useSolanaTransaction

1function useSolanaTransaction(opts): SolanaTransaction;

Defined in: account-kit/react/src/hooks/useSolanaTransaction.ts:124

This is the hook that will be used to send a transaction. It will prioritize external connected Solana wallets, falling back to the internal signer when not connected. Supports sponsorship for both external wallets and internal signers.

Example

import { 
function useSolanaTransaction(opts?: SolanaTransactionHookParams): SolanaTransaction

This is the hook that will be used to send a transaction. It will prioritize external connected Solana wallets, falling back to the internal signer when not connected. Supports sponsorship for both external wallets and internal signers.

useSolanaTransaction
} from "@account-kit/react";
const {
const mutate: any
mutate
} =
function useSolanaTransaction(opts?: SolanaTransactionHookParams): SolanaTransaction

This is the hook that will be used to send a transaction. It will prioritize external connected Solana wallets, falling back to the internal signer when not connected. Supports sponsorship for both external wallets and internal signers.

useSolanaTransaction
({
policyId?: string | void | undefined
policyId
: "<policyId>",
});
const mutate: any
mutate
({
transfer: { amount: number; toAddress: string; }
transfer
: {
amount: number
amount
: 0,
toAddress: string
toAddress
: "<toAddress>",
}, });

Parameters

ParameterTypeDescription

opts

SolanaTransactionHookParams

Options for the hook to get setup, The transaction is required.

Returns

SolanaTransaction

The transaction hook.