Skip to content

Commit

Permalink
Fix Client.addAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
rygine committed Nov 23, 2024
1 parent 3b67c81 commit 29a1da2
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions sdks/node-sdk/src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,10 @@ export class Client {
}
}

async #addAccountSignatureText(
existingAccountAddress: string,
newAccountAddress: string,
) {
async #addAccountSignatureText(newAccountAddress: string) {
try {
const signatureText = await this.#innerClient.addWalletSignatureText(
existingAccountAddress,
newAccountAddress,
);
const signatureText =
await this.#innerClient.addWalletSignatureText(newAccountAddress);
return signatureText;
} catch {
return null;
Expand Down Expand Up @@ -257,20 +252,13 @@ export class Client {

async addAccount(newAccountSigner: Signer) {
const signatureText = await this.#addAccountSignatureText(
await this.#signer.getAddress(),
await newAccountSigner.getAddress(),
);

if (!signatureText) {
throw new Error("Unable to generate add account signature text");
}

await this.#addSignature(
SignatureRequestType.AddWallet,
signatureText,
this.#signer,
);

await this.#addSignature(
SignatureRequestType.AddWallet,
signatureText,
Expand Down

0 comments on commit 29a1da2

Please sign in to comment.