@bithomp/xrpl-api 3.7.30 → 3.7.37
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/parse/outcome/orderbook_changes.js +5 -4
- package/lib/parse/specification/offer-create.js +1 -0
- 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 +76 -0
- package/lib/src/connection.js +653 -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/lib/types/offers.d.ts +1 -0
- package/package.json +11 -11
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { parseAffectedObjects } from "./affected_objects";
|
|
2
|
+
export { parseNFTokenChanges } from "./nftoken_changes";
|
|
3
|
+
export { parseNFTokenOfferChanges } from "./nftoken_offer_changes";
|
|
4
|
+
export { parseURITokenChanges } from "./uritoken_changes";
|
|
5
|
+
export { parseURITokenSellOfferChanges } from "./uritoken_sell_offer_changes";
|
|
6
|
+
export { parseBalanceChanges } from "./balance_changes";
|
|
7
|
+
export { parseLockedBalanceChanges } from "./locked_balance_changes";
|
|
8
|
+
export { parseChannelChanges } from "./channel_changes";
|
|
9
|
+
export { parseCheckChanges } from "./check_changes";
|
|
10
|
+
export { parseOrderbookChanges } from "./orderbook_changes";
|
|
11
|
+
export { parseHooksExecutions } from "./hooks_executions";
|
|
12
|
+
export { parseEmittedTxns } from "./emitted_txns";
|
|
13
|
+
export { parseEscrowChanges } from "./escrow_changes";
|
|
14
|
+
export { parseUNLReportChanges } from "./unl_report_changes";
|
|
15
|
+
export { parseAmmChanges } from "./amm_changes";
|
|
16
|
+
export { parseDIDChanges } from "./did_changes";
|
|
17
|
+
export { parseOracleChanges } from "./oracle_changes";
|
|
18
|
+
export { parseDeliveredAmount } from "./delivered_amount";
|
|
19
|
+
export { parseMPTokenIssuanceChanges } from "./mptoken_issuance_changes";
|
|
20
|
+
export { parseMPTokenChanges } from "./mptoken_changes";
|
|
21
|
+
export { parseCredentialChanges } from "./credential_changes";
|
|
22
|
+
export { parseDelegateChanges } from "./delegate_changes";
|
|
23
|
+
export { parseRemarksChanges } from "./remarks_changes";
|
|
24
|
+
export { parseAmendmentChanges } from "./amendment_changes";
|
|
25
|
+
export { parseCronChanges } from "./cron_changes";
|
|
26
|
+
export { parseAccountSettingChanges } from "./account_setting_changes";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAccountSettingChanges = exports.parseCronChanges = exports.parseAmendmentChanges = exports.parseRemarksChanges = exports.parseDelegateChanges = exports.parseCredentialChanges = exports.parseMPTokenChanges = exports.parseMPTokenIssuanceChanges = exports.parseDeliveredAmount = exports.parseOracleChanges = exports.parseDIDChanges = exports.parseAmmChanges = exports.parseUNLReportChanges = exports.parseEscrowChanges = exports.parseEmittedTxns = exports.parseHooksExecutions = exports.parseOrderbookChanges = exports.parseCheckChanges = exports.parseChannelChanges = exports.parseLockedBalanceChanges = exports.parseBalanceChanges = exports.parseURITokenSellOfferChanges = exports.parseURITokenChanges = exports.parseNFTokenOfferChanges = exports.parseNFTokenChanges = exports.parseAffectedObjects = void 0;
|
|
4
|
+
var affected_objects_1 = require("./affected_objects");
|
|
5
|
+
Object.defineProperty(exports, "parseAffectedObjects", { enumerable: true, get: function () { return affected_objects_1.parseAffectedObjects; } });
|
|
6
|
+
var nftoken_changes_1 = require("./nftoken_changes");
|
|
7
|
+
Object.defineProperty(exports, "parseNFTokenChanges", { enumerable: true, get: function () { return nftoken_changes_1.parseNFTokenChanges; } });
|
|
8
|
+
var nftoken_offer_changes_1 = require("./nftoken_offer_changes");
|
|
9
|
+
Object.defineProperty(exports, "parseNFTokenOfferChanges", { enumerable: true, get: function () { return nftoken_offer_changes_1.parseNFTokenOfferChanges; } });
|
|
10
|
+
var uritoken_changes_1 = require("./uritoken_changes");
|
|
11
|
+
Object.defineProperty(exports, "parseURITokenChanges", { enumerable: true, get: function () { return uritoken_changes_1.parseURITokenChanges; } });
|
|
12
|
+
var uritoken_sell_offer_changes_1 = require("./uritoken_sell_offer_changes");
|
|
13
|
+
Object.defineProperty(exports, "parseURITokenSellOfferChanges", { enumerable: true, get: function () { return uritoken_sell_offer_changes_1.parseURITokenSellOfferChanges; } });
|
|
14
|
+
var balance_changes_1 = require("./balance_changes");
|
|
15
|
+
Object.defineProperty(exports, "parseBalanceChanges", { enumerable: true, get: function () { return balance_changes_1.parseBalanceChanges; } });
|
|
16
|
+
var locked_balance_changes_1 = require("./locked_balance_changes");
|
|
17
|
+
Object.defineProperty(exports, "parseLockedBalanceChanges", { enumerable: true, get: function () { return locked_balance_changes_1.parseLockedBalanceChanges; } });
|
|
18
|
+
var channel_changes_1 = require("./channel_changes");
|
|
19
|
+
Object.defineProperty(exports, "parseChannelChanges", { enumerable: true, get: function () { return channel_changes_1.parseChannelChanges; } });
|
|
20
|
+
var check_changes_1 = require("./check_changes");
|
|
21
|
+
Object.defineProperty(exports, "parseCheckChanges", { enumerable: true, get: function () { return check_changes_1.parseCheckChanges; } });
|
|
22
|
+
var orderbook_changes_1 = require("./orderbook_changes");
|
|
23
|
+
Object.defineProperty(exports, "parseOrderbookChanges", { enumerable: true, get: function () { return orderbook_changes_1.parseOrderbookChanges; } });
|
|
24
|
+
var hooks_executions_1 = require("./hooks_executions");
|
|
25
|
+
Object.defineProperty(exports, "parseHooksExecutions", { enumerable: true, get: function () { return hooks_executions_1.parseHooksExecutions; } });
|
|
26
|
+
var emitted_txns_1 = require("./emitted_txns");
|
|
27
|
+
Object.defineProperty(exports, "parseEmittedTxns", { enumerable: true, get: function () { return emitted_txns_1.parseEmittedTxns; } });
|
|
28
|
+
var escrow_changes_1 = require("./escrow_changes");
|
|
29
|
+
Object.defineProperty(exports, "parseEscrowChanges", { enumerable: true, get: function () { return escrow_changes_1.parseEscrowChanges; } });
|
|
30
|
+
var unl_report_changes_1 = require("./unl_report_changes");
|
|
31
|
+
Object.defineProperty(exports, "parseUNLReportChanges", { enumerable: true, get: function () { return unl_report_changes_1.parseUNLReportChanges; } });
|
|
32
|
+
var amm_changes_1 = require("./amm_changes");
|
|
33
|
+
Object.defineProperty(exports, "parseAmmChanges", { enumerable: true, get: function () { return amm_changes_1.parseAmmChanges; } });
|
|
34
|
+
var did_changes_1 = require("./did_changes");
|
|
35
|
+
Object.defineProperty(exports, "parseDIDChanges", { enumerable: true, get: function () { return did_changes_1.parseDIDChanges; } });
|
|
36
|
+
var oracle_changes_1 = require("./oracle_changes");
|
|
37
|
+
Object.defineProperty(exports, "parseOracleChanges", { enumerable: true, get: function () { return oracle_changes_1.parseOracleChanges; } });
|
|
38
|
+
var delivered_amount_1 = require("./delivered_amount");
|
|
39
|
+
Object.defineProperty(exports, "parseDeliveredAmount", { enumerable: true, get: function () { return delivered_amount_1.parseDeliveredAmount; } });
|
|
40
|
+
var mptoken_issuance_changes_1 = require("./mptoken_issuance_changes");
|
|
41
|
+
Object.defineProperty(exports, "parseMPTokenIssuanceChanges", { enumerable: true, get: function () { return mptoken_issuance_changes_1.parseMPTokenIssuanceChanges; } });
|
|
42
|
+
var mptoken_changes_1 = require("./mptoken_changes");
|
|
43
|
+
Object.defineProperty(exports, "parseMPTokenChanges", { enumerable: true, get: function () { return mptoken_changes_1.parseMPTokenChanges; } });
|
|
44
|
+
var credential_changes_1 = require("./credential_changes");
|
|
45
|
+
Object.defineProperty(exports, "parseCredentialChanges", { enumerable: true, get: function () { return credential_changes_1.parseCredentialChanges; } });
|
|
46
|
+
var delegate_changes_1 = require("./delegate_changes");
|
|
47
|
+
Object.defineProperty(exports, "parseDelegateChanges", { enumerable: true, get: function () { return delegate_changes_1.parseDelegateChanges; } });
|
|
48
|
+
var remarks_changes_1 = require("./remarks_changes");
|
|
49
|
+
Object.defineProperty(exports, "parseRemarksChanges", { enumerable: true, get: function () { return remarks_changes_1.parseRemarksChanges; } });
|
|
50
|
+
var amendment_changes_1 = require("./amendment_changes");
|
|
51
|
+
Object.defineProperty(exports, "parseAmendmentChanges", { enumerable: true, get: function () { return amendment_changes_1.parseAmendmentChanges; } });
|
|
52
|
+
var cron_changes_1 = require("./cron_changes");
|
|
53
|
+
Object.defineProperty(exports, "parseCronChanges", { enumerable: true, get: function () { return cron_changes_1.parseCronChanges; } });
|
|
54
|
+
var account_setting_changes_1 = require("./account_setting_changes");
|
|
55
|
+
Object.defineProperty(exports, "parseAccountSettingChanges", { enumerable: true, get: function () { return account_setting_changes_1.parseAccountSettingChanges; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TransactionMetadata } from "xrpl";
|
|
2
|
+
interface LockedBalanceChangeQuantity {
|
|
3
|
+
issuer?: string;
|
|
4
|
+
currency?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
counterparty?: string;
|
|
7
|
+
mpt_issuance_id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AddressLockedBalanceChangeQuantity {
|
|
10
|
+
address: string;
|
|
11
|
+
lockedBalance: LockedBalanceChangeQuantity;
|
|
12
|
+
}
|
|
13
|
+
export interface LockedBalanceChanges {
|
|
14
|
+
[key: string]: LockedBalanceChangeQuantity[];
|
|
15
|
+
}
|
|
16
|
+
declare function parseLockedBalanceChanges(metadata: TransactionMetadata): LockedBalanceChanges;
|
|
17
|
+
declare function parseFinalLockedBalances(metadata: TransactionMetadata): {
|
|
18
|
+
[x: string]: LockedBalanceChangeQuantity[];
|
|
19
|
+
};
|
|
20
|
+
export { parseLockedBalanceChanges, parseFinalLockedBalances };
|
|
@@ -0,0 +1,117 @@
|
|
|
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.parseLockedBalanceChanges = parseLockedBalanceChanges;
|
|
7
|
+
exports.parseFinalLockedBalances = parseFinalLockedBalances;
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
function groupByAddress(lockedBalanceChanges) {
|
|
12
|
+
const grouped = lodash_1.default.groupBy(lockedBalanceChanges, function (node) {
|
|
13
|
+
return node.address;
|
|
14
|
+
});
|
|
15
|
+
return lodash_1.default.mapValues(grouped, function (group) {
|
|
16
|
+
return lodash_1.default.map(group, function (node) {
|
|
17
|
+
return node.lockedBalance;
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function parseValue(value) {
|
|
22
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
23
|
+
return new bignumber_js_1.default(value);
|
|
24
|
+
}
|
|
25
|
+
return new bignumber_js_1.default(value.value ?? 0);
|
|
26
|
+
}
|
|
27
|
+
function computeBalanceChange(node) {
|
|
28
|
+
let value = null;
|
|
29
|
+
if (node.newFields.LockedBalance) {
|
|
30
|
+
value = parseValue(node.newFields.LockedBalance);
|
|
31
|
+
}
|
|
32
|
+
else if (node.previousFields.LockedBalance && node.finalFields.LockedBalance) {
|
|
33
|
+
value = parseValue(node.finalFields.LockedBalance).minus(parseValue(node.previousFields.LockedBalance));
|
|
34
|
+
}
|
|
35
|
+
else if (node.previousFields.LockedBalance) {
|
|
36
|
+
value = parseValue(node.previousFields.LockedBalance).negated();
|
|
37
|
+
}
|
|
38
|
+
else if (node.finalFields.LockedAmount || node.previousFields.LockedAmount) {
|
|
39
|
+
value = parseValue(node.finalFields.LockedAmount ?? 0).minus(parseValue(node.previousFields.LockedAmount ?? 0));
|
|
40
|
+
}
|
|
41
|
+
return value === null ? null : value.isZero() ? null : value;
|
|
42
|
+
}
|
|
43
|
+
function parseFinalBalance(node) {
|
|
44
|
+
if (node.newFields.LockedBalance) {
|
|
45
|
+
return parseValue(node.newFields.LockedBalance);
|
|
46
|
+
}
|
|
47
|
+
else if (node.finalFields.LockedBalance) {
|
|
48
|
+
return parseValue(node.finalFields.LockedBalance);
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
function parseTrustlineQuantity(node, valueParser) {
|
|
53
|
+
const value = valueParser(node);
|
|
54
|
+
if (value === null) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
const fields = lodash_1.default.isEmpty(node.newFields) ? node.finalFields : node.newFields;
|
|
58
|
+
const previousFields = node.previousFields;
|
|
59
|
+
let viewLowest = true;
|
|
60
|
+
if (previousFields && previousFields.Balance && previousFields.Balance.value !== "0") {
|
|
61
|
+
viewLowest = previousFields.Balance.value[0] !== "-";
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
viewLowest = fields.Balance.value[0] !== "-";
|
|
65
|
+
}
|
|
66
|
+
const sign = viewLowest ? 1 : -1;
|
|
67
|
+
const currency = fields.Balance.currency;
|
|
68
|
+
const issuer = viewLowest ? fields.HighLimit.issuer : fields.LowLimit.issuer;
|
|
69
|
+
const holder = viewLowest ? fields.LowLimit.issuer : fields.HighLimit.issuer;
|
|
70
|
+
const result = {
|
|
71
|
+
address: holder,
|
|
72
|
+
lockedBalance: {
|
|
73
|
+
issuer,
|
|
74
|
+
currency,
|
|
75
|
+
value: value.times(sign).toString(),
|
|
76
|
+
counterparty: issuer,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
return [result];
|
|
80
|
+
}
|
|
81
|
+
function parseMPTQuantity(node, valueParser) {
|
|
82
|
+
const value = valueParser(node);
|
|
83
|
+
if (value === null) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const fields = lodash_1.default.isEmpty(node.newFields) ? node.finalFields : node.newFields;
|
|
87
|
+
return {
|
|
88
|
+
address: fields.Account,
|
|
89
|
+
lockedBalance: {
|
|
90
|
+
value: value.toString(),
|
|
91
|
+
mpt_issuance_id: fields.MPTokenIssuanceID,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function parseQuantities(metadata, valueParser) {
|
|
96
|
+
const values = metadata.AffectedNodes.map(function (affectedNode) {
|
|
97
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
98
|
+
if (!["RippleState", "MPToken"].includes(node.LedgerEntryType)) {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
const normalizedNode = (0, utils_1.normalizeNode)(affectedNode);
|
|
102
|
+
if (node.LedgerEntryType === "RippleState") {
|
|
103
|
+
return parseTrustlineQuantity(normalizedNode, valueParser);
|
|
104
|
+
}
|
|
105
|
+
else if (node.LedgerEntryType === "MPToken") {
|
|
106
|
+
return [parseMPTQuantity(normalizedNode, valueParser)];
|
|
107
|
+
}
|
|
108
|
+
return [];
|
|
109
|
+
});
|
|
110
|
+
return groupByAddress(lodash_1.default.compact(lodash_1.default.flatten(values)));
|
|
111
|
+
}
|
|
112
|
+
function parseLockedBalanceChanges(metadata) {
|
|
113
|
+
return parseQuantities(metadata, computeBalanceChange);
|
|
114
|
+
}
|
|
115
|
+
function parseFinalLockedBalances(metadata) {
|
|
116
|
+
return parseQuantities(metadata, parseFinalBalance);
|
|
117
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseMPTokenChanges(tx: object): object;
|
|
@@ -0,0 +1,113 @@
|
|
|
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.parseMPTokenChanges = parseMPTokenChanges;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const common_1 = require("../../common");
|
|
9
|
+
const mptoken_flags_1 = __importDefault(require("../ledger/mptoken-flags"));
|
|
10
|
+
function parseMPTokenChanges(tx) {
|
|
11
|
+
return new MPTokenChanges(tx).call();
|
|
12
|
+
}
|
|
13
|
+
class MPTokenChanges {
|
|
14
|
+
constructor(tx) {
|
|
15
|
+
this.tx = tx;
|
|
16
|
+
this.changes = {};
|
|
17
|
+
}
|
|
18
|
+
call() {
|
|
19
|
+
if (this.hasAffectedNodes() === false) {
|
|
20
|
+
return this.changes;
|
|
21
|
+
}
|
|
22
|
+
this.parseAffectedNodes();
|
|
23
|
+
return this.changes;
|
|
24
|
+
}
|
|
25
|
+
hasAffectedNodes() {
|
|
26
|
+
if (this.tx.meta?.AffectedNodes === undefined) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (this.tx.meta?.AffectedNodes?.length === 0) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
addChange(mptIssuanceID, account, change) {
|
|
35
|
+
if (!this.changes[mptIssuanceID]) {
|
|
36
|
+
this.changes[mptIssuanceID] = {};
|
|
37
|
+
}
|
|
38
|
+
this.changes[mptIssuanceID][account] = (0, common_1.removeUndefined)(change);
|
|
39
|
+
}
|
|
40
|
+
parseAffectedNodes() {
|
|
41
|
+
for (const affectedNode of this.tx.meta.AffectedNodes) {
|
|
42
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
43
|
+
if (node?.LedgerEntryType === "MPToken" && node?.LedgerIndex) {
|
|
44
|
+
if (affectedNode.CreatedNode) {
|
|
45
|
+
const mptIssuanceID = node.NewFields.MPTokenIssuanceID;
|
|
46
|
+
const account = node.NewFields.Account;
|
|
47
|
+
this.addChange(mptIssuanceID, account, {
|
|
48
|
+
status: "added",
|
|
49
|
+
flags: (0, mptoken_flags_1.default)(node.NewFields.Flags),
|
|
50
|
+
mptIssuanceID,
|
|
51
|
+
account,
|
|
52
|
+
amount: node.NewFields.MPTAmount || "0",
|
|
53
|
+
lockedAmount: node.NewFields.LockedAmount,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (affectedNode.ModifiedNode) {
|
|
57
|
+
const mptIssuanceID = node.FinalFields.MPTokenIssuanceID;
|
|
58
|
+
const account = node.FinalFields.Account;
|
|
59
|
+
let amountChange = undefined;
|
|
60
|
+
if (node.PreviousFields.MPTAmount !== undefined) {
|
|
61
|
+
amountChange = new bignumber_js_1.default(node.FinalFields.MPTAmount ?? 0)
|
|
62
|
+
.minus(node.PreviousFields.MPTAmount ?? 0)
|
|
63
|
+
.toString();
|
|
64
|
+
if (amountChange === "0") {
|
|
65
|
+
amountChange = undefined;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let lockedAmountChange = undefined;
|
|
69
|
+
if (node.PreviousFields.LockedAmount !== undefined) {
|
|
70
|
+
lockedAmountChange = new bignumber_js_1.default(node.FinalFields.LockedAmount ?? 0)
|
|
71
|
+
.minus(node.PreviousFields.LockedAmount ?? 0)
|
|
72
|
+
.toString();
|
|
73
|
+
if (lockedAmountChange === "0") {
|
|
74
|
+
lockedAmountChange = undefined;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (amountChange &&
|
|
78
|
+
lockedAmountChange &&
|
|
79
|
+
new bignumber_js_1.default(amountChange).abs().isEqualTo(new bignumber_js_1.default(lockedAmountChange).abs())) {
|
|
80
|
+
amountChange = undefined;
|
|
81
|
+
}
|
|
82
|
+
let flagsChange;
|
|
83
|
+
if (node.PreviousFields?.Flags !== undefined) {
|
|
84
|
+
flagsChange = (0, mptoken_flags_1.default)(node.PreviousFields.Flags);
|
|
85
|
+
}
|
|
86
|
+
this.addChange(mptIssuanceID, account, {
|
|
87
|
+
status: "modified",
|
|
88
|
+
flags: (0, mptoken_flags_1.default)(node.FinalFields.Flags),
|
|
89
|
+
mptIssuanceID,
|
|
90
|
+
account,
|
|
91
|
+
amount: node.FinalFields.MPTAmount || "0",
|
|
92
|
+
lockedAmount: node.FinalFields.LockedAmount,
|
|
93
|
+
amountChange,
|
|
94
|
+
lockedAmountChange,
|
|
95
|
+
flagsChange,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (affectedNode.DeletedNode) {
|
|
99
|
+
const mptIssuanceID = node.FinalFields.MPTokenIssuanceID;
|
|
100
|
+
const account = node.FinalFields.Account;
|
|
101
|
+
this.addChange(mptIssuanceID, account, {
|
|
102
|
+
status: "removed",
|
|
103
|
+
flags: (0, mptoken_flags_1.default)(node.FinalFields.Flags),
|
|
104
|
+
mptIssuanceID,
|
|
105
|
+
account,
|
|
106
|
+
amount: node.FinalFields.MPTAmount,
|
|
107
|
+
lockedAmount: node.FinalFields.LockedAmount,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseMPTokenIssuanceChanges(tx: object): object;
|
|
@@ -0,0 +1,119 @@
|
|
|
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.parseMPTokenIssuanceChanges = parseMPTokenIssuanceChanges;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
const common_1 = require("../../common");
|
|
9
|
+
const mptoken_1 = require("../../models/mptoken");
|
|
10
|
+
const mptoken_issuance_flags_1 = __importDefault(require("../ledger/mptoken-issuance-flags"));
|
|
11
|
+
function parseMPTokenIssuanceChanges(tx) {
|
|
12
|
+
return new MPTokenIssuanceChanges(tx).call();
|
|
13
|
+
}
|
|
14
|
+
class MPTokenIssuanceChanges {
|
|
15
|
+
constructor(tx) {
|
|
16
|
+
this.tx = tx;
|
|
17
|
+
this.changes = {};
|
|
18
|
+
}
|
|
19
|
+
call() {
|
|
20
|
+
if (this.hasAffectedNodes() === false) {
|
|
21
|
+
return this.changes;
|
|
22
|
+
}
|
|
23
|
+
this.parseAffectedNodes();
|
|
24
|
+
return this.changes;
|
|
25
|
+
}
|
|
26
|
+
hasAffectedNodes() {
|
|
27
|
+
if (this.tx.meta?.AffectedNodes === undefined) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (this.tx.meta?.AffectedNodes?.length === 0) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
addChange(mptIssuanceID, change) {
|
|
36
|
+
this.changes[mptIssuanceID] = (0, common_1.removeUndefined)(change);
|
|
37
|
+
}
|
|
38
|
+
parseAffectedNodes() {
|
|
39
|
+
for (const affectedNode of this.tx.meta.AffectedNodes) {
|
|
40
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
41
|
+
if (node?.LedgerEntryType === "MPTokenIssuance" && node?.LedgerIndex) {
|
|
42
|
+
if (affectedNode.CreatedNode) {
|
|
43
|
+
const mptIssuanceID = (0, mptoken_1.buildMPTokenIssuanceID)(node.NewFields.Sequence, node.NewFields.Issuer);
|
|
44
|
+
this.addChange(mptIssuanceID, {
|
|
45
|
+
status: "added",
|
|
46
|
+
flags: (0, mptoken_issuance_flags_1.default)(node.NewFields.Flags),
|
|
47
|
+
mptIssuanceID,
|
|
48
|
+
issuer: node.NewFields.Issuer,
|
|
49
|
+
sequence: node.NewFields.Sequence,
|
|
50
|
+
transferFee: node.NewFields.TransferFee,
|
|
51
|
+
maximumAmount: node.NewFields.MaximumAmount,
|
|
52
|
+
outstandingAmount: node.NewFields.OutstandingAmount,
|
|
53
|
+
lockedAmount: node.NewFields.LockedAmount,
|
|
54
|
+
metadata: node.NewFields.Metadata,
|
|
55
|
+
scale: node.NewFields.AssetScale,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (affectedNode.ModifiedNode) {
|
|
59
|
+
const mptIssuanceID = (0, mptoken_1.buildMPTokenIssuanceID)(node.FinalFields.Sequence, node.FinalFields.Issuer);
|
|
60
|
+
let outstandingAmountChange = new bignumber_js_1.default(node.FinalFields.OutstandingAmount ?? 0)
|
|
61
|
+
.minus(node.PreviousFields.OutstandingAmount ?? 0)
|
|
62
|
+
.toString();
|
|
63
|
+
if (outstandingAmountChange === "0") {
|
|
64
|
+
outstandingAmountChange = undefined;
|
|
65
|
+
}
|
|
66
|
+
let lockedAmountChange = undefined;
|
|
67
|
+
if (node.PreviousFields.LockedAmount !== undefined) {
|
|
68
|
+
lockedAmountChange = new bignumber_js_1.default(node.FinalFields.LockedAmount ?? 0)
|
|
69
|
+
.minus(new bignumber_js_1.default(node.PreviousFields.LockedAmount ?? 0))
|
|
70
|
+
.toString();
|
|
71
|
+
if (lockedAmountChange === "0") {
|
|
72
|
+
lockedAmountChange = undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
let lockedAmount = node.FinalFields.LockedAmount;
|
|
76
|
+
if (lockedAmount === undefined && lockedAmountChange !== undefined) {
|
|
77
|
+
lockedAmount = "0";
|
|
78
|
+
}
|
|
79
|
+
let flagsChange;
|
|
80
|
+
if (node.PreviousFields?.Flags !== undefined) {
|
|
81
|
+
flagsChange = (0, mptoken_issuance_flags_1.default)(node.PreviousFields.Flags);
|
|
82
|
+
}
|
|
83
|
+
this.addChange(mptIssuanceID, {
|
|
84
|
+
status: "modified",
|
|
85
|
+
flags: (0, mptoken_issuance_flags_1.default)(node.FinalFields.Flags),
|
|
86
|
+
mptIssuanceID,
|
|
87
|
+
issuer: node.FinalFields.Issuer,
|
|
88
|
+
sequence: node.FinalFields.Sequence,
|
|
89
|
+
transferFee: node.FinalFields.TransferFee,
|
|
90
|
+
maximumAmount: node.FinalFields.MaximumAmount,
|
|
91
|
+
outstandingAmount: node.FinalFields.OutstandingAmount,
|
|
92
|
+
lockedAmount,
|
|
93
|
+
metadata: node.FinalFields.Metadata,
|
|
94
|
+
scale: node.FinalFields.AssetScale,
|
|
95
|
+
outstandingAmountChange,
|
|
96
|
+
lockedAmountChange,
|
|
97
|
+
flagsChange,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (affectedNode.DeletedNode) {
|
|
101
|
+
const mptIssuanceID = (0, mptoken_1.buildMPTokenIssuanceID)(node.FinalFields.Sequence, node.FinalFields.Issuer);
|
|
102
|
+
this.addChange(mptIssuanceID, {
|
|
103
|
+
status: "removed",
|
|
104
|
+
flags: (0, mptoken_issuance_flags_1.default)(node.FinalFields.Flags),
|
|
105
|
+
mptIssuanceID,
|
|
106
|
+
issuer: node.FinalFields.Issuer,
|
|
107
|
+
sequence: node.FinalFields.Sequence,
|
|
108
|
+
transferFee: node.FinalFields.TransferFee,
|
|
109
|
+
maximumAmount: node.FinalFields.MaximumAmount,
|
|
110
|
+
outstandingAmount: node.FinalFields.OutstandingAmount,
|
|
111
|
+
lockedAmount: node.FinalFields.LockedAmount,
|
|
112
|
+
metadata: node.FinalFields.Metadata,
|
|
113
|
+
scale: node.FinalFields.AssetScale,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseNFTokenChanges(tx: object): object;
|