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,121 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.SHAMap = exports.Leaf = exports.InnerNode = exports.Node = exports.NodeType = void 0;
|
7
|
+
const hash_prefix_1 = __importDefault(require("./hash-prefix"));
|
8
|
+
const sha512Half_1 = __importDefault(require("./sha512Half"));
|
9
|
+
const HEX_ZERO = '0000000000000000000000000000000000000000000000000000000000000000';
|
10
|
+
var NodeType;
|
11
|
+
(function (NodeType) {
|
12
|
+
NodeType[NodeType["INNER"] = 1] = "INNER";
|
13
|
+
NodeType[NodeType["TRANSACTION_NO_METADATA"] = 2] = "TRANSACTION_NO_METADATA";
|
14
|
+
NodeType[NodeType["TRANSACTION_METADATA"] = 3] = "TRANSACTION_METADATA";
|
15
|
+
NodeType[NodeType["ACCOUNT_STATE"] = 4] = "ACCOUNT_STATE";
|
16
|
+
})(NodeType = exports.NodeType || (exports.NodeType = {}));
|
17
|
+
class Node {
|
18
|
+
constructor() { }
|
19
|
+
addItem(_tag, _node) {
|
20
|
+
throw new Error('Called unimplemented virtual method SHAMapTreeNode#addItem.');
|
21
|
+
}
|
22
|
+
get hash() {
|
23
|
+
throw new Error('Called unimplemented virtual method SHAMapTreeNode#hash.');
|
24
|
+
}
|
25
|
+
}
|
26
|
+
exports.Node = Node;
|
27
|
+
class InnerNode extends Node {
|
28
|
+
constructor(depth = 0) {
|
29
|
+
super();
|
30
|
+
this.leaves = {};
|
31
|
+
this.type = NodeType.INNER;
|
32
|
+
this.depth = depth;
|
33
|
+
this.empty = true;
|
34
|
+
}
|
35
|
+
addItem(tag, node) {
|
36
|
+
const existingNode = this.getNode(parseInt(tag[this.depth], 16));
|
37
|
+
if (existingNode) {
|
38
|
+
if (existingNode instanceof InnerNode) {
|
39
|
+
existingNode.addItem(tag, node);
|
40
|
+
}
|
41
|
+
else if (existingNode instanceof Leaf) {
|
42
|
+
if (existingNode.tag === tag) {
|
43
|
+
throw new Error('Tried to add a node to a SHAMap that was already in there.');
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
const newInnerNode = new InnerNode(this.depth + 1);
|
47
|
+
newInnerNode.addItem(existingNode.tag, existingNode);
|
48
|
+
newInnerNode.addItem(tag, node);
|
49
|
+
this.setNode(parseInt(tag[this.depth], 16), newInnerNode);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
this.setNode(parseInt(tag[this.depth], 16), node);
|
55
|
+
}
|
56
|
+
}
|
57
|
+
setNode(slot, node) {
|
58
|
+
if (slot < 0 || slot > 15) {
|
59
|
+
throw new Error('Invalid slot: slot must be between 0-15.');
|
60
|
+
}
|
61
|
+
this.leaves[slot] = node;
|
62
|
+
this.empty = false;
|
63
|
+
}
|
64
|
+
getNode(slot) {
|
65
|
+
if (slot < 0 || slot > 15) {
|
66
|
+
throw new Error('Invalid slot: slot must be between 0-15.');
|
67
|
+
}
|
68
|
+
return this.leaves[slot];
|
69
|
+
}
|
70
|
+
get hash() {
|
71
|
+
if (this.empty)
|
72
|
+
return HEX_ZERO;
|
73
|
+
let hex = '';
|
74
|
+
for (let i = 0; i < 16; i++) {
|
75
|
+
hex += this.leaves[i] ? this.leaves[i].hash : HEX_ZERO;
|
76
|
+
}
|
77
|
+
const prefix = hash_prefix_1.default.INNER_NODE.toString(16);
|
78
|
+
return sha512Half_1.default(prefix + hex);
|
79
|
+
}
|
80
|
+
}
|
81
|
+
exports.InnerNode = InnerNode;
|
82
|
+
class Leaf extends Node {
|
83
|
+
constructor(tag, data, type) {
|
84
|
+
super();
|
85
|
+
this.tag = tag;
|
86
|
+
this.type = type;
|
87
|
+
this.data = data;
|
88
|
+
}
|
89
|
+
get hash() {
|
90
|
+
switch (this.type) {
|
91
|
+
case NodeType.ACCOUNT_STATE: {
|
92
|
+
const leafPrefix = hash_prefix_1.default.LEAF_NODE.toString(16);
|
93
|
+
return sha512Half_1.default(leafPrefix + this.data + this.tag);
|
94
|
+
}
|
95
|
+
case NodeType.TRANSACTION_NO_METADATA: {
|
96
|
+
const txIDPrefix = hash_prefix_1.default.TRANSACTION_ID.toString(16);
|
97
|
+
return sha512Half_1.default(txIDPrefix + this.data);
|
98
|
+
}
|
99
|
+
case NodeType.TRANSACTION_METADATA: {
|
100
|
+
const txNodePrefix = hash_prefix_1.default.TRANSACTION_NODE.toString(16);
|
101
|
+
return sha512Half_1.default(txNodePrefix + this.data + this.tag);
|
102
|
+
}
|
103
|
+
default:
|
104
|
+
throw new Error('Tried to hash a SHAMap node of unknown type.');
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
108
|
+
exports.Leaf = Leaf;
|
109
|
+
class SHAMap {
|
110
|
+
constructor() {
|
111
|
+
this.root = new InnerNode(0);
|
112
|
+
}
|
113
|
+
addItem(tag, data, type) {
|
114
|
+
this.root.addItem(tag, new Leaf(tag, data, type));
|
115
|
+
}
|
116
|
+
get hash() {
|
117
|
+
return this.root.hash;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
exports.SHAMap = SHAMap;
|
121
|
+
//# sourceMappingURL=shamap.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"shamap.js","sourceRoot":"","sources":["../../../../src/common/hashes/shamap.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAsC;AACtC,8DAAqC;AACrC,MAAM,QAAQ,GACZ,kEAAkE,CAAA;AAEpE,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yCAAS,CAAA;IACT,6EAA2B,CAAA;IAC3B,uEAAwB,CAAA;IACxB,yDAAiB,CAAA;AACnB,CAAC,EALW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAKnB;AAED,MAAsB,IAAI;IAMxB,gBAAsB,CAAC;IAEhB,OAAO,CAAC,IAAY,EAAE,KAAW;QACtC,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAA;IACH,CAAC;IACD,IAAW,IAAI;QACb,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;IAC7E,CAAC;CACF;A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constants';
|
2
|
+
import * as errors from './errors';
|
3
|
+
import * as validate from './validate';
|
4
|
+
import * as serverInfo from './serverinfo';
|
5
|
+
export declare function ensureClassicAddress(account: string): string;
|
6
|
+
export { constants, errors, validate, serverInfo };
|
7
|
+
export { dropsToXrp, xrpToDrops, toRippledAmount, removeUndefined, convertKeysFromSnakeCaseToCamelCase, iso8601ToRippleTime, rippleTimeToISO8601 } from './utils';
|
8
|
+
export { Connection } from './connection';
|
9
|
+
export { txFlags } from './txflags';
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAG1C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkB5D;AAED,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAC,CAAA;AAChD,OAAO,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,mCAAmC,EACnC,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA"}
|
@@ -0,0 +1,57 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
+
exports.serverInfo = exports.validate = exports.errors = exports.constants = exports.ensureClassicAddress = void 0;
|
23
|
+
const constants = __importStar(require("./constants"));
|
24
|
+
exports.constants = constants;
|
25
|
+
const errors = __importStar(require("./errors"));
|
26
|
+
exports.errors = errors;
|
27
|
+
const validate = __importStar(require("./validate"));
|
28
|
+
exports.validate = validate;
|
29
|
+
const serverInfo = __importStar(require("./serverinfo"));
|
30
|
+
exports.serverInfo = serverInfo;
|
31
|
+
const ripple_address_codec_1 = require("ripple-address-codec");
|
32
|
+
function ensureClassicAddress(account) {
|
33
|
+
if (ripple_address_codec_1.isValidXAddress(account)) {
|
34
|
+
const { classicAddress, tag } = ripple_address_codec_1.xAddressToClassicAddress(account);
|
35
|
+
if (tag !== false) {
|
36
|
+
throw new Error('This command does not support the use of a tag. Use an address without a tag.');
|
37
|
+
}
|
38
|
+
return classicAddress;
|
39
|
+
}
|
40
|
+
else {
|
41
|
+
return account;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
exports.ensureClassicAddress = ensureClassicAddress;
|
45
|
+
var utils_1 = require("./utils");
|
46
|
+
Object.defineProperty(exports, "dropsToXrp", { enumerable: true, get: function () { return utils_1.dropsToXrp; } });
|
47
|
+
Object.defineProperty(exports, "xrpToDrops", { enumerable: true, get: function () { return utils_1.xrpToDrops; } });
|
48
|
+
Object.defineProperty(exports, "toRippledAmount", { enumerable: true, get: function () { return utils_1.toRippledAmount; } });
|
49
|
+
Object.defineProperty(exports, "removeUndefined", { enumerable: true, get: function () { return utils_1.removeUndefined; } });
|
50
|
+
Object.defineProperty(exports, "convertKeysFromSnakeCaseToCamelCase", { enumerable: true, get: function () { return utils_1.convertKeysFromSnakeCaseToCamelCase; } });
|
51
|
+
Object.defineProperty(exports, "iso8601ToRippleTime", { enumerable: true, get: function () { return utils_1.iso8601ToRippleTime; } });
|
52
|
+
Object.defineProperty(exports, "rippleTimeToISO8601", { enumerable: true, get: function () { return utils_1.rippleTimeToISO8601; } });
|
53
|
+
var connection_1 = require("./connection");
|
54
|
+
Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return connection_1.Connection; } });
|
55
|
+
var txflags_1 = require("./txflags");
|
56
|
+
Object.defineProperty(exports, "txFlags", { enumerable: true, get: function () { return txflags_1.txFlags; } });
|
57
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AA0BhC,8BAAS;AAzBjB,iDAAkC;AAyBf,wBAAM;AAxBzB,qDAAsC;AAwBX,4BAAQ;AAvBnC,yDAA0C;AAuBL,gCAAU;AAtB/C,+DAA8E;AAE9E,SAAgB,oBAAoB,CAAC,OAAe;IAClD,IAAI,sCAAe,CAAC,OAAO,CAAC,EAAE;QAC5B,MAAM,EAAC,cAAc,EAAE,GAAG,EAAC,GAAG,+CAAwB,CAAC,OAAO,CAAC,CAAA;QAK/D,IAAI,GAAG,KAAK,KAAK,EAAE;YACjB,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAA;SACF;QAGD,OAAO,cAAc,CAAA;KACtB;SAAM;QACL,OAAO,OAAO,CAAA;KACf;AACH,CAAC;AAlBD,oDAkBC;AAGD,iCAQgB;AAPd,mGAAA,UAAU,OAAA;AACV,mGAAA,UAAU,OAAA;AACV,wGAAA,eAAe,OAAA;AACf,wGAAA,eAAe,OAAA;AACf,4HAAA,mCAAmC,OAAA;AACnC,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AAErB,2CAAuC;AAA/B,wGAAA,UAAU,OAAA;AAClB,qCAAiC;AAAzB,kGAAA,OAAO,OAAA"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
declare class RangeSet {
|
2
|
+
ranges: Array<[number, number]>;
|
3
|
+
constructor();
|
4
|
+
reset(): void;
|
5
|
+
serialize(): string;
|
6
|
+
addRange(start: number, end: number): void;
|
7
|
+
addValue(value: number): void;
|
8
|
+
parseAndAddRanges(rangesString: string): void;
|
9
|
+
containsRange(start: number, end: number): boolean;
|
10
|
+
containsValue(value: number): boolean;
|
11
|
+
}
|
12
|
+
export default RangeSet;
|
13
|
+
//# sourceMappingURL=rangeset.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rangeset.d.ts","sourceRoot":"","sources":["../../../src/common/rangeset.ts"],"names":[],"mappings":"AAmBA,cAAM,QAAQ;IACZ,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;;IAM/B,KAAK;IAIL,SAAS;IAMT,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKnC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,iBAAiB,CAAC,YAAY,EAAE,MAAM;IAQtC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAIxC,aAAa,CAAC,KAAK,EAAE,MAAM;CAG5B;AAED,eAAe,QAAQ,CAAA"}
|
@@ -0,0 +1,72 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
+
const _ = __importStar(require("lodash"));
|
23
|
+
const assert = __importStar(require("assert"));
|
24
|
+
function mergeIntervals(intervals) {
|
25
|
+
const stack = [[-Infinity, -Infinity]];
|
26
|
+
_.sortBy(intervals, (x) => x[0]).forEach((interval) => {
|
27
|
+
const lastInterval = stack.pop();
|
28
|
+
if (interval[0] <= lastInterval[1] + 1) {
|
29
|
+
stack.push([lastInterval[0], Math.max(interval[1], lastInterval[1])]);
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
stack.push(lastInterval);
|
33
|
+
stack.push(interval);
|
34
|
+
}
|
35
|
+
});
|
36
|
+
return stack.slice(1);
|
37
|
+
}
|
38
|
+
class RangeSet {
|
39
|
+
constructor() {
|
40
|
+
this.reset();
|
41
|
+
}
|
42
|
+
reset() {
|
43
|
+
this.ranges = [];
|
44
|
+
}
|
45
|
+
serialize() {
|
46
|
+
return this.ranges
|
47
|
+
.map((range) => range[0].toString() + '-' + range[1].toString())
|
48
|
+
.join(',');
|
49
|
+
}
|
50
|
+
addRange(start, end) {
|
51
|
+
assert.ok(start <= end, `invalid range ${start} <= ${end}`);
|
52
|
+
this.ranges = mergeIntervals(this.ranges.concat([[start, end]]));
|
53
|
+
}
|
54
|
+
addValue(value) {
|
55
|
+
this.addRange(value, value);
|
56
|
+
}
|
57
|
+
parseAndAddRanges(rangesString) {
|
58
|
+
const rangeStrings = rangesString.split(',');
|
59
|
+
rangeStrings.forEach((rangeString) => {
|
60
|
+
const range = rangeString.split('-').map(Number);
|
61
|
+
this.addRange(range[0], range.length === 1 ? range[0] : range[1]);
|
62
|
+
});
|
63
|
+
}
|
64
|
+
containsRange(start, end) {
|
65
|
+
return this.ranges.some((range) => range[0] <= start && range[1] >= end);
|
66
|
+
}
|
67
|
+
containsValue(value) {
|
68
|
+
return this.containsRange(value, value);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
exports.default = RangeSet;
|
72
|
+
//# sourceMappingURL=rangeset.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rangeset.js","sourceRoot":"","sources":["../../../src/common/rangeset.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B;AAC3B,+CAAgC;AAIhC,SAAS,cAAc,CAAC,SAAqB;IAC3C,MAAM,KAAK,GAAe,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAClD,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QACpD,MAAM,YAAY,GAAa,KAAK,CAAC,GAAG,EAAG,CAAA;QAC3C,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;YACtC,KAAK,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY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AAC,MAAM,CAAC,CAAA;YAChD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;QACnE,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,aAAa,CAAC,KAAa,EAAE,GAAW;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAA;IAC1E,CAAC;IAED,aAAa,CAAC,KAAa;QACzB,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC;CACF;AAED,kBAAe,QAAQ,CAAA"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { isValidSecret } from './utils';
|
2
|
+
declare function schemaValidate(schemaName: string, object: any): void;
|
3
|
+
declare function isValidAddress(address: string): boolean;
|
4
|
+
export { schemaValidate, isValidSecret, isValidAddress };
|
5
|
+
//# sourceMappingURL=schema-validator.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema-validator.d.ts","sourceRoot":"","sources":["../../../src/common/schema-validator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAA;AAkKrC,iBAAS,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAU7D;AAED,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,OAAO,EAAC,cAAc,EAAE,aAAa,EAAE,cAAc,EAAC,CAAA"}
|
@@ -0,0 +1,190 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
+
exports.isValidAddress = exports.isValidSecret = exports.schemaValidate = void 0;
|
23
|
+
const _ = __importStar(require("lodash"));
|
24
|
+
const assert = __importStar(require("assert"));
|
25
|
+
const { Validator } = require('jsonschema');
|
26
|
+
const errors_1 = require("./errors");
|
27
|
+
const ripple_address_codec_1 = require("ripple-address-codec");
|
28
|
+
const utils_1 = require("./utils");
|
29
|
+
Object.defineProperty(exports, "isValidSecret", { enumerable: true, get: function () { return utils_1.isValidSecret; } });
|
30
|
+
function loadSchemas() {
|
31
|
+
const schemas = [
|
32
|
+
require('./schemas/objects/tx-json.json'),
|
33
|
+
require('./schemas/objects/transaction-type.json'),
|
34
|
+
require('./schemas/objects/hash128.json'),
|
35
|
+
require('./schemas/objects/hash256.json'),
|
36
|
+
require('./schemas/objects/sequence.json'),
|
37
|
+
require('./schemas/objects/ticket-sequence.json'),
|
38
|
+
require('./schemas/objects/signature.json'),
|
39
|
+
require('./schemas/objects/issue.json'),
|
40
|
+
require('./schemas/objects/ledger-version.json'),
|
41
|
+
require('./schemas/objects/max-adjustment.json'),
|
42
|
+
require('./schemas/objects/memo.json'),
|
43
|
+
require('./schemas/objects/memos.json'),
|
44
|
+
require('./schemas/objects/public-key.json'),
|
45
|
+
require('./schemas/objects/private-key.json'),
|
46
|
+
require('./schemas/objects/uint32.json'),
|
47
|
+
require('./schemas/objects/value.json'),
|
48
|
+
require('./schemas/objects/source-adjustment.json'),
|
49
|
+
require('./schemas/objects/destination-adjustment.json'),
|
50
|
+
require('./schemas/objects/tag.json'),
|
51
|
+
require('./schemas/objects/lax-amount.json'),
|
52
|
+
require('./schemas/objects/lax-lax-amount.json'),
|
53
|
+
require('./schemas/objects/min-adjustment.json'),
|
54
|
+
require('./schemas/objects/source-exact-adjustment.json'),
|
55
|
+
require('./schemas/objects/destination-exact-adjustment.json'),
|
56
|
+
require('./schemas/objects/destination-address-tag.json'),
|
57
|
+
require('./schemas/objects/transaction-hash.json'),
|
58
|
+
require('./schemas/objects/address.json'),
|
59
|
+
require('./schemas/objects/x-address.json'),
|
60
|
+
require('./schemas/objects/classic-address.json'),
|
61
|
+
require('./schemas/objects/adjustment.json'),
|
62
|
+
require('./schemas/objects/quality.json'),
|
63
|
+
require('./schemas/objects/amount.json'),
|
64
|
+
require('./schemas/objects/amountbase.json'),
|
65
|
+
require('./schemas/objects/balance.json'),
|
66
|
+
require('./schemas/objects/blob.json'),
|
67
|
+
require('./schemas/objects/currency.json'),
|
68
|
+
require('./schemas/objects/signed-value.json'),
|
69
|
+
require('./schemas/objects/orderbook.json'),
|
70
|
+
require('./schemas/objects/instructions.json'),
|
71
|
+
require('./schemas/objects/settings-plus-memos.json'),
|
72
|
+
require('./schemas/specifications/settings.json'),
|
73
|
+
require('./schemas/specifications/payment.json'),
|
74
|
+
require('./schemas/specifications/get-payment.json'),
|
75
|
+
require('./schemas/specifications/escrow-cancellation.json'),
|
76
|
+
require('./schemas/specifications/order-cancellation.json'),
|
77
|
+
require('./schemas/specifications/order.json'),
|
78
|
+
require('./schemas/specifications/escrow-execution.json'),
|
79
|
+
require('./schemas/specifications/escrow-creation.json'),
|
80
|
+
require('./schemas/specifications/payment-channel-create.json'),
|
81
|
+
require('./schemas/specifications/payment-channel-fund.json'),
|
82
|
+
require('./schemas/specifications/payment-channel-claim.json'),
|
83
|
+
require('./schemas/specifications/check-create.json'),
|
84
|
+
require('./schemas/specifications/check-cash.json'),
|
85
|
+
require('./schemas/specifications/check-cancel.json'),
|
86
|
+
require('./schemas/specifications/trustline.json'),
|
87
|
+
require('./schemas/specifications/deposit-preauth.json'),
|
88
|
+
require('./schemas/specifications/account-delete.json'),
|
89
|
+
require('./schemas/output/sign.json'),
|
90
|
+
require('./schemas/output/submit.json'),
|
91
|
+
require('./schemas/output/get-account-info.json'),
|
92
|
+
require('./schemas/output/get-account-objects.json'),
|
93
|
+
require('./schemas/output/get-balances.json'),
|
94
|
+
require('./schemas/output/get-balance-sheet.json'),
|
95
|
+
require('./schemas/output/get-ledger.json'),
|
96
|
+
require('./schemas/output/get-orderbook.json'),
|
97
|
+
require('./schemas/output/get-orders.json'),
|
98
|
+
require('./schemas/output/order-change.json'),
|
99
|
+
require('./schemas/output/get-payment-channel.json'),
|
100
|
+
require('./schemas/output/prepare.json'),
|
101
|
+
require('./schemas/output/ledger-event.json'),
|
102
|
+
require('./schemas/output/get-paths.json'),
|
103
|
+
require('./schemas/output/get-server-info.json'),
|
104
|
+
require('./schemas/output/get-settings.json'),
|
105
|
+
require('./schemas/output/orderbook-orders.json'),
|
106
|
+
require('./schemas/output/outcome.json'),
|
107
|
+
require('./schemas/output/get-transaction.json'),
|
108
|
+
require('./schemas/output/get-transactions.json'),
|
109
|
+
require('./schemas/output/get-trustlines.json'),
|
110
|
+
require('./schemas/output/sign-payment-channel-claim.json'),
|
111
|
+
require('./schemas/output/verify-payment-channel-claim.json'),
|
112
|
+
require('./schemas/input/get-balances.json'),
|
113
|
+
require('./schemas/input/get-balance-sheet.json'),
|
114
|
+
require('./schemas/input/get-ledger.json'),
|
115
|
+
require('./schemas/input/get-orders.json'),
|
116
|
+
require('./schemas/input/get-orderbook.json'),
|
117
|
+
require('./schemas/input/get-paths.json'),
|
118
|
+
require('./schemas/input/get-payment-channel.json'),
|
119
|
+
require('./schemas/input/api-options.json'),
|
120
|
+
require('./schemas/input/get-settings.json'),
|
121
|
+
require('./schemas/input/get-account-info.json'),
|
122
|
+
require('./schemas/input/get-account-objects.json'),
|
123
|
+
require('./schemas/input/get-transaction.json'),
|
124
|
+
require('./schemas/input/get-transactions.json'),
|
125
|
+
require('./schemas/input/get-trustlines.json'),
|
126
|
+
require('./schemas/input/prepare-payment.json'),
|
127
|
+
require('./schemas/input/prepare-order.json'),
|
128
|
+
require('./schemas/input/prepare-trustline.json'),
|
129
|
+
require('./schemas/input/prepare-order-cancellation.json'),
|
130
|
+
require('./schemas/input/prepare-settings.json'),
|
131
|
+
require('./schemas/input/prepare-escrow-creation.json'),
|
132
|
+
require('./schemas/input/prepare-escrow-cancellation.json'),
|
133
|
+
require('./schemas/input/prepare-escrow-execution.json'),
|
134
|
+
require('./schemas/input/prepare-payment-channel-create.json'),
|
135
|
+
require('./schemas/input/prepare-payment-channel-fund.json'),
|
136
|
+
require('./schemas/input/prepare-payment-channel-claim.json'),
|
137
|
+
require('./schemas/input/prepare-check-create.json'),
|
138
|
+
require('./schemas/input/prepare-check-cash.json'),
|
139
|
+
require('./schemas/input/prepare-check-cancel.json'),
|
140
|
+
require('./schemas/input/prepare-ticket-create.json'),
|
141
|
+
require('./schemas/input/compute-ledger-hash.json'),
|
142
|
+
require('./schemas/input/sign.json'),
|
143
|
+
require('./schemas/input/submit.json'),
|
144
|
+
require('./schemas/input/generate-address.json'),
|
145
|
+
require('./schemas/input/sign-payment-channel-claim.json'),
|
146
|
+
require('./schemas/input/verify-payment-channel-claim.json'),
|
147
|
+
require('./schemas/input/combine.json')
|
148
|
+
];
|
149
|
+
const titles = schemas.map((schema) => schema.title);
|
150
|
+
const duplicates = Object.keys(_.pickBy(_.countBy(titles), (count) => count > 1));
|
151
|
+
assert.ok(duplicates.length === 0, 'Duplicate schemas for: ' + duplicates);
|
152
|
+
const validator = new Validator();
|
153
|
+
validator.customFormats.xAddress = function (instance) {
|
154
|
+
if (instance == null) {
|
155
|
+
return true;
|
156
|
+
}
|
157
|
+
return ripple_address_codec_1.isValidXAddress(instance);
|
158
|
+
};
|
159
|
+
validator.customFormats.classicAddress = function (instance) {
|
160
|
+
if (instance == null) {
|
161
|
+
return true;
|
162
|
+
}
|
163
|
+
return isValidAddress(instance);
|
164
|
+
};
|
165
|
+
validator.customFormats.secret = function (instance) {
|
166
|
+
if (instance == null) {
|
167
|
+
return true;
|
168
|
+
}
|
169
|
+
return utils_1.isValidSecret(instance);
|
170
|
+
};
|
171
|
+
schemas.forEach((schema) => validator.addSchema(schema, '/' + schema.title));
|
172
|
+
return validator;
|
173
|
+
}
|
174
|
+
const schemaValidator = loadSchemas();
|
175
|
+
function schemaValidate(schemaName, object) {
|
176
|
+
const schema = schemaValidator.getSchema('/' + schemaName);
|
177
|
+
if (schema == null) {
|
178
|
+
throw new errors_1.ValidationError('no schema for ' + schemaName);
|
179
|
+
}
|
180
|
+
const result = schemaValidator.validate(object, schema);
|
181
|
+
if (!result.valid) {
|
182
|
+
throw new errors_1.ValidationError(result.errors.join());
|
183
|
+
}
|
184
|
+
}
|
185
|
+
exports.schemaValidate = schemaValidate;
|
186
|
+
function isValidAddress(address) {
|
187
|
+
return ripple_address_codec_1.isValidXAddress(address) || ripple_address_codec_1.isValidClassicAddress(address);
|
188
|
+
}
|
189
|
+
exports.isValidAddress = isValidAddress;
|
190
|
+
//# sourceMappingURL=schema-validator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema-validator.js","sourceRoot":"","sources":["../../../src/common/schema-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA2B;AAC3B,+CAAgC;AAChC,MAAM,EAAC,SAAS,EAA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AAO,qBAAa,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC,CAAA;IAGD,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CACzB,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAChD,CAAA;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,MAAM,eAAe,GAAG,WAAW,EAAE,CAAA;AAErC,SAAS,cAAc,CAAC,UAAkB,EAAE,MAAW;IAErD,MAAM,MAAM,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG,GAAG,UAAU,CAAC,CAAA;IAC1D,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,MAAM,IAAI,wBAAe,CAAC,gBAAgB,GAAG,UAAU,CAAC,CAAA;KACzD;IACD,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;QACjB,MAAM,IAAI,wBAAe,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;KAChD;AACH,CAAC;AAMO,wCAAc;AAJtB,SAAS,cAAc,CAAC,OAAe;IACrC,OAAO,sCAAe,CAAC,OAAO,CAAC,IAAI,4CAAqB,CAAC,OAAO,CAAC,CAAA;AACnE,CAAC;AAEsC,wCAAc"}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"title": "api-options",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"trace": {
|
7
|
+
"type": "boolean",
|
8
|
+
"description": "If true, log rippled requests and responses to stdout."
|
9
|
+
},
|
10
|
+
"feeCushion": {
|
11
|
+
"type": "number",
|
12
|
+
"minimum": 1,
|
13
|
+
"description": "Factor to multiply estimated fee by to provide a cushion in case the required fee rises during submission of a transaction. Defaults to `1.2`."
|
14
|
+
},
|
15
|
+
"maxFeeXRP": {
|
16
|
+
"type": "string",
|
17
|
+
"description": "Maximum fee to use with transactions, in XRP. Must be a string-encoded number. Defaults to `'2'`."
|
18
|
+
},
|
19
|
+
"server": {
|
20
|
+
"type": "string",
|
21
|
+
"description": "URI for rippled websocket port to connect to. Must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.",
|
22
|
+
"format": "uri",
|
23
|
+
"pattern": "^(wss?|wss?\\+unix)://"
|
24
|
+
},
|
25
|
+
"proxy": {
|
26
|
+
"format": "uri",
|
27
|
+
"description": "URI for HTTP/HTTPS proxy to use to connect to the rippled server."
|
28
|
+
},
|
29
|
+
"timeout": {
|
30
|
+
"type": "integer",
|
31
|
+
"description": "Request timeout in milliseconds before considering a request to have failed. See also: connectionTimeout.",
|
32
|
+
"minimum": 1
|
33
|
+
},
|
34
|
+
"connectionTimeout": {
|
35
|
+
"type": "integer",
|
36
|
+
"description": "Connection timeout, in milliseconds, before considering connect() to have failed.",
|
37
|
+
"minimum": 1
|
38
|
+
},
|
39
|
+
"proxyAuthorization": {
|
40
|
+
"type": "string",
|
41
|
+
"description": "Username and password for HTTP basic authentication to the proxy in the format **username:password**."
|
42
|
+
},
|
43
|
+
"authorization": {
|
44
|
+
"type": "string",
|
45
|
+
"description": "Username and password for HTTP basic authentication to the rippled server in the format **username:password**."
|
46
|
+
},
|
47
|
+
"trustedCertificates": {
|
48
|
+
"type": "array",
|
49
|
+
"description": "Array of PEM-formatted SSL certificates to trust when connecting to a proxy. This is useful if you want to use a self-signed certificate on the proxy server. Note: Each element must contain a single certificate; concatenated certificates are not valid.",
|
50
|
+
"items": {
|
51
|
+
"type": "string",
|
52
|
+
"description": "A PEM-formatted SSL certificate to trust when connecting to a proxy."
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"key": {
|
56
|
+
"type": "string",
|
57
|
+
"description": "A string containing the private key of the client in PEM format. (Can be an array of keys)."
|
58
|
+
},
|
59
|
+
"passphrase": {
|
60
|
+
"type": "string",
|
61
|
+
"description": "The passphrase for the private key of the client."
|
62
|
+
},
|
63
|
+
"certificate": {
|
64
|
+
"type": "string",
|
65
|
+
"description": "A string containing the certificate key of the client in PEM format. (Can be an array of certificates)."
|
66
|
+
}
|
67
|
+
},
|
68
|
+
"additionalProperties": false
|
69
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"title": "combineParameters",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"signedTransactions": {
|
7
|
+
"type": "array",
|
8
|
+
"description": "An array of signed transactions (from the output of [sign](#sign)) to combine.",
|
9
|
+
"items": {
|
10
|
+
"type": "string",
|
11
|
+
"pattern": "^[A-F0-9]+$",
|
12
|
+
"description": "A single-signed transaction represented as an uppercase hexadecimal string (from the output of [sign](#sign))"
|
13
|
+
},
|
14
|
+
"minLength": 1
|
15
|
+
}
|
16
|
+
},
|
17
|
+
"additionalProperties": false,
|
18
|
+
"required": ["signedTransactions"]
|
19
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"title": "computeLedgerHashParameters",
|
4
|
+
"type": "object",
|
5
|
+
"properties": {
|
6
|
+
"ledger": {
|
7
|
+
"$ref": "getLedger",
|
8
|
+
"description": "The ledger header to hash."
|
9
|
+
}
|
10
|
+
},
|
11
|
+
"additionalProperties": false,
|
12
|
+
"required": ["ledger"]
|
13
|
+
}
|