Documentation Index
Fetch the complete documentation index at: https://docs.chipipay.com/llms.txt
Use this file to discover all available pages before exploring further.
Usage
Parameters
The hook accepts an object with:params(RecordSendTransactionParams):transactionHash(string): The hash of the transaction to recordchain(Chain): The blockchain network. UseChain.STARKNETexpectedSender(string): The expected sender wallet addressexpectedRecipient(string): The expected recipient wallet addressexpectedToken(ChainToken): The expected token. UseChainToken.USDCexpectedAmount(string): The expected transaction amount
bearerToken(string): Bearer token for authentication
Return Value
Returns an object containing:recordSendTransaction: Function to record transaction (fire-and-forget)recordSendTransactionAsync: Promise-based function that resolves with the transaction recorddata: The recorded transaction data (Transaction | undefined)isLoading: Boolean indicating if the operation is in progressisError: Boolean indicating if an error occurrederror: Error instance whenisErroris true, otherwisenullisSuccess: Boolean indicating if the recording completed successfullyreset: Function to reset the mutation state
Example Implementation
Security Considerations
- Always verify recipient addresses
- Use encrypted private keys
- Implement proper PIN validation
- Monitor transaction status
Error Handling
- Handle insufficient token balance
- Validate wallet addresses
- Monitor gas fees
- Implement retry logic for failed transactions
Always verify recipient addresses. Transfers on StarkNet are irreversible.
Related Hooks
- useTransfer - Execute the transfer before recording it
- useGetTransactionList - List all recorded transactions
