@solana/wallet-adapter-base
Advanced tools
Comparing version 0.9.10 to 0.9.11
@@ -52,3 +52,3 @@ "use strict"; | ||
} | ||
prepareTransaction(transaction, connection) { | ||
prepareTransaction(transaction, connection, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -59,3 +59,5 @@ const publicKey = this.publicKey; | ||
transaction.feePayer = transaction.feePayer || publicKey; | ||
transaction.recentBlockhash = transaction.recentBlockhash || (yield connection.getLatestBlockhash()).blockhash; | ||
transaction.recentBlockhash = | ||
transaction.recentBlockhash || | ||
(yield connection.getLatestBlockhash(options === null || options === void 0 ? void 0 : options.preflightCommitment)).blockhash; | ||
return transaction; | ||
@@ -62,0 +64,0 @@ }); |
@@ -32,4 +32,4 @@ "use strict"; | ||
try { | ||
transaction = yield this.prepareTransaction(transaction, connection); | ||
const { signers } = options, sendOptions = __rest(options, ["signers"]); | ||
transaction = yield this.prepareTransaction(transaction, connection, sendOptions); | ||
(signers === null || signers === void 0 ? void 0 : signers.length) && transaction.partialSign(...signers); | ||
@@ -36,0 +36,0 @@ transaction = yield this.signTransaction(transaction); |
@@ -69,4 +69,4 @@ import type { Connection, PublicKey, SendOptions, Signer, Transaction, TransactionSignature } from '@solana/web3.js'; | ||
abstract sendTransaction(transaction: Transaction, connection: Connection, options?: SendTransactionOptions): Promise<TransactionSignature>; | ||
protected prepareTransaction(transaction: Transaction, connection: Connection): Promise<Transaction>; | ||
protected prepareTransaction(transaction: Transaction, connection: Connection, options?: SendOptions): Promise<Transaction>; | ||
} | ||
export declare function scopePollingDetectionStrategy(detect: () => boolean): void; |
{ | ||
"name": "@solana/wallet-adapter-base", | ||
"version": "0.9.10", | ||
"version": "0.9.11", | ||
"author": "Solana Maintainers <maintainers@solana.foundation>", | ||
@@ -14,4 +14,5 @@ "repository": "https://github.com/solana-labs/wallet-adapter", | ||
".": { | ||
"require": "./lib/cjs/index.js", | ||
"import": "./lib/esm/index.mjs", | ||
"require": "./lib/cjs/index.js" | ||
"types": "./lib/types/index.d.ts" | ||
}, | ||
@@ -42,3 +43,3 @@ "./package.json": "./package.json" | ||
}, | ||
"gitHead": "29b57115d1fd7bf097f14ca82cbb1c96e65b8372" | ||
"gitHead": "dfe6f0cd3cd8a6430aab3bc82049d58d8e41ce09" | ||
} |
@@ -92,3 +92,7 @@ import type { Connection, PublicKey, SendOptions, Signer, Transaction, TransactionSignature } from '@solana/web3.js'; | ||
protected async prepareTransaction(transaction: Transaction, connection: Connection): Promise<Transaction> { | ||
protected async prepareTransaction( | ||
transaction: Transaction, | ||
connection: Connection, | ||
options: SendOptions = {} | ||
): Promise<Transaction> { | ||
const publicKey = this.publicKey; | ||
@@ -98,3 +102,5 @@ if (!publicKey) throw new WalletNotConnectedError(); | ||
transaction.feePayer = transaction.feePayer || publicKey; | ||
transaction.recentBlockhash = transaction.recentBlockhash || (await connection.getLatestBlockhash()).blockhash; | ||
transaction.recentBlockhash = | ||
transaction.recentBlockhash || | ||
(await connection.getLatestBlockhash(options?.preflightCommitment)).blockhash; | ||
@@ -101,0 +107,0 @@ return transaction; |
@@ -22,5 +22,6 @@ import type { Connection, Transaction, TransactionSignature } from '@solana/web3.js'; | ||
try { | ||
transaction = await this.prepareTransaction(transaction, connection); | ||
const { signers, ...sendOptions } = options; | ||
const { signers, ...sendOptions } = options; | ||
transaction = await this.prepareTransaction(transaction, connection, sendOptions); | ||
signers?.length && transaction.partialSign(...signers); | ||
@@ -27,0 +28,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
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
61668
946