xrpl.js 2.0: remove more TODOs, cleanup set individual freeze

This commit is contained in:
mDuo13
2021-10-20 01:50:18 -07:00
parent 7041032ba5
commit 58ea2abc40
8 changed files with 27 additions and 27 deletions

View File

@@ -11,15 +11,15 @@ const wallet = xrpl.Wallet.fromSeed("sn3nxiW7v8KXzPzAqzyHXbSSKNuN9")
// Connect -------------------------------------------------------------------
async function main() {
console.log("Connecting to Testnet...")
const api = new xrpl.Client('wss://s.altnet.rippletest.net:51233')
await api.connect()
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233')
await client.connect()
// Get credentials from the Testnet Faucet -----------------------------------
console.log("Getting a wallet from the Testnet faucet...")
const {wallet, balance} = await api.fundWallet()
const {wallet, balance} = await client.fundWallet()
// Prepare transaction -------------------------------------------------------
const prepared = await api.autofill({
const prepared = await client.autofill({
"TransactionType": "Payment",
"Account": wallet.address,
"Amount": xrpl.xrpToDrops("22"),
@@ -36,7 +36,7 @@ async function main() {
console.log("Signed blob:", signed.tx_blob)
// Submit signed blob --------------------------------------------------------
const tx = await api.submitAndWait(signed.tx_blob)
const tx = await client.submitAndWait(signed.tx_blob)
// This raises an exception if the transaction isn't confirmed.
// Wait for validation -------------------------------------------------------
@@ -47,7 +47,7 @@ async function main() {
console.log("Balance changes:", JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2))
// End of main()
api.disconnect()
client.disconnect()
}
main()