@bithomp/xrpl-api 3.7.31 → 3.7.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/connection.js +5 -3
- package/lib/src/base58.d.ts +2 -0
- package/lib/src/base58.js +32 -0
- package/lib/src/client.d.ts +25 -0
- package/lib/src/client.js +192 -0
- package/lib/src/common/errors/index.d.ts +3 -0
- package/lib/src/common/errors/index.js +7 -0
- package/lib/src/common/errors/validation_error.d.ts +4 -0
- package/lib/src/common/errors/validation_error.js +7 -0
- package/lib/src/common/errors/xrpl_api_error.d.ts +9 -0
- package/lib/src/common/errors/xrpl_api_error.js +28 -0
- package/lib/src/common/index.d.ts +9 -0
- package/lib/src/common/index.js +57 -0
- package/lib/src/common/sha512Half.d.ts +2 -0
- package/lib/src/common/sha512Half.js +12 -0
- package/lib/src/common/utils.d.ts +14 -0
- package/lib/src/common/utils.js +147 -0
- package/lib/src/connection.d.ts +75 -0
- package/lib/src/connection.js +645 -0
- package/lib/src/faucet.d.ts +58 -0
- package/lib/src/faucet.js +129 -0
- package/lib/src/index.d.ts +9 -0
- package/lib/src/index.js +45 -0
- package/lib/src/ledger/account_info.d.ts +16 -0
- package/lib/src/ledger/account_info.js +112 -0
- package/lib/src/ledger/account_lines.d.ts +11 -0
- package/lib/src/ledger/account_lines.js +90 -0
- package/lib/src/ledger/account_namespace.d.ts +7 -0
- package/lib/src/ledger/account_namespace.js +72 -0
- package/lib/src/ledger/account_nfts.d.ts +21 -0
- package/lib/src/ledger/account_nfts.js +199 -0
- package/lib/src/ledger/account_objects.d.ts +44 -0
- package/lib/src/ledger/account_objects.js +222 -0
- package/lib/src/ledger/account_offers.d.ts +13 -0
- package/lib/src/ledger/account_offers.js +142 -0
- package/lib/src/ledger/account_tx.d.ts +37 -0
- package/lib/src/ledger/account_tx.js +376 -0
- package/lib/src/ledger/amm_info.d.ts +13 -0
- package/lib/src/ledger/amm_info.js +114 -0
- package/lib/src/ledger/book_offers.d.ts +15 -0
- package/lib/src/ledger/book_offers.js +102 -0
- package/lib/src/ledger/currency.d.ts +28 -0
- package/lib/src/ledger/currency.js +250 -0
- package/lib/src/ledger/fee.d.ts +13 -0
- package/lib/src/ledger/fee.js +99 -0
- package/lib/src/ledger/gateway_balances.d.ts +16 -0
- package/lib/src/ledger/gateway_balances.js +119 -0
- package/lib/src/ledger/index.d.ts +21 -0
- package/lib/src/ledger/index.js +37 -0
- package/lib/src/ledger/ledger.d.ts +16 -0
- package/lib/src/ledger/ledger.js +99 -0
- package/lib/src/ledger/ledger_entry.d.ts +16 -0
- package/lib/src/ledger/ledger_entry.js +118 -0
- package/lib/src/ledger/manifest.d.ts +8 -0
- package/lib/src/ledger/manifest.js +67 -0
- package/lib/src/ledger/nft_info.d.ts +4 -0
- package/lib/src/ledger/nft_info.js +67 -0
- package/lib/src/ledger/server_definitions.d.ts +7 -0
- package/lib/src/ledger/server_definitions.js +65 -0
- package/lib/src/ledger/server_info.d.ts +8 -0
- package/lib/src/ledger/server_info.js +65 -0
- package/lib/src/ledger/transaction.d.ts +47 -0
- package/lib/src/ledger/transaction.js +440 -0
- package/lib/src/ledger/vl-v2.d.ts +3 -0
- package/lib/src/ledger/vl-v2.js +124 -0
- package/lib/src/ledger/vl.d.ts +4 -0
- package/lib/src/ledger/vl.js +131 -0
- package/lib/src/models/account_info.d.ts +184 -0
- package/lib/src/models/account_info.js +139 -0
- package/lib/src/models/account_lines.d.ts +26 -0
- package/lib/src/models/account_lines.js +2 -0
- package/lib/src/models/account_namespace.d.ts +16 -0
- package/lib/src/models/account_namespace.js +2 -0
- package/lib/src/models/account_nfts.d.ts +20 -0
- package/lib/src/models/account_nfts.js +92 -0
- package/lib/src/models/account_object.d.ts +61 -0
- package/lib/src/models/account_object.js +125 -0
- package/lib/src/models/account_offers.d.ts +9 -0
- package/lib/src/models/account_offers.js +2 -0
- package/lib/src/models/account_uritokens.d.ts +11 -0
- package/lib/src/models/account_uritokens.js +2 -0
- package/lib/src/models/amm_info.d.ts +1 -0
- package/lib/src/models/amm_info.js +4 -0
- package/lib/src/models/base_model.d.ts +15 -0
- package/lib/src/models/base_model.js +2 -0
- package/lib/src/models/book_offers.d.ts +9 -0
- package/lib/src/models/book_offers.js +40 -0
- package/lib/src/models/gateway_balances.d.ts +19 -0
- package/lib/src/models/gateway_balances.js +2 -0
- package/lib/src/models/index.d.ts +38 -0
- package/lib/src/models/index.js +82 -0
- package/lib/src/models/ledger.d.ts +7 -0
- package/lib/src/models/ledger.js +20 -0
- package/lib/src/models/manifest.d.ts +25 -0
- package/lib/src/models/manifest.js +199 -0
- package/lib/src/models/mptoken.d.ts +7 -0
- package/lib/src/models/mptoken.js +59 -0
- package/lib/src/models/path_find.d.ts +11 -0
- package/lib/src/models/path_find.js +2 -0
- package/lib/src/models/server_definitions.d.ts +33 -0
- package/lib/src/models/server_definitions.js +2 -0
- package/lib/src/models/transaction.d.ts +52 -0
- package/lib/src/models/transaction.js +141 -0
- package/lib/src/models/transactions/CronSet.d.ts +3 -0
- package/lib/src/models/transactions/CronSet.js +2 -0
- package/lib/src/models/transactions/SetRemarks.d.ts +3 -0
- package/lib/src/models/transactions/SetRemarks.js +2 -0
- package/lib/src/models/transactions/URITokenMint.d.ts +3 -0
- package/lib/src/models/transactions/URITokenMint.js +2 -0
- package/lib/src/models/vl.d.ts +82 -0
- package/lib/src/models/vl.js +498 -0
- package/lib/src/parse/index.d.ts +6 -0
- package/lib/src/parse/index.js +46 -0
- package/lib/src/parse/ledger/account-fields.d.ts +5 -0
- package/lib/src/parse/ledger/account-fields.js +43 -0
- package/lib/src/parse/ledger/account-info.d.ts +3 -0
- package/lib/src/parse/ledger/account-info.js +15 -0
- package/lib/src/parse/ledger/account-order.d.ts +18 -0
- package/lib/src/parse/ledger/account-order.js +48 -0
- package/lib/src/parse/ledger/account-settings-flags.d.ts +2 -0
- package/lib/src/parse/ledger/account-settings-flags.js +77 -0
- package/lib/src/parse/ledger/account.d.ts +1 -0
- package/lib/src/parse/ledger/account.js +7 -0
- package/lib/src/parse/ledger/amount.d.ts +3 -0
- package/lib/src/parse/ledger/amount.js +25 -0
- package/lib/src/parse/ledger/asset.d.ts +3 -0
- package/lib/src/parse/ledger/asset.js +19 -0
- package/lib/src/parse/ledger/auth-accounts.d.ts +3 -0
- package/lib/src/parse/ledger/auth-accounts.js +18 -0
- package/lib/src/parse/ledger/credential-flags.d.ts +5 -0
- package/lib/src/parse/ledger/credential-flags.js +8 -0
- package/lib/src/parse/ledger/credential.d.ts +3 -0
- package/lib/src/parse/ledger/credential.js +13 -0
- package/lib/src/parse/ledger/currency-amount.d.ts +3 -0
- package/lib/src/parse/ledger/currency-amount.js +13 -0
- package/lib/src/parse/ledger/delegate.d.ts +2 -0
- package/lib/src/parse/ledger/delegate.js +11 -0
- package/lib/src/parse/ledger/destination.d.ts +2 -0
- package/lib/src/parse/ledger/destination.js +12 -0
- package/lib/src/parse/ledger/emit_details.d.ts +2 -0
- package/lib/src/parse/ledger/emit_details.js +14 -0
- package/lib/src/parse/ledger/flags.d.ts +4 -0
- package/lib/src/parse/ledger/flags.js +17 -0
- package/lib/src/parse/ledger/gateway-balances.d.ts +3 -0
- package/lib/src/parse/ledger/gateway-balances.js +31 -0
- package/lib/src/parse/ledger/genesis-mints.d.ts +2 -0
- package/lib/src/parse/ledger/genesis-mints.js +17 -0
- package/lib/src/parse/ledger/import.d.ts +2 -0
- package/lib/src/parse/ledger/import.js +40 -0
- package/lib/src/parse/ledger/index.d.ts +6 -0
- package/lib/src/parse/ledger/index.js +29 -0
- package/lib/src/parse/ledger/ledger.d.ts +2 -0
- package/lib/src/parse/ledger/ledger.js +98 -0
- package/lib/src/parse/ledger/memos.d.ts +4 -0
- package/lib/src/parse/ledger/memos.js +27 -0
- package/lib/src/parse/ledger/mptoken-flags.d.ts +6 -0
- package/lib/src/parse/ledger/mptoken-flags.js +8 -0
- package/lib/src/parse/ledger/mptoken-issuance-flags.d.ts +6 -0
- package/lib/src/parse/ledger/mptoken-issuance-flags.js +8 -0
- package/lib/src/parse/ledger/nftoken-flags.d.ts +5 -0
- package/lib/src/parse/ledger/nftoken-flags.js +8 -0
- package/lib/src/parse/ledger/nftoken-offer-flags.d.ts +5 -0
- package/lib/src/parse/ledger/nftoken-offer-flags.js +8 -0
- package/lib/src/parse/ledger/offer-flags.d.ts +5 -0
- package/lib/src/parse/ledger/offer-flags.js +8 -0
- package/lib/src/parse/ledger/orderbook-order.d.ts +21 -0
- package/lib/src/parse/ledger/orderbook-order.js +42 -0
- package/lib/src/parse/ledger/permissions.d.ts +2 -0
- package/lib/src/parse/ledger/permissions.js +9 -0
- package/lib/src/parse/ledger/regular-key.d.ts +2 -0
- package/lib/src/parse/ledger/regular-key.js +14 -0
- package/lib/src/parse/ledger/remark-flags.d.ts +5 -0
- package/lib/src/parse/ledger/remark-flags.js +8 -0
- package/lib/src/parse/ledger/remarks.d.ts +3 -0
- package/lib/src/parse/ledger/remarks.js +37 -0
- package/lib/src/parse/ledger/signers.d.ts +2 -0
- package/lib/src/parse/ledger/signers.js +12 -0
- package/lib/src/parse/ledger/source.d.ts +3 -0
- package/lib/src/parse/ledger/source.js +28 -0
- package/lib/src/parse/ledger/trustline-flags.d.ts +5 -0
- package/lib/src/parse/ledger/trustline-flags.js +8 -0
- package/lib/src/parse/ledger/tx-account-set-flags.d.ts +4 -0
- package/lib/src/parse/ledger/tx-account-set-flags.js +36 -0
- package/lib/src/parse/ledger/tx-amm-clawback-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-amm-clawback-flags.js +8 -0
- package/lib/src/parse/ledger/tx-amm-deposit-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-amm-deposit-flags.js +8 -0
- package/lib/src/parse/ledger/tx-amm-withdraw-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-amm-withdraw-flags.js +8 -0
- package/lib/src/parse/ledger/tx-batch-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-batch-flags.js +8 -0
- package/lib/src/parse/ledger/tx-cron-set-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-cron-set-flags.js +8 -0
- package/lib/src/parse/ledger/tx-global-flags.d.ts +5 -0
- package/lib/src/parse/ledger/tx-global-flags.js +8 -0
- package/lib/src/parse/ledger/tx-mptoken-authorize-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-mptoken-authorize-flags.js +8 -0
- package/lib/src/parse/ledger/tx-mptoken-issuance-create-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-mptoken-issuance-create-flags.js +8 -0
- package/lib/src/parse/ledger/tx-mptoken-issuance-set-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-mptoken-issuance-set-flags.js +8 -0
- package/lib/src/parse/ledger/tx-nftoken-mint-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-nftoken-mint-flags.js +8 -0
- package/lib/src/parse/ledger/tx-nftoken-offer-create-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-nftoken-offer-create-flags.js +8 -0
- package/lib/src/parse/ledger/tx-offer-create-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-offer-create-flags.js +8 -0
- package/lib/src/parse/ledger/tx-payment-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-payment-flags.js +8 -0
- package/lib/src/parse/ledger/tx-trust-set-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-trust-set-flags.js +8 -0
- package/lib/src/parse/ledger/tx-uritoken-mint-flags.d.ts +6 -0
- package/lib/src/parse/ledger/tx-uritoken-mint-flags.js +8 -0
- package/lib/src/parse/ledger/uritoken-flags.d.ts +5 -0
- package/lib/src/parse/ledger/uritoken-flags.js +8 -0
- package/lib/src/parse/mptoken_normalize.d.ts +5 -0
- package/lib/src/parse/mptoken_normalize.js +215 -0
- package/lib/src/parse/outcome/account_setting_changes.d.ts +4 -0
- package/lib/src/parse/outcome/account_setting_changes.js +67 -0
- package/lib/src/parse/outcome/affected_objects.d.ts +7 -0
- package/lib/src/parse/outcome/affected_objects.js +147 -0
- package/lib/src/parse/outcome/amendment_changes.d.ts +8 -0
- package/lib/src/parse/outcome/amendment_changes.js +84 -0
- package/lib/src/parse/outcome/amm_changes.d.ts +52 -0
- package/lib/src/parse/outcome/amm_changes.js +214 -0
- package/lib/src/parse/outcome/balance_changes.d.ts +24 -0
- package/lib/src/parse/outcome/balance_changes.js +337 -0
- package/lib/src/parse/outcome/channel_changes.d.ts +20 -0
- package/lib/src/parse/outcome/channel_changes.js +70 -0
- package/lib/src/parse/outcome/check_changes.d.ts +17 -0
- package/lib/src/parse/outcome/check_changes.js +63 -0
- package/lib/src/parse/outcome/credential_changes.d.ts +16 -0
- package/lib/src/parse/outcome/credential_changes.js +59 -0
- package/lib/src/parse/outcome/cron_changes.d.ts +13 -0
- package/lib/src/parse/outcome/cron_changes.js +72 -0
- package/lib/src/parse/outcome/delegate_changes.d.ts +12 -0
- package/lib/src/parse/outcome/delegate_changes.js +59 -0
- package/lib/src/parse/outcome/delivered_amount.d.ts +4 -0
- package/lib/src/parse/outcome/delivered_amount.js +63 -0
- package/lib/src/parse/outcome/did_changes.d.ts +14 -0
- package/lib/src/parse/outcome/did_changes.js +50 -0
- package/lib/src/parse/outcome/emitted_txns.d.ts +9 -0
- package/lib/src/parse/outcome/emitted_txns.js +57 -0
- package/lib/src/parse/outcome/escrow_changes.d.ts +16 -0
- package/lib/src/parse/outcome/escrow_changes.js +75 -0
- package/lib/src/parse/outcome/hooks_executions.d.ts +13 -0
- package/lib/src/parse/outcome/hooks_executions.js +42 -0
- package/lib/src/parse/outcome/index.d.ts +26 -0
- package/lib/src/parse/outcome/index.js +55 -0
- package/lib/src/parse/outcome/locked_balance_changes.d.ts +20 -0
- package/lib/src/parse/outcome/locked_balance_changes.js +117 -0
- package/lib/src/parse/outcome/mptoken_changes.d.ts +1 -0
- package/lib/src/parse/outcome/mptoken_changes.js +113 -0
- package/lib/src/parse/outcome/mptoken_issuance_changes.d.ts +1 -0
- package/lib/src/parse/outcome/mptoken_issuance_changes.js +119 -0
- package/lib/src/parse/outcome/nftoken_changes.d.ts +1 -0
- package/lib/src/parse/outcome/nftoken_changes.js +234 -0
- package/lib/src/parse/outcome/nftoken_offer_changes.d.ts +2 -0
- package/lib/src/parse/outcome/nftoken_offer_changes.js +106 -0
- package/lib/src/parse/outcome/oracle_changes.d.ts +29 -0
- package/lib/src/parse/outcome/oracle_changes.js +150 -0
- package/lib/src/parse/outcome/orderbook_changes.d.ts +21 -0
- package/lib/src/parse/outcome/orderbook_changes.js +108 -0
- package/lib/src/parse/outcome/orderbook_quality.d.ts +2 -0
- package/lib/src/parse/outcome/orderbook_quality.js +49 -0
- package/lib/src/parse/outcome/remarks_changes.d.ts +14 -0
- package/lib/src/parse/outcome/remarks_changes.js +68 -0
- package/lib/src/parse/outcome/unl_report_changes.d.ts +13 -0
- package/lib/src/parse/outcome/unl_report_changes.js +48 -0
- package/lib/src/parse/outcome/uritoken_changes.d.ts +1 -0
- package/lib/src/parse/outcome/uritoken_changes.js +83 -0
- package/lib/src/parse/outcome/uritoken_sell_offer_changes.d.ts +1 -0
- package/lib/src/parse/outcome/uritoken_sell_offer_changes.js +105 -0
- package/lib/src/parse/outcome.d.ts +4 -0
- package/lib/src/parse/outcome.js +264 -0
- package/lib/src/parse/specification/account-delete.d.ts +4 -0
- package/lib/src/parse/specification/account-delete.js +59 -0
- package/lib/src/parse/specification/amendment.d.ts +3 -0
- package/lib/src/parse/specification/amendment.js +50 -0
- package/lib/src/parse/specification/amm-bid.d.ts +4 -0
- package/lib/src/parse/specification/amm-bid.js +66 -0
- package/lib/src/parse/specification/amm-clawback.d.ts +4 -0
- package/lib/src/parse/specification/amm-clawback.js +65 -0
- package/lib/src/parse/specification/amm-create.d.ts +4 -0
- package/lib/src/parse/specification/amm-create.js +62 -0
- package/lib/src/parse/specification/amm-delete.d.ts +4 -0
- package/lib/src/parse/specification/amm-delete.js +61 -0
- package/lib/src/parse/specification/amm-deposit.d.ts +4 -0
- package/lib/src/parse/specification/amm-deposit.js +66 -0
- package/lib/src/parse/specification/amm-vote.d.ts +4 -0
- package/lib/src/parse/specification/amm-vote.js +62 -0
- package/lib/src/parse/specification/amm-withdraw.d.ts +4 -0
- package/lib/src/parse/specification/amm-withdraw.js +66 -0
- package/lib/src/parse/specification/batch.d.ts +4 -0
- package/lib/src/parse/specification/batch.js +83 -0
- package/lib/src/parse/specification/check-cancel.d.ts +4 -0
- package/lib/src/parse/specification/check-cancel.js +58 -0
- package/lib/src/parse/specification/check-cash.d.ts +4 -0
- package/lib/src/parse/specification/check-cash.js +64 -0
- package/lib/src/parse/specification/check-create.d.ts +4 -0
- package/lib/src/parse/specification/check-create.js +67 -0
- package/lib/src/parse/specification/clawback.d.ts +4 -0
- package/lib/src/parse/specification/clawback.js +62 -0
- package/lib/src/parse/specification/credential-accept.d.ts +4 -0
- package/lib/src/parse/specification/credential-accept.js +56 -0
- package/lib/src/parse/specification/credential-create.d.ts +4 -0
- package/lib/src/parse/specification/credential-create.js +58 -0
- package/lib/src/parse/specification/credential-delete.d.ts +4 -0
- package/lib/src/parse/specification/credential-delete.js +57 -0
- package/lib/src/parse/specification/cron-set.d.ts +3 -0
- package/lib/src/parse/specification/cron-set.js +62 -0
- package/lib/src/parse/specification/cron.d.ts +3 -0
- package/lib/src/parse/specification/cron.js +47 -0
- package/lib/src/parse/specification/delegate-set.d.ts +4 -0
- package/lib/src/parse/specification/delegate-set.js +60 -0
- package/lib/src/parse/specification/deposit-preauth.d.ts +4 -0
- package/lib/src/parse/specification/deposit-preauth.js +62 -0
- package/lib/src/parse/specification/did-delete.d.ts +4 -0
- package/lib/src/parse/specification/did-delete.js +57 -0
- package/lib/src/parse/specification/did-set.d.ts +4 -0
- package/lib/src/parse/specification/did-set.js +60 -0
- package/lib/src/parse/specification/escrow-cancel.d.ts +4 -0
- package/lib/src/parse/specification/escrow-cancel.js +59 -0
- package/lib/src/parse/specification/escrow-create.d.ts +4 -0
- package/lib/src/parse/specification/escrow-create.js +64 -0
- package/lib/src/parse/specification/escrow-finish.d.ts +4 -0
- package/lib/src/parse/specification/escrow-finish.js +61 -0
- package/lib/src/parse/specification/fee-update.d.ts +3 -0
- package/lib/src/parse/specification/fee-update.js +69 -0
- package/lib/src/parse/specification/genesis-mint.d.ts +3 -0
- package/lib/src/parse/specification/genesis-mint.js +53 -0
- package/lib/src/parse/specification/import.d.ts +3 -0
- package/lib/src/parse/specification/import.js +55 -0
- package/lib/src/parse/specification/invoke.d.ts +3 -0
- package/lib/src/parse/specification/invoke.js +54 -0
- package/lib/src/parse/specification/mptoken-authorize.d.ts +4 -0
- package/lib/src/parse/specification/mptoken-authorize.js +60 -0
- package/lib/src/parse/specification/mptoken-issuance-create.d.ts +4 -0
- package/lib/src/parse/specification/mptoken-issuance-create.js +62 -0
- package/lib/src/parse/specification/mptoken-issuance-destroy.d.ts +4 -0
- package/lib/src/parse/specification/mptoken-issuance-destroy.js +56 -0
- package/lib/src/parse/specification/mptoken-issuance-set.d.ts +4 -0
- package/lib/src/parse/specification/mptoken-issuance-set.js +60 -0
- package/lib/src/parse/specification/nftoken-accept-offer.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-accept-offer.js +58 -0
- package/lib/src/parse/specification/nftoken-burn.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-burn.js +56 -0
- package/lib/src/parse/specification/nftoken-cancel-offer.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-cancel-offer.js +56 -0
- package/lib/src/parse/specification/nftoken-create-offer.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-create-offer.js +69 -0
- package/lib/src/parse/specification/nftoken-mint.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-mint.js +73 -0
- package/lib/src/parse/specification/nftoken-modify.d.ts +4 -0
- package/lib/src/parse/specification/nftoken-modify.js +58 -0
- package/lib/src/parse/specification/offer-cancel.d.ts +4 -0
- package/lib/src/parse/specification/offer-cancel.js +58 -0
- package/lib/src/parse/specification/offer-create.d.ts +4 -0
- package/lib/src/parse/specification/offer-create.js +78 -0
- package/lib/src/parse/specification/oracle-delete.d.ts +4 -0
- package/lib/src/parse/specification/oracle-delete.js +56 -0
- package/lib/src/parse/specification/oracle-set.d.ts +4 -0
- package/lib/src/parse/specification/oracle-set.js +62 -0
- package/lib/src/parse/specification/payment-channel-claim.d.ts +4 -0
- package/lib/src/parse/specification/payment-channel-claim.js +67 -0
- package/lib/src/parse/specification/payment-channel-create.d.ts +4 -0
- package/lib/src/parse/specification/payment-channel-create.js +68 -0
- package/lib/src/parse/specification/payment-channel-fund.d.ts +4 -0
- package/lib/src/parse/specification/payment-channel-fund.js +65 -0
- package/lib/src/parse/specification/payment.d.ts +4 -0
- package/lib/src/parse/specification/payment.js +75 -0
- package/lib/src/parse/specification/permissioned-domain-set.d.ts +4 -0
- package/lib/src/parse/specification/permissioned-domain-set.js +56 -0
- package/lib/src/parse/specification/remit.d.ts +3 -0
- package/lib/src/parse/specification/remit.js +90 -0
- package/lib/src/parse/specification/set-remarks.d.ts +3 -0
- package/lib/src/parse/specification/set-remarks.js +56 -0
- package/lib/src/parse/specification/settings.d.ts +4 -0
- package/lib/src/parse/specification/settings.js +64 -0
- package/lib/src/parse/specification/ticket-create.d.ts +4 -0
- package/lib/src/parse/specification/ticket-create.js +58 -0
- package/lib/src/parse/specification/trust-set.d.ts +4 -0
- package/lib/src/parse/specification/trust-set.js +80 -0
- package/lib/src/parse/specification/unl-modify.d.ts +4 -0
- package/lib/src/parse/specification/unl-modify.js +52 -0
- package/lib/src/parse/specification/unl-report.d.ts +3 -0
- package/lib/src/parse/specification/unl-report.js +51 -0
- package/lib/src/parse/specification/unrecognized.d.ts +4 -0
- package/lib/src/parse/specification/unrecognized.js +24 -0
- package/lib/src/parse/specification/uritoken-burn.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-burn.js +54 -0
- package/lib/src/parse/specification/uritoken-buy.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-buy.js +55 -0
- package/lib/src/parse/specification/uritoken-cancel-sell-offer.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-cancel-sell-offer.js +54 -0
- package/lib/src/parse/specification/uritoken-create-sell-offer.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-create-sell-offer.js +57 -0
- package/lib/src/parse/specification/uritoken-mint.d.ts +3 -0
- package/lib/src/parse/specification/uritoken-mint.js +63 -0
- package/lib/src/parse/transaction.d.ts +168 -0
- package/lib/src/parse/transaction.js +228 -0
- package/lib/src/parse/utils.d.ts +33 -0
- package/lib/src/parse/utils.js +119 -0
- package/lib/src/types/account.d.ts +26 -0
- package/lib/src/types/account.js +2 -0
- package/lib/src/types/adjustments.d.ts +16 -0
- package/lib/src/types/adjustments.js +2 -0
- package/lib/src/types/amendments.d.ts +4 -0
- package/lib/src/types/amendments.js +2 -0
- package/lib/src/types/amm.d.ts +98 -0
- package/lib/src/types/amm.js +68 -0
- package/lib/src/types/amounts.d.ts +20 -0
- package/lib/src/types/amounts.js +2 -0
- package/lib/src/types/batch.d.ts +21 -0
- package/lib/src/types/batch.js +26 -0
- package/lib/src/types/checks.d.ts +17 -0
- package/lib/src/types/checks.js +2 -0
- package/lib/src/types/clawback.d.ts +5 -0
- package/lib/src/types/clawback.js +2 -0
- package/lib/src/types/credentials.d.ts +30 -0
- package/lib/src/types/credentials.js +10 -0
- package/lib/src/types/cron.d.ts +17 -0
- package/lib/src/types/cron.js +6 -0
- package/lib/src/types/delegate.d.ts +5 -0
- package/lib/src/types/delegate.js +2 -0
- package/lib/src/types/deposits.d.ts +11 -0
- package/lib/src/types/deposits.js +2 -0
- package/lib/src/types/did.d.ts +7 -0
- package/lib/src/types/did.js +2 -0
- package/lib/src/types/emit_details.d.ts +7 -0
- package/lib/src/types/emit_details.js +2 -0
- package/lib/src/types/escrows.d.ts +18 -0
- package/lib/src/types/escrows.js +2 -0
- package/lib/src/types/fees.d.ts +9 -0
- package/lib/src/types/fees.js +2 -0
- package/lib/src/types/gateway_balances.d.ts +11 -0
- package/lib/src/types/gateway_balances.js +2 -0
- package/lib/src/types/genesis_mint.d.ts +9 -0
- package/lib/src/types/genesis_mint.js +2 -0
- package/lib/src/types/global.d.ts +14 -0
- package/lib/src/types/global.js +26 -0
- package/lib/src/types/hooks.d.ts +14 -0
- package/lib/src/types/hooks.js +2 -0
- package/lib/src/types/import.d.ts +21 -0
- package/lib/src/types/import.js +2 -0
- package/lib/src/types/index.d.ts +31 -0
- package/lib/src/types/index.js +47 -0
- package/lib/src/types/invoke.d.ts +5 -0
- package/lib/src/types/invoke.js +2 -0
- package/lib/src/types/ledger.d.ts +46 -0
- package/lib/src/types/ledger.js +2 -0
- package/lib/src/types/ledger_data.d.ts +10 -0
- package/lib/src/types/ledger_data.js +2 -0
- package/lib/src/types/ledger_entries.d.ts +163 -0
- package/lib/src/types/ledger_entries.js +2 -0
- package/lib/src/types/memos.d.ts +12 -0
- package/lib/src/types/memos.js +2 -0
- package/lib/src/types/mptokens.d.ts +84 -0
- package/lib/src/types/mptokens.js +76 -0
- package/lib/src/types/nftokens.d.ts +62 -0
- package/lib/src/types/nftokens.js +44 -0
- package/lib/src/types/offers.d.ts +46 -0
- package/lib/src/types/offers.js +33 -0
- package/lib/src/types/oracle.d.ts +19 -0
- package/lib/src/types/oracle.js +2 -0
- package/lib/src/types/outcome.d.ts +22 -0
- package/lib/src/types/outcome.js +2 -0
- package/lib/src/types/payment_channels.d.ts +23 -0
- package/lib/src/types/payment_channels.js +2 -0
- package/lib/src/types/payments.d.ts +24 -0
- package/lib/src/types/payments.js +25 -0
- package/lib/src/types/queue_data.d.ts +15 -0
- package/lib/src/types/queue_data.js +2 -0
- package/lib/src/types/remarks.d.ts +24 -0
- package/lib/src/types/remarks.js +6 -0
- package/lib/src/types/remits.d.ts +15 -0
- package/lib/src/types/remits.js +2 -0
- package/lib/src/types/settings.d.ts +27 -0
- package/lib/src/types/settings.js +2 -0
- package/lib/src/types/signers.d.ts +22 -0
- package/lib/src/types/signers.js +2 -0
- package/lib/src/types/specification.d.ts +14 -0
- package/lib/src/types/specification.js +2 -0
- package/lib/src/types/tickets.d.ts +4 -0
- package/lib/src/types/tickets.js +2 -0
- package/lib/src/types/trustlines.d.ts +85 -0
- package/lib/src/types/trustlines.js +43 -0
- package/lib/src/types/unl_modify.d.ts +6 -0
- package/lib/src/types/unl_modify.js +2 -0
- package/lib/src/types/unl_reports.d.ts +5 -0
- package/lib/src/types/unl_reports.js +2 -0
- package/lib/src/types/unrecognized.d.ts +5 -0
- package/lib/src/types/unrecognized.js +2 -0
- package/lib/src/types/uri_tokens.d.ts +7 -0
- package/lib/src/types/uri_tokens.js +6 -0
- package/lib/src/types/uritokens.d.ts +41 -0
- package/lib/src/types/uritokens.js +22 -0
- package/lib/src/v1/transaction/payment.d.ts +14 -0
- package/lib/src/v1/transaction/payment.js +142 -0
- package/lib/src/v1/types.d.ts +9 -0
- package/lib/src/v1/types.js +2 -0
- package/lib/src/v1/utils.d.ts +7 -0
- package/lib/src/v1/utils.js +49 -0
- package/lib/src/validator.d.ts +11 -0
- package/lib/src/validator.js +130 -0
- package/lib/src/wallet.d.ts +34 -0
- package/lib/src/wallet.js +284 -0
- package/package.json +19 -19
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accountObjectsToAccountLines = accountObjectsToAccountLines;
|
|
4
|
+
exports.accountObjectsToNFTOffers = accountObjectsToNFTOffers;
|
|
5
|
+
exports.accountObjectsToURITokens = accountObjectsToURITokens;
|
|
6
|
+
const xrpl_1 = require("xrpl");
|
|
7
|
+
const { RippleStateFlags } = xrpl_1.LedgerEntry;
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const ledger_1 = require("../models/ledger");
|
|
10
|
+
function accountObjectsToAccountLines(account, accountObjects) {
|
|
11
|
+
const notInDefaultState = accountObjects.filter((node) => {
|
|
12
|
+
if (node.LedgerEntryType !== "RippleState") {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (node.HighLimit.issuer === account) {
|
|
16
|
+
if (node.Flags & RippleStateFlags.lsfHighReserve) {
|
|
17
|
+
if (isPositiveBalance(node.Balance.value)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
if (isNegativeBalance(node.Balance.value)) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
if (node.Flags & RippleStateFlags.lsfLowReserve) {
|
|
28
|
+
if (isNegativeBalance(node.Balance.value)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (isPositiveBalance(node.Balance.value)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
});
|
|
39
|
+
const accountLinesFormatted = notInDefaultState.map((node) => RippleStateToTrustLine(node, account));
|
|
40
|
+
return accountLinesFormatted;
|
|
41
|
+
}
|
|
42
|
+
function isPositiveBalance(balance) {
|
|
43
|
+
return balance !== "0" && balance[0] !== "-";
|
|
44
|
+
}
|
|
45
|
+
function isNegativeBalance(balance) {
|
|
46
|
+
return balance !== "0" && balance[0] === "-";
|
|
47
|
+
}
|
|
48
|
+
const RippleStateToTrustLine = (ledgerEntry, account) => {
|
|
49
|
+
const viewLowest = ledgerEntry.LowLimit.issuer === account;
|
|
50
|
+
const flags = ledgerEntry.Flags;
|
|
51
|
+
const self = viewLowest ? ledgerEntry.LowLimit : ledgerEntry.HighLimit;
|
|
52
|
+
const counterparty = viewLowest ? ledgerEntry.HighLimit : ledgerEntry.LowLimit;
|
|
53
|
+
const { lsfLowNoRipple, lsfHighNoRipple, lsfLowAuth, lsfHighAuth } = RippleStateFlags;
|
|
54
|
+
const no_ripple = (flags & (viewLowest ? lsfLowNoRipple : lsfHighNoRipple)) !== 0;
|
|
55
|
+
const no_ripple_peer = (flags & (viewLowest ? lsfHighNoRipple : lsfLowNoRipple)) !== 0;
|
|
56
|
+
const authorized = (flags & (viewLowest ? lsfLowAuth : lsfHighAuth)) !== 0;
|
|
57
|
+
const peer_authorized = (flags & (viewLowest ? lsfHighAuth : lsfLowAuth)) !== 0;
|
|
58
|
+
const balance = ledgerEntry.HighLimit.issuer === account && ledgerEntry.Balance.value.startsWith("-")
|
|
59
|
+
? ledgerEntry.Balance.value.slice(1)
|
|
60
|
+
: ledgerEntry.Balance.value;
|
|
61
|
+
let lockedBalance = ledgerEntry.LockedBalance?.value;
|
|
62
|
+
if (lockedBalance && lockedBalance.startsWith("-")) {
|
|
63
|
+
lockedBalance = lockedBalance.slice(1);
|
|
64
|
+
}
|
|
65
|
+
let lockCount = undefined;
|
|
66
|
+
if (lockedBalance) {
|
|
67
|
+
lockCount = ledgerEntry.LockCount;
|
|
68
|
+
}
|
|
69
|
+
return (0, common_1.removeUndefined)({
|
|
70
|
+
account: counterparty.issuer,
|
|
71
|
+
balance,
|
|
72
|
+
currency: self.currency,
|
|
73
|
+
limit: self.value,
|
|
74
|
+
limit_peer: counterparty.value,
|
|
75
|
+
lock_count: lockCount,
|
|
76
|
+
locked_balance: lockedBalance,
|
|
77
|
+
no_ripple,
|
|
78
|
+
no_ripple_peer,
|
|
79
|
+
authorized,
|
|
80
|
+
peer_authorized,
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
function accountObjectsToNFTOffers(accountObjects) {
|
|
84
|
+
const nftOfferObjects = accountObjects.filter((obj) => {
|
|
85
|
+
return obj.LedgerEntryType === "NFTokenOffer";
|
|
86
|
+
});
|
|
87
|
+
const nftOffers = nftOfferObjects.map((obj) => {
|
|
88
|
+
let expiration = obj.Expiration;
|
|
89
|
+
if (typeof expiration === "number") {
|
|
90
|
+
expiration = (0, ledger_1.ledgerTimeToUnixTime)(expiration);
|
|
91
|
+
}
|
|
92
|
+
return (0, common_1.removeUndefined)({
|
|
93
|
+
nft_id: obj.NFTokenID,
|
|
94
|
+
amount: obj.Amount,
|
|
95
|
+
flags: obj.Flags,
|
|
96
|
+
index: obj.index,
|
|
97
|
+
owner: obj.Owner,
|
|
98
|
+
destination: obj.Destination,
|
|
99
|
+
expiration,
|
|
100
|
+
ledger_index: obj.PreviousTxnLgrSeq,
|
|
101
|
+
transaction_hash: obj.PreviousTxnID,
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
return nftOffers;
|
|
105
|
+
}
|
|
106
|
+
function accountObjectsToURITokens(accountObjects) {
|
|
107
|
+
const uriTokenObjects = accountObjects.filter((obj) => {
|
|
108
|
+
return obj.LedgerEntryType === "URIToken";
|
|
109
|
+
});
|
|
110
|
+
const uritokens = uriTokenObjects.map((obj) => {
|
|
111
|
+
return (0, common_1.removeUndefined)({
|
|
112
|
+
flags: obj.Flags,
|
|
113
|
+
index: obj.index,
|
|
114
|
+
owner: obj.Owner,
|
|
115
|
+
issuer: obj.Issuer,
|
|
116
|
+
uri: obj.URI,
|
|
117
|
+
digest: obj.Digest,
|
|
118
|
+
amount: obj.Amount,
|
|
119
|
+
destination: obj.Destination,
|
|
120
|
+
ledger_index: obj.PreviousTxnLgrSeq,
|
|
121
|
+
transaction_hash: obj.PreviousTxnID,
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
return uritokens;
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AMM_LP_TOKEN_REGEX: RegExp;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ErrorResponse {
|
|
2
|
+
id?: number | string;
|
|
3
|
+
account?: string;
|
|
4
|
+
transaction?: string;
|
|
5
|
+
public_key?: string;
|
|
6
|
+
nft_id?: string;
|
|
7
|
+
status: "error";
|
|
8
|
+
error: string;
|
|
9
|
+
error_code?: string;
|
|
10
|
+
error_message?: string;
|
|
11
|
+
error_exception?: string;
|
|
12
|
+
api_version?: number;
|
|
13
|
+
marker?: any;
|
|
14
|
+
validated?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IssuedCurrency, FormattedIssuedCurrency } from "../types";
|
|
2
|
+
export type OrderbookInfo = {
|
|
3
|
+
base: IssuedCurrency | FormattedIssuedCurrency;
|
|
4
|
+
counter: IssuedCurrency | FormattedIssuedCurrency;
|
|
5
|
+
};
|
|
6
|
+
export declare function formatBidsAndAsks(orderbook: OrderbookInfo, offers: any[]): {
|
|
7
|
+
bids: any[];
|
|
8
|
+
asks: any[];
|
|
9
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
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.formatBidsAndAsks = formatBidsAndAsks;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
9
|
+
const orderbook_order_1 = require("../parse/ledger/orderbook-order");
|
|
10
|
+
function isSameIssue(a, b) {
|
|
11
|
+
return a.currency === b.currency && a.issuer === b.issuer;
|
|
12
|
+
}
|
|
13
|
+
function directionFilter(direction, order) {
|
|
14
|
+
return order.specification.direction === direction;
|
|
15
|
+
}
|
|
16
|
+
function flipOrder(order) {
|
|
17
|
+
const specification = order.specification;
|
|
18
|
+
const flippedSpecification = {
|
|
19
|
+
quantity: specification.totalPrice,
|
|
20
|
+
totalPrice: specification.quantity,
|
|
21
|
+
direction: specification.direction === "buy" ? "sell" : "buy",
|
|
22
|
+
};
|
|
23
|
+
const newSpecification = lodash_1.default.merge({}, specification, flippedSpecification);
|
|
24
|
+
return lodash_1.default.merge({}, order, { specification: newSpecification });
|
|
25
|
+
}
|
|
26
|
+
function alignOrder(base, order) {
|
|
27
|
+
const quantity = order.specification.quantity;
|
|
28
|
+
return isSameIssue(quantity, base) ? order : flipOrder(order);
|
|
29
|
+
}
|
|
30
|
+
function formatBidsAndAsks(orderbook, offers) {
|
|
31
|
+
const orders = offers
|
|
32
|
+
.sort((a, b) => {
|
|
33
|
+
return new bignumber_js_1.default(a.quality).comparedTo(b.quality) ?? 0;
|
|
34
|
+
})
|
|
35
|
+
.map(orderbook_order_1.parseOrderbookOrder);
|
|
36
|
+
const alignedOrders = orders.map(lodash_1.default.partial(alignOrder, orderbook.base));
|
|
37
|
+
const bids = alignedOrders.filter(lodash_1.default.partial(directionFilter, "buy"));
|
|
38
|
+
const asks = alignedOrders.filter(lodash_1.default.partial(directionFilter, "sell"));
|
|
39
|
+
return { bids, asks };
|
|
40
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface GatewayBalance {
|
|
2
|
+
currency: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface GatewayBalances {
|
|
6
|
+
account: string;
|
|
7
|
+
obligations?: {
|
|
8
|
+
[currency: string]: string;
|
|
9
|
+
};
|
|
10
|
+
balances?: {
|
|
11
|
+
[address: string]: GatewayBalance[];
|
|
12
|
+
};
|
|
13
|
+
assets?: {
|
|
14
|
+
[address: string]: GatewayBalance[];
|
|
15
|
+
};
|
|
16
|
+
ledger_hash?: string;
|
|
17
|
+
ledger_current_index?: number;
|
|
18
|
+
ledger_index?: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export * from "./account_info";
|
|
2
|
+
export * from "./account_nfts";
|
|
3
|
+
export * from "./account_object";
|
|
4
|
+
export * from "./amm_info";
|
|
5
|
+
export * from "./ledger";
|
|
6
|
+
export * from "./manifest";
|
|
7
|
+
export * from "./transaction";
|
|
8
|
+
export * from "./account_lines";
|
|
9
|
+
export * from "./account_namespace";
|
|
10
|
+
export * from "./account_uritokens";
|
|
11
|
+
export * from "./vl";
|
|
12
|
+
export * from "./server_definitions";
|
|
13
|
+
export * from "./mptoken";
|
|
14
|
+
export { parseAffectedObjects } from "../parse/outcome/affected_objects";
|
|
15
|
+
export { parseNFTokenChanges } from "../parse/outcome/nftoken_changes";
|
|
16
|
+
export { parseNFTokenOfferChanges } from "../parse/outcome/nftoken_offer_changes";
|
|
17
|
+
export { parseURITokenChanges } from "../parse/outcome/uritoken_changes";
|
|
18
|
+
export { parseURITokenSellOfferChanges } from "../parse/outcome/uritoken_sell_offer_changes";
|
|
19
|
+
export { parseBalanceChanges, parseFinalBalances } from "../parse/outcome/balance_changes";
|
|
20
|
+
export { parseLockedBalanceChanges } from "../parse/outcome/locked_balance_changes";
|
|
21
|
+
export { parseChannelChanges } from "../parse/outcome/channel_changes";
|
|
22
|
+
export { parseOrderbookChanges } from "../parse/outcome/orderbook_changes";
|
|
23
|
+
export { parseMPTokenIssuanceChanges } from "../parse/outcome/mptoken_issuance_changes";
|
|
24
|
+
export { parseMPTokenChanges } from "../parse/outcome/mptoken_changes";
|
|
25
|
+
import parseNFTokenBurn from "../parse/specification/nftoken-burn";
|
|
26
|
+
import parseNFTokenMint from "../parse/specification/nftoken-mint";
|
|
27
|
+
import parseNFTokenFlags from "../parse/ledger/nftoken-flags";
|
|
28
|
+
import parseNFTOfferFlags from "../parse/ledger/nftoken-offer-flags";
|
|
29
|
+
import parseNFTokenAcceptOffer from "../parse/specification/nftoken-accept-offer";
|
|
30
|
+
import parseNFTokenCancelOffer from "../parse/specification/nftoken-cancel-offer";
|
|
31
|
+
import parseNFTokenCreateOffer from "../parse/specification/nftoken-create-offer";
|
|
32
|
+
import parseURITokenFlags from "../parse/ledger/uritoken-flags";
|
|
33
|
+
import parseTrustlineFlags from "../parse/ledger/trustline-flags";
|
|
34
|
+
import parseOfferFlags from "../parse/ledger/offer-flags";
|
|
35
|
+
import parseCredentialFlags from "../parse/ledger/credential-flags";
|
|
36
|
+
import parseMPTokenIssuanceFlags from "../parse/ledger/mptoken-issuance-flags";
|
|
37
|
+
import parseMPTokenFlags from "../parse/ledger/mptoken-flags";
|
|
38
|
+
export { parseNFTokenMint, parseNFTokenBurn, parseNFTokenFlags, parseNFTOfferFlags, parseNFTokenAcceptOffer, parseNFTokenCancelOffer, parseNFTokenCreateOffer, parseURITokenFlags, parseTrustlineFlags, parseOfferFlags, parseCredentialFlags, parseMPTokenIssuanceFlags, parseMPTokenFlags, };
|
|
@@ -0,0 +1,82 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.parseMPTokenFlags = exports.parseMPTokenIssuanceFlags = exports.parseCredentialFlags = exports.parseOfferFlags = exports.parseTrustlineFlags = exports.parseURITokenFlags = exports.parseNFTokenCreateOffer = exports.parseNFTokenCancelOffer = exports.parseNFTokenAcceptOffer = exports.parseNFTOfferFlags = exports.parseNFTokenFlags = exports.parseNFTokenBurn = exports.parseNFTokenMint = exports.parseMPTokenChanges = exports.parseMPTokenIssuanceChanges = exports.parseOrderbookChanges = exports.parseChannelChanges = exports.parseLockedBalanceChanges = exports.parseFinalBalances = exports.parseBalanceChanges = exports.parseURITokenSellOfferChanges = exports.parseURITokenChanges = exports.parseNFTokenOfferChanges = exports.parseNFTokenChanges = exports.parseAffectedObjects = void 0;
|
|
21
|
+
__exportStar(require("./account_info"), exports);
|
|
22
|
+
__exportStar(require("./account_nfts"), exports);
|
|
23
|
+
__exportStar(require("./account_object"), exports);
|
|
24
|
+
__exportStar(require("./amm_info"), exports);
|
|
25
|
+
__exportStar(require("./ledger"), exports);
|
|
26
|
+
__exportStar(require("./manifest"), exports);
|
|
27
|
+
__exportStar(require("./transaction"), exports);
|
|
28
|
+
__exportStar(require("./account_lines"), exports);
|
|
29
|
+
__exportStar(require("./account_namespace"), exports);
|
|
30
|
+
__exportStar(require("./account_uritokens"), exports);
|
|
31
|
+
__exportStar(require("./vl"), exports);
|
|
32
|
+
__exportStar(require("./server_definitions"), exports);
|
|
33
|
+
__exportStar(require("./mptoken"), exports);
|
|
34
|
+
var affected_objects_1 = require("../parse/outcome/affected_objects");
|
|
35
|
+
Object.defineProperty(exports, "parseAffectedObjects", { enumerable: true, get: function () { return affected_objects_1.parseAffectedObjects; } });
|
|
36
|
+
var nftoken_changes_1 = require("../parse/outcome/nftoken_changes");
|
|
37
|
+
Object.defineProperty(exports, "parseNFTokenChanges", { enumerable: true, get: function () { return nftoken_changes_1.parseNFTokenChanges; } });
|
|
38
|
+
var nftoken_offer_changes_1 = require("../parse/outcome/nftoken_offer_changes");
|
|
39
|
+
Object.defineProperty(exports, "parseNFTokenOfferChanges", { enumerable: true, get: function () { return nftoken_offer_changes_1.parseNFTokenOfferChanges; } });
|
|
40
|
+
var uritoken_changes_1 = require("../parse/outcome/uritoken_changes");
|
|
41
|
+
Object.defineProperty(exports, "parseURITokenChanges", { enumerable: true, get: function () { return uritoken_changes_1.parseURITokenChanges; } });
|
|
42
|
+
var uritoken_sell_offer_changes_1 = require("../parse/outcome/uritoken_sell_offer_changes");
|
|
43
|
+
Object.defineProperty(exports, "parseURITokenSellOfferChanges", { enumerable: true, get: function () { return uritoken_sell_offer_changes_1.parseURITokenSellOfferChanges; } });
|
|
44
|
+
var balance_changes_1 = require("../parse/outcome/balance_changes");
|
|
45
|
+
Object.defineProperty(exports, "parseBalanceChanges", { enumerable: true, get: function () { return balance_changes_1.parseBalanceChanges; } });
|
|
46
|
+
Object.defineProperty(exports, "parseFinalBalances", { enumerable: true, get: function () { return balance_changes_1.parseFinalBalances; } });
|
|
47
|
+
var locked_balance_changes_1 = require("../parse/outcome/locked_balance_changes");
|
|
48
|
+
Object.defineProperty(exports, "parseLockedBalanceChanges", { enumerable: true, get: function () { return locked_balance_changes_1.parseLockedBalanceChanges; } });
|
|
49
|
+
var channel_changes_1 = require("../parse/outcome/channel_changes");
|
|
50
|
+
Object.defineProperty(exports, "parseChannelChanges", { enumerable: true, get: function () { return channel_changes_1.parseChannelChanges; } });
|
|
51
|
+
var orderbook_changes_1 = require("../parse/outcome/orderbook_changes");
|
|
52
|
+
Object.defineProperty(exports, "parseOrderbookChanges", { enumerable: true, get: function () { return orderbook_changes_1.parseOrderbookChanges; } });
|
|
53
|
+
var mptoken_issuance_changes_1 = require("../parse/outcome/mptoken_issuance_changes");
|
|
54
|
+
Object.defineProperty(exports, "parseMPTokenIssuanceChanges", { enumerable: true, get: function () { return mptoken_issuance_changes_1.parseMPTokenIssuanceChanges; } });
|
|
55
|
+
var mptoken_changes_1 = require("../parse/outcome/mptoken_changes");
|
|
56
|
+
Object.defineProperty(exports, "parseMPTokenChanges", { enumerable: true, get: function () { return mptoken_changes_1.parseMPTokenChanges; } });
|
|
57
|
+
const nftoken_burn_1 = __importDefault(require("../parse/specification/nftoken-burn"));
|
|
58
|
+
exports.parseNFTokenBurn = nftoken_burn_1.default;
|
|
59
|
+
const nftoken_mint_1 = __importDefault(require("../parse/specification/nftoken-mint"));
|
|
60
|
+
exports.parseNFTokenMint = nftoken_mint_1.default;
|
|
61
|
+
const nftoken_flags_1 = __importDefault(require("../parse/ledger/nftoken-flags"));
|
|
62
|
+
exports.parseNFTokenFlags = nftoken_flags_1.default;
|
|
63
|
+
const nftoken_offer_flags_1 = __importDefault(require("../parse/ledger/nftoken-offer-flags"));
|
|
64
|
+
exports.parseNFTOfferFlags = nftoken_offer_flags_1.default;
|
|
65
|
+
const nftoken_accept_offer_1 = __importDefault(require("../parse/specification/nftoken-accept-offer"));
|
|
66
|
+
exports.parseNFTokenAcceptOffer = nftoken_accept_offer_1.default;
|
|
67
|
+
const nftoken_cancel_offer_1 = __importDefault(require("../parse/specification/nftoken-cancel-offer"));
|
|
68
|
+
exports.parseNFTokenCancelOffer = nftoken_cancel_offer_1.default;
|
|
69
|
+
const nftoken_create_offer_1 = __importDefault(require("../parse/specification/nftoken-create-offer"));
|
|
70
|
+
exports.parseNFTokenCreateOffer = nftoken_create_offer_1.default;
|
|
71
|
+
const uritoken_flags_1 = __importDefault(require("../parse/ledger/uritoken-flags"));
|
|
72
|
+
exports.parseURITokenFlags = uritoken_flags_1.default;
|
|
73
|
+
const trustline_flags_1 = __importDefault(require("../parse/ledger/trustline-flags"));
|
|
74
|
+
exports.parseTrustlineFlags = trustline_flags_1.default;
|
|
75
|
+
const offer_flags_1 = __importDefault(require("../parse/ledger/offer-flags"));
|
|
76
|
+
exports.parseOfferFlags = offer_flags_1.default;
|
|
77
|
+
const credential_flags_1 = __importDefault(require("../parse/ledger/credential-flags"));
|
|
78
|
+
exports.parseCredentialFlags = credential_flags_1.default;
|
|
79
|
+
const mptoken_issuance_flags_1 = __importDefault(require("../parse/ledger/mptoken-issuance-flags"));
|
|
80
|
+
exports.parseMPTokenIssuanceFlags = mptoken_issuance_flags_1.default;
|
|
81
|
+
const mptoken_flags_1 = __importDefault(require("../parse/ledger/mptoken-flags"));
|
|
82
|
+
exports.parseMPTokenFlags = mptoken_flags_1.default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const RIPPLE_UNIX_DIFF = 946684800;
|
|
2
|
+
export type LedgerIndex = number | ("validated" | "closed" | "current");
|
|
3
|
+
export type StreamType = "consensus" | "ledger" | "manifests" | "peer_status" | "transactions" | "transactions_proposed" | "server" | "validations";
|
|
4
|
+
export declare function unixTimeToLedgerTime(time: number): number;
|
|
5
|
+
export declare function ledgerTimeToUnixTime(ledgerTime: number): number;
|
|
6
|
+
export declare function ledgerTimeToTimestamp(ledgerTime: number): number;
|
|
7
|
+
export declare function ledgerTimeToISO8601(ledgerTime: number): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RIPPLE_UNIX_DIFF = void 0;
|
|
4
|
+
exports.unixTimeToLedgerTime = unixTimeToLedgerTime;
|
|
5
|
+
exports.ledgerTimeToUnixTime = ledgerTimeToUnixTime;
|
|
6
|
+
exports.ledgerTimeToTimestamp = ledgerTimeToTimestamp;
|
|
7
|
+
exports.ledgerTimeToISO8601 = ledgerTimeToISO8601;
|
|
8
|
+
exports.RIPPLE_UNIX_DIFF = 946684800;
|
|
9
|
+
function unixTimeToLedgerTime(time) {
|
|
10
|
+
return time - exports.RIPPLE_UNIX_DIFF;
|
|
11
|
+
}
|
|
12
|
+
function ledgerTimeToUnixTime(ledgerTime) {
|
|
13
|
+
return ledgerTime + exports.RIPPLE_UNIX_DIFF;
|
|
14
|
+
}
|
|
15
|
+
function ledgerTimeToTimestamp(ledgerTime) {
|
|
16
|
+
return ledgerTimeToUnixTime(ledgerTime) * 1000;
|
|
17
|
+
}
|
|
18
|
+
function ledgerTimeToISO8601(ledgerTime) {
|
|
19
|
+
return new Date(ledgerTimeToTimestamp(ledgerTime)).toISOString();
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ManifestInterface {
|
|
2
|
+
Sequence?: number;
|
|
3
|
+
PublicKey?: string;
|
|
4
|
+
publicKey?: string;
|
|
5
|
+
address?: string;
|
|
6
|
+
SigningPubKey?: string;
|
|
7
|
+
signingPubKey?: string;
|
|
8
|
+
Signature?: string;
|
|
9
|
+
Domain?: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
MasterSignature?: string;
|
|
12
|
+
verifyFields?: Buffer;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function decodeManifest(manifest: string): ManifestInterface;
|
|
16
|
+
export declare function parseManifest(manifest: string): ManifestInterface;
|
|
17
|
+
export interface GenerateManifestInterface {
|
|
18
|
+
Sequence: number;
|
|
19
|
+
PublicKey: string;
|
|
20
|
+
SigningPubKey: string;
|
|
21
|
+
Domain?: string;
|
|
22
|
+
SigningPrivateKey: string;
|
|
23
|
+
MasterPrivateKey: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function generateManifest(manifest: GenerateManifestInterface): string;
|
|
@@ -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.decodeManifest = decodeManifest;
|
|
37
|
+
exports.parseManifest = parseManifest;
|
|
38
|
+
exports.generateManifest = generateManifest;
|
|
39
|
+
const ripple_binary_codec_1 = require("ripple-binary-codec");
|
|
40
|
+
const ripple_address_codec_1 = require("ripple-address-codec");
|
|
41
|
+
const Validator = __importStar(require("../validator"));
|
|
42
|
+
function decodeManifest(manifest) {
|
|
43
|
+
const manifestHex = Buffer.from(manifest, "base64").toString("hex").toUpperCase();
|
|
44
|
+
const manifestDecoded = (0, ripple_binary_codec_1.decode)(manifestHex);
|
|
45
|
+
if (!manifestDecoded) {
|
|
46
|
+
return manifestDecoded;
|
|
47
|
+
}
|
|
48
|
+
const { PublicKey, SigningPubKey, Domain } = manifestDecoded;
|
|
49
|
+
if (typeof PublicKey === "string") {
|
|
50
|
+
const publicKeyBuffer = Buffer.from(PublicKey, "hex");
|
|
51
|
+
manifestDecoded.publicKey = (0, ripple_address_codec_1.encodeNodePublic)(publicKeyBuffer);
|
|
52
|
+
manifestDecoded.address = Validator.classicAddressFromValidatorPK(publicKeyBuffer);
|
|
53
|
+
}
|
|
54
|
+
if (typeof SigningPubKey === "string") {
|
|
55
|
+
const signingKeyBuffer = Buffer.from(SigningPubKey, "hex");
|
|
56
|
+
manifestDecoded.signingPubKey = (0, ripple_address_codec_1.encodeNodePublic)(signingKeyBuffer);
|
|
57
|
+
}
|
|
58
|
+
if (typeof Domain === "string") {
|
|
59
|
+
manifestDecoded.domain = Buffer.from(Domain, "hex").toString("utf8");
|
|
60
|
+
}
|
|
61
|
+
return manifestDecoded;
|
|
62
|
+
}
|
|
63
|
+
function parseManifest(manifest) {
|
|
64
|
+
const buf = Buffer.from(manifest, "base64");
|
|
65
|
+
const decoded = {};
|
|
66
|
+
let cur = 0;
|
|
67
|
+
const verifyFields = [Buffer.from("MAN\x00", "utf-8")];
|
|
68
|
+
let lastSigning = 0;
|
|
69
|
+
if (buf[cur] === 0x24) {
|
|
70
|
+
cur++;
|
|
71
|
+
decoded.Sequence = (buf[cur] << 24) + (buf[cur + 1] << 16) + (buf[cur + 2] << 8) + buf[cur + 3];
|
|
72
|
+
cur += 4;
|
|
73
|
+
verifyFields.push(buf.slice(lastSigning, cur));
|
|
74
|
+
lastSigning = cur;
|
|
75
|
+
}
|
|
76
|
+
if (buf[cur++] !== 0x71) {
|
|
77
|
+
decoded.error = "Missing Public Key";
|
|
78
|
+
return decoded;
|
|
79
|
+
}
|
|
80
|
+
if (buf[cur++] !== 33) {
|
|
81
|
+
decoded.error = "Missing Public Key size";
|
|
82
|
+
return decoded;
|
|
83
|
+
}
|
|
84
|
+
decoded.PublicKey = buf
|
|
85
|
+
.slice(cur, cur + 33)
|
|
86
|
+
.toString("hex")
|
|
87
|
+
.toUpperCase();
|
|
88
|
+
decoded.publicKey = (0, ripple_address_codec_1.encodeNodePublic)(buf.slice(cur, cur + 33));
|
|
89
|
+
decoded.address = Validator.classicAddressFromValidatorPK(buf.slice(cur, cur + 33));
|
|
90
|
+
cur += 33;
|
|
91
|
+
verifyFields.push(buf.slice(lastSigning, cur));
|
|
92
|
+
lastSigning = cur;
|
|
93
|
+
if (buf[cur++] === 0x73) {
|
|
94
|
+
if (buf[cur++] !== 33) {
|
|
95
|
+
decoded.error = "Missing Signing Public Key size";
|
|
96
|
+
return decoded;
|
|
97
|
+
}
|
|
98
|
+
decoded.SigningPubKey = buf
|
|
99
|
+
.slice(cur, cur + 33)
|
|
100
|
+
.toString("hex")
|
|
101
|
+
.toUpperCase();
|
|
102
|
+
decoded.signingPubKey = (0, ripple_address_codec_1.encodeNodePublic)(buf.slice(cur, cur + 33));
|
|
103
|
+
cur += 33;
|
|
104
|
+
verifyFields.push(buf.slice(lastSigning, cur));
|
|
105
|
+
lastSigning = cur;
|
|
106
|
+
}
|
|
107
|
+
if (buf[cur++] === 0x76) {
|
|
108
|
+
const signatureSize = buf[cur++];
|
|
109
|
+
decoded.Signature = buf
|
|
110
|
+
.slice(cur, cur + signatureSize)
|
|
111
|
+
.toString("hex")
|
|
112
|
+
.toUpperCase();
|
|
113
|
+
cur += signatureSize;
|
|
114
|
+
lastSigning = cur;
|
|
115
|
+
}
|
|
116
|
+
if (buf[cur] === 0x77) {
|
|
117
|
+
cur++;
|
|
118
|
+
const domainSize = buf[cur++];
|
|
119
|
+
decoded.Domain = buf
|
|
120
|
+
.slice(cur, cur + domainSize)
|
|
121
|
+
.toString("hex")
|
|
122
|
+
.toUpperCase();
|
|
123
|
+
decoded.domain = buf.slice(cur, cur + domainSize).toString("utf-8");
|
|
124
|
+
cur += domainSize;
|
|
125
|
+
verifyFields.push(buf.slice(lastSigning, cur));
|
|
126
|
+
lastSigning = cur;
|
|
127
|
+
}
|
|
128
|
+
if (buf[cur++] !== 0x70) {
|
|
129
|
+
decoded.error = "Missing Master Signature";
|
|
130
|
+
return decoded;
|
|
131
|
+
}
|
|
132
|
+
if (buf[cur++] !== 0x12) {
|
|
133
|
+
decoded.error = "Missing Master Signature follow byte";
|
|
134
|
+
return decoded;
|
|
135
|
+
}
|
|
136
|
+
const masterSize = buf[cur++];
|
|
137
|
+
decoded.MasterSignature = buf
|
|
138
|
+
.slice(cur, cur + masterSize)
|
|
139
|
+
.toString("hex")
|
|
140
|
+
.toUpperCase();
|
|
141
|
+
cur += masterSize;
|
|
142
|
+
lastSigning = cur;
|
|
143
|
+
if (cur !== buf.length) {
|
|
144
|
+
decoded.error = "Extra bytes at end of manifest";
|
|
145
|
+
return decoded;
|
|
146
|
+
}
|
|
147
|
+
const verify = Buffer.concat(verifyFields);
|
|
148
|
+
if (decoded.SigningPubKey && decoded.Signature) {
|
|
149
|
+
if (!Validator.verify(verify, decoded.Signature, decoded.SigningPubKey)) {
|
|
150
|
+
decoded.error = "Ephemeral signature does not match";
|
|
151
|
+
return decoded;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (!Validator.verify(verify, decoded.MasterSignature, decoded.PublicKey)) {
|
|
155
|
+
decoded.error = "Master signature does not match";
|
|
156
|
+
return decoded;
|
|
157
|
+
}
|
|
158
|
+
if (decoded.SigningPubKey && decoded.PublicKey && decoded.SigningPubKey === decoded.PublicKey) {
|
|
159
|
+
decoded.error = "Master and ephemeral public keys must be different";
|
|
160
|
+
return decoded;
|
|
161
|
+
}
|
|
162
|
+
return decoded;
|
|
163
|
+
}
|
|
164
|
+
function generateManifest(manifest) {
|
|
165
|
+
const verifyFields = [Buffer.from("MAN\x00", "utf-8")];
|
|
166
|
+
const sequenceBuffer = Buffer.alloc(5);
|
|
167
|
+
sequenceBuffer.writeUInt8(0x24);
|
|
168
|
+
sequenceBuffer.writeUInt32BE(manifest.Sequence, 1);
|
|
169
|
+
verifyFields.push(sequenceBuffer);
|
|
170
|
+
const publicKeyBuffer = Buffer.alloc(35);
|
|
171
|
+
publicKeyBuffer.writeUInt8(0x71);
|
|
172
|
+
publicKeyBuffer.writeUInt8(manifest.PublicKey.length / 2, 1);
|
|
173
|
+
publicKeyBuffer.write(manifest.PublicKey, 2, "hex");
|
|
174
|
+
verifyFields.push(publicKeyBuffer);
|
|
175
|
+
const signingPubKeyBuffer = Buffer.alloc(35);
|
|
176
|
+
signingPubKeyBuffer.writeUInt8(0x73);
|
|
177
|
+
signingPubKeyBuffer.writeUInt8(manifest.SigningPubKey.length / 2, 1);
|
|
178
|
+
signingPubKeyBuffer.write(manifest.SigningPubKey, 2, "hex");
|
|
179
|
+
verifyFields.push(signingPubKeyBuffer);
|
|
180
|
+
if (manifest.Domain) {
|
|
181
|
+
const domainBuffer = Buffer.alloc(2 + manifest.Domain.length / 2);
|
|
182
|
+
domainBuffer.writeUInt8(0x77);
|
|
183
|
+
domainBuffer.writeUInt8(manifest.Domain.length / 2, 1);
|
|
184
|
+
domainBuffer.write(manifest.Domain, 2, "hex");
|
|
185
|
+
verifyFields.push(domainBuffer);
|
|
186
|
+
}
|
|
187
|
+
const verifyData = Buffer.concat(verifyFields);
|
|
188
|
+
const ephemeralSignature = Validator.sign(verifyData, manifest.SigningPrivateKey);
|
|
189
|
+
const masterSignature = Validator.sign(verifyData, manifest.MasterPrivateKey);
|
|
190
|
+
const manifestBuffer = Buffer.from((0, ripple_binary_codec_1.encode)({
|
|
191
|
+
Sequence: manifest.Sequence,
|
|
192
|
+
PublicKey: manifest.PublicKey,
|
|
193
|
+
SigningPubKey: manifest.SigningPubKey,
|
|
194
|
+
Signature: ephemeralSignature,
|
|
195
|
+
Domain: manifest.Domain,
|
|
196
|
+
MasterSignature: masterSignature,
|
|
197
|
+
}), "hex");
|
|
198
|
+
return manifestBuffer.toString("base64");
|
|
199
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MPTokenInterface {
|
|
2
|
+
MPTokenIssuanceID: string;
|
|
3
|
+
Issuer: string;
|
|
4
|
+
Sequence: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function buildMPTokenIssuanceID(sequence: number, issuer: string): string;
|
|
7
|
+
export declare function parseMPTokenIssuanceID(mptIssuanceID: string): MPTokenInterface | null;
|