mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-22 13:15:49 +00:00
Use TypeScript project reference (#1002)
* Add *.tsbuildinfo to .gitignore * Bump versions of dependencies, nyc and yargs * Drop support for node 9 (EOL 2018-06-30) https://github.com/nodejs/Release * Add getTransaction snippet
This commit is contained in:
17
snippets/src/getTransaction.ts
Normal file
17
snippets/src/getTransaction.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import {RippleAPI} from '../../dist/npm'
|
||||
|
||||
const api = new RippleAPI({
|
||||
server: 'wss://s.altnet.rippletest.net:51233'
|
||||
})
|
||||
|
||||
getTransaction()
|
||||
|
||||
async function getTransaction() {
|
||||
await api.connect()
|
||||
const ledger = await api.getLedger({includeTransactions: true})
|
||||
console.log(ledger)
|
||||
const tx = await api.getTransaction(ledger.transactionHashes[0])
|
||||
console.log(tx)
|
||||
console.log('deliveredAmount:', tx.outcome.deliveredAmount)
|
||||
process.exit(0)
|
||||
}
|
||||
Reference in New Issue
Block a user