Skip to content
Alchemy Logo

useSolanaTransaction

function 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.

import { useSolanaTransaction } from "@account-kit/react";
 
const { mutate } = useSolanaTransaction({
  policyId: "<policyId>",
});
 
mutate({
  transfer: {
    amount: 0,
    toAddress: "<toAddress>",
  },
});

ParameterTypeDescription

opts

SolanaTransactionHookParams

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

SolanaTransaction

The transaction hook.

Was this page helpful?