@vue-solana/core 4.1.8 → 4.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -12,4 +12,4 @@ export { createSolanaPayReference, findTransactionSignaturesByReference, verifyS
|
|
|
12
12
|
export { getSolanaPayPaymentStatus } from './solana-pay-status.mjs';
|
|
13
13
|
export * from '@solana/kit';
|
|
14
14
|
export { C as CreateTransferError, H as HTTPS_PROTOCOL, M as MEMO_PROGRAM_ID, P as ParseURLError, S as SOLANA_PROTOCOL, a as SOL_DECIMALS, T as TEN, b as TOKEN_PROGRAM_ID, c as createQR, d as createQRCanvas, e as createQRDataURL, f as createQROptions, g as createRecipient, h as createSPLToken, i as createStyledQRCode, j as encodeTransactionRequestURL, k as encodeTransferRequestURL, l as encodeURL, m as isValidSolanaAddress, p as parseURL } from './shared/core.CQFtdLrA.mjs';
|
|
15
|
-
export { S as SOLANA_CHAINS, a as SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, b as adaptSolanaStandardWallet, d as disconnectSolanaStandardWallet, g as getRegisteredSolanaWallets, c as getSolanaChain, i as isSolanaStandardWallet, s as subscribeSolanaWallets } from './shared/core.
|
|
15
|
+
export { S as SOLANA_CHAINS, a as SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, b as adaptSolanaStandardWallet, d as disconnectSolanaStandardWallet, g as getRegisteredSolanaWallets, c as getSolanaChain, i as isSolanaStandardWallet, s as subscribeSolanaWallets } from './shared/core.BUkDk-YR.mjs';
|
|
@@ -130,6 +130,12 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
130
130
|
return signedTransactions;
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
+
function shouldSignThenSend(transactionCount) {
|
|
134
|
+
if (!isMobileWalletAdapter || !options.sendTransaction || !hasSignTransaction(wallet)) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
return transactionCount > 1 || Boolean(getMobileWalletSession()?.signTransactions);
|
|
138
|
+
}
|
|
133
139
|
function signAndSendTransactionsThroughWallet(activeAccount, transactions, sendOptions) {
|
|
134
140
|
const signAndSendTransactions = getMobileWalletSession()?.signAndSendTransactions;
|
|
135
141
|
return whileMobileWalletAuthorized(async () => {
|
|
@@ -357,6 +363,18 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
357
363
|
signAllTransactions: hasSignTransaction(wallet) ? async (transactions) => signTransactionsThroughWallet(getActiveAccount(account), transactions) : void 0,
|
|
358
364
|
signTransactions: hasSignTransaction(wallet) ? async (transactions) => signTransactionsThroughWallet(getActiveAccount(account), transactions) : void 0,
|
|
359
365
|
signAndSendTransaction: hasSignAndSendTransaction(wallet) ? async (transaction, sendOptions) => {
|
|
366
|
+
if (options.sendTransaction && shouldSignThenSend(1)) {
|
|
367
|
+
const [signedTransaction] = await signTransactionsThroughWallet(
|
|
368
|
+
getActiveAccount(account),
|
|
369
|
+
[transaction]
|
|
370
|
+
);
|
|
371
|
+
return {
|
|
372
|
+
signature: await options.sendTransaction(
|
|
373
|
+
signedTransaction,
|
|
374
|
+
sendOptions
|
|
375
|
+
)
|
|
376
|
+
};
|
|
377
|
+
}
|
|
360
378
|
const [signature] = await signAndSendTransactionsThroughWallet(
|
|
361
379
|
getActiveAccount(account),
|
|
362
380
|
[transaction],
|
|
@@ -369,7 +387,7 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
369
387
|
} : void 0,
|
|
370
388
|
signAndSendTransactions: hasSignAndSendTransaction(wallet) ? async (transactions, sendOptions) => {
|
|
371
389
|
const activeAccount = getActiveAccount(account);
|
|
372
|
-
if (
|
|
390
|
+
if (options.sendTransaction && shouldSignThenSend(transactions.length)) {
|
|
373
391
|
const signedTransactions = await signTransactionsThroughWallet(
|
|
374
392
|
activeAccount,
|
|
375
393
|
transactions
|
package/dist/wallet-standard.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { S as SOLANA_CHAINS, a as SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, b as adaptSolanaStandardWallet, d as disconnectSolanaStandardWallet, g as getRegisteredSolanaWallets, c as getSolanaChain, i as isSolanaStandardWallet, s as subscribeSolanaWallets } from './shared/core.
|
|
1
|
+
export { S as SOLANA_CHAINS, a as SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, b as adaptSolanaStandardWallet, d as disconnectSolanaStandardWallet, g as getRegisteredSolanaWallets, c as getSolanaChain, i as isSolanaStandardWallet, s as subscribeSolanaWallets } from './shared/core.BUkDk-YR.mjs';
|