mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
Add protocol refs for Permissioned DEXes
This commit is contained in:
@@ -6,14 +6,14 @@ labels:
|
||||
- Decentralized Exchange
|
||||
---
|
||||
# DirectoryNode
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/f64cf9187affd69650907d0d92e097eb29693945/include/xrpl/protocol/detail/ledger_entries.macro#L165-L179 "Source")
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/7e24adbdd0b61fb50967c4c6d4b27cc6d81b33f3/include/xrpl/protocol/detail/ledger_entries.macro#L177-L192 "Source")
|
||||
|
||||
The `DirectoryNode` ledger entry type provides a list of links to other entries in the ledger's state data. A single conceptual _Directory_ takes the form of a doubly linked list, with one or more DirectoryNode entries each containing up to 32 [IDs of other entries](../common-fields.md). The first DirectoryNode entry is called the root of the directory, and all entries other than the root can be added or deleted as necessary.
|
||||
|
||||
There are three kinds of directory:
|
||||
|
||||
* _Owner directories_ list other entries owned by an account, such as [`RippleState` (trust line)](ripplestate.md) or [`Offer`](offer.md) entries.
|
||||
* _Offer directories_ list the offers available in the [decentralized exchange](../../../../concepts/tokens/decentralized-exchange/index.md). A single Offer directory contains all the offers that have the same exchange rate for the same token (currency code and issuer).
|
||||
* _Offer directories_ list the offers available in the [decentralized exchange](../../../../concepts/tokens/decentralized-exchange/index.md). A single offer directory contains all the offers that have the same exchange rate for the same token (currency code and issuer).
|
||||
* _NFT Offer directories_ list buy and sell offers for NFTs. Each NFT has up to two directories, one for buy offers, the other for sell offers.
|
||||
|
||||
All types of directories are automatically updated by the protocol as necessary.
|
||||
@@ -97,6 +97,7 @@ All types of directories are automatically updated by the protocol as necessary.
|
||||
|
||||
| Name | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:--------------------|:----------|:------------------|:----------|:------------|
|
||||
| `DomainID` | String | Hash256 | No | (Offer directories only) The ledger entry ID of a permissioned domain. If present, this order book belongs to the corresponding [Permissioned DEX](../permissioned-dexes.md). Otherwise, this order book is part of the open DEX. _(Requires the [PermissionedDEX amendment][] {% not-enabled /%})_ |
|
||||
| `ExchangeRate` | String | UInt64 | No | (Offer directories only) **DEPRECATED**. Do not use. |
|
||||
| `Flags` | Number | UInt32 | Yes | A bit-map of boolean flags enabled for this object. Currently, the protocol defines no flags for `DirectoryNode` objects. The value is always `0`. |
|
||||
| `Indexes` | Array | Vector256 | Yes | The contents of this directory: an array of IDs of other objects. |
|
||||
@@ -136,8 +137,8 @@ Owner directories and offer directories for fungible tokens do not use flags; th
|
||||
There are three different formulas for creating the ID of a DirectoryNode, depending on which of the following the DirectoryNode represents:
|
||||
|
||||
* The first page (also called the root) of an Owner or NFT Offer directory
|
||||
* The first page of an Offer directory
|
||||
* Later pages of either type
|
||||
* The first page of an Offer directory, with variants for the open DEX and permissioned DEX _(Requires the [PermissionedDEX amendment][] {% not-enabled /%})_
|
||||
* Later pages of any type
|
||||
|
||||
The first page of an Owner directory or NFT Offer directory has an ID that is the [SHA-512Half][] of the following values, concatenated in order:
|
||||
|
||||
@@ -151,6 +152,7 @@ The first page of an Offer directory has a special ID: the higher 192 bits defin
|
||||
* The 160-bit currency code from the `TakerGetsCurrency`
|
||||
* The AccountID from the `TakerPaysIssuer`
|
||||
* The AccountID from the `TakerGetsIssuer`
|
||||
* The `DomainID` of the permissioned domain this order book belongs to, if part of a permissioned DEX. Omitted for order books in the open DEX.
|
||||
|
||||
The lower 64 bits of an Offer directory's ID represent the `TakerPays` amount divided by `TakerGets` amount from the offer(s) in that directory as a 64-bit number in the XRP Ledger's internal amount format.
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ labels:
|
||||
- Decentralized Exchange
|
||||
---
|
||||
# Offer
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/f64cf9187affd69650907d0d92e097eb29693945/include/xrpl/protocol/detail/ledger_entries.macro#L229-L240 "Source")
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/7e24adbdd0b61fb50967c4c6d4b27cc6d81b33f3/include/xrpl/protocol/detail/ledger_entries.macro#L242-L255 "Source")
|
||||
|
||||
An `Offer` ledger entry describes an [Offer](../../../../concepts/tokens/decentralized-exchange/offers.md) to exchange currencies in the XRP Ledger's [decentralized exchange](../../../../concepts/tokens/decentralized-exchange/index.md). (In finance, this is more traditionally known as an _order_.) You an create a new Offer entry by sending an [OfferCreate transaction][] that is not fully executed immediately.
|
||||
An `Offer` ledger entry describes an [offer](../../../../concepts/tokens/decentralized-exchange/offers.md) to exchange currencies in the XRP Ledger's [decentralized exchange](../../../../concepts/tokens/decentralized-exchange/index.md). (In finance, this is more traditionally known as an _order_.) You an create a new offer entry by sending an [OfferCreate transaction][] that is not fully executed immediately.
|
||||
|
||||
An Offer can become unfunded through other activities in the network, while remaining in the ledger. When processing transactions, the network automatically removes any unfunded Offers that those transactions come across. (Otherwise, unfunded Offers remain, because _only_ transactions can change the ledger state.)
|
||||
An offer can become unfunded through other activities in the network, while remaining in the ledger. When processing transactions, the network automatically removes any unfunded Offers that those transactions come across. (Otherwise, unfunded Offers remain, because _only_ transactions can change the ledger state.)
|
||||
|
||||
|
||||
## Example {% $frontmatter.seo.title %} JSON
|
||||
@@ -39,19 +39,21 @@ An Offer can become unfunded through other activities in the network, while rema
|
||||
|
||||
In addition to the [common fields](../common-fields.md), {% code-page-name /%} entries have the following fields:
|
||||
|
||||
| Name | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:--------------------|:-----------------|:------------------|:----------|:------------|
|
||||
| `Account` | String | AccountID | Yes | The address of the account that owns this Offer. |
|
||||
| `BookDirectory` | String | Hash256 | Yes | The ID of the [Offer Directory](directorynode.md) that links to this Offer. |
|
||||
| `BookNode` | String | UInt64 | Yes | A hint indicating which page of the offer directory links to this entry, in case the directory consists of multiple pages. |
|
||||
| `Expiration` | Number | UInt32 | No | Indicates the time after which this Offer is considered unfunded. See [Specifying Time][] for details. |
|
||||
| `LedgerEntryType` | String | UInt16 | Yes | The value `0x006F`, mapped to the string `Offer`, indicates that this is an Offer entry. |
|
||||
| `OwnerNode` | String | UInt64 | Yes | A hint indicating which page of the owner directory links to this entry, in case the directory consists of multiple pages. |
|
||||
| `PreviousTxnID` | String | Hash256 | Yes | The identifying hash of the transaction that most recently modified this entry. |
|
||||
| `PreviousTxnLgrSeq` | Number | UInt32 | Yes | The [index of the ledger][Ledger Index] that contains the transaction that most recently modified this object. |
|
||||
| `Sequence` | Number | UInt32 | Yes | The `Sequence` value of the [OfferCreate][] transaction that created this offer. Used in combination with the `Account` to identify this offer. |
|
||||
| `TakerPays` | [Currency Amount][] | Amount | Yes | The remaining amount and type of currency requested by the Offer creator. |
|
||||
| `TakerGets` | [Currency Amount][] | Amount | Yes | The remaining amount and type of currency being provided by the Offer creator. |
|
||||
| Name | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:--------------------|:---------------------|:------------------|:----------|:------------|
|
||||
| `Account` | String - [Address][] | AccountID | Yes | The account that owns this offer. |
|
||||
| `AdditionalBooks` | Array | Array | No | A list of additional offer directories that link to this offer. This field must be present if this is a hybrid offer in a [permissioned DEX](../permissioned-dexes.md) and if it is not a hybrid offer. The array always contains exactly 1 entry. _(Requires the [PermissionedDEX amendment][] {% not-enabled /%})_ |
|
||||
| `BookDirectory` | String - [Hash][] | Hash256 | Yes | The ID of the [offer directory](directorynode.md) that links to this offer. |
|
||||
| `BookNode` | String | UInt64 | Yes | A hint indicating which page of the offer directory links to this entry, in case the directory consists of multiple pages. |
|
||||
| `DomainID` | String - [Hash][] | Hash256 | No | The ledger entry ID of a [permissioned domain](/docs/concepts/tokens/decentralized-exchange/permissioned-domains). If present, this offer belongs to the corresponding [Permissioned DEX](/docs/concepts/tokens/decentralized-exchange/permissioned-dexes.md). _(Requires the [PermissionedDEX amendment][] {% not-enabled /%})_ |
|
||||
| `Expiration` | Number | UInt32 | No | Indicates the time after which this offer is considered unfunded. See [Specifying Time][] for details. |
|
||||
| `LedgerEntryType` | String | UInt16 | Yes | The value `0x006F`, mapped to the string `Offer`, indicates that this is an offer entry. |
|
||||
| `OwnerNode` | String | UInt64 | Yes | A hint indicating which page of the owner directory links to this entry, in case the directory consists of multiple pages. |
|
||||
| `PreviousTxnID` | String - [Hash][] | Hash256 | Yes | The identifying hash of the transaction that most recently modified this entry. |
|
||||
| `PreviousTxnLgrSeq` | Number | UInt32 | Yes | The [index of the ledger][Ledger Index] that contains the transaction that most recently modified this object. |
|
||||
| `Sequence` | Number | UInt32 | Yes | The `Sequence` value of the [OfferCreate][] transaction that created this offer. Used in combination with the `Account` to identify this offer. |
|
||||
| `TakerPays` | [Currency Amount][] | Amount | Yes | The remaining amount and type of currency requested by the offer creator. |
|
||||
| `TakerGets` | [Currency Amount][] | Amount | Yes | The remaining amount and type of currency being provided by the offer creator. |
|
||||
|
||||
## Offer Flags
|
||||
|
||||
@@ -59,9 +61,9 @@ In addition to the [common fields](../common-fields.md), {% code-page-name /%} e
|
||||
|
||||
| Flag Name | Hex Value | Decimal Value | Corresponding [OfferCreate Flag](../../transactions/types/offercreate.md#offercreate-flags) | Description |
|
||||
|--------------|--------------|---------------|-------------|------------------------|
|
||||
| `lsfPassive` | `0x00010000` | 65536 | `tfPassive` | The offer was placed as "passive". This has no effect after the offer is placed into the ledger. |
|
||||
| `lsfSell` | `0x00020000` | 131072 | `tfSell` | The offer was placed as a "Sell" offer. This has no effect after the offer is placed in the ledger, because `tfSell` only matters if you get a better rate than you asked for, which can only happen when the offer is initially placed. |
|
||||
|
||||
| `lsfPassive` | `0x00010000` | 65536 | `tfPassive` | The offer was placed as passive. This has no effect after the offer is placed into the ledger. |
|
||||
| `lsfSell` | `0x00020000` | 131072 | `tfSell` | The offer was placed as a sell offer. This has no effect after the offer is placed in the ledger, because `tfSell` only matters if you get a better rate than you asked for, which can only happen when the offer is initially placed. |
|
||||
| `lsfHybrid` | `0x00040000` | 262144 | `tfHybrid` | The offer was placed as a hybrid offer, which means it is listed in a [permissioned DEX](/docs/concepts/tokens/decentralized-exchange/permissioned-dexes.md) and the open DEX. _(Requires the [PermissionedDEX amendment][] {% not-enabled /%})_ |
|
||||
|
||||
## {% $frontmatter.seo.title %} Reserve
|
||||
|
||||
@@ -73,9 +75,9 @@ In addition to the [common fields](../common-fields.md), {% code-page-name /%} e
|
||||
The ID of an `Offer` entry is the [SHA-512Half][] of the following values, concatenated in order:
|
||||
|
||||
* The Offer space key (`0x006F`)
|
||||
* The AccountID of the account placing the Offer
|
||||
* The Sequence number of the [OfferCreate transaction][] that created the Offer.
|
||||
* The AccountID of the account placing the offer
|
||||
* The Sequence number of the [OfferCreate transaction][] that created the offer.
|
||||
|
||||
If the OfferCreate transaction used a [Ticket](../../../../concepts/accounts/tickets.md), use the `TicketSequence` value instead.
|
||||
If the OfferCreate transaction used a [ticket](../../../../concepts/accounts/tickets.md), use the `TicketSequence` value instead.
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
---
|
||||
html: offercreate.html
|
||||
parent: transaction-types.html
|
||||
seo:
|
||||
description: Submit an order to exchange currency.
|
||||
labels:
|
||||
@@ -61,22 +59,22 @@ Transactions of the OfferCreate type support additional values in the [`Flags` f
|
||||
|
||||
| Error Code | Description |
|
||||
|:-------------------------|:--------------------------------------------------|
|
||||
| `temINVALID_FLAG` | The transaction specifies an invalid flag combination, such as both `tfImmediateOrCancel` and `tfFillOrKill`, or the transaction uses `tfHybrid` but omits the `DomainID` field. |
|
||||
| `tecEXPIRED` | The transaction specifies an `Expiration` time that has already passed. |
|
||||
| `tecKILLED` | The transaction specifies `tfFillOrKill`, and the full amount cannot be filled. If the _[ImmediateOfferKilled amendment][]_ is enabled, this result code also occurs when the transaction specifies `tfImmediateOrCancel` and executes without moving funds (previously, an Immediate or Cancel offer would return `tesSUCCESS` even if no funds were moved). |
|
||||
| `temBAD_EXPIRATION` | The transaction contains an `Expiration` field that is not validly formatted. |
|
||||
| `temBAD_SEQUENCE` | The transaction contains an `OfferSequence` that is not validly formatted, or is higher than the transaction's own `Sequence` number. |
|
||||
| `temBAD_OFFER` | The offer tries to trade XRP for XRP, or tries to trade an invalid or negative amount of a token. |
|
||||
| `temREDUNDANT` | The transaction specifies a token for the same token (same issuer and currency code). |
|
||||
| `temBAD_CURRENCY` | The transaction specifies a token with the currency code "XRP". |
|
||||
| `temBAD_ISSUER` | The transaction specifies a token with an invalid `issuer` value. |
|
||||
| `tecNO_ISSUER` | The transaction specifies a token whose `issuer` value is not a funded account in the ledger. |
|
||||
| `tecNO_PERMISSION` | The transaction uses a `DomainID` but the sender is not a member of that domain. _(Requires the [PermissionedDEX amendment][] {% not-enabled /%})_ |
|
||||
| `tecFROZEN` | The transaction involves a token on a [frozen](../../../../concepts/tokens/fungible-tokens/freezes.md) trust line (including local and global freezes). The `TakerPays` (buy amount) token has been deep-frozen by the issuer. |
|
||||
| `tecUNFUNDED_OFFER` | The owner does not hold a positive amount of the `TakerGets` currency. (Exception: if `TakerGets` specifies a token that the owner issues, the transaction can succeed.) |
|
||||
| `tecNO_LINE` | The transaction involves a token whose issuer uses [Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md) and the necessary trust line does not exist. |
|
||||
| `tecNO_AUTH` | The transaction involves a token whose issuer uses [Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md) and the the trust line that would receive the tokens exists but has not been authorized. |
|
||||
| `tecINSUF_RESERVE_OFFER` | The owner does not have enough XRP to meet the reserve requirement of adding a new Offer object to the ledger, and the transaction did not convert any currency. (If the transaction successfully traded any amount, the transaction succeeds with the result code `tesSUCCESS`, but does not create an Offer object in the ledger for the rest.) |
|
||||
| `tecDIR_FULL` | The owner owns too many items in the ledger, or the order book contains too many Offers at the same exchange rate already. |
|
||||
| `tecEXPIRED` | The transaction specifies an `Expiration` time that has already passed. |
|
||||
| `tecFROZEN` | The transaction involves a token on a [frozen](../../../../concepts/tokens/fungible-tokens/freezes.md) trust line (including local and global freezes). The `TakerPays` (buy amount) token has been deep-frozen by the issuer. |
|
||||
| `tecINSUF_RESERVE_OFFER` | The owner does not have enough XRP to meet the reserve requirement of adding a new offer ledger entry, and the transaction did not convert any currency. (If the transaction successfully traded any amount, the transaction succeeds with the result code `tesSUCCESS`, but does not create an offer ledger entry for the remainder.) |
|
||||
| `tecKILLED` | The transaction specifies `tfFillOrKill`, and the full amount cannot be filled. If the _[ImmediateOfferKilled amendment][]_ is enabled, this result code also occurs when the transaction specifies `tfImmediateOrCancel` and executes without moving funds (previously, an Immediate or Cancel offer would return `tesSUCCESS` even if no funds were moved). |
|
||||
| `tecNO_AUTH` | The transaction involves a token whose issuer uses [Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md) and the the trust line that would receive the tokens exists but has not been authorized. |
|
||||
| `tecNO_ISSUER` | The transaction specifies a token whose `issuer` value is not a funded account in the ledger. |
|
||||
| `tecNO_LINE` | The transaction involves a token whose issuer uses [Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md) and the necessary trust line does not exist. |
|
||||
| `tecNO_PERMISSION` | The transaction uses a `DomainID` but the sender is not a member of that domain. _(Requires the [PermissionedDEX amendment][] {% not-enabled /%})_ |
|
||||
| `tecUNFUNDED_OFFER` | The owner does not hold a positive amount of the `TakerGets` currency. (Exception: if `TakerGets` specifies a token that the owner issues, the transaction can succeed.) |
|
||||
| `temBAD_CURRENCY` | The transaction specifies a fungible token incorrectly, such as a fungible token with the currency code "XRP". |
|
||||
| `temBAD_EXPIRATION` | The transaction contains an `Expiration` field that is not validly formatted. |
|
||||
| `temBAD_ISSUER` | The transaction specifies a token with an invalid `issuer` value. |
|
||||
| `temBAD_OFFER` | The offer tries to trade XRP for XRP, or tries to trade an invalid or negative amount of a token. |
|
||||
| `temBAD_SEQUENCE` | The transaction contains an `OfferSequence` that is not validly formatted, or is higher than the transaction's own `Sequence` number. |
|
||||
| `temINVALID_FLAG` | The transaction specifies an invalid flag combination, such as both `tfImmediateOrCancel` and `tfFillOrKill`, or the transaction uses `tfHybrid` but omits the `DomainID` field. |
|
||||
| `temREDUNDANT` | The transaction would trade a token for the same token (same issuer and currency code). |
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
|
||||
@@ -42,11 +42,11 @@ Payments are also the only way to [create accounts](#creating-accounts).
|
||||
| `Amount` | [Currency Amount][] | Amount | API v1: Yes | Alias to `DeliverMax`. |
|
||||
| `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. _(Requires the [Credentials amendment][]._ {% not-enabled /%})_ |
|
||||
| `DeliverMax` | [Currency Amount][] | Amount | Yes | [API v2][]: The maximum amount of currency to deliver. [Partial payments](#partial-payments) can deliver less than this amount and still succeed; other payments fail unless they deliver the exact amount. {% badge href="https://github.com/XRPLF/rippled/releases/tag/2.0.0" %}New in: rippled 2.0.0{% /badge %} |
|
||||
| `DeliverMin` | [Currency Amount][] | Amount | No | Minimum amount of destination currency this transaction should deliver. Only valid if this is a [partial payment](#partial-payments). For non-XRP amounts, the nested field names are lower-case. |
|
||||
| `Destination` | String | AccountID | Yes | The unique address of the account receiving the payment. |
|
||||
| `DeliverMin` | [Currency Amount][] | Amount | No | Minimum amount of destination currency this transaction should deliver. Only valid if this is a [partial payment](#partial-payments). |
|
||||
| `Destination` | String - [Address][] | AccountID | Yes | The account receiving the payment. |
|
||||
| `DestinationTag` | Number | UInt32 | No | Arbitrary tag that identifies the reason for the payment to the destination, or a hosted recipient to pay. |
|
||||
| `DomainID` | String - [Hash][] | Hash256 | No | The ledger entry ID of a permissioned domain. If this is a cross-currency payment, only use the corresponding [permissioned DEX](../permissioned-dexes.md) to convert currency. Both the sender and the recipient must have valid credentials that grant access to the specified domain. This field has no effect if the payment is not cross-currency. _(Requires the [PermissionedDEX amendment][] {% not-enabled /%})_ |
|
||||
| `InvoiceID` | String | Hash256 | No | Arbitrary 256-bit hash representing a specific reason or identifier for this payment. |
|
||||
| `InvoiceID` | String - Hexadecimal | Hash256 | No | Arbitrary 256-bit value representing a specific reason or identifier for this payment. |
|
||||
| `Paths` | Array of path arrays | PathSet | No | _(Auto-fillable)_ Array of [payment paths](../../../../concepts/tokens/fungible-tokens/paths.md) to be used for this transaction. Must be omitted for XRP-to-XRP transactions. |
|
||||
| `SendMax` | [Currency Amount][] | Amount | No | Highest amount of source currency this transaction is allowed to cost, including [transfer fees](../../../../concepts/tokens/transfer-fees.md), exchange rates, and [slippage](http://en.wikipedia.org/wiki/Slippage_%28finance%29). Does not include the [XRP destroyed as a cost for submitting the transaction](../../../../concepts/transactions/transaction-cost.md). Must be supplied for cross-currency/cross-issue payments. Must be omitted for XRP-to-XRP payments. |
|
||||
|
||||
@@ -64,7 +64,7 @@ The `Payment` transaction type functions differently depending on how you fill i
|
||||
| [Cross-currency Payment][] | Object (non-XRP) / String (XRP) | Object (non-XRP) / String (XRP) | Usually required | No | Send tokens from one holder to another. The `Amount` or `SendMax` can be XRP or tokens, but can't both be XRP. These payments [ripple through](../../../../concepts/tokens/fungible-tokens/rippling.md) the issuer and can take longer [paths](../../../../concepts/tokens/fungible-tokens/paths.md) through several intermediaries if the transaction specifies a path set. [Transfer fees](../../../../concepts/tokens/transfer-fees.md) set by the issuer(s) apply to this type of transaction. These transactions consume offers in the [decentralized exchange](../../../../concepts/tokens/decentralized-exchange/index.md) to connect different currencies, or currencies with the same currency code and different issuers. |
|
||||
| [Partial payment][] | Object (non-XRP) / String (XRP) | Object (non-XRP) / String (XRP) | Usually required | No | Sends _up to_ a specific amount of any currency. Uses the [`tfPartialPayment` flag](#payment-flags). May include a `DeliverMin` amount specifying the minimum that the transaction must deliver to be successful; if the transaction does not specify `DeliverMin`, it can succeed by delivering _any positive amount_. |
|
||||
| Currency conversion | Object (non-XRP) / String (XRP) | Object (non-XRP) / String (XRP) | Required | Yes | Consumes offers in the [decentralized exchange](../../../../concepts/tokens/decentralized-exchange/index.md) to convert one currency to another, possibly taking [arbitrage](https://en.wikipedia.org/wiki/Arbitrage) opportunities. The `Amount` and `SendMax` cannot both be XRP. Also called a _circular payment_ because it delivers money to the sender. This type of transaction may be classified as an "exchange" and not a "payment". |
|
||||
| MPT Payment | Object | Omitted | Omitted | Yes | Send MPTs to a holder. See [MPT Payments](#mpt-payments). |
|
||||
| MPT Payment | Object | Omitted | Omitted | No | Send MPTs to a holder. See [MPT Payments](#mpt-payments). |
|
||||
|
||||
[Direct XRP Payment]: ../../../../concepts/payment-types/direct-xrp-payments.md
|
||||
[Creating or redeeming tokens]: ../../../../concepts/tokens/index.md
|
||||
@@ -76,11 +76,14 @@ The `Payment` transaction type functions differently depending on how you fill i
|
||||
|
||||
<!-- SPELLING_IGNORE: sendmax -->
|
||||
|
||||
Most of the time, the `issuer` field of a non-XRP [Currency Amount][] indicates the issuer of a token. However, when describing payments, there are special rules for the `issuer` field in the `Amount` and `SendMax` fields of a payment.
|
||||
Most of the time, the `issuer` field of a non-XRP [Currency Amount][] indicates the issuer of a token. However, when describing payments, there are special rules for the `issuer` field in the `DeliverMax` (or `Amount`) and `SendMax` fields of a payment.
|
||||
|
||||
* There is only ever one balance between two addresses for the same currency code. This means that, sometimes, the `issuer` field of an amount actually refers to a counterparty, instead of the address that issued the token.
|
||||
* When the `issuer` field of the destination `Amount` field matches the `Destination` address, it is treated as a special case meaning "any issuer that the destination accepts." This includes all addresses to which the destination has trust lines with a positive limit, as well as tokens with the same currency code issued by the destination.
|
||||
* When the `issuer` field of the `SendMax` field matches the source account's address, it is treated as a special case meaning "any issuer that the source can use." This includes creating new tokens on trust lines that other accounts have extended to the source account, and sending tokens the source account holds from other issuers.
|
||||
* When the `issuer` field of the destination `DeliverMax` field matches the `Destination` address, it is treated as a special case meaning "any issuer that the destination accepts." This includes all addresses to which the destination has trust lines with a positive limit, as well as tokens issued by the destination itself.
|
||||
* When the `issuer` field of the `SendMax` field matches the source account's address, it is treated as a special case meaning "any issuer that the source can use." The payment can send tokens the source account already holds, or issue new tokens to others who have trust lines with the source account.
|
||||
|
||||
In all of these cases, the currency code must still match exactly.
|
||||
|
||||
|
||||
## Creating Accounts
|
||||
|
||||
@@ -185,6 +188,10 @@ The credentials provided in the `CredentialIDs` field must all be valid, meaning
|
||||
|
||||
If you provide credentials even though the destination account does not use Deposit Authorization, the credentials are not needed but they are still checked for validity.
|
||||
|
||||
{% admonition type="info" name="Note" %}
|
||||
The `CredentialIDs` field is only used for deposit authorization, not for trading in a [permissioned DEX](/docs/concepts/tokens/decentralized-exchange/permissioned-dex.md), even though Permissioned DEXes also use credentials to grant access. To trade in a permissioned DEX, you use the `DomainID` field to specify a domain for which you hold valid credentials.
|
||||
{% /admonition %}
|
||||
|
||||
## Special Case for Destination Accounts Below the Reserve
|
||||
|
||||
If an account has Deposit Authorization enabled, but its current XRP balance is less than the [reserve requirement](../../../../concepts/accounts/reserves.md), there is a special exception to Deposit Authorization where anyone can send a Payment transaction, without preauthorization, for up to the base account reserve; this exists as an emergency measure to prevent an account from getting "stuck" without enough XRP to transact. To qualify for this special case, the payment MUST NOT use the `CredentialIDs` field.
|
||||
|
||||
Reference in New Issue
Block a user