@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,199 @@
|
|
|
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.getAccountNfts = getAccountNfts;
|
|
37
|
+
exports.findAccountNfts = findAccountNfts;
|
|
38
|
+
exports.getAccountNftSellOffers = getAccountNftSellOffers;
|
|
39
|
+
exports.getAccountNftBuyOffers = getAccountNftBuyOffers;
|
|
40
|
+
const Client = __importStar(require("../client"));
|
|
41
|
+
const account_nfts_1 = require("../models/account_nfts");
|
|
42
|
+
const utils_1 = require("../common/utils");
|
|
43
|
+
const common_1 = require("../common");
|
|
44
|
+
async function getAccountNfts(account, options = {}) {
|
|
45
|
+
const { hash, marker } = (0, utils_1.parseMarker)(options.marker);
|
|
46
|
+
options.marker = marker;
|
|
47
|
+
const connection = Client.findConnection(undefined, undefined, undefined, hash);
|
|
48
|
+
if (!connection) {
|
|
49
|
+
throw new Error("There is no connection");
|
|
50
|
+
}
|
|
51
|
+
const response = await connection.request({
|
|
52
|
+
command: "account_nfts",
|
|
53
|
+
account,
|
|
54
|
+
ledger_index: options.ledgerIndex || "validated",
|
|
55
|
+
marker: options.marker,
|
|
56
|
+
});
|
|
57
|
+
if (!response) {
|
|
58
|
+
return {
|
|
59
|
+
account,
|
|
60
|
+
status: "error",
|
|
61
|
+
error: "invalidResponse",
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (response.error) {
|
|
65
|
+
const { error, error_code, error_message, error_exception, status, validated } = response;
|
|
66
|
+
return (0, common_1.removeUndefined)({
|
|
67
|
+
account,
|
|
68
|
+
error,
|
|
69
|
+
error_code,
|
|
70
|
+
error_message,
|
|
71
|
+
error_exception,
|
|
72
|
+
status,
|
|
73
|
+
validated,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const result = response?.result;
|
|
77
|
+
if (!result) {
|
|
78
|
+
return {
|
|
79
|
+
account,
|
|
80
|
+
status: "error",
|
|
81
|
+
error: "invalidResponse",
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (Array.isArray(result.account_nfts)) {
|
|
85
|
+
result.account_nfts = result.account_nfts.sort(account_nfts_1.sortHelperAccountNFToken);
|
|
86
|
+
}
|
|
87
|
+
const newMarker = (0, utils_1.createMarker)(connection.hash, result.marker);
|
|
88
|
+
if (newMarker) {
|
|
89
|
+
result.marker = newMarker;
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
async function findAccountNfts(account, options = { timeout: 15000 }) {
|
|
94
|
+
const timeStart = new Date();
|
|
95
|
+
const limit = options.limit;
|
|
96
|
+
let response;
|
|
97
|
+
const accountNfts = [];
|
|
98
|
+
while (true) {
|
|
99
|
+
const currentTime = new Date();
|
|
100
|
+
if (options.timeout && currentTime.getTime() - timeStart.getTime() > options.timeout) {
|
|
101
|
+
options.timeout = currentTime.getTime() - timeStart.getTime();
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (options.limit && limit) {
|
|
105
|
+
options.limit = limit - accountNfts.length;
|
|
106
|
+
}
|
|
107
|
+
response = await getAccountNfts(account, options);
|
|
108
|
+
if (!response || response.error) {
|
|
109
|
+
return response;
|
|
110
|
+
}
|
|
111
|
+
accountNfts.push(...response.account_nfts);
|
|
112
|
+
if (limit && accountNfts.length >= limit) {
|
|
113
|
+
response.limit = accountNfts.length;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
if (response.marker) {
|
|
117
|
+
options.marker = response.marker;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (response.error) {
|
|
124
|
+
const { error, error_code, error_message, error_exception, status, validated } = response;
|
|
125
|
+
return (0, common_1.removeUndefined)({
|
|
126
|
+
account,
|
|
127
|
+
error,
|
|
128
|
+
error_code,
|
|
129
|
+
error_message,
|
|
130
|
+
error_exception,
|
|
131
|
+
status,
|
|
132
|
+
validated,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
response.account_nfts = accountNfts;
|
|
136
|
+
return response;
|
|
137
|
+
}
|
|
138
|
+
async function getAccountNftSellOffers(nftID, options = {}) {
|
|
139
|
+
const connection = Client.findConnection("!clio");
|
|
140
|
+
if (!connection) {
|
|
141
|
+
throw new Error("There is no connection");
|
|
142
|
+
}
|
|
143
|
+
const response = await connection.request({
|
|
144
|
+
command: "nft_sell_offers",
|
|
145
|
+
nft_id: nftID,
|
|
146
|
+
ledger_index: options.ledgerIndex || "validated",
|
|
147
|
+
});
|
|
148
|
+
if (!response) {
|
|
149
|
+
return {
|
|
150
|
+
nft_id: nftID,
|
|
151
|
+
status: "error",
|
|
152
|
+
error: "invalidResponse",
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (response.error) {
|
|
156
|
+
const { error, error_code, error_message, error_exception, status, validated } = response;
|
|
157
|
+
return (0, common_1.removeUndefined)({
|
|
158
|
+
nft_id: nftID,
|
|
159
|
+
error,
|
|
160
|
+
error_code,
|
|
161
|
+
error_message,
|
|
162
|
+
error_exception,
|
|
163
|
+
status,
|
|
164
|
+
validated,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return response?.result;
|
|
168
|
+
}
|
|
169
|
+
async function getAccountNftBuyOffers(nftID, options = {}) {
|
|
170
|
+
const connection = Client.findConnection("!clio");
|
|
171
|
+
if (!connection) {
|
|
172
|
+
throw new Error("There is no connection");
|
|
173
|
+
}
|
|
174
|
+
const response = await connection.request({
|
|
175
|
+
command: "nft_buy_offers",
|
|
176
|
+
nft_id: nftID,
|
|
177
|
+
ledger_index: options.ledgerIndex || "validated",
|
|
178
|
+
});
|
|
179
|
+
if (!response) {
|
|
180
|
+
return {
|
|
181
|
+
nft_id: nftID,
|
|
182
|
+
status: "error",
|
|
183
|
+
error: "invalidResponse",
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if (response.error) {
|
|
187
|
+
const { error, error_code, error_message, error_exception, status, validated } = response;
|
|
188
|
+
return (0, common_1.removeUndefined)({
|
|
189
|
+
nft_id: nftID,
|
|
190
|
+
error,
|
|
191
|
+
error_code,
|
|
192
|
+
error_message,
|
|
193
|
+
error_exception,
|
|
194
|
+
status,
|
|
195
|
+
validated,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return response?.result;
|
|
199
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Connection } from "../connection";
|
|
2
|
+
import { AccountObjectType, AccountObjects, AccountNFTObjectsResponse, AccountURITokensObjectsResponse } from "../models/account_object";
|
|
3
|
+
import { AccountLinesResponse } from "../models/account_lines";
|
|
4
|
+
import { ErrorResponse } from "../models/base_model";
|
|
5
|
+
import { LedgerIndex } from "../models/ledger";
|
|
6
|
+
export interface GetAccountObjectsOptions {
|
|
7
|
+
type?: AccountObjectType;
|
|
8
|
+
ledgerHash?: string;
|
|
9
|
+
ledgerIndex?: LedgerIndex;
|
|
10
|
+
limit?: number;
|
|
11
|
+
marker?: string;
|
|
12
|
+
connection?: Connection;
|
|
13
|
+
}
|
|
14
|
+
export declare function getAccountObjects(account: string, options?: GetAccountObjectsOptions): Promise<AccountObjects | ErrorResponse>;
|
|
15
|
+
export interface GetAccountAllObjectsOptions extends GetAccountObjectsOptions {
|
|
16
|
+
timeout?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function getAccountAllObjects(account: string, options?: GetAccountAllObjectsOptions): Promise<AccountObjects | ErrorResponse>;
|
|
19
|
+
export interface GetAccountLinesObjectsOptions {
|
|
20
|
+
ledgerHash?: string;
|
|
21
|
+
ledgerIndex?: LedgerIndex;
|
|
22
|
+
}
|
|
23
|
+
export declare function getAccountLinesObjects(account: string, options?: GetAccountLinesObjectsOptions): Promise<AccountLinesResponse | ErrorResponse>;
|
|
24
|
+
export interface GetAccountNFTOffersObjectsOptions {
|
|
25
|
+
ledgerHash?: string;
|
|
26
|
+
ledgerIndex?: LedgerIndex;
|
|
27
|
+
limit?: number;
|
|
28
|
+
marker?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function getAccountNFTOffersObjects(account: string, options?: GetAccountNFTOffersObjectsOptions): Promise<AccountNFTObjectsResponse | ErrorResponse>;
|
|
31
|
+
export interface GetAccountDepositPreauthObjectsOptions {
|
|
32
|
+
ledgerHash?: string;
|
|
33
|
+
ledgerIndex?: LedgerIndex;
|
|
34
|
+
limit?: number;
|
|
35
|
+
marker?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function getAccountDepositPreauthObjects(account: string, options?: GetAccountDepositPreauthObjectsOptions): Promise<any | ErrorResponse>;
|
|
38
|
+
export interface GetAccountURITokensObjectsOptions {
|
|
39
|
+
ledgerHash?: string;
|
|
40
|
+
ledgerIndex?: LedgerIndex;
|
|
41
|
+
limit?: number;
|
|
42
|
+
marker?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare function getAccountURITokensObjects(account: string, options?: GetAccountURITokensObjectsOptions): Promise<AccountURITokensObjectsResponse | ErrorResponse>;
|
|
@@ -0,0 +1,222 @@
|
|
|
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.getAccountObjects = getAccountObjects;
|
|
37
|
+
exports.getAccountAllObjects = getAccountAllObjects;
|
|
38
|
+
exports.getAccountLinesObjects = getAccountLinesObjects;
|
|
39
|
+
exports.getAccountNFTOffersObjects = getAccountNFTOffersObjects;
|
|
40
|
+
exports.getAccountDepositPreauthObjects = getAccountDepositPreauthObjects;
|
|
41
|
+
exports.getAccountURITokensObjects = getAccountURITokensObjects;
|
|
42
|
+
const Client = __importStar(require("../client"));
|
|
43
|
+
const account_object_1 = require("../models/account_object");
|
|
44
|
+
const utils_1 = require("../common/utils");
|
|
45
|
+
const OBJECTS_LIMIT_DEFAULT = 200;
|
|
46
|
+
const OBJECTS_LIMIT_MAX = 400;
|
|
47
|
+
const OBJECTS_LIMIT_MIN = 10;
|
|
48
|
+
async function getAccountObjects(account, options = {}) {
|
|
49
|
+
const { hash, marker } = (0, utils_1.parseMarker)(options.marker);
|
|
50
|
+
options.marker = marker;
|
|
51
|
+
const connection = options.connection || Client.findConnection("account_objects", undefined, undefined, hash);
|
|
52
|
+
if (!connection) {
|
|
53
|
+
throw new Error("There is no connection");
|
|
54
|
+
}
|
|
55
|
+
const request = {
|
|
56
|
+
command: "account_objects",
|
|
57
|
+
account,
|
|
58
|
+
type: options.type,
|
|
59
|
+
ledger_hash: options.ledgerHash,
|
|
60
|
+
ledger_index: options.ledgerIndex || "validated",
|
|
61
|
+
limit: options.limit || OBJECTS_LIMIT_DEFAULT,
|
|
62
|
+
marker: options.marker,
|
|
63
|
+
};
|
|
64
|
+
const response = await connection.request(request);
|
|
65
|
+
if (!response) {
|
|
66
|
+
return {
|
|
67
|
+
account,
|
|
68
|
+
status: "error",
|
|
69
|
+
error: "invalidResponse",
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (response.error) {
|
|
73
|
+
const { error, error_code, error_message, error_exception, status, validated } = response;
|
|
74
|
+
return (0, utils_1.removeUndefined)({
|
|
75
|
+
account,
|
|
76
|
+
error,
|
|
77
|
+
error_code,
|
|
78
|
+
error_message,
|
|
79
|
+
error_exception,
|
|
80
|
+
status,
|
|
81
|
+
validated,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const result = response.result;
|
|
85
|
+
const newMarker = (0, utils_1.createMarker)(connection.hash, result.marker);
|
|
86
|
+
if (newMarker) {
|
|
87
|
+
result.marker = newMarker;
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
async function getAccountAllObjects(account, options = {}) {
|
|
92
|
+
const loadOptions = { ...options };
|
|
93
|
+
loadOptions.connection =
|
|
94
|
+
loadOptions.connection || Client.findConnection("account_objects", undefined, undefined);
|
|
95
|
+
const timeStart = new Date();
|
|
96
|
+
const limit = loadOptions.limit;
|
|
97
|
+
let response;
|
|
98
|
+
const accountObjects = [];
|
|
99
|
+
while (true) {
|
|
100
|
+
const currentTime = new Date();
|
|
101
|
+
if (loadOptions.timeout && currentTime.getTime() - timeStart.getTime() > loadOptions.timeout) {
|
|
102
|
+
loadOptions.timeout = currentTime.getTime() - timeStart.getTime();
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (loadOptions.limit && limit) {
|
|
106
|
+
const left = limit - accountObjects.length;
|
|
107
|
+
const parts = Math.floor(left / OBJECTS_LIMIT_MAX);
|
|
108
|
+
if (parts === 0) {
|
|
109
|
+
loadOptions.limit = left;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
loadOptions.limit = left - OBJECTS_LIMIT_MIN;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
response = await getAccountObjects(account, loadOptions);
|
|
116
|
+
if (response.error) {
|
|
117
|
+
return response;
|
|
118
|
+
}
|
|
119
|
+
accountObjects.push(...response.account_objects);
|
|
120
|
+
if (limit && accountObjects.length >= limit) {
|
|
121
|
+
response.limit = accountObjects.length;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
if (response.marker) {
|
|
125
|
+
loadOptions.marker = response.marker;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (response.error) {
|
|
132
|
+
const { error, error_code, error_message, error_exception, status, validated } = response;
|
|
133
|
+
return (0, utils_1.removeUndefined)({
|
|
134
|
+
account,
|
|
135
|
+
error,
|
|
136
|
+
error_code,
|
|
137
|
+
error_message,
|
|
138
|
+
error_exception,
|
|
139
|
+
status,
|
|
140
|
+
validated,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
response.account_objects = accountObjects;
|
|
144
|
+
if (!options.hasOwnProperty("limit") || options.limit === undefined) {
|
|
145
|
+
delete response.limit;
|
|
146
|
+
}
|
|
147
|
+
return response;
|
|
148
|
+
}
|
|
149
|
+
async function getAccountLinesObjects(account, options = {}) {
|
|
150
|
+
const response = await getAccountAllObjects(account, {
|
|
151
|
+
type: "state",
|
|
152
|
+
ledgerHash: options.ledgerHash,
|
|
153
|
+
ledgerIndex: options.ledgerIndex,
|
|
154
|
+
});
|
|
155
|
+
if ("error" in response) {
|
|
156
|
+
return response;
|
|
157
|
+
}
|
|
158
|
+
const accountObjects = response.account_objects;
|
|
159
|
+
const accountLines = (0, account_object_1.accountObjectsToAccountLines)(account, accountObjects);
|
|
160
|
+
return {
|
|
161
|
+
account: response.account,
|
|
162
|
+
ledger_hash: response.ledger_hash,
|
|
163
|
+
ledger_index: response.ledger_index,
|
|
164
|
+
validated: response.validated,
|
|
165
|
+
lines: accountLines,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
async function getAccountNFTOffersObjects(account, options = {}) {
|
|
169
|
+
const response = await getAccountAllObjects(account, {
|
|
170
|
+
type: "nft_offer",
|
|
171
|
+
ledgerHash: options.ledgerHash,
|
|
172
|
+
ledgerIndex: options.ledgerIndex,
|
|
173
|
+
limit: options.limit,
|
|
174
|
+
marker: options.marker,
|
|
175
|
+
});
|
|
176
|
+
if ("error" in response) {
|
|
177
|
+
return response;
|
|
178
|
+
}
|
|
179
|
+
const accountObjects = response.account_objects;
|
|
180
|
+
const nftOffers = (0, account_object_1.accountObjectsToNFTOffers)(accountObjects);
|
|
181
|
+
return {
|
|
182
|
+
account: response.account,
|
|
183
|
+
ledger_hash: response.ledger_hash,
|
|
184
|
+
ledger_index: response.ledger_index,
|
|
185
|
+
validated: response.validated,
|
|
186
|
+
nft_offers: nftOffers,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
async function getAccountDepositPreauthObjects(account, options = {}) {
|
|
190
|
+
const response = await getAccountAllObjects(account, {
|
|
191
|
+
type: "deposit_preauth",
|
|
192
|
+
ledgerHash: options.ledgerHash,
|
|
193
|
+
ledgerIndex: options.ledgerIndex,
|
|
194
|
+
limit: options.limit,
|
|
195
|
+
marker: options.marker,
|
|
196
|
+
});
|
|
197
|
+
if ("error" in response) {
|
|
198
|
+
return response;
|
|
199
|
+
}
|
|
200
|
+
return response;
|
|
201
|
+
}
|
|
202
|
+
async function getAccountURITokensObjects(account, options = {}) {
|
|
203
|
+
const response = await getAccountAllObjects(account, {
|
|
204
|
+
type: "uri_token",
|
|
205
|
+
ledgerHash: options.ledgerHash,
|
|
206
|
+
ledgerIndex: options.ledgerIndex,
|
|
207
|
+
limit: options.limit,
|
|
208
|
+
marker: options.marker,
|
|
209
|
+
});
|
|
210
|
+
if ("error" in response) {
|
|
211
|
+
return response;
|
|
212
|
+
}
|
|
213
|
+
const accountObjects = response.account_objects;
|
|
214
|
+
const uritokens = (0, account_object_1.accountObjectsToURITokens)(accountObjects);
|
|
215
|
+
return {
|
|
216
|
+
account: response.account,
|
|
217
|
+
ledger_hash: response.ledger_hash,
|
|
218
|
+
ledger_index: response.ledger_index,
|
|
219
|
+
validated: response.validated,
|
|
220
|
+
uritokens: uritokens,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LedgerIndex } from "../models/ledger";
|
|
2
|
+
import { AccountOffers } from "../models/account_offers";
|
|
3
|
+
import { ErrorResponse } from "../models/base_model";
|
|
4
|
+
import { FormattedAccountOrders } from "../parse/ledger/account-order";
|
|
5
|
+
export interface GetAccountOffers {
|
|
6
|
+
ledgerIndex?: LedgerIndex;
|
|
7
|
+
limit?: number;
|
|
8
|
+
marker?: any;
|
|
9
|
+
legacy?: boolean;
|
|
10
|
+
formatted?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function getAccountOffers(account: string, options?: GetAccountOffers): Promise<AccountOffers | FormattedAccountOrders | ErrorResponse>;
|
|
13
|
+
export declare function getAccountAllOffers(account: string, options?: GetAccountOffers): Promise<AccountOffers | FormattedAccountOrders | ErrorResponse>;
|
|
@@ -0,0 +1,142 @@
|
|
|
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.getAccountOffers = getAccountOffers;
|
|
40
|
+
exports.getAccountAllOffers = getAccountAllOffers;
|
|
41
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
42
|
+
const Client = __importStar(require("../client"));
|
|
43
|
+
const utils_1 = require("../common/utils");
|
|
44
|
+
const account_order_1 = require("../parse/ledger/account-order");
|
|
45
|
+
const common_1 = require("../common");
|
|
46
|
+
const OFFERS_LIMIT_MAX = 400;
|
|
47
|
+
async function getAccountOffers(account, options = {}) {
|
|
48
|
+
const formatted = options.legacy === true || options.formatted === true;
|
|
49
|
+
const { hash, marker } = (0, utils_1.parseMarker)(options.marker);
|
|
50
|
+
options.marker = marker;
|
|
51
|
+
const connection = Client.findConnection(undefined, undefined, undefined, hash);
|
|
52
|
+
if (!connection) {
|
|
53
|
+
throw new Error("There is no connection");
|
|
54
|
+
}
|
|
55
|
+
const response = await connection.request({
|
|
56
|
+
command: "account_offers",
|
|
57
|
+
account,
|
|
58
|
+
ledger_index: options.ledgerIndex || "validated",
|
|
59
|
+
limit: options.limit,
|
|
60
|
+
marker: options.marker,
|
|
61
|
+
});
|
|
62
|
+
if (!response) {
|
|
63
|
+
return {
|
|
64
|
+
account,
|
|
65
|
+
status: "error",
|
|
66
|
+
error: "invalidResponse",
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (response.error) {
|
|
70
|
+
const { error, error_code, error_message, error_exception, status, validated } = response;
|
|
71
|
+
return (0, common_1.removeUndefined)({
|
|
72
|
+
account,
|
|
73
|
+
error,
|
|
74
|
+
error_code,
|
|
75
|
+
error_message,
|
|
76
|
+
error_exception,
|
|
77
|
+
status,
|
|
78
|
+
validated,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const result = response.result;
|
|
82
|
+
const newMarker = (0, utils_1.createMarker)(connection.hash, result.marker);
|
|
83
|
+
if (newMarker) {
|
|
84
|
+
result.marker = newMarker;
|
|
85
|
+
}
|
|
86
|
+
if (formatted === true) {
|
|
87
|
+
result.offers = formatResponse(account, result.offers);
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
async function getAccountAllOffers(account, options = {}) {
|
|
92
|
+
const limit = options.limit;
|
|
93
|
+
let response;
|
|
94
|
+
const accountOffers = [];
|
|
95
|
+
while (true) {
|
|
96
|
+
if (options.limit && limit) {
|
|
97
|
+
const left = limit - accountOffers.length;
|
|
98
|
+
const parts = Math.floor(left / OFFERS_LIMIT_MAX);
|
|
99
|
+
if (parts === 0) {
|
|
100
|
+
options.limit = left;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
options.limit = left;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
response = await getAccountOffers(account, options);
|
|
107
|
+
if (response.error) {
|
|
108
|
+
return response;
|
|
109
|
+
}
|
|
110
|
+
accountOffers.push(...response.offers);
|
|
111
|
+
if (limit && accountOffers.length >= limit) {
|
|
112
|
+
response.limit = accountOffers.length;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
if (response.marker) {
|
|
116
|
+
options.marker = response.marker;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (response.error) {
|
|
123
|
+
const { error, error_code, error_message, error_exception, status, validated } = response;
|
|
124
|
+
return (0, common_1.removeUndefined)({
|
|
125
|
+
account,
|
|
126
|
+
error,
|
|
127
|
+
error_code,
|
|
128
|
+
error_message,
|
|
129
|
+
error_exception,
|
|
130
|
+
status,
|
|
131
|
+
validated,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
response.offers = accountOffers;
|
|
135
|
+
return response;
|
|
136
|
+
}
|
|
137
|
+
function formatResponse(address, offers) {
|
|
138
|
+
const orders = offers.map((offer) => {
|
|
139
|
+
return (0, account_order_1.parseAccountOrder)(address, offer);
|
|
140
|
+
});
|
|
141
|
+
return lodash_1.default.sortBy(orders, (order) => order.properties.sequence);
|
|
142
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LedgerIndex } from "../models/ledger";
|
|
2
|
+
import { ErrorResponse } from "../models/base_model";
|
|
3
|
+
export interface GetTransactionsOptions {
|
|
4
|
+
ledgerIndexMin?: number;
|
|
5
|
+
ledgerIndexMax?: number;
|
|
6
|
+
ledgerHash?: string;
|
|
7
|
+
ledgerIndex?: LedgerIndex;
|
|
8
|
+
binary?: boolean;
|
|
9
|
+
forward?: boolean;
|
|
10
|
+
limit: number;
|
|
11
|
+
marker?: any;
|
|
12
|
+
balanceChanges?: boolean;
|
|
13
|
+
specification?: boolean;
|
|
14
|
+
includeRawTransactions?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function getTransactions(account: string, options?: GetTransactionsOptions): Promise<object | ErrorResponse>;
|
|
17
|
+
export interface FindTransactionsOptions extends GetTransactionsOptions {
|
|
18
|
+
startTxHash?: string;
|
|
19
|
+
excludeFailures?: boolean;
|
|
20
|
+
initiated?: boolean;
|
|
21
|
+
counterparty?: string;
|
|
22
|
+
types?: string[];
|
|
23
|
+
sourceTag?: number;
|
|
24
|
+
destinationTag?: number;
|
|
25
|
+
timeout?: number;
|
|
26
|
+
legacy?: boolean;
|
|
27
|
+
formatted?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface FindTransactionsResponse {
|
|
30
|
+
account: string;
|
|
31
|
+
transactions: any[];
|
|
32
|
+
marker?: any;
|
|
33
|
+
validated?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare function findTransactionsExt(account: string, options?: FindTransactionsOptions): Promise<FindTransactionsResponse | ErrorResponse>;
|
|
36
|
+
export declare function findTransactions(account: string, options?: FindTransactionsOptions): Promise<object[] | ErrorResponse>;
|
|
37
|
+
export {};
|