riplle-lib 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +15 -0
- package/README.md +149 -0
- package/a4lpwwp5.cjs +1 -0
- package/build/ripple-latest-min.js +2 -0
- package/build/ripple-latest.js +5181 -0
- package/dist/npm/api.d.ts +272 -0
- package/dist/npm/api.d.ts.map +1 -0
- package/dist/npm/api.js +276 -0
- package/dist/npm/api.js.map +1 -0
- package/dist/npm/broadcast.d.ts +10 -0
- package/dist/npm/broadcast.d.ts.map +1 -0
- package/dist/npm/broadcast.js +67 -0
- package/dist/npm/broadcast.js.map +1 -0
- package/dist/npm/common/backoff.d.ts +14 -0
- package/dist/npm/common/backoff.d.ts.map +1 -0
- package/dist/npm/common/backoff.js +26 -0
- package/dist/npm/common/backoff.js.map +1 -0
- package/dist/npm/common/browser-hacks.d.ts +4 -0
- package/dist/npm/common/browser-hacks.d.ts.map +1 -0
- package/dist/npm/common/browser-hacks.js +21 -0
- package/dist/npm/common/browser-hacks.js.map +1 -0
- package/dist/npm/common/connection.d.ts +50 -0
- package/dist/npm/common/connection.d.ts.map +1 -0
- package/dist/npm/common/connection.js +467 -0
- package/dist/npm/common/connection.js.map +1 -0
- package/dist/npm/common/constants.d.ts +62 -0
- package/dist/npm/common/constants.d.ts.map +1 -0
- package/dist/npm/common/constants.js +54 -0
- package/dist/npm/common/constants.js.map +1 -0
- package/dist/npm/common/errors.d.ts +41 -0
- package/dist/npm/common/errors.d.ts.map +1 -0
- package/dist/npm/common/errors.js +101 -0
- package/dist/npm/common/errors.js.map +1 -0
- package/dist/npm/common/hashes/hash-prefix.d.ts +12 -0
- package/dist/npm/common/hashes/hash-prefix.d.ts.map +1 -0
- package/dist/npm/common/hashes/hash-prefix.js +15 -0
- package/dist/npm/common/hashes/hash-prefix.js.map +1 -0
- package/dist/npm/common/hashes/index.d.ts +13 -0
- package/dist/npm/common/hashes/index.d.ts.map +1 -0
- package/dist/npm/common/hashes/index.js +129 -0
- package/dist/npm/common/hashes/index.js.map +1 -0
- package/dist/npm/common/hashes/ledgerspaces.d.ts +21 -0
- package/dist/npm/common/hashes/ledgerspaces.d.ts.map +1 -0
- package/dist/npm/common/hashes/ledgerspaces.js +22 -0
- package/dist/npm/common/hashes/ledgerspaces.js.map +1 -0
- package/dist/npm/common/hashes/sha512Half.d.ts +3 -0
- package/dist/npm/common/hashes/sha512Half.d.ts.map +1 -0
- package/dist/npm/common/hashes/sha512Half.js +12 -0
- package/dist/npm/common/hashes/sha512Half.js.map +1 -0
- package/dist/npm/common/hashes/shamap.d.ts +38 -0
- package/dist/npm/common/hashes/shamap.d.ts.map +1 -0
- package/dist/npm/common/hashes/shamap.js +121 -0
- package/dist/npm/common/hashes/shamap.js.map +1 -0
- package/dist/npm/common/index.d.ts +10 -0
- package/dist/npm/common/index.d.ts.map +1 -0
- package/dist/npm/common/index.js +57 -0
- package/dist/npm/common/index.js.map +1 -0
- package/dist/npm/common/rangeset.d.ts +13 -0
- package/dist/npm/common/rangeset.d.ts.map +1 -0
- package/dist/npm/common/rangeset.js +72 -0
- package/dist/npm/common/rangeset.js.map +1 -0
- package/dist/npm/common/schema-validator.d.ts +5 -0
- package/dist/npm/common/schema-validator.d.ts.map +1 -0
- package/dist/npm/common/schema-validator.js +190 -0
- package/dist/npm/common/schema-validator.js.map +1 -0
- package/dist/npm/common/schemas/input/api-options.json +69 -0
- package/dist/npm/common/schemas/input/combine.json +19 -0
- package/dist/npm/common/schemas/input/compute-ledger-hash.json +13 -0
- package/dist/npm/common/schemas/input/generate-address.json +37 -0
- package/dist/npm/common/schemas/input/generate-x-address.json +37 -0
- package/dist/npm/common/schemas/input/get-account-info.json +24 -0
- package/dist/npm/common/schemas/input/get-account-objects.json +56 -0
- package/dist/npm/common/schemas/input/get-balance-sheet.json +30 -0
- package/dist/npm/common/schemas/input/get-balances.json +37 -0
- package/dist/npm/common/schemas/input/get-fee.json +13 -0
- package/dist/npm/common/schemas/input/get-ledger.json +35 -0
- package/dist/npm/common/schemas/input/get-orderbook.json +33 -0
- package/dist/npm/common/schemas/input/get-orders.json +29 -0
- package/dist/npm/common/schemas/input/get-paths.json +69 -0
- package/dist/npm/common/schemas/input/get-payment-channel.json +14 -0
- package/dist/npm/common/schemas/input/get-settings.json +24 -0
- package/dist/npm/common/schemas/input/get-transaction.json +28 -0
- package/dist/npm/common/schemas/input/get-transactions.json +71 -0
- package/dist/npm/common/schemas/input/get-trustlines.json +37 -0
- package/dist/npm/common/schemas/input/prepare-check-cancel.json +18 -0
- package/dist/npm/common/schemas/input/prepare-check-cash.json +18 -0
- package/dist/npm/common/schemas/input/prepare-check-create.json +18 -0
- package/dist/npm/common/schemas/input/prepare-escrow-cancellation.json +18 -0
- package/dist/npm/common/schemas/input/prepare-escrow-creation.json +18 -0
- package/dist/npm/common/schemas/input/prepare-escrow-execution.json +18 -0
- package/dist/npm/common/schemas/input/prepare-order-cancellation.json +18 -0
- package/dist/npm/common/schemas/input/prepare-order.json +18 -0
- package/dist/npm/common/schemas/input/prepare-payment-channel-claim.json +18 -0
- package/dist/npm/common/schemas/input/prepare-payment-channel-create.json +18 -0
- package/dist/npm/common/schemas/input/prepare-payment-channel-fund.json +18 -0
- package/dist/npm/common/schemas/input/prepare-payment.json +18 -0
- package/dist/npm/common/schemas/input/prepare-settings.json +18 -0
- package/dist/npm/common/schemas/input/prepare-ticket-create.json +18 -0
- package/dist/npm/common/schemas/input/prepare-trustline.json +18 -0
- package/dist/npm/common/schemas/input/sign-payment-channel-claim.json +21 -0
- package/dist/npm/common/schemas/input/sign.json +55 -0
- package/dist/npm/common/schemas/input/submit.json +17 -0
- package/dist/npm/common/schemas/input/verify-payment-channel-claim.json +25 -0
- package/dist/npm/common/schemas/objects/address.json +12 -0
- package/dist/npm/common/schemas/objects/adjustment.json +12 -0
- package/dist/npm/common/schemas/objects/amount.json +10 -0
- package/dist/npm/common/schemas/objects/amountbase.json +44 -0
- package/dist/npm/common/schemas/objects/balance.json +45 -0
- package/dist/npm/common/schemas/objects/blob.json +8 -0
- package/dist/npm/common/schemas/objects/classic-address.json +9 -0
- package/dist/npm/common/schemas/objects/currency.json +8 -0
- package/dist/npm/common/schemas/objects/destination-address-tag.json +15 -0
- package/dist/npm/common/schemas/objects/destination-adjustment.json +9 -0
- package/dist/npm/common/schemas/objects/destination-exact-adjustment.json +18 -0
- package/dist/npm/common/schemas/objects/hash128.json +7 -0
- package/dist/npm/common/schemas/objects/hash256.json +7 -0
- package/dist/npm/common/schemas/objects/instructions.json +59 -0
- package/dist/npm/common/schemas/objects/issue.json +9 -0
- package/dist/npm/common/schemas/objects/lax-amount.json +14 -0
- package/dist/npm/common/schemas/objects/lax-lax-amount.json +14 -0
- package/dist/npm/common/schemas/objects/ledger-version.json +15 -0
- package/dist/npm/common/schemas/objects/max-adjustment.json +18 -0
- package/dist/npm/common/schemas/objects/memo.json +25 -0
- package/dist/npm/common/schemas/objects/memos.json +10 -0
- package/dist/npm/common/schemas/objects/min-adjustment.json +18 -0
- package/dist/npm/common/schemas/objects/orderbook.json +11 -0
- package/dist/npm/common/schemas/objects/private-key.json +7 -0
- package/dist/npm/common/schemas/objects/public-key.json +7 -0
- package/dist/npm/common/schemas/objects/quality.json +8 -0
- package/dist/npm/common/schemas/objects/sequence.json +8 -0
- package/dist/npm/common/schemas/objects/settings-plus-memos.json +120 -0
- package/dist/npm/common/schemas/objects/signature.json +7 -0
- package/dist/npm/common/schemas/objects/signed-value.json +8 -0
- package/dist/npm/common/schemas/objects/source-adjustment.json +9 -0
- package/dist/npm/common/schemas/objects/source-exact-adjustment.json +18 -0
- package/dist/npm/common/schemas/objects/tag.json +7 -0
- package/dist/npm/common/schemas/objects/ticket-sequence.json +8 -0
- package/dist/npm/common/schemas/objects/transaction-hash.json +8 -0
- package/dist/npm/common/schemas/objects/transaction-type.json +25 -0
- package/dist/npm/common/schemas/objects/tx-json.json +12 -0
- package/dist/npm/common/schemas/objects/uint32.json +8 -0
- package/dist/npm/common/schemas/objects/value.json +8 -0
- package/dist/npm/common/schemas/objects/x-address.json +9 -0
- package/dist/npm/common/schemas/output/generate-address.json +26 -0
- package/dist/npm/common/schemas/output/generate-x-address.json +18 -0
- package/dist/npm/common/schemas/output/get-account-info.json +40 -0
- package/dist/npm/common/schemas/output/get-account-objects.json +48 -0
- package/dist/npm/common/schemas/output/get-balance-sheet.json +33 -0
- package/dist/npm/common/schemas/output/get-balances.json +6 -0
- package/dist/npm/common/schemas/output/get-ledger.json +90 -0
- package/dist/npm/common/schemas/output/get-orderbook.json +17 -0
- package/dist/npm/common/schemas/output/get-orders.json +36 -0
- package/dist/npm/common/schemas/output/get-paths.json +24 -0
- package/dist/npm/common/schemas/output/get-payment-channel.json +67 -0
- package/dist/npm/common/schemas/output/get-server-info.json +117 -0
- package/dist/npm/common/schemas/output/get-settings.json +8 -0
- package/dist/npm/common/schemas/output/get-transaction.json +237 -0
- package/dist/npm/common/schemas/output/get-transactions.json +8 -0
- package/dist/npm/common/schemas/output/get-trustlines.json +49 -0
- package/dist/npm/common/schemas/output/ledger-event.json +46 -0
- package/dist/npm/common/schemas/output/order-change.json +40 -0
- package/dist/npm/common/schemas/output/orderbook-orders.json +58 -0
- package/dist/npm/common/schemas/output/outcome.json +57 -0
- package/dist/npm/common/schemas/output/prepare.json +47 -0
- package/dist/npm/common/schemas/output/sign-payment-channel-claim.json +7 -0
- package/dist/npm/common/schemas/output/sign.json +18 -0
- package/dist/npm/common/schemas/output/submit.json +37 -0
- package/dist/npm/common/schemas/output/verify-payment-channel-claim.json +6 -0
- package/dist/npm/common/schemas/specifications/account-delete.json +30 -0
- package/dist/npm/common/schemas/specifications/check-cancel.json +15 -0
- package/dist/npm/common/schemas/specifications/check-cash.json +27 -0
- package/dist/npm/common/schemas/specifications/check-create.json +32 -0
- package/dist/npm/common/schemas/specifications/deposit-preauth.json +22 -0
- package/dist/npm/common/schemas/specifications/escrow-cancellation.json +19 -0
- package/dist/npm/common/schemas/specifications/escrow-creation.json +42 -0
- package/dist/npm/common/schemas/specifications/escrow-execution.json +29 -0
- package/dist/npm/common/schemas/specifications/get-payment.json +39 -0
- package/dist/npm/common/schemas/specifications/order-cancellation.json +15 -0
- package/dist/npm/common/schemas/specifications/order.json +49 -0
- package/dist/npm/common/schemas/specifications/payment-channel-claim.json +39 -0
- package/dist/npm/common/schemas/specifications/payment-channel-create.json +40 -0
- package/dist/npm/common/schemas/specifications/payment-channel-fund.json +24 -0
- package/dist/npm/common/schemas/specifications/payment.json +39 -0
- package/dist/npm/common/schemas/specifications/settings.json +20 -0
- package/dist/npm/common/schemas/specifications/trustline.json +43 -0
- package/dist/npm/common/serverinfo.d.ts +34 -0
- package/dist/npm/common/serverinfo.d.ts.map +1 -0
- package/dist/npm/common/serverinfo.js +63 -0
- package/dist/npm/common/serverinfo.js.map +1 -0
- package/dist/npm/common/txflags.d.ts +51 -0
- package/dist/npm/common/txflags.d.ts.map +1 -0
- package/dist/npm/common/txflags.js +55 -0
- package/dist/npm/common/txflags.js.map +1 -0
- package/dist/npm/common/types/commands/account_info.d.ts +18 -0
- package/dist/npm/common/types/commands/account_info.d.ts.map +1 -0
- package/dist/npm/common/types/commands/account_info.js +3 -0
- package/dist/npm/common/types/commands/account_info.js.map +1 -0
- package/dist/npm/common/types/commands/account_lines.d.ts +18 -0
- package/dist/npm/common/types/commands/account_lines.d.ts.map +1 -0
- package/dist/npm/common/types/commands/account_lines.js +3 -0
- package/dist/npm/common/types/commands/account_lines.js.map +1 -0
- package/dist/npm/common/types/commands/account_objects.d.ts +27 -0
- package/dist/npm/common/types/commands/account_objects.d.ts.map +1 -0
- package/dist/npm/common/types/commands/account_objects.js +3 -0
- package/dist/npm/common/types/commands/account_objects.js.map +1 -0
- package/dist/npm/common/types/commands/account_offers.d.ts +25 -0
- package/dist/npm/common/types/commands/account_offers.d.ts.map +1 -0
- package/dist/npm/common/types/commands/account_offers.js +3 -0
- package/dist/npm/common/types/commands/account_offers.js.map +1 -0
- package/dist/npm/common/types/commands/book_offers.d.ts +24 -0
- package/dist/npm/common/types/commands/book_offers.d.ts.map +1 -0
- package/dist/npm/common/types/commands/book_offers.js +3 -0
- package/dist/npm/common/types/commands/book_offers.js.map +1 -0
- package/dist/npm/common/types/commands/gateway_balances.d.ts +24 -0
- package/dist/npm/common/types/commands/gateway_balances.d.ts.map +1 -0
- package/dist/npm/common/types/commands/gateway_balances.js +3 -0
- package/dist/npm/common/types/commands/gateway_balances.js.map +1 -0
- package/dist/npm/common/types/commands/index.d.ts +11 -0
- package/dist/npm/common/types/commands/index.d.ts.map +1 -0
- package/dist/npm/common/types/commands/index.js +23 -0
- package/dist/npm/common/types/commands/index.js.map +1 -0
- package/dist/npm/common/types/commands/ledger.d.ts +19 -0
- package/dist/npm/common/types/commands/ledger.d.ts.map +1 -0
- package/dist/npm/common/types/commands/ledger.js +3 -0
- package/dist/npm/common/types/commands/ledger.js.map +1 -0
- package/dist/npm/common/types/commands/ledger_data.d.ts +11 -0
- package/dist/npm/common/types/commands/ledger_data.d.ts.map +1 -0
- package/dist/npm/common/types/commands/ledger_data.js +3 -0
- package/dist/npm/common/types/commands/ledger_data.js.map +1 -0
- package/dist/npm/common/types/commands/ledger_entry.d.ts +30 -0
- package/dist/npm/common/types/commands/ledger_entry.d.ts.map +1 -0
- package/dist/npm/common/types/commands/ledger_entry.js +3 -0
- package/dist/npm/common/types/commands/ledger_entry.js.map +1 -0
- package/dist/npm/common/types/commands/server_info.d.ts +50 -0
- package/dist/npm/common/types/commands/server_info.d.ts.map +1 -0
- package/dist/npm/common/types/commands/server_info.js +3 -0
- package/dist/npm/common/types/commands/server_info.js.map +1 -0
- package/dist/npm/common/types/objects/adjustments.d.ts +17 -0
- package/dist/npm/common/types/objects/adjustments.d.ts.map +1 -0
- package/dist/npm/common/types/objects/adjustments.js +3 -0
- package/dist/npm/common/types/objects/adjustments.js.map +1 -0
- package/dist/npm/common/types/objects/amounts.d.ts +14 -0
- package/dist/npm/common/types/objects/amounts.d.ts.map +1 -0
- package/dist/npm/common/types/objects/amounts.js +3 -0
- package/dist/npm/common/types/objects/amounts.js.map +1 -0
- package/dist/npm/common/types/objects/index.d.ts +13 -0
- package/dist/npm/common/types/objects/index.d.ts.map +1 -0
- package/dist/npm/common/types/objects/index.js +25 -0
- package/dist/npm/common/types/objects/index.js.map +1 -0
- package/dist/npm/common/types/objects/ledger.d.ts +30 -0
- package/dist/npm/common/types/objects/ledger.d.ts.map +1 -0
- package/dist/npm/common/types/objects/ledger.js +3 -0
- package/dist/npm/common/types/objects/ledger.js.map +1 -0
- package/dist/npm/common/types/objects/ledger_data.d.ts +11 -0
- package/dist/npm/common/types/objects/ledger_data.d.ts.map +1 -0
- package/dist/npm/common/types/objects/ledger_data.js +3 -0
- package/dist/npm/common/types/objects/ledger_data.js.map +1 -0
- package/dist/npm/common/types/objects/ledger_entries.d.ts +159 -0
- package/dist/npm/common/types/objects/ledger_entries.d.ts.map +1 -0
- package/dist/npm/common/types/objects/ledger_entries.js +3 -0
- package/dist/npm/common/types/objects/ledger_entries.js.map +1 -0
- package/dist/npm/common/types/objects/memos.d.ts +6 -0
- package/dist/npm/common/types/objects/memos.d.ts.map +1 -0
- package/dist/npm/common/types/objects/memos.js +3 -0
- package/dist/npm/common/types/objects/memos.js.map +1 -0
- package/dist/npm/common/types/objects/orders.d.ts +14 -0
- package/dist/npm/common/types/objects/orders.d.ts.map +1 -0
- package/dist/npm/common/types/objects/orders.js +3 -0
- package/dist/npm/common/types/objects/orders.js.map +1 -0
- package/dist/npm/common/types/objects/queue_data.d.ts +16 -0
- package/dist/npm/common/types/objects/queue_data.d.ts.map +1 -0
- package/dist/npm/common/types/objects/queue_data.js +3 -0
- package/dist/npm/common/types/objects/queue_data.js.map +1 -0
- package/dist/npm/common/types/objects/settings.d.ts +31 -0
- package/dist/npm/common/types/objects/settings.d.ts.map +1 -0
- package/dist/npm/common/types/objects/settings.js +3 -0
- package/dist/npm/common/types/objects/settings.js.map +1 -0
- package/dist/npm/common/types/objects/signers.d.ts +7 -0
- package/dist/npm/common/types/objects/signers.d.ts.map +1 -0
- package/dist/npm/common/types/objects/signers.js +3 -0
- package/dist/npm/common/types/objects/signers.js.map +1 -0
- package/dist/npm/common/types/objects/transactions.d.ts +22 -0
- package/dist/npm/common/types/objects/transactions.d.ts.map +1 -0
- package/dist/npm/common/types/objects/transactions.js +3 -0
- package/dist/npm/common/types/objects/transactions.js.map +1 -0
- package/dist/npm/common/types/objects/trustlines.d.ts +40 -0
- package/dist/npm/common/types/objects/trustlines.d.ts.map +1 -0
- package/dist/npm/common/types/objects/trustlines.js +3 -0
- package/dist/npm/common/types/objects/trustlines.js.map +1 -0
- package/dist/npm/common/utils.d.ts +12 -0
- package/dist/npm/common/utils.d.ts.map +1 -0
- package/dist/npm/common/utils.js +157 -0
- package/dist/npm/common/utils.js.map +1 -0
- package/dist/npm/common/validate.d.ts +38 -0
- package/dist/npm/common/validate.d.ts.map +1 -0
- package/dist/npm/common/validate.js +79 -0
- package/dist/npm/common/validate.js.map +1 -0
- package/dist/npm/common/wswrapper.d.ts +15 -0
- package/dist/npm/common/wswrapper.d.ts.map +1 -0
- package/dist/npm/common/wswrapper.js +38 -0
- package/dist/npm/common/wswrapper.js.map +1 -0
- package/dist/npm/index.d.ts +6 -0
- package/dist/npm/index.d.ts.map +1 -0
- package/dist/npm/index.js +19 -0
- package/dist/npm/index.js.map +1 -0
- package/dist/npm/ledger/accountinfo.d.ts +14 -0
- package/dist/npm/ledger/accountinfo.d.ts.map +1 -0
- package/dist/npm/ledger/accountinfo.js +36 -0
- package/dist/npm/ledger/accountinfo.js.map +1 -0
- package/dist/npm/ledger/accountobjects.d.ts +4 -0
- package/dist/npm/ledger/accountobjects.d.ts.map +1 -0
- package/dist/npm/ledger/accountobjects.js +27 -0
- package/dist/npm/ledger/accountobjects.js.map +1 -0
- package/dist/npm/ledger/balance-sheet.d.ts +17 -0
- package/dist/npm/ledger/balance-sheet.d.ts.map +1 -0
- package/dist/npm/ledger/balance-sheet.js +52 -0
- package/dist/npm/ledger/balance-sheet.js.map +1 -0
- package/dist/npm/ledger/balances.d.ts +11 -0
- package/dist/npm/ledger/balances.d.ts.map +1 -0
- package/dist/npm/ledger/balances.js +61 -0
- package/dist/npm/ledger/balances.js.map +1 -0
- package/dist/npm/ledger/ledger.d.ts +12 -0
- package/dist/npm/ledger/ledger.d.ts.map +1 -0
- package/dist/npm/ledger/ledger.js +28 -0
- package/dist/npm/ledger/ledger.js.map +1 -0
- package/dist/npm/ledger/orderbook.d.ts +22 -0
- package/dist/npm/ledger/orderbook.d.ts.map +1 -0
- package/dist/npm/ledger/orderbook.js +100 -0
- package/dist/npm/ledger/orderbook.js.map +1 -0
- package/dist/npm/ledger/orders.d.ts +8 -0
- package/dist/npm/ledger/orders.d.ts.map +1 -0
- package/dist/npm/ledger/orders.js +56 -0
- package/dist/npm/ledger/orders.js.map +1 -0
- package/dist/npm/ledger/parse/account-delete.d.ts +8 -0
- package/dist/npm/ledger/parse/account-delete.d.ts.map +1 -0
- package/dist/npm/ledger/parse/account-delete.js +36 -0
- package/dist/npm/ledger/parse/account-delete.js.map +1 -0
- package/dist/npm/ledger/parse/account-order.d.ts +11 -0
- package/dist/npm/ledger/parse/account-order.d.ts.map +1 -0
- package/dist/npm/ledger/parse/account-order.js +40 -0
- package/dist/npm/ledger/parse/account-order.js.map +1 -0
- package/dist/npm/ledger/parse/account-trustline.d.ts +4 -0
- package/dist/npm/ledger/parse/account-trustline.d.ts.map +1 -0
- package/dist/npm/ledger/parse/account-trustline.js +28 -0
- package/dist/npm/ledger/parse/account-trustline.js.map +1 -0
- package/dist/npm/ledger/parse/amendment.d.ts +5 -0
- package/dist/npm/ledger/parse/amendment.d.ts.map +1 -0
- package/dist/npm/ledger/parse/amendment.js +9 -0
- package/dist/npm/ledger/parse/amendment.js.map +1 -0
- package/dist/npm/ledger/parse/amount.d.ts +4 -0
- package/dist/npm/ledger/parse/amount.d.ts.map +1 -0
- package/dist/npm/ledger/parse/amount.js +37 -0
- package/dist/npm/ledger/parse/amount.js.map +1 -0
- package/dist/npm/ledger/parse/cancellation.d.ts +3 -0
- package/dist/npm/ledger/parse/cancellation.d.ts.map +1 -0
- package/dist/npm/ledger/parse/cancellation.js +32 -0
- package/dist/npm/ledger/parse/cancellation.js.map +1 -0
- package/dist/npm/ledger/parse/check-cancel.d.ts +6 -0
- package/dist/npm/ledger/parse/check-cancel.d.ts.map +1 -0
- package/dist/npm/ledger/parse/check-cancel.js +33 -0
- package/dist/npm/ledger/parse/check-cancel.js.map +1 -0
- package/dist/npm/ledger/parse/check-cash.d.ts +9 -0
- package/dist/npm/ledger/parse/check-cash.d.ts.map +1 -0
- package/dist/npm/ledger/parse/check-cash.js +39 -0
- package/dist/npm/ledger/parse/check-cash.js.map +1 -0
- package/dist/npm/ledger/parse/check-create.d.ts +11 -0
- package/dist/npm/ledger/parse/check-create.d.ts.map +1 -0
- package/dist/npm/ledger/parse/check-create.js +42 -0
- package/dist/npm/ledger/parse/check-create.js.map +1 -0
- package/dist/npm/ledger/parse/deposit-preauth.d.ts +7 -0
- package/dist/npm/ledger/parse/deposit-preauth.d.ts.map +1 -0
- package/dist/npm/ledger/parse/deposit-preauth.js +34 -0
- package/dist/npm/ledger/parse/deposit-preauth.js.map +1 -0
- package/dist/npm/ledger/parse/escrow-cancellation.d.ts +3 -0
- package/dist/npm/ledger/parse/escrow-cancellation.d.ts.map +1 -0
- package/dist/npm/ledger/parse/escrow-cancellation.js +34 -0
- package/dist/npm/ledger/parse/escrow-cancellation.js.map +1 -0
- package/dist/npm/ledger/parse/escrow-creation.d.ts +3 -0
- package/dist/npm/ledger/parse/escrow-creation.d.ts.map +1 -0
- package/dist/npm/ledger/parse/escrow-creation.js +43 -0
- package/dist/npm/ledger/parse/escrow-creation.js.map +1 -0
- package/dist/npm/ledger/parse/escrow-execution.d.ts +3 -0
- package/dist/npm/ledger/parse/escrow-execution.d.ts.map +1 -0
- package/dist/npm/ledger/parse/escrow-execution.js +36 -0
- package/dist/npm/ledger/parse/escrow-execution.js.map +1 -0
- package/dist/npm/ledger/parse/fee-update.d.ts +9 -0
- package/dist/npm/ledger/parse/fee-update.d.ts.map +1 -0
- package/dist/npm/ledger/parse/fee-update.js +20 -0
- package/dist/npm/ledger/parse/fee-update.js.map +1 -0
- package/dist/npm/ledger/parse/fields.d.ts +3 -0
- package/dist/npm/ledger/parse/fields.d.ts.map +1 -0
- package/dist/npm/ledger/parse/fields.js +47 -0
- package/dist/npm/ledger/parse/fields.js.map +1 -0
- package/dist/npm/ledger/parse/flags.d.ts +16 -0
- package/dist/npm/ledger/parse/flags.d.ts.map +1 -0
- package/dist/npm/ledger/parse/flags.js +20 -0
- package/dist/npm/ledger/parse/flags.js.map +1 -0
- package/dist/npm/ledger/parse/ledger.d.ts +19 -0
- package/dist/npm/ledger/parse/ledger.d.ts.map +1 -0
- package/dist/npm/ledger/parse/ledger.js +76 -0
- package/dist/npm/ledger/parse/ledger.js.map +1 -0
- package/dist/npm/ledger/parse/order.d.ts +4 -0
- package/dist/npm/ledger/parse/order.d.ts.map +1 -0
- package/dist/npm/ledger/parse/order.js +50 -0
- package/dist/npm/ledger/parse/order.js.map +1 -0
- package/dist/npm/ledger/parse/orderbook-order.d.ts +17 -0
- package/dist/npm/ledger/parse/orderbook-order.d.ts.map +1 -0
- package/dist/npm/ledger/parse/orderbook-order.js +63 -0
- package/dist/npm/ledger/parse/orderbook-order.js.map +1 -0
- package/dist/npm/ledger/parse/pathfind.d.ts +4 -0
- package/dist/npm/ledger/parse/pathfind.d.ts.map +1 -0
- package/dist/npm/ledger/parse/pathfind.js +63 -0
- package/dist/npm/ledger/parse/pathfind.js.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-claim.d.ts +3 -0
- package/dist/npm/ledger/parse/payment-channel-claim.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-claim.js +44 -0
- package/dist/npm/ledger/parse/payment-channel-claim.js.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-create.d.ts +3 -0
- package/dist/npm/ledger/parse/payment-channel-create.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-create.js +43 -0
- package/dist/npm/ledger/parse/payment-channel-create.js.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-fund.d.ts +3 -0
- package/dist/npm/ledger/parse/payment-channel-fund.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-fund.js +39 -0
- package/dist/npm/ledger/parse/payment-channel-fund.js.map +1 -0
- package/dist/npm/ledger/parse/payment-channel.d.ts +17 -0
- package/dist/npm/ledger/parse/payment-channel.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment-channel.js +24 -0
- package/dist/npm/ledger/parse/payment-channel.js.map +1 -0
- package/dist/npm/ledger/parse/payment.d.ts +3 -0
- package/dist/npm/ledger/parse/payment.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment.js +64 -0
- package/dist/npm/ledger/parse/payment.js.map +1 -0
- package/dist/npm/ledger/parse/settings.d.ts +3 -0
- package/dist/npm/ledger/parse/settings.d.ts.map +1 -0
- package/dist/npm/ledger/parse/settings.js +75 -0
- package/dist/npm/ledger/parse/settings.js.map +1 -0
- package/dist/npm/ledger/parse/ticket-create.d.ts +3 -0
- package/dist/npm/ledger/parse/ticket-create.d.ts.map +1 -0
- package/dist/npm/ledger/parse/ticket-create.js +33 -0
- package/dist/npm/ledger/parse/ticket-create.js.map +1 -0
- package/dist/npm/ledger/parse/transaction.d.ts +3 -0
- package/dist/npm/ledger/parse/transaction.d.ts.map +1 -0
- package/dist/npm/ledger/parse/transaction.js +98 -0
- package/dist/npm/ledger/parse/transaction.js.map +1 -0
- package/dist/npm/ledger/parse/trustline.d.ts +3 -0
- package/dist/npm/ledger/parse/trustline.d.ts.map +1 -0
- package/dist/npm/ledger/parse/trustline.js +50 -0
- package/dist/npm/ledger/parse/trustline.js.map +1 -0
- package/dist/npm/ledger/parse/utils.d.ts +10 -0
- package/dist/npm/ledger/parse/utils.d.ts.map +1 -0
- package/dist/npm/ledger/parse/utils.js +136 -0
- package/dist/npm/ledger/parse/utils.js.map +1 -0
- package/dist/npm/ledger/pathfind-types.d.ts +60 -0
- package/dist/npm/ledger/pathfind-types.d.ts.map +1 -0
- package/dist/npm/ledger/pathfind-types.js +3 -0
- package/dist/npm/ledger/pathfind-types.js.map +1 -0
- package/dist/npm/ledger/pathfind.d.ts +5 -0
- package/dist/npm/ledger/pathfind.d.ts.map +1 -0
- package/dist/npm/ledger/pathfind.js +141 -0
- package/dist/npm/ledger/pathfind.js.map +1 -0
- package/dist/npm/ledger/payment-channel.d.ts +5 -0
- package/dist/npm/ledger/payment-channel.d.ts.map +1 -0
- package/dist/npm/ledger/payment-channel.js +34 -0
- package/dist/npm/ledger/payment-channel.js.map +1 -0
- package/dist/npm/ledger/settings.d.ts +11 -0
- package/dist/npm/ledger/settings.d.ts.map +1 -0
- package/dist/npm/ledger/settings.js +53 -0
- package/dist/npm/ledger/settings.js.map +1 -0
- package/dist/npm/ledger/transaction.d.ts +10 -0
- package/dist/npm/ledger/transaction.d.ts.map +1 -0
- package/dist/npm/ledger/transaction.js +126 -0
- package/dist/npm/ledger/transaction.js.map +1 -0
- package/dist/npm/ledger/transactions.d.ts +20 -0
- package/dist/npm/ledger/transactions.d.ts.map +1 -0
- package/dist/npm/ledger/transactions.js +156 -0
- package/dist/npm/ledger/transactions.js.map +1 -0
- package/dist/npm/ledger/trustlines.d.ts +11 -0
- package/dist/npm/ledger/trustlines.d.ts.map +1 -0
- package/dist/npm/ledger/trustlines.js +58 -0
- package/dist/npm/ledger/trustlines.js.map +1 -0
- package/dist/npm/ledger/utils.d.ts +33 -0
- package/dist/npm/ledger/utils.d.ts.map +1 -0
- package/dist/npm/ledger/utils.js +107 -0
- package/dist/npm/ledger/utils.js.map +1 -0
- package/dist/npm/offline/derive.d.ts +8 -0
- package/dist/npm/offline/derive.d.ts.map +1 -0
- package/dist/npm/offline/derive.js +13 -0
- package/dist/npm/offline/derive.js.map +1 -0
- package/dist/npm/offline/generate-address.d.ts +15 -0
- package/dist/npm/offline/generate-address.d.ts.map +1 -0
- package/dist/npm/offline/generate-address.js +37 -0
- package/dist/npm/offline/generate-address.js.map +1 -0
- package/dist/npm/offline/ledgerhash.d.ts +6 -0
- package/dist/npm/offline/ledgerhash.d.ts.map +1 -0
- package/dist/npm/offline/ledgerhash.js +104 -0
- package/dist/npm/offline/ledgerhash.js.map +1 -0
- package/dist/npm/offline/sign-payment-channel-claim.d.ts +3 -0
- package/dist/npm/offline/sign-payment-channel-claim.d.ts.map +1 -0
- package/dist/npm/offline/sign-payment-channel-claim.js +38 -0
- package/dist/npm/offline/sign-payment-channel-claim.js.map +1 -0
- package/dist/npm/offline/utils.d.ts +10 -0
- package/dist/npm/offline/utils.d.ts.map +1 -0
- package/dist/npm/offline/utils.js +43 -0
- package/dist/npm/offline/utils.js.map +1 -0
- package/dist/npm/offline/verify-payment-channel-claim.d.ts +3 -0
- package/dist/npm/offline/verify-payment-channel-claim.d.ts.map +1 -0
- package/dist/npm/offline/verify-payment-channel-claim.js +18 -0
- package/dist/npm/offline/verify-payment-channel-claim.js.map +1 -0
- package/dist/npm/server/server.d.ts +8 -0
- package/dist/npm/server/server.d.ts.map +1 -0
- package/dist/npm/server/server.js +66 -0
- package/dist/npm/server/server.js.map +1 -0
- package/dist/npm/transaction/check-cancel.d.ts +8 -0
- package/dist/npm/transaction/check-cancel.d.ts.map +1 -0
- package/dist/npm/transaction/check-cancel.js +24 -0
- package/dist/npm/transaction/check-cancel.js.map +1 -0
- package/dist/npm/transaction/check-cash.d.ts +11 -0
- package/dist/npm/transaction/check-cash.d.ts.map +1 -0
- package/dist/npm/transaction/check-cash.js +55 -0
- package/dist/npm/transaction/check-cash.js.map +1 -0
- package/dist/npm/transaction/check-create.d.ts +13 -0
- package/dist/npm/transaction/check-create.d.ts.map +1 -0
- package/dist/npm/transaction/check-create.js +54 -0
- package/dist/npm/transaction/check-create.js.map +1 -0
- package/dist/npm/transaction/combine.d.ts +3 -0
- package/dist/npm/transaction/combine.d.ts.map +1 -0
- package/dist/npm/transaction/combine.js +62 -0
- package/dist/npm/transaction/combine.js.map +1 -0
- package/dist/npm/transaction/escrow-cancellation.d.ts +11 -0
- package/dist/npm/transaction/escrow-cancellation.d.ts.map +1 -0
- package/dist/npm/transaction/escrow-cancellation.js +46 -0
- package/dist/npm/transaction/escrow-cancellation.js.map +1 -0
- package/dist/npm/transaction/escrow-creation.d.ts +16 -0
- package/dist/npm/transaction/escrow-creation.d.ts.map +1 -0
- package/dist/npm/transaction/escrow-creation.js +69 -0
- package/dist/npm/transaction/escrow-creation.js.map +1 -0
- package/dist/npm/transaction/escrow-execution.d.ts +13 -0
- package/dist/npm/transaction/escrow-execution.d.ts.map +1 -0
- package/dist/npm/transaction/escrow-execution.js +58 -0
- package/dist/npm/transaction/escrow-execution.js.map +1 -0
- package/dist/npm/transaction/order.d.ts +6 -0
- package/dist/npm/transaction/order.d.ts.map +1 -0
- package/dist/npm/transaction/order.js +69 -0
- package/dist/npm/transaction/order.js.map +1 -0
- package/dist/npm/transaction/ordercancellation.d.ts +5 -0
- package/dist/npm/transaction/ordercancellation.d.ts.map +1 -0
- package/dist/npm/transaction/ordercancellation.js +50 -0
- package/dist/npm/transaction/ordercancellation.js.map +1 -0
- package/dist/npm/transaction/payment-channel-claim.d.ts +14 -0
- package/dist/npm/transaction/payment-channel-claim.d.ts.map +1 -0
- package/dist/npm/transaction/payment-channel-claim.js +76 -0
- package/dist/npm/transaction/payment-channel-claim.js.map +1 -0
- package/dist/npm/transaction/payment-channel-create.d.ts +14 -0
- package/dist/npm/transaction/payment-channel-create.d.ts.map +1 -0
- package/dist/npm/transaction/payment-channel-create.js +59 -0
- package/dist/npm/transaction/payment-channel-create.js.map +1 -0
- package/dist/npm/transaction/payment-channel-fund.d.ts +10 -0
- package/dist/npm/transaction/payment-channel-fund.d.ts.map +1 -0
- package/dist/npm/transaction/payment-channel-fund.js +51 -0
- package/dist/npm/transaction/payment-channel-fund.js.map +1 -0
- package/dist/npm/transaction/payment.d.ts +16 -0
- package/dist/npm/transaction/payment.d.ts.map +1 -0
- package/dist/npm/transaction/payment.js +163 -0
- package/dist/npm/transaction/payment.js.map +1 -0
- package/dist/npm/transaction/settings.d.ts +6 -0
- package/dist/npm/transaction/settings.d.ts.map +1 -0
- package/dist/npm/transaction/settings.js +130 -0
- package/dist/npm/transaction/settings.js.map +1 -0
- package/dist/npm/transaction/sign.d.ts +8 -0
- package/dist/npm/transaction/sign.d.ts.map +1 -0
- package/dist/npm/transaction/sign.js +173 -0
- package/dist/npm/transaction/sign.js.map +1 -0
- package/dist/npm/transaction/submit.d.ts +8 -0
- package/dist/npm/transaction/submit.d.ts.map +1 -0
- package/dist/npm/transaction/submit.js +59 -0
- package/dist/npm/transaction/submit.js.map +1 -0
- package/dist/npm/transaction/ticket.d.ts +9 -0
- package/dist/npm/transaction/ticket.d.ts.map +1 -0
- package/dist/npm/transaction/ticket.js +46 -0
- package/dist/npm/transaction/ticket.js.map +1 -0
- package/dist/npm/transaction/trustline.d.ts +6 -0
- package/dist/npm/transaction/trustline.d.ts.map +1 -0
- package/dist/npm/transaction/trustline.js +82 -0
- package/dist/npm/transaction/trustline.js.map +1 -0
- package/dist/npm/transaction/types.d.ts +138 -0
- package/dist/npm/transaction/types.d.ts.map +1 -0
- package/dist/npm/transaction/types.js +3 -0
- package/dist/npm/transaction/types.js.map +1 -0
- package/dist/npm/transaction/utils.d.ts +22 -0
- package/dist/npm/transaction/utils.d.ts.map +1 -0
- package/dist/npm/transaction/utils.js +285 -0
- package/dist/npm/transaction/utils.js.map +1 -0
- package/dist/npm/tsconfig.tsbuildinfo +4230 -0
- package/dist/npm/wallet/wallet-generation.d.ts +15 -0
- package/dist/npm/wallet/wallet-generation.d.ts.map +1 -0
- package/dist/npm/wallet/wallet-generation.js +150 -0
- package/dist/npm/wallet/wallet-generation.js.map +1 -0
- package/package.json +84 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
const assert = __importStar(require("assert"));
|
26
|
+
const utils_1 = require("./utils");
|
27
|
+
const common_1 = require("../../common");
|
28
|
+
const amount_1 = __importDefault(require("./amount"));
|
29
|
+
function parsePaymentChannelFund(tx) {
|
30
|
+
assert.ok(tx.TransactionType === 'PaymentChannelFund');
|
31
|
+
return common_1.removeUndefined({
|
32
|
+
memos: utils_1.parseMemos(tx),
|
33
|
+
channel: tx.Channel,
|
34
|
+
amount: amount_1.default(tx.Amount).value,
|
35
|
+
expiration: tx.Expiration && utils_1.parseTimestamp(tx.Expiration)
|
36
|
+
});
|
37
|
+
}
|
38
|
+
exports.default = parsePaymentChannelFund;
|
39
|
+
//# sourceMappingURL=payment-channel-fund.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"payment-channel-fund.js","sourceRoot":"","sources":["../../../../src/ledger/parse/payment-channel-fund.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,mCAAiD;AACjD,yCAA4C;AAC5C,sDAAkC;AAElC,SAAS,uBAAuB,CAAC,EAAO;IACtC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,KAAK,oBAAoB,CAAC,CAAA;IAEtD,OAAO,wBAAe,CAAC;QACrB,KAAK,EAAE,kBAAU,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,MAAM,EAAE,gBAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK;QACpC,UAAU,EAAE,EAAE,CAAC,UAAU,IAAI,sBAAc,CAAC,EAAE,CAAC,UAAU,CAAC;KAC3D,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,uBAAuB,CAAA"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { PayChannelLedgerEntry } from '../../common/types/objects';
|
2
|
+
export declare type FormattedPaymentChannel = {
|
3
|
+
account: string;
|
4
|
+
amount: string;
|
5
|
+
balance: string;
|
6
|
+
publicKey: string;
|
7
|
+
destination: string;
|
8
|
+
settleDelay: number;
|
9
|
+
expiration?: string;
|
10
|
+
cancelAfter?: string;
|
11
|
+
sourceTag?: number;
|
12
|
+
destinationTag?: number;
|
13
|
+
previousAffectingTransactionID: string;
|
14
|
+
previousAffectingTransactionLedgerVersion: number;
|
15
|
+
};
|
16
|
+
export declare function parsePaymentChannel(data: PayChannelLedgerEntry): FormattedPaymentChannel;
|
17
|
+
//# sourceMappingURL=payment-channel.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"payment-channel.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/payment-channel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAA;AAEhE,oBAAY,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,8BAA8B,EAAE,MAAM,CAAA;IACtC,yCAAyC,EAAE,MAAM,CAAA;CAClD,CAAA;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,qBAAqB,GAC1B,uBAAuB,CAgBzB"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.parsePaymentChannel = void 0;
|
4
|
+
const utils_1 = require("./utils");
|
5
|
+
const common_1 = require("../../common");
|
6
|
+
function parsePaymentChannel(data) {
|
7
|
+
return common_1.removeUndefined({
|
8
|
+
memos: utils_1.parseMemos(data),
|
9
|
+
account: data.Account,
|
10
|
+
amount: common_1.dropsToXrp(data.Amount),
|
11
|
+
balance: common_1.dropsToXrp(data.Balance),
|
12
|
+
destination: data.Destination,
|
13
|
+
publicKey: data.PublicKey,
|
14
|
+
settleDelay: data.SettleDelay,
|
15
|
+
expiration: utils_1.parseTimestamp(data.Expiration),
|
16
|
+
cancelAfter: utils_1.parseTimestamp(data.CancelAfter),
|
17
|
+
sourceTag: data.SourceTag,
|
18
|
+
destinationTag: data.DestinationTag,
|
19
|
+
previousAffectingTransactionID: data.PreviousTxnID,
|
20
|
+
previousAffectingTransactionLedgerVersion: data.PreviousTxnLgrSeq
|
21
|
+
});
|
22
|
+
}
|
23
|
+
exports.parsePaymentChannel = parsePaymentChannel;
|
24
|
+
//# sourceMappingURL=payment-channel.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"payment-channel.js","sourceRoot":"","sources":["../../../../src/ledger/parse/payment-channel.ts"],"names":[],"mappings":";;;AAAA,mCAAkD;AAClD,yCAAwD;AAkBxD,SAAgB,mBAAmB,CACjC,IAA2B;IAE3B,OAAO,wBAAe,CAAC;QACrB,KAAK,EAAE,kBAAU,CAAC,IAAI,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,MAAM,EAAE,mBAAU,CAAC,IAAI,CAAC,MAAM,CAAC;QAC/B,OAAO,EAAE,mBAAU,CAAC,IAAI,CAAC,OAAO,CAAC;QACjC,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,sBAAc,CAAC,IAAI,CAAC,UAAU,CAAC;QAC3C,WAAW,EAAE,sBAAc,CAAC,IAAI,CAAC,WAAW,CAAC;QAC7C,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,8BAA8B,EAAE,IAAI,CAAC,aAAa;QAClD,yCAAyC,EAAE,IAAI,CAAC,iBAAiB;KAClE,CAAC,CAAA;AACJ,CAAC;AAlBD,kDAkBC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/payment.ts"],"names":[],"mappings":"AAqBA,iBAAS,YAAY,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CA+BrC;AAED,eAAe,YAAY,CAAA"}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
const _ = __importStar(require("lodash"));
|
26
|
+
const assert = __importStar(require("assert"));
|
27
|
+
const utils = __importStar(require("./utils"));
|
28
|
+
const common_1 = require("../../common");
|
29
|
+
const amount_1 = __importDefault(require("./amount"));
|
30
|
+
function isNoDirectRipple(tx) {
|
31
|
+
return (tx.Flags & common_1.txFlags.Payment.NoRippleDirect) !== 0;
|
32
|
+
}
|
33
|
+
function isQualityLimited(tx) {
|
34
|
+
return (tx.Flags & common_1.txFlags.Payment.LimitQuality) !== 0;
|
35
|
+
}
|
36
|
+
function removeGenericCounterparty(amount, address) {
|
37
|
+
return amount.counterparty === address
|
38
|
+
? _.omit(amount, 'counterparty')
|
39
|
+
: amount;
|
40
|
+
}
|
41
|
+
function parsePayment(tx) {
|
42
|
+
assert.ok(tx.TransactionType === 'Payment');
|
43
|
+
const source = {
|
44
|
+
address: tx.Account,
|
45
|
+
maxAmount: removeGenericCounterparty(amount_1.default(tx.SendMax || tx.Amount), tx.Account),
|
46
|
+
tag: tx.SourceTag
|
47
|
+
};
|
48
|
+
const destination = {
|
49
|
+
address: tx.Destination,
|
50
|
+
tag: tx.DestinationTag
|
51
|
+
};
|
52
|
+
return common_1.removeUndefined({
|
53
|
+
source: common_1.removeUndefined(source),
|
54
|
+
destination: common_1.removeUndefined(destination),
|
55
|
+
memos: utils.parseMemos(tx),
|
56
|
+
invoiceID: tx.InvoiceID,
|
57
|
+
paths: tx.Paths ? JSON.stringify(tx.Paths) : undefined,
|
58
|
+
allowPartialPayment: utils.isPartialPayment(tx) || undefined,
|
59
|
+
noDirectRipple: isNoDirectRipple(tx) || undefined,
|
60
|
+
limitQuality: isQualityLimited(tx) || undefined
|
61
|
+
});
|
62
|
+
}
|
63
|
+
exports.default = parsePayment;
|
64
|
+
//# sourceMappingURL=payment.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../../src/ledger/parse/payment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B;AAC3B,+CAAgC;AAChC,+CAAgC;AAChC,yCAAqD;AACrD,sDAAkC;AAElC,SAAS,gBAAgB,CAAC,EAAE;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,GAAG,gBAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;AAC1D,CAAC;AAED,SAAS,gBAAgB,CAAC,EAAE;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,GAAG,gBAAO,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;AACxD,CAAC;AAED,SAAS,yBAAyB,CAAC,MAAM,EAAE,OAAO;IAChD,OAAO,MAAM,CAAC,YAAY,KAAK,OAAO;QACpC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC;QAChC,CAAC,CAAC,MAAM,CAAA;AACZ,CAAC;AAGD,SAAS,YAAY,CAAC,EAAO;IAC3B,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,KAAK,SAAS,CAAC,CAAA;IAE3C,MAAM,MAAM,GAAG;QACb,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,SAAS,EAAE,yBAAyB,CAClC,gBAAW,CAAC,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,MAAM,CAAC,EACpC,EAAE,CAAC,OAAO,CACX;QACD,GAAG,EAAE,EAAE,CAAC,SAAS;KAClB,CAAA;IAED,MAAM,WAAW,GAGb;QACF,OAAO,EAAE,EAAE,CAAC,WAAW;QACvB,GAAG,EAAE,EAAE,CAAC,cAAc;KAEvB,CAAA;IAED,OAAO,wBAAe,CAAC;QACrB,MAAM,EAAE,wBAAe,CAAC,MAAM,CAAC;QAC/B,WAAW,EAAE,wBAAe,CAAC,WAAW,CAAC;QACzC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,SAAS,EAAE,EAAE,CAAC,SAAS;QACvB,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QACtD,mBAAmB,EAAE,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,IAAI,SAAS;QAC5D,cAAc,EAAE,gBAAgB,CAAC,EAAE,CAAC,IAAI,SAAS;QACjD,YAAY,EAAE,gBAAgB,CAAC,EAAE,CAAC,IAAI,SAAS;KAChD,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,YAAY,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/settings.ts"],"names":[],"mappings":"AAmDA,iBAAS,aAAa,CAAC,EAAE,EAAE,GAAG,OAS7B;AAED,eAAe,aAAa,CAAA"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
const _ = __importStar(require("lodash"));
|
26
|
+
const assert = __importStar(require("assert"));
|
27
|
+
const common_1 = require("../../common");
|
28
|
+
const AccountFlags = common_1.constants.AccountFlags;
|
29
|
+
const fields_1 = __importDefault(require("./fields"));
|
30
|
+
function getAccountRootModifiedNode(tx) {
|
31
|
+
const modifiedNodes = tx.meta.AffectedNodes.filter(node => { var _a; return ((_a = node.ModifiedNode) === null || _a === void 0 ? void 0 : _a.LedgerEntryType) === 'AccountRoot'; });
|
32
|
+
assert.ok(modifiedNodes.length === 1);
|
33
|
+
return modifiedNodes[0].ModifiedNode;
|
34
|
+
}
|
35
|
+
function parseFlags(tx) {
|
36
|
+
const settings = {};
|
37
|
+
if (tx.TransactionType !== 'AccountSet') {
|
38
|
+
return settings;
|
39
|
+
}
|
40
|
+
const node = getAccountRootModifiedNode(tx);
|
41
|
+
const oldFlags = _.get(node.PreviousFields, 'Flags');
|
42
|
+
const newFlags = _.get(node.FinalFields, 'Flags');
|
43
|
+
if (oldFlags != null && newFlags != null) {
|
44
|
+
const changedFlags = oldFlags ^ newFlags;
|
45
|
+
const setFlags = newFlags & changedFlags;
|
46
|
+
const clearedFlags = oldFlags & changedFlags;
|
47
|
+
Object.entries(AccountFlags).forEach(entry => {
|
48
|
+
const [flagName, flagValue] = entry;
|
49
|
+
if (setFlags & flagValue) {
|
50
|
+
settings[flagName] = true;
|
51
|
+
}
|
52
|
+
else if (clearedFlags & flagValue) {
|
53
|
+
settings[flagName] = false;
|
54
|
+
}
|
55
|
+
});
|
56
|
+
}
|
57
|
+
const oldField = _.get(node.PreviousFields, 'AccountTxnID');
|
58
|
+
const newField = _.get(node.FinalFields, 'AccountTxnID');
|
59
|
+
if (newField && !oldField) {
|
60
|
+
settings.enableTransactionIDTracking = true;
|
61
|
+
}
|
62
|
+
else if (oldField && !newField) {
|
63
|
+
settings.enableTransactionIDTracking = false;
|
64
|
+
}
|
65
|
+
return settings;
|
66
|
+
}
|
67
|
+
function parseSettings(tx) {
|
68
|
+
const txType = tx.TransactionType;
|
69
|
+
assert.ok(txType === 'AccountSet' ||
|
70
|
+
txType === 'SetRegularKey' ||
|
71
|
+
txType === 'SignerListSet');
|
72
|
+
return Object.assign({}, parseFlags(tx), fields_1.default(tx));
|
73
|
+
}
|
74
|
+
exports.default = parseSettings;
|
75
|
+
//# sourceMappingURL=settings.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../src/ledger/parse/settings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B;AAC3B,+CAAgC;AAChC,yCAAsC;AACtC,MAAM,YAAY,GAAG,kBAAS,CAAC,YAAY,CAAA;AAC3C,sDAAkC;AAElC,SAAS,0BAA0B,CAAC,EAAO;IACzC,MAAM,aAAa,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,OAAA,IAAI,CAAC,YAAY,0CAAE,eAAe,MAAK,aAAa,CAAA,EAAA,CAAC,CAAC;IACjH,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAA;IACrC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAA;AACtC,CAAC;AAED,SAAS,UAAU,CAAC,EAAO;IACzB,MAAM,QAAQ,GAAQ,EAAE,CAAA;IACxB,IAAI,EAAE,CAAC,eAAe,KAAK,YAAY,EAAE;QACvC,OAAO,QAAQ,CAAA;KAChB;IAED,MAAM,IAAI,GAAG,0BAA0B,CAAC,EAAE,CAAC,CAAA;IAC3C,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;IACpD,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;IAEjD,IAAI,QAAQ,IAAI,IAAI,IAAI,QAAQ,IAAI,IAAI,EAAE;QACxC,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;QACxC,MAAM,QAAQ,GAAG,QAAQ,GAAG,YAAY,CAAA;QACxC,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,CAAA;QAC5C,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC3C,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC;YACpC,IAAI,QAAQ,GAAG,SAAS,EAAE;gBACxB,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA;aAC1B;iBAAM,IAAI,YAAY,GAAG,SAAS,EAAE;gBACnC,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAA;aAC3B;QACH,CAAC,CAAC,CAAA;KACH;IAMD,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;IAC3D,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;IACxD,IAAI,QAAQ,IAAI,CAAC,QAAQ,EAAE;QACzB,QAAQ,CAAC,2BAA2B,GAAG,IAAI,CAAA;KAC5C;SAAM,IAAI,QAAQ,IAAI,CAAC,QAAQ,EAAE;QAChC,QAAQ,CAAC,2BAA2B,GAAG,KAAK,CAAA;KAC7C;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,EAAO;IAC5B,MAAM,MAAM,GAAG,EAAE,CAAC,eAAe,CAAA;IACjC,MAAM,CAAC,EAAE,CACP,MAAM,KAAK,YAAY;QACrB,MAAM,KAAK,eAAe;QAC1B,MAAM,KAAK,eAAe,CAC7B,CAAA;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,EAAE,gBAAW,CAAC,EAAE,CAAC,CAAC,CAAA;AAC3D,CAAC;AAED,kBAAe,aAAa,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ticket-create.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/ticket-create.ts"],"names":[],"mappings":"AAIA,iBAAS,iBAAiB,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAM1C;AAED,eAAe,iBAAiB,CAAA"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
+
const assert = __importStar(require("assert"));
|
23
|
+
const common_1 = require("../../common");
|
24
|
+
const utils_1 = require("./utils");
|
25
|
+
function parseTicketCreate(tx) {
|
26
|
+
assert.ok(tx.TransactionType === 'TicketCreate');
|
27
|
+
return common_1.removeUndefined({
|
28
|
+
memos: utils_1.parseMemos(tx),
|
29
|
+
ticketCount: tx.TicketCount
|
30
|
+
});
|
31
|
+
}
|
32
|
+
exports.default = parseTicketCreate;
|
33
|
+
//# sourceMappingURL=ticket-create.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ticket-create.js","sourceRoot":"","sources":["../../../../src/ledger/parse/ticket-create.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,yCAA4C;AAC5C,mCAAkC;AAElC,SAAS,iBAAiB,CAAC,EAAO;IAChC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,KAAK,cAAc,CAAC,CAAA;IAChD,OAAO,wBAAe,CAAC;QACrB,KAAK,EAAE,kBAAU,CAAC,EAAE,CAAC;QACrB,WAAW,EAAE,EAAE,CAAC,WAAW;KAC5B,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,iBAAiB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/transaction.ts"],"names":[],"mappings":"AAsDA,iBAAS,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,qBAAqB,EAAE,OAAO,GAAG,GAAG,CA+CtE;AAED,eAAe,gBAAgB,CAAA"}
|
@@ -0,0 +1,98 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const utils_1 = require("./utils");
|
7
|
+
const common_1 = require("../../common");
|
8
|
+
const settings_1 = __importDefault(require("./settings"));
|
9
|
+
const account_delete_1 = __importDefault(require("./account-delete"));
|
10
|
+
const check_cancel_1 = __importDefault(require("./check-cancel"));
|
11
|
+
const check_cash_1 = __importDefault(require("./check-cash"));
|
12
|
+
const check_create_1 = __importDefault(require("./check-create"));
|
13
|
+
const deposit_preauth_1 = __importDefault(require("./deposit-preauth"));
|
14
|
+
const escrow_cancellation_1 = __importDefault(require("./escrow-cancellation"));
|
15
|
+
const escrow_creation_1 = __importDefault(require("./escrow-creation"));
|
16
|
+
const escrow_execution_1 = __importDefault(require("./escrow-execution"));
|
17
|
+
const cancellation_1 = __importDefault(require("./cancellation"));
|
18
|
+
const order_1 = __importDefault(require("./order"));
|
19
|
+
const payment_1 = __importDefault(require("./payment"));
|
20
|
+
const payment_channel_claim_1 = __importDefault(require("./payment-channel-claim"));
|
21
|
+
const payment_channel_create_1 = __importDefault(require("./payment-channel-create"));
|
22
|
+
const payment_channel_fund_1 = __importDefault(require("./payment-channel-fund"));
|
23
|
+
const ticket_create_1 = __importDefault(require("./ticket-create"));
|
24
|
+
const trustline_1 = __importDefault(require("./trustline"));
|
25
|
+
const amendment_1 = __importDefault(require("./amendment"));
|
26
|
+
const fee_update_1 = __importDefault(require("./fee-update"));
|
27
|
+
function parseTransactionType(type) {
|
28
|
+
const mapping = {
|
29
|
+
AccountSet: 'settings',
|
30
|
+
AccountDelete: 'accountDelete',
|
31
|
+
CheckCancel: 'checkCancel',
|
32
|
+
CheckCash: 'checkCash',
|
33
|
+
CheckCreate: 'checkCreate',
|
34
|
+
DepositPreauth: 'depositPreauth',
|
35
|
+
EscrowCancel: 'escrowCancellation',
|
36
|
+
EscrowCreate: 'escrowCreation',
|
37
|
+
EscrowFinish: 'escrowExecution',
|
38
|
+
OfferCancel: 'orderCancellation',
|
39
|
+
OfferCreate: 'order',
|
40
|
+
Payment: 'payment',
|
41
|
+
PaymentChannelClaim: 'paymentChannelClaim',
|
42
|
+
PaymentChannelCreate: 'paymentChannelCreate',
|
43
|
+
PaymentChannelFund: 'paymentChannelFund',
|
44
|
+
SetRegularKey: 'settings',
|
45
|
+
SignerListSet: 'settings',
|
46
|
+
TicketCreate: 'ticketCreate',
|
47
|
+
TrustSet: 'trustline',
|
48
|
+
EnableAmendment: 'amendment',
|
49
|
+
SetFee: 'feeUpdate'
|
50
|
+
};
|
51
|
+
return mapping[type] || null;
|
52
|
+
}
|
53
|
+
function parseTransaction(tx, includeRawTransaction) {
|
54
|
+
const type = parseTransactionType(tx.TransactionType);
|
55
|
+
const mapping = {
|
56
|
+
settings: settings_1.default,
|
57
|
+
accountDelete: account_delete_1.default,
|
58
|
+
checkCancel: check_cancel_1.default,
|
59
|
+
checkCash: check_cash_1.default,
|
60
|
+
checkCreate: check_create_1.default,
|
61
|
+
depositPreauth: deposit_preauth_1.default,
|
62
|
+
escrowCancellation: escrow_cancellation_1.default,
|
63
|
+
escrowCreation: escrow_creation_1.default,
|
64
|
+
escrowExecution: escrow_execution_1.default,
|
65
|
+
orderCancellation: cancellation_1.default,
|
66
|
+
order: order_1.default,
|
67
|
+
payment: payment_1.default,
|
68
|
+
paymentChannelClaim: payment_channel_claim_1.default,
|
69
|
+
paymentChannelCreate: payment_channel_create_1.default,
|
70
|
+
paymentChannelFund: payment_channel_fund_1.default,
|
71
|
+
ticketCreate: ticket_create_1.default,
|
72
|
+
trustline: trustline_1.default,
|
73
|
+
amendment: amendment_1.default,
|
74
|
+
feeUpdate: fee_update_1.default
|
75
|
+
};
|
76
|
+
const parser = mapping[type];
|
77
|
+
const specification = parser
|
78
|
+
? parser(tx)
|
79
|
+
: {
|
80
|
+
UNAVAILABLE: 'Unrecognized transaction type.',
|
81
|
+
SEE_RAW_TRANSACTION: 'Since this type is unrecognized, `rawTransaction` is included in this response.'
|
82
|
+
};
|
83
|
+
if (!parser) {
|
84
|
+
includeRawTransaction = true;
|
85
|
+
}
|
86
|
+
const outcome = utils_1.parseOutcome(tx);
|
87
|
+
return common_1.removeUndefined({
|
88
|
+
type: type,
|
89
|
+
address: tx.Account,
|
90
|
+
sequence: tx.Sequence,
|
91
|
+
id: tx.hash,
|
92
|
+
specification: common_1.removeUndefined(specification),
|
93
|
+
outcome: outcome ? common_1.removeUndefined(outcome) : undefined,
|
94
|
+
rawTransaction: includeRawTransaction ? JSON.stringify(tx) : undefined
|
95
|
+
});
|
96
|
+
}
|
97
|
+
exports.default = parseTransaction;
|
98
|
+
//# sourceMappingURL=transaction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../../src/ledger/parse/transaction.ts"],"names":[],"mappings":";;;;;AAAA,mCAAoC;AACpC,yCAA4C;AAE5C,0DAAsC;AACtC,sEAAiD;AACjD,kEAA6C;AAC7C,8DAAyC;AACzC,kEAA6C;AAC7C,wEAAmD;AACnD,gFAA2D;AAC3D,wEAAmD;AACnD,0EAAqD;AACrD,kEAAmD;AACnD,oDAAgC;AAChC,wDAAoC;AACpC,oFAA8D;AAC9D,sFAAgE;AAChE,kFAA4D;AAC5D,oEAA+C;AAC/C,4DAAwC;AAExC,4DAAwC;AACxC,8DAAyC;AAEzC,SAAS,oBAAoB,CAAC,IAAI;IAEhC,MAAM,OAAO,GAAG;QACd,UAAU,EAAE,UAAU;QACtB,aAAa,EAAE,eAAe;QAC9B,WAAW,EAAE,aAAa;QAC1B,SAAS,EAAE,WAAW;QACtB,WAAW,EAAE,aAAa;QAC1B,cAAc,EAAE,gBAAgB;QAChC,YAAY,EAAE,oBAAoB;QAClC,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,iBAAiB;QAC/B,WAAW,EAAE,mBAAmB;QAChC,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,SAAS;QAClB,mBAAmB,EAAE,qBAAqB;QAC1C,oBAAoB,EAAE,sBAAsB;QAC5C,kBAAkB,EAAE,oBAAoB;QACxC,aAAa,EAAE,UAAU;QACzB,aAAa,EAAE,UAAU;QACzB,YAAY,EAAE,cAAc;QAC5B,QAAQ,EAAE,WAAW;QAErB,eAAe,EAAE,WAAW;QAC5B,MAAM,EAAE,WAAW;KACpB,CAAA;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAA;AAC9B,CAAC;AAGD,SAAS,gBAAgB,CAAC,EAAO,EAAE,qBAA8B;IAC/D,MAAM,IAAI,GAAG,oBAAoB,CAAC,EAAE,CAAC,eAAe,CAAC,CAAA;IACrD,MAAM,OAAO,GAAG;QACd,QAAQ,EAAE,kBAAa;QACvB,aAAa,EAAE,wBAAkB;QACjC,WAAW,EAAE,sBAAgB;QAC7B,SAAS,EAAE,oBAAc;QACzB,WAAW,EAAE,sBAAgB;QAC7B,cAAc,EAAE,yBAAmB;QACnC,kBAAkB,EAAE,6BAAuB;QAC3C,cAAc,EAAE,yBAAmB;QACnC,eAAe,EAAE,0BAAoB;QACrC,iBAAiB,EAAE,sBAAsB;QACzC,KAAK,EAAE,eAAU;QACjB,OAAO,EAAE,iBAAY;QACrB,mBAAmB,EAAE,+BAAwB;QAC7C,oBAAoB,EAAE,gCAAyB;QAC/C,kBAAkB,EAAE,8BAAuB;QAC3C,YAAY,EAAE,uBAAiB;QAC/B,SAAS,EAAE,mBAAc;QAEzB,SAAS,EAAE,mBAAc;QACzB,SAAS,EAAE,oBAAc;KAC1B,CAAA;IACD,MAAM,MAAM,GAAa,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtC,MAAM,aAAa,GAAG,MAAM;QAC1B,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACZ,CAAC,CAAC;YACE,WAAW,EAAE,gCAAgC;YAC7C,mBAAmB,EACjB,iFAAiF;SACpF,CAAA;IACL,IAAI,CAAC,MAAM,EAAE;QACX,qBAAqB,GAAG,IAAI,CAAA;KAC7B;IAED,MAAM,OAAO,GAAG,oBAAY,CAAC,EAAE,CAAC,CAAA;IAChC,OAAO,wBAAe,CAAC;QACrB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,EAAE,EAAE,EAAE,CAAC,IAAI;QACX,aAAa,EAAE,wBAAe,CAAC,aAAa,CAAC;QAC7C,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;QACvD,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;KACvE,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,gBAAgB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"trustline.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/trustline.ts"],"names":[],"mappings":"AAeA,iBAAS,cAAc,CAAC,EAAE,EAAE,GAAG,GAAG,MAAM,CAkBvC;AAED,eAAe,cAAc,CAAA"}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
+
const assert = __importStar(require("assert"));
|
23
|
+
const utils_1 = require("./utils");
|
24
|
+
const common_1 = require("../../common");
|
25
|
+
const flags = common_1.txFlags.TrustSet;
|
26
|
+
function parseFlag(flagsValue, trueValue, falseValue) {
|
27
|
+
if (flagsValue & trueValue) {
|
28
|
+
return true;
|
29
|
+
}
|
30
|
+
if (flagsValue & falseValue) {
|
31
|
+
return false;
|
32
|
+
}
|
33
|
+
return undefined;
|
34
|
+
}
|
35
|
+
function parseTrustline(tx) {
|
36
|
+
assert.ok(tx.TransactionType === 'TrustSet');
|
37
|
+
return common_1.removeUndefined({
|
38
|
+
limit: tx.LimitAmount.value,
|
39
|
+
currency: tx.LimitAmount.currency,
|
40
|
+
counterparty: tx.LimitAmount.issuer,
|
41
|
+
memos: utils_1.parseMemos(tx),
|
42
|
+
qualityIn: utils_1.parseQuality(tx.QualityIn),
|
43
|
+
qualityOut: utils_1.parseQuality(tx.QualityOut),
|
44
|
+
ripplingDisabled: parseFlag(tx.Flags, flags.SetNoRipple, flags.ClearNoRipple),
|
45
|
+
frozen: parseFlag(tx.Flags, flags.SetFreeze, flags.ClearFreeze),
|
46
|
+
authorized: parseFlag(tx.Flags, flags.SetAuth, 0)
|
47
|
+
});
|
48
|
+
}
|
49
|
+
exports.default = parseTrustline;
|
50
|
+
//# sourceMappingURL=trustline.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"trustline.js","sourceRoot":"","sources":["../../../../src/ledger/parse/trustline.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAChC,mCAAgD;AAChD,yCAAqD;AACrD,MAAM,KAAK,GAAG,gBAAO,CAAC,QAAQ,CAAA;AAE9B,SAAS,SAAS,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU;IAClD,IAAI,UAAU,GAAG,SAAS,EAAE;QAC1B,OAAO,IAAI,CAAA;KACZ;IACD,IAAI,UAAU,GAAG,UAAU,EAAE;QAC3B,OAAO,KAAK,CAAA;KACb;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,cAAc,CAAC,EAAO;IAC7B,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,KAAK,UAAU,CAAC,CAAA;IAE5C,OAAO,wBAAe,CAAC;QACrB,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK;QAC3B,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ;QACjC,YAAY,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM;QACnC,KAAK,EAAE,kBAAU,CAAC,EAAE,CAAC;QACrB,SAAS,EAAE,oBAAY,CAAC,EAAE,CAAC,SAAS,CAAC;QACrC,UAAU,EAAE,oBAAY,CAAC,EAAE,CAAC,UAAU,CAAC;QACvC,gBAAgB,EAAE,SAAS,CACzB,EAAE,CAAC,KAAK,EACR,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,aAAa,CACpB;QACD,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC;QAC/D,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;KAClD,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,cAAc,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Memo } from '../../common/types/objects';
|
2
|
+
declare function adjustQualityForXRP(quality: string, takerGetsCurrency: string, takerPaysCurrency: string): string;
|
3
|
+
declare function parseQuality(quality?: number | null): number | undefined;
|
4
|
+
declare function parseTimestamp(rippleTime?: number | null): string | undefined;
|
5
|
+
declare function isPartialPayment(tx: any): boolean;
|
6
|
+
declare function parseOutcome(tx: any): any | undefined;
|
7
|
+
declare function hexToString(hex: string): string | undefined;
|
8
|
+
declare function parseMemos(tx: any): Array<Memo> | undefined;
|
9
|
+
export { parseQuality, parseOutcome, parseMemos, hexToString, parseTimestamp, adjustQualityForXRP, isPartialPayment };
|
10
|
+
//# sourceMappingURL=utils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/ledger/parse/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAS,IAAI,EAAC,MAAM,4BAA4B,CAAA;AAyBvD,iBAAS,mBAAmB,CAC1B,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,UAU1B;AAED,iBAAS,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAKjE;AAED,iBAAS,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAKtE;AAsBD,iBAAS,gBAAgB,CAAC,EAAE,EAAE,GAAG,WAEhC;AA0CD,iBAAS,YAAY,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAuB9C;AAED,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpD;AAED,iBAAS,UAAU,CAAC,EAAE,EAAE,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAWpD;AAED,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EACjB,CAAA"}
|
@@ -0,0 +1,136 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
exports.isPartialPayment = exports.adjustQualityForXRP = exports.parseTimestamp = exports.hexToString = exports.parseMemos = exports.parseOutcome = exports.parseQuality = void 0;
|
26
|
+
const ripple_lib_transactionparser_1 = __importDefault(require("ripple-lib-transactionparser"));
|
27
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
28
|
+
const common = __importStar(require("../../common"));
|
29
|
+
const amount_1 = __importDefault(require("./amount"));
|
30
|
+
function adjustQualityForXRP(quality, takerGetsCurrency, takerPaysCurrency) {
|
31
|
+
const numeratorShift = takerPaysCurrency === 'XRP' ? -6 : 0;
|
32
|
+
const denominatorShift = takerGetsCurrency === 'XRP' ? -6 : 0;
|
33
|
+
const shift = numeratorShift - denominatorShift;
|
34
|
+
return shift === 0
|
35
|
+
? quality
|
36
|
+
: new bignumber_js_1.default(quality).shiftedBy(shift).toString();
|
37
|
+
}
|
38
|
+
exports.adjustQualityForXRP = adjustQualityForXRP;
|
39
|
+
function parseQuality(quality) {
|
40
|
+
if (typeof quality !== 'number') {
|
41
|
+
return undefined;
|
42
|
+
}
|
43
|
+
return new bignumber_js_1.default(quality).shiftedBy(-9).toNumber();
|
44
|
+
}
|
45
|
+
exports.parseQuality = parseQuality;
|
46
|
+
function parseTimestamp(rippleTime) {
|
47
|
+
if (typeof rippleTime !== 'number') {
|
48
|
+
return undefined;
|
49
|
+
}
|
50
|
+
return common.rippleTimeToISO8601(rippleTime);
|
51
|
+
}
|
52
|
+
exports.parseTimestamp = parseTimestamp;
|
53
|
+
function removeEmptyCounterparty(amount) {
|
54
|
+
if (amount.counterparty === '') {
|
55
|
+
delete amount.counterparty;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
function removeEmptyCounterpartyInBalanceChanges(balanceChanges) {
|
59
|
+
Object.entries(balanceChanges).forEach(([_, changes]) => {
|
60
|
+
changes.forEach(removeEmptyCounterparty);
|
61
|
+
});
|
62
|
+
}
|
63
|
+
function removeEmptyCounterpartyInOrderbookChanges(orderbookChanges) {
|
64
|
+
Object.entries(orderbookChanges).forEach(([_, changes]) => {
|
65
|
+
changes.forEach((change) => {
|
66
|
+
Object.entries(change).forEach(removeEmptyCounterparty);
|
67
|
+
});
|
68
|
+
});
|
69
|
+
}
|
70
|
+
function isPartialPayment(tx) {
|
71
|
+
return (tx.Flags & common.txFlags.Payment.PartialPayment) !== 0;
|
72
|
+
}
|
73
|
+
exports.isPartialPayment = isPartialPayment;
|
74
|
+
function parseDeliveredAmount(tx) {
|
75
|
+
if (tx.TransactionType !== 'Payment' ||
|
76
|
+
tx.meta.TransactionResult !== 'tesSUCCESS') {
|
77
|
+
return undefined;
|
78
|
+
}
|
79
|
+
if (tx.meta.delivered_amount && tx.meta.delivered_amount === 'unavailable') {
|
80
|
+
return undefined;
|
81
|
+
}
|
82
|
+
if (tx.meta.delivered_amount) {
|
83
|
+
return amount_1.default(tx.meta.delivered_amount);
|
84
|
+
}
|
85
|
+
if (tx.meta.DeliveredAmount) {
|
86
|
+
return amount_1.default(tx.meta.DeliveredAmount);
|
87
|
+
}
|
88
|
+
if (tx.Amount && !isPartialPayment(tx)) {
|
89
|
+
return amount_1.default(tx.Amount);
|
90
|
+
}
|
91
|
+
if (tx.Amount && tx.ledger_index > 4594094) {
|
92
|
+
return amount_1.default(tx.Amount);
|
93
|
+
}
|
94
|
+
return undefined;
|
95
|
+
}
|
96
|
+
function parseOutcome(tx) {
|
97
|
+
const metadata = tx.meta || tx.metaData;
|
98
|
+
if (!metadata) {
|
99
|
+
return undefined;
|
100
|
+
}
|
101
|
+
const balanceChanges = ripple_lib_transactionparser_1.default.parseBalanceChanges(metadata);
|
102
|
+
const orderbookChanges = ripple_lib_transactionparser_1.default.parseOrderbookChanges(metadata);
|
103
|
+
const channelChanges = ripple_lib_transactionparser_1.default.parseChannelChanges(metadata);
|
104
|
+
removeEmptyCounterpartyInBalanceChanges(balanceChanges);
|
105
|
+
removeEmptyCounterpartyInOrderbookChanges(orderbookChanges);
|
106
|
+
return common.removeUndefined({
|
107
|
+
result: tx.meta.TransactionResult,
|
108
|
+
timestamp: parseTimestamp(tx.date),
|
109
|
+
fee: common.dropsToXrp(tx.Fee),
|
110
|
+
balanceChanges: balanceChanges,
|
111
|
+
orderbookChanges: orderbookChanges,
|
112
|
+
channelChanges: channelChanges,
|
113
|
+
ledgerVersion: tx.ledger_index,
|
114
|
+
indexInLedger: tx.meta.TransactionIndex,
|
115
|
+
deliveredAmount: parseDeliveredAmount(tx)
|
116
|
+
});
|
117
|
+
}
|
118
|
+
exports.parseOutcome = parseOutcome;
|
119
|
+
function hexToString(hex) {
|
120
|
+
return hex ? Buffer.from(hex, 'hex').toString('utf-8') : undefined;
|
121
|
+
}
|
122
|
+
exports.hexToString = hexToString;
|
123
|
+
function parseMemos(tx) {
|
124
|
+
if (!Array.isArray(tx.Memos) || tx.Memos.length === 0) {
|
125
|
+
return undefined;
|
126
|
+
}
|
127
|
+
return tx.Memos.map((m) => {
|
128
|
+
return common.removeUndefined({
|
129
|
+
type: m.Memo.parsed_memo_type || hexToString(m.Memo.MemoType),
|
130
|
+
format: m.Memo.parsed_memo_format || hexToString(m.Memo.MemoFormat),
|
131
|
+
data: m.Memo.parsed_memo_data || hexToString(m.Memo.MemoData)
|
132
|
+
});
|
133
|
+
});
|
134
|
+
}
|
135
|
+
exports.parseMemos = parseMemos;
|
136
|
+
//# sourceMappingURL=utils.js.map
|