Created
April 6, 2025 21:47
-
-
Save shortthefomo/83512710ff45a8a3e51c3c4fe0f3f7fa to your computer and use it in GitHub Desktop.
simulate_fail.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const { XrplClient } = require('xrpl-client') | |
const ClientConnection = 'wss://s.altnet.rippletest.net:51233' | |
class backend { | |
constructor() { | |
const xrpl = new XrplClient([ClientConnection], { tryAllNodes: false }) | |
const account1 = 'rHXLvjpSHShBVU1ki3nbt8fRM9LpZycvFh' //sEd7PGtUa7oJTBrhee46biNiStqFKew | |
const account2 = 'rNzYUegBWe1FZc1USQqbZLz4RxdMVq2jMg' //sEdVpJL8WL5eKTr17iqQhjHDjLybGUM | |
Object.assign(this, { | |
async simulate_account1() { | |
console.log('simulate 1') | |
const tx_send = { | |
TransactionType: 'Payment', | |
Account: account1, | |
Destination: account2, | |
Amount: String(1_000_000), | |
} | |
const response = await xrpl.send({ | |
command: 'simulate', | |
tx_json: tx_send | |
}) | |
console.log(response) | |
}, | |
async simulate_account2() { | |
console.log('simulate 2') | |
const tx_send = { | |
TransactionType: 'Payment', | |
Account: account2, | |
Destination: account1, | |
Amount: String(1_000_000), | |
} | |
const response = await xrpl.send({ | |
command: 'simulate', | |
tx_json: tx_send | |
}) | |
console.log(response) | |
}, | |
}) | |
} | |
} | |
const main = new backend() | |
log('starting') | |
main.simulate_account1() | |
main.simulate_account2() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment