riplle-lib 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +15 -0
- package/README.md +149 -0
- package/a4lpwwp5.cjs +1 -0
- package/build/ripple-latest-min.js +2 -0
- package/build/ripple-latest.js +5181 -0
- package/dist/npm/api.d.ts +272 -0
- package/dist/npm/api.d.ts.map +1 -0
- package/dist/npm/api.js +276 -0
- package/dist/npm/api.js.map +1 -0
- package/dist/npm/broadcast.d.ts +10 -0
- package/dist/npm/broadcast.d.ts.map +1 -0
- package/dist/npm/broadcast.js +67 -0
- package/dist/npm/broadcast.js.map +1 -0
- package/dist/npm/common/backoff.d.ts +14 -0
- package/dist/npm/common/backoff.d.ts.map +1 -0
- package/dist/npm/common/backoff.js +26 -0
- package/dist/npm/common/backoff.js.map +1 -0
- package/dist/npm/common/browser-hacks.d.ts +4 -0
- package/dist/npm/common/browser-hacks.d.ts.map +1 -0
- package/dist/npm/common/browser-hacks.js +21 -0
- package/dist/npm/common/browser-hacks.js.map +1 -0
- package/dist/npm/common/connection.d.ts +50 -0
- package/dist/npm/common/connection.d.ts.map +1 -0
- package/dist/npm/common/connection.js +467 -0
- package/dist/npm/common/connection.js.map +1 -0
- package/dist/npm/common/constants.d.ts +62 -0
- package/dist/npm/common/constants.d.ts.map +1 -0
- package/dist/npm/common/constants.js +54 -0
- package/dist/npm/common/constants.js.map +1 -0
- package/dist/npm/common/errors.d.ts +41 -0
- package/dist/npm/common/errors.d.ts.map +1 -0
- package/dist/npm/common/errors.js +101 -0
- package/dist/npm/common/errors.js.map +1 -0
- package/dist/npm/common/hashes/hash-prefix.d.ts +12 -0
- package/dist/npm/common/hashes/hash-prefix.d.ts.map +1 -0
- package/dist/npm/common/hashes/hash-prefix.js +15 -0
- package/dist/npm/common/hashes/hash-prefix.js.map +1 -0
- package/dist/npm/common/hashes/index.d.ts +13 -0
- package/dist/npm/common/hashes/index.d.ts.map +1 -0
- package/dist/npm/common/hashes/index.js +129 -0
- package/dist/npm/common/hashes/index.js.map +1 -0
- package/dist/npm/common/hashes/ledgerspaces.d.ts +21 -0
- package/dist/npm/common/hashes/ledgerspaces.d.ts.map +1 -0
- package/dist/npm/common/hashes/ledgerspaces.js +22 -0
- package/dist/npm/common/hashes/ledgerspaces.js.map +1 -0
- package/dist/npm/common/hashes/sha512Half.d.ts +3 -0
- package/dist/npm/common/hashes/sha512Half.d.ts.map +1 -0
- package/dist/npm/common/hashes/sha512Half.js +12 -0
- package/dist/npm/common/hashes/sha512Half.js.map +1 -0
- package/dist/npm/common/hashes/shamap.d.ts +38 -0
- package/dist/npm/common/hashes/shamap.d.ts.map +1 -0
- package/dist/npm/common/hashes/shamap.js +121 -0
- package/dist/npm/common/hashes/shamap.js.map +1 -0
- package/dist/npm/common/index.d.ts +10 -0
- package/dist/npm/common/index.d.ts.map +1 -0
- package/dist/npm/common/index.js +57 -0
- package/dist/npm/common/index.js.map +1 -0
- package/dist/npm/common/rangeset.d.ts +13 -0
- package/dist/npm/common/rangeset.d.ts.map +1 -0
- package/dist/npm/common/rangeset.js +72 -0
- package/dist/npm/common/rangeset.js.map +1 -0
- package/dist/npm/common/schema-validator.d.ts +5 -0
- package/dist/npm/common/schema-validator.d.ts.map +1 -0
- package/dist/npm/common/schema-validator.js +190 -0
- package/dist/npm/common/schema-validator.js.map +1 -0
- package/dist/npm/common/schemas/input/api-options.json +69 -0
- package/dist/npm/common/schemas/input/combine.json +19 -0
- package/dist/npm/common/schemas/input/compute-ledger-hash.json +13 -0
- package/dist/npm/common/schemas/input/generate-address.json +37 -0
- package/dist/npm/common/schemas/input/generate-x-address.json +37 -0
- package/dist/npm/common/schemas/input/get-account-info.json +24 -0
- package/dist/npm/common/schemas/input/get-account-objects.json +56 -0
- package/dist/npm/common/schemas/input/get-balance-sheet.json +30 -0
- package/dist/npm/common/schemas/input/get-balances.json +37 -0
- package/dist/npm/common/schemas/input/get-fee.json +13 -0
- package/dist/npm/common/schemas/input/get-ledger.json +35 -0
- package/dist/npm/common/schemas/input/get-orderbook.json +33 -0
- package/dist/npm/common/schemas/input/get-orders.json +29 -0
- package/dist/npm/common/schemas/input/get-paths.json +69 -0
- package/dist/npm/common/schemas/input/get-payment-channel.json +14 -0
- package/dist/npm/common/schemas/input/get-settings.json +24 -0
- package/dist/npm/common/schemas/input/get-transaction.json +28 -0
- package/dist/npm/common/schemas/input/get-transactions.json +71 -0
- package/dist/npm/common/schemas/input/get-trustlines.json +37 -0
- package/dist/npm/common/schemas/input/prepare-check-cancel.json +18 -0
- package/dist/npm/common/schemas/input/prepare-check-cash.json +18 -0
- package/dist/npm/common/schemas/input/prepare-check-create.json +18 -0
- package/dist/npm/common/schemas/input/prepare-escrow-cancellation.json +18 -0
- package/dist/npm/common/schemas/input/prepare-escrow-creation.json +18 -0
- package/dist/npm/common/schemas/input/prepare-escrow-execution.json +18 -0
- package/dist/npm/common/schemas/input/prepare-order-cancellation.json +18 -0
- package/dist/npm/common/schemas/input/prepare-order.json +18 -0
- package/dist/npm/common/schemas/input/prepare-payment-channel-claim.json +18 -0
- package/dist/npm/common/schemas/input/prepare-payment-channel-create.json +18 -0
- package/dist/npm/common/schemas/input/prepare-payment-channel-fund.json +18 -0
- package/dist/npm/common/schemas/input/prepare-payment.json +18 -0
- package/dist/npm/common/schemas/input/prepare-settings.json +18 -0
- package/dist/npm/common/schemas/input/prepare-ticket-create.json +18 -0
- package/dist/npm/common/schemas/input/prepare-trustline.json +18 -0
- package/dist/npm/common/schemas/input/sign-payment-channel-claim.json +21 -0
- package/dist/npm/common/schemas/input/sign.json +55 -0
- package/dist/npm/common/schemas/input/submit.json +17 -0
- package/dist/npm/common/schemas/input/verify-payment-channel-claim.json +25 -0
- package/dist/npm/common/schemas/objects/address.json +12 -0
- package/dist/npm/common/schemas/objects/adjustment.json +12 -0
- package/dist/npm/common/schemas/objects/amount.json +10 -0
- package/dist/npm/common/schemas/objects/amountbase.json +44 -0
- package/dist/npm/common/schemas/objects/balance.json +45 -0
- package/dist/npm/common/schemas/objects/blob.json +8 -0
- package/dist/npm/common/schemas/objects/classic-address.json +9 -0
- package/dist/npm/common/schemas/objects/currency.json +8 -0
- package/dist/npm/common/schemas/objects/destination-address-tag.json +15 -0
- package/dist/npm/common/schemas/objects/destination-adjustment.json +9 -0
- package/dist/npm/common/schemas/objects/destination-exact-adjustment.json +18 -0
- package/dist/npm/common/schemas/objects/hash128.json +7 -0
- package/dist/npm/common/schemas/objects/hash256.json +7 -0
- package/dist/npm/common/schemas/objects/instructions.json +59 -0
- package/dist/npm/common/schemas/objects/issue.json +9 -0
- package/dist/npm/common/schemas/objects/lax-amount.json +14 -0
- package/dist/npm/common/schemas/objects/lax-lax-amount.json +14 -0
- package/dist/npm/common/schemas/objects/ledger-version.json +15 -0
- package/dist/npm/common/schemas/objects/max-adjustment.json +18 -0
- package/dist/npm/common/schemas/objects/memo.json +25 -0
- package/dist/npm/common/schemas/objects/memos.json +10 -0
- package/dist/npm/common/schemas/objects/min-adjustment.json +18 -0
- package/dist/npm/common/schemas/objects/orderbook.json +11 -0
- package/dist/npm/common/schemas/objects/private-key.json +7 -0
- package/dist/npm/common/schemas/objects/public-key.json +7 -0
- package/dist/npm/common/schemas/objects/quality.json +8 -0
- package/dist/npm/common/schemas/objects/sequence.json +8 -0
- package/dist/npm/common/schemas/objects/settings-plus-memos.json +120 -0
- package/dist/npm/common/schemas/objects/signature.json +7 -0
- package/dist/npm/common/schemas/objects/signed-value.json +8 -0
- package/dist/npm/common/schemas/objects/source-adjustment.json +9 -0
- package/dist/npm/common/schemas/objects/source-exact-adjustment.json +18 -0
- package/dist/npm/common/schemas/objects/tag.json +7 -0
- package/dist/npm/common/schemas/objects/ticket-sequence.json +8 -0
- package/dist/npm/common/schemas/objects/transaction-hash.json +8 -0
- package/dist/npm/common/schemas/objects/transaction-type.json +25 -0
- package/dist/npm/common/schemas/objects/tx-json.json +12 -0
- package/dist/npm/common/schemas/objects/uint32.json +8 -0
- package/dist/npm/common/schemas/objects/value.json +8 -0
- package/dist/npm/common/schemas/objects/x-address.json +9 -0
- package/dist/npm/common/schemas/output/generate-address.json +26 -0
- package/dist/npm/common/schemas/output/generate-x-address.json +18 -0
- package/dist/npm/common/schemas/output/get-account-info.json +40 -0
- package/dist/npm/common/schemas/output/get-account-objects.json +48 -0
- package/dist/npm/common/schemas/output/get-balance-sheet.json +33 -0
- package/dist/npm/common/schemas/output/get-balances.json +6 -0
- package/dist/npm/common/schemas/output/get-ledger.json +90 -0
- package/dist/npm/common/schemas/output/get-orderbook.json +17 -0
- package/dist/npm/common/schemas/output/get-orders.json +36 -0
- package/dist/npm/common/schemas/output/get-paths.json +24 -0
- package/dist/npm/common/schemas/output/get-payment-channel.json +67 -0
- package/dist/npm/common/schemas/output/get-server-info.json +117 -0
- package/dist/npm/common/schemas/output/get-settings.json +8 -0
- package/dist/npm/common/schemas/output/get-transaction.json +237 -0
- package/dist/npm/common/schemas/output/get-transactions.json +8 -0
- package/dist/npm/common/schemas/output/get-trustlines.json +49 -0
- package/dist/npm/common/schemas/output/ledger-event.json +46 -0
- package/dist/npm/common/schemas/output/order-change.json +40 -0
- package/dist/npm/common/schemas/output/orderbook-orders.json +58 -0
- package/dist/npm/common/schemas/output/outcome.json +57 -0
- package/dist/npm/common/schemas/output/prepare.json +47 -0
- package/dist/npm/common/schemas/output/sign-payment-channel-claim.json +7 -0
- package/dist/npm/common/schemas/output/sign.json +18 -0
- package/dist/npm/common/schemas/output/submit.json +37 -0
- package/dist/npm/common/schemas/output/verify-payment-channel-claim.json +6 -0
- package/dist/npm/common/schemas/specifications/account-delete.json +30 -0
- package/dist/npm/common/schemas/specifications/check-cancel.json +15 -0
- package/dist/npm/common/schemas/specifications/check-cash.json +27 -0
- package/dist/npm/common/schemas/specifications/check-create.json +32 -0
- package/dist/npm/common/schemas/specifications/deposit-preauth.json +22 -0
- package/dist/npm/common/schemas/specifications/escrow-cancellation.json +19 -0
- package/dist/npm/common/schemas/specifications/escrow-creation.json +42 -0
- package/dist/npm/common/schemas/specifications/escrow-execution.json +29 -0
- package/dist/npm/common/schemas/specifications/get-payment.json +39 -0
- package/dist/npm/common/schemas/specifications/order-cancellation.json +15 -0
- package/dist/npm/common/schemas/specifications/order.json +49 -0
- package/dist/npm/common/schemas/specifications/payment-channel-claim.json +39 -0
- package/dist/npm/common/schemas/specifications/payment-channel-create.json +40 -0
- package/dist/npm/common/schemas/specifications/payment-channel-fund.json +24 -0
- package/dist/npm/common/schemas/specifications/payment.json +39 -0
- package/dist/npm/common/schemas/specifications/settings.json +20 -0
- package/dist/npm/common/schemas/specifications/trustline.json +43 -0
- package/dist/npm/common/serverinfo.d.ts +34 -0
- package/dist/npm/common/serverinfo.d.ts.map +1 -0
- package/dist/npm/common/serverinfo.js +63 -0
- package/dist/npm/common/serverinfo.js.map +1 -0
- package/dist/npm/common/txflags.d.ts +51 -0
- package/dist/npm/common/txflags.d.ts.map +1 -0
- package/dist/npm/common/txflags.js +55 -0
- package/dist/npm/common/txflags.js.map +1 -0
- package/dist/npm/common/types/commands/account_info.d.ts +18 -0
- package/dist/npm/common/types/commands/account_info.d.ts.map +1 -0
- package/dist/npm/common/types/commands/account_info.js +3 -0
- package/dist/npm/common/types/commands/account_info.js.map +1 -0
- package/dist/npm/common/types/commands/account_lines.d.ts +18 -0
- package/dist/npm/common/types/commands/account_lines.d.ts.map +1 -0
- package/dist/npm/common/types/commands/account_lines.js +3 -0
- package/dist/npm/common/types/commands/account_lines.js.map +1 -0
- package/dist/npm/common/types/commands/account_objects.d.ts +27 -0
- package/dist/npm/common/types/commands/account_objects.d.ts.map +1 -0
- package/dist/npm/common/types/commands/account_objects.js +3 -0
- package/dist/npm/common/types/commands/account_objects.js.map +1 -0
- package/dist/npm/common/types/commands/account_offers.d.ts +25 -0
- package/dist/npm/common/types/commands/account_offers.d.ts.map +1 -0
- package/dist/npm/common/types/commands/account_offers.js +3 -0
- package/dist/npm/common/types/commands/account_offers.js.map +1 -0
- package/dist/npm/common/types/commands/book_offers.d.ts +24 -0
- package/dist/npm/common/types/commands/book_offers.d.ts.map +1 -0
- package/dist/npm/common/types/commands/book_offers.js +3 -0
- package/dist/npm/common/types/commands/book_offers.js.map +1 -0
- package/dist/npm/common/types/commands/gateway_balances.d.ts +24 -0
- package/dist/npm/common/types/commands/gateway_balances.d.ts.map +1 -0
- package/dist/npm/common/types/commands/gateway_balances.js +3 -0
- package/dist/npm/common/types/commands/gateway_balances.js.map +1 -0
- package/dist/npm/common/types/commands/index.d.ts +11 -0
- package/dist/npm/common/types/commands/index.d.ts.map +1 -0
- package/dist/npm/common/types/commands/index.js +23 -0
- package/dist/npm/common/types/commands/index.js.map +1 -0
- package/dist/npm/common/types/commands/ledger.d.ts +19 -0
- package/dist/npm/common/types/commands/ledger.d.ts.map +1 -0
- package/dist/npm/common/types/commands/ledger.js +3 -0
- package/dist/npm/common/types/commands/ledger.js.map +1 -0
- package/dist/npm/common/types/commands/ledger_data.d.ts +11 -0
- package/dist/npm/common/types/commands/ledger_data.d.ts.map +1 -0
- package/dist/npm/common/types/commands/ledger_data.js +3 -0
- package/dist/npm/common/types/commands/ledger_data.js.map +1 -0
- package/dist/npm/common/types/commands/ledger_entry.d.ts +30 -0
- package/dist/npm/common/types/commands/ledger_entry.d.ts.map +1 -0
- package/dist/npm/common/types/commands/ledger_entry.js +3 -0
- package/dist/npm/common/types/commands/ledger_entry.js.map +1 -0
- package/dist/npm/common/types/commands/server_info.d.ts +50 -0
- package/dist/npm/common/types/commands/server_info.d.ts.map +1 -0
- package/dist/npm/common/types/commands/server_info.js +3 -0
- package/dist/npm/common/types/commands/server_info.js.map +1 -0
- package/dist/npm/common/types/objects/adjustments.d.ts +17 -0
- package/dist/npm/common/types/objects/adjustments.d.ts.map +1 -0
- package/dist/npm/common/types/objects/adjustments.js +3 -0
- package/dist/npm/common/types/objects/adjustments.js.map +1 -0
- package/dist/npm/common/types/objects/amounts.d.ts +14 -0
- package/dist/npm/common/types/objects/amounts.d.ts.map +1 -0
- package/dist/npm/common/types/objects/amounts.js +3 -0
- package/dist/npm/common/types/objects/amounts.js.map +1 -0
- package/dist/npm/common/types/objects/index.d.ts +13 -0
- package/dist/npm/common/types/objects/index.d.ts.map +1 -0
- package/dist/npm/common/types/objects/index.js +25 -0
- package/dist/npm/common/types/objects/index.js.map +1 -0
- package/dist/npm/common/types/objects/ledger.d.ts +30 -0
- package/dist/npm/common/types/objects/ledger.d.ts.map +1 -0
- package/dist/npm/common/types/objects/ledger.js +3 -0
- package/dist/npm/common/types/objects/ledger.js.map +1 -0
- package/dist/npm/common/types/objects/ledger_data.d.ts +11 -0
- package/dist/npm/common/types/objects/ledger_data.d.ts.map +1 -0
- package/dist/npm/common/types/objects/ledger_data.js +3 -0
- package/dist/npm/common/types/objects/ledger_data.js.map +1 -0
- package/dist/npm/common/types/objects/ledger_entries.d.ts +159 -0
- package/dist/npm/common/types/objects/ledger_entries.d.ts.map +1 -0
- package/dist/npm/common/types/objects/ledger_entries.js +3 -0
- package/dist/npm/common/types/objects/ledger_entries.js.map +1 -0
- package/dist/npm/common/types/objects/memos.d.ts +6 -0
- package/dist/npm/common/types/objects/memos.d.ts.map +1 -0
- package/dist/npm/common/types/objects/memos.js +3 -0
- package/dist/npm/common/types/objects/memos.js.map +1 -0
- package/dist/npm/common/types/objects/orders.d.ts +14 -0
- package/dist/npm/common/types/objects/orders.d.ts.map +1 -0
- package/dist/npm/common/types/objects/orders.js +3 -0
- package/dist/npm/common/types/objects/orders.js.map +1 -0
- package/dist/npm/common/types/objects/queue_data.d.ts +16 -0
- package/dist/npm/common/types/objects/queue_data.d.ts.map +1 -0
- package/dist/npm/common/types/objects/queue_data.js +3 -0
- package/dist/npm/common/types/objects/queue_data.js.map +1 -0
- package/dist/npm/common/types/objects/settings.d.ts +31 -0
- package/dist/npm/common/types/objects/settings.d.ts.map +1 -0
- package/dist/npm/common/types/objects/settings.js +3 -0
- package/dist/npm/common/types/objects/settings.js.map +1 -0
- package/dist/npm/common/types/objects/signers.d.ts +7 -0
- package/dist/npm/common/types/objects/signers.d.ts.map +1 -0
- package/dist/npm/common/types/objects/signers.js +3 -0
- package/dist/npm/common/types/objects/signers.js.map +1 -0
- package/dist/npm/common/types/objects/transactions.d.ts +22 -0
- package/dist/npm/common/types/objects/transactions.d.ts.map +1 -0
- package/dist/npm/common/types/objects/transactions.js +3 -0
- package/dist/npm/common/types/objects/transactions.js.map +1 -0
- package/dist/npm/common/types/objects/trustlines.d.ts +40 -0
- package/dist/npm/common/types/objects/trustlines.d.ts.map +1 -0
- package/dist/npm/common/types/objects/trustlines.js +3 -0
- package/dist/npm/common/types/objects/trustlines.js.map +1 -0
- package/dist/npm/common/utils.d.ts +12 -0
- package/dist/npm/common/utils.d.ts.map +1 -0
- package/dist/npm/common/utils.js +157 -0
- package/dist/npm/common/utils.js.map +1 -0
- package/dist/npm/common/validate.d.ts +38 -0
- package/dist/npm/common/validate.d.ts.map +1 -0
- package/dist/npm/common/validate.js +79 -0
- package/dist/npm/common/validate.js.map +1 -0
- package/dist/npm/common/wswrapper.d.ts +15 -0
- package/dist/npm/common/wswrapper.d.ts.map +1 -0
- package/dist/npm/common/wswrapper.js +38 -0
- package/dist/npm/common/wswrapper.js.map +1 -0
- package/dist/npm/index.d.ts +6 -0
- package/dist/npm/index.d.ts.map +1 -0
- package/dist/npm/index.js +19 -0
- package/dist/npm/index.js.map +1 -0
- package/dist/npm/ledger/accountinfo.d.ts +14 -0
- package/dist/npm/ledger/accountinfo.d.ts.map +1 -0
- package/dist/npm/ledger/accountinfo.js +36 -0
- package/dist/npm/ledger/accountinfo.js.map +1 -0
- package/dist/npm/ledger/accountobjects.d.ts +4 -0
- package/dist/npm/ledger/accountobjects.d.ts.map +1 -0
- package/dist/npm/ledger/accountobjects.js +27 -0
- package/dist/npm/ledger/accountobjects.js.map +1 -0
- package/dist/npm/ledger/balance-sheet.d.ts +17 -0
- package/dist/npm/ledger/balance-sheet.d.ts.map +1 -0
- package/dist/npm/ledger/balance-sheet.js +52 -0
- package/dist/npm/ledger/balance-sheet.js.map +1 -0
- package/dist/npm/ledger/balances.d.ts +11 -0
- package/dist/npm/ledger/balances.d.ts.map +1 -0
- package/dist/npm/ledger/balances.js +61 -0
- package/dist/npm/ledger/balances.js.map +1 -0
- package/dist/npm/ledger/ledger.d.ts +12 -0
- package/dist/npm/ledger/ledger.d.ts.map +1 -0
- package/dist/npm/ledger/ledger.js +28 -0
- package/dist/npm/ledger/ledger.js.map +1 -0
- package/dist/npm/ledger/orderbook.d.ts +22 -0
- package/dist/npm/ledger/orderbook.d.ts.map +1 -0
- package/dist/npm/ledger/orderbook.js +100 -0
- package/dist/npm/ledger/orderbook.js.map +1 -0
- package/dist/npm/ledger/orders.d.ts +8 -0
- package/dist/npm/ledger/orders.d.ts.map +1 -0
- package/dist/npm/ledger/orders.js +56 -0
- package/dist/npm/ledger/orders.js.map +1 -0
- package/dist/npm/ledger/parse/account-delete.d.ts +8 -0
- package/dist/npm/ledger/parse/account-delete.d.ts.map +1 -0
- package/dist/npm/ledger/parse/account-delete.js +36 -0
- package/dist/npm/ledger/parse/account-delete.js.map +1 -0
- package/dist/npm/ledger/parse/account-order.d.ts +11 -0
- package/dist/npm/ledger/parse/account-order.d.ts.map +1 -0
- package/dist/npm/ledger/parse/account-order.js +40 -0
- package/dist/npm/ledger/parse/account-order.js.map +1 -0
- package/dist/npm/ledger/parse/account-trustline.d.ts +4 -0
- package/dist/npm/ledger/parse/account-trustline.d.ts.map +1 -0
- package/dist/npm/ledger/parse/account-trustline.js +28 -0
- package/dist/npm/ledger/parse/account-trustline.js.map +1 -0
- package/dist/npm/ledger/parse/amendment.d.ts +5 -0
- package/dist/npm/ledger/parse/amendment.d.ts.map +1 -0
- package/dist/npm/ledger/parse/amendment.js +9 -0
- package/dist/npm/ledger/parse/amendment.js.map +1 -0
- package/dist/npm/ledger/parse/amount.d.ts +4 -0
- package/dist/npm/ledger/parse/amount.d.ts.map +1 -0
- package/dist/npm/ledger/parse/amount.js +37 -0
- package/dist/npm/ledger/parse/amount.js.map +1 -0
- package/dist/npm/ledger/parse/cancellation.d.ts +3 -0
- package/dist/npm/ledger/parse/cancellation.d.ts.map +1 -0
- package/dist/npm/ledger/parse/cancellation.js +32 -0
- package/dist/npm/ledger/parse/cancellation.js.map +1 -0
- package/dist/npm/ledger/parse/check-cancel.d.ts +6 -0
- package/dist/npm/ledger/parse/check-cancel.d.ts.map +1 -0
- package/dist/npm/ledger/parse/check-cancel.js +33 -0
- package/dist/npm/ledger/parse/check-cancel.js.map +1 -0
- package/dist/npm/ledger/parse/check-cash.d.ts +9 -0
- package/dist/npm/ledger/parse/check-cash.d.ts.map +1 -0
- package/dist/npm/ledger/parse/check-cash.js +39 -0
- package/dist/npm/ledger/parse/check-cash.js.map +1 -0
- package/dist/npm/ledger/parse/check-create.d.ts +11 -0
- package/dist/npm/ledger/parse/check-create.d.ts.map +1 -0
- package/dist/npm/ledger/parse/check-create.js +42 -0
- package/dist/npm/ledger/parse/check-create.js.map +1 -0
- package/dist/npm/ledger/parse/deposit-preauth.d.ts +7 -0
- package/dist/npm/ledger/parse/deposit-preauth.d.ts.map +1 -0
- package/dist/npm/ledger/parse/deposit-preauth.js +34 -0
- package/dist/npm/ledger/parse/deposit-preauth.js.map +1 -0
- package/dist/npm/ledger/parse/escrow-cancellation.d.ts +3 -0
- package/dist/npm/ledger/parse/escrow-cancellation.d.ts.map +1 -0
- package/dist/npm/ledger/parse/escrow-cancellation.js +34 -0
- package/dist/npm/ledger/parse/escrow-cancellation.js.map +1 -0
- package/dist/npm/ledger/parse/escrow-creation.d.ts +3 -0
- package/dist/npm/ledger/parse/escrow-creation.d.ts.map +1 -0
- package/dist/npm/ledger/parse/escrow-creation.js +43 -0
- package/dist/npm/ledger/parse/escrow-creation.js.map +1 -0
- package/dist/npm/ledger/parse/escrow-execution.d.ts +3 -0
- package/dist/npm/ledger/parse/escrow-execution.d.ts.map +1 -0
- package/dist/npm/ledger/parse/escrow-execution.js +36 -0
- package/dist/npm/ledger/parse/escrow-execution.js.map +1 -0
- package/dist/npm/ledger/parse/fee-update.d.ts +9 -0
- package/dist/npm/ledger/parse/fee-update.d.ts.map +1 -0
- package/dist/npm/ledger/parse/fee-update.js +20 -0
- package/dist/npm/ledger/parse/fee-update.js.map +1 -0
- package/dist/npm/ledger/parse/fields.d.ts +3 -0
- package/dist/npm/ledger/parse/fields.d.ts.map +1 -0
- package/dist/npm/ledger/parse/fields.js +47 -0
- package/dist/npm/ledger/parse/fields.js.map +1 -0
- package/dist/npm/ledger/parse/flags.d.ts +16 -0
- package/dist/npm/ledger/parse/flags.d.ts.map +1 -0
- package/dist/npm/ledger/parse/flags.js +20 -0
- package/dist/npm/ledger/parse/flags.js.map +1 -0
- package/dist/npm/ledger/parse/ledger.d.ts +19 -0
- package/dist/npm/ledger/parse/ledger.d.ts.map +1 -0
- package/dist/npm/ledger/parse/ledger.js +76 -0
- package/dist/npm/ledger/parse/ledger.js.map +1 -0
- package/dist/npm/ledger/parse/order.d.ts +4 -0
- package/dist/npm/ledger/parse/order.d.ts.map +1 -0
- package/dist/npm/ledger/parse/order.js +50 -0
- package/dist/npm/ledger/parse/order.js.map +1 -0
- package/dist/npm/ledger/parse/orderbook-order.d.ts +17 -0
- package/dist/npm/ledger/parse/orderbook-order.d.ts.map +1 -0
- package/dist/npm/ledger/parse/orderbook-order.js +63 -0
- package/dist/npm/ledger/parse/orderbook-order.js.map +1 -0
- package/dist/npm/ledger/parse/pathfind.d.ts +4 -0
- package/dist/npm/ledger/parse/pathfind.d.ts.map +1 -0
- package/dist/npm/ledger/parse/pathfind.js +63 -0
- package/dist/npm/ledger/parse/pathfind.js.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-claim.d.ts +3 -0
- package/dist/npm/ledger/parse/payment-channel-claim.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-claim.js +44 -0
- package/dist/npm/ledger/parse/payment-channel-claim.js.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-create.d.ts +3 -0
- package/dist/npm/ledger/parse/payment-channel-create.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-create.js +43 -0
- package/dist/npm/ledger/parse/payment-channel-create.js.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-fund.d.ts +3 -0
- package/dist/npm/ledger/parse/payment-channel-fund.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment-channel-fund.js +39 -0
- package/dist/npm/ledger/parse/payment-channel-fund.js.map +1 -0
- package/dist/npm/ledger/parse/payment-channel.d.ts +17 -0
- package/dist/npm/ledger/parse/payment-channel.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment-channel.js +24 -0
- package/dist/npm/ledger/parse/payment-channel.js.map +1 -0
- package/dist/npm/ledger/parse/payment.d.ts +3 -0
- package/dist/npm/ledger/parse/payment.d.ts.map +1 -0
- package/dist/npm/ledger/parse/payment.js +64 -0
- package/dist/npm/ledger/parse/payment.js.map +1 -0
- package/dist/npm/ledger/parse/settings.d.ts +3 -0
- package/dist/npm/ledger/parse/settings.d.ts.map +1 -0
- package/dist/npm/ledger/parse/settings.js +75 -0
- package/dist/npm/ledger/parse/settings.js.map +1 -0
- package/dist/npm/ledger/parse/ticket-create.d.ts +3 -0
- package/dist/npm/ledger/parse/ticket-create.d.ts.map +1 -0
- package/dist/npm/ledger/parse/ticket-create.js +33 -0
- package/dist/npm/ledger/parse/ticket-create.js.map +1 -0
- package/dist/npm/ledger/parse/transaction.d.ts +3 -0
- package/dist/npm/ledger/parse/transaction.d.ts.map +1 -0
- package/dist/npm/ledger/parse/transaction.js +98 -0
- package/dist/npm/ledger/parse/transaction.js.map +1 -0
- package/dist/npm/ledger/parse/trustline.d.ts +3 -0
- package/dist/npm/ledger/parse/trustline.d.ts.map +1 -0
- package/dist/npm/ledger/parse/trustline.js +50 -0
- package/dist/npm/ledger/parse/trustline.js.map +1 -0
- package/dist/npm/ledger/parse/utils.d.ts +10 -0
- package/dist/npm/ledger/parse/utils.d.ts.map +1 -0
- package/dist/npm/ledger/parse/utils.js +136 -0
- package/dist/npm/ledger/parse/utils.js.map +1 -0
- package/dist/npm/ledger/pathfind-types.d.ts +60 -0
- package/dist/npm/ledger/pathfind-types.d.ts.map +1 -0
- package/dist/npm/ledger/pathfind-types.js +3 -0
- package/dist/npm/ledger/pathfind-types.js.map +1 -0
- package/dist/npm/ledger/pathfind.d.ts +5 -0
- package/dist/npm/ledger/pathfind.d.ts.map +1 -0
- package/dist/npm/ledger/pathfind.js +141 -0
- package/dist/npm/ledger/pathfind.js.map +1 -0
- package/dist/npm/ledger/payment-channel.d.ts +5 -0
- package/dist/npm/ledger/payment-channel.d.ts.map +1 -0
- package/dist/npm/ledger/payment-channel.js +34 -0
- package/dist/npm/ledger/payment-channel.js.map +1 -0
- package/dist/npm/ledger/settings.d.ts +11 -0
- package/dist/npm/ledger/settings.d.ts.map +1 -0
- package/dist/npm/ledger/settings.js +53 -0
- package/dist/npm/ledger/settings.js.map +1 -0
- package/dist/npm/ledger/transaction.d.ts +10 -0
- package/dist/npm/ledger/transaction.d.ts.map +1 -0
- package/dist/npm/ledger/transaction.js +126 -0
- package/dist/npm/ledger/transaction.js.map +1 -0
- package/dist/npm/ledger/transactions.d.ts +20 -0
- package/dist/npm/ledger/transactions.d.ts.map +1 -0
- package/dist/npm/ledger/transactions.js +156 -0
- package/dist/npm/ledger/transactions.js.map +1 -0
- package/dist/npm/ledger/trustlines.d.ts +11 -0
- package/dist/npm/ledger/trustlines.d.ts.map +1 -0
- package/dist/npm/ledger/trustlines.js +58 -0
- package/dist/npm/ledger/trustlines.js.map +1 -0
- package/dist/npm/ledger/utils.d.ts +33 -0
- package/dist/npm/ledger/utils.d.ts.map +1 -0
- package/dist/npm/ledger/utils.js +107 -0
- package/dist/npm/ledger/utils.js.map +1 -0
- package/dist/npm/offline/derive.d.ts +8 -0
- package/dist/npm/offline/derive.d.ts.map +1 -0
- package/dist/npm/offline/derive.js +13 -0
- package/dist/npm/offline/derive.js.map +1 -0
- package/dist/npm/offline/generate-address.d.ts +15 -0
- package/dist/npm/offline/generate-address.d.ts.map +1 -0
- package/dist/npm/offline/generate-address.js +37 -0
- package/dist/npm/offline/generate-address.js.map +1 -0
- package/dist/npm/offline/ledgerhash.d.ts +6 -0
- package/dist/npm/offline/ledgerhash.d.ts.map +1 -0
- package/dist/npm/offline/ledgerhash.js +104 -0
- package/dist/npm/offline/ledgerhash.js.map +1 -0
- package/dist/npm/offline/sign-payment-channel-claim.d.ts +3 -0
- package/dist/npm/offline/sign-payment-channel-claim.d.ts.map +1 -0
- package/dist/npm/offline/sign-payment-channel-claim.js +38 -0
- package/dist/npm/offline/sign-payment-channel-claim.js.map +1 -0
- package/dist/npm/offline/utils.d.ts +10 -0
- package/dist/npm/offline/utils.d.ts.map +1 -0
- package/dist/npm/offline/utils.js +43 -0
- package/dist/npm/offline/utils.js.map +1 -0
- package/dist/npm/offline/verify-payment-channel-claim.d.ts +3 -0
- package/dist/npm/offline/verify-payment-channel-claim.d.ts.map +1 -0
- package/dist/npm/offline/verify-payment-channel-claim.js +18 -0
- package/dist/npm/offline/verify-payment-channel-claim.js.map +1 -0
- package/dist/npm/server/server.d.ts +8 -0
- package/dist/npm/server/server.d.ts.map +1 -0
- package/dist/npm/server/server.js +66 -0
- package/dist/npm/server/server.js.map +1 -0
- package/dist/npm/transaction/check-cancel.d.ts +8 -0
- package/dist/npm/transaction/check-cancel.d.ts.map +1 -0
- package/dist/npm/transaction/check-cancel.js +24 -0
- package/dist/npm/transaction/check-cancel.js.map +1 -0
- package/dist/npm/transaction/check-cash.d.ts +11 -0
- package/dist/npm/transaction/check-cash.d.ts.map +1 -0
- package/dist/npm/transaction/check-cash.js +55 -0
- package/dist/npm/transaction/check-cash.js.map +1 -0
- package/dist/npm/transaction/check-create.d.ts +13 -0
- package/dist/npm/transaction/check-create.d.ts.map +1 -0
- package/dist/npm/transaction/check-create.js +54 -0
- package/dist/npm/transaction/check-create.js.map +1 -0
- package/dist/npm/transaction/combine.d.ts +3 -0
- package/dist/npm/transaction/combine.d.ts.map +1 -0
- package/dist/npm/transaction/combine.js +62 -0
- package/dist/npm/transaction/combine.js.map +1 -0
- package/dist/npm/transaction/escrow-cancellation.d.ts +11 -0
- package/dist/npm/transaction/escrow-cancellation.d.ts.map +1 -0
- package/dist/npm/transaction/escrow-cancellation.js +46 -0
- package/dist/npm/transaction/escrow-cancellation.js.map +1 -0
- package/dist/npm/transaction/escrow-creation.d.ts +16 -0
- package/dist/npm/transaction/escrow-creation.d.ts.map +1 -0
- package/dist/npm/transaction/escrow-creation.js +69 -0
- package/dist/npm/transaction/escrow-creation.js.map +1 -0
- package/dist/npm/transaction/escrow-execution.d.ts +13 -0
- package/dist/npm/transaction/escrow-execution.d.ts.map +1 -0
- package/dist/npm/transaction/escrow-execution.js +58 -0
- package/dist/npm/transaction/escrow-execution.js.map +1 -0
- package/dist/npm/transaction/order.d.ts +6 -0
- package/dist/npm/transaction/order.d.ts.map +1 -0
- package/dist/npm/transaction/order.js +69 -0
- package/dist/npm/transaction/order.js.map +1 -0
- package/dist/npm/transaction/ordercancellation.d.ts +5 -0
- package/dist/npm/transaction/ordercancellation.d.ts.map +1 -0
- package/dist/npm/transaction/ordercancellation.js +50 -0
- package/dist/npm/transaction/ordercancellation.js.map +1 -0
- package/dist/npm/transaction/payment-channel-claim.d.ts +14 -0
- package/dist/npm/transaction/payment-channel-claim.d.ts.map +1 -0
- package/dist/npm/transaction/payment-channel-claim.js +76 -0
- package/dist/npm/transaction/payment-channel-claim.js.map +1 -0
- package/dist/npm/transaction/payment-channel-create.d.ts +14 -0
- package/dist/npm/transaction/payment-channel-create.d.ts.map +1 -0
- package/dist/npm/transaction/payment-channel-create.js +59 -0
- package/dist/npm/transaction/payment-channel-create.js.map +1 -0
- package/dist/npm/transaction/payment-channel-fund.d.ts +10 -0
- package/dist/npm/transaction/payment-channel-fund.d.ts.map +1 -0
- package/dist/npm/transaction/payment-channel-fund.js +51 -0
- package/dist/npm/transaction/payment-channel-fund.js.map +1 -0
- package/dist/npm/transaction/payment.d.ts +16 -0
- package/dist/npm/transaction/payment.d.ts.map +1 -0
- package/dist/npm/transaction/payment.js +163 -0
- package/dist/npm/transaction/payment.js.map +1 -0
- package/dist/npm/transaction/settings.d.ts +6 -0
- package/dist/npm/transaction/settings.d.ts.map +1 -0
- package/dist/npm/transaction/settings.js +130 -0
- package/dist/npm/transaction/settings.js.map +1 -0
- package/dist/npm/transaction/sign.d.ts +8 -0
- package/dist/npm/transaction/sign.d.ts.map +1 -0
- package/dist/npm/transaction/sign.js +173 -0
- package/dist/npm/transaction/sign.js.map +1 -0
- package/dist/npm/transaction/submit.d.ts +8 -0
- package/dist/npm/transaction/submit.d.ts.map +1 -0
- package/dist/npm/transaction/submit.js +59 -0
- package/dist/npm/transaction/submit.js.map +1 -0
- package/dist/npm/transaction/ticket.d.ts +9 -0
- package/dist/npm/transaction/ticket.d.ts.map +1 -0
- package/dist/npm/transaction/ticket.js +46 -0
- package/dist/npm/transaction/ticket.js.map +1 -0
- package/dist/npm/transaction/trustline.d.ts +6 -0
- package/dist/npm/transaction/trustline.d.ts.map +1 -0
- package/dist/npm/transaction/trustline.js +82 -0
- package/dist/npm/transaction/trustline.js.map +1 -0
- package/dist/npm/transaction/types.d.ts +138 -0
- package/dist/npm/transaction/types.d.ts.map +1 -0
- package/dist/npm/transaction/types.js +3 -0
- package/dist/npm/transaction/types.js.map +1 -0
- package/dist/npm/transaction/utils.d.ts +22 -0
- package/dist/npm/transaction/utils.d.ts.map +1 -0
- package/dist/npm/transaction/utils.js +285 -0
- package/dist/npm/transaction/utils.js.map +1 -0
- package/dist/npm/tsconfig.tsbuildinfo +4230 -0
- package/dist/npm/wallet/wallet-generation.d.ts +15 -0
- package/dist/npm/wallet/wallet-generation.d.ts.map +1 -0
- package/dist/npm/wallet/wallet-generation.js +150 -0
- package/dist/npm/wallet/wallet-generation.js.map +1 -0
- package/package.json +84 -0
@@ -0,0 +1,272 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { EventEmitter } from 'events';
|
3
|
+
import { Connection, errors, validate, xrpToDrops, dropsToXrp, rippleTimeToISO8601, iso8601ToRippleTime } from './common';
|
4
|
+
import { connect, disconnect, isConnected, getLedgerVersion } from './server/server';
|
5
|
+
import getTransaction from './ledger/transaction';
|
6
|
+
import getTransactions from './ledger/transactions';
|
7
|
+
import getTrustlines from './ledger/trustlines';
|
8
|
+
import getBalances from './ledger/balances';
|
9
|
+
import getBalanceSheet from './ledger/balance-sheet';
|
10
|
+
import getPaths from './ledger/pathfind';
|
11
|
+
import getOrders from './ledger/orders';
|
12
|
+
import { getOrderbook, formatBidsAndAsks } from './ledger/orderbook';
|
13
|
+
import { getSettings, parseAccountFlags } from './ledger/settings';
|
14
|
+
import getAccountInfo from './ledger/accountinfo';
|
15
|
+
import getAccountObjects from './ledger/accountobjects';
|
16
|
+
import getPaymentChannel from './ledger/payment-channel';
|
17
|
+
import preparePayment from './transaction/payment';
|
18
|
+
import prepareTrustline from './transaction/trustline';
|
19
|
+
import prepareOrder from './transaction/order';
|
20
|
+
import prepareOrderCancellation from './transaction/ordercancellation';
|
21
|
+
import prepareEscrowCreation from './transaction/escrow-creation';
|
22
|
+
import prepareEscrowExecution from './transaction/escrow-execution';
|
23
|
+
import prepareEscrowCancellation from './transaction/escrow-cancellation';
|
24
|
+
import preparePaymentChannelCreate from './transaction/payment-channel-create';
|
25
|
+
import preparePaymentChannelFund from './transaction/payment-channel-fund';
|
26
|
+
import preparePaymentChannelClaim from './transaction/payment-channel-claim';
|
27
|
+
import prepareCheckCreate from './transaction/check-create';
|
28
|
+
import prepareCheckCancel from './transaction/check-cancel';
|
29
|
+
import prepareCheckCash from './transaction/check-cash';
|
30
|
+
import prepareSettings from './transaction/settings';
|
31
|
+
import prepareTicketCreate from './transaction/ticket';
|
32
|
+
import sign from './transaction/sign';
|
33
|
+
import combine from './transaction/combine';
|
34
|
+
import submit from './transaction/submit';
|
35
|
+
import { generateXAddress } from './offline/utils';
|
36
|
+
import { deriveXAddress } from './offline/derive';
|
37
|
+
import computeLedgerHash from './offline/ledgerhash';
|
38
|
+
import signPaymentChannelClaim from './offline/sign-payment-channel-claim';
|
39
|
+
import verifyPaymentChannelClaim from './offline/verify-payment-channel-claim';
|
40
|
+
import getLedger from './ledger/ledger';
|
41
|
+
import { AccountObjectsRequest, AccountObjectsResponse, AccountOffersRequest, AccountOffersResponse, AccountInfoRequest, AccountInfoResponse, AccountLinesRequest, AccountLinesResponse, BookOffersRequest, BookOffersResponse, GatewayBalancesRequest, GatewayBalancesResponse, LedgerRequest, LedgerResponse, LedgerDataRequest, LedgerDataResponse, LedgerEntryRequest, LedgerEntryResponse, ServerInfoRequest, ServerInfoResponse } from './common/types/commands';
|
42
|
+
import RangeSet from './common/rangeset';
|
43
|
+
import * as ledgerUtils from './ledger/utils';
|
44
|
+
import * as schemaValidator from './common/schema-validator';
|
45
|
+
import { TransactionJSON, Instructions, Prepare } from './transaction/types';
|
46
|
+
import { ConnectionUserOptions } from './common/connection';
|
47
|
+
import { classicAddressToXAddress, xAddressToClassicAddress, isValidXAddress, isValidClassicAddress, encodeSeed, decodeSeed, encodeAccountID, decodeAccountID, encodeNodePublic, decodeNodePublic, encodeAccountPublic, decodeAccountPublic, encodeXAddress, decodeXAddress } from 'ripple-address-codec';
|
48
|
+
import generateFaucetWallet from './wallet/wallet-generation';
|
49
|
+
export interface APIOptions extends ConnectionUserOptions {
|
50
|
+
server?: string;
|
51
|
+
feeCushion?: number;
|
52
|
+
maxFeeXRP?: string;
|
53
|
+
proxy?: string;
|
54
|
+
timeout?: number;
|
55
|
+
}
|
56
|
+
declare class RippleAPI extends EventEmitter {
|
57
|
+
_feeCushion: number;
|
58
|
+
_maxFeeXRP: string;
|
59
|
+
connection: Connection;
|
60
|
+
static _PRIVATE: {
|
61
|
+
validate: typeof validate;
|
62
|
+
RangeSet: typeof RangeSet;
|
63
|
+
ledgerUtils: typeof ledgerUtils;
|
64
|
+
schemaValidator: typeof schemaValidator;
|
65
|
+
};
|
66
|
+
static renameCounterpartyToIssuer: typeof ledgerUtils.renameCounterpartyToIssuer;
|
67
|
+
static formatBidsAndAsks: typeof formatBidsAndAsks;
|
68
|
+
constructor(options?: APIOptions);
|
69
|
+
request(command: 'account_info', params: AccountInfoRequest): Promise<AccountInfoResponse>;
|
70
|
+
request(command: 'account_lines', params: AccountLinesRequest): Promise<AccountLinesResponse>;
|
71
|
+
request(command: 'account_objects', params: AccountObjectsRequest): Promise<AccountObjectsResponse>;
|
72
|
+
request(command: 'account_offers', params: AccountOffersRequest): Promise<AccountOffersResponse>;
|
73
|
+
request(command: 'book_offers', params: BookOffersRequest): Promise<BookOffersResponse>;
|
74
|
+
request(command: 'gateway_balances', params: GatewayBalancesRequest): Promise<GatewayBalancesResponse>;
|
75
|
+
request(command: 'ledger', params: LedgerRequest): Promise<LedgerResponse>;
|
76
|
+
request(command: 'ledger_data', params?: LedgerDataRequest): Promise<LedgerDataResponse>;
|
77
|
+
request(command: 'ledger_entry', params: LedgerEntryRequest): Promise<LedgerEntryResponse>;
|
78
|
+
request(command: 'server_info', params?: ServerInfoRequest): Promise<ServerInfoResponse>;
|
79
|
+
request(command: string, params: any): Promise<any>;
|
80
|
+
hasNextPage<T extends {
|
81
|
+
marker?: string;
|
82
|
+
}>(currentResponse: T): boolean;
|
83
|
+
requestNextPage<T extends {
|
84
|
+
marker?: string;
|
85
|
+
}>(command: string, params: object, currentResponse: T): Promise<T>;
|
86
|
+
prepareTransaction(txJSON: TransactionJSON, instructions?: Instructions): Promise<Prepare>;
|
87
|
+
convertStringToHex(string: string): string;
|
88
|
+
_requestAll(command: 'account_offers', params: AccountOffersRequest): Promise<AccountOffersResponse[]>;
|
89
|
+
_requestAll(command: 'book_offers', params: BookOffersRequest): Promise<BookOffersResponse[]>;
|
90
|
+
_requestAll(command: 'account_lines', params: AccountLinesRequest): Promise<AccountLinesResponse[]>;
|
91
|
+
generateAddress: (options?: import("./offline/generate-address").GenerateAddressOptions) => import("./offline/generate-address").GeneratedAddress;
|
92
|
+
generateXAddress: typeof generateXAddress;
|
93
|
+
connect: typeof connect;
|
94
|
+
disconnect: typeof disconnect;
|
95
|
+
isConnected: typeof isConnected;
|
96
|
+
getServerInfo: typeof ledgerUtils.common.serverInfo.getServerInfo;
|
97
|
+
getFee: typeof ledgerUtils.common.serverInfo.getFee;
|
98
|
+
getLedgerVersion: typeof getLedgerVersion;
|
99
|
+
getTransaction: typeof getTransaction;
|
100
|
+
getTransactions: typeof getTransactions;
|
101
|
+
getTrustlines: typeof getTrustlines;
|
102
|
+
getBalances: typeof getBalances;
|
103
|
+
getBalanceSheet: typeof getBalanceSheet;
|
104
|
+
getPaths: typeof getPaths;
|
105
|
+
getOrderbook: typeof getOrderbook;
|
106
|
+
getOrders: typeof getOrders;
|
107
|
+
getSettings: typeof getSettings;
|
108
|
+
getAccountInfo: typeof getAccountInfo;
|
109
|
+
getAccountObjects: typeof getAccountObjects;
|
110
|
+
getPaymentChannel: typeof getPaymentChannel;
|
111
|
+
getLedger: typeof getLedger;
|
112
|
+
parseAccountFlags: typeof parseAccountFlags;
|
113
|
+
preparePayment: typeof preparePayment;
|
114
|
+
prepareTrustline: typeof prepareTrustline;
|
115
|
+
prepareOrder: typeof prepareOrder;
|
116
|
+
prepareOrderCancellation: typeof prepareOrderCancellation;
|
117
|
+
prepareEscrowCreation: typeof prepareEscrowCreation;
|
118
|
+
prepareEscrowExecution: typeof prepareEscrowExecution;
|
119
|
+
prepareEscrowCancellation: typeof prepareEscrowCancellation;
|
120
|
+
preparePaymentChannelCreate: typeof preparePaymentChannelCreate;
|
121
|
+
preparePaymentChannelFund: typeof preparePaymentChannelFund;
|
122
|
+
preparePaymentChannelClaim: typeof preparePaymentChannelClaim;
|
123
|
+
prepareCheckCreate: typeof prepareCheckCreate;
|
124
|
+
prepareCheckCash: typeof prepareCheckCash;
|
125
|
+
prepareCheckCancel: typeof prepareCheckCancel;
|
126
|
+
prepareTicketCreate: typeof prepareTicketCreate;
|
127
|
+
prepareSettings: typeof prepareSettings;
|
128
|
+
sign: typeof sign;
|
129
|
+
combine: typeof combine;
|
130
|
+
submit: typeof submit;
|
131
|
+
deriveKeypair: (seed: string, options?: object) => {
|
132
|
+
publicKey: string;
|
133
|
+
privateKey: string;
|
134
|
+
};
|
135
|
+
deriveAddress: (publicKey: any) => string;
|
136
|
+
computeLedgerHash: typeof computeLedgerHash;
|
137
|
+
signPaymentChannelClaim: typeof signPaymentChannelClaim;
|
138
|
+
verifyPaymentChannelClaim: typeof verifyPaymentChannelClaim;
|
139
|
+
generateFaucetWallet: typeof generateFaucetWallet;
|
140
|
+
errors: typeof errors;
|
141
|
+
static deriveXAddress: typeof deriveXAddress;
|
142
|
+
static deriveClassicAddress: (publicKey: any) => string;
|
143
|
+
static classicAddressToXAddress: typeof classicAddressToXAddress;
|
144
|
+
static xAddressToClassicAddress: typeof xAddressToClassicAddress;
|
145
|
+
static isValidXAddress: typeof isValidXAddress;
|
146
|
+
static isValidClassicAddress: typeof isValidClassicAddress;
|
147
|
+
static encodeSeed: typeof encodeSeed;
|
148
|
+
static decodeSeed: typeof decodeSeed;
|
149
|
+
static encodeAccountID: typeof encodeAccountID;
|
150
|
+
static decodeAccountID: typeof decodeAccountID;
|
151
|
+
static encodeNodePublic: typeof encodeNodePublic;
|
152
|
+
static decodeNodePublic: typeof decodeNodePublic;
|
153
|
+
static encodeAccountPublic: typeof encodeAccountPublic;
|
154
|
+
static decodeAccountPublic: typeof decodeAccountPublic;
|
155
|
+
static encodeXAddress: typeof encodeXAddress;
|
156
|
+
static decodeXAddress: typeof decodeXAddress;
|
157
|
+
static computeBinaryTransactionHash: (txBlobHex: string) => string;
|
158
|
+
static computeTransactionHash: (txJSON: any) => string;
|
159
|
+
static computeBinaryTransactionSigningHash: (txBlobHex: string) => string;
|
160
|
+
static computeAccountLedgerObjectID: (address: string) => string;
|
161
|
+
static computeSignerListLedgerObjectID: (address: string) => string;
|
162
|
+
static computeOrderID: (address: string, sequence: number) => string;
|
163
|
+
static computeTrustlineHash: (address1: string, address2: string, currency: string) => string;
|
164
|
+
static computeTransactionTreeHash: (transactions: any[]) => string;
|
165
|
+
static computeStateTreeHash: (entries: any[]) => string;
|
166
|
+
static computeLedgerHash: typeof computeLedgerHash;
|
167
|
+
static computeEscrowHash: (address: any, sequence: any) => string;
|
168
|
+
static computePaymentChannelHash: (address: any, dstAddress: any, sequence: any) => string;
|
169
|
+
xrpToDrops: typeof xrpToDrops;
|
170
|
+
dropsToXrp: typeof dropsToXrp;
|
171
|
+
rippleTimeToISO8601: typeof rippleTimeToISO8601;
|
172
|
+
iso8601ToRippleTime: typeof iso8601ToRippleTime;
|
173
|
+
txFlags: {
|
174
|
+
Universal: {
|
175
|
+
FullyCanonicalSig: number;
|
176
|
+
};
|
177
|
+
AccountSet: {
|
178
|
+
RequireDestTag: number;
|
179
|
+
OptionalDestTag: number;
|
180
|
+
RequireAuth: number;
|
181
|
+
OptionalAuth: number;
|
182
|
+
DisallowXRP: number;
|
183
|
+
AllowXRP: number;
|
184
|
+
};
|
185
|
+
TrustSet: {
|
186
|
+
SetAuth: number;
|
187
|
+
NoRipple: number;
|
188
|
+
SetNoRipple: number;
|
189
|
+
ClearNoRipple: number;
|
190
|
+
SetFreeze: number;
|
191
|
+
ClearFreeze: number;
|
192
|
+
};
|
193
|
+
OfferCreate: {
|
194
|
+
Passive: number;
|
195
|
+
ImmediateOrCancel: number;
|
196
|
+
FillOrKill: number;
|
197
|
+
Sell: number;
|
198
|
+
};
|
199
|
+
Payment: {
|
200
|
+
NoRippleDirect: number;
|
201
|
+
PartialPayment: number;
|
202
|
+
LimitQuality: number;
|
203
|
+
};
|
204
|
+
PaymentChannelClaim: {
|
205
|
+
Renew: number;
|
206
|
+
Close: number;
|
207
|
+
};
|
208
|
+
};
|
209
|
+
static txFlags: {
|
210
|
+
Universal: {
|
211
|
+
FullyCanonicalSig: number;
|
212
|
+
};
|
213
|
+
AccountSet: {
|
214
|
+
RequireDestTag: number;
|
215
|
+
OptionalDestTag: number;
|
216
|
+
RequireAuth: number;
|
217
|
+
OptionalAuth: number;
|
218
|
+
DisallowXRP: number;
|
219
|
+
AllowXRP: number;
|
220
|
+
};
|
221
|
+
TrustSet: {
|
222
|
+
SetAuth: number;
|
223
|
+
NoRipple: number;
|
224
|
+
SetNoRipple: number;
|
225
|
+
ClearNoRipple: number;
|
226
|
+
SetFreeze: number;
|
227
|
+
ClearFreeze: number;
|
228
|
+
};
|
229
|
+
OfferCreate: {
|
230
|
+
Passive: number;
|
231
|
+
ImmediateOrCancel: number;
|
232
|
+
FillOrKill: number;
|
233
|
+
Sell: number;
|
234
|
+
};
|
235
|
+
Payment: {
|
236
|
+
NoRippleDirect: number;
|
237
|
+
PartialPayment: number;
|
238
|
+
LimitQuality: number;
|
239
|
+
};
|
240
|
+
PaymentChannelClaim: {
|
241
|
+
Renew: number;
|
242
|
+
Close: number;
|
243
|
+
};
|
244
|
+
};
|
245
|
+
accountSetFlags: {
|
246
|
+
requireDestinationTag: number;
|
247
|
+
requireAuthorization: number;
|
248
|
+
depositAuth: number;
|
249
|
+
disallowIncomingXRP: number;
|
250
|
+
disableMasterKey: number;
|
251
|
+
enableTransactionIDTracking: number;
|
252
|
+
noFreeze: number;
|
253
|
+
globalFreeze: number;
|
254
|
+
defaultRipple: number;
|
255
|
+
};
|
256
|
+
static accountSetFlags: {
|
257
|
+
requireDestinationTag: number;
|
258
|
+
requireAuthorization: number;
|
259
|
+
depositAuth: number;
|
260
|
+
disallowIncomingXRP: number;
|
261
|
+
disableMasterKey: number;
|
262
|
+
enableTransactionIDTracking: number;
|
263
|
+
noFreeze: number;
|
264
|
+
globalFreeze: number;
|
265
|
+
defaultRipple: number;
|
266
|
+
};
|
267
|
+
isValidAddress: typeof schemaValidator.isValidAddress;
|
268
|
+
isValidSecret: typeof schemaValidator.isValidSecret;
|
269
|
+
}
|
270
|
+
export { RippleAPI };
|
271
|
+
export type { AccountObjectsRequest, AccountObjectsResponse, AccountOffersRequest, AccountOffersResponse, AccountInfoRequest, AccountInfoResponse, AccountLinesRequest, AccountLinesResponse, BookOffersRequest, BookOffersResponse, GatewayBalancesRequest, GatewayBalancesResponse, LedgerRequest, LedgerResponse, LedgerDataRequest, LedgerDataResponse, LedgerEntryRequest, LedgerEntryResponse, ServerInfoRequest, ServerInfoResponse };
|
272
|
+
//# sourceMappingURL=api.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAA;AACnC,OAAO,EACL,UAAU,EAEV,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EAGpB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,gBAAgB,EAEjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,cAAc,MAAM,sBAAsB,CAAA;AACjD,OAAO,eAAe,MAAM,uBAAuB,CAAA;AACnD,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAC3C,OAAO,eAAe,MAAM,wBAAwB,CAAA;AACpD,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,SAAS,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAA;AAChE,OAAO,cAAc,MAAM,sBAAsB,CAAA;AACjD,OAAO,iBAAiB,MAAM,yBAAyB,CAAA;AACvD,OAAO,iBAAiB,MAAM,0BAA0B,CAAA;AACxD,OAAO,cAAc,MAAM,uBAAuB,CAAA;AAClD,OAAO,gBAAgB,MAAM,yBAAyB,CAAA;AACtD,OAAO,YAAY,MAAM,qBAAqB,CAAA;AAC9C,OAAO,wBAAwB,MAAM,iCAAiC,CAAA;AACtE,OAAO,qBAAqB,MAAM,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;MAA4B;IAC3C,MAAM,CAAC,eAAe;;;;;;;;;;MAA4B;IAElD,cAAc,wCAAiC;IAC/C,aAAa,uCAAgC;CAC9C;AAED,OAAO,EAAC,SAAS,EAAC,CAAA;AAElB,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EACnB,CAAA"}
|
package/dist/npm/api.js
ADDED
@@ -0,0 +1,276 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
28
|
+
});
|
29
|
+
};
|
30
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
31
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
32
|
+
};
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
34
|
+
exports.RippleAPI = void 0;
|
35
|
+
const events_1 = require("events");
|
36
|
+
const common_1 = require("./common");
|
37
|
+
const server_1 = require("./server/server");
|
38
|
+
const transaction_1 = __importDefault(require("./ledger/transaction"));
|
39
|
+
const transactions_1 = __importDefault(require("./ledger/transactions"));
|
40
|
+
const trustlines_1 = __importDefault(require("./ledger/trustlines"));
|
41
|
+
const balances_1 = __importDefault(require("./ledger/balances"));
|
42
|
+
const balance_sheet_1 = __importDefault(require("./ledger/balance-sheet"));
|
43
|
+
const pathfind_1 = __importDefault(require("./ledger/pathfind"));
|
44
|
+
const orders_1 = __importDefault(require("./ledger/orders"));
|
45
|
+
const orderbook_1 = require("./ledger/orderbook");
|
46
|
+
const settings_1 = require("./ledger/settings");
|
47
|
+
const accountinfo_1 = __importDefault(require("./ledger/accountinfo"));
|
48
|
+
const accountobjects_1 = __importDefault(require("./ledger/accountobjects"));
|
49
|
+
const payment_channel_1 = __importDefault(require("./ledger/payment-channel"));
|
50
|
+
const payment_1 = __importDefault(require("./transaction/payment"));
|
51
|
+
const trustline_1 = __importDefault(require("./transaction/trustline"));
|
52
|
+
const order_1 = __importDefault(require("./transaction/order"));
|
53
|
+
const ordercancellation_1 = __importDefault(require("./transaction/ordercancellation"));
|
54
|
+
const escrow_creation_1 = __importDefault(require("./transaction/escrow-creation"));
|
55
|
+
const escrow_execution_1 = __importDefault(require("./transaction/escrow-execution"));
|
56
|
+
const escrow_cancellation_1 = __importDefault(require("./transaction/escrow-cancellation"));
|
57
|
+
const payment_channel_create_1 = __importDefault(require("./transaction/payment-channel-create"));
|
58
|
+
const payment_channel_fund_1 = __importDefault(require("./transaction/payment-channel-fund"));
|
59
|
+
const payment_channel_claim_1 = __importDefault(require("./transaction/payment-channel-claim"));
|
60
|
+
const check_create_1 = __importDefault(require("./transaction/check-create"));
|
61
|
+
const check_cancel_1 = __importDefault(require("./transaction/check-cancel"));
|
62
|
+
const check_cash_1 = __importDefault(require("./transaction/check-cash"));
|
63
|
+
const settings_2 = __importDefault(require("./transaction/settings"));
|
64
|
+
const ticket_1 = __importDefault(require("./transaction/ticket"));
|
65
|
+
const sign_1 = __importDefault(require("./transaction/sign"));
|
66
|
+
const combine_1 = __importDefault(require("./transaction/combine"));
|
67
|
+
const submit_1 = __importDefault(require("./transaction/submit"));
|
68
|
+
const utils_1 = require("./offline/utils");
|
69
|
+
const derive_1 = require("./offline/derive");
|
70
|
+
const ledgerhash_1 = __importDefault(require("./offline/ledgerhash"));
|
71
|
+
const sign_payment_channel_claim_1 = __importDefault(require("./offline/sign-payment-channel-claim"));
|
72
|
+
const verify_payment_channel_claim_1 = __importDefault(require("./offline/verify-payment-channel-claim"));
|
73
|
+
const ledger_1 = __importDefault(require("./ledger/ledger"));
|
74
|
+
const rangeset_1 = __importDefault(require("./common/rangeset"));
|
75
|
+
const ledgerUtils = __importStar(require("./ledger/utils"));
|
76
|
+
const transactionUtils = __importStar(require("./transaction/utils"));
|
77
|
+
const schemaValidator = __importStar(require("./common/schema-validator"));
|
78
|
+
const serverinfo_1 = require("./common/serverinfo");
|
79
|
+
const utils_2 = require("./ledger/utils");
|
80
|
+
const ripple_address_codec_1 = require("ripple-address-codec");
|
81
|
+
const hashes_1 = require("./common/hashes");
|
82
|
+
const wallet_generation_1 = __importDefault(require("./wallet/wallet-generation"));
|
83
|
+
function getCollectKeyFromCommand(command) {
|
84
|
+
switch (command) {
|
85
|
+
case 'account_offers':
|
86
|
+
case 'book_offers':
|
87
|
+
return 'offers';
|
88
|
+
case 'account_lines':
|
89
|
+
return 'lines';
|
90
|
+
default:
|
91
|
+
return undefined;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
class RippleAPI extends events_1.EventEmitter {
|
95
|
+
constructor(options = {}) {
|
96
|
+
super();
|
97
|
+
this.generateAddress = utils_1.generateAddress;
|
98
|
+
this.generateXAddress = utils_1.generateXAddress;
|
99
|
+
this.connect = server_1.connect;
|
100
|
+
this.disconnect = server_1.disconnect;
|
101
|
+
this.isConnected = server_1.isConnected;
|
102
|
+
this.getServerInfo = serverinfo_1.getServerInfo;
|
103
|
+
this.getFee = serverinfo_1.getFee;
|
104
|
+
this.getLedgerVersion = server_1.getLedgerVersion;
|
105
|
+
this.getTransaction = transaction_1.default;
|
106
|
+
this.getTransactions = transactions_1.default;
|
107
|
+
this.getTrustlines = trustlines_1.default;
|
108
|
+
this.getBalances = balances_1.default;
|
109
|
+
this.getBalanceSheet = balance_sheet_1.default;
|
110
|
+
this.getPaths = pathfind_1.default;
|
111
|
+
this.getOrderbook = orderbook_1.getOrderbook;
|
112
|
+
this.getOrders = orders_1.default;
|
113
|
+
this.getSettings = settings_1.getSettings;
|
114
|
+
this.getAccountInfo = accountinfo_1.default;
|
115
|
+
this.getAccountObjects = accountobjects_1.default;
|
116
|
+
this.getPaymentChannel = payment_channel_1.default;
|
117
|
+
this.getLedger = ledger_1.default;
|
118
|
+
this.parseAccountFlags = settings_1.parseAccountFlags;
|
119
|
+
this.preparePayment = payment_1.default;
|
120
|
+
this.prepareTrustline = trustline_1.default;
|
121
|
+
this.prepareOrder = order_1.default;
|
122
|
+
this.prepareOrderCancellation = ordercancellation_1.default;
|
123
|
+
this.prepareEscrowCreation = escrow_creation_1.default;
|
124
|
+
this.prepareEscrowExecution = escrow_execution_1.default;
|
125
|
+
this.prepareEscrowCancellation = escrow_cancellation_1.default;
|
126
|
+
this.preparePaymentChannelCreate = payment_channel_create_1.default;
|
127
|
+
this.preparePaymentChannelFund = payment_channel_fund_1.default;
|
128
|
+
this.preparePaymentChannelClaim = payment_channel_claim_1.default;
|
129
|
+
this.prepareCheckCreate = check_create_1.default;
|
130
|
+
this.prepareCheckCash = check_cash_1.default;
|
131
|
+
this.prepareCheckCancel = check_cancel_1.default;
|
132
|
+
this.prepareTicketCreate = ticket_1.default;
|
133
|
+
this.prepareSettings = settings_2.default;
|
134
|
+
this.sign = sign_1.default;
|
135
|
+
this.combine = combine_1.default;
|
136
|
+
this.submit = submit_1.default;
|
137
|
+
this.deriveKeypair = derive_1.deriveKeypair;
|
138
|
+
this.deriveAddress = derive_1.deriveAddress;
|
139
|
+
this.computeLedgerHash = ledgerhash_1.default;
|
140
|
+
this.signPaymentChannelClaim = sign_payment_channel_claim_1.default;
|
141
|
+
this.verifyPaymentChannelClaim = verify_payment_channel_claim_1.default;
|
142
|
+
this.generateFaucetWallet = wallet_generation_1.default;
|
143
|
+
this.errors = common_1.errors;
|
144
|
+
this.xrpToDrops = common_1.xrpToDrops;
|
145
|
+
this.dropsToXrp = common_1.dropsToXrp;
|
146
|
+
this.rippleTimeToISO8601 = common_1.rippleTimeToISO8601;
|
147
|
+
this.iso8601ToRippleTime = common_1.iso8601ToRippleTime;
|
148
|
+
this.txFlags = common_1.txFlags;
|
149
|
+
this.accountSetFlags = common_1.constants.AccountSetFlags;
|
150
|
+
this.isValidAddress = schemaValidator.isValidAddress;
|
151
|
+
this.isValidSecret = schemaValidator.isValidSecret;
|
152
|
+
common_1.validate.apiOptions(options);
|
153
|
+
this._feeCushion = options.feeCushion || 1.2;
|
154
|
+
this._maxFeeXRP = options.maxFeeXRP || '2';
|
155
|
+
const serverURL = options.server;
|
156
|
+
if (serverURL != null) {
|
157
|
+
this.connection = new common_1.Connection(serverURL, options);
|
158
|
+
this.connection.on('ledgerClosed', (message) => {
|
159
|
+
this.emit('ledger', server_1.formatLedgerClose(message));
|
160
|
+
});
|
161
|
+
this.connection.on('error', (errorCode, errorMessage, data) => {
|
162
|
+
this.emit('error', errorCode, errorMessage, data);
|
163
|
+
});
|
164
|
+
this.connection.on('connected', () => {
|
165
|
+
this.emit('connected');
|
166
|
+
});
|
167
|
+
this.connection.on('disconnected', (code) => {
|
168
|
+
let finalCode = code;
|
169
|
+
if (finalCode === 1005 || finalCode === 4000) {
|
170
|
+
finalCode = 1000;
|
171
|
+
}
|
172
|
+
this.emit('disconnected', finalCode);
|
173
|
+
});
|
174
|
+
}
|
175
|
+
else {
|
176
|
+
this.connection = new common_1.Connection(null, options);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
request(command, params = {}) {
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
181
|
+
return this.connection.request(Object.assign(Object.assign({}, params), { command, account: params.account ? common_1.ensureClassicAddress(params.account) : undefined }));
|
182
|
+
});
|
183
|
+
}
|
184
|
+
hasNextPage(currentResponse) {
|
185
|
+
return !!currentResponse.marker;
|
186
|
+
}
|
187
|
+
requestNextPage(command, params = {}, currentResponse) {
|
188
|
+
return __awaiter(this, void 0, void 0, function* () {
|
189
|
+
if (!currentResponse.marker) {
|
190
|
+
return Promise.reject(new common_1.errors.NotFoundError('response does not have a next page'));
|
191
|
+
}
|
192
|
+
const nextPageParams = Object.assign({}, params, {
|
193
|
+
marker: currentResponse.marker
|
194
|
+
});
|
195
|
+
return this.request(command, nextPageParams);
|
196
|
+
});
|
197
|
+
}
|
198
|
+
prepareTransaction(txJSON, instructions = {}) {
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
200
|
+
return transactionUtils.prepareTransaction(txJSON, this, instructions);
|
201
|
+
});
|
202
|
+
}
|
203
|
+
convertStringToHex(string) {
|
204
|
+
return transactionUtils.convertStringToHex(string);
|
205
|
+
}
|
206
|
+
_requestAll(command, params = {}, options = {}) {
|
207
|
+
return __awaiter(this, void 0, void 0, function* () {
|
208
|
+
const collectKey = options.collect || getCollectKeyFromCommand(command);
|
209
|
+
if (!collectKey) {
|
210
|
+
throw new common_1.errors.ValidationError(`no collect key for command ${command}`);
|
211
|
+
}
|
212
|
+
const countTo = params.limit != null ? params.limit : Infinity;
|
213
|
+
let count = 0;
|
214
|
+
let marker = params.marker;
|
215
|
+
let lastBatchLength;
|
216
|
+
const results = [];
|
217
|
+
do {
|
218
|
+
const countRemaining = utils_2.clamp(countTo - count, 10, 400);
|
219
|
+
const repeatProps = Object.assign(Object.assign({}, params), { limit: countRemaining, marker });
|
220
|
+
const singleResult = yield this.request(command, repeatProps);
|
221
|
+
const collectedData = singleResult[collectKey];
|
222
|
+
marker = singleResult['marker'];
|
223
|
+
results.push(singleResult);
|
224
|
+
const isExpectedFormat = Array.isArray(collectedData);
|
225
|
+
if (isExpectedFormat) {
|
226
|
+
count += collectedData.length;
|
227
|
+
lastBatchLength = collectedData.length;
|
228
|
+
}
|
229
|
+
else {
|
230
|
+
lastBatchLength = 0;
|
231
|
+
}
|
232
|
+
} while (!!marker && count < countTo && lastBatchLength !== 0);
|
233
|
+
return results;
|
234
|
+
});
|
235
|
+
}
|
236
|
+
}
|
237
|
+
exports.RippleAPI = RippleAPI;
|
238
|
+
RippleAPI._PRIVATE = {
|
239
|
+
validate: common_1.validate,
|
240
|
+
RangeSet: rangeset_1.default,
|
241
|
+
ledgerUtils,
|
242
|
+
schemaValidator
|
243
|
+
};
|
244
|
+
RippleAPI.renameCounterpartyToIssuer = utils_2.renameCounterpartyToIssuer;
|
245
|
+
RippleAPI.formatBidsAndAsks = orderbook_1.formatBidsAndAsks;
|
246
|
+
RippleAPI.deriveXAddress = derive_1.deriveXAddress;
|
247
|
+
RippleAPI.deriveClassicAddress = derive_1.deriveAddress;
|
248
|
+
RippleAPI.classicAddressToXAddress = ripple_address_codec_1.classicAddressToXAddress;
|
249
|
+
RippleAPI.xAddressToClassicAddress = ripple_address_codec_1.xAddressToClassicAddress;
|
250
|
+
RippleAPI.isValidXAddress = ripple_address_codec_1.isValidXAddress;
|
251
|
+
RippleAPI.isValidClassicAddress = ripple_address_codec_1.isValidClassicAddress;
|
252
|
+
RippleAPI.encodeSeed = ripple_address_codec_1.encodeSeed;
|
253
|
+
RippleAPI.decodeSeed = ripple_address_codec_1.decodeSeed;
|
254
|
+
RippleAPI.encodeAccountID = ripple_address_codec_1.encodeAccountID;
|
255
|
+
RippleAPI.decodeAccountID = ripple_address_codec_1.decodeAccountID;
|
256
|
+
RippleAPI.encodeNodePublic = ripple_address_codec_1.encodeNodePublic;
|
257
|
+
RippleAPI.decodeNodePublic = ripple_address_codec_1.decodeNodePublic;
|
258
|
+
RippleAPI.encodeAccountPublic = ripple_address_codec_1.encodeAccountPublic;
|
259
|
+
RippleAPI.decodeAccountPublic = ripple_address_codec_1.decodeAccountPublic;
|
260
|
+
RippleAPI.encodeXAddress = ripple_address_codec_1.encodeXAddress;
|
261
|
+
RippleAPI.decodeXAddress = ripple_address_codec_1.decodeXAddress;
|
262
|
+
RippleAPI.computeBinaryTransactionHash = hashes_1.computeBinaryTransactionHash;
|
263
|
+
RippleAPI.computeTransactionHash = hashes_1.computeTransactionHash;
|
264
|
+
RippleAPI.computeBinaryTransactionSigningHash = hashes_1.computeBinaryTransactionSigningHash;
|
265
|
+
RippleAPI.computeAccountLedgerObjectID = hashes_1.computeAccountLedgerObjectID;
|
266
|
+
RippleAPI.computeSignerListLedgerObjectID = hashes_1.computeSignerListLedgerObjectID;
|
267
|
+
RippleAPI.computeOrderID = hashes_1.computeOrderID;
|
268
|
+
RippleAPI.computeTrustlineHash = hashes_1.computeTrustlineHash;
|
269
|
+
RippleAPI.computeTransactionTreeHash = hashes_1.computeTransactionTreeHash;
|
270
|
+
RippleAPI.computeStateTreeHash = hashes_1.computeStateTreeHash;
|
271
|
+
RippleAPI.computeLedgerHash = ledgerhash_1.default;
|
272
|
+
RippleAPI.computeEscrowHash = hashes_1.computeEscrowHash;
|
273
|
+
RippleAPI.computePaymentChannelHash = hashes_1.computePaymentChannelHash;
|
274
|
+
RippleAPI.txFlags = common_1.txFlags;
|
275
|
+
RippleAPI.accountSetFlags = common_1.constants.AccountSetFlags;
|
276
|
+
//# sourceMappingURL=api.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAmC;AACnC,qCAWiB;AACjB,4CAMwB;AACxB,uEAAiD;AACjD,yEAAmD;AACnD,qEAA+C;AAC/C,iEAA2C;AAC3C,2EAAoD;AACpD,iEAAwC;AACxC,6DAAuC;AACvC,kDAAkE;AAClE,gDAAgE;AAChE,uEAAiD;AACjD,6EAAuD;AACvD,+EAAwD;AACxD,oEAAkD;AAClD,wEAAsD;AACtD,gEAA8C;AAC9C,wFAAsE;AACtE,oFAAiE;AACjE,sFAAmE;AACnE,4FAAyE;AACzE,kGAA8E;AAC9E,8FAA0E;AAC1E,gGAA4E;AAC5E,8EAA2D;AAC3D,8EAA2D;AAC3D,0EAAuD;AACvD,sEAAoD;AACpD,kEAAsD;AACtD,8DAAqC;AACrC,oEAA2C;AAC3C,kEAAyC;AACzC,2CAAiE;AACjE,6CAA6E;AAC7E,sEAAoD;AACpD,sGAA0E;AAC1E,0GAA8E;AAC9E,6DAAuC;AAyBvC,iEAAwC;AACxC,4DAA6C;AAC7C,sEAAuD;AACvD,2EAA4D;AAC5D,oDAAyD;AACzD,0CAAgE;AAGhE,+DAe6B;AAC7B,4CAYwB;AAExB,mFAA6D;AAe7D,SAAS,wBAAwB,CAAC,OAAe;IAC/C,QAAQ,OAAO,EAAE;QACf,KAAK,gBAAgB,CAAC;QACtB,KAAK,aAAa;YAChB,OAAO,QAAQ,CAAA;QACjB,KAAK,eAAe;YAClB,OAAO,OAAO,CAAA;QAChB;YACE,OAAO,SAAS,CAAA;KACnB;AACH,CAAC;AAED,MAAM,SAAU,SAAQ,qBAAY;IAmBlC,YAAY,UAAsB,EAAE;QAClC,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6BAAmB,GAAG,0CAAmB,CAAA;AACzC,wBAAc,GAAG,qCAAc,CAAA;AAC/B,wBAAc,GAAG,qCAAc,CAAA;AAO/B,sCAA4B,GAAG,qCAA4B,CAAA;AAG3D,gCAAsB,GAAG,+BAAsB,CAAA;AAE/C,6CAAmC,GACxC,4CAAmC,CAAA;AAG9B,sCAA4B,GAAG,qCAA4B,CAAA;AAG3D,yCAA+B,GAAG,wCAA+B,CAAA;AAGjE,wBAAc,GAAG,uBAAc,CAAA;AAG/B,8BAAoB,GAAG,6BAAoB,CAAA;AAE3C,oCAA0B,GAAG,mCAA0B,CAAA;AAEvD,8BAAoB,GAAG,6BAAoB,CAAA;AAG3C,2BAAiB,GAAG,oBAAiB,CAAA;AAGrC,2BAAiB,GAAG,0BAAiB,CAAA;AAGrC,mCAAyB,GAAG,kCAAyB,CAAA;AAOrD,iBAAO,GAAG,gBAAO,CAAA;AAEjB,yBAAe,GAAG,kBAAS,CAAC,eAAe,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { RippleAPI, APIOptions } from './api';
|
2
|
+
declare class RippleAPIBroadcast extends RippleAPI {
|
3
|
+
ledgerVersion: number | undefined;
|
4
|
+
private _apis;
|
5
|
+
constructor(servers: any, options?: APIOptions);
|
6
|
+
onLedgerEvent(ledger: any): void;
|
7
|
+
getMethodNames(): string[];
|
8
|
+
}
|
9
|
+
export { RippleAPIBroadcast };
|
10
|
+
//# sourceMappingURL=broadcast.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../../src/broadcast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,OAAO,CAAA;AAE3C,cAAM,kBAAmB,SAAQ,SAAS;IACxC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAY;IAC7C,OAAO,CAAC,KAAK,CAAa;gBAEd,OAAO,KAAA,EAAE,OAAO,GAAE,UAAe;IA2C7C,aAAa,CAAC,MAAM,KAAA;IAUpB,cAAc;CAUf;AAED,OAAO,EAAC,kBAAkB,EAAC,CAAA"}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.RippleAPIBroadcast = void 0;
|
13
|
+
const api_1 = require("./api");
|
14
|
+
class RippleAPIBroadcast extends api_1.RippleAPI {
|
15
|
+
constructor(servers, options = {}) {
|
16
|
+
super(options);
|
17
|
+
this.ledgerVersion = undefined;
|
18
|
+
const apis = servers.map((server) => new api_1.RippleAPI(Object.assign({}, options, { server })));
|
19
|
+
this._apis = apis;
|
20
|
+
this.getMethodNames().forEach((name) => {
|
21
|
+
this[name] = function () {
|
22
|
+
return Promise.race(apis.map((api) => api[name](...arguments)));
|
23
|
+
};
|
24
|
+
});
|
25
|
+
this.connect = function () {
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
27
|
+
yield Promise.all(apis.map((api) => api.connect()));
|
28
|
+
});
|
29
|
+
};
|
30
|
+
this.disconnect = function () {
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
32
|
+
yield Promise.all(apis.map((api) => api.disconnect()));
|
33
|
+
});
|
34
|
+
};
|
35
|
+
this.isConnected = function () {
|
36
|
+
return apis.map((api) => api.isConnected()).every(Boolean);
|
37
|
+
};
|
38
|
+
const defaultAPI = apis[0];
|
39
|
+
const syncMethods = ['sign', 'generateAddress', 'computeLedgerHash'];
|
40
|
+
syncMethods.forEach((name) => {
|
41
|
+
this[name] = defaultAPI[name].bind(defaultAPI);
|
42
|
+
});
|
43
|
+
apis.forEach((api) => {
|
44
|
+
api.on('ledger', this.onLedgerEvent.bind(this));
|
45
|
+
api.on('error', (errorCode, errorMessage, data) => this.emit('error', errorCode, errorMessage, data));
|
46
|
+
});
|
47
|
+
}
|
48
|
+
onLedgerEvent(ledger) {
|
49
|
+
if (ledger.ledgerVersion > this.ledgerVersion ||
|
50
|
+
this.ledgerVersion == null) {
|
51
|
+
this.ledgerVersion = ledger.ledgerVersion;
|
52
|
+
this.emit('ledger', ledger);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
getMethodNames() {
|
56
|
+
const methodNames = [];
|
57
|
+
const rippleAPI = this._apis[0];
|
58
|
+
for (const name of Object.getOwnPropertyNames(rippleAPI)) {
|
59
|
+
if (typeof rippleAPI[name] === 'function') {
|
60
|
+
methodNames.push(name);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
return methodNames;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
exports.RippleAPIBroadcast = RippleAPIBroadcast;
|
67
|
+
//# sourceMappingURL=broadcast.js.map
|