@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,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.parseOrderbookQuality = parseOrderbookQuality;
|
|
40
|
+
const assert = __importStar(require("assert"));
|
|
41
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
42
|
+
const utils_1 = require("../utils");
|
|
43
|
+
function parseOrderbookQuality(qualityHex, takerGetsCurrency, takerPaysCurrency) {
|
|
44
|
+
assert.ok(qualityHex.length === 16);
|
|
45
|
+
const mantissa = new bignumber_js_1.default(qualityHex.substring(2), 16);
|
|
46
|
+
const offset = parseInt(qualityHex.substring(0, 2), 16) - 100;
|
|
47
|
+
const quality = mantissa.toString() + "e" + offset.toString();
|
|
48
|
+
return (0, utils_1.adjustQualityForXRP)(quality, takerGetsCurrency, takerPaysCurrency);
|
|
49
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormattedRemark } from "../../types";
|
|
2
|
+
type FormattedRemarkSummaryInterface = {
|
|
3
|
+
status?: "created" | "modified" | "deleted";
|
|
4
|
+
previousValue?: string;
|
|
5
|
+
} & FormattedRemark;
|
|
6
|
+
interface FormattedRemarksSummaryInterface {
|
|
7
|
+
status?: "created" | "modified" | "deleted";
|
|
8
|
+
objectID: string;
|
|
9
|
+
entryType?: string;
|
|
10
|
+
remarks?: FormattedRemarkSummaryInterface[];
|
|
11
|
+
previousTxnID?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function parseRemarksChanges(tx: any): FormattedRemarksSummaryInterface | undefined;
|
|
14
|
+
export { parseRemarksChanges };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseRemarksChanges = parseRemarksChanges;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const remarks_1 = require("../ledger/remarks");
|
|
6
|
+
function parseEntryRemarks(node) {
|
|
7
|
+
const final = node.diffType === "CreatedNode" ? node.newFields : node.finalFields;
|
|
8
|
+
const prev = node.previousFields;
|
|
9
|
+
if (!final.Remarks && !prev.Remarks) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
const remarks = ((0, remarks_1.parseRemarks)(final.Remarks) || []);
|
|
13
|
+
if (prev.Remarks) {
|
|
14
|
+
const previousRemarks = (0, remarks_1.parseRemarks)(prev.Remarks) || [];
|
|
15
|
+
remarks.forEach((remark) => {
|
|
16
|
+
const previousRemark = previousRemarks.find((r) => r.name === remark.name);
|
|
17
|
+
if (previousRemark) {
|
|
18
|
+
if (previousRemark.value !== remark.value) {
|
|
19
|
+
remark.status = "modified";
|
|
20
|
+
remark.previousValue = previousRemark.value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
remark.status = "created";
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
previousRemarks.forEach((previousRemark) => {
|
|
28
|
+
if (!remarks.some((r) => r.name === previousRemark.name)) {
|
|
29
|
+
remarks.push({
|
|
30
|
+
...previousRemark,
|
|
31
|
+
status: "deleted",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
remarks.forEach((remark) => {
|
|
38
|
+
remark.status = "created";
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return remarks;
|
|
42
|
+
}
|
|
43
|
+
function summarizeRemarks(node) {
|
|
44
|
+
const summary = {
|
|
45
|
+
objectID: node.ledgerIndex,
|
|
46
|
+
entryType: node.entryType,
|
|
47
|
+
remarks: parseEntryRemarks(node),
|
|
48
|
+
};
|
|
49
|
+
if (node.PreviousTxnID) {
|
|
50
|
+
summary.previousTxnID = node.PreviousTxnID;
|
|
51
|
+
}
|
|
52
|
+
return summary;
|
|
53
|
+
}
|
|
54
|
+
function parseRemarksChanges(tx) {
|
|
55
|
+
if (!tx.ObjectID || !tx.meta || !Array.isArray(tx.meta.AffectedNodes)) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
const metadata = tx.meta;
|
|
59
|
+
const affectedNodes = metadata.AffectedNodes.filter((affectedNode) => {
|
|
60
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
61
|
+
return node.LedgerIndex === tx.ObjectID;
|
|
62
|
+
});
|
|
63
|
+
if (affectedNodes.length !== 1) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
const normalizedNode = (0, utils_1.normalizeNode)(affectedNodes[0]);
|
|
67
|
+
return summarizeRemarks(normalizedNode);
|
|
68
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface FormattedUNLReportSummaryInterface {
|
|
2
|
+
status: "added";
|
|
3
|
+
activeValidator?: {
|
|
4
|
+
account: string;
|
|
5
|
+
publicKey: string;
|
|
6
|
+
};
|
|
7
|
+
importVLKey?: {
|
|
8
|
+
account: string;
|
|
9
|
+
publicKey: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare function parseUNLReportChanges(tx: any): FormattedUNLReportSummaryInterface | undefined;
|
|
13
|
+
export { parseUNLReportChanges };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseUNLReportChanges = parseUNLReportChanges;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
function summarizeUNLReport(tx, node) {
|
|
7
|
+
const final = node.diffType === "CreatedNode" ? node.newFields : node.finalFields;
|
|
8
|
+
if (tx.ImportVLKey && final.ImportVLKeys) {
|
|
9
|
+
for (const vlKey of final.ImportVLKeys) {
|
|
10
|
+
if (vlKey.ImportVLKey.PublicKey === tx.ImportVLKey.PublicKey) {
|
|
11
|
+
const summary = {
|
|
12
|
+
status: "added",
|
|
13
|
+
importVLKey: {
|
|
14
|
+
account: vlKey.ImportVLKey.Account,
|
|
15
|
+
publicKey: vlKey.ImportVLKey.PublicKey,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
return (0, common_1.removeUndefined)(summary);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (tx.ActiveValidator && final.ActiveValidators) {
|
|
23
|
+
for (const activeValidator of final.ActiveValidators) {
|
|
24
|
+
if (activeValidator.ActiveValidator.PublicKey === tx.ActiveValidator.PublicKey) {
|
|
25
|
+
const summary = {
|
|
26
|
+
status: "added",
|
|
27
|
+
activeValidator: {
|
|
28
|
+
account: activeValidator.ActiveValidator.Account,
|
|
29
|
+
publicKey: activeValidator.ActiveValidator.PublicKey,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
return (0, common_1.removeUndefined)(summary);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
function parseUNLReportChanges(tx) {
|
|
39
|
+
const affectedNodes = tx.meta.AffectedNodes.filter((affectedNode) => {
|
|
40
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
41
|
+
return node.LedgerEntryType === "UNLReport";
|
|
42
|
+
});
|
|
43
|
+
if (affectedNodes.length !== 1) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const normalizedNode = (0, utils_1.normalizeNode)(affectedNodes[0]);
|
|
47
|
+
return summarizeUNLReport(tx, normalizedNode);
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseURITokenChanges(tx: object): object;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseURITokenChanges = parseURITokenChanges;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
function parseURITokenChanges(tx) {
|
|
6
|
+
return new URITokenChanges(tx).call();
|
|
7
|
+
}
|
|
8
|
+
class URITokenChanges {
|
|
9
|
+
constructor(tx) {
|
|
10
|
+
this.tx = tx;
|
|
11
|
+
this.changes = {};
|
|
12
|
+
}
|
|
13
|
+
call() {
|
|
14
|
+
if (this.hasAffectedNodes() === false) {
|
|
15
|
+
return this.changes;
|
|
16
|
+
}
|
|
17
|
+
this.parseAffectedNodes();
|
|
18
|
+
return this.changes;
|
|
19
|
+
}
|
|
20
|
+
hasAffectedNodes() {
|
|
21
|
+
if (this.tx.meta?.AffectedNodes === undefined) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (this.tx.meta?.AffectedNodes?.length === 0) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
addChange(account, change) {
|
|
30
|
+
if (!this.changes[account]) {
|
|
31
|
+
this.changes[account] = [];
|
|
32
|
+
}
|
|
33
|
+
this.changes[account].push((0, common_1.removeUndefined)(change));
|
|
34
|
+
}
|
|
35
|
+
parseAffectedNodes() {
|
|
36
|
+
for (const affectedNode of this.tx.meta.AffectedNodes) {
|
|
37
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
38
|
+
if (node?.LedgerEntryType === "URIToken" && node?.LedgerIndex) {
|
|
39
|
+
const uritokenID = node.LedgerIndex;
|
|
40
|
+
if (affectedNode.CreatedNode) {
|
|
41
|
+
this.addChange(node.NewFields.Owner, {
|
|
42
|
+
status: "added",
|
|
43
|
+
flags: node.NewFields.Flags,
|
|
44
|
+
uritokenID,
|
|
45
|
+
uri: node.NewFields.URI,
|
|
46
|
+
digest: node.NewFields.Digest,
|
|
47
|
+
issuer: node.NewFields.Issuer,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (affectedNode.ModifiedNode) {
|
|
51
|
+
if (node.PreviousFields.Owner && node.PreviousFields.Owner !== node.FinalFields.Owner) {
|
|
52
|
+
this.addChange(node.PreviousFields.Owner, {
|
|
53
|
+
status: "removed",
|
|
54
|
+
flags: node.FinalFields.Flags,
|
|
55
|
+
uritokenID,
|
|
56
|
+
uri: node.FinalFields.URI,
|
|
57
|
+
digest: node.FinalFields.Digest,
|
|
58
|
+
issuer: node.FinalFields.Issuer,
|
|
59
|
+
});
|
|
60
|
+
this.addChange(node.FinalFields.Owner, {
|
|
61
|
+
status: "added",
|
|
62
|
+
flags: node.FinalFields.Flags,
|
|
63
|
+
uritokenID,
|
|
64
|
+
uri: node.FinalFields.URI,
|
|
65
|
+
digest: node.FinalFields.Digest,
|
|
66
|
+
issuer: node.FinalFields.Issuer,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (affectedNode.DeletedNode) {
|
|
71
|
+
this.addChange(node.FinalFields.Owner, {
|
|
72
|
+
status: "removed",
|
|
73
|
+
flags: node.FinalFields.Flags,
|
|
74
|
+
uritokenID,
|
|
75
|
+
uri: node.FinalFields.URI,
|
|
76
|
+
digest: node.FinalFields.Digest,
|
|
77
|
+
issuer: node.FinalFields.Issuer,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseURITokenSellOfferChanges(tx: object): object;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseURITokenSellOfferChanges = parseURITokenSellOfferChanges;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
function parseURITokenSellOfferChanges(tx) {
|
|
6
|
+
return new URITokenSellOfferChanges(tx).call();
|
|
7
|
+
}
|
|
8
|
+
class URITokenSellOfferChanges {
|
|
9
|
+
constructor(tx) {
|
|
10
|
+
this.tx = tx;
|
|
11
|
+
this.changes = {};
|
|
12
|
+
}
|
|
13
|
+
call() {
|
|
14
|
+
if (this.hasAffectedNodes() === false) {
|
|
15
|
+
return this.changes;
|
|
16
|
+
}
|
|
17
|
+
this.parseAffectedNodes();
|
|
18
|
+
return this.changes;
|
|
19
|
+
}
|
|
20
|
+
hasAffectedNodes() {
|
|
21
|
+
if (this.tx.meta?.AffectedNodes === undefined) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (this.tx.meta?.AffectedNodes?.length === 0) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
addChange(account, change) {
|
|
30
|
+
if (!this.changes[account]) {
|
|
31
|
+
this.changes[account] = [];
|
|
32
|
+
}
|
|
33
|
+
this.changes[account].push((0, common_1.removeUndefined)(change));
|
|
34
|
+
}
|
|
35
|
+
parseAffectedNodes() {
|
|
36
|
+
for (const affectedNode of this.tx.meta.AffectedNodes) {
|
|
37
|
+
const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
|
|
38
|
+
if (node?.LedgerEntryType === "URIToken" && node?.LedgerIndex) {
|
|
39
|
+
const uritokenID = node.LedgerIndex;
|
|
40
|
+
if (affectedNode.CreatedNode) {
|
|
41
|
+
if (node.NewFields.Amount || node.NewFields.Destination) {
|
|
42
|
+
this.addChange(node.NewFields.Owner, {
|
|
43
|
+
status: "created",
|
|
44
|
+
uritokenID,
|
|
45
|
+
amount: node.NewFields.Amount,
|
|
46
|
+
destination: node.NewFields.Destination,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (affectedNode.ModifiedNode) {
|
|
51
|
+
if (node.PreviousFields.Amount !== node.FinalFields.Amount ||
|
|
52
|
+
node.PreviousFields.Destination !== node.FinalFields.Destination) {
|
|
53
|
+
if (node.PreviousFields.Amount || node.PreviousFields.Destination) {
|
|
54
|
+
let owner;
|
|
55
|
+
if (node.PreviousFields.hasOwnProperty("Owner")) {
|
|
56
|
+
owner = node.PreviousFields.Owner;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
owner = node.FinalFields.Owner;
|
|
60
|
+
}
|
|
61
|
+
let destination;
|
|
62
|
+
if (node.PreviousFields.hasOwnProperty("Destination")) {
|
|
63
|
+
destination = node.PreviousFields.Destination;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
destination = node.FinalFields.Destination;
|
|
67
|
+
}
|
|
68
|
+
let amount;
|
|
69
|
+
if (node.PreviousFields.hasOwnProperty("Amount")) {
|
|
70
|
+
amount = node.PreviousFields.Amount;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
amount = node.FinalFields.Amount;
|
|
74
|
+
}
|
|
75
|
+
this.addChange(owner, {
|
|
76
|
+
status: "deleted",
|
|
77
|
+
uritokenID,
|
|
78
|
+
amount,
|
|
79
|
+
destination,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (node.FinalFields.Amount || node.FinalFields.Destination) {
|
|
83
|
+
this.addChange(node.FinalFields.Owner, {
|
|
84
|
+
status: "created",
|
|
85
|
+
uritokenID,
|
|
86
|
+
amount: node.FinalFields.Amount,
|
|
87
|
+
destination: node.FinalFields.Destination,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (affectedNode.DeletedNode) {
|
|
93
|
+
if (node.FinalFields.Amount || node.FinalFields.Destination) {
|
|
94
|
+
this.addChange(node.FinalFields.Owner, {
|
|
95
|
+
status: "deleted",
|
|
96
|
+
uritokenID,
|
|
97
|
+
amount: node.FinalFields.Amount,
|
|
98
|
+
destination: node.FinalFields.Destination,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseOutcome = parseOutcome;
|
|
4
|
+
const client_1 = require("../client");
|
|
5
|
+
const index_1 = require("./outcome/index");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const ESCROW_TYPES = ["EscrowFinish", "EscrowCreate", "EscrowCancel"];
|
|
9
|
+
const CHANNEL_TYPES = ["PaymentChannelCreate", "PaymentChannelFund", "PaymentChannelClaim"];
|
|
10
|
+
const CHECK_TYPES = ["CheckCreate", "CheckCash", "CheckCancel"];
|
|
11
|
+
const NFTOKEN_TYPES = [
|
|
12
|
+
"NFTokenMint",
|
|
13
|
+
"NFTokenBurn",
|
|
14
|
+
"NFTokenCreateOffer",
|
|
15
|
+
"NFTokenCancelOffer",
|
|
16
|
+
"NFTokenAcceptOffer",
|
|
17
|
+
"NFTokenModify",
|
|
18
|
+
];
|
|
19
|
+
const URITOKEN_TYPES = [
|
|
20
|
+
"Remit",
|
|
21
|
+
"URITokenMint",
|
|
22
|
+
"URITokenBurn",
|
|
23
|
+
"URITokenBuy",
|
|
24
|
+
"URITokenCreateSellOffer",
|
|
25
|
+
"URITokenCancelSellOffer",
|
|
26
|
+
];
|
|
27
|
+
const AMM_TYPES = ["AMMBid", "AMMCreate", "AMMDelete", "AMMDeposit", "AMMWithdraw", "AMMVote", "AMMClawback"];
|
|
28
|
+
const DID_TYPES = ["DIDSet", "DIDDelete"];
|
|
29
|
+
const ORACLE_TYPES = ["OracleSet", "OracleDelete"];
|
|
30
|
+
const UNL_REPORT_TYPES = ["UNLReport"];
|
|
31
|
+
const MPTOKEN_TYPES = [
|
|
32
|
+
"MPTokenIssuanceCreate",
|
|
33
|
+
"MPTokenAuthorize",
|
|
34
|
+
"MPTokenIssuanceSet",
|
|
35
|
+
"MPTokenIssuanceDestroy",
|
|
36
|
+
"Payment",
|
|
37
|
+
"Clawback",
|
|
38
|
+
"EscrowFinish",
|
|
39
|
+
"EscrowCreate",
|
|
40
|
+
"EscrowCancel",
|
|
41
|
+
];
|
|
42
|
+
const CREDENTIAL_TYPES = ["CredentialCreate", "CredentialAccept", "CredentialDelete"];
|
|
43
|
+
const DELEGATE_TYPES = ["DelegateSet"];
|
|
44
|
+
const REMARKS_TYPES = ["SetRemarks"];
|
|
45
|
+
const CRON_TYPES = ["Cron", "CronSet"];
|
|
46
|
+
const AMENDMENT_TYPES = ["EnableAmendment"];
|
|
47
|
+
const ACCOUNT_SETTING_TYPES = ["AccountSet"];
|
|
48
|
+
function parseOutcome(tx, nativeCurrency, definitions) {
|
|
49
|
+
const metadata = tx.meta || tx.metaData;
|
|
50
|
+
if (!metadata) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const balanceChanges = getBalanceChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)());
|
|
54
|
+
return (0, common_1.removeUndefined)({
|
|
55
|
+
result: tx.meta.TransactionResult,
|
|
56
|
+
timestamp: (0, utils_1.parseTimestamp)(tx.date),
|
|
57
|
+
fee: (0, common_1.dropsToXrp)(tx.Fee),
|
|
58
|
+
settingsChanges: getSettingsChanges(tx),
|
|
59
|
+
balanceChanges,
|
|
60
|
+
lockedBalanceChanges: getLockedBalanceChanges(tx),
|
|
61
|
+
orderbookChanges: getOrderbookChanges(tx),
|
|
62
|
+
channelChanges: getChannelChanges(tx),
|
|
63
|
+
checkChanges: getCheckChanges(tx),
|
|
64
|
+
escrowChanges: getEscrowChanges(tx),
|
|
65
|
+
amendmentChanges: getAmendmentChanges(tx),
|
|
66
|
+
nftokenChanges: getNFTokenChanges(tx),
|
|
67
|
+
nftokenOfferChanges: getNFTokenOfferChanges(tx),
|
|
68
|
+
uritokenChanges: getURITokenChanges(tx),
|
|
69
|
+
uritokenSellOfferChanges: getURITokenSellOfferChanges(tx),
|
|
70
|
+
affectedObjects: getAffectedObjects(tx),
|
|
71
|
+
ammChanges: getAmmChanges(tx),
|
|
72
|
+
didChanges: getDIDChanges(tx),
|
|
73
|
+
oracleChanges: getOracleChanges(tx),
|
|
74
|
+
mptokenIssuanceChanges: getMPTokenIssuanceChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
|
|
75
|
+
mptokenChanges: getMPTokenChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
|
|
76
|
+
credentialChanges: getCredentialChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
|
|
77
|
+
delegateChanges: getDelegateChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
|
|
78
|
+
remarksChanges: getRemarksChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
|
|
79
|
+
cronChanges: getCronChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
|
|
80
|
+
unlReportChanges: getUNLReportChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
|
|
81
|
+
hooksExecutions: getHooksExecutions(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
|
|
82
|
+
emittedTxns: getEmittedTxns(tx, nativeCurrency || (0, client_1.getNativeCurrency)(), definitions),
|
|
83
|
+
parentBatchID: tx.meta.ParentBatchID,
|
|
84
|
+
ledgerIndex: tx.ledger_index || tx.inLedger,
|
|
85
|
+
ledgerVersion: tx.ledger_index || tx.inLedger,
|
|
86
|
+
indexInLedger: tx.meta.TransactionIndex,
|
|
87
|
+
deliveredAmount: (0, index_1.parseDeliveredAmount)(tx, balanceChanges),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function getBalanceChanges(tx, nativeCurrency) {
|
|
91
|
+
const balanceChanges = (0, index_1.parseBalanceChanges)(tx.meta, nativeCurrency, tx);
|
|
92
|
+
return Object.keys(balanceChanges).length > 0 ? balanceChanges : undefined;
|
|
93
|
+
}
|
|
94
|
+
function getLockedBalanceChanges(tx) {
|
|
95
|
+
if (!ESCROW_TYPES.includes(tx.TransactionType)) {
|
|
96
|
+
return undefined;
|
|
97
|
+
}
|
|
98
|
+
const lockedBalanceChanges = (0, index_1.parseLockedBalanceChanges)(tx.meta);
|
|
99
|
+
return Object.keys(lockedBalanceChanges).length > 0 ? lockedBalanceChanges : undefined;
|
|
100
|
+
}
|
|
101
|
+
function getOrderbookChanges(tx) {
|
|
102
|
+
const orderbookChanges = (0, index_1.parseOrderbookChanges)(tx.meta);
|
|
103
|
+
return Object.keys(orderbookChanges).length > 0 ? orderbookChanges : undefined;
|
|
104
|
+
}
|
|
105
|
+
function getChannelChanges(tx) {
|
|
106
|
+
if (!CHANNEL_TYPES.includes(tx.TransactionType)) {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
return (0, index_1.parseChannelChanges)(tx.meta);
|
|
110
|
+
}
|
|
111
|
+
function getCheckChanges(tx) {
|
|
112
|
+
if (!CHECK_TYPES.includes(tx.TransactionType)) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
return (0, index_1.parseCheckChanges)(tx.meta);
|
|
116
|
+
}
|
|
117
|
+
function getEscrowChanges(tx) {
|
|
118
|
+
if (!ESCROW_TYPES.includes(tx.TransactionType)) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
return (0, index_1.parseEscrowChanges)(tx);
|
|
122
|
+
}
|
|
123
|
+
function getAmendmentChanges(tx) {
|
|
124
|
+
if (!AMENDMENT_TYPES.includes(tx.TransactionType)) {
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
return (0, index_1.parseAmendmentChanges)(tx);
|
|
128
|
+
}
|
|
129
|
+
function getSettingsChanges(tx) {
|
|
130
|
+
if (!ACCOUNT_SETTING_TYPES.includes(tx.TransactionType)) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
return (0, index_1.parseAccountSettingChanges)(tx.meta);
|
|
134
|
+
}
|
|
135
|
+
function getAffectedObjects(tx) {
|
|
136
|
+
if (!NFTOKEN_TYPES.includes(tx.TransactionType) && !URITOKEN_TYPES.includes(tx.TransactionType)) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
const affectedObjects = (0, index_1.parseAffectedObjects)(tx);
|
|
140
|
+
return affectedObjects ? (0, common_1.removeUndefined)(affectedObjects) : undefined;
|
|
141
|
+
}
|
|
142
|
+
function getNFTokenChanges(tx) {
|
|
143
|
+
if (!NFTOKEN_TYPES.includes(tx.TransactionType)) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
const nftokenChanges = (0, index_1.parseNFTokenChanges)(tx);
|
|
147
|
+
return Object.keys(nftokenChanges).length > 0 ? nftokenChanges : undefined;
|
|
148
|
+
}
|
|
149
|
+
function getNFTokenOfferChanges(tx) {
|
|
150
|
+
if (!NFTOKEN_TYPES.includes(tx.TransactionType)) {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
const nftokenOfferChanges = (0, index_1.parseNFTokenOfferChanges)(tx);
|
|
154
|
+
return Object.keys(nftokenOfferChanges).length > 0 ? nftokenOfferChanges : undefined;
|
|
155
|
+
}
|
|
156
|
+
function getURITokenChanges(tx) {
|
|
157
|
+
if (!URITOKEN_TYPES.includes(tx.TransactionType)) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
const uritokenChanges = (0, index_1.parseURITokenChanges)(tx);
|
|
161
|
+
return Object.keys(uritokenChanges).length > 0 ? uritokenChanges : undefined;
|
|
162
|
+
}
|
|
163
|
+
function getURITokenSellOfferChanges(tx) {
|
|
164
|
+
if (!URITOKEN_TYPES.includes(tx.TransactionType)) {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
const uritokenSellOfferChanges = (0, index_1.parseURITokenSellOfferChanges)(tx);
|
|
168
|
+
return Object.keys(uritokenSellOfferChanges).length > 0 ? uritokenSellOfferChanges : undefined;
|
|
169
|
+
}
|
|
170
|
+
function getHooksExecutions(tx, nativeCurrency) {
|
|
171
|
+
if (nativeCurrency !== common_1.XAHAU_NATIVE_CURRENCY) {
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
return (0, index_1.parseHooksExecutions)(tx);
|
|
175
|
+
}
|
|
176
|
+
function getEmittedTxns(tx, nativeCurrency, definitions) {
|
|
177
|
+
if (nativeCurrency !== common_1.XAHAU_NATIVE_CURRENCY) {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
return (0, index_1.parseEmittedTxns)(tx, nativeCurrency, definitions);
|
|
181
|
+
}
|
|
182
|
+
function getAmmChanges(tx) {
|
|
183
|
+
if (!AMM_TYPES.includes(tx.TransactionType)) {
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
const ammChanges = (0, index_1.parseAmmChanges)(tx.meta);
|
|
187
|
+
return ammChanges ? (0, common_1.removeUndefined)(ammChanges) : undefined;
|
|
188
|
+
}
|
|
189
|
+
function getDIDChanges(tx) {
|
|
190
|
+
if (!DID_TYPES.includes(tx.TransactionType)) {
|
|
191
|
+
return undefined;
|
|
192
|
+
}
|
|
193
|
+
const didChanges = (0, index_1.parseDIDChanges)(tx.meta);
|
|
194
|
+
return didChanges ? (0, common_1.removeUndefined)(didChanges) : undefined;
|
|
195
|
+
}
|
|
196
|
+
function getOracleChanges(tx) {
|
|
197
|
+
if (!ORACLE_TYPES.includes(tx.TransactionType)) {
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
200
|
+
const oracleChanges = (0, index_1.parseOracleChanges)(tx.meta);
|
|
201
|
+
return oracleChanges ? (0, common_1.removeUndefined)(oracleChanges) : undefined;
|
|
202
|
+
}
|
|
203
|
+
function getUNLReportChanges(tx, nativeCurrency) {
|
|
204
|
+
if (nativeCurrency !== common_1.XAHAU_NATIVE_CURRENCY) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
if (!UNL_REPORT_TYPES.includes(tx.TransactionType)) {
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
return (0, index_1.parseUNLReportChanges)(tx);
|
|
211
|
+
}
|
|
212
|
+
function getMPTokenChanges(tx, nativeCurrency) {
|
|
213
|
+
if (nativeCurrency !== common_1.MAINNET_NATIVE_CURRENCY) {
|
|
214
|
+
return undefined;
|
|
215
|
+
}
|
|
216
|
+
if (!MPTOKEN_TYPES.includes(tx.TransactionType)) {
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
const mptokenChanges = (0, index_1.parseMPTokenChanges)(tx);
|
|
220
|
+
return Object.keys(mptokenChanges).length > 0 ? mptokenChanges : undefined;
|
|
221
|
+
}
|
|
222
|
+
function getMPTokenIssuanceChanges(tx, nativeCurrency) {
|
|
223
|
+
if (nativeCurrency !== common_1.MAINNET_NATIVE_CURRENCY) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
const mptokenIssuanceChanges = (0, index_1.parseMPTokenIssuanceChanges)(tx);
|
|
227
|
+
return Object.keys(mptokenIssuanceChanges).length > 0 ? mptokenIssuanceChanges : undefined;
|
|
228
|
+
}
|
|
229
|
+
function getCredentialChanges(tx, nativeCurrency) {
|
|
230
|
+
if (nativeCurrency !== common_1.MAINNET_NATIVE_CURRENCY) {
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
if (!CREDENTIAL_TYPES.includes(tx.TransactionType)) {
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
return (0, index_1.parseCredentialChanges)(tx.meta);
|
|
237
|
+
}
|
|
238
|
+
function getDelegateChanges(tx, nativeCurrency) {
|
|
239
|
+
if (nativeCurrency !== common_1.MAINNET_NATIVE_CURRENCY) {
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
if (!DELEGATE_TYPES.includes(tx.TransactionType)) {
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
return (0, index_1.parseDelegateChanges)(tx.meta);
|
|
246
|
+
}
|
|
247
|
+
function getRemarksChanges(tx, nativeCurrency) {
|
|
248
|
+
if (nativeCurrency !== common_1.XAHAU_NATIVE_CURRENCY) {
|
|
249
|
+
return undefined;
|
|
250
|
+
}
|
|
251
|
+
if (!REMARKS_TYPES.includes(tx.TransactionType)) {
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
return (0, index_1.parseRemarksChanges)(tx);
|
|
255
|
+
}
|
|
256
|
+
function getCronChanges(tx, nativeCurrency) {
|
|
257
|
+
if (nativeCurrency !== common_1.XAHAU_NATIVE_CURRENCY) {
|
|
258
|
+
return undefined;
|
|
259
|
+
}
|
|
260
|
+
if (!CRON_TYPES.includes(tx.TransactionType)) {
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
return (0, index_1.parseCronChanges)(tx);
|
|
264
|
+
}
|