diff --git a/packages/sdk/src/transaction/AuroSigner.ts b/packages/sdk/src/transaction/AuroSigner.ts index 40a6d99b..d01dd351 100644 --- a/packages/sdk/src/transaction/AuroSigner.ts +++ b/packages/sdk/src/transaction/AuroSigner.ts @@ -7,9 +7,16 @@ import { Signer } from "./InMemorySigner"; @injectable() export class AuroSigner extends AppChainModule implements Signer { public async sign(message: Field[]): Promise { + try { const response = await (window as any).mina.signFields({ message: message.map((field) => field.toString()), }); return Signature.fromBase58(response.signature); - } + } catch (e: any) { + if (e?.code == 1001) { + await (window as any).mina.requestAccounts(); + return await this.sign(message); + } + throw e; + }} }