@bithomp/xrpl-api 3.7.31 → 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/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/package.json +11 -11
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createVL = createVL;
|
|
37
|
+
exports.createVLBlob = createVLBlob;
|
|
38
|
+
exports.getVLBlobValidatorsManifest = getVLBlobValidatorsManifest;
|
|
39
|
+
const ripple_address_codec_1 = require("ripple-address-codec");
|
|
40
|
+
const Client = __importStar(require("../client"));
|
|
41
|
+
const utils_1 = require("../parse/utils");
|
|
42
|
+
const vl_1 = require("../models/vl");
|
|
43
|
+
const manifest_1 = require("../models/manifest");
|
|
44
|
+
const ledger_1 = require("../models/ledger");
|
|
45
|
+
const Validator = __importStar(require("../validator"));
|
|
46
|
+
async function createVL(masterKey, ephemeralKey, sequence, expiration, validatorsPublicKeys) {
|
|
47
|
+
if (!masterKey) {
|
|
48
|
+
throw new Error("Master key is required");
|
|
49
|
+
}
|
|
50
|
+
if (!ephemeralKey) {
|
|
51
|
+
throw new Error("Ephemeral key is required");
|
|
52
|
+
}
|
|
53
|
+
if (masterKey.publicKey === ephemeralKey.publicKey) {
|
|
54
|
+
throw new Error("Master and ephemeral keys must be different.");
|
|
55
|
+
}
|
|
56
|
+
if (typeof sequence !== "number") {
|
|
57
|
+
throw new Error("sequence must be a number.");
|
|
58
|
+
}
|
|
59
|
+
if (typeof expiration !== "number") {
|
|
60
|
+
throw new Error("expiration must be a number.");
|
|
61
|
+
}
|
|
62
|
+
if (Array.isArray(validatorsPublicKeys) === false) {
|
|
63
|
+
throw new Error("validatorsPublicKeys must be an array.");
|
|
64
|
+
}
|
|
65
|
+
if (validatorsPublicKeys.length === 0) {
|
|
66
|
+
throw new Error("validatorsPublicKeys must not be empty.");
|
|
67
|
+
}
|
|
68
|
+
for (const publicKey of validatorsPublicKeys) {
|
|
69
|
+
if (typeof publicKey !== "string") {
|
|
70
|
+
throw new Error("validatorsPublicKeys must be an array of strings.");
|
|
71
|
+
}
|
|
72
|
+
if (publicKey[0] !== "n") {
|
|
73
|
+
throw new Error("validatorsPublicKeys must be an array of strings starting with 'n'.");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const vlBlob = await createVLBlob(sequence, expiration, validatorsPublicKeys);
|
|
77
|
+
const blob = (0, vl_1.encodeVLBlob)(vlBlob);
|
|
78
|
+
const manifest = (0, manifest_1.generateManifest)({
|
|
79
|
+
Sequence: sequence,
|
|
80
|
+
PublicKey: masterKey.publicKey,
|
|
81
|
+
SigningPubKey: ephemeralKey.publicKey,
|
|
82
|
+
SigningPrivateKey: ephemeralKey.privateKey,
|
|
83
|
+
MasterPrivateKey: masterKey.privateKey,
|
|
84
|
+
});
|
|
85
|
+
const signature = Validator.sign(Buffer.from(blob, "base64"), ephemeralKey.privateKey);
|
|
86
|
+
return {
|
|
87
|
+
blob,
|
|
88
|
+
manifest,
|
|
89
|
+
signature,
|
|
90
|
+
public_key: masterKey.publicKey,
|
|
91
|
+
version: 1,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async function createVLBlob(sequence, expiration, validatorsPublicKeys) {
|
|
95
|
+
const validators = await getVLBlobValidatorsManifest(validatorsPublicKeys);
|
|
96
|
+
return {
|
|
97
|
+
sequence,
|
|
98
|
+
expiration: (0, ledger_1.unixTimeToLedgerTime)(expiration),
|
|
99
|
+
validators,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
async function getVLBlobValidatorsManifest(validatorsPublicKeys) {
|
|
103
|
+
const connection = Client.findConnection("manifest");
|
|
104
|
+
if (!connection) {
|
|
105
|
+
throw new Error("There is no connection");
|
|
106
|
+
}
|
|
107
|
+
const validatorsManifests = await Promise.all(validatorsPublicKeys.map(async (publicKey) => {
|
|
108
|
+
const response = await connection.request({
|
|
109
|
+
command: "manifest",
|
|
110
|
+
public_key: publicKey,
|
|
111
|
+
});
|
|
112
|
+
if (response.error) {
|
|
113
|
+
Promise.reject(response.error);
|
|
114
|
+
}
|
|
115
|
+
if (!response.result || !response.result.manifest) {
|
|
116
|
+
return Promise.reject(new Error("Failed to get validator manifest"));
|
|
117
|
+
}
|
|
118
|
+
return response.result;
|
|
119
|
+
}));
|
|
120
|
+
const validators = validatorsManifests.map((info) => {
|
|
121
|
+
const validationPublicKey = info.requested;
|
|
122
|
+
const publicKeyBuffer = (0, ripple_address_codec_1.decodeNodePublic)(validationPublicKey);
|
|
123
|
+
const publicKey = (0, utils_1.bytesToHex)(publicKeyBuffer.buffer);
|
|
124
|
+
const manifest = info.manifest;
|
|
125
|
+
return {
|
|
126
|
+
validation_public_key: publicKey,
|
|
127
|
+
manifest,
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
return validators;
|
|
131
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { LedgerEntry, AccountSetAsfFlags } from "xrpl";
|
|
2
|
+
import { QueueData } from "../types/queue_data";
|
|
3
|
+
export declare enum XahauAccountRootFlags {
|
|
4
|
+
lsfTshCollect = 33554432,
|
|
5
|
+
lsfURITokenIssuer = 1073741824,
|
|
6
|
+
lsfDisallowIncomingRemit = 2147483648
|
|
7
|
+
}
|
|
8
|
+
export declare const AccountRootFlagsKeys: {
|
|
9
|
+
passwordSpent: LedgerEntry.AccountRootFlags;
|
|
10
|
+
requireDestTag: LedgerEntry.AccountRootFlags;
|
|
11
|
+
requireAuth: LedgerEntry.AccountRootFlags;
|
|
12
|
+
depositAuth: LedgerEntry.AccountRootFlags;
|
|
13
|
+
disallowXRP: LedgerEntry.AccountRootFlags;
|
|
14
|
+
disableMaster: LedgerEntry.AccountRootFlags;
|
|
15
|
+
noFreeze: LedgerEntry.AccountRootFlags;
|
|
16
|
+
globalFreeze: LedgerEntry.AccountRootFlags;
|
|
17
|
+
defaultRipple: LedgerEntry.AccountRootFlags;
|
|
18
|
+
disallowIncomingNFTokenOffer: LedgerEntry.AccountRootFlags;
|
|
19
|
+
disallowIncomingCheck: LedgerEntry.AccountRootFlags;
|
|
20
|
+
disallowIncomingPayChan: LedgerEntry.AccountRootFlags;
|
|
21
|
+
disallowIncomingTrustline: LedgerEntry.AccountRootFlags;
|
|
22
|
+
};
|
|
23
|
+
export declare const XRPLAccountRootFlagsKeys: {
|
|
24
|
+
allowTrustLineClawback: LedgerEntry.AccountRootFlags;
|
|
25
|
+
allowTrustLineLocking: LedgerEntry.AccountRootFlags;
|
|
26
|
+
passwordSpent: LedgerEntry.AccountRootFlags;
|
|
27
|
+
requireDestTag: LedgerEntry.AccountRootFlags;
|
|
28
|
+
requireAuth: LedgerEntry.AccountRootFlags;
|
|
29
|
+
depositAuth: LedgerEntry.AccountRootFlags;
|
|
30
|
+
disallowXRP: LedgerEntry.AccountRootFlags;
|
|
31
|
+
disableMaster: LedgerEntry.AccountRootFlags;
|
|
32
|
+
noFreeze: LedgerEntry.AccountRootFlags;
|
|
33
|
+
globalFreeze: LedgerEntry.AccountRootFlags;
|
|
34
|
+
defaultRipple: LedgerEntry.AccountRootFlags;
|
|
35
|
+
disallowIncomingNFTokenOffer: LedgerEntry.AccountRootFlags;
|
|
36
|
+
disallowIncomingCheck: LedgerEntry.AccountRootFlags;
|
|
37
|
+
disallowIncomingPayChan: LedgerEntry.AccountRootFlags;
|
|
38
|
+
disallowIncomingTrustline: LedgerEntry.AccountRootFlags;
|
|
39
|
+
};
|
|
40
|
+
export declare const XahauAccountRootFlagsKeys: {
|
|
41
|
+
tshCollect: XahauAccountRootFlags;
|
|
42
|
+
uriTokenIssuer: XahauAccountRootFlags;
|
|
43
|
+
disallowIncomingRemit: XahauAccountRootFlags;
|
|
44
|
+
passwordSpent: LedgerEntry.AccountRootFlags;
|
|
45
|
+
requireDestTag: LedgerEntry.AccountRootFlags;
|
|
46
|
+
requireAuth: LedgerEntry.AccountRootFlags;
|
|
47
|
+
depositAuth: LedgerEntry.AccountRootFlags;
|
|
48
|
+
disallowXRP: LedgerEntry.AccountRootFlags;
|
|
49
|
+
disableMaster: LedgerEntry.AccountRootFlags;
|
|
50
|
+
noFreeze: LedgerEntry.AccountRootFlags;
|
|
51
|
+
globalFreeze: LedgerEntry.AccountRootFlags;
|
|
52
|
+
defaultRipple: LedgerEntry.AccountRootFlags;
|
|
53
|
+
disallowIncomingNFTokenOffer: LedgerEntry.AccountRootFlags;
|
|
54
|
+
disallowIncomingCheck: LedgerEntry.AccountRootFlags;
|
|
55
|
+
disallowIncomingPayChan: LedgerEntry.AccountRootFlags;
|
|
56
|
+
disallowIncomingTrustline: LedgerEntry.AccountRootFlags;
|
|
57
|
+
};
|
|
58
|
+
export declare function getAccountRootFlagsKeys(): Record<string, number>;
|
|
59
|
+
export interface AccountRootFlagsKeysInterface {
|
|
60
|
+
passwordSpent?: boolean;
|
|
61
|
+
requireDestTag?: boolean;
|
|
62
|
+
requireAuth?: boolean;
|
|
63
|
+
depositAuth?: boolean;
|
|
64
|
+
disallowXRP?: boolean;
|
|
65
|
+
disableMaster?: boolean;
|
|
66
|
+
noFreeze?: boolean;
|
|
67
|
+
globalFreeze?: boolean;
|
|
68
|
+
defaultRipple?: boolean;
|
|
69
|
+
disallowIncomingNFTokenOffer?: boolean;
|
|
70
|
+
disallowIncomingCheck?: boolean;
|
|
71
|
+
disallowIncomingPayChan?: boolean;
|
|
72
|
+
disallowIncomingTrustline?: boolean;
|
|
73
|
+
enableTransactionIDTracking?: boolean;
|
|
74
|
+
allowTrustLineClawback?: boolean;
|
|
75
|
+
allowTrustLineLocking?: boolean;
|
|
76
|
+
tshCollect?: boolean;
|
|
77
|
+
uriTokenIssuer?: boolean;
|
|
78
|
+
disallowIncomingRemit?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export declare enum XahauAccountSetAsfFlags {
|
|
81
|
+
asfTshCollect = 11,
|
|
82
|
+
asfDisallowIncomingRemit = 16
|
|
83
|
+
}
|
|
84
|
+
export declare const AccountSetFlags: {
|
|
85
|
+
requireDestinationTag: AccountSetAsfFlags;
|
|
86
|
+
requireAuthorization: AccountSetAsfFlags;
|
|
87
|
+
depositAuth: AccountSetAsfFlags;
|
|
88
|
+
disallowIncomingXRP: AccountSetAsfFlags;
|
|
89
|
+
disableMasterKey: AccountSetAsfFlags;
|
|
90
|
+
enableTransactionIDTracking: AccountSetAsfFlags;
|
|
91
|
+
noFreeze: AccountSetAsfFlags;
|
|
92
|
+
globalFreeze: AccountSetAsfFlags;
|
|
93
|
+
defaultRipple: AccountSetAsfFlags;
|
|
94
|
+
authorizedMinter: AccountSetAsfFlags;
|
|
95
|
+
disallowIncomingNFTokenOffer: AccountSetAsfFlags;
|
|
96
|
+
disallowIncomingCheck: AccountSetAsfFlags;
|
|
97
|
+
disallowIncomingPayChan: AccountSetAsfFlags;
|
|
98
|
+
disallowIncomingTrustline: AccountSetAsfFlags;
|
|
99
|
+
allowTrustLineClawback: AccountSetAsfFlags;
|
|
100
|
+
allowTrustLineLocking: AccountSetAsfFlags;
|
|
101
|
+
tshCollect: XahauAccountSetAsfFlags;
|
|
102
|
+
disallowIncomingRemit: XahauAccountSetAsfFlags;
|
|
103
|
+
};
|
|
104
|
+
export declare const SignerListFlagsKeys: {
|
|
105
|
+
oneOwnerCount: LedgerEntry.SignerListFlags;
|
|
106
|
+
};
|
|
107
|
+
export interface SignerListFlagsKeysInterface {
|
|
108
|
+
oneOwnerCount?: boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface AccountFieldParametersInterface {
|
|
111
|
+
name: string;
|
|
112
|
+
encoding?: string;
|
|
113
|
+
length?: number;
|
|
114
|
+
defaults?: any;
|
|
115
|
+
shift?: number;
|
|
116
|
+
}
|
|
117
|
+
export declare const AccountFields: {
|
|
118
|
+
EmailHash: {
|
|
119
|
+
name: string;
|
|
120
|
+
encoding: string;
|
|
121
|
+
length: number;
|
|
122
|
+
defaults: string;
|
|
123
|
+
};
|
|
124
|
+
MessageKey: {
|
|
125
|
+
name: string;
|
|
126
|
+
};
|
|
127
|
+
Domain: {
|
|
128
|
+
name: string;
|
|
129
|
+
encoding: string;
|
|
130
|
+
};
|
|
131
|
+
TransferRate: {
|
|
132
|
+
name: string;
|
|
133
|
+
defaults: number;
|
|
134
|
+
shift: number;
|
|
135
|
+
};
|
|
136
|
+
TickSize: {
|
|
137
|
+
name: string;
|
|
138
|
+
defaults: number;
|
|
139
|
+
};
|
|
140
|
+
RegularKey: {
|
|
141
|
+
name: string;
|
|
142
|
+
};
|
|
143
|
+
NFTokenMinter: {
|
|
144
|
+
name: string;
|
|
145
|
+
};
|
|
146
|
+
WalletLocator: {
|
|
147
|
+
name: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
export interface AccountInfoResponse extends AccountSignerListResponse {
|
|
151
|
+
account_data: AccountInfoDataResponse;
|
|
152
|
+
ledger_current_index?: number;
|
|
153
|
+
ledger_index?: number;
|
|
154
|
+
queue_data?: QueueData;
|
|
155
|
+
validated?: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface AccountSignerListResponse {
|
|
158
|
+
signer_lists?: LedgerEntry.SignerList[];
|
|
159
|
+
}
|
|
160
|
+
export interface AccountInfoDataResponse extends LedgerEntry.AccountRoot, AccountSignerListResponse {
|
|
161
|
+
}
|
|
162
|
+
export interface AccountFieldsInterface {
|
|
163
|
+
blackholed?: boolean;
|
|
164
|
+
emailHash?: string;
|
|
165
|
+
messageKey?: string;
|
|
166
|
+
domain?: string;
|
|
167
|
+
transferRate?: number;
|
|
168
|
+
tickSize?: number;
|
|
169
|
+
regularKey?: string;
|
|
170
|
+
nftokenMinter?: string;
|
|
171
|
+
walletLocator?: string;
|
|
172
|
+
}
|
|
173
|
+
export interface AccountSettingsInterface extends AccountFieldsInterface, AccountRootFlagsKeysInterface {
|
|
174
|
+
}
|
|
175
|
+
export declare function getSettings(accountInfo: AccountInfoDataResponse, excludeFalse?: boolean): AccountSettingsInterface;
|
|
176
|
+
export declare function parseAccountFlags(value: number, options?: {
|
|
177
|
+
excludeFalse?: boolean;
|
|
178
|
+
}): AccountRootFlagsKeysInterface;
|
|
179
|
+
export declare function parseAccountFields(accountInfo: AccountInfoDataResponse, options?: {
|
|
180
|
+
excludeFalse?: boolean;
|
|
181
|
+
}): AccountFieldsInterface;
|
|
182
|
+
export declare function parseSignerListFlags(value: number, options?: {
|
|
183
|
+
excludeFalse?: boolean;
|
|
184
|
+
}): SignerListFlagsKeysInterface;
|
|
@@ -0,0 +1,139 @@
|
|
|
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.AccountFields = exports.SignerListFlagsKeys = exports.AccountSetFlags = exports.XahauAccountSetAsfFlags = exports.XahauAccountRootFlagsKeys = exports.XRPLAccountRootFlagsKeys = exports.AccountRootFlagsKeys = exports.XahauAccountRootFlags = void 0;
|
|
7
|
+
exports.getAccountRootFlagsKeys = getAccountRootFlagsKeys;
|
|
8
|
+
exports.getSettings = getSettings;
|
|
9
|
+
exports.parseAccountFlags = parseAccountFlags;
|
|
10
|
+
exports.parseAccountFields = parseAccountFields;
|
|
11
|
+
exports.parseSignerListFlags = parseSignerListFlags;
|
|
12
|
+
const xrpl_1 = require("xrpl");
|
|
13
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
14
|
+
const common_1 = require("../common");
|
|
15
|
+
const flags_1 = require("../parse/ledger/flags");
|
|
16
|
+
const client_1 = require("../client");
|
|
17
|
+
var XahauAccountRootFlags;
|
|
18
|
+
(function (XahauAccountRootFlags) {
|
|
19
|
+
XahauAccountRootFlags[XahauAccountRootFlags["lsfTshCollect"] = 33554432] = "lsfTshCollect";
|
|
20
|
+
XahauAccountRootFlags[XahauAccountRootFlags["lsfURITokenIssuer"] = 1073741824] = "lsfURITokenIssuer";
|
|
21
|
+
XahauAccountRootFlags[XahauAccountRootFlags["lsfDisallowIncomingRemit"] = 2147483648] = "lsfDisallowIncomingRemit";
|
|
22
|
+
})(XahauAccountRootFlags || (exports.XahauAccountRootFlags = XahauAccountRootFlags = {}));
|
|
23
|
+
exports.AccountRootFlagsKeys = {
|
|
24
|
+
passwordSpent: xrpl_1.LedgerEntry.AccountRootFlags.lsfPasswordSpent,
|
|
25
|
+
requireDestTag: xrpl_1.LedgerEntry.AccountRootFlags.lsfRequireDestTag,
|
|
26
|
+
requireAuth: xrpl_1.LedgerEntry.AccountRootFlags.lsfRequireAuth,
|
|
27
|
+
depositAuth: xrpl_1.LedgerEntry.AccountRootFlags.lsfDepositAuth,
|
|
28
|
+
disallowXRP: xrpl_1.LedgerEntry.AccountRootFlags.lsfDisallowXRP,
|
|
29
|
+
disableMaster: xrpl_1.LedgerEntry.AccountRootFlags.lsfDisableMaster,
|
|
30
|
+
noFreeze: xrpl_1.LedgerEntry.AccountRootFlags.lsfNoFreeze,
|
|
31
|
+
globalFreeze: xrpl_1.LedgerEntry.AccountRootFlags.lsfGlobalFreeze,
|
|
32
|
+
defaultRipple: xrpl_1.LedgerEntry.AccountRootFlags.lsfDefaultRipple,
|
|
33
|
+
disallowIncomingNFTokenOffer: xrpl_1.LedgerEntry.AccountRootFlags.lsfDisallowIncomingNFTokenOffer,
|
|
34
|
+
disallowIncomingCheck: xrpl_1.LedgerEntry.AccountRootFlags.lsfDisallowIncomingCheck,
|
|
35
|
+
disallowIncomingPayChan: xrpl_1.LedgerEntry.AccountRootFlags.lsfDisallowIncomingPayChan,
|
|
36
|
+
disallowIncomingTrustline: xrpl_1.LedgerEntry.AccountRootFlags.lsfDisallowIncomingTrustline,
|
|
37
|
+
};
|
|
38
|
+
exports.XRPLAccountRootFlagsKeys = {
|
|
39
|
+
...exports.AccountRootFlagsKeys,
|
|
40
|
+
allowTrustLineClawback: xrpl_1.LedgerEntry.AccountRootFlags.lsfAllowTrustLineClawback,
|
|
41
|
+
allowTrustLineLocking: xrpl_1.LedgerEntry.AccountRootFlags.lsfAllowTrustLineLocking,
|
|
42
|
+
};
|
|
43
|
+
exports.XahauAccountRootFlagsKeys = {
|
|
44
|
+
...exports.AccountRootFlagsKeys,
|
|
45
|
+
tshCollect: XahauAccountRootFlags.lsfTshCollect,
|
|
46
|
+
uriTokenIssuer: XahauAccountRootFlags.lsfURITokenIssuer,
|
|
47
|
+
disallowIncomingRemit: XahauAccountRootFlags.lsfDisallowIncomingRemit,
|
|
48
|
+
};
|
|
49
|
+
function getAccountRootFlagsKeys() {
|
|
50
|
+
const nativeCurrency = (0, client_1.getNativeCurrency)();
|
|
51
|
+
if (nativeCurrency === common_1.XAHAU_NATIVE_CURRENCY) {
|
|
52
|
+
return exports.XahauAccountRootFlagsKeys;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return exports.XRPLAccountRootFlagsKeys;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
var XahauAccountSetAsfFlags;
|
|
59
|
+
(function (XahauAccountSetAsfFlags) {
|
|
60
|
+
XahauAccountSetAsfFlags[XahauAccountSetAsfFlags["asfTshCollect"] = 11] = "asfTshCollect";
|
|
61
|
+
XahauAccountSetAsfFlags[XahauAccountSetAsfFlags["asfDisallowIncomingRemit"] = 16] = "asfDisallowIncomingRemit";
|
|
62
|
+
})(XahauAccountSetAsfFlags || (exports.XahauAccountSetAsfFlags = XahauAccountSetAsfFlags = {}));
|
|
63
|
+
exports.AccountSetFlags = {
|
|
64
|
+
requireDestinationTag: xrpl_1.AccountSetAsfFlags.asfRequireDest,
|
|
65
|
+
requireAuthorization: xrpl_1.AccountSetAsfFlags.asfRequireAuth,
|
|
66
|
+
depositAuth: xrpl_1.AccountSetAsfFlags.asfDepositAuth,
|
|
67
|
+
disallowIncomingXRP: xrpl_1.AccountSetAsfFlags.asfDisallowXRP,
|
|
68
|
+
disableMasterKey: xrpl_1.AccountSetAsfFlags.asfDisableMaster,
|
|
69
|
+
enableTransactionIDTracking: xrpl_1.AccountSetAsfFlags.asfAccountTxnID,
|
|
70
|
+
noFreeze: xrpl_1.AccountSetAsfFlags.asfNoFreeze,
|
|
71
|
+
globalFreeze: xrpl_1.AccountSetAsfFlags.asfGlobalFreeze,
|
|
72
|
+
defaultRipple: xrpl_1.AccountSetAsfFlags.asfDefaultRipple,
|
|
73
|
+
authorizedMinter: xrpl_1.AccountSetAsfFlags.asfAuthorizedNFTokenMinter,
|
|
74
|
+
disallowIncomingNFTokenOffer: xrpl_1.AccountSetAsfFlags.asfDisallowIncomingNFTokenOffer,
|
|
75
|
+
disallowIncomingCheck: xrpl_1.AccountSetAsfFlags.asfDisallowIncomingCheck,
|
|
76
|
+
disallowIncomingPayChan: xrpl_1.AccountSetAsfFlags.asfDisallowIncomingPayChan,
|
|
77
|
+
disallowIncomingTrustline: xrpl_1.AccountSetAsfFlags.asfDisallowIncomingTrustline,
|
|
78
|
+
allowTrustLineClawback: xrpl_1.AccountSetAsfFlags.asfAllowTrustLineClawback,
|
|
79
|
+
allowTrustLineLocking: xrpl_1.AccountSetAsfFlags.asfAllowTrustLineLocking,
|
|
80
|
+
tshCollect: XahauAccountSetAsfFlags.asfTshCollect,
|
|
81
|
+
disallowIncomingRemit: XahauAccountSetAsfFlags.asfDisallowIncomingRemit,
|
|
82
|
+
};
|
|
83
|
+
exports.SignerListFlagsKeys = {
|
|
84
|
+
oneOwnerCount: xrpl_1.LedgerEntry.SignerListFlags.lsfOneOwnerCount,
|
|
85
|
+
};
|
|
86
|
+
exports.AccountFields = {
|
|
87
|
+
EmailHash: { name: "emailHash", encoding: "hex", length: 32, defaults: "00000000000000000000000000000000" },
|
|
88
|
+
MessageKey: { name: "messageKey" },
|
|
89
|
+
Domain: { name: "domain", encoding: "hex" },
|
|
90
|
+
TransferRate: { name: "transferRate", defaults: 0, shift: 9 },
|
|
91
|
+
TickSize: { name: "tickSize", defaults: 0 },
|
|
92
|
+
RegularKey: { name: "regularKey" },
|
|
93
|
+
NFTokenMinter: { name: "nftokenMinter" },
|
|
94
|
+
WalletLocator: { name: "walletLocator" },
|
|
95
|
+
};
|
|
96
|
+
function getSettings(accountInfo, excludeFalse = true) {
|
|
97
|
+
const parsedFlags = parseAccountFlags(accountInfo.Flags, { excludeFalse });
|
|
98
|
+
const parsedFields = parseAccountFields(accountInfo, { excludeFalse });
|
|
99
|
+
return {
|
|
100
|
+
...parsedFlags,
|
|
101
|
+
...parsedFields,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function parseAccountFlags(value, options = {}) {
|
|
105
|
+
return (0, flags_1.parseFlags)(value, getAccountRootFlagsKeys(), options);
|
|
106
|
+
}
|
|
107
|
+
function parseAccountFields(accountInfo, options = {}) {
|
|
108
|
+
const settings = {};
|
|
109
|
+
if (accountInfo.hasOwnProperty("signer_lists")) {
|
|
110
|
+
if (accountInfo.Flags & exports.AccountRootFlagsKeys.disableMaster &&
|
|
111
|
+
common_1.BLACKHOLE_ACCOUNTS.includes(accountInfo.RegularKey) &&
|
|
112
|
+
accountInfo.signer_lists?.length === 0) {
|
|
113
|
+
settings.blackholed = true;
|
|
114
|
+
}
|
|
115
|
+
else if (!options.excludeFalse) {
|
|
116
|
+
settings.blackholed = false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
for (const fieldName in exports.AccountFields) {
|
|
120
|
+
const fieldValue = accountInfo[fieldName];
|
|
121
|
+
if (fieldValue != null) {
|
|
122
|
+
const info = exports.AccountFields[fieldName];
|
|
123
|
+
settings[info.name] = parseField(info, fieldValue);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function parseField(info, value) {
|
|
127
|
+
if (info.encoding === "hex" && !info.length) {
|
|
128
|
+
return Buffer.from(value, "hex").toString("ascii");
|
|
129
|
+
}
|
|
130
|
+
if (info.shift) {
|
|
131
|
+
return new bignumber_js_1.default(value).shiftedBy(-info.shift).toNumber();
|
|
132
|
+
}
|
|
133
|
+
return value;
|
|
134
|
+
}
|
|
135
|
+
return settings;
|
|
136
|
+
}
|
|
137
|
+
function parseSignerListFlags(value, options = {}) {
|
|
138
|
+
return (0, flags_1.parseFlags)(value, exports.SignerListFlagsKeys, options);
|
|
139
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface Trustline {
|
|
2
|
+
account: string;
|
|
3
|
+
balance: string;
|
|
4
|
+
currency: string;
|
|
5
|
+
limit: string;
|
|
6
|
+
limit_peer: string;
|
|
7
|
+
lock_count?: number;
|
|
8
|
+
locked_balance?: string;
|
|
9
|
+
quality_in: number;
|
|
10
|
+
quality_out: number;
|
|
11
|
+
no_ripple?: boolean;
|
|
12
|
+
no_ripple_peer?: boolean;
|
|
13
|
+
authorized?: boolean;
|
|
14
|
+
peer_authorized?: boolean;
|
|
15
|
+
freeze?: boolean;
|
|
16
|
+
freeze_peer?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AccountLinesResponse {
|
|
19
|
+
account: string;
|
|
20
|
+
lines: Trustline[];
|
|
21
|
+
ledger_current_index?: number;
|
|
22
|
+
ledger_index?: number;
|
|
23
|
+
ledger_hash?: string;
|
|
24
|
+
marker?: unknown;
|
|
25
|
+
validated?: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface HookNamespaceEntry {
|
|
2
|
+
Flags: number;
|
|
3
|
+
LedgerEntryType: string;
|
|
4
|
+
HookStateData: string;
|
|
5
|
+
HookStateKey: string;
|
|
6
|
+
OwnerNode: string;
|
|
7
|
+
index: string;
|
|
8
|
+
}
|
|
9
|
+
export interface HookNamespaceResponse {
|
|
10
|
+
account: string;
|
|
11
|
+
namespace_entries: HookNamespaceEntry[];
|
|
12
|
+
ledger_current_index?: number;
|
|
13
|
+
ledger_index?: number;
|
|
14
|
+
namespace_id?: string;
|
|
15
|
+
validated?: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SortDirection } from "../common";
|
|
2
|
+
export interface NFTokenInterface {
|
|
3
|
+
Flags: number;
|
|
4
|
+
Issuer: string;
|
|
5
|
+
NFTokenID: string;
|
|
6
|
+
NFTokenTaxon: number;
|
|
7
|
+
TransferFee: number;
|
|
8
|
+
Sequence: number;
|
|
9
|
+
}
|
|
10
|
+
export interface AccountNFTokenInterface {
|
|
11
|
+
Flags: number;
|
|
12
|
+
Issuer: string;
|
|
13
|
+
NFTokenID: string;
|
|
14
|
+
TokenTaxons: number;
|
|
15
|
+
nft_serial: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function sortHelperAccountNFToken(a: AccountNFTokenInterface, b: AccountNFTokenInterface): SortDirection;
|
|
18
|
+
export declare function cipheredTaxon(tokenSeq: number, taxon: number): number;
|
|
19
|
+
export declare function parseNFTokenID(nftokenID: string): NFTokenInterface | null;
|
|
20
|
+
export declare function buildNFTokenID(flags: number, transferFee: number, issuer: string, taxon: number, sequence: number): string;
|
|
@@ -0,0 +1,92 @@
|
|
|
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.sortHelperAccountNFToken = sortHelperAccountNFToken;
|
|
40
|
+
exports.cipheredTaxon = cipheredTaxon;
|
|
41
|
+
exports.parseNFTokenID = parseNFTokenID;
|
|
42
|
+
exports.buildNFTokenID = buildNFTokenID;
|
|
43
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
44
|
+
const AddressCodec = __importStar(require("ripple-address-codec"));
|
|
45
|
+
const utils_1 = require("../parse/utils");
|
|
46
|
+
function sortHelperAccountNFToken(a, b) {
|
|
47
|
+
const cmpIssuer = a.Issuer.localeCompare(b.Issuer);
|
|
48
|
+
if (cmpIssuer !== 0) {
|
|
49
|
+
return cmpIssuer;
|
|
50
|
+
}
|
|
51
|
+
if (a.nft_serial < b.nft_serial) {
|
|
52
|
+
return -1;
|
|
53
|
+
}
|
|
54
|
+
if (a.nft_serial > b.nft_serial) {
|
|
55
|
+
return 1;
|
|
56
|
+
}
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
function cipheredTaxon(tokenSeq, taxon) {
|
|
60
|
+
const m = 384160001n;
|
|
61
|
+
const c = 2459n;
|
|
62
|
+
const max = 4294967296n;
|
|
63
|
+
const p1 = (m * BigInt(tokenSeq)) % max;
|
|
64
|
+
const p2 = (p1 + c) % max;
|
|
65
|
+
return (taxon ^ Number(p2)) >>> 0;
|
|
66
|
+
}
|
|
67
|
+
function parseNFTokenID(nftokenID) {
|
|
68
|
+
if (typeof nftokenID !== "string" || nftokenID.length !== 64) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const flags = new bignumber_js_1.default(nftokenID.slice(0, 4), 16).toNumber();
|
|
72
|
+
const transferFee = new bignumber_js_1.default(nftokenID.slice(4, 8), 16).toNumber();
|
|
73
|
+
const issuer = AddressCodec.encodeAccountID(Buffer.from(nftokenID.slice(8, 48), "hex"));
|
|
74
|
+
const scrambledTaxon = new bignumber_js_1.default(nftokenID.slice(48, 56), 16).toNumber();
|
|
75
|
+
const sequence = new bignumber_js_1.default(nftokenID.slice(56, 64), 16).toNumber();
|
|
76
|
+
return {
|
|
77
|
+
NFTokenID: nftokenID,
|
|
78
|
+
Flags: flags,
|
|
79
|
+
TransferFee: transferFee,
|
|
80
|
+
Issuer: issuer,
|
|
81
|
+
NFTokenTaxon: cipheredTaxon(sequence, scrambledTaxon),
|
|
82
|
+
Sequence: sequence,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function buildNFTokenID(flags, transferFee, issuer, taxon, sequence) {
|
|
86
|
+
const scrambledTaxon = cipheredTaxon(sequence, taxon);
|
|
87
|
+
return (new bignumber_js_1.default(flags).toString(16).padStart(4, "0").toUpperCase() +
|
|
88
|
+
new bignumber_js_1.default(transferFee).toString(16).padStart(4, "0").toUpperCase() +
|
|
89
|
+
(0, utils_1.bytesToHex)(AddressCodec.decodeAccountID(issuer).buffer) +
|
|
90
|
+
new bignumber_js_1.default(scrambledTaxon).toString(16).padStart(8, "0").toUpperCase() +
|
|
91
|
+
new bignumber_js_1.default(sequence).toString(16).padStart(8, "0").toUpperCase());
|
|
92
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { LedgerEntry } from "xrpl";
|
|
2
|
+
import { Trustline } from "./account_lines";
|
|
3
|
+
import { Amount } from "../types";
|
|
4
|
+
export type AccountObject = LedgerEntry.Check | LedgerEntry.DepositPreauth | LedgerEntry.Escrow | LedgerEntry.Offer | LedgerEntry.PayChannel | LedgerEntry.SignerList | LedgerEntry.Ticket | LedgerEntry.RippleState;
|
|
5
|
+
export type AccountObjectType = Exclude<LedgerEntry.LedgerEntryFilter, "amendments" | "fee" | "hashes"> | "uri_token";
|
|
6
|
+
export interface AccountObjects {
|
|
7
|
+
account: string;
|
|
8
|
+
account_objects: AccountObject[];
|
|
9
|
+
ledger_hash?: string;
|
|
10
|
+
ledger_index?: number;
|
|
11
|
+
ledger_current_index?: number;
|
|
12
|
+
limit?: number;
|
|
13
|
+
marker?: string;
|
|
14
|
+
validated?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface AccountNFTObjectsResponse {
|
|
17
|
+
account: string;
|
|
18
|
+
nft_offers: AccountNFTOffersInterface[];
|
|
19
|
+
ledger_hash?: string;
|
|
20
|
+
ledger_index?: number;
|
|
21
|
+
ledger_current_index?: number;
|
|
22
|
+
limit?: number;
|
|
23
|
+
marker?: string;
|
|
24
|
+
validated?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface AccountNFTOffersInterface {
|
|
27
|
+
nft_id: string;
|
|
28
|
+
amount: Amount;
|
|
29
|
+
flags: number;
|
|
30
|
+
index: string;
|
|
31
|
+
owner: string;
|
|
32
|
+
destination?: string;
|
|
33
|
+
expiration?: number;
|
|
34
|
+
ledger_index: number;
|
|
35
|
+
transaction_hash: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AccountURITokensInterface {
|
|
38
|
+
flags: number;
|
|
39
|
+
index: string;
|
|
40
|
+
owner: string;
|
|
41
|
+
issuer: string;
|
|
42
|
+
uri: number;
|
|
43
|
+
digest?: string;
|
|
44
|
+
amount?: Amount;
|
|
45
|
+
destination?: string;
|
|
46
|
+
ledger_index: number;
|
|
47
|
+
transaction_hash: string;
|
|
48
|
+
}
|
|
49
|
+
export interface AccountURITokensObjectsResponse {
|
|
50
|
+
account: string;
|
|
51
|
+
uritokens: AccountURITokensInterface[];
|
|
52
|
+
ledger_hash?: string;
|
|
53
|
+
ledger_index?: number;
|
|
54
|
+
ledger_current_index?: number;
|
|
55
|
+
limit?: number;
|
|
56
|
+
marker?: string;
|
|
57
|
+
validated?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare function accountObjectsToAccountLines(account: string, accountObjects: AccountObject[]): Trustline[];
|
|
60
|
+
export declare function accountObjectsToNFTOffers(accountObjects: AccountObject[]): AccountNFTOffersInterface[];
|
|
61
|
+
export declare function accountObjectsToURITokens(accountObjects: AccountObject[]): AccountURITokensInterface[];
|