mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
changes based on mduo review
This commit is contained in:
@@ -121,7 +121,7 @@ Connect to the ledger and get the account wallet.
|
|||||||
Define the AccountSet transaction, setting the `NFTokenMinter` account and the `asfAuthorizedNFTokenMinter` flag.
|
Define the AccountSet transaction, setting the `NFTokenMinter` account and the `asfAuthorizedNFTokenMinter` flag.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
tx_blob = {
|
tx_json = {
|
||||||
"TransactionType": "AccountSet",
|
"TransactionType": "AccountSet",
|
||||||
"Account": my_wallet.address,
|
"Account": my_wallet.address,
|
||||||
```
|
```
|
||||||
@@ -149,20 +149,20 @@ Report progress.
|
|||||||
Prepare and send the transaction, then wait for results
|
Prepare and send the transaction, then wait for results
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const cst_prepared = await client.autofill(tx_blob)
|
const prepared = await client.autofill(tx_json)
|
||||||
const cst_signed = my_wallet.sign(cst_prepared)
|
const signed = my_wallet.sign(prepared)
|
||||||
const cst_result = await client.submitAndWait(cst_signed.tx_blob)
|
const result = await client.submitAndWait(signed.tx_json)
|
||||||
```
|
```
|
||||||
|
|
||||||
If the transaction succeeds, stringify the results and report. If not, report that the transaction failed.
|
If the transaction succeeds, stringify the results and report. If not, report that the transaction failed.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
if (cst_result.result.meta.TransactionResult == "tesSUCCESS") {
|
if (result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||||
results += '\nAccount setting succeeded.'
|
results += '\nAccount setting succeeded.'
|
||||||
results += JSON.stringify(cst_result,null,2)
|
results += JSON.stringify(result,null,2)
|
||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
} else {
|
} else {
|
||||||
throw 'Error sending transaction: ${cst_result}'
|
throw 'Error sending transaction: ${result}'
|
||||||
results += '\nAccount setting failed.'
|
results += '\nAccount setting failed.'
|
||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
}
|
}
|
||||||
@@ -205,7 +205,7 @@ Report success
|
|||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
```
|
```
|
||||||
|
|
||||||
This transaction blob is the same as the one used for the previous `Mint Token` function, with the addition of the `Issuer` field.
|
This transaction blob is the same as the one used for the previous [`mintToken()` function](mint-and-burn-nftokens.html#mint-token), with the addition of the `Issuer` field.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const transactionBlob = {
|
const transactionBlob = {
|
||||||
@@ -219,7 +219,7 @@ The URI is a link to a data file represented by the NFToken.
|
|||||||
"URI": xrpl.convertStringToHex(standbyTokenUrlField.value),
|
"URI": xrpl.convertStringToHex(standbyTokenUrlField.value),
|
||||||
```
|
```
|
||||||
|
|
||||||
At a minimum, we recommend that you set the tfTransferable flag (8) to enable accounts to sell and resell the NFToken for testing purposes.
|
At a minimum, we recommend that you set the `tfTransferable` flag (8) to enable accounts to sell and resell the NFToken for testing purposes.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
"Flags": parseInt(standbyFlagsField.value),
|
"Flags": parseInt(standbyFlagsField.value),
|
||||||
@@ -291,7 +291,7 @@ async function oPsetMinter(type) {
|
|||||||
my_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
my_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
|
|
||||||
tx_blob = {
|
tx_json = {
|
||||||
"TransactionType": "AccountSet",
|
"TransactionType": "AccountSet",
|
||||||
"Account": my_wallet.address,
|
"Account": my_wallet.address,
|
||||||
"NFTokenMinter": operationalMinterField.value,
|
"NFTokenMinter": operationalMinterField.value,
|
||||||
@@ -300,15 +300,15 @@ async function oPsetMinter(type) {
|
|||||||
results += '\n Set Minter.'
|
results += '\n Set Minter.'
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
|
|
||||||
const cst_prepared = await client.autofill(tx_blob)
|
const prepared = await client.autofill(tx_json)
|
||||||
const cst_signed = my_wallet.sign(cst_prepared)
|
const signed = my_wallet.sign(prepared)
|
||||||
const cst_result = await client.submitAndWait(cst_signed.tx_blob)
|
const result = await client.submitAndWait(signed.tx_json)
|
||||||
if (cst_result.result.meta.TransactionResult == "tesSUCCESS") {
|
if (result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||||
results += '\nAccount setting succeeded.'
|
results += '\nAccount setting succeeded.'
|
||||||
results += JSON.stringify(cst_result,null,2)
|
results += JSON.stringify(result,null,2)
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
} else {
|
} else {
|
||||||
throw 'Error sending transaction: ${cst_result}'
|
throw 'Error sending transaction: ${result}'
|
||||||
results += '\nAccount setting failed.'
|
results += '\nAccount setting failed.'
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user