@bithomp/xrpl-api 3.7.31 → 3.7.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/connection.js +5 -3
- package/lib/src/base58.d.ts +2 -0
- package/lib/src/base58.js +32 -0
- package/lib/src/client.d.ts +25 -0
- package/lib/src/client.js +192 -0
- package/lib/src/common/errors/index.d.ts +3 -0
- package/lib/src/common/errors/index.js +7 -0
- package/lib/src/common/errors/validation_error.d.ts +4 -0
- package/lib/src/common/errors/validation_error.js +7 -0
- package/lib/src/common/errors/xrpl_api_error.d.ts +9 -0
- package/lib/src/common/errors/xrpl_api_error.js +28 -0
- package/lib/src/common/index.d.ts +9 -0
- package/lib/src/common/index.js +57 -0
- package/lib/src/common/sha512Half.d.ts +2 -0
- package/lib/src/common/sha512Half.js +12 -0
- package/lib/src/common/utils.d.ts +14 -0
- package/lib/src/common/utils.js +147 -0
- package/lib/src/connection.d.ts +75 -0
- package/lib/src/connection.js +645 -0
- package/lib/src/faucet.d.ts +58 -0
- package/lib/src/faucet.js +129 -0
- package/lib/src/index.d.ts +9 -0
- package/lib/src/index.js +45 -0
- package/lib/src/ledger/account_info.d.ts +16 -0
- package/lib/src/ledger/account_info.js +112 -0
- package/lib/src/ledger/account_lines.d.ts +11 -0
- package/lib/src/ledger/account_lines.js +90 -0
- package/lib/src/ledger/account_namespace.d.ts +7 -0
- package/lib/src/ledger/account_namespace.js +72 -0
- package/lib/src/ledger/account_nfts.d.ts +21 -0
- package/lib/src/ledger/account_nfts.js +199 -0
- package/lib/src/ledger/account_objects.d.ts +44 -0
- package/lib/src/ledger/account_objects.js +222 -0
- package/lib/src/ledger/account_offers.d.ts +13 -0
- package/lib/src/ledger/account_offers.js +142 -0
- package/lib/src/ledger/account_tx.d.ts +37 -0
- package/lib/src/ledger/account_tx.js +376 -0
- package/lib/src/ledger/amm_info.d.ts +13 -0
- package/lib/src/ledger/amm_info.js +114 -0
- package/lib/src/ledger/book_offers.d.ts +15 -0
- package/lib/src/ledger/book_offers.js +102 -0
- package/lib/src/ledger/currency.d.ts +28 -0
- package/lib/src/ledger/currency.js +250 -0
- package/lib/src/ledger/fee.d.ts +13 -0
- package/lib/src/ledger/fee.js +99 -0
- package/lib/src/ledger/gateway_balances.d.ts +16 -0
- package/lib/src/ledger/gateway_balances.js +119 -0
- package/lib/src/ledger/index.d.ts +21 -0
- package/lib/src/ledger/index.js +37 -0
- package/lib/src/ledger/ledger.d.ts +16 -0
- package/lib/src/ledger/ledger.js +99 -0
- package/lib/src/ledger/ledger_entry.d.ts +16 -0
- package/lib/src/ledger/ledger_entry.js +118 -0
- package/lib/src/ledger/manifest.d.ts +8 -0
- package/lib/src/ledger/manifest.js +67 -0
- package/lib/src/ledger/nft_info.d.ts +4 -0
- package/lib/src/ledger/nft_info.js +67 -0
- package/lib/src/ledger/server_definitions.d.ts +7 -0
- package/lib/src/ledger/server_definitions.js +65 -0
- package/lib/src/ledger/server_info.d.ts +8 -0
- package/lib/src/ledger/server_info.js +65 -0
- package/lib/src/ledger/transaction.d.ts +47 -0
- package/lib/src/ledger/transaction.js +440 -0
- package/lib/src/ledger/vl-v2.d.ts +3 -0
- package/lib/src/ledger/vl-v2.js +124 -0
- package/lib/src/ledger/vl.d.ts +4 -0
- package/lib/src/ledger/vl.js +131 -0
- package/lib/src/models/account_info.d.ts +184 -0
- package/lib/src/models/account_info.js +139 -0
- package/lib/src/models/account_lines.d.ts +26 -0
- package/lib/src/models/account_lines.js +2 -0
- package/lib/src/models/account_namespace.d.ts +16 -0
- package/lib/src/models/account_namespace.js +2 -0
- package/lib/src/models/account_nfts.d.ts +20 -0
- package/lib/src/models/account_nfts.js +92 -0
- package/lib/src/models/account_object.d.ts +61 -0
- package/lib/src/models/account_object.js +125 -0
- package/lib/src/models/account_offers.d.ts +9 -0
- package/lib/src/models/account_offers.js +2 -0
- package/lib/src/models/account_uritokens.d.ts +11 -0
- package/lib/src/models/account_uritokens.js +2 -0
- package/lib/src/models/amm_info.d.ts +1 -0
- package/lib/src/models/amm_info.js +4 -0
- package/lib/src/models/base_model.d.ts +15 -0
- package/lib/src/models/base_model.js +2 -0
- package/lib/src/models/book_offers.d.ts +9 -0
- package/lib/src/models/book_offers.js +40 -0
- package/lib/src/models/gateway_balances.d.ts +19 -0
- package/lib/src/models/gateway_balances.js +2 -0
- package/lib/src/models/index.d.ts +38 -0
- package/lib/src/models/index.js +82 -0
- package/lib/src/models/ledger.d.ts +7 -0
- package/lib/src/models/ledger.js +20 -0
- package/lib/src/models/manifest.d.ts +25 -0
- package/lib/src/models/manifest.js +199 -0
- package/lib/src/models/mptoken.d.ts +7 -0
- package/lib/src/models/mptoken.js +59 -0
- package/lib/src/models/path_find.d.ts +11 -0
- package/lib/src/models/path_find.js +2 -0
- package/lib/src/models/server_definitions.d.ts +33 -0
- package/lib/src/models/server_definitions.js +2 -0
- package/lib/src/models/transaction.d.ts +52 -0
- package/lib/src/models/transaction.js +141 -0
- package/lib/src/models/transactions/CronSet.d.ts +3 -0
- package/lib/src/models/transactions/CronSet.js +2 -0
- package/lib/src/models/transactions/SetRemarks.d.ts +3 -0
- package/lib/src/models/transactions/SetRemarks.js +2 -0
- package/lib/src/models/transactions/URITokenMint.d.ts +3 -0
- package/lib/src/models/transactions/URITokenMint.js +2 -0
- package/lib/src/models/vl.d.ts +82 -0
- package/lib/src/models/vl.js +498 -0
- package/lib/src/parse/index.d.ts +6 -0
- package/lib/src/parse/index.js +46 -0
- package/lib/src/parse/ledger/account-fields.d.ts +5 -0
- package/lib/src/parse/ledger/account-fields.js +43 -0
- package/lib/src/parse/ledger/account-info.d.ts +3 -0
- package/lib/src/parse/ledger/account-info.js +15 -0
- package/lib/src/parse/ledger/account-order.d.ts +18 -0
- package/lib/src/parse/ledger/account-order.js +48 -0
- package/lib/src/parse/ledger/account-settings-flags.d.ts +2 -0
- package/lib/src/parse/ledger/account-settings-flags.js +77 -0
- package/lib/src/parse/ledger/account.d.ts +1 -0
- package/lib/src/parse/ledger/account.js +7 -0
- package/lib/src/parse/ledger/amount.d.ts +3 -0
- package/lib/src/parse/ledger/amount.js +25 -0
- package/lib/src/parse/ledger/asset.d.ts +3 -0
- package/lib/src/parse/ledger/asset.js +19 -0
- package/lib/src/parse/ledger/auth-accounts.d.ts +3 -0
- package/lib/src/parse/ledger/auth-accounts.js +18 -0
- package/lib/src/parse/ledger/credential-flags.d.ts +5 -0
- package/lib/src/parse/ledger/credential-flags.js +8 -0
- package/lib/src/parse/ledger/credential.d.ts +3 -0
- package/lib/src/parse/ledger/credential.js +13 -0
- package/lib/src/parse/ledger/currency-amount.d.ts +3 -0
- package/lib/src/parse/ledger/currency-amount.js +13 -0
- package/lib/src/parse/ledger/delegate.d.ts +2 -0
- package/lib/src/parse/ledger/delegate.js +11 -0
- package/lib/src/parse/ledger/destination.d.ts +2 -0
- package/lib/src/parse/ledger/destination.js +12 -0
- package/lib/src/parse/ledger/emit_details.d.ts +2 -0
- package/lib/src/parse/ledger/emit_details.js +14 -0
- package/lib/src/parse/ledger/flags.d.ts +4 -0
- package/lib/src/parse/ledger/flags.js +17 -0
- package/lib/src/parse/ledger/gateway-balances.d.ts +3 -0
- package/lib/src/parse/ledger/gateway-balances.js +31 -0
- package/lib/src/parse/ledger/genesis-mints.d.ts +2 -0
- package/lib/src/parse/ledger/genesis-mints.js +17 -0
- package/lib/src/parse/ledger/import.d.ts +2 -0
- package/lib/src/parse/ledger/import.js +40 -0
- package/lib/src/parse/ledger/index.d.ts +6 -0
- package/lib/src/parse/ledger/index.js +29 -0
- package/lib/src/parse/ledger/ledger.d.ts +2 -0
- package/lib/src/parse/ledger/ledger.js +98 -0
- package/lib/src/parse/ledger/memos.d.ts +4 -0
- package/lib/src/parse/ledger/memos.js +27 -0
- package/lib/src/parse/ledger/mptoken-flags.d.ts +6 -0
- package/lib/src/parse/ledger/mptoken-flags.js +8 -0
- package/lib/src/parse/ledger/mptoken-issuance-flags.d.ts +6 -0
- package/lib/src/parse/ledger/mptoken-issuance-flags.js +8 -0
- package/lib/src/parse/ledger/nftoken-flags.d.ts +5 -0
- package/lib/src/parse/ledger/nftoken-flags.js +8 -0
- package/lib/src/parse/ledger/nftoken-offer-flags.d.ts +5 -0
- package/lib/src/parse/ledger/nftoken-offer-flags.js +8 -0
- package/lib/src/parse/ledger/offer-flags.d.ts +5 -0
- package/lib/src/parse/ledger/offer-flags.js +8 -0
- package/lib/src/parse/ledger/orderbook-order.d.ts +21 -0
- package/lib/src/parse/ledger/orderbook-order.js +42 -0
- package/lib/src/parse/ledger/permissions.d.ts +2 -0
- package/lib/src/parse/ledger/permissions.js +9 -0
- package/lib/src/parse/ledger/regular-key.d.ts +2 -0
- package/lib/src/parse/ledger/regular-key.js +14 -0
- package/lib/src/parse/ledger/remark-flags.d.ts +5 -0
- package/lib/src/parse/ledger/remark-flags.js +8 -0
- package/lib/src/parse/ledger/remarks.d.ts +3 -0
- package/lib/src/parse/ledger/remarks.js +37 -0
- package/lib/src/parse/ledger/signers.d.ts +2 -0
- package/lib/src/parse/ledger/signers.js +12 -0
- package/lib/src/parse/ledger/source.d.ts +3 -0
- package/lib/src/parse/ledger/source.js +28 -0
- package/lib/src/parse/ledger/trustline-flags.d.ts +5 -0
- package/lib/src/parse/ledger/trustline-flags.js +8 -0
- package/lib/src/parse/ledger/tx-account-set-flags.d.ts +4 -0
- package/lib/src/parse/ledger/tx-account-set-flags.js +36 -0
- package/lib/src/parse/ledger/tx-amm-clawback-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-amm-clawback-flags.js +8 -0
- package/lib/src/parse/ledger/tx-amm-deposit-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-amm-deposit-flags.js +8 -0
- package/lib/src/parse/ledger/tx-amm-withdraw-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-amm-withdraw-flags.js +8 -0
- package/lib/src/parse/ledger/tx-batch-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-batch-flags.js +8 -0
- package/lib/src/parse/ledger/tx-cron-set-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-cron-set-flags.js +8 -0
- package/lib/src/parse/ledger/tx-global-flags.d.ts +5 -0
- package/lib/src/parse/ledger/tx-global-flags.js +8 -0
- package/lib/src/parse/ledger/tx-mptoken-authorize-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-mptoken-authorize-flags.js +8 -0
- package/lib/src/parse/ledger/tx-mptoken-issuance-create-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-mptoken-issuance-create-flags.js +8 -0
- package/lib/src/parse/ledger/tx-mptoken-issuance-set-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-mptoken-issuance-set-flags.js +8 -0
- package/lib/src/parse/ledger/tx-nftoken-mint-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-nftoken-mint-flags.js +8 -0
- package/lib/src/parse/ledger/tx-nftoken-offer-create-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-nftoken-offer-create-flags.js +8 -0
- package/lib/src/parse/ledger/tx-offer-create-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-offer-create-flags.js +8 -0
- package/lib/src/parse/ledger/tx-payment-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-payment-flags.js +8 -0
- package/lib/src/parse/ledger/tx-trust-set-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-trust-set-flags.js +8 -0
- package/lib/src/parse/ledger/tx-uritoken-mint-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-uritoken-mint-flags.js +8 -0
- package/lib/src/parse/ledger/uritoken-flags.d.ts +5 -0
- package/lib/src/parse/ledger/uritoken-flags.js +8 -0
- package/lib/src/parse/mptoken_normalize.d.ts +5 -0
- package/lib/src/parse/mptoken_normalize.js +215 -0
- package/lib/src/parse/outcome/account_setting_changes.d.ts +4 -0
- package/lib/src/parse/outcome/account_setting_changes.js +67 -0
- package/lib/src/parse/outcome/affected_objects.d.ts +7 -0
- package/lib/src/parse/outcome/affected_objects.js +147 -0
- package/lib/src/parse/outcome/amendment_changes.d.ts +8 -0
- package/lib/src/parse/outcome/amendment_changes.js +84 -0
- package/lib/src/parse/outcome/amm_changes.d.ts +52 -0
- package/lib/src/parse/outcome/amm_changes.js +214 -0
- package/lib/src/parse/outcome/balance_changes.d.ts +24 -0
- package/lib/src/parse/outcome/balance_changes.js +337 -0
- package/lib/src/parse/outcome/channel_changes.d.ts +20 -0
- package/lib/src/parse/outcome/channel_changes.js +70 -0
- package/lib/src/parse/outcome/check_changes.d.ts +17 -0
- package/lib/src/parse/outcome/check_changes.js +63 -0
- package/lib/src/parse/outcome/credential_changes.d.ts +16 -0
- package/lib/src/parse/outcome/credential_changes.js +59 -0
- package/lib/src/parse/outcome/cron_changes.d.ts +13 -0
- package/lib/src/parse/outcome/cron_changes.js +72 -0
- package/lib/src/parse/outcome/delegate_changes.d.ts +12 -0
- package/lib/src/parse/outcome/delegate_changes.js +59 -0
- package/lib/src/parse/outcome/delivered_amount.d.ts +4 -0
- package/lib/src/parse/outcome/delivered_amount.js +63 -0
- package/lib/src/parse/outcome/did_changes.d.ts +14 -0
- package/lib/src/parse/outcome/did_changes.js +50 -0
- package/lib/src/parse/outcome/emitted_txns.d.ts +9 -0
- package/lib/src/parse/outcome/emitted_txns.js +57 -0
- package/lib/src/parse/outcome/escrow_changes.d.ts +16 -0
- package/lib/src/parse/outcome/escrow_changes.js +75 -0
- package/lib/src/parse/outcome/hooks_executions.d.ts +13 -0
- package/lib/src/parse/outcome/hooks_executions.js +42 -0
- package/lib/src/parse/outcome/index.d.ts +26 -0
- package/lib/src/parse/outcome/index.js +55 -0
- package/lib/src/parse/outcome/locked_balance_changes.d.ts +20 -0
- package/lib/src/parse/outcome/locked_balance_changes.js +117 -0
- package/lib/src/parse/outcome/mptoken_changes.d.ts +1 -0
- package/lib/src/parse/outcome/mptoken_changes.js +113 -0
- package/lib/src/parse/outcome/mptoken_issuance_changes.d.ts +1 -0
- package/lib/src/parse/outcome/mptoken_issuance_changes.js +119 -0
- package/lib/src/parse/outcome/nftoken_changes.d.ts +1 -0
- package/lib/src/parse/outcome/nftoken_changes.js +234 -0
- package/lib/src/parse/outcome/nftoken_offer_changes.d.ts +2 -0
- package/lib/src/parse/outcome/nftoken_offer_changes.js +106 -0
- package/lib/src/parse/outcome/oracle_changes.d.ts +29 -0
- package/lib/src/parse/outcome/oracle_changes.js +150 -0
- package/lib/src/parse/outcome/orderbook_changes.d.ts +21 -0
- package/lib/src/parse/outcome/orderbook_changes.js +108 -0
- package/lib/src/parse/outcome/orderbook_quality.d.ts +2 -0
- package/lib/src/parse/outcome/orderbook_quality.js +49 -0
- package/lib/src/parse/outcome/remarks_changes.d.ts +14 -0
- package/lib/src/parse/outcome/remarks_changes.js +68 -0
- package/lib/src/parse/outcome/unl_report_changes.d.ts +13 -0
- package/lib/src/parse/outcome/unl_report_changes.js +48 -0
- package/lib/src/parse/outcome/uritoken_changes.d.ts +1 -0
- package/lib/src/parse/outcome/uritoken_changes.js +83 -0
- package/lib/src/parse/outcome/uritoken_sell_offer_changes.d.ts +1 -0
- package/lib/src/parse/outcome/uritoken_sell_offer_changes.js +105 -0
- package/lib/src/parse/outcome.d.ts +4 -0
- package/lib/src/parse/outcome.js +264 -0
- package/lib/src/parse/specification/account-delete.d.ts +4 -0
- package/lib/src/parse/specification/account-delete.js +59 -0
- package/lib/src/parse/specification/amendment.d.ts +3 -0
- package/lib/src/parse/specification/amendment.js +50 -0
- package/lib/src/parse/specification/amm-bid.d.ts +4 -0
- package/lib/src/parse/specification/amm-bid.js +66 -0
- package/lib/src/parse/specification/amm-clawback.d.ts +4 -0
- package/lib/src/parse/specification/amm-clawback.js +65 -0
- package/lib/src/parse/specification/amm-create.d.ts +4 -0
- package/lib/src/parse/specification/amm-create.js +62 -0
- package/lib/src/parse/specification/amm-delete.d.ts +4 -0
- package/lib/src/parse/specification/amm-delete.js +61 -0
- package/lib/src/parse/specification/amm-deposit.d.ts +4 -0
- package/lib/src/parse/specification/amm-deposit.js +66 -0
- package/lib/src/parse/specification/amm-vote.d.ts +4 -0
- package/lib/src/parse/specification/amm-vote.js +62 -0
- package/lib/src/parse/specification/amm-withdraw.d.ts +4 -0
- package/lib/src/parse/specification/amm-withdraw.js +66 -0
- package/lib/src/parse/specification/batch.d.ts +4 -0
- package/lib/src/parse/specification/batch.js +83 -0
- package/lib/src/parse/specification/check-cancel.d.ts +4 -0
- package/lib/src/parse/specification/check-cancel.js +58 -0
- package/lib/src/parse/specification/check-cash.d.ts +4 -0
- package/lib/src/parse/specification/check-cash.js +64 -0
- package/lib/src/parse/specification/check-create.d.ts +4 -0
- package/lib/src/parse/specification/check-create.js +67 -0
- package/lib/src/parse/specification/clawback.d.ts +4 -0
- package/lib/src/parse/specification/clawback.js +62 -0
- package/lib/src/parse/specification/credential-accept.d.ts +4 -0
- package/lib/src/parse/specification/credential-accept.js +56 -0
- package/lib/src/parse/specification/credential-create.d.ts +4 -0
- package/lib/src/parse/specification/credential-create.js +58 -0
- package/lib/src/parse/specification/credential-delete.d.ts +4 -0
- package/lib/src/parse/specification/credential-delete.js +57 -0
- package/lib/src/parse/specification/cron-set.d.ts +3 -0
- package/lib/src/parse/specification/cron-set.js +62 -0
- package/lib/src/parse/specification/cron.d.ts +3 -0
- package/lib/src/parse/specification/cron.js +47 -0
- package/lib/src/parse/specification/delegate-set.d.ts +4 -0
- package/lib/src/parse/specification/delegate-set.js +60 -0
- package/lib/src/parse/specification/deposit-preauth.d.ts +4 -0
- package/lib/src/parse/specification/deposit-preauth.js +62 -0
- package/lib/src/parse/specification/did-delete.d.ts +4 -0
- package/lib/src/parse/specification/did-delete.js +57 -0
- package/lib/src/parse/specification/did-set.d.ts +4 -0
- package/lib/src/parse/specification/did-set.js +60 -0
- package/lib/src/parse/specification/escrow-cancel.d.ts +4 -0
- package/lib/src/parse/specification/escrow-cancel.js +59 -0
- package/lib/src/parse/specification/escrow-create.d.ts +4 -0
- package/lib/src/parse/specification/escrow-create.js +64 -0
- package/lib/src/parse/specification/escrow-finish.d.ts +4 -0
- package/lib/src/parse/specification/escrow-finish.js +61 -0
- package/lib/src/parse/specification/fee-update.d.ts +3 -0
- package/lib/src/parse/specification/fee-update.js +69 -0
- package/lib/src/parse/specification/genesis-mint.d.ts +3 -0
- package/lib/src/parse/specification/genesis-mint.js +53 -0
- package/lib/src/parse/specification/import.d.ts +3 -0
- package/lib/src/parse/specification/import.js +55 -0
- package/lib/src/parse/specification/invoke.d.ts +3 -0
- package/lib/src/parse/specification/invoke.js +54 -0
- package/lib/src/parse/specification/mptoken-authorize.d.ts +4 -0
- package/lib/src/parse/specification/mptoken-authorize.js +60 -0
- package/lib/src/parse/specification/mptoken-issuance-create.d.ts +4 -0
- package/lib/src/parse/specification/mptoken-issuance-create.js +62 -0
- package/lib/src/parse/specification/mptoken-issuance-destroy.d.ts +4 -0
- package/lib/src/parse/specification/mptoken-issuance-destroy.js +56 -0
- package/lib/src/parse/specification/mptoken-issuance-set.d.ts +4 -0
- package/lib/src/parse/specification/mptoken-issuance-set.js +60 -0
- package/lib/src/parse/specification/nftoken-accept-offer.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-accept-offer.js +58 -0
- package/lib/src/parse/specification/nftoken-burn.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-burn.js +56 -0
- package/lib/src/parse/specification/nftoken-cancel-offer.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-cancel-offer.js +56 -0
- package/lib/src/parse/specification/nftoken-create-offer.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-create-offer.js +69 -0
- package/lib/src/parse/specification/nftoken-mint.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-mint.js +73 -0
- package/lib/src/parse/specification/nftoken-modify.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-modify.js +58 -0
- package/lib/src/parse/specification/offer-cancel.d.ts +4 -0
- package/lib/src/parse/specification/offer-cancel.js +58 -0
- package/lib/src/parse/specification/offer-create.d.ts +4 -0
- package/lib/src/parse/specification/offer-create.js +78 -0
- package/lib/src/parse/specification/oracle-delete.d.ts +4 -0
- package/lib/src/parse/specification/oracle-delete.js +56 -0
- package/lib/src/parse/specification/oracle-set.d.ts +4 -0
- package/lib/src/parse/specification/oracle-set.js +62 -0
- package/lib/src/parse/specification/payment-channel-claim.d.ts +4 -0
- package/lib/src/parse/specification/payment-channel-claim.js +67 -0
- package/lib/src/parse/specification/payment-channel-create.d.ts +4 -0
- package/lib/src/parse/specification/payment-channel-create.js +68 -0
- package/lib/src/parse/specification/payment-channel-fund.d.ts +4 -0
- package/lib/src/parse/specification/payment-channel-fund.js +65 -0
- package/lib/src/parse/specification/payment.d.ts +4 -0
- package/lib/src/parse/specification/payment.js +75 -0
- package/lib/src/parse/specification/permissioned-domain-set.d.ts +4 -0
- package/lib/src/parse/specification/permissioned-domain-set.js +56 -0
- package/lib/src/parse/specification/remit.d.ts +3 -0
- package/lib/src/parse/specification/remit.js +90 -0
- package/lib/src/parse/specification/set-remarks.d.ts +3 -0
- package/lib/src/parse/specification/set-remarks.js +56 -0
- package/lib/src/parse/specification/settings.d.ts +4 -0
- package/lib/src/parse/specification/settings.js +64 -0
- package/lib/src/parse/specification/ticket-create.d.ts +4 -0
- package/lib/src/parse/specification/ticket-create.js +58 -0
- package/lib/src/parse/specification/trust-set.d.ts +4 -0
- package/lib/src/parse/specification/trust-set.js +80 -0
- package/lib/src/parse/specification/unl-modify.d.ts +4 -0
- package/lib/src/parse/specification/unl-modify.js +52 -0
- package/lib/src/parse/specification/unl-report.d.ts +3 -0
- package/lib/src/parse/specification/unl-report.js +51 -0
- package/lib/src/parse/specification/unrecognized.d.ts +4 -0
- package/lib/src/parse/specification/unrecognized.js +24 -0
- package/lib/src/parse/specification/uritoken-burn.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-burn.js +54 -0
- package/lib/src/parse/specification/uritoken-buy.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-buy.js +55 -0
- package/lib/src/parse/specification/uritoken-cancel-sell-offer.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-cancel-sell-offer.js +54 -0
- package/lib/src/parse/specification/uritoken-create-sell-offer.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-create-sell-offer.js +57 -0
- package/lib/src/parse/specification/uritoken-mint.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-mint.js +63 -0
- package/lib/src/parse/transaction.d.ts +168 -0
- package/lib/src/parse/transaction.js +228 -0
- package/lib/src/parse/utils.d.ts +33 -0
- package/lib/src/parse/utils.js +119 -0
- package/lib/src/types/account.d.ts +26 -0
- package/lib/src/types/account.js +2 -0
- package/lib/src/types/adjustments.d.ts +16 -0
- package/lib/src/types/adjustments.js +2 -0
- package/lib/src/types/amendments.d.ts +4 -0
- package/lib/src/types/amendments.js +2 -0
- package/lib/src/types/amm.d.ts +98 -0
- package/lib/src/types/amm.js +68 -0
- package/lib/src/types/amounts.d.ts +20 -0
- package/lib/src/types/amounts.js +2 -0
- package/lib/src/types/batch.d.ts +21 -0
- package/lib/src/types/batch.js +26 -0
- package/lib/src/types/checks.d.ts +17 -0
- package/lib/src/types/checks.js +2 -0
- package/lib/src/types/clawback.d.ts +5 -0
- package/lib/src/types/clawback.js +2 -0
- package/lib/src/types/credentials.d.ts +30 -0
- package/lib/src/types/credentials.js +10 -0
- package/lib/src/types/cron.d.ts +17 -0
- package/lib/src/types/cron.js +6 -0
- package/lib/src/types/delegate.d.ts +5 -0
- package/lib/src/types/delegate.js +2 -0
- package/lib/src/types/deposits.d.ts +11 -0
- package/lib/src/types/deposits.js +2 -0
- package/lib/src/types/did.d.ts +7 -0
- package/lib/src/types/did.js +2 -0
- package/lib/src/types/emit_details.d.ts +7 -0
- package/lib/src/types/emit_details.js +2 -0
- package/lib/src/types/escrows.d.ts +18 -0
- package/lib/src/types/escrows.js +2 -0
- package/lib/src/types/fees.d.ts +9 -0
- package/lib/src/types/fees.js +2 -0
- package/lib/src/types/gateway_balances.d.ts +11 -0
- package/lib/src/types/gateway_balances.js +2 -0
- package/lib/src/types/genesis_mint.d.ts +9 -0
- package/lib/src/types/genesis_mint.js +2 -0
- package/lib/src/types/global.d.ts +14 -0
- package/lib/src/types/global.js +26 -0
- package/lib/src/types/hooks.d.ts +14 -0
- package/lib/src/types/hooks.js +2 -0
- package/lib/src/types/import.d.ts +21 -0
- package/lib/src/types/import.js +2 -0
- package/lib/src/types/index.d.ts +31 -0
- package/lib/src/types/index.js +47 -0
- package/lib/src/types/invoke.d.ts +5 -0
- package/lib/src/types/invoke.js +2 -0
- package/lib/src/types/ledger.d.ts +46 -0
- package/lib/src/types/ledger.js +2 -0
- package/lib/src/types/ledger_data.d.ts +10 -0
- package/lib/src/types/ledger_data.js +2 -0
- package/lib/src/types/ledger_entries.d.ts +163 -0
- package/lib/src/types/ledger_entries.js +2 -0
- package/lib/src/types/memos.d.ts +12 -0
- package/lib/src/types/memos.js +2 -0
- package/lib/src/types/mptokens.d.ts +84 -0
- package/lib/src/types/mptokens.js +76 -0
- package/lib/src/types/nftokens.d.ts +62 -0
- package/lib/src/types/nftokens.js +44 -0
- package/lib/src/types/offers.d.ts +46 -0
- package/lib/src/types/offers.js +33 -0
- package/lib/src/types/oracle.d.ts +19 -0
- package/lib/src/types/oracle.js +2 -0
- package/lib/src/types/outcome.d.ts +22 -0
- package/lib/src/types/outcome.js +2 -0
- package/lib/src/types/payment_channels.d.ts +23 -0
- package/lib/src/types/payment_channels.js +2 -0
- package/lib/src/types/payments.d.ts +24 -0
- package/lib/src/types/payments.js +25 -0
- package/lib/src/types/queue_data.d.ts +15 -0
- package/lib/src/types/queue_data.js +2 -0
- package/lib/src/types/remarks.d.ts +24 -0
- package/lib/src/types/remarks.js +6 -0
- package/lib/src/types/remits.d.ts +15 -0
- package/lib/src/types/remits.js +2 -0
- package/lib/src/types/settings.d.ts +27 -0
- package/lib/src/types/settings.js +2 -0
- package/lib/src/types/signers.d.ts +22 -0
- package/lib/src/types/signers.js +2 -0
- package/lib/src/types/specification.d.ts +14 -0
- package/lib/src/types/specification.js +2 -0
- package/lib/src/types/tickets.d.ts +4 -0
- package/lib/src/types/tickets.js +2 -0
- package/lib/src/types/trustlines.d.ts +85 -0
- package/lib/src/types/trustlines.js +43 -0
- package/lib/src/types/unl_modify.d.ts +6 -0
- package/lib/src/types/unl_modify.js +2 -0
- package/lib/src/types/unl_reports.d.ts +5 -0
- package/lib/src/types/unl_reports.js +2 -0
- package/lib/src/types/unrecognized.d.ts +5 -0
- package/lib/src/types/unrecognized.js +2 -0
- package/lib/src/types/uri_tokens.d.ts +7 -0
- package/lib/src/types/uri_tokens.js +6 -0
- package/lib/src/types/uritokens.d.ts +41 -0
- package/lib/src/types/uritokens.js +22 -0
- package/lib/src/v1/transaction/payment.d.ts +14 -0
- package/lib/src/v1/transaction/payment.js +142 -0
- package/lib/src/v1/types.d.ts +9 -0
- package/lib/src/v1/types.js +2 -0
- package/lib/src/v1/utils.d.ts +7 -0
- package/lib/src/v1/utils.js +49 -0
- package/lib/src/validator.d.ts +11 -0
- package/lib/src/validator.js +130 -0
- package/lib/src/wallet.d.ts +34 -0
- package/lib/src/wallet.js +284 -0
- package/package.json +19 -19
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAccountSettingsFlags = parseAccountSettingsFlags;
|
|
4
|
+
const account_info_1 = require("../../models/account_info");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
const client_1 = require("../../client");
|
|
7
|
+
function parseAccountSettingsFlags(setFlag, clearFlag) {
|
|
8
|
+
const settings = {};
|
|
9
|
+
if (setFlag === undefined && clearFlag === undefined) {
|
|
10
|
+
return settings;
|
|
11
|
+
}
|
|
12
|
+
const key = setFlag !== undefined ? setFlag : clearFlag;
|
|
13
|
+
const value = setFlag !== undefined ? true : false;
|
|
14
|
+
switch (key) {
|
|
15
|
+
case account_info_1.AccountSetFlags.requireDestinationTag:
|
|
16
|
+
settings.requireDestTag = value;
|
|
17
|
+
break;
|
|
18
|
+
case account_info_1.AccountSetFlags.requireAuthorization:
|
|
19
|
+
settings.requireAuth = value;
|
|
20
|
+
break;
|
|
21
|
+
case account_info_1.AccountSetFlags.depositAuth:
|
|
22
|
+
settings.depositAuth = value;
|
|
23
|
+
break;
|
|
24
|
+
case account_info_1.AccountSetFlags.disallowIncomingXRP:
|
|
25
|
+
settings.disallowXRP = value;
|
|
26
|
+
break;
|
|
27
|
+
case account_info_1.AccountSetFlags.disableMasterKey:
|
|
28
|
+
settings.disableMaster = value;
|
|
29
|
+
break;
|
|
30
|
+
case account_info_1.AccountSetFlags.enableTransactionIDTracking:
|
|
31
|
+
settings.enableTransactionIDTracking = value;
|
|
32
|
+
break;
|
|
33
|
+
case account_info_1.AccountSetFlags.noFreeze:
|
|
34
|
+
settings.noFreeze = value;
|
|
35
|
+
break;
|
|
36
|
+
case account_info_1.AccountSetFlags.globalFreeze:
|
|
37
|
+
settings.globalFreeze = value;
|
|
38
|
+
break;
|
|
39
|
+
case account_info_1.AccountSetFlags.defaultRipple:
|
|
40
|
+
settings.defaultRipple = value;
|
|
41
|
+
break;
|
|
42
|
+
case account_info_1.AccountSetFlags.disallowIncomingNFTokenOffer:
|
|
43
|
+
settings.disallowIncomingNFTokenOffer = value;
|
|
44
|
+
break;
|
|
45
|
+
case account_info_1.AccountSetFlags.disallowIncomingCheck:
|
|
46
|
+
settings.disallowIncomingCheck = value;
|
|
47
|
+
break;
|
|
48
|
+
case account_info_1.AccountSetFlags.disallowIncomingPayChan:
|
|
49
|
+
settings.disallowIncomingPayChan = value;
|
|
50
|
+
break;
|
|
51
|
+
case account_info_1.AccountSetFlags.disallowIncomingTrustline:
|
|
52
|
+
settings.disallowIncomingTrustline = value;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
const nativeCurrency = (0, client_1.getNativeCurrency)();
|
|
56
|
+
if (nativeCurrency === common_1.XAHAU_NATIVE_CURRENCY) {
|
|
57
|
+
switch (key) {
|
|
58
|
+
case account_info_1.AccountSetFlags.tshCollect:
|
|
59
|
+
settings.tshCollect = value;
|
|
60
|
+
break;
|
|
61
|
+
case account_info_1.AccountSetFlags.disallowIncomingRemit:
|
|
62
|
+
settings.disallowIncomingRemit = value;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
switch (key) {
|
|
68
|
+
case account_info_1.AccountSetFlags.allowTrustLineClawback:
|
|
69
|
+
settings.allowTrustLineClawback = value;
|
|
70
|
+
break;
|
|
71
|
+
case account_info_1.AccountSetFlags.allowTrustLineLocking:
|
|
72
|
+
settings.allowTrustLineLocking = value;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return settings;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseAccount(account: string): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_1 = require("../../common");
|
|
4
|
+
const client_1 = require("../../client");
|
|
5
|
+
function parseAmount(amount) {
|
|
6
|
+
if (typeof amount === "string") {
|
|
7
|
+
return {
|
|
8
|
+
currency: (0, client_1.getNativeCurrency)(),
|
|
9
|
+
value: (0, common_1.dropsToXrp)(amount),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
if (amount && "value" in amount && "currency" in amount && "issuer" in amount) {
|
|
13
|
+
return {
|
|
14
|
+
issuer: amount.issuer,
|
|
15
|
+
currency: amount.currency,
|
|
16
|
+
value: amount.value,
|
|
17
|
+
counterparty: amount.issuer,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (amount && typeof amount === "object") {
|
|
21
|
+
return { ...amount };
|
|
22
|
+
}
|
|
23
|
+
return amount;
|
|
24
|
+
}
|
|
25
|
+
exports.default = parseAmount;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const client_1 = require("../../client");
|
|
4
|
+
function parseAsset(asset) {
|
|
5
|
+
if (asset === undefined) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (asset.currency === (0, client_1.getNativeCurrency)()) {
|
|
9
|
+
return {
|
|
10
|
+
currency: asset.currency,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
issuer: asset.issuer,
|
|
15
|
+
currency: asset.currency,
|
|
16
|
+
counterparty: asset.issuer,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
exports.default = parseAsset;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function parseAuthAccounts(authAccounts) {
|
|
4
|
+
if (!authAccounts) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const result = [];
|
|
8
|
+
for (const authAccount of authAccounts) {
|
|
9
|
+
if (authAccount.AuthAccount.Account) {
|
|
10
|
+
result.push(authAccount.AuthAccount.Account);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (result.length === 0) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
exports.default = parseAuthAccounts;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const credentials_1 = require("../../types/credentials");
|
|
4
|
+
const flags_1 = require("./flags");
|
|
5
|
+
function parseCredentialFlags(value, options = {}) {
|
|
6
|
+
return (0, flags_1.parseFlags)(value, credentials_1.CredentialFlagsKeys, options);
|
|
7
|
+
}
|
|
8
|
+
exports.default = parseCredentialFlags;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCredentials = parseCredentials;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
function parseCredentials(credential) {
|
|
6
|
+
if (!credential.Credential) {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
issuer: credential.Credential.Issuer,
|
|
11
|
+
type: (0, utils_1.decodeHexData)(credential.Credential.CredentialType),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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 amount_1 = __importDefault(require("./amount"));
|
|
7
|
+
function parseCurrencyAmount(amount) {
|
|
8
|
+
if (amount === undefined) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return (0, amount_1.default)(amount);
|
|
12
|
+
}
|
|
13
|
+
exports.default = parseCurrencyAmount;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseDelegate = parseDelegate;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
function parseDelegate(tx) {
|
|
6
|
+
if (tx && tx.Delegate) {
|
|
7
|
+
return (0, common_1.removeUndefined)({
|
|
8
|
+
address: tx.Delegate,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseDestination = parseDestination;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
function parseDestination(tx) {
|
|
6
|
+
if (tx && tx.Destination) {
|
|
7
|
+
return (0, common_1.removeUndefined)({
|
|
8
|
+
address: tx.Destination,
|
|
9
|
+
tag: tx.DestinationTag,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseEmittedDetails = parseEmittedDetails;
|
|
4
|
+
function parseEmittedDetails(tx) {
|
|
5
|
+
if (tx && tx.EmitDetails) {
|
|
6
|
+
return {
|
|
7
|
+
emitBurden: tx.EmitDetails.EmitBurden,
|
|
8
|
+
emitGeneration: tx.EmitDetails.EmitGeneration,
|
|
9
|
+
emitHookHash: tx.EmitDetails.EmitHookHash,
|
|
10
|
+
emitNonce: tx.EmitDetails.EmitNonce,
|
|
11
|
+
emitParentTxnID: tx.EmitDetails.EmitParentTxnID,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseFlags = parseFlags;
|
|
4
|
+
function parseFlags(value, keys, options = {}) {
|
|
5
|
+
const flags = {};
|
|
6
|
+
for (const flagName in keys) {
|
|
7
|
+
if (value & keys[flagName]) {
|
|
8
|
+
flags[flagName] = true;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
if (!options.excludeFalse) {
|
|
12
|
+
flags[flagName] = false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return flags;
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseGatewayBalances = parseGatewayBalances;
|
|
4
|
+
function parseGatewayBalances(balanceSheet) {
|
|
5
|
+
const result = {};
|
|
6
|
+
if (typeof balanceSheet.balances === "object") {
|
|
7
|
+
Object.entries(balanceSheet.balances).forEach((entry) => {
|
|
8
|
+
const [issuer, balances] = entry;
|
|
9
|
+
balances.forEach((balance) => {
|
|
10
|
+
if (!result.balances) {
|
|
11
|
+
result.balances = [];
|
|
12
|
+
}
|
|
13
|
+
result.balances.push(Object.assign({ issuer, counterparty: issuer }, balance));
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (typeof balanceSheet.assets === "object") {
|
|
18
|
+
Object.entries(balanceSheet.assets).forEach(([issuer, assets]) => {
|
|
19
|
+
assets.forEach((balance) => {
|
|
20
|
+
if (!result.assets) {
|
|
21
|
+
result.assets = [];
|
|
22
|
+
}
|
|
23
|
+
result.assets.push(Object.assign({ issuer, counterparty: issuer }, balance));
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (typeof balanceSheet.obligations === "object") {
|
|
28
|
+
result.obligations = Object.entries(balanceSheet.obligations).map(([currency, value]) => ({ currency, value }));
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
exports.parseGenesisMints = parseGenesisMints;
|
|
7
|
+
const amount_1 = __importDefault(require("./amount"));
|
|
8
|
+
function parseGenesisMints(tx) {
|
|
9
|
+
if (tx && tx.GenesisMints) {
|
|
10
|
+
return tx.GenesisMints.map((m) => {
|
|
11
|
+
return {
|
|
12
|
+
amount: (0, amount_1.default)(m.GenesisMint.Amount),
|
|
13
|
+
destination: m.GenesisMint.Destination,
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseImportBlob = parseImportBlob;
|
|
4
|
+
const ripple_binary_codec_1 = require("ripple-binary-codec");
|
|
5
|
+
const wallet_1 = require("../../wallet");
|
|
6
|
+
const vl_1 = require("../../models/vl");
|
|
7
|
+
const transaction_1 = require("../../models/transaction");
|
|
8
|
+
const MAINNET_NATIVE_CURRENCY = "XRP";
|
|
9
|
+
function parseImportBlob(blob) {
|
|
10
|
+
try {
|
|
11
|
+
const decodedBlob = JSON.parse(Buffer.from(blob, "hex").toString("utf8"));
|
|
12
|
+
const data = decodedBlob.validation.data;
|
|
13
|
+
for (const key in data) {
|
|
14
|
+
if (data.hasOwnProperty(key)) {
|
|
15
|
+
data[key] = (0, ripple_binary_codec_1.decode)(data[key]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const tx = (0, ripple_binary_codec_1.decode)(decodedBlob.transaction.blob);
|
|
19
|
+
const meta = (0, ripple_binary_codec_1.decode)(decodedBlob.transaction.meta);
|
|
20
|
+
const parsedTX = (0, transaction_1.getAccountTxDetails)({ tx: tx, meta: meta, validated: true }, false, MAINNET_NATIVE_CURRENCY);
|
|
21
|
+
return {
|
|
22
|
+
ledger: decodedBlob.ledger,
|
|
23
|
+
validation: {
|
|
24
|
+
data,
|
|
25
|
+
unl: (0, vl_1.parseVL)(decodedBlob.validation.unl),
|
|
26
|
+
},
|
|
27
|
+
transaction: {
|
|
28
|
+
id: (0, wallet_1.hashSignedTx)(decodedBlob.transaction.blob),
|
|
29
|
+
tx: (0, ripple_binary_codec_1.decode)(decodedBlob.transaction.blob),
|
|
30
|
+
meta: (0, ripple_binary_codec_1.decode)(decodedBlob.transaction.meta),
|
|
31
|
+
proof: decodedBlob.transaction.proof,
|
|
32
|
+
specification: parsedTX.specification,
|
|
33
|
+
outcome: parsedTX.outcome,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch (_err) {
|
|
38
|
+
return blob;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import parseAmount from "./amount";
|
|
2
|
+
import { parseMemos } from "./memos";
|
|
3
|
+
import { parseRemarks, REMARKS_SUPPORTED_ENTRIES } from "./remarks";
|
|
4
|
+
export * from "./account";
|
|
5
|
+
export * from "../utils";
|
|
6
|
+
export { parseAmount, parseMemos, parseRemarks, REMARKS_SUPPORTED_ENTRIES };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.REMARKS_SUPPORTED_ENTRIES = exports.parseRemarks = exports.parseMemos = exports.parseAmount = void 0;
|
|
21
|
+
const amount_1 = __importDefault(require("./amount"));
|
|
22
|
+
exports.parseAmount = amount_1.default;
|
|
23
|
+
const memos_1 = require("./memos");
|
|
24
|
+
Object.defineProperty(exports, "parseMemos", { enumerable: true, get: function () { return memos_1.parseMemos; } });
|
|
25
|
+
const remarks_1 = require("./remarks");
|
|
26
|
+
Object.defineProperty(exports, "parseRemarks", { enumerable: true, get: function () { return remarks_1.parseRemarks; } });
|
|
27
|
+
Object.defineProperty(exports, "REMARKS_SUPPORTED_ENTRIES", { enumerable: true, get: function () { return remarks_1.REMARKS_SUPPORTED_ENTRIES; } });
|
|
28
|
+
__exportStar(require("./account"), exports);
|
|
29
|
+
__exportStar(require("../utils"), exports);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.parseLedger = parseLedger;
|
|
40
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
41
|
+
const Client = __importStar(require("../../client"));
|
|
42
|
+
const common_1 = require("../../common");
|
|
43
|
+
const models_1 = require("../../models");
|
|
44
|
+
const transaction_1 = require("../transaction");
|
|
45
|
+
function parseTransactionWrapper(ledgerIndex, includeRawTransaction, tx) {
|
|
46
|
+
const transaction = Object.assign({}, lodash_1.default.omit(tx, "metaData"), {
|
|
47
|
+
meta: tx.metaData,
|
|
48
|
+
ledger_index: ledgerIndex,
|
|
49
|
+
});
|
|
50
|
+
const result = (0, transaction_1.parseTransaction)(transaction, includeRawTransaction, Client.getNativeCurrency());
|
|
51
|
+
if (!result.outcome) {
|
|
52
|
+
result.outcome = {};
|
|
53
|
+
}
|
|
54
|
+
if (!result.outcome.ledgerIndex) {
|
|
55
|
+
result.outcome.ledgerIndex = ledgerIndex;
|
|
56
|
+
}
|
|
57
|
+
if (!result.outcome.ledgerVersion) {
|
|
58
|
+
result.outcome.ledgerVersion = ledgerIndex;
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
function parseTransactions(transactions, ledgerIndex, includeRawTransactions) {
|
|
63
|
+
if (lodash_1.default.isEmpty(transactions)) {
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
if (typeof transactions[0] === "string") {
|
|
67
|
+
return { transactionHashes: transactions };
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
transactions: transactions.map(lodash_1.default.partial(parseTransactionWrapper, ledgerIndex, includeRawTransactions)),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function parseState(state) {
|
|
74
|
+
if (lodash_1.default.isEmpty(state)) {
|
|
75
|
+
return {};
|
|
76
|
+
}
|
|
77
|
+
if (typeof state[0] === "string") {
|
|
78
|
+
return { stateHashes: state };
|
|
79
|
+
}
|
|
80
|
+
return { rawState: JSON.stringify(state) };
|
|
81
|
+
}
|
|
82
|
+
function parseLedger(ledger, includeRawTransactions) {
|
|
83
|
+
const ledgerIndex = parseInt(ledger.ledger_index, 10);
|
|
84
|
+
return (0, common_1.removeUndefined)(Object.assign({
|
|
85
|
+
stateHash: ledger.account_hash,
|
|
86
|
+
close_time: (0, models_1.ledgerTimeToUnixTime)(ledger.close_time),
|
|
87
|
+
closeTime: (0, models_1.ledgerTimeToISO8601)(ledger.close_time),
|
|
88
|
+
closeTimeResolution: ledger.close_time_resolution,
|
|
89
|
+
closeFlags: ledger.close_flags,
|
|
90
|
+
ledgerHash: ledger.ledger_hash,
|
|
91
|
+
ledgerIndex: ledgerIndex,
|
|
92
|
+
ledgerVersion: ledgerIndex,
|
|
93
|
+
parentLedgerHash: ledger.parent_hash,
|
|
94
|
+
parentCloseTime: (0, models_1.ledgerTimeToISO8601)(ledger.parent_close_time),
|
|
95
|
+
totalDrops: ledger.total_coins,
|
|
96
|
+
transactionHash: ledger.transaction_hash,
|
|
97
|
+
}, parseTransactions(ledger.transactions, ledgerIndex, includeRawTransactions), parseState(ledger.accountState)));
|
|
98
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseMemos = parseMemos;
|
|
4
|
+
exports.formattedMemoToMemo = formattedMemoToMemo;
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
function parseMemos(tx) {
|
|
8
|
+
if (!Array.isArray(tx.Memos) || tx.Memos.length === 0) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return tx.Memos.map((m) => {
|
|
12
|
+
return (0, common_1.removeUndefined)({
|
|
13
|
+
type: (0, utils_1.hexToString)(m.Memo.MemoType),
|
|
14
|
+
format: (0, utils_1.hexToString)(m.Memo.MemoFormat),
|
|
15
|
+
data: (0, utils_1.decodeHexData)(m.Memo.MemoData),
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function formattedMemoToMemo(memo) {
|
|
20
|
+
return {
|
|
21
|
+
Memo: (0, common_1.removeUndefined)({
|
|
22
|
+
MemoData: (0, utils_1.stringToHex)(memo.data),
|
|
23
|
+
MemoType: (0, utils_1.stringToHex)(memo.type),
|
|
24
|
+
MemoFormat: (0, utils_1.stringToHex)(memo.format),
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mptokens_1 = require("../../types/mptokens");
|
|
4
|
+
const flags_1 = require("./flags");
|
|
5
|
+
function parseMPTokenFlags(value, options = {}) {
|
|
6
|
+
return (0, flags_1.parseFlags)(value, mptokens_1.MPTokenFlagsKeys, options);
|
|
7
|
+
}
|
|
8
|
+
exports.default = parseMPTokenFlags;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MPTokenIssuanceFlagsKeysInterface } from "../../types/mptokens";
|
|
2
|
+
declare function parseMPTokenIssuanceFlags(value: number, options?: {
|
|
3
|
+
excludeFalse?: boolean;
|
|
4
|
+
nativeCurrency?: string;
|
|
5
|
+
}): MPTokenIssuanceFlagsKeysInterface;
|
|
6
|
+
export default parseMPTokenIssuanceFlags;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mptokens_1 = require("../../types/mptokens");
|
|
4
|
+
const flags_1 = require("./flags");
|
|
5
|
+
function parseMPTokenIssuanceFlags(value, options = {}) {
|
|
6
|
+
return (0, flags_1.parseFlags)(value, mptokens_1.MPTokenIssuanceFlagsKeys, options);
|
|
7
|
+
}
|
|
8
|
+
exports.default = parseMPTokenIssuanceFlags;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const nftokens_1 = require("../../types/nftokens");
|
|
4
|
+
const flags_1 = require("./flags");
|
|
5
|
+
function parseNFTokenFlags(value, options = {}) {
|
|
6
|
+
return (0, flags_1.parseFlags)(value, nftokens_1.NFTokenFlagsKeys, options);
|
|
7
|
+
}
|
|
8
|
+
exports.default = parseNFTokenFlags;
|