mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 19:55:54 +00:00
NFT: Update Fields for v2.2.1 (#1400)
* update: 2.2.1 * fixup: nft field changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script src='https://unpkg.com/xrpl@2.1.0-beta.1'></script>
|
<script src='https://unpkg.com/xrpl@2.2.1/build/xrpl-latest-min.js'></script>
|
||||||
<script>
|
<script>
|
||||||
if (typeof module !== "undefined") var xrpl = require('xrpl')
|
if (typeof module !== "undefined") var xrpl = require('xrpl')
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ async function mintToken() {
|
|||||||
Account: wallet.classicAddress,
|
Account: wallet.classicAddress,
|
||||||
URI: xrpl.convertStringToHex(tokenUrl.value),
|
URI: xrpl.convertStringToHex(tokenUrl.value),
|
||||||
Flags: parseInt(flags.value),
|
Flags: parseInt(flags.value),
|
||||||
TokenTaxon: 0 //Required, but if you have no use for it, set to zero.
|
NFTokenTaxon: 0 //Required, but if you have no use for it, set to zero.
|
||||||
}
|
}
|
||||||
// Submit signed blob --------------------------------------------------------
|
// Submit signed blob --------------------------------------------------------
|
||||||
const tx = await client.submitAndWait(transactionBlob,{wallet})
|
const tx = await client.submitAndWait(transactionBlob,{wallet})
|
||||||
@@ -71,7 +71,7 @@ async function burnToken() {
|
|||||||
const transactionBlob = {
|
const transactionBlob = {
|
||||||
"TransactionType": "NFTokenBurn",
|
"TransactionType": "NFTokenBurn",
|
||||||
"Account": wallet.classicAddress,
|
"Account": wallet.classicAddress,
|
||||||
"TokenID": tokenId.value
|
"NFTokenID": tokenId.value
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submit signed blob --------------------------------------------------------
|
// Submit signed blob --------------------------------------------------------
|
||||||
@@ -103,7 +103,7 @@ async function createSellOffer() {
|
|||||||
const transactionBlob = {
|
const transactionBlob = {
|
||||||
"TransactionType": "NFTokenCreateOffer",
|
"TransactionType": "NFTokenCreateOffer",
|
||||||
"Account": wallet.classicAddress,
|
"Account": wallet.classicAddress,
|
||||||
"TokenID": tokenId.value,
|
"NFTokenID": tokenId.value,
|
||||||
"Amount": amount.value,
|
"Amount": amount.value,
|
||||||
"Flags": parseInt(flags.value)
|
"Flags": parseInt(flags.value)
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ async function createSellOffer() {
|
|||||||
try {
|
try {
|
||||||
nftSellOffers = await client.request({
|
nftSellOffers = await client.request({
|
||||||
method: "nft_sell_offers",
|
method: "nft_sell_offers",
|
||||||
tokenid: tokenId.value
|
nft_id:tokenId.value
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("No sell offers.")
|
console.log("No sell offers.")
|
||||||
@@ -129,7 +129,7 @@ async function createSellOffer() {
|
|||||||
try {
|
try {
|
||||||
nftBuyOffers = await client.request({
|
nftBuyOffers = await client.request({
|
||||||
method: "nft_buy_offers",
|
method: "nft_buy_offers",
|
||||||
tokenid: tokenId.value })
|
nft_id:tokenId.value })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("No buy offers.")
|
console.log("No buy offers.")
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ async function createBuyOffer() {
|
|||||||
"TransactionType": "NFTokenCreateOffer",
|
"TransactionType": "NFTokenCreateOffer",
|
||||||
"Account": wallet.classicAddress,
|
"Account": wallet.classicAddress,
|
||||||
"Owner": owner.value,
|
"Owner": owner.value,
|
||||||
"TokenID": tokenId.value,
|
"NFTokenID": tokenId.value,
|
||||||
"Amount": amount.value,
|
"Amount": amount.value,
|
||||||
"Flags": parseInt(flags.value)
|
"Flags": parseInt(flags.value)
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ async function createBuyOffer() {
|
|||||||
try {
|
try {
|
||||||
nftSellOffers = await client.request({
|
nftSellOffers = await client.request({
|
||||||
method: "nft_sell_offers",
|
method: "nft_sell_offers",
|
||||||
tokenid: tokenId.value
|
nft_id: tokenId.value
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("No sell offers.")
|
console.log("No sell offers.")
|
||||||
@@ -183,7 +183,7 @@ async function createBuyOffer() {
|
|||||||
try {
|
try {
|
||||||
nftBuyOffers = await client.request({
|
nftBuyOffers = await client.request({
|
||||||
method: "nft_buy_offers",
|
method: "nft_buy_offers",
|
||||||
tokenid: tokenId.value })
|
nft_id: tokenId.value })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("No buy offers.")
|
console.log("No buy offers.")
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ async function cancelOffer() {
|
|||||||
const transactionBlob = {
|
const transactionBlob = {
|
||||||
"TransactionType": "NFTokenCancelOffer",
|
"TransactionType": "NFTokenCancelOffer",
|
||||||
"Account": wallet.classicAddress,
|
"Account": wallet.classicAddress,
|
||||||
"TokenOffers": tokenOffers
|
"NFTokenOffers": tokenOffers
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submit signed blob --------------------------------------------------------
|
// Submit signed blob --------------------------------------------------------
|
||||||
@@ -229,7 +229,7 @@ async function cancelOffer() {
|
|||||||
try {
|
try {
|
||||||
nftSellOffers = await client.request({
|
nftSellOffers = await client.request({
|
||||||
method: "nft_sell_offers",
|
method: "nft_sell_offers",
|
||||||
tokenid: tokenId.value
|
nft_id:tokenId.value
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("No sell offers.")
|
console.log("No sell offers.")
|
||||||
@@ -240,7 +240,7 @@ async function cancelOffer() {
|
|||||||
try {
|
try {
|
||||||
nftBuyOffers = await client.request({
|
nftBuyOffers = await client.request({
|
||||||
method: "nft_buy_offers",
|
method: "nft_buy_offers",
|
||||||
tokenid: tokenId.value })
|
nft_id:tokenId.value })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("No buy offers.")
|
console.log("No buy offers.")
|
||||||
}
|
}
|
||||||
@@ -267,11 +267,12 @@ async function getOffers() {
|
|||||||
await client.connect()
|
await client.connect()
|
||||||
console.log("Connected to Sandbox")
|
console.log("Connected to Sandbox")
|
||||||
console.log("***Sell Offers***")
|
console.log("***Sell Offers***")
|
||||||
|
|
||||||
let nftSellOffers
|
let nftSellOffers
|
||||||
try {
|
try {
|
||||||
nftSellOffers = await client.request({
|
nftSellOffers = await client.request({
|
||||||
method: "nft_sell_offers",
|
method: "nft_sell_offers",
|
||||||
tokenid: tokenId.value
|
nft_id: tokenId.value
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("No sell offers.")
|
console.log("No sell offers.")
|
||||||
@@ -282,7 +283,7 @@ async function getOffers() {
|
|||||||
try {
|
try {
|
||||||
nftBuyOffers = await client.request({
|
nftBuyOffers = await client.request({
|
||||||
method: "nft_buy_offers",
|
method: "nft_buy_offers",
|
||||||
tokenid: tokenId.value })
|
nft_id:tokenId.value })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("No buy offers.")
|
console.log("No buy offers.")
|
||||||
}
|
}
|
||||||
@@ -305,7 +306,7 @@ async function acceptSellOffer() {
|
|||||||
const transactionBlob = {
|
const transactionBlob = {
|
||||||
"TransactionType": "NFTokenAcceptOffer",
|
"TransactionType": "NFTokenAcceptOffer",
|
||||||
"Account": wallet.classicAddress,
|
"Account": wallet.classicAddress,
|
||||||
"SellOffer": tokenOfferIndex.value,
|
"NFTokenSellOffer": tokenOfferIndex.value,
|
||||||
}
|
}
|
||||||
// Submit signed blob --------------------------------------------------------
|
// Submit signed blob --------------------------------------------------------
|
||||||
const tx = await client.submitAndWait(transactionBlob,{wallet})
|
const tx = await client.submitAndWait(transactionBlob,{wallet})
|
||||||
@@ -338,7 +339,7 @@ async function acceptBuyOffer() {
|
|||||||
const transactionBlob = {
|
const transactionBlob = {
|
||||||
"TransactionType": "NFTokenAcceptOffer",
|
"TransactionType": "NFTokenAcceptOffer",
|
||||||
"Account": wallet.classicAddress,
|
"Account": wallet.classicAddress,
|
||||||
"BuyOffer": tokenOfferIndex.value
|
"NFTokenBuyOffer": tokenOfferIndex.value
|
||||||
}
|
}
|
||||||
// Submit signed blob --------------------------------------------------------
|
// Submit signed blob --------------------------------------------------------
|
||||||
const tx = await client.submitAndWait(transactionBlob,{wallet})
|
const tx = await client.submitAndWait(transactionBlob,{wallet})
|
||||||
|
|||||||
Reference in New Issue
Block a user