Skip to content

prepare

Transactions
  • This function takes a transaction JSON object and prepares it for emission.
  • The transaction must be complete except for the Account field, which should always be the Hook account.
function prepare(
txJson: Record<string, any> | Transaction
): ErrorCode | Record<string, any> | Transaction
const prepared_txn = prepare({
TransactionType: "Payment",
Destination: util_raddr(p1address_ns),
Amount: parseFloat(drops_sent)*2
})
NameTypeDescription
txJsonRecord<string, any> | TransactionThe transaction JSON, must be a complete transaction except for Account (always the Hook account).
TypeDescription
ErrorCode | Record<string, any> | TransactionReturns an ErrorCode if there is an error, or the prepared transaction JSON or Transaction object.