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
import { XrplClient } from 'xrpl-client' | |
const config = { backfillLedgers: 20, lastLedger: null } | |
const client = new XrplClient(['wss://xrplcluster.com']) | |
await client.ready() | |
config.lastLedger = client.getState().ledger.last - config.backfillLedgers | |
function getLedgerTransactions(ledger_index) { | |
return client.send({ command: 'ledger', transactions: true, expand: true, ledger_index }) |
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
//pass tx as returned from ledger | |
ntfDeriveSale(tx) { | |
let hash = tx.hash || tx.transaction.hash | |
let trade = {} | |
let taker = tx.Account | |
for(let affected of (tx.meta || tx.metaData).AffectedNodes){ | |
let node = affected.DeletedNode | |
if(!node || node.LedgerEntryType !== 'NFTokenOffer') | |
continue |
OlderNewer