@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,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeMPTokensPreviousFields = normalizeMPTokensPreviousFields;
|
|
4
|
+
exports.normalizeMPTokensPreviousFieldsEscrowCreate = normalizeMPTokensPreviousFieldsEscrowCreate;
|
|
5
|
+
exports.normalizeMPTokensPreviousFieldsEscrowFinish = normalizeMPTokensPreviousFieldsEscrowFinish;
|
|
6
|
+
exports.normalizeMPTokensPreviousFieldsEscrowCancel = normalizeMPTokensPreviousFieldsEscrowCancel;
|
|
7
|
+
exports.normalizeMPTokensPreviousFieldsTransfer = normalizeMPTokensPreviousFieldsTransfer;
|
|
8
|
+
const TRANSFER_TRANSACTION_TYPES = ["Payment", "CheckCash", "EscrowFinish", "Clawback", "AMMClawback"];
|
|
9
|
+
function normalizeMPTokensPreviousFields(meta, tx) {
|
|
10
|
+
if (meta.TransactionResult !== "tesSUCCESS") {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (tx.TransactionType === "EscrowCreate") {
|
|
14
|
+
normalizeMPTokensPreviousFieldsEscrowCreate(meta);
|
|
15
|
+
}
|
|
16
|
+
else if (tx.TransactionType === "EscrowFinish") {
|
|
17
|
+
normalizeMPTokensPreviousFieldsEscrowFinish(meta);
|
|
18
|
+
}
|
|
19
|
+
else if (tx.TransactionType === "EscrowCancel") {
|
|
20
|
+
normalizeMPTokensPreviousFieldsEscrowCancel(meta);
|
|
21
|
+
}
|
|
22
|
+
else if (TRANSFER_TRANSACTION_TYPES.includes(tx.TransactionType)) {
|
|
23
|
+
normalizeMPTokensPreviousFieldsTransfer(meta, tx);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function normalizeMPTokensPreviousFieldsEscrowCreate(meta) {
|
|
27
|
+
const escrowNode = meta.AffectedNodes.find((node) => {
|
|
28
|
+
const createdNode = node.CreatedNode;
|
|
29
|
+
return createdNode && createdNode.LedgerEntryType === "Escrow";
|
|
30
|
+
});
|
|
31
|
+
if (!escrowNode) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const escrowFields = escrowNode.CreatedNode.NewFields;
|
|
35
|
+
const mptokenIssuanceID = escrowFields?.Amount?.mpt_issuance_id;
|
|
36
|
+
if (!mptokenIssuanceID) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const mptIssuanceNode = meta.AffectedNodes.find((node) => {
|
|
40
|
+
const modifiedNode = node.ModifiedNode;
|
|
41
|
+
return modifiedNode && modifiedNode.LedgerEntryType === "MPTokenIssuance";
|
|
42
|
+
});
|
|
43
|
+
if (mptIssuanceNode) {
|
|
44
|
+
const prevFields = mptIssuanceNode.ModifiedNode.PreviousFields;
|
|
45
|
+
if (prevFields && prevFields.LockedAmount === undefined) {
|
|
46
|
+
if (prevFields.LockedAmount === undefined) {
|
|
47
|
+
prevFields.LockedAmount = "0";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const mptokenNode = meta.AffectedNodes.find((node) => {
|
|
52
|
+
const modifiedNode = node.ModifiedNode;
|
|
53
|
+
return (modifiedNode &&
|
|
54
|
+
modifiedNode.LedgerEntryType === "MPToken" &&
|
|
55
|
+
modifiedNode.FinalFields.Account === escrowFields.Account &&
|
|
56
|
+
modifiedNode.FinalFields.MPTokenIssuanceID === mptokenIssuanceID);
|
|
57
|
+
});
|
|
58
|
+
if (mptokenNode) {
|
|
59
|
+
const finalFields = mptokenNode.ModifiedNode.FinalFields;
|
|
60
|
+
const prevFields = mptokenNode.ModifiedNode.PreviousFields;
|
|
61
|
+
if (prevFields && prevFields.LockedAmount === undefined) {
|
|
62
|
+
if (finalFields.Amount === undefined) {
|
|
63
|
+
finalFields.Amount = "0";
|
|
64
|
+
}
|
|
65
|
+
if (prevFields.LockedAmount === undefined) {
|
|
66
|
+
prevFields.LockedAmount = "0";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function normalizeMPTokensPreviousFieldsEscrowFinish(meta) {
|
|
72
|
+
const escrowNode = meta.AffectedNodes.find((node) => {
|
|
73
|
+
const deletedNode = node.DeletedNode;
|
|
74
|
+
return deletedNode && deletedNode.LedgerEntryType === "Escrow";
|
|
75
|
+
});
|
|
76
|
+
if (!escrowNode) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const escrowFields = escrowNode.DeletedNode.FinalFields;
|
|
80
|
+
const mptokenIssuanceID = escrowFields?.Amount?.mpt_issuance_id;
|
|
81
|
+
if (!mptokenIssuanceID) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const value = escrowFields?.Amount?.value ?? "0";
|
|
85
|
+
if (escrowFields.Account === escrowFields.Destination) {
|
|
86
|
+
const mptokenNode = meta.AffectedNodes.find((node) => {
|
|
87
|
+
const modifiedNode = node.ModifiedNode;
|
|
88
|
+
return (modifiedNode &&
|
|
89
|
+
modifiedNode.LedgerEntryType === "MPToken" &&
|
|
90
|
+
modifiedNode.FinalFields.Account === escrowFields.Account &&
|
|
91
|
+
modifiedNode.FinalFields.MPTokenIssuanceID === mptokenIssuanceID);
|
|
92
|
+
});
|
|
93
|
+
if (mptokenNode) {
|
|
94
|
+
const finalFields = mptokenNode.ModifiedNode.FinalFields;
|
|
95
|
+
const prevFields = mptokenNode.ModifiedNode.PreviousFields;
|
|
96
|
+
if (prevFields) {
|
|
97
|
+
if (finalFields.LockedAmount === undefined) {
|
|
98
|
+
finalFields.LockedAmount = "0";
|
|
99
|
+
}
|
|
100
|
+
if (prevFields.MPTAmount === undefined) {
|
|
101
|
+
prevFields.MPTAmount = "0";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const mptokenSourceNode = meta.AffectedNodes.find((node) => {
|
|
108
|
+
const modifiedNode = node.ModifiedNode;
|
|
109
|
+
return (modifiedNode &&
|
|
110
|
+
modifiedNode.LedgerEntryType === "MPToken" &&
|
|
111
|
+
modifiedNode.FinalFields.Account === escrowFields.Account &&
|
|
112
|
+
modifiedNode.FinalFields.MPTokenIssuanceID === mptokenIssuanceID);
|
|
113
|
+
});
|
|
114
|
+
if (mptokenSourceNode) {
|
|
115
|
+
const finalFields = mptokenSourceNode.ModifiedNode.FinalFields;
|
|
116
|
+
const prevFields = mptokenSourceNode.ModifiedNode.PreviousFields;
|
|
117
|
+
if (prevFields && prevFields.MPTAmount === undefined) {
|
|
118
|
+
if (finalFields.MPTAmount === undefined) {
|
|
119
|
+
finalFields.MPTAmount = "0";
|
|
120
|
+
}
|
|
121
|
+
if (finalFields.LockedAmount === undefined) {
|
|
122
|
+
finalFields.LockedAmount = "0";
|
|
123
|
+
}
|
|
124
|
+
if (prevFields.LockedAmount === undefined) {
|
|
125
|
+
prevFields.LockedAmount = value;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const mptokenDestNode = meta.AffectedNodes.find((node) => {
|
|
130
|
+
const modifiedNode = node.ModifiedNode;
|
|
131
|
+
return (modifiedNode &&
|
|
132
|
+
modifiedNode.LedgerEntryType === "MPToken" &&
|
|
133
|
+
modifiedNode.FinalFields.Account === escrowFields.Destination &&
|
|
134
|
+
modifiedNode.FinalFields.MPTokenIssuanceID === mptokenIssuanceID);
|
|
135
|
+
});
|
|
136
|
+
if (mptokenDestNode) {
|
|
137
|
+
const prevFields = mptokenDestNode.ModifiedNode.PreviousFields;
|
|
138
|
+
if (prevFields && prevFields.LockedAmount === undefined) {
|
|
139
|
+
if (prevFields.MPTAmount === undefined) {
|
|
140
|
+
prevFields.MPTAmount = "0";
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function normalizeMPTokensPreviousFieldsEscrowCancel(meta) {
|
|
146
|
+
const escrowNode = meta.AffectedNodes.find((node) => {
|
|
147
|
+
const deletedNode = node.DeletedNode;
|
|
148
|
+
return deletedNode && deletedNode.LedgerEntryType === "Escrow";
|
|
149
|
+
});
|
|
150
|
+
if (!escrowNode) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const escrowFields = escrowNode.DeletedNode.FinalFields;
|
|
154
|
+
const mptokenIssuanceID = escrowFields?.Amount?.mpt_issuance_id;
|
|
155
|
+
if (!mptokenIssuanceID) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const mptokenNode = meta.AffectedNodes.find((node) => {
|
|
159
|
+
const modifiedNode = node.ModifiedNode;
|
|
160
|
+
return (modifiedNode &&
|
|
161
|
+
modifiedNode.LedgerEntryType === "MPToken" &&
|
|
162
|
+
modifiedNode.FinalFields.Account === escrowFields.Account &&
|
|
163
|
+
modifiedNode.FinalFields.MPTokenIssuanceID === mptokenIssuanceID);
|
|
164
|
+
});
|
|
165
|
+
if (mptokenNode) {
|
|
166
|
+
const finalFields = mptokenNode.ModifiedNode.FinalFields;
|
|
167
|
+
const prevFields = mptokenNode.ModifiedNode.PreviousFields;
|
|
168
|
+
if (prevFields) {
|
|
169
|
+
if (finalFields.LockedAmount === undefined) {
|
|
170
|
+
finalFields.LockedAmount = "0";
|
|
171
|
+
}
|
|
172
|
+
if (prevFields.MPTAmount === undefined) {
|
|
173
|
+
prevFields.MPTAmount = "0";
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function normalizeMPTokensPreviousFieldsTransfer(meta, tx) {
|
|
179
|
+
if (tx.Destination === undefined) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
let amount = null;
|
|
183
|
+
if (typeof tx.Amount === "object") {
|
|
184
|
+
amount = tx.Amount;
|
|
185
|
+
}
|
|
186
|
+
else if (typeof tx.SendMax === "object") {
|
|
187
|
+
amount = tx.SendMax;
|
|
188
|
+
}
|
|
189
|
+
else if (typeof tx.DeliverMax === "object") {
|
|
190
|
+
amount = tx.DeliverMax;
|
|
191
|
+
}
|
|
192
|
+
if (!amount) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const mptokenIssuanceID = amount.mpt_issuance_id;
|
|
196
|
+
const destination = tx.Destination;
|
|
197
|
+
if (!mptokenIssuanceID || !destination) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const mptokenNode = meta.AffectedNodes.find((node) => {
|
|
201
|
+
const modifiedNode = node.ModifiedNode;
|
|
202
|
+
return (modifiedNode &&
|
|
203
|
+
modifiedNode.LedgerEntryType === "MPToken" &&
|
|
204
|
+
modifiedNode.FinalFields.Account === destination &&
|
|
205
|
+
modifiedNode.FinalFields.MPTokenIssuanceID === mptokenIssuanceID);
|
|
206
|
+
});
|
|
207
|
+
if (mptokenNode) {
|
|
208
|
+
const prevFields = mptokenNode.ModifiedNode.PreviousFields;
|
|
209
|
+
if (prevFields && prevFields.LockedAmount === undefined) {
|
|
210
|
+
if (prevFields.MPTAmount === undefined) {
|
|
211
|
+
prevFields.MPTAmount = "0";
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TransactionMetadata } from "xrpl";
|
|
2
|
+
import { AccountRootFlagsKeysInterface } from "../../models/account_info";
|
|
3
|
+
declare function parseAccountSettingChanges(metadata: TransactionMetadata): AccountRootFlagsKeysInterface | undefined;
|
|
4
|
+
export { parseAccountSettingChanges };
|
|
@@ -0,0 +1,67 @@
|
|
|
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.parseAccountSettingChanges = parseAccountSettingChanges;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const account_info_1 = require("../../models/account_info");
|
|
9
|
+
const account_fields_1 = require("../ledger/account-fields");
|
|
10
|
+
function summarizeSetting(modifiedNode) {
|
|
11
|
+
const settings = {};
|
|
12
|
+
const oldFlags = lodash_1.default.get(modifiedNode.PreviousFields, "Flags");
|
|
13
|
+
const newFlags = lodash_1.default.get(modifiedNode.FinalFields, "Flags");
|
|
14
|
+
if (oldFlags != null && newFlags != null) {
|
|
15
|
+
const changedFlags = oldFlags ^ newFlags;
|
|
16
|
+
const setFlags = newFlags & changedFlags;
|
|
17
|
+
const clearedFlags = oldFlags & changedFlags;
|
|
18
|
+
Object.entries((0, account_info_1.getAccountRootFlagsKeys)()).forEach((entry) => {
|
|
19
|
+
const [flagName, flagValue] = entry;
|
|
20
|
+
if (setFlags & flagValue) {
|
|
21
|
+
settings[flagName] = true;
|
|
22
|
+
}
|
|
23
|
+
else if (clearedFlags & flagValue) {
|
|
24
|
+
settings[flagName] = false;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const oldAccountTxnIDField = lodash_1.default.get(modifiedNode.PreviousFields, "AccountTxnID");
|
|
29
|
+
const newAccountTxnIDField = lodash_1.default.get(modifiedNode.FinalFields, "AccountTxnID");
|
|
30
|
+
if (newAccountTxnIDField && !oldAccountTxnIDField) {
|
|
31
|
+
settings.enableTransactionIDTracking = true;
|
|
32
|
+
}
|
|
33
|
+
else if (oldAccountTxnIDField && !newAccountTxnIDField) {
|
|
34
|
+
settings.enableTransactionIDTracking = false;
|
|
35
|
+
}
|
|
36
|
+
for (const fieldName in account_info_1.AccountFields) {
|
|
37
|
+
const oldFieldValue = lodash_1.default.get(modifiedNode.PreviousFields, fieldName);
|
|
38
|
+
const newFieldValue = lodash_1.default.get(modifiedNode.FinalFields, fieldName);
|
|
39
|
+
if (oldFieldValue !== undefined && newFieldValue !== undefined && oldFieldValue !== newFieldValue) {
|
|
40
|
+
const info = account_info_1.AccountFields[fieldName];
|
|
41
|
+
settings[info.name] = (0, account_fields_1.parseField)(info, newFieldValue);
|
|
42
|
+
}
|
|
43
|
+
else if (oldFieldValue !== undefined && newFieldValue === undefined) {
|
|
44
|
+
const info = account_info_1.AccountFields[fieldName];
|
|
45
|
+
settings[info.name] = null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return settings;
|
|
49
|
+
}
|
|
50
|
+
function parseAccountSettingChanges(metadata) {
|
|
51
|
+
const affectedNodes = metadata.AffectedNodes.filter((affectedNode) => {
|
|
52
|
+
if (!affectedNode.ModifiedNode) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const node = affectedNode.ModifiedNode;
|
|
56
|
+
return node.LedgerEntryType === "AccountRoot";
|
|
57
|
+
});
|
|
58
|
+
if (affectedNodes.length !== 1) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const modifiedNode = affectedNodes[0].ModifiedNode;
|
|
62
|
+
const settings = summarizeSetting(modifiedNode);
|
|
63
|
+
if (Object.keys(settings).length === 0) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
return settings;
|
|
67
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
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.parseAffectedObjects = parseAffectedObjects;
|
|
7
|
+
const nftoken_changes_1 = require("./nftoken_changes");
|
|
8
|
+
const nftoken_offer_changes_1 = require("./nftoken_offer_changes");
|
|
9
|
+
const account_nfts_1 = require("../../models/account_nfts");
|
|
10
|
+
const nftoken_flags_1 = __importDefault(require("../ledger/nftoken-flags"));
|
|
11
|
+
const nftoken_offer_flags_1 = __importDefault(require("../ledger/nftoken-offer-flags"));
|
|
12
|
+
const uritoken_flags_1 = __importDefault(require("../ledger/uritoken-flags"));
|
|
13
|
+
const common_1 = require("../../common");
|
|
14
|
+
function parseAffectedObjects(tx) {
|
|
15
|
+
return new AffectedObjects(tx).call();
|
|
16
|
+
}
|
|
17
|
+
class AffectedObjects {
|
|
18
|
+
constructor(tx) {
|
|
19
|
+
this.tx = tx;
|
|
20
|
+
this.affectedObjects = {};
|
|
21
|
+
this.nftChanges = undefined;
|
|
22
|
+
this.nftOfferChanges = undefined;
|
|
23
|
+
}
|
|
24
|
+
call() {
|
|
25
|
+
this.parseNFTokens();
|
|
26
|
+
this.parseNFTokenOffers();
|
|
27
|
+
this.parseURITokenChanges();
|
|
28
|
+
if (Object.keys(this.affectedObjects).length > 0) {
|
|
29
|
+
return this.affectedObjects;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
getNFTokenChanges() {
|
|
34
|
+
if (this.nftChanges) {
|
|
35
|
+
return this.nftChanges;
|
|
36
|
+
}
|
|
37
|
+
this.nftChanges = (0, nftoken_changes_1.parseNFTokenChanges)(this.tx);
|
|
38
|
+
return this.nftChanges;
|
|
39
|
+
}
|
|
40
|
+
getNFTokenOfferChanges() {
|
|
41
|
+
if (this.nftOfferChanges) {
|
|
42
|
+
return this.nftOfferChanges;
|
|
43
|
+
}
|
|
44
|
+
this.nftOfferChanges = (0, nftoken_offer_changes_1.parseNFTokenOfferChanges)(this.tx);
|
|
45
|
+
return this.nftOfferChanges;
|
|
46
|
+
}
|
|
47
|
+
parseNFTokens() {
|
|
48
|
+
const nftokens = {};
|
|
49
|
+
const nftokenChanges = this.getNFTokenChanges();
|
|
50
|
+
for (const account in nftokenChanges) {
|
|
51
|
+
for (const nftsChange of nftokenChanges[account]) {
|
|
52
|
+
if (nftokens[nftsChange.nftokenID]) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const nftokenIDInfo = (0, account_nfts_1.parseNFTokenID)(nftsChange.nftokenID);
|
|
56
|
+
if (nftokenIDInfo) {
|
|
57
|
+
nftokens[nftsChange.nftokenID] = {
|
|
58
|
+
nftokenID: nftsChange.nftokenID,
|
|
59
|
+
flags: (0, nftoken_flags_1.default)(nftokenIDInfo.Flags),
|
|
60
|
+
transferFee: nftokenIDInfo.TransferFee,
|
|
61
|
+
issuer: nftokenIDInfo.Issuer,
|
|
62
|
+
nftokenTaxon: nftokenIDInfo.NFTokenTaxon,
|
|
63
|
+
sequence: nftokenIDInfo.Sequence,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const nftokenOfferChanges = this.getNFTokenOfferChanges();
|
|
69
|
+
for (const account in nftokenOfferChanges) {
|
|
70
|
+
for (const nftokenOfferChange of nftokenOfferChanges[account]) {
|
|
71
|
+
if (nftokens[nftokenOfferChange.nftokenID]) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const nftokenIDInfo = (0, account_nfts_1.parseNFTokenID)(nftokenOfferChange.nftokenID);
|
|
75
|
+
if (nftokenIDInfo) {
|
|
76
|
+
nftokens[nftokenOfferChange.nftokenID] = {
|
|
77
|
+
nftokenID: nftokenOfferChange.nftokenID,
|
|
78
|
+
flags: (0, nftoken_flags_1.default)(nftokenIDInfo.Flags),
|
|
79
|
+
transferFee: nftokenIDInfo.TransferFee,
|
|
80
|
+
issuer: nftokenIDInfo.Issuer,
|
|
81
|
+
nftokenTaxon: nftokenIDInfo.NFTokenTaxon,
|
|
82
|
+
sequence: nftokenIDInfo.Sequence,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (Object.keys(nftokens).length > 0) {
|
|
88
|
+
this.affectedObjects.nftokens = nftokens;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
parseNFTokenOffers() {
|
|
92
|
+
const nftokenOffers = {};
|
|
93
|
+
const nftokenOfferChanges = this.getNFTokenOfferChanges();
|
|
94
|
+
for (const account in nftokenOfferChanges) {
|
|
95
|
+
for (const nftokenOfferChange of nftokenOfferChanges[account]) {
|
|
96
|
+
if (nftokenOffers[nftokenOfferChange.index]) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
nftokenOffers[nftokenOfferChange.index] = {
|
|
100
|
+
index: nftokenOfferChange.index,
|
|
101
|
+
nftokenID: nftokenOfferChange.nftokenID,
|
|
102
|
+
flags: (0, nftoken_offer_flags_1.default)(nftokenOfferChange.flags),
|
|
103
|
+
owner: nftokenOfferChange.owner,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (Object.keys(nftokenOffers).length > 0) {
|
|
108
|
+
this.affectedObjects.nftokenOffers = nftokenOffers;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
parseURITokenChanges() {
|
|
112
|
+
const uritokens = {};
|
|
113
|
+
for (const affectedNode of this.tx.meta.AffectedNodes) {
|
|
114
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
115
|
+
if (node?.LedgerEntryType === "URIToken" && node?.LedgerIndex) {
|
|
116
|
+
const uritokenID = node.LedgerIndex;
|
|
117
|
+
if (affectedNode.CreatedNode) {
|
|
118
|
+
uritokens[uritokenID] = (0, common_1.removeUndefined)({
|
|
119
|
+
uritokenID,
|
|
120
|
+
flags: (0, uritoken_flags_1.default)(node.NewFields.Flags),
|
|
121
|
+
uri: node.NewFields.URI,
|
|
122
|
+
digest: node.NewFields.Digest,
|
|
123
|
+
issuer: node.NewFields.Issuer,
|
|
124
|
+
owner: node.NewFields.Owner,
|
|
125
|
+
amount: node.NewFields.Amount,
|
|
126
|
+
destination: node.NewFields.Destination,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (affectedNode.ModifiedNode || affectedNode.DeletedNode) {
|
|
130
|
+
uritokens[uritokenID] = (0, common_1.removeUndefined)({
|
|
131
|
+
uritokenID,
|
|
132
|
+
flags: (0, uritoken_flags_1.default)(node.FinalFields.Flags),
|
|
133
|
+
uri: node.FinalFields.URI,
|
|
134
|
+
digest: node.FinalFields.Digest,
|
|
135
|
+
issuer: node.FinalFields.Issuer,
|
|
136
|
+
owner: node.FinalFields.Owner,
|
|
137
|
+
amount: node.FinalFields.Amount,
|
|
138
|
+
destination: node.FinalFields.Destination,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (Object.keys(uritokens).length > 0) {
|
|
144
|
+
this.affectedObjects.uritokens = uritokens;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type AmendmentStatus = "majority" | "enabled" | "lostMajority" | "obsolete";
|
|
2
|
+
interface FormattedAmendmentSummaryInterface {
|
|
3
|
+
status?: AmendmentStatus;
|
|
4
|
+
amendment?: string;
|
|
5
|
+
closeTime?: number;
|
|
6
|
+
}
|
|
7
|
+
declare function parseAmendmentChanges(tx: any): FormattedAmendmentSummaryInterface | undefined;
|
|
8
|
+
export { parseAmendmentChanges };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAmendmentChanges = parseAmendmentChanges;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const ledger_1 = require("../../models/ledger");
|
|
6
|
+
function parseAmendmentStatus(tx, node) {
|
|
7
|
+
const amendment = tx.Amendment;
|
|
8
|
+
const final = node.diffType === "CreatedNode" ? node.newFields : node.finalFields;
|
|
9
|
+
const prev = node.previousFields;
|
|
10
|
+
const amendments = final.Amendments || [];
|
|
11
|
+
const majority = final.Majorities || [];
|
|
12
|
+
if (amendments.includes(amendment)) {
|
|
13
|
+
return "enabled";
|
|
14
|
+
}
|
|
15
|
+
for (const maj of majority) {
|
|
16
|
+
if (maj.Majority.Amendment === amendment) {
|
|
17
|
+
return "majority";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (prev && prev.Majorities) {
|
|
21
|
+
const prevMajority = prev.Majorities;
|
|
22
|
+
for (const maj of prevMajority) {
|
|
23
|
+
if (maj.Majority.Amendment === amendment) {
|
|
24
|
+
return "lostMajority";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (node.diffType === "DeletedNode") {
|
|
29
|
+
const prevFinal = node.finalFields;
|
|
30
|
+
const prevAmendments = prevFinal.Amendments || [];
|
|
31
|
+
if (!prevAmendments.includes(amendment)) {
|
|
32
|
+
return "obsolete";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
function summarizeAmendment(tx, node) {
|
|
38
|
+
const summary = {
|
|
39
|
+
amendment: tx.Amendment,
|
|
40
|
+
status: parseAmendmentStatus(tx, node),
|
|
41
|
+
};
|
|
42
|
+
if (summary.status === "majority") {
|
|
43
|
+
const final = node.diffType === "CreatedNode" ? node.newFields : node.finalFields;
|
|
44
|
+
const majority = final.Majorities || [];
|
|
45
|
+
for (const maj of majority) {
|
|
46
|
+
if (maj.Majority.Amendment === tx.Amendment) {
|
|
47
|
+
if (maj.Majority.CloseTime) {
|
|
48
|
+
summary.closeTime = (0, ledger_1.ledgerTimeToTimestamp)(maj.Majority.CloseTime);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (summary.status === "lostMajority") {
|
|
55
|
+
const prev = node.previousFields;
|
|
56
|
+
if (prev && prev.Majorities) {
|
|
57
|
+
const prevMajority = prev.Majorities;
|
|
58
|
+
for (const maj of prevMajority) {
|
|
59
|
+
if (maj.Majority.Amendment === tx.Amendment) {
|
|
60
|
+
if (maj.Majority.CloseTime) {
|
|
61
|
+
summary.closeTime = (0, ledger_1.ledgerTimeToTimestamp)(maj.Majority.CloseTime);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return summary;
|
|
69
|
+
}
|
|
70
|
+
function parseAmendmentChanges(tx) {
|
|
71
|
+
const amendment = tx.Amendment;
|
|
72
|
+
if (!amendment) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
const affectedNodes = tx.meta.AffectedNodes.filter((affectedNode) => {
|
|
76
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
77
|
+
return node.LedgerEntryType === "Amendments";
|
|
78
|
+
});
|
|
79
|
+
if (affectedNodes.length !== 1) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
const normalizedNode = (0, utils_1.normalizeNode)(affectedNodes[0]);
|
|
83
|
+
return summarizeAmendment(tx, normalizedNode);
|
|
84
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { TransactionMetadata } from "xrpl";
|
|
2
|
+
import { FormattedIssuedCurrency, FormattedAmount } from "../../types";
|
|
3
|
+
interface FormattedAuctionSlot {
|
|
4
|
+
account: string;
|
|
5
|
+
authAccounts?: string[];
|
|
6
|
+
discountedFee?: number;
|
|
7
|
+
expiration?: number;
|
|
8
|
+
price?: FormattedAmount;
|
|
9
|
+
timeInterval?: number;
|
|
10
|
+
}
|
|
11
|
+
interface FormattedVoteSlot {
|
|
12
|
+
account: string;
|
|
13
|
+
tradingFee?: number;
|
|
14
|
+
voteWeight?: number;
|
|
15
|
+
}
|
|
16
|
+
interface FormattedAmmSummaryInterface {
|
|
17
|
+
status?: "created" | "modified" | "deleted";
|
|
18
|
+
ammID?: string;
|
|
19
|
+
account?: string;
|
|
20
|
+
asset?: FormattedIssuedCurrency;
|
|
21
|
+
asset2?: FormattedIssuedCurrency;
|
|
22
|
+
auctionSlot: FormattedAuctionSlot;
|
|
23
|
+
lpTokenBalance: FormattedAmount;
|
|
24
|
+
tradingFee: number;
|
|
25
|
+
ownerNode: string;
|
|
26
|
+
voteSlots: FormattedVoteSlot[];
|
|
27
|
+
lpTokenBalanceChange?: FormattedAmount;
|
|
28
|
+
tradingFeeChanges?: number;
|
|
29
|
+
voteSlotsChanges?: FormattedAmmVoteSlotChanges[];
|
|
30
|
+
auctionSlotChanges?: FormattedAuctionSlotChanges;
|
|
31
|
+
}
|
|
32
|
+
interface FormattedAuctionSlotChanges {
|
|
33
|
+
accountChanges?: string;
|
|
34
|
+
authAccountsChanges?: {
|
|
35
|
+
status: string;
|
|
36
|
+
account: string;
|
|
37
|
+
}[];
|
|
38
|
+
discountedFeeChange?: number;
|
|
39
|
+
expirationChange?: number;
|
|
40
|
+
priceChange?: FormattedAmount;
|
|
41
|
+
timeIntervalChange?: number;
|
|
42
|
+
}
|
|
43
|
+
interface FormattedAmmVoteSlotChanges {
|
|
44
|
+
status: "added" | "modified" | "removed";
|
|
45
|
+
account: string;
|
|
46
|
+
tradingFee?: number;
|
|
47
|
+
voteWeight?: number;
|
|
48
|
+
tradingFeeChange?: number;
|
|
49
|
+
voteWeightChange?: number;
|
|
50
|
+
}
|
|
51
|
+
declare function parseAmmChanges(metadata: TransactionMetadata): FormattedAmmSummaryInterface | undefined;
|
|
52
|
+
export { parseAmmChanges };
|