diff --git a/package.json b/package.json index ed2fcbf87..f2650a53d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "near-wallet-selector", - "version": "3.0.0", + "version": "3.0.1", "description": "This is a wallet modal that allows users to interact with NEAR dApps with a selection of available wallets.", "keywords": [ "near", diff --git a/packages/core/package.json b/packages/core/package.json index df7e4ec4a..7c62762b0 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,4 +1,4 @@ { "name": "@near-wallet-selector/core", - "version": "3.0.0" + "version": "3.0.1" } diff --git a/packages/ledger/package.json b/packages/ledger/package.json index e8ff4ee40..0f942b04c 100644 --- a/packages/ledger/package.json +++ b/packages/ledger/package.json @@ -1,4 +1,4 @@ { "name": "@near-wallet-selector/ledger", - "version": "3.0.0" + "version": "3.0.1" } diff --git a/packages/math-wallet/package.json b/packages/math-wallet/package.json index 265c7220d..b7d1bd230 100644 --- a/packages/math-wallet/package.json +++ b/packages/math-wallet/package.json @@ -1,4 +1,4 @@ { "name": "@near-wallet-selector/math-wallet", - "version": "3.0.0" + "version": "3.0.1" } diff --git a/packages/near-wallet/package.json b/packages/near-wallet/package.json index d9515be4a..4d3a438eb 100644 --- a/packages/near-wallet/package.json +++ b/packages/near-wallet/package.json @@ -1,4 +1,4 @@ { "name": "@near-wallet-selector/near-wallet", - "version": "3.0.0" + "version": "3.0.1" } diff --git a/packages/sender/package.json b/packages/sender/package.json index 354786f47..1206a6b14 100644 --- a/packages/sender/package.json +++ b/packages/sender/package.json @@ -1,4 +1,4 @@ { "name": "@near-wallet-selector/sender", - "version": "3.0.0" + "version": "3.0.1" } diff --git a/packages/sender/src/lib/injected-sender.ts b/packages/sender/src/lib/injected-sender.ts index 6ea245bdd..07380f5fe 100644 --- a/packages/sender/src/lib/injected-sender.ts +++ b/packages/sender/src/lib/injected-sender.ts @@ -13,7 +13,11 @@ interface AccessKey { export interface RequestSignInResponse { accessKey: AccessKey; - error: string; + error: + | string + | { + type: string; + }; notificationId: number; type: "sender-wallet-result"; } diff --git a/packages/sender/src/lib/sender.ts b/packages/sender/src/lib/sender.ts index 8cfb16883..41b908ae6 100644 --- a/packages/sender/src/lib/sender.ts +++ b/packages/sender/src/lib/sender.ts @@ -151,13 +151,16 @@ export function setupSender({ await this.init(); } - const { accessKey } = await wallet.requestSignIn({ + const { accessKey, error } = await wallet.requestSignIn({ contractId: options.contractId, methodNames: options.methodNames, }); - if (!accessKey) { - throw new Error("Failed to sign in"); + if (!accessKey || error) { + throw new Error( + (typeof error === "string" ? error : error.type) || + "Failed to sign in" + ); } updateState((prevState) => ({ diff --git a/packages/wallet-connect/package.json b/packages/wallet-connect/package.json index d2d0debb3..cbc8c3fb4 100644 --- a/packages/wallet-connect/package.json +++ b/packages/wallet-connect/package.json @@ -1,4 +1,4 @@ { "name": "@near-wallet-selector/wallet-connect", - "version": "3.0.0" + "version": "3.0.1" }