Deliver funds from an escrow to the recipient.
{
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"TransactionType": "EscrowFinish",
"Owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"OfferSequence": 7,
"Condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100",
"Fulfillment": "A0028000"
}In addition to the common fields, EscrowFinish transactions use the following fields:
| Field | JSON Type | Internal Type | Required? | Description |
|---|---|---|---|---|
Owner | String - Address | AccountID | Yes | The source account that funded the escrow. |
OfferSequence | Number | UInt32 | Yes | Transaction sequence of EscrowCreate transaction that created the escrow to finish. |
Condition | String - Hexadecimal | Blob | No | The (previously-supplied) PREIMAGE-SHA-256 crypto-condition of the escrow. |
CredentialIDs | Array of Strings | Vector256 | No | Set of Credentials to authorize a deposit made by this transaction. Each member of the array must be the ledger entry ID of a Credential entry in the ledger. For details, see Credential IDs. (Requires the Credentials amendment. |
Fulfillment | String - Hexadecmial | Blob | No | The PREIMAGE-SHA-256 crypto-condition fulfillment matching the escrow's Condition. If present, must not be empty. |
Gas | Number | UInt32 | No | The maximum amount of gas that this transaction can use to execute the escrow's smart function, if it has one. Required if the escrow has a Bytecode field; must be omitted otherwise. (Requires the SmartEscrow amendment. |
Any account may submit an EscrowFinish transaction.
- If the escrow has a
FinishAftertime, you cannot execute it before this time. Specifically, if the corresponding EscrowCreate transaction specified aFinishAftertime that is after the close time of the most recently-closed ledger, the EscrowFinish transaction fails. - If the escrow has a
Condition, you cannot execute it unless you provide a matchingFulfillmentfor the condition. - If the escrow has a
Bytecodewith a smart function, the smart function must return success for the escrow to execute. If the smart function does not return success, the transaction fails with moving funds, but can modify the escrow entry'sDatafield.(Requires the SmartEscrow amendment.
)
- You cannot execute an escrow after it has expired. Specifically, if the corresponding EscrowCreate transaction specified a
CancelAftertime that is before the close time of the most recently-closed ledger, the EscrowFinish transaction fails.
On test networks created before rippled version 1.6.0 (released in 2017), it may be possible to delete the destination account of a pending escrow. In this case, an attempt to finish the escrow fails with the result tecNO_TARGET, but the escrow remains unless it has expired normally. If another payment re-creates the destination account, the escrow can be finished successfully. The destination account of an escrow can only be deleted if the escrow was created before the fix1523 amendment became enabled. No such escrows exist on the XRP Ledger Mainnet, so this edge case is not possible on Mainnet or any test networks created using rippled version 1.6.0 or later.
The minimum transaction cost to submit an EscrowFinish transaction increases if it contains a fulfillment. If the transaction has no fulfillment, the transaction cost is the standard ledger base fee, typically 10 drops. If the transaction contains a fulfillment, the transaction cost is 330 drops of XRP plus another 10 drops for every 16 bytes in size of the preimage. If the validators vote to increase or lower the base fee, the cost per 16 bytes is adjusted accordingly. The exact formula is:
(32 + ceiling(preimage_size ÷ 16)) × base_feebase_feeis the base transaction fee (typically 10 drops)preimage_sizeis the size of the fulfillment in bytesceilingis the ceiling function, meaning to round up to the nearest integer
When the escrow to be finished contains a smart function, the EscrowFinish transaction's metadata includes the following additional fields:
| Field | JSON Type | Internal Type | Description |
|---|---|---|---|
GasUsed | Number | UInt32 | The amount of gas actually used in executing the smart function. This affects the amount of XRP burned by the transaction sender. |
VMReturnCode | Number | Int32 | The return code from the smart function. |
Besides errors that can occur for all transactions, EscrowFinish transactions can result in the following transaction result codes:
| Error Code | Description |
|---|---|
tecBYTECODE_REJECTED | The escrow's smart function did not return success. It may have returned 0 or a negative value, or thrown an error. (Requires the SmartEscrow amendment. |
tecCRYPTOCONDITION_ERROR | The crypto-condition check failed. This can happen when:
|
tecFROZEN | The destination's trust line for the escrowed trust line token is deep frozen. (Requires the TokenEscrow amendment. |
tecINSUFFICIENT_RESERVE | Unable to create a trust line or MPToken entry due to lack of reserves. (Requires the TokenEscrow amendment. |
tecLOCKED | The destination's MPToken entry for the escrowed MPT is locked. (Requires the TokenEscrow amendment. |
tecNO_AUTH | Authorization requirements were not met. For example, the issuer requires authorization and the destination is not authorized. (Requires the TokenEscrow amendment. |
tecNO_DST | The escrow's destination account does not exist. |
tecNO_ENTRY | The destination account does not have an MPToken entry to hold the escrowed MPT. (Requires the TokenEscrow amendment. |
tecNO_LINE | The destination account does not have a trust line to hold the escrowed trust line token. (Requires the TokenEscrow amendment. |
tecNO_PERMISSION | The time-based conditions to finish the escrow haven't been met or the escrow is expired. Alternatively, the escrow's destination requires Deposit Authorization and this transaction was not sent by the destination account nor authorized with the appropriate preauthorization or credentials. (Requires the Credentials amendment. |
tecNO_TARGET | The specified escrow does not exist. |
tecOBJECT_NOT_FOUND | The MPT issuance does not exist for the escrowed MPT. (Requires the TokenEscrow amendment. |
tefNO_BYTECODE | The transaction specified a Gas field but the escrow does not have a smart function. (Requires the SmartEscrow amendment. |
tefBYTECODE_NOT_INCLUDED | The transaction did not specify a Gas field, but escrow has a smart function so it requires gas to run. (Requires the SmartEscrow amendment. |
temBAD_LIMIT | The Gas field of the transaction is 0 or is larger than the network's current gas limit. (Requires the SmartEscrow amendment. |
temTEMP_DISABLED | Smart functions have been temporarily disabled by fee voting. (Requires the SmartEscrow amendment. |