@solana/wallet-adapter-coinbase
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -11,2 +11,13 @@ "use strict"; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -118,17 +129,18 @@ exports.CoinbaseWalletAdapter = exports.CoinbaseWalletName = void 0; | ||
} | ||
sendTransaction(transaction, connection, options) { | ||
sendTransaction(transaction, connection, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const wallet = this._wallet; | ||
const publicKey = this.publicKey; | ||
if (!wallet || !publicKey) | ||
if (!wallet) | ||
throw new wallet_adapter_base_1.WalletNotConnectedError(); | ||
try { | ||
transaction.feePayer = transaction.feePayer || publicKey; | ||
transaction.recentBlockhash = | ||
transaction.recentBlockhash || (yield connection.getRecentBlockhash('finalized')).blockhash; | ||
const { signature } = yield wallet.signAndSendTransaction(transaction, options); | ||
transaction = yield this.prepareTransaction(transaction, connection); | ||
const { signers } = options, sendOptions = __rest(options, ["signers"]); | ||
(signers === null || signers === void 0 ? void 0 : signers.length) && transaction.partialSign(...signers); | ||
const { signature } = yield wallet.signAndSendTransaction(transaction, sendOptions); | ||
return signature; | ||
} | ||
catch (error) { | ||
if (error instanceof wallet_adapter_base_1.WalletError) | ||
throw error; | ||
throw new wallet_adapter_base_1.WalletSendTransactionError(error === null || error === void 0 ? void 0 : error.message, error); | ||
@@ -135,0 +147,0 @@ } |
{ | ||
"name": "@solana/wallet-adapter-coinbase", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"author": "Solana Maintainers <maintainers@solana.foundation>", | ||
@@ -38,3 +38,3 @@ "repository": "https://github.com/solana-labs/wallet-adapter", | ||
}, | ||
"gitHead": "b4e2ac67dab0d8dadb4b0d49a456c63aa29b5663" | ||
"gitHead": "3647ee8dbe5f19aa4821dd97e58b0be02ae50646" | ||
} |
@@ -10,2 +10,3 @@ import { | ||
WalletDisconnectionError, | ||
WalletError, | ||
WalletName, | ||
@@ -54,2 +55,3 @@ WalletNotConnectedError, | ||
'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSI1MTIiIGN5PSI1MTIiIHI9IjUxMiIgZmlsbD0iIzAwNTJGRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1MiA1MTJDMTUyIDcxMC44MjMgMzEzLjE3NyA4NzIgNTEyIDg3MkM3MTAuODIzIDg3MiA4NzIgNzEwLjgyMyA4NzIgNTEyQzg3MiAzMTMuMTc3IDcxMC44MjMgMTUyIDUxMiAxNTJDMzEzLjE3NyAxNTIgMTUyIDMxMy4xNzcgMTUyIDUxMlpNNDIwIDM5NkM0MDYuNzQ1IDM5NiAzOTYgNDA2Ljc0NSAzOTYgNDIwVjYwNEMzOTYgNjE3LjI1NSA0MDYuNzQ1IDYyOCA0MjAgNjI4SDYwNEM2MTcuMjU1IDYyOCA2MjggNjE3LjI1NSA2MjggNjA0VjQyMEM2MjggNDA2Ljc0NSA2MTcuMjU1IDM5NiA2MDQgMzk2SDQyMFoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo='; | ||
private _connecting: boolean; | ||
@@ -68,2 +70,3 @@ private _wallet: CoinbaseWallet | null; | ||
this._publicKey = null; | ||
if (this._readyState !== WalletReadyState.Unsupported) { | ||
@@ -157,17 +160,18 @@ scopePollingDetectionStrategy(() => { | ||
connection: Connection, | ||
options?: SendTransactionOptions | ||
options: SendTransactionOptions = {} | ||
): Promise<TransactionSignature> { | ||
try { | ||
const wallet = this._wallet; | ||
const publicKey = this.publicKey; | ||
if (!wallet || !publicKey) throw new WalletNotConnectedError(); | ||
if (!wallet) throw new WalletNotConnectedError(); | ||
try { | ||
transaction.feePayer = transaction.feePayer || publicKey; | ||
transaction.recentBlockhash = | ||
transaction.recentBlockhash || (await connection.getRecentBlockhash('finalized')).blockhash; | ||
transaction = await this.prepareTransaction(transaction, connection); | ||
const { signature } = await wallet.signAndSendTransaction(transaction, options); | ||
const { signers, ...sendOptions } = options; | ||
signers?.length && transaction.partialSign(...signers); | ||
const { signature } = await wallet.signAndSendTransaction(transaction, sendOptions); | ||
return signature; | ||
} catch (error: any) { | ||
if (error instanceof WalletError) throw error; | ||
throw new WalletSendTransactionError(error?.message, error); | ||
@@ -174,0 +178,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
51415
643