useSolanaTransaction

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.

Import

1import { useSolanaTransaction } from "@account-kit/react";

Usage

1const {mutate} = useSolanaTransaction({
2policyId: "<policyId>",
3});
4
5mutate({
6transfer: {
7amount: <amount:number>,
8toAddress: "<toAddress>",
9},

Parameters

opts

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

Returns

SolanaTransaction The transaction hook.