mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
Fix require destination tags code sample
This commit is contained in:
@@ -9,11 +9,13 @@ if (typeof module !== "undefined") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Connect -------------------------------------------------------------------
|
// Connect -------------------------------------------------------------------
|
||||||
api = new ripple.RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
async function main() {
|
||||||
api.connect()
|
console.log("Connecting to Testnet...")
|
||||||
api.on('connected', async () => {
|
const api = new ripple.RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||||
|
await api.connect()
|
||||||
|
|
||||||
// Get credentials from the Testnet Faucet -----------------------------------
|
// Get credentials from the Testnet Faucet -----------------------------------
|
||||||
|
console.log("Requesting addresses from the Testnet faucet...")
|
||||||
const data = await api.generateFaucetWallet()
|
const data = await api.generateFaucetWallet()
|
||||||
const address = data.account.address
|
const address = data.account.address
|
||||||
const secret = data.account.secret
|
const secret = data.account.secret
|
||||||
@@ -58,7 +60,7 @@ api.on('connected', async () => {
|
|||||||
min_ledger: ${min_ledger}`)
|
min_ledger: ${min_ledger}`)
|
||||||
let tx_status
|
let tx_status
|
||||||
try {
|
try {
|
||||||
tx_status = await lookup_tx_final(tx_id, max_ledger, min_ledger)
|
tx_status = await lookup_tx_final(api, tx_id, max_ledger, min_ledger)
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
tx_status = err
|
tx_status = err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user