prepare
Concepts
Section titled “Concepts”Behaviour
Section titled “Behaviour”- 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.
Definition
Section titled “Definition”function prepare( txJson: Record<string, any> | Transaction ): ErrorCode | Record<string, any> | Transaction
Example
Section titled “Example”const prepared_txn = prepare({ TransactionType: "Payment", Destination: util_raddr(p1address_ns), Amount: parseFloat(drops_sent)*2 })
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
txJson | Record<string, any> | Transaction | The transaction JSON, must be a complete transaction except for Account (always the Hook account). |
Return Code
Section titled “Return Code”Type | Description |
---|---|
ErrorCode | Record<string, any> | Transaction | Returns an ErrorCode if there is an error, or the prepared transaction JSON or Transaction object. |