Changes per Git issue 1487

This commit is contained in:
ddawson
2022-09-08 13:29:41 -07:00
parent ac3fe2e056
commit ef1e092a6a
7 changed files with 38 additions and 41 deletions

View File

@@ -15,7 +15,7 @@ Example {{currentpage.name}} JSON
```json
{
"TokenID": "000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65",
"NFTokenID": "000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65",
"URI": "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi"
}
```
@@ -24,23 +24,23 @@ Example {{currentpage.name}} JSON
Unlike other objects, `NFToken` has no field to identify the object type or current owner of the object. `NFToken `objects are grouped into `NFTokenPages` that implicitly define the object type and identify the owner.
## TokenID
## NFTokenID
TokenID, optional, string, Hash256
NFTokenID, optional, string, Hash256
This composite field uniquely identifies a token, and consists of the following sections.
1. 16 bits that identify flags or settings specific to the NFT
2. 16 bits that encode the transfer fee associated with this token, if any
3. A 160-bit account identifier of the issuer
4. A 32-bit issuer-specified [taxon](https://www.merriam-webster.com/dictionary/taxon)
4. A 32-bit issuer-specified [NFTokenTaxon](https://www.merriam-webster.com/dictionary/taxon)
5. An (automatically generated) monotonically increasing 32-bit sequence number.
![Token ID Breakdown](img/nftoken1.png "Token ID Breakdown")
The 16-bit flags, transfer fee fields, the 32-bit taxon, and the sequence number fields are stored in big-endian format.
The 16-bit flags, transfer fee fields, the 32-bit NFTokenTaxon, and the sequence number fields are stored in big-endian format.
## NFToken Flags
@@ -125,23 +125,23 @@ This value sets the transfer fee to 314 bps, or 3.14%.
### Issuer Identification
The third section of the TokenID is a big endian representation of the issuers public address.
The third section of the NFTokenID is a big endian representation of the issuers public address.
![Issuer Address](img/nftokenc.png "Issuer Address")
### Taxon
### NFTokenTaxon
The fourth section is a taxon created by the issuer.
The fourth section is a NFTokenTaxon created by the issuer.
![Taxon](img/nftokend.png "Taxon")
![NFTokenTaxon](img/nftokend.png "NFTokenTaxon")
An issuer might issue several NFTs with the same taxon; to ensure that NFTs are spread across multiple pages, the taxon is scrambled using the fifth section, a dumb sequential number, as the seed for a random number generator. The scrambled value is stored with the `NFToken`, but the unscrambled value is the actual taxon.
An issuer might issue several NFTs with the same NFTokenTaxon; to ensure that NFTs are spread across multiple pages, the NFTokenTaxon is scrambled using the fifth section, a dumb sequential number, as the seed for a random number generator. The scrambled value is stored with the `NFToken`, but the unscrambled value is the actual NFTokenTaxon.
![Dumb Sequential](img/nftokene.png "Dumb Sequential")
Notice that the scrambled version of the taxon is `0xBC8B858E`: the scrambled version of the taxon specified by the issuer. But the _actual_ value of the taxon is the unscrambled value.
Notice that the scrambled version of the NFTokenTaxon is `0xBC8B858E`: the scrambled version of the NFTokenTaxon specified by the issuer. But the _actual_ value of the NFTokenTaxon is the unscrambled value.
### Token Sequence
@@ -172,17 +172,17 @@ The format for a text record is as follows.
```
xrpl-nft-data-token-info-v1 IN TXT "https://host.example.com/api/token-info/{tokenid}"
xrpl-nft-data-token-info-v1 IN TXT "https://host.example.com/api/token-info/{nftokenid}"
```
Replace the string `{tokenid}` with the requested tokens `NFTokenID` as a 64-byte hex string when you attempt to query information.
Replace the string `{nftokenid}` with the requested tokens `NFTokenID` as a 64-byte hex string when you attempt to query information.
Your implementation should check for the presence of `TXT` records and use those query strings if present. If no string is present, implementations should attempt to use a default URL. Assuming the domain is _example.com_, the default URL would be:
```
https://example.com/.well-known/xrpl-nft/{tokenid}
https://example.com/.well-known/xrpl-nft/{nftokenid}
```

View File

@@ -90,7 +90,7 @@ The unique ID (`NFTokenOfferID`) of the `NFTokenOffer` object is the result of t
</td>
</tr>
<tr>
<td><code>TokenID</code>
<td><code>NFTokenID</code>
</td>
<td>Yes
</td>
@@ -98,7 +98,7 @@ The unique ID (`NFTokenOfferID`) of the `NFTokenOffer` object is the result of t
</td>
<td>Hash256
</td>
<td><code>TokenID</code> of the <code>NFToken</code> object referenced by this offer.
<td><code>NFTokenID</code> of the <code>NFToken</code> object referenced by this offer.
</td>
</tr>
<tr>
@@ -152,7 +152,7 @@ Sell offers that specify assets other than XRP must specify a non-zero amount. S
</td>
</tr>
<tr>
<td><code>OfferNode</code>
<td><code>NFTokenOfferNode</code>
</td>
<td>No
</td>
@@ -192,21 +192,21 @@ Sell offers that specify assets other than XRP must specify a non-zero amount. S
</td>
</tr>
<tr>
<td><code>lsfBuyToken</code>
<td><code>lsfSellNFToken</code>
</td>
<td><code>0x00000001</code>
</td>
<td>If set, the offer is a buy offer. Otherwise, the offer is a sell offer.
<td>If set, the offer is a sell offer. Otherwise, the offer is a buy offer.
</td>
</tr>
<tr>
<!-- tr>
<td><code>lsfAuthorized</code>
</td>
<td><code>0x00000002</code>
</td>
<td>If set, the offer has been approved by the issuer. This flag can only be set by the <code>Issuer</code> of the token or an account authorized by the issuer (for example, the <code>MintAccount</code> listed in the account root of the <code>Issuer</code>) and only if the token has the flag indicating that authorization is required.
</td>
</tr>
</tr -->
</table>
## `NFTokenOffer` Transactions

View File

@@ -11,7 +11,7 @@ status: not_enabled
# NFTokenPage
{% include '_snippets/nfts-disclaimer.md' %}
The `NFTokenPage` object represents a collection of `NFToken` objects owned by the same account. An account can have multiple `NFTokenPage` ledger objects, which form a doubly-linked list (DLL).
The `NFTokenPage` object represents a collection of `NFToken` objects owned by the same account. An account can have multiple `NFTokenPage` ledger objects, which form a doubly linked list (DLL).
## Example {{currentpage.name}} JSON
@@ -26,13 +26,12 @@ The `NFTokenPage` object represents a collection of `NFToken` objects owned by t
"95C8761B22894E328646F7A70035E9DFBECC90EDD83E43B7B973F626D21A0822",
"PreviousTxnLgrSeq":
42891441,
"Tokens":
"NFTokens":
{
{
"TokenID":
"NFTokenID":
"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65",
"URI":
"ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi"
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469"
},
/* potentially more objects */
}
@@ -123,7 +122,7 @@ An `NFTokenPage` object can have the following required and optional fields:
</td>
</tr>
<tr>
<td><code>NonFungibleTokens</code>
<td><code>NFTokens</code>
</td>
<td>Yes
</td>

View File

@@ -3,7 +3,7 @@ html: nftokenacceptoffer.html
parent: transaction-types.html
blurb: Accept an offer to buy or sell an NFToken.
labels:
- NFTs, Non-fungible Tokens
- NFTokens, Non-fungible Tokens
status: not_enabled
---
# NFTokenAcceptOffer
@@ -28,7 +28,7 @@ The mode in which the transaction operates depends on the presence of the `NFTok
If neither of those fields is specified, the transaction is malformed and produces a `tem` class error.
The semantics of brokered mode are slightly different than one in direct mode: The account executing the transaction functions as a broker, bringing the two offers together and causing them to be matched, but does not acquire ownership of the involved NFT, which will, if the transaction is successful, be transferred directly from the seller to the buyer.
The semantics of brokered mode are slightly different than one in direct mode: The account executing the transaction functions as a broker, bringing the two offers together and causing them to be matched, but does not acquire ownership of the involved NFToken, which will, if the transaction is successful, be transferred directly from the seller to the buyer.
## Execution Details
@@ -39,8 +39,8 @@ The semantics of brokered mode are slightly different than one in direct mode: T
In direct mode, `NFTokenAcceptOffer` transaction fails if:
* The `NFTokenOffer` against which `NFTokenAcceptOffer` transaction is placed is an offer to `buy` the `NFToken` and the account executing the `NFTokenAcceptOffer` is not, at the time of execution, the current owner of the corresponding `NFToken`.
* The `NFTokenOffer` against which `NFTokenAcceptOffer` transaction is placed is an offer to `sell` the `NFToken` and was placed by an account which is not, at the time of execution, the current owner of the `NFToken`
* The `NFTokenOffer` against which `NFTokenAcceptOffer` transaction is placed is an offer to `sell` the `NFToken` and was placed by an account which is not, at the time of execution, the `Account` in the recipient field of the `NFTokenOffer`, if there exist one.
* The `NFTokenOffer` against which `NFTokenAcceptOffer` transaction is placed is an offer to `sell` the `NFToken` and was placed by an account which is not, at the time of execution, the current owner of the `NFToken`.
* The `NFTokenOffer` against which `NFTokenAcceptOffer` transaction is placed is an offer to `sell` the `NFToken` and was placed by an account which is not, at the time of execution, the `Account` in the recipient field of the `NFTokenOffer`, if one exists.
* The `NFTokenOffer` against which `NFTokenAcceptOffer` transaction is placed specifies an `expiration` time and the close time field of the parent of the ledger in which the transaction would be included has already passed.
* The `NFTokenOffer` against which `NFTokenAcceptOffer` transaction is placed to buy or sell the `NFToken `is owned by the account executing the `NFTokenAcceptOffer`.
@@ -49,7 +49,7 @@ A side-effect of such failures is the removal of the `NFTokenOffer` object and t
If the transaction is executed successfully then:
* The relevant `NFTtoken` changes ownership, meaning that the token is removed from the `NFTokenPage` of the existing `owner` and added to the `NFTokenPage` of the new `owner`.
* Funds are transferred from the buyer to the seller, as specified in the `NFTokenOffer`. If the corresponding `NFToken` offer specifies a `TransferRate`, then the `issuer` receives the specified percentage, with the balance going to the seller of the `NFToken`.
* Funds are transferred from the buyer to the seller, as specified in the `NFTokenOffer`. If the corresponding `NFToken` offer specifies a `TransferFee`, then the `issuer` receives the specified percentage, with the balance going to the seller of the `NFToken`.
### Brokered Mode

View File

@@ -37,7 +37,7 @@ This transaction removes the listed `NFTokenOffer` object from the ledger, if pr
| Field | JSON Type | [Internal Type][] | Description |
|:------------------|:----------|:------------------|:-------------------------|
| `TokenOffers` | Array | VECTOR256 | An array of IDs of the `NFTokenOffer` objects to cancel (not the IDs of `NFToken` objects, but the IDs of the `NFTokenOffer` objects). Each entry must be a different [object ID](ledger-object-ids.html) of an [NFTokenOffer](nftokenoffer.html) object; the transaction is invalid if the array contains duplicate entries. |
| `NFTokenOffers` | Array | VECTOR256 | An array of IDs of the `NFTokenOffer` objects to cancel (not the IDs of `NFToken` objects, but the IDs of the `NFTokenOffer` objects). Each entry must be a different [object ID](ledger-object-ids.html) of an [NFTokenOffer](nftokenoffer.html) object; the transaction is invalid if the array contains duplicate entries. |
The transaction can succeed even if one or more of the IDs in the `NFTokenOffers` field do not refer to objects that currently exist in the ledger. (For example, those token offers might already have been deleted.) The transaction fails with an error if one of the IDs points to an object that does exist, but is not a [NFTokenOffer](nftokenoffer.html) object.
@@ -52,8 +52,8 @@ In addition to errors that can occur for all transactions, {{currentpage.name}}
| Error Code | Description |
|:-------------------|:--------------------------------------------------------|
| `temDISABLED` | The [NonFungibleTokensV1 amendment][] is not enabled. |
| `temMALFORMED` | The transaction was not validly formatted. For example, the `TokenOffers` array was empty or contained more than the maximum number of offers that can be canceled at one time. |
| `tecNO_PERMISSION` | At least one of the IDs in the `TokenOffers` field refers to an object that cannot be canceled. For example, the sender of this transaction is not the owner or `Destination` of the offer, or the object was not an `NFTokenOffer` type object. |
| `temMALFORMED` | The transaction was not validly formatted. For example, the `NFTokenOffers` array was empty or contained more than the maximum number of offers that can be canceled at one time. |
| `tecNO_PERMISSION` | At least one of the IDs in the `NFTokenOffers` field refers to an object that cannot be canceled. For example, the sender of this transaction is not the owner or `Destination` of the offer, or the object was not an `NFTokenOffer` type object. |
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}

View File

@@ -41,9 +41,9 @@ If successful, the transaction creates a [NFTokenOffer object][]. Each offer cou
Transactions of the NFTokenCreateOffer type support additional values in the [`Flags` field](transaction-common-fields.html#flags-field), as follows:
| Flag Name | Hex Value | Decimal Value | Description |
|:--------------|:-------------|:--------------|:------------------------------|
| `tfSellToken` | `0x00000001` | `1` | If enabled, indicates that the offer is a sell offer. Otherwise, it is a buy offer. |
| Flag Name | Hex Value | Decimal Value | Description |
|:----------------|:-------------|:--------------|:------------------------------|
| `tfSellNFToken` | `0x00000001` | `1` | If enabled, indicates that the offer is a sell offer. Otherwise, it is a buy offer. |
## Error Cases

View File

@@ -22,7 +22,6 @@ If the transaction is successful, the newly minted token is owned by the account
{
"TransactionType": "NFTokenMint",
"Account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"Issuer": "rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2",
"TransferFee": 314,
"NFTokenTaxon": 0,
"Flags": 8,
@@ -49,7 +48,6 @@ This transaction assumes that the issuer, `rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2`,
| Field | JSON Type | [Internal Type][] | Description |
|:--------------|:--------------------|:------------------|:-------------------|
| `NFTokenTaxon` | Number | UInt32 | The taxon associated with the token. The taxon is generally a value chosen by the minter of the token. A given taxon can be used for multiple tokens. Taxon identifiers greater than `0xFFFF'FFFF` are disallowed. |
| `Issuer` | String | AccountID | _(Optional)_ The issuer of the token, if the sender of the account is issuing it on behalf of another account. This field must be omitted if the account sending the transaction is the issuer of the `NFToken`. If provided, the issuer's [AccountRoot object][] must have the `NFTokenMinter` field set to the sender of this transaction (this transaction's `Account` field). |
| `TransferFee` | Number | UInt16 | _(Optional)_ The value specifies the fee charged by the issuer for secondary sales of the `NFToken`, if such sales are allowed. Valid values for this field are between 0 and 50000 inclusive, allowing transfer rates of between 0.00% and 50.00% in increments of 0.001. If this field is provided, the transaction MUST have the [`tfTransferable` flag](#nftokenmint-flags) enabled. |
| `URI` | String | Blob | _(Optional)_ Up to 256 bytes of arbitrary data. In JSON, this should be encoded as a string of hexadecimal. You can use the [`xrpl.convertStringToHex`](https://js.xrpl.org/modules.html#convertStringToHex) utility to convert a URI to its hexadecimal equivalent. This is intended to be a URI that points to the data or metadata associated with the NFT. The contents could decode to an HTTP or HTTPS URL, an IPFS URI, a magnet link, immediate data encoded as an [RFC2379 "data" URL](https://datatracker.ietf.org/doc/html/rfc2397), or even an issuer-specific encoding. The URI is NOT checked for validity. |
@@ -86,7 +84,7 @@ If you want to issue an NFT for another account there are two things you must do
"TransactionType": "NFTokenMint",
"Account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"Issuer": "rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2",
"TransferFee": 314,
"TransferFee": 25000,
"NFTokenTaxon": 0,
"Flags": 8,
"Fee": "10",