mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-25 14:15:50 +00:00
Update escrow documentation
This commit is contained in:
@@ -73,6 +73,7 @@ The available AccountSet flags are:
|
||||
|:----------------------------------|:--------------|:--------------|
|
||||
| `asfAccountTxnID` | 5 | Track the ID of this account's most recent transaction. Required for [`AccountTxnID`](../common-fields.md#accounttxnid) |
|
||||
| `asfAllowTrustLineClawback` | 16 | Allow account to claw back tokens it has issued. _(Requires the Clawback amendment.)_ Can only be set if the account has an empty owner directory (no trust lines, offers, escrows, payment channels, checks, or signer lists). After you set this flag, it cannot be reverted. The account permanently gains the ability to claw back issued assets on trust lines. |
|
||||
| `asfAllowTrustLineLocking` | 17 | Allow Trust Line tokens issued by this account to be held in escrow. If not set, attempts to create escrows with this account's tokens will fail. After you set this flag, it cannot be disabled. {% amendment-disclaimer name="TokenEscrow" /%} |
|
||||
| `asfAuthorizedNFTokenMinter` | 10 | Enable to allow another account to mint non-fungible tokens (NFTokens) on this account's behalf. Specify the authorized account in the `NFTokenMinter` field of the [AccountRoot](../../ledger-data/ledger-entry-types/accountroot.md) object. To remove an authorized minter, enable this flag and omit the `NFTokenMinter` field. {% amendment-disclaimer name="NonFungibleTokensV1_1" /%} |
|
||||
| `asfDefaultRipple` | 8 | Enable [rippling](../../../../concepts/tokens/fungible-tokens/rippling.md) on this account's trust lines by default. |
|
||||
| `asfDepositAuth` | 9 | Enable [Deposit Authorization](../../../../concepts/accounts/depositauth.md) on this account. {% amendment-disclaimer name="DepositAuth" /%} |
|
||||
|
||||
@@ -37,6 +37,19 @@ Any account may submit an EscrowCancel transaction.
|
||||
* If the corresponding [EscrowCreate transaction][] did not specify a `CancelAfter` time, the EscrowCancel transaction fails.
|
||||
* Otherwise the EscrowCancel transaction fails if the `CancelAfter` time is after the close time of the most recently-closed ledger.
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, {% $frontmatter.seo.title %} transactions can result in the following [transaction result codes](../transaction-results/index.md):
|
||||
|
||||
## EscrowFinish Errors
|
||||
|
||||
| Error Code | Description |
|
||||
|:------------------------- |:------------|
|
||||
| `tecNO_AUTH` | The transaction failed because authorization requirements were not met. For example, the issuer requires authorization and the sender is not authorized. |
|
||||
| `tecNO_LINE` | The sender does not have a trust line with the issuer. For Trust Line Tokens only. |
|
||||
| `tecNO_ENTRY` | The sender does not hold the MPT. |
|
||||
| `tecINSUFFICIENT_RESERVE` | Unable to create a trust line or MPToken due to lack of reserves. |
|
||||
|
||||
## See Also
|
||||
|
||||
- [Escrow entry][]
|
||||
|
||||
@@ -9,7 +9,18 @@ labels:
|
||||
|
||||
Set aside funds in an [escrow](../../../../concepts/payment-types/escrow.md) that delivers them to a predetermined recipient when certain conditions are met. If the escrow has an expiration, the funds can also be returned to the sender after it expires.
|
||||
|
||||
{% admonition type="info" name="Fungible Tokens" %}
|
||||
To escrow fungible tokens you must take note of the following:
|
||||
|
||||
- Trust Line Tokens must have the **Allow Trust Line Locking** flag enabled on their account.
|
||||
- Multi-Purpose-Tokens (MPTs) must have both the **Can Escrow** and **Can Transfer** flags enabled.
|
||||
- All token escrows must specify a **Cancel After** time.
|
||||
- If the token requires **authorization**, both sender and recipient must be pre-authorized by the issuer.
|
||||
{% /admonition %}
|
||||
|
||||
{% amendment-disclaimer name="Escrow" /%}
|
||||
{% amendment-disclaimer name="TokenEscrow" mode="updated" /%}
|
||||
|
||||
|
||||
## Example {% $frontmatter.seo.title %} JSON
|
||||
|
||||
@@ -34,29 +45,41 @@ Set aside funds in an [escrow](../../../../concepts/payment-types/escrow.md) tha
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Description |
|
||||
|:-----------------|:----------|:------------------|:--------------------------|
|
||||
| `Amount` | Object or String | Amount | Amount of XRP or fungible tokens to deduct from the sender's balance and escrow. Once escrowed, the payment can either go to the `Destination` address (after the `FinishAfter` time) or be returned to the sender (after the `CancelAfter` time). |
|
||||
| `Destination` | String | AccountID | Address to receive escrowed XRP. |
|
||||
| `CancelAfter` | Number | UInt32 | _(Optional)_ The time, in [seconds since the Ripple Epoch][], when this escrow expires. This value is immutable; the funds can only be returned to the sender after this time. |
|
||||
| `FinishAfter` | Number | UInt32 | _(Optional)_ The time, in [seconds since the Ripple Epoch][], when the escrowed XRP can be released to the recipient. This value is immutable, and the funds can't be accessed until this time. |
|
||||
| `Condition` | String | Blob | _(Optional)_ Hex value representing a [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1). The funds can only be delivered to the recipient if this condition is fulfilled. If the condition is not fulfilled before the expiration time specified in the `CancelAfter` field, the XRP can only revert to the sender. |
|
||||
| `Amount` | Object or String | Amount | Amount of XRP, in drops, or fungible tokens to deduct from the sender's balance and escrow. Once escrowed, the payment can either go to the `Destination` address (after the `FinishAfter` time) or be returned to the sender (after the `CancelAfter` time). {% amendment-disclaimer name="TokenEscrow" mode="updated" /%} |
|
||||
| `Destination` | String | AccountID | Address to receive escrowed funds. |
|
||||
| `CancelAfter` | Number | UInt32 | _(Optional for XRP escrows, but mandatory for token escrows)_ The time, in [seconds since the Ripple Epoch][], when this escrow expires. This value is immutable; the funds can only be returned to the sender after this time. Required if the token is a fungible token. |
|
||||
| `FinishAfter` | Number | UInt32 | _(Optional)_ The time, in [seconds since the Ripple Epoch][], when the escrowed funds can be released to the recipient. This value is immutable, and the funds can't be accessed until this time. |
|
||||
| `Condition` | String | Blob | _(Optional)_ Hex value representing a [PREIMAGE-SHA-256 crypto-condition](https://tools.ietf.org/html/draft-thomas-crypto-conditions-02#section-8.1). The funds can only be delivered to the recipient if this condition is fulfilled. If the condition is not fulfilled before the expiration time specified in the `CancelAfter` field, the funds can only revert to the sender. |
|
||||
| `DestinationTag` | Number | UInt32 | _(Optional)_ Arbitrary tag to further specify the destination for this escrowed payment, such as a hosted recipient at the destination address. |
|
||||
|
||||
You must specify one of the following combinations of fields:
|
||||
|
||||
| Summary | `FinishAfter` | `Condition` | `CancelAfter` |
|
||||
|-----------------------------------|---------------|-------------|---------------|
|
||||
| Time-based | ✅ | | |
|
||||
| Time-based (XRP only) | ✅ | | |
|
||||
| Time-based with expiration | ✅ | | ✅ |
|
||||
| Timed conditional | ✅ | ✅ | |
|
||||
| Timed conditional (XRP only) | ✅ | ✅ | |
|
||||
| Timed conditional with expiration | ✅ | ✅ | ✅ |
|
||||
| Conditional with expiration | | ✅ | ✅ |
|
||||
|
||||
It is not possible to create a conditional escrow with no expiration, but you can specify an expiration that is very far in the future.
|
||||
|
||||
{% admonition type="info" name="Note" %}
|
||||
Before the [fix1571 amendment][] became enabled on 2018-06-19, it was possible to create an escrow with `CancelAfter` only. These escrows could be finished by anyone at any time before the specified expiration.
|
||||
Before the [fix1571 amendment][] became enabled on 2018-06-19, it was possible to create an XRP escrow with `CancelAfter` only. These escrows could be finished by anyone at any time before the specified expiration.
|
||||
{% /admonition %}
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, {% $frontmatter.seo.title %} transactions can result in the following [transaction result codes](../transaction-results/index.md):
|
||||
|
||||
| Error Code | Description |
|
||||
|:--------------------- |:---------------------------------------------|
|
||||
| `tecNO_PERMISSION` | The transaction failed because the necessary permissions for token escrow are not in place. For example, the issuer hasn't enabled the Allow Trust Line Locking flag for a Trust Line Token.|
|
||||
| `tecNO_AUTH` | The transaction failed because authorization requirements for the token were not met. For example, the sender lacks authorization when creating the escrow. |
|
||||
| `tecUNFUNDED` | The sender lacks sufficient spendable balance. For Trust Line Tokens, this means the sender's trust line with the issuer has insufficient available balance. For XRP escrows, this means the sender doesn't have enough XRP. |
|
||||
| `tecOBJECT_NOT_FOUND` | The sender does not hold the MPT. |
|
||||
| `tecFROZEN` | The token is frozen (for Trust Line Tokens) or locked (for MPTs) for the sender. |
|
||||
|
||||
## See Also
|
||||
|
||||
- [Escrow entry][]
|
||||
|
||||
@@ -48,6 +48,20 @@ Any account may submit an EscrowFinish transaction.
|
||||
|
||||
In [non-production networks](../../../../concepts/networks-and-servers/parallel-networks.md), it may be possible [to delete](../../../../concepts/accounts/deleting-accounts.md) 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 object 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](/resources/known-amendments.md#fix1523) became enabled. No such escrows exist in the production XRP Ledger, so this edge case is not possible on the production XRP Ledger. This edge case is also not possible in test networks that enable both fix1523 and Escrow amendments at the same time, which is the default when you [start a new genesis ledger](../../../../infrastructure/testing-and-auditing/start-a-new-genesis-ledger-in-stand-alone-mode.md).
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, {% $frontmatter.seo.title %} transactions can result in the following [transaction result codes](../transaction-results/index.md):
|
||||
|
||||
## EscrowFinish Errors
|
||||
|
||||
| Error Code | Description |
|
||||
|:------------------------- |:------------|
|
||||
| `tecNO_AUTH` | The transaction failed because authorization requirements were not met. For example, the issuer requires authorization and the destination is not authorized. |
|
||||
| `tecNO_LINE` | The destination account does not have a trust line with the issuer. For Trust Line Tokens only. |
|
||||
| `tecNO_ENTRY` | The destination account does not hold the MPT. |
|
||||
| `tecINSUFFICIENT_RESERVE` | Unable to create a trust line or MPToken due to lack of reserves. |
|
||||
| `tecFROZEN` | The token is deep frozen (Trust Line Tokens) or locked (for MPTs). |
|
||||
|
||||
## See Also
|
||||
|
||||
- [Escrow entry][]
|
||||
|
||||
@@ -51,8 +51,8 @@ The **destination address** of a channel can:
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:----------------|:---------------------|:------------------|:----------|:------------|
|
||||
| `Amount` | [Currency Amount][] | Amount | No | The amount of [XRP, in drops][Currency Amount], or fungible tokens authorized by the `Signature`. This must match the amount in the signed message. This is the cumulative amount that can be dispensed by the channel, including funds previously redeemed. Non-XRP tokens can only be used if the [TokenEscrow amendment][] {% not-enabled /%} is enabled. |
|
||||
| `Balance` | [Currency Amount][] | Amount | No | Total amount of [XRP, in drops][Currency Amount], or fungible tokens delivered by this channel after processing this claim. Required to deliver XRP or fungible tokens. Must be more than the total amount delivered by the channel so far, but not greater than the `Amount` of the signed claim. Must be provided except when closing the channel. Non-XRP tokens can only be used if the [TokenEscrow amendment][] {% not-enabled /%} is enabled. |
|
||||
| `Amount` | [Currency Amount][] | Amount | No | The amount of XRP, in drops, authorized by the `Signature`. This must match the amount in the signed message. This is the cumulative amount of XRP that can be dispensed by the channel, including XRP previously redeemed. Must be provided except when closing the channel.|
|
||||
| `Balance` | [Currency Amount][] | Amount | No | Total amount of XRP, in drops, delivered by this channel after processing this claim. Required to deliver XRP. Must be more than the total amount delivered by the channel so far, but not greater than the `Amount` of the signed claim. Must be provided except when closing the channel. |
|
||||
| `Channel` | String - Hexadecimal | UInt256 | Yes | The unique ID of the channel. |
|
||||
| `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](./payment.md#credential-ids). |
|
||||
| `PublicKey` | String - Hexadecimal | Blob | No | The public key used for the signature. This must match the `PublicKey` stored in the ledger for the channel. Required unless the sender of the transaction is the source address of the channel and the `Signature` field is omitted. (The transaction includes the public key so that `rippled` can check the validity of the signature before trying to apply the transaction to the ledger.) |
|
||||
|
||||
@@ -34,7 +34,7 @@ Create a [payment channel](../../../../concepts/payment-types/payment-channels.m
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-----------------|:---------------------|:------------------|:----------|:------------|
|
||||
| `Amount` | [Currency Amount][] | Amount | Yes | Amount to deduct from the sender's balance and set aside in this channel. While the channel is open, the amount can only go to the `Destination` address. When the channel closes, any unclaimed amount is returned to the source account's balance. Non-XRP tokens can only be used if the [TokenEscrow amendment][] {% not-enabled /%} is enabled. |
|
||||
| `Amount` | [Currency Amount][] | Amount | Yes | Amount of XRP, in drops, to deduct from the sender's balance and set aside in this channel. While the channel is open, the XRP can only go to the `Destination` address. When the channel closes, any unclaimed XRP is returned to the source account's balance. |
|
||||
| `Destination` | String - [Address][] | AccountID | Yes | The account that can receive money from this channel. This is also known as the "destination address" for the channel. Cannot be the same as the sender (`Account`). |
|
||||
| `SettleDelay` | Number | UInt32 | Yes | Amount of time, in seconds, the source address must wait before closing the channel if it has unclaimed funds. |
|
||||
| `PublicKey` | String - Hexadecimal | Blob | Yes | The 33-byte public key of the key pair the source will use to sign claims against this channel. This can be any secp256k1 or Ed25519 public key. For more information on key pairs, see [Key Derivation](../../../../concepts/accounts/cryptographic-keys.md#key-derivation) <!-- STYLE_OVERRIDE: will --> |
|
||||
|
||||
@@ -30,7 +30,7 @@ Add an additional amount to an open [payment channel](../../../../concepts/payme
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-------------|:---------------------|:------------------|:----------|:------------|
|
||||
| `Channel` | String - Hexadecimal | UInt256 | Yes | The unique ID of the channel to fund. |
|
||||
| `Amount` | [Currency Amount][] | Amount | Yes | Amount to add to the channel. Must be a positive amount. Non-XRP tokens can only be used if the [TokenEscrow amendment][] {% not-enabled /%} is enabled. |
|
||||
| `Amount` | [Currency Amount][] | Amount | Yes | Amount of XRP, in drops, to add to the channel. Must be a positive amount of XRP. |
|
||||
| `Expiration` | Number | UInt32 | No | New expiration time to set for the channel, in [seconds since the Ripple Epoch][]. This must be later than either the current time plus the `SettleDelay` of the channel, or the existing `Expiration` of the channel. After the `Expiration` time, any transaction that would access the channel closes the channel without taking its normal action. (`Expiration` is separate from the channel's immutable `CancelAfter` time.) For more information, see the [PayChannel ledger entry type](../../ledger-data/ledger-entry-types/paychannel.md). |
|
||||
|
||||
## Error Cases
|
||||
|
||||
Reference in New Issue
Block a user