From 3ba21bd8c42318f37ddadea9e39c72beca02eebd Mon Sep 17 00:00:00 2001 From: Fernando Gonzalez Goncharov Date: Fri, 6 Dec 2024 12:25:30 +0200 Subject: [PATCH] feat(server-dapp-sdk): update namings --- packages/idos-sdk-server-dapp/src/idOS-grantee.ts | 14 +++++++------- packages/idos-sdk-server-dapp/src/idOS.ts | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/idos-sdk-server-dapp/src/idOS-grantee.ts b/packages/idos-sdk-server-dapp/src/idOS-grantee.ts index 94b987544..34ec1323d 100644 --- a/packages/idos-sdk-server-dapp/src/idOS-grantee.ts +++ b/packages/idos-sdk-server-dapp/src/idOS-grantee.ts @@ -86,7 +86,7 @@ const buildKwilSignerAndGrantee = ( }; interface idOSGranteeInitParams { - encryptionSecret: string; + encryptionPrivateKey: string; nodeUrl?: string; chainId?: string; dbId?: string; @@ -109,7 +109,7 @@ export class idOSGrantee { grants?: GrantChild; static async init(_: { - encryptionSecret: string; + encryptionPrivateKey: string; nodeUrl?: string; chainId?: string; dbId?: string; @@ -119,7 +119,7 @@ export class idOSGrantee { }): Promise; static async init(_: { - encryptionSecret: string; + encryptionPrivateKey: string; nodeUrl?: string; chainId?: string; dbId?: string; @@ -129,7 +129,7 @@ export class idOSGrantee { }): Promise; static async init({ - encryptionSecret, + encryptionPrivateKey, nodeUrl = KwilWrapper.defaults.kwilProvider, chainId, dbId, @@ -173,7 +173,7 @@ export class idOSGrantee { } return new idOSGrantee( - NoncedBox.fromBase64SecretKey(encryptionSecret), + NoncedBox.fromBase64SecretKey(encryptionPrivateKey), nodeKwil, kwilSigner, dbId, @@ -250,8 +250,8 @@ export class idOSGrantee { if (!this.grants) throw new Error("NEAR is not implemented yet"); return this.grants.list({ - owner: address, - grantee: this.grantee, + ownerAddress: address, + granteeAddress: this.grantee, }); } diff --git a/packages/idos-sdk-server-dapp/src/idOS.ts b/packages/idos-sdk-server-dapp/src/idOS.ts index 11439338f..6ad0f8939 100644 --- a/packages/idos-sdk-server-dapp/src/idOS.ts +++ b/packages/idos-sdk-server-dapp/src/idOS.ts @@ -10,28 +10,28 @@ export class idOS { static async init( chainType: "EVM" | "NEAR", - privateKey: string, - encryptionSecretKey: string, + authnPrivateKey: string, + encryptionPrivateKey: string, nodeUrl: string, ) { let grantee: idOSGrantee; switch (chainType) { case "EVM": { - const signer = new ethers.Wallet(privateKey, new JsonRpcProvider(nodeUrl)); + const signer = new ethers.Wallet(authnPrivateKey, new JsonRpcProvider(nodeUrl)); grantee = await idOSGrantee.init({ chainType, granteeSigner: signer, - encryptionSecret: encryptionSecretKey, + encryptionPrivateKey, }); return new idOS(grantee); } case "NEAR": { - const signer = KeyPair.fromString(privateKey); + const signer = KeyPair.fromString(authnPrivateKey); grantee = await idOSGrantee.init({ chainType, granteeSigner: signer, - encryptionSecret: privateKey, + encryptionPrivateKey: authnPrivateKey, }); return new idOS(grantee); }