Skip to content

Commit 1002c26

Browse files
committed
README and package update
1 parent 2a7f889 commit 1002c26

File tree

3 files changed

+56
-21
lines changed

3 files changed

+56
-21
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,38 @@ const vl = await BithompXRPL.Client.createVL(vk, sk, sequence, expiration, valid
107107
// disconnect
108108
BithompXRPL.Client.disconnect();
109109
```
110+
111+
## Decode NFTokenID
112+
113+
```JS
114+
const BithompXRPL = require("@bithomp/xrpl-api");
115+
116+
const nftokenID = "000861A8A7C507A12088BF6A6BB62BAFEE9CDAABA2961DB216E5DA9C00000001";
117+
const decoded = BithompXRPL.Models.parseNFTokenID(nftokenID);
118+
// decoded will contain
119+
// {
120+
// "NFTokenID: "000861A8A7C507A12088BF6A6BB62BAFEE9CDAABA2961DB216E5DA9C00000001",
121+
// "Flags": 8,
122+
// "TransferFee": 25000,
123+
// "Issuer": "rGJn1uZxDX4ksxRPYuj2smP7ZshdwjeSTG",
124+
// "NFTokenTaxon": 0,
125+
// "Sequence": 1,
126+
// }
127+
```
128+
129+
## Encode NFTokenID
130+
131+
```JS
132+
const BithompXRPL = require("@bithomp/xrpl-api");
133+
134+
const flags = 11;
135+
const transferFee = 3140;
136+
const issuer = "rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2";
137+
const nftokenTaxon = 146999694;
138+
const sequence = 3429;
139+
140+
// NOTE: This function is not minting NFTokenID, it is just encoding it from the data provided, can be used if you want to test something, check if the NFTokenID is valid, or predict the NFTokenID before minting
141+
const result = BithompXRPL.Models.buildNFTokenID(flags, transferFee, issuer, nftokenTaxon, sequence);
142+
// result will contain NFTokenID
143+
// "000B0C4495F14B0E44F78A264E41713C64B5F89242540EE2BC8B858E00000D65"
144+
```

package-lock.json

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@
5151
"elliptic": "^6.5.4",
5252
"lodash": "^4.17.21",
5353
"ripple-address-codec": "^4.3.0",
54-
"ripple-binary-codec": "^1.7.1",
55-
"xrpl": "^2.9.1"
54+
"ripple-binary-codec": "^1.8.0",
55+
"xrpl": "^2.10.0"
5656
},
5757
"devDependencies": {
58-
"@types/lodash": "^4.14.196",
58+
"@types/lodash": "^4.14.197",
5959
"@types/chai": "^4.3.5",
6060
"@types/chai-as-promised": "^7.1.5",
6161
"@types/mocha": "^10.0.1",
6262
"@types/nconf": "^0.10.3",
63-
"@types/node": "^20.4.5",
63+
"@types/node": "^20.4.9",
6464
"chai": "^4.3.7",
6565
"chai-as-promised": "^7.1.1",
6666
"mocha": "^10.2.0",

0 commit comments

Comments
 (0)