OfferCreate
An OfferCreate transaction places an [Offer](offers.html) in the [decentralized exchange](decentralized-exchange.html).
[Source]
Example
Fields
Field | JSON Type | [Internal Type][] | Description |
---|---|---|---|
| Number | UInt32 | (Optional) Time after which the Offer is no longer active, in [seconds since the Ripple Epoch][]. |
| Number | UInt32 | (Optional) An Offer to delete first, specified in the same way as [OfferCancel][]. |
| String | Hash256 | (Optional) The ID of the Offer ledger object to cancel, as a 64-character hexadecimal string. |
| Amount | The amount and type of currency being sold. | |
| Amount | The amount and type of currency being bought. |
OfferCreate Flags
Transactions of the OfferCreate type support additional values in the Flags
field, as follows:
Flag Name | Hex Value | Decimal Value | Description |
---|---|---|---|
|
| 65536 | If enabled, the Offer does not consume Offers that exactly match it, and instead becomes an Offer object in the ledger. It still consumes Offers that cross it. |
|
| 131072 | Treat the Offer as an Immediate or Cancel order. The Offer never creates an [Offer object][] in the ledger: it only trades as much as it can by consuming existing Offers at the time the transaction is processed. If no Offers match, it executes "successfully" without trading anything. In this case, the transaction still uses the result code |
|
| 262144 | Treat the offer as a Fill or Kill order. The Offer never creates an [Offer object][] in the ledger, and is canceled if it cannot be fully filled at the time of execution. By default, this means that the owner must receive the full |
|
| 524288 | Exchange the entire |
Error Cases
Error Code | Description |
---|---|
| Occurs if the transaction specifies both |
| Occurs if the transaction specifies an |
| Occurs if the transaction specifies |
| Occurs if the transaction contains an |
| Occurs if the transaction contains an |
| Occurs if the Offer tries to trade XAH for XAH, or tries to trade an invalid or negative amount of a token. |
| Occurs if the transaction specifies a token for the same token (same issuer and currency code). |
| Occurs if the transaction specifies a token with the currency code "XAH". |
| Occurs if the transaction specifies a token with an invalid |
| Occurs if the transaction specifies a token whose |
| Occurs if the transaction involves a token on a frozen trust line (including local and global freezes). |
| Occurs if the owner does not hold a positive amount of the |
| Occurs if the transaction involves a token whose issuer uses Authorized Trust Lines and the necessary trust line does not exist. |
| Occurs if the transaction involves a token whose issuer uses Authorized Trust Lines and the the trust line that would receive the tokens exists but has not been authorized. |
| Occurs if the owner does not have enough XAH 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 |
| Occurs if the owner owns too many items in the ledger, or the order book contains too many Offers at the same exchange rate already. |
Last updated