signAndSendTransaction: Sign and send a transaction. Sponsors gas automatically when SVM Gas Sponsorship is enabled in project settings and the wallet supports it; otherwise sends a regular transaction.signAndSendSponsoredTransaction: Sign and send a sponsored transaction. Throws if sponsorship is not available.signTransaction: Sign a transactionsignAllTransactions: Sign multiple transactions
Usage
- JavaScript
- React
Gas Sponsorship
signAndSendTransaction honors the project’s SVM gas sponsorship setting by default. When sponsorship is enabled in the dashboard and the wallet provider supports it (embedded V3 MPC wallets), the transaction is sponsored automatically. Otherwise, it sends a regular transaction.
Use the sponsorshipMode option to control this behavior on a per-call basis:
'auto'(default): sponsor when project settings and the wallet support it, otherwise send a regular transaction.'off': never sponsor, regardless of project settings.
signAndSendSponsoredTransaction instead. See SVM Gas Sponsorship for details.
Error Handling
-
If the specified wallet account is not a
SolanaWalletAccount, it will throw aNotSolanaProviderErrorerror. -
If the specified wallet account is not available for signing (e.g. wallet is an external wallet and the specific account is not the active one in the wallet app, or not connected to your app),
it will throw a
WalletAccountNotSelectedErrorerror, stating what is the expected account address to be used, and the active account address in the wallet app (if available). -
If
signAndSendSponsoredTransactionis called on a wallet that does not support sponsorship (e.g. an external wallet), it will throw aSponsorTransactionError.