useSendTransaction
Most Trustless Work endpoints return an unsigned transaction in XDR format. This endpoint is used to sign such unsigned transactions and send them to the Stellar network.
useSendTransaction
Submit a signed transaction XDR to Core. Call this after any operate hook returns unsignedXdr and your wallet has signed it.
Import
import { useSendTransaction } from "@trustless-work/escrow";
// or
import { useSendTransaction } from "@trustless-work/escrow/hooks/rest";Signature
function useSendTransaction(): {
sendTransaction: (signedXdr: string) => Promise<SendTransactionResponse>;
};Returns SendTransactionResponse:
Field
Type
Notes
txHash
string
On-chain transaction hash
ledger
number
Ledger number
contractId?
string
Present on factory deploy confirmation
escrow?
Escrow | EscrowSummary
Optional snapshot after submit
code?
SendTransactionCode
STELLAR_TX_SUBMITTED or STELLAR_TX_SUBMITTED_INDEXER_LAGGING
message?
string
Human-readable note
Example
See Operate for the full mutate catalog.