@solana/wallet-adapter-base
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -26,2 +26,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let emit = true; | ||
try { | ||
@@ -38,4 +39,7 @@ try { | ||
catch (error) { | ||
if (error instanceof WalletError) | ||
// If the error was thrown by `signTransaction`, rethrow it and don't emit a duplicate event | ||
if (error instanceof WalletError) { | ||
emit = false; | ||
throw error; | ||
} | ||
throw new WalletSendTransactionError(error === null || error === void 0 ? void 0 : error.message, error); | ||
@@ -45,3 +49,5 @@ } | ||
catch (error) { | ||
this.emit('error', error); | ||
if (emit) { | ||
this.emit('error', error); | ||
} | ||
throw error; | ||
@@ -48,0 +54,0 @@ } |
{ | ||
"name": "@solana/wallet-adapter-base", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"author": "Solana Maintainers <maintainers@solana.foundation>", | ||
@@ -32,3 +32,3 @@ "repository": "https://github.com/solana-labs/wallet-adapter", | ||
}, | ||
"gitHead": "ec6efb647304d3655c95909d3f998f8fc0baf6d5" | ||
"gitHead": "606551691ad84e11a7ebe91f432f113edeb8069c" | ||
} |
@@ -18,2 +18,3 @@ import { Connection, Transaction, TransactionSignature } from '@solana/web3.js'; | ||
): Promise<TransactionSignature> { | ||
let emit = true; | ||
try { | ||
@@ -34,7 +35,13 @@ try { | ||
} catch (error: any) { | ||
if (error instanceof WalletError) throw error; | ||
// If the error was thrown by `signTransaction`, rethrow it and don't emit a duplicate event | ||
if (error instanceof WalletError) { | ||
emit = false; | ||
throw error; | ||
} | ||
throw new WalletSendTransactionError(error?.message, error); | ||
} | ||
} catch (error: any) { | ||
this.emit('error', error); | ||
if (emit) { | ||
this.emit('error', error); | ||
} | ||
throw error; | ||
@@ -41,0 +48,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35503
498