mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-28 07:35:50 +00:00
Add validate and comment to all transactions
This commit is contained in:
@@ -22,6 +22,9 @@ async function main() {
|
||||
peer: counterparty_address,
|
||||
}
|
||||
|
||||
// Best practice for JS users - validate checks if a transaction is well-formed
|
||||
xrpl.validate(account_lines)
|
||||
|
||||
console.log(`Looking up all trust lines from
|
||||
${counterparty_address} to ${my_address}`)
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@ async function main() {
|
||||
SetFlag: xrpl.AccountSetAsfFlags.asfGlobalFreeze
|
||||
}
|
||||
|
||||
// Best practice for JS users - validate checks if a transaction is well-formed
|
||||
xrpl.validate(accountSetTx)
|
||||
|
||||
// Sign and submit the AccountSet transaction to enable a global freeze -------
|
||||
console.log('Signing and submitting the transaction:', accountSetTx)
|
||||
await client.submitAndWait(wallet, accountSetTx)
|
||||
@@ -51,6 +54,9 @@ async function main() {
|
||||
ClearFlag: xrpl.AccountSetAsfFlags.asfGlobalFreeze
|
||||
}
|
||||
|
||||
// Best practice for JS users - validate checks if a transaction is well-formed
|
||||
xrpl.validate(accountSetTx2)
|
||||
|
||||
// Sign and submit the AccountSet transaction to enable a global freeze -------
|
||||
console.log('Signing and submitting the transaction:', accountSetTx2)
|
||||
const result = await client.submitAndWait(wallet, accountSetTx2)
|
||||
|
||||
@@ -22,6 +22,9 @@ async function main() {
|
||||
SetFlag: xrpl.AccountSetAsfFlags.asfGlobalFreeze
|
||||
}
|
||||
|
||||
// Best practice for JS users - validate checks if a transaction is well-formed
|
||||
xrpl.validate(accountSetTx)
|
||||
|
||||
// Sign and submit the AccountSet transaction to enable a global freeze ------
|
||||
console.log('Signing and submitting the transaction:', accountSetTx)
|
||||
await client.submitAndWait(wallet, accountSetTx)
|
||||
@@ -40,6 +43,9 @@ async function main() {
|
||||
ClearFlag: xrpl.AccountSetAsfFlags.asfGlobalFreeze
|
||||
}
|
||||
|
||||
// Best practice for JS users - validate checks if a transaction is well-formed
|
||||
xrpl.validate(accountSetTx2)
|
||||
|
||||
// Sign and submit the AccountSet transaction to end a global freeze ---------
|
||||
console.log('Signing and submitting the transaction:', accountSetTx2)
|
||||
const result = await client.submitAndWait(wallet, accountSetTx2)
|
||||
|
||||
@@ -73,6 +73,9 @@ async function main() {
|
||||
// Set a flag to freeze the trust line --------------------------------------------
|
||||
trust_set.Flags = xrpl.TrustSetFlags.tfSetFreeze
|
||||
|
||||
// Best practice for JS users - validate checks if a transaction is well-formed
|
||||
xrpl.validate(trust_set)
|
||||
|
||||
// Submit a TrustSet transaction to set an individual freeze ----------------------
|
||||
console.log('Submitting TrustSet tx:', trust_set)
|
||||
const result = await client.submitAndWait(wallet, trust_set)
|
||||
|
||||
@@ -23,6 +23,9 @@ async function main() {
|
||||
SetFlag: xrpl.AccountSetAsfFlags.asfNoFreeze
|
||||
}
|
||||
|
||||
// Best practice for JS users - validate checks if a transaction is well-formed
|
||||
xrpl.validate(accountSetTx)
|
||||
|
||||
console.log('Sign and submit the transaction:', accountSetTx)
|
||||
await client.submitAndWait(wallet, accountSetTx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user