mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-12-06 01:07:59 +00:00
xrpl.js 2.0: small code updates
This commit is contained in:
@@ -10,8 +10,8 @@ async function main() {
|
||||
await client.connect()
|
||||
|
||||
// Create a wallet and fund it with the Testnet faucet:
|
||||
const test_wallet = new xrpl.Wallet() // TODO: change to define based on fundWallet result
|
||||
const fund_result = await client.fundWallet(test_wallet)
|
||||
const test_wallet = fund_result.wallet
|
||||
console.log(fund_result)
|
||||
|
||||
// Get info from the ledger about the address we just funded
|
||||
|
||||
@@ -32,10 +32,7 @@ api.on('connected', async () => {
|
||||
// The earliest ledger a transaction could appear in is the first ledger
|
||||
// after the one that's already validated at the time it's *first* submitted.
|
||||
const min_ledger = (await api.getLedgerIndex()) + 1
|
||||
const result = await api.request({
|
||||
"command": "submit",
|
||||
"tx_blob": signed.tx_blob
|
||||
})
|
||||
const result = await api.submit(signed.tx_blob)
|
||||
console.log("Tentative result code:", result.result.engine_result)
|
||||
console.log("Tentative result message:", result.result.engine_result_message)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user