AvaCloud API
AvaCloud App
AvaCloud Wallet as a Service
AvaCloud Wallet as a Service
  • AvaCloud Wallet as a Service SDK
  • 🚀Getting Started
    • Quickstart
  • ⚙️USAGE
    • 🪝Hooks
      • useAvaCloudWallet
      • useAuth
      • useSignMessage
      • useSignTransaction
      • useTransferTokens
      • useUserWallets
      • useChainId
    • UI Components
      • LoginButton
      • WalletButton
      • WalletDisplay
      • UserProfile
      • WalletCard
      • TokensView
      • SendView
      • ReceiveView
      • ExportView
    • 🛠️Advanced Usage
Powered by GitBook

© 2025 Ava Labs, Inc.

On this page

Was this helpful?

  1. USAGE
  2. Hooks

useSignTransaction

Hook for signing transactions with the connected wallet.

import { useSignTransaction } from '@avalabs/avacloud-waas-react';

function TransactionSigner() {
  const { signTransaction, isLoading, error } = useSignTransaction();

  const handleSignTx = async () => {
    try {
      const signedTx = await signTransaction({
        to: '0x...',
        value: '0.1',
        data: '0x...',
      });
      console.log('Signed transaction:', signedTx);
    } catch (error) {
      console.error('Error signing transaction:', error);
    }
  };

  return (
    <button onClick={handleSignTx}>
      Sign Transaction
    </button>
  );
}

Returns

  • signTransaction: (transaction: Transaction) => Promise<string> - Function to sign a transaction

  • isLoading: boolean - Loading state during transaction signing

  • error: Error | null - Error state if signing fails

PrevioususeSignMessageNextuseTransferTokens

Last updated 28 days ago

Was this helpful?

⚙️
🪝