@stellar/stellar-sdk 12.3.0 → 13.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +29 -7
- package/dist/stellar-sdk-minimal.js +45947 -0
- package/dist/stellar-sdk-minimal.min.js +2 -0
- package/dist/stellar-sdk-minimal.min.js.LICENSE.txt +69 -0
- package/dist/stellar-sdk-no-axios.js +56586 -0
- package/dist/stellar-sdk-no-axios.min.js +2 -0
- package/dist/stellar-sdk-no-axios.min.js.LICENSE.txt +71 -0
- package/dist/stellar-sdk-no-eventsource.js +49760 -0
- package/dist/stellar-sdk-no-eventsource.min.js +2 -0
- package/dist/stellar-sdk-no-eventsource.min.js.LICENSE.txt +69 -0
- package/dist/stellar-sdk.js +28203 -27336
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/browser.d.ts +2 -2
- package/lib/browser.js +5 -7
- package/lib/config.d.ts +31 -19
- package/lib/contract/assembled_transaction.d.ts +22 -14
- package/lib/contract/assembled_transaction.js +158 -127
- package/lib/contract/basic_node_signer.d.ts +6 -1
- package/lib/contract/client.d.ts +24 -24
- package/lib/contract/rust_result.d.ts +22 -12
- package/lib/contract/sent_transaction.d.ts +7 -1
- package/lib/contract/sent_transaction.js +2 -2
- package/lib/contract/spec.d.ts +8 -14
- package/lib/contract/types.d.ts +81 -13
- package/lib/contract/utils.d.ts +8 -1
- package/lib/errors/account_requires_memo.d.ts +24 -0
- package/lib/errors/account_requires_memo.js +38 -0
- package/lib/errors/bad_request.d.ts +14 -0
- package/lib/errors/bad_request.js +34 -0
- package/lib/errors/bad_response.d.ts +17 -0
- package/lib/errors/bad_response.js +34 -0
- package/lib/errors/index.d.ts +5 -0
- package/lib/errors/index.js +60 -0
- package/lib/errors/network.d.ts +33 -0
- package/lib/{errors.js → errors/network.js} +1 -59
- package/lib/errors/not_found.d.ts +14 -0
- package/lib/errors/not_found.js +34 -0
- package/lib/federation/api.d.ts +21 -0
- package/lib/federation/index.d.ts +1 -1
- package/lib/federation/index.js +16 -6
- package/lib/federation/server.d.ts +36 -38
- package/lib/federation/server.js +2 -2
- package/lib/horizon/account_call_builder.d.ts +10 -8
- package/lib/horizon/account_response.d.ts +5 -2
- package/lib/horizon/assets_call_builder.d.ts +3 -2
- package/lib/horizon/call_builder.js +9 -3
- package/lib/horizon/claimable_balances_call_builder.d.ts +10 -8
- package/lib/horizon/effect_call_builder.d.ts +8 -7
- package/lib/horizon/horizon_axios_client.d.ts +13 -6
- package/lib/horizon/horizon_axios_client.js +16 -4
- package/lib/horizon/index.d.ts +2 -1
- package/lib/horizon/index.js +1 -1
- package/lib/horizon/ledger_call_builder.d.ts +6 -4
- package/lib/horizon/liquidity_pool_call_builder.d.ts +3 -2
- package/lib/horizon/offer_call_builder.d.ts +12 -10
- package/lib/horizon/operation_call_builder.d.ts +11 -9
- package/lib/horizon/orderbook_call_builder.d.ts +7 -2
- package/lib/horizon/path_call_builder.d.ts +7 -2
- package/lib/horizon/payment_call_builder.d.ts +10 -6
- package/lib/horizon/server.d.ts +64 -55
- package/lib/horizon/server.js +6 -5
- package/lib/horizon/strict_receive_path_call_builder.d.ts +7 -2
- package/lib/horizon/strict_send_path_call_builder.d.ts +7 -2
- package/lib/horizon/trade_aggregation_call_builder.d.ts +4 -2
- package/lib/horizon/trades_call_builder.d.ts +8 -5
- package/lib/horizon/transaction_call_builder.d.ts +10 -7
- package/lib/http-client/axios-client.d.ts +2 -0
- package/lib/http-client/axios-client.js +10 -0
- package/lib/http-client/fetch-client.d.ts +11 -0
- package/lib/http-client/fetch-client.js +229 -0
- package/lib/http-client/index.d.ts +5 -0
- package/lib/http-client/index.js +33 -0
- package/lib/http-client/types.d.ts +69 -0
- package/lib/http-client/types.js +34 -0
- package/lib/index.d.ts +3 -4
- package/lib/index.js +7 -1
- package/lib/minimal/browser.d.ts +6 -0
- package/lib/minimal/browser.js +35 -0
- package/lib/minimal/config.d.ts +64 -0
- package/lib/minimal/config.js +51 -0
- package/lib/minimal/contract/assembled_transaction.d.ts +555 -0
- package/lib/minimal/contract/assembled_transaction.js +752 -0
- package/lib/minimal/contract/basic_node_signer.d.ts +17 -0
- package/lib/minimal/contract/basic_node_signer.js +52 -0
- package/lib/minimal/contract/client.d.ts +52 -0
- package/lib/minimal/contract/client.js +180 -0
- package/lib/minimal/contract/index.d.ts +7 -0
- package/lib/minimal/contract/index.js +82 -0
- package/lib/minimal/contract/rust_result.d.ts +81 -0
- package/lib/minimal/contract/rust_result.js +66 -0
- package/lib/minimal/contract/sent_transaction.d.ts +85 -0
- package/lib/minimal/contract/sent_transaction.js +151 -0
- package/lib/minimal/contract/spec.d.ts +152 -0
- package/lib/minimal/contract/spec.js +1020 -0
- package/lib/minimal/contract/types.d.ts +180 -0
- package/lib/minimal/contract/types.js +8 -0
- package/lib/minimal/contract/utils.d.ts +46 -0
- package/lib/minimal/contract/utils.js +123 -0
- package/lib/minimal/errors/account_requires_memo.d.ts +24 -0
- package/lib/minimal/errors/account_requires_memo.js +38 -0
- package/lib/minimal/errors/bad_request.d.ts +14 -0
- package/lib/minimal/errors/bad_request.js +34 -0
- package/lib/minimal/errors/bad_response.d.ts +17 -0
- package/lib/minimal/errors/bad_response.js +34 -0
- package/lib/minimal/errors/index.d.ts +5 -0
- package/lib/minimal/errors/index.js +60 -0
- package/lib/minimal/errors/network.d.ts +33 -0
- package/lib/minimal/errors/network.js +41 -0
- package/lib/minimal/errors/not_found.d.ts +14 -0
- package/lib/minimal/errors/not_found.js +34 -0
- package/lib/minimal/federation/api.d.ts +32 -0
- package/lib/minimal/federation/api.js +7 -0
- package/lib/minimal/federation/index.d.ts +2 -0
- package/lib/minimal/federation/index.js +34 -0
- package/lib/minimal/federation/server.d.ts +116 -0
- package/lib/minimal/federation/server.js +252 -0
- package/lib/minimal/friendbot/index.d.ts +5 -0
- package/lib/minimal/friendbot/index.js +7 -0
- package/lib/minimal/horizon/account_call_builder.d.ts +56 -0
- package/lib/minimal/horizon/account_call_builder.js +62 -0
- package/lib/minimal/horizon/account_response.d.ts +61 -0
- package/lib/minimal/horizon/account_response.js +49 -0
- package/lib/minimal/horizon/assets_call_builder.d.ts +27 -0
- package/lib/minimal/horizon/assets_call_builder.js +43 -0
- package/lib/minimal/horizon/call_builder.d.ts +128 -0
- package/lib/minimal/horizon/call_builder.js +362 -0
- package/lib/minimal/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/minimal/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/minimal/horizon/effect_call_builder.d.ts +53 -0
- package/lib/minimal/horizon/effect_call_builder.js +56 -0
- package/lib/minimal/horizon/friendbot_builder.d.ts +4 -0
- package/lib/minimal/horizon/friendbot_builder.js +32 -0
- package/lib/minimal/horizon/horizon_api.d.ts +527 -0
- package/lib/minimal/horizon/horizon_api.js +96 -0
- package/lib/minimal/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/minimal/horizon/horizon_axios_client.js +60 -0
- package/lib/minimal/horizon/index.d.ts +8 -0
- package/lib/minimal/horizon/index.js +78 -0
- package/lib/minimal/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/minimal/horizon/ledger_call_builder.js +37 -0
- package/lib/minimal/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/minimal/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/minimal/horizon/offer_call_builder.d.ts +65 -0
- package/lib/minimal/horizon/offer_call_builder.js +79 -0
- package/lib/minimal/horizon/operation_call_builder.d.ts +69 -0
- package/lib/minimal/horizon/operation_call_builder.js +69 -0
- package/lib/minimal/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/minimal/horizon/orderbook_call_builder.js +45 -0
- package/lib/minimal/horizon/path_call_builder.d.ts +35 -0
- package/lib/minimal/horizon/path_call_builder.js +41 -0
- package/lib/minimal/horizon/payment_call_builder.d.ts +39 -0
- package/lib/minimal/horizon/payment_call_builder.js +46 -0
- package/lib/minimal/horizon/server.d.ts +389 -0
- package/lib/minimal/horizon/server.js +550 -0
- package/lib/minimal/horizon/server_api.d.ts +278 -0
- package/lib/minimal/horizon/server_api.js +19 -0
- package/lib/minimal/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/minimal/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/minimal/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/minimal/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/minimal/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/minimal/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/minimal/horizon/trades_call_builder.d.ts +52 -0
- package/lib/minimal/horizon/trades_call_builder.js +72 -0
- package/lib/minimal/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/minimal/horizon/transaction_call_builder.js +64 -0
- package/lib/minimal/horizon/types/account.d.ts +5 -0
- package/lib/minimal/horizon/types/account.js +5 -0
- package/lib/minimal/horizon/types/assets.d.ts +19 -0
- package/lib/minimal/horizon/types/assets.js +5 -0
- package/lib/minimal/horizon/types/effects.d.ts +285 -0
- package/lib/minimal/horizon/types/effects.js +62 -0
- package/lib/minimal/horizon/types/offer.d.ts +20 -0
- package/lib/minimal/horizon/types/offer.js +5 -0
- package/lib/minimal/horizon/types/trade.d.ts +13 -0
- package/lib/minimal/horizon/types/trade.js +5 -0
- package/lib/minimal/http-client/axios-client.d.ts +2 -0
- package/lib/minimal/http-client/axios-client.js +10 -0
- package/lib/minimal/http-client/fetch-client.d.ts +11 -0
- package/lib/minimal/http-client/fetch-client.js +229 -0
- package/lib/minimal/http-client/index.d.ts +5 -0
- package/lib/minimal/http-client/index.js +33 -0
- package/lib/minimal/http-client/types.d.ts +69 -0
- package/lib/minimal/http-client/types.js +34 -0
- package/lib/minimal/index.d.ts +36 -0
- package/lib/minimal/index.js +83 -0
- package/lib/minimal/rpc/api.d.ts +359 -0
- package/lib/minimal/rpc/api.js +32 -0
- package/lib/minimal/rpc/axios.d.ts +4 -0
- package/lib/minimal/rpc/axios.js +15 -0
- package/lib/minimal/rpc/browser.d.ts +4 -0
- package/lib/minimal/rpc/browser.js +27 -0
- package/lib/minimal/rpc/index.d.ts +8 -0
- package/lib/minimal/rpc/index.js +72 -0
- package/lib/minimal/rpc/jsonrpc.d.ts +35 -0
- package/lib/minimal/rpc/jsonrpc.js +52 -0
- package/lib/minimal/rpc/parsers.d.ts +39 -0
- package/lib/minimal/rpc/parsers.js +155 -0
- package/lib/minimal/rpc/server.d.ts +584 -0
- package/lib/minimal/rpc/server.js +823 -0
- package/lib/minimal/rpc/transaction.d.ts +21 -0
- package/lib/minimal/rpc/transaction.js +53 -0
- package/lib/minimal/rpc/utils.d.ts +1 -0
- package/lib/minimal/rpc/utils.js +9 -0
- package/lib/minimal/stellartoml/index.d.ts +131 -0
- package/lib/minimal/stellartoml/index.js +77 -0
- package/lib/minimal/utils.d.ts +19 -0
- package/lib/minimal/utils.js +31 -0
- package/lib/minimal/webauth/errors.d.ts +13 -0
- package/lib/minimal/webauth/errors.js +36 -0
- package/lib/minimal/webauth/index.d.ts +2 -0
- package/lib/minimal/webauth/index.js +27 -0
- package/lib/minimal/webauth/utils.d.ts +307 -0
- package/lib/minimal/webauth/utils.js +332 -0
- package/lib/no-axios/browser.d.ts +6 -0
- package/lib/no-axios/browser.js +35 -0
- package/lib/no-axios/config.d.ts +64 -0
- package/lib/no-axios/config.js +51 -0
- package/lib/no-axios/contract/assembled_transaction.d.ts +555 -0
- package/lib/no-axios/contract/assembled_transaction.js +752 -0
- package/lib/no-axios/contract/basic_node_signer.d.ts +17 -0
- package/lib/no-axios/contract/basic_node_signer.js +52 -0
- package/lib/no-axios/contract/client.d.ts +52 -0
- package/lib/no-axios/contract/client.js +180 -0
- package/lib/no-axios/contract/index.d.ts +7 -0
- package/lib/no-axios/contract/index.js +82 -0
- package/lib/no-axios/contract/rust_result.d.ts +81 -0
- package/lib/no-axios/contract/rust_result.js +66 -0
- package/lib/no-axios/contract/sent_transaction.d.ts +85 -0
- package/lib/no-axios/contract/sent_transaction.js +151 -0
- package/lib/no-axios/contract/spec.d.ts +152 -0
- package/lib/no-axios/contract/spec.js +1020 -0
- package/lib/no-axios/contract/types.d.ts +180 -0
- package/lib/no-axios/contract/types.js +8 -0
- package/lib/no-axios/contract/utils.d.ts +46 -0
- package/lib/no-axios/contract/utils.js +123 -0
- package/lib/no-axios/errors/account_requires_memo.d.ts +24 -0
- package/lib/no-axios/errors/account_requires_memo.js +38 -0
- package/lib/no-axios/errors/bad_request.d.ts +14 -0
- package/lib/no-axios/errors/bad_request.js +34 -0
- package/lib/no-axios/errors/bad_response.d.ts +17 -0
- package/lib/no-axios/errors/bad_response.js +34 -0
- package/lib/no-axios/errors/index.d.ts +5 -0
- package/lib/no-axios/errors/index.js +60 -0
- package/lib/no-axios/errors/network.d.ts +33 -0
- package/lib/no-axios/errors/network.js +41 -0
- package/lib/no-axios/errors/not_found.d.ts +14 -0
- package/lib/no-axios/errors/not_found.js +34 -0
- package/lib/no-axios/federation/api.d.ts +32 -0
- package/lib/no-axios/federation/api.js +7 -0
- package/lib/no-axios/federation/index.d.ts +2 -0
- package/lib/no-axios/federation/index.js +34 -0
- package/lib/no-axios/federation/server.d.ts +116 -0
- package/lib/no-axios/federation/server.js +252 -0
- package/lib/no-axios/friendbot/index.d.ts +5 -0
- package/lib/no-axios/friendbot/index.js +7 -0
- package/lib/no-axios/horizon/account_call_builder.d.ts +56 -0
- package/lib/no-axios/horizon/account_call_builder.js +62 -0
- package/lib/no-axios/horizon/account_response.d.ts +61 -0
- package/lib/no-axios/horizon/account_response.js +49 -0
- package/lib/no-axios/horizon/assets_call_builder.d.ts +27 -0
- package/lib/no-axios/horizon/assets_call_builder.js +43 -0
- package/lib/no-axios/horizon/call_builder.d.ts +128 -0
- package/lib/no-axios/horizon/call_builder.js +362 -0
- package/lib/no-axios/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/no-axios/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/no-axios/horizon/effect_call_builder.d.ts +53 -0
- package/lib/no-axios/horizon/effect_call_builder.js +56 -0
- package/lib/no-axios/horizon/friendbot_builder.d.ts +4 -0
- package/lib/no-axios/horizon/friendbot_builder.js +32 -0
- package/lib/no-axios/horizon/horizon_api.d.ts +527 -0
- package/lib/no-axios/horizon/horizon_api.js +96 -0
- package/lib/no-axios/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/no-axios/horizon/horizon_axios_client.js +60 -0
- package/lib/no-axios/horizon/index.d.ts +8 -0
- package/lib/no-axios/horizon/index.js +78 -0
- package/lib/no-axios/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/no-axios/horizon/ledger_call_builder.js +37 -0
- package/lib/no-axios/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/no-axios/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/no-axios/horizon/offer_call_builder.d.ts +65 -0
- package/lib/no-axios/horizon/offer_call_builder.js +79 -0
- package/lib/no-axios/horizon/operation_call_builder.d.ts +69 -0
- package/lib/no-axios/horizon/operation_call_builder.js +69 -0
- package/lib/no-axios/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/no-axios/horizon/orderbook_call_builder.js +45 -0
- package/lib/no-axios/horizon/path_call_builder.d.ts +35 -0
- package/lib/no-axios/horizon/path_call_builder.js +41 -0
- package/lib/no-axios/horizon/payment_call_builder.d.ts +39 -0
- package/lib/no-axios/horizon/payment_call_builder.js +46 -0
- package/lib/no-axios/horizon/server.d.ts +389 -0
- package/lib/no-axios/horizon/server.js +550 -0
- package/lib/no-axios/horizon/server_api.d.ts +278 -0
- package/lib/no-axios/horizon/server_api.js +19 -0
- package/lib/no-axios/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/no-axios/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/no-axios/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/no-axios/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/no-axios/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/no-axios/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/no-axios/horizon/trades_call_builder.d.ts +52 -0
- package/lib/no-axios/horizon/trades_call_builder.js +72 -0
- package/lib/no-axios/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/no-axios/horizon/transaction_call_builder.js +64 -0
- package/lib/no-axios/horizon/types/account.d.ts +5 -0
- package/lib/no-axios/horizon/types/account.js +5 -0
- package/lib/no-axios/horizon/types/assets.d.ts +19 -0
- package/lib/no-axios/horizon/types/assets.js +5 -0
- package/lib/no-axios/horizon/types/effects.d.ts +285 -0
- package/lib/no-axios/horizon/types/effects.js +62 -0
- package/lib/no-axios/horizon/types/offer.d.ts +20 -0
- package/lib/no-axios/horizon/types/offer.js +5 -0
- package/lib/no-axios/horizon/types/trade.d.ts +13 -0
- package/lib/no-axios/horizon/types/trade.js +5 -0
- package/lib/no-axios/http-client/axios-client.d.ts +2 -0
- package/lib/no-axios/http-client/axios-client.js +10 -0
- package/lib/no-axios/http-client/fetch-client.d.ts +11 -0
- package/lib/no-axios/http-client/fetch-client.js +229 -0
- package/lib/no-axios/http-client/index.d.ts +5 -0
- package/lib/no-axios/http-client/index.js +33 -0
- package/lib/no-axios/http-client/types.d.ts +69 -0
- package/lib/no-axios/http-client/types.js +34 -0
- package/lib/no-axios/index.d.ts +36 -0
- package/lib/no-axios/index.js +83 -0
- package/lib/no-axios/rpc/api.d.ts +359 -0
- package/lib/no-axios/rpc/api.js +32 -0
- package/lib/no-axios/rpc/axios.d.ts +4 -0
- package/lib/no-axios/rpc/axios.js +15 -0
- package/lib/no-axios/rpc/browser.d.ts +4 -0
- package/lib/no-axios/rpc/browser.js +27 -0
- package/lib/no-axios/rpc/index.d.ts +8 -0
- package/lib/no-axios/rpc/index.js +72 -0
- package/lib/no-axios/rpc/jsonrpc.d.ts +35 -0
- package/lib/no-axios/rpc/jsonrpc.js +52 -0
- package/lib/no-axios/rpc/parsers.d.ts +39 -0
- package/lib/no-axios/rpc/parsers.js +155 -0
- package/lib/no-axios/rpc/server.d.ts +584 -0
- package/lib/no-axios/rpc/server.js +823 -0
- package/lib/no-axios/rpc/transaction.d.ts +21 -0
- package/lib/no-axios/rpc/transaction.js +53 -0
- package/lib/no-axios/rpc/utils.d.ts +1 -0
- package/lib/no-axios/rpc/utils.js +9 -0
- package/lib/no-axios/stellartoml/index.d.ts +131 -0
- package/lib/no-axios/stellartoml/index.js +77 -0
- package/lib/no-axios/utils.d.ts +19 -0
- package/lib/no-axios/utils.js +31 -0
- package/lib/no-axios/webauth/errors.d.ts +13 -0
- package/lib/no-axios/webauth/errors.js +36 -0
- package/lib/no-axios/webauth/index.d.ts +2 -0
- package/lib/no-axios/webauth/index.js +27 -0
- package/lib/no-axios/webauth/utils.d.ts +307 -0
- package/lib/no-axios/webauth/utils.js +332 -0
- package/lib/no-eventsource/browser.d.ts +6 -0
- package/lib/no-eventsource/browser.js +35 -0
- package/lib/no-eventsource/config.d.ts +64 -0
- package/lib/no-eventsource/config.js +51 -0
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +555 -0
- package/lib/no-eventsource/contract/assembled_transaction.js +752 -0
- package/lib/no-eventsource/contract/basic_node_signer.d.ts +17 -0
- package/lib/no-eventsource/contract/basic_node_signer.js +52 -0
- package/lib/no-eventsource/contract/client.d.ts +52 -0
- package/lib/no-eventsource/contract/client.js +180 -0
- package/lib/no-eventsource/contract/index.d.ts +7 -0
- package/lib/no-eventsource/contract/index.js +82 -0
- package/lib/no-eventsource/contract/rust_result.d.ts +81 -0
- package/lib/no-eventsource/contract/rust_result.js +66 -0
- package/lib/no-eventsource/contract/sent_transaction.d.ts +85 -0
- package/lib/no-eventsource/contract/sent_transaction.js +151 -0
- package/lib/no-eventsource/contract/spec.d.ts +152 -0
- package/lib/no-eventsource/contract/spec.js +1020 -0
- package/lib/no-eventsource/contract/types.d.ts +180 -0
- package/lib/no-eventsource/contract/types.js +8 -0
- package/lib/no-eventsource/contract/utils.d.ts +46 -0
- package/lib/no-eventsource/contract/utils.js +123 -0
- package/lib/no-eventsource/errors/account_requires_memo.d.ts +24 -0
- package/lib/no-eventsource/errors/account_requires_memo.js +38 -0
- package/lib/no-eventsource/errors/bad_request.d.ts +14 -0
- package/lib/no-eventsource/errors/bad_request.js +34 -0
- package/lib/no-eventsource/errors/bad_response.d.ts +17 -0
- package/lib/no-eventsource/errors/bad_response.js +34 -0
- package/lib/no-eventsource/errors/index.d.ts +5 -0
- package/lib/no-eventsource/errors/index.js +60 -0
- package/lib/no-eventsource/errors/network.d.ts +33 -0
- package/lib/no-eventsource/errors/network.js +41 -0
- package/lib/no-eventsource/errors/not_found.d.ts +14 -0
- package/lib/no-eventsource/errors/not_found.js +34 -0
- package/lib/no-eventsource/federation/api.d.ts +32 -0
- package/lib/no-eventsource/federation/api.js +7 -0
- package/lib/no-eventsource/federation/index.d.ts +2 -0
- package/lib/no-eventsource/federation/index.js +34 -0
- package/lib/no-eventsource/federation/server.d.ts +116 -0
- package/lib/no-eventsource/federation/server.js +252 -0
- package/lib/no-eventsource/friendbot/index.d.ts +5 -0
- package/lib/no-eventsource/friendbot/index.js +7 -0
- package/lib/no-eventsource/horizon/account_call_builder.d.ts +56 -0
- package/lib/no-eventsource/horizon/account_call_builder.js +62 -0
- package/lib/no-eventsource/horizon/account_response.d.ts +61 -0
- package/lib/no-eventsource/horizon/account_response.js +49 -0
- package/lib/no-eventsource/horizon/assets_call_builder.d.ts +27 -0
- package/lib/no-eventsource/horizon/assets_call_builder.js +43 -0
- package/lib/no-eventsource/horizon/call_builder.d.ts +128 -0
- package/lib/no-eventsource/horizon/call_builder.js +362 -0
- package/lib/no-eventsource/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/no-eventsource/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/no-eventsource/horizon/effect_call_builder.d.ts +53 -0
- package/lib/no-eventsource/horizon/effect_call_builder.js +56 -0
- package/lib/no-eventsource/horizon/friendbot_builder.d.ts +4 -0
- package/lib/no-eventsource/horizon/friendbot_builder.js +32 -0
- package/lib/no-eventsource/horizon/horizon_api.d.ts +527 -0
- package/lib/no-eventsource/horizon/horizon_api.js +96 -0
- package/lib/no-eventsource/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/no-eventsource/horizon/horizon_axios_client.js +60 -0
- package/lib/no-eventsource/horizon/index.d.ts +8 -0
- package/lib/no-eventsource/horizon/index.js +78 -0
- package/lib/no-eventsource/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/no-eventsource/horizon/ledger_call_builder.js +37 -0
- package/lib/no-eventsource/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/no-eventsource/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/no-eventsource/horizon/offer_call_builder.d.ts +65 -0
- package/lib/no-eventsource/horizon/offer_call_builder.js +79 -0
- package/lib/no-eventsource/horizon/operation_call_builder.d.ts +69 -0
- package/lib/no-eventsource/horizon/operation_call_builder.js +69 -0
- package/lib/no-eventsource/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/no-eventsource/horizon/orderbook_call_builder.js +45 -0
- package/lib/no-eventsource/horizon/path_call_builder.d.ts +35 -0
- package/lib/no-eventsource/horizon/path_call_builder.js +41 -0
- package/lib/no-eventsource/horizon/payment_call_builder.d.ts +39 -0
- package/lib/no-eventsource/horizon/payment_call_builder.js +46 -0
- package/lib/no-eventsource/horizon/server.d.ts +389 -0
- package/lib/no-eventsource/horizon/server.js +550 -0
- package/lib/no-eventsource/horizon/server_api.d.ts +278 -0
- package/lib/no-eventsource/horizon/server_api.js +19 -0
- package/lib/no-eventsource/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/no-eventsource/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/no-eventsource/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/no-eventsource/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/no-eventsource/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/no-eventsource/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/no-eventsource/horizon/trades_call_builder.d.ts +52 -0
- package/lib/no-eventsource/horizon/trades_call_builder.js +72 -0
- package/lib/no-eventsource/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/no-eventsource/horizon/transaction_call_builder.js +64 -0
- package/lib/no-eventsource/horizon/types/account.d.ts +5 -0
- package/lib/no-eventsource/horizon/types/account.js +5 -0
- package/lib/no-eventsource/horizon/types/assets.d.ts +19 -0
- package/lib/no-eventsource/horizon/types/assets.js +5 -0
- package/lib/no-eventsource/horizon/types/effects.d.ts +285 -0
- package/lib/no-eventsource/horizon/types/effects.js +62 -0
- package/lib/no-eventsource/horizon/types/offer.d.ts +20 -0
- package/lib/no-eventsource/horizon/types/offer.js +5 -0
- package/lib/no-eventsource/horizon/types/trade.d.ts +13 -0
- package/lib/no-eventsource/horizon/types/trade.js +5 -0
- package/lib/no-eventsource/http-client/axios-client.d.ts +2 -0
- package/lib/no-eventsource/http-client/axios-client.js +10 -0
- package/lib/no-eventsource/http-client/fetch-client.d.ts +11 -0
- package/lib/no-eventsource/http-client/fetch-client.js +229 -0
- package/lib/no-eventsource/http-client/index.d.ts +5 -0
- package/lib/no-eventsource/http-client/index.js +33 -0
- package/lib/no-eventsource/http-client/types.d.ts +69 -0
- package/lib/no-eventsource/http-client/types.js +34 -0
- package/lib/no-eventsource/index.d.ts +36 -0
- package/lib/no-eventsource/index.js +83 -0
- package/lib/no-eventsource/rpc/api.d.ts +359 -0
- package/lib/no-eventsource/rpc/api.js +32 -0
- package/lib/no-eventsource/rpc/axios.d.ts +4 -0
- package/lib/no-eventsource/rpc/axios.js +15 -0
- package/lib/no-eventsource/rpc/browser.d.ts +4 -0
- package/lib/no-eventsource/rpc/browser.js +27 -0
- package/lib/no-eventsource/rpc/index.d.ts +8 -0
- package/lib/no-eventsource/rpc/index.js +72 -0
- package/lib/no-eventsource/rpc/jsonrpc.d.ts +35 -0
- package/lib/no-eventsource/rpc/jsonrpc.js +52 -0
- package/lib/no-eventsource/rpc/parsers.d.ts +39 -0
- package/lib/no-eventsource/rpc/parsers.js +155 -0
- package/lib/no-eventsource/rpc/server.d.ts +584 -0
- package/lib/no-eventsource/rpc/server.js +823 -0
- package/lib/no-eventsource/rpc/transaction.d.ts +21 -0
- package/lib/no-eventsource/rpc/transaction.js +53 -0
- package/lib/no-eventsource/rpc/utils.d.ts +1 -0
- package/lib/no-eventsource/rpc/utils.js +9 -0
- package/lib/no-eventsource/stellartoml/index.d.ts +131 -0
- package/lib/no-eventsource/stellartoml/index.js +77 -0
- package/lib/no-eventsource/utils.d.ts +19 -0
- package/lib/no-eventsource/utils.js +31 -0
- package/lib/no-eventsource/webauth/errors.d.ts +13 -0
- package/lib/no-eventsource/webauth/errors.js +36 -0
- package/lib/no-eventsource/webauth/index.d.ts +2 -0
- package/lib/no-eventsource/webauth/index.js +27 -0
- package/lib/no-eventsource/webauth/utils.d.ts +307 -0
- package/lib/no-eventsource/webauth/utils.js +332 -0
- package/lib/rpc/api.d.ts +13 -2
- package/lib/rpc/axios.d.ts +3 -2
- package/lib/rpc/axios.js +3 -4
- package/lib/rpc/browser.d.ts +0 -2
- package/lib/rpc/browser.js +1 -11
- package/lib/rpc/index.d.ts +2 -1
- package/lib/rpc/index.js +1 -1
- package/lib/rpc/jsonrpc.d.ts +9 -1
- package/lib/rpc/parsers.d.ts +30 -10
- package/lib/rpc/parsers.js +11 -11
- package/lib/rpc/server.d.ts +169 -99
- package/lib/rpc/server.js +92 -6
- package/lib/rpc/transaction.d.ts +11 -9
- package/lib/stellartoml/index.d.ts +21 -11
- package/lib/stellartoml/index.js +3 -3
- package/lib/utils.d.ts +11 -4
- package/lib/webauth/errors.d.ts +9 -0
- package/lib/webauth/utils.d.ts +67 -54
- package/package.json +59 -7
- package/lib/errors.d.ts +0 -59
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SentTransaction = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _rpc = require("../rpc");
|
|
8
8
|
var _api = require("../rpc/api");
|
|
9
9
|
var _utils = require("./utils");
|
|
10
10
|
var _types = require("./types");
|
|
@@ -75,7 +75,7 @@ var SentTransaction = exports.SentTransaction = function () {
|
|
|
75
75
|
}, _callee);
|
|
76
76
|
})));
|
|
77
77
|
this.assembled = assembled;
|
|
78
|
-
this.server = new
|
|
78
|
+
this.server = new _rpc.Server(this.assembled.options.rpcUrl, {
|
|
79
79
|
allowHttp: (_this$assembled$optio2 = this.assembled.options.allowHttp) !== null && _this$assembled$optio2 !== void 0 ? _this$assembled$optio2 : false
|
|
80
80
|
});
|
|
81
81
|
}
|
package/lib/contract/spec.d.ts
CHANGED
|
@@ -8,8 +8,13 @@ export interface Union<T> {
|
|
|
8
8
|
* Provides a ContractSpec class which can contains the XDR types defined by the contract.
|
|
9
9
|
* This allows the class to be used to convert between native and raw `xdr.ScVal`s.
|
|
10
10
|
*
|
|
11
|
+
* Constructs a new ContractSpec from an array of XDR spec entries.
|
|
12
|
+
*
|
|
13
|
+
* @memberof module:contract
|
|
14
|
+
* @param {xdr.ScSpecEntry[] | string[]} entries the XDR spec entries
|
|
15
|
+
* @throws {Error} if entries is invalid
|
|
16
|
+
*
|
|
11
17
|
* @example
|
|
12
|
-
* ```js
|
|
13
18
|
* const specEntries = [...]; // XDR spec entries of a smart contract
|
|
14
19
|
* const contractSpec = new ContractSpec(specEntries);
|
|
15
20
|
*
|
|
@@ -27,23 +32,16 @@ export interface Union<T> {
|
|
|
27
32
|
* const result = contractSpec.funcResToNative('funcName', resultScv);
|
|
28
33
|
*
|
|
29
34
|
* console.log(result); // {success: true}
|
|
30
|
-
* ```
|
|
31
35
|
*/
|
|
32
36
|
export declare class Spec {
|
|
33
|
-
entries: xdr.ScSpecEntry[];
|
|
34
37
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @param {xdr.ScSpecEntry[] | string[]} entries the XDR spec entries
|
|
38
|
-
*
|
|
39
|
-
* @throws {Error} if entries is invalid
|
|
38
|
+
* The XDR spec entries.
|
|
40
39
|
*/
|
|
40
|
+
entries: xdr.ScSpecEntry[];
|
|
41
41
|
constructor(entries: xdr.ScSpecEntry[] | string[]);
|
|
42
42
|
/**
|
|
43
43
|
* Gets the XDR functions from the spec.
|
|
44
|
-
*
|
|
45
44
|
* @returns {xdr.ScSpecFunctionV0[]} all contract functions
|
|
46
|
-
*
|
|
47
45
|
*/
|
|
48
46
|
funcs(): xdr.ScSpecFunctionV0[];
|
|
49
47
|
/**
|
|
@@ -65,13 +63,11 @@ export declare class Spec {
|
|
|
65
63
|
* @throws {Error} if argument is missing or incorrect type
|
|
66
64
|
*
|
|
67
65
|
* @example
|
|
68
|
-
* ```js
|
|
69
66
|
* const args = {
|
|
70
67
|
* arg1: 'value1',
|
|
71
68
|
* arg2: 1234
|
|
72
69
|
* };
|
|
73
70
|
* const scArgs = contractSpec.funcArgsToScVals('funcName', args);
|
|
74
|
-
* ```
|
|
75
71
|
*/
|
|
76
72
|
funcArgsToScVals(name: string, args: object): xdr.ScVal[];
|
|
77
73
|
/**
|
|
@@ -84,10 +80,8 @@ export declare class Spec {
|
|
|
84
80
|
* @throws {Error} if return type mismatch or invalid input
|
|
85
81
|
*
|
|
86
82
|
* @example
|
|
87
|
-
* ```js
|
|
88
83
|
* const resultScv = 'AAA=='; // Base64 encoded ScVal
|
|
89
84
|
* const result = contractSpec.funcResToNative('funcName', resultScv);
|
|
90
|
-
* ```
|
|
91
85
|
*/
|
|
92
86
|
funcResToNative(name: string, val_or_base64: xdr.ScVal | string): any;
|
|
93
87
|
/**
|
package/lib/contract/types.d.ts
CHANGED
|
@@ -1,26 +1,64 @@
|
|
|
1
1
|
import { Memo, MemoType, Operation, Transaction, xdr } from "@stellar/stellar-base";
|
|
2
2
|
export type XDR_BASE64 = string;
|
|
3
|
+
/**
|
|
4
|
+
* An unsigned 32-bit integer.
|
|
5
|
+
* @memberof module:contract
|
|
6
|
+
*/
|
|
3
7
|
export type u32 = number;
|
|
8
|
+
/**
|
|
9
|
+
* A signed 32-bit integer.
|
|
10
|
+
* @memberof module:contract
|
|
11
|
+
*/
|
|
4
12
|
export type i32 = number;
|
|
13
|
+
/**
|
|
14
|
+
* An unsigned 64-bit integer.
|
|
15
|
+
* @memberof module:contract
|
|
16
|
+
*/
|
|
5
17
|
export type u64 = bigint;
|
|
18
|
+
/**
|
|
19
|
+
* A signed 64-bit integer.
|
|
20
|
+
* @memberof module:contract
|
|
21
|
+
*/
|
|
6
22
|
export type i64 = bigint;
|
|
23
|
+
/**
|
|
24
|
+
* An unsigned 128-bit integer.
|
|
25
|
+
* @memberof module:contract
|
|
26
|
+
*/
|
|
7
27
|
export type u128 = bigint;
|
|
28
|
+
/**
|
|
29
|
+
* A signed 128-bit integer.
|
|
30
|
+
* @memberof module:contract
|
|
31
|
+
*/
|
|
8
32
|
export type i128 = bigint;
|
|
33
|
+
/**
|
|
34
|
+
* An unsigned 256-bit integer.
|
|
35
|
+
* @memberof module:contract
|
|
36
|
+
*/
|
|
9
37
|
export type u256 = bigint;
|
|
38
|
+
/**
|
|
39
|
+
* A signed 256-bit integer.
|
|
40
|
+
* @memberof module:contract
|
|
41
|
+
*/
|
|
10
42
|
export type i256 = bigint;
|
|
11
43
|
export type Option<T> = T | undefined;
|
|
12
44
|
export type Typepoint = bigint;
|
|
13
45
|
export type Duration = bigint;
|
|
14
46
|
/**
|
|
15
47
|
* A "regular" transaction, as opposed to a FeeBumpTransaction.
|
|
48
|
+
* @memberof module:contract
|
|
49
|
+
* @type {Transaction<Memo<MemoType>, Operation[]>}
|
|
16
50
|
*/
|
|
17
51
|
export type Tx = Transaction<Memo<MemoType>, Operation[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Options for a smart contract client.
|
|
54
|
+
* @memberof module:contract
|
|
55
|
+
*/
|
|
18
56
|
export type ClientOptions = {
|
|
19
57
|
/**
|
|
20
58
|
* The public key of the account that will send this transaction. You can
|
|
21
59
|
* override this for specific methods later, like
|
|
22
|
-
* {@link AssembledTransaction#signAndSend} and
|
|
23
|
-
* {@link AssembledTransaction#signAuthEntries}.
|
|
60
|
+
* [signAndSend]{@link module:contract.AssembledTransaction#signAndSend} and
|
|
61
|
+
* [signAuthEntries]{@link module:contract.AssembledTransaction#signAuthEntries}.
|
|
24
62
|
*/
|
|
25
63
|
publicKey?: string;
|
|
26
64
|
/**
|
|
@@ -29,7 +67,7 @@ export type ClientOptions = {
|
|
|
29
67
|
* calls, which only need to be simulated. If you do not need to sign and
|
|
30
68
|
* send, there is no need to provide this. If you do not provide it during
|
|
31
69
|
* initialization, you can provide it later when you call
|
|
32
|
-
* {@link AssembledTransaction#signAndSend}.
|
|
70
|
+
* {@link module:contract.AssembledTransaction#signAndSend signAndSend}.
|
|
33
71
|
*
|
|
34
72
|
* Matches signature of `signTransaction` from Freighter.
|
|
35
73
|
*/
|
|
@@ -43,19 +81,29 @@ export type ClientOptions = {
|
|
|
43
81
|
* private key corresponding to the provided `publicKey`. This is only needed
|
|
44
82
|
* for multi-auth transactions, in which one transaction is signed by
|
|
45
83
|
* multiple parties. If you do not provide it during initialization, you can
|
|
46
|
-
* provide it later when you call {@link AssembledTransaction#signAuthEntries}.
|
|
84
|
+
* provide it later when you call {@link module:contract.AssembledTransaction#signAuthEntries signAuthEntries}.
|
|
47
85
|
*
|
|
48
86
|
* Matches signature of `signAuthEntry` from Freighter.
|
|
49
87
|
*/
|
|
50
88
|
signAuthEntry?: (entryXdr: XDR_BASE64, opts?: {
|
|
51
89
|
accountToSign?: string;
|
|
52
90
|
}) => Promise<XDR_BASE64>;
|
|
91
|
+
/** The address of the contract the client will interact with. */
|
|
53
92
|
contractId: string;
|
|
93
|
+
/**
|
|
94
|
+
* The network passphrase for the Stellar network this contract is deployed
|
|
95
|
+
* to.
|
|
96
|
+
*/
|
|
54
97
|
networkPassphrase: string;
|
|
98
|
+
/**
|
|
99
|
+
* The URL of the RPC instance that will be used to interact with this
|
|
100
|
+
* contract.
|
|
101
|
+
*/
|
|
55
102
|
rpcUrl: string;
|
|
56
103
|
/**
|
|
57
104
|
* If true, will allow HTTP requests to the Soroban network. If false, will
|
|
58
|
-
* only allow HTTPS requests.
|
|
105
|
+
* only allow HTTPS requests.
|
|
106
|
+
* @default false
|
|
59
107
|
*/
|
|
60
108
|
allowHttp?: boolean;
|
|
61
109
|
/**
|
|
@@ -67,11 +115,11 @@ export type ClientOptions = {
|
|
|
67
115
|
* on-chain XDR that also describes your contract's methods. Each error will
|
|
68
116
|
* have a specific number.
|
|
69
117
|
*
|
|
70
|
-
* A Client makes method calls with an {@link AssembledTransaction}.
|
|
118
|
+
* A Client makes method calls with an {@link module:contract.AssembledTransaction AssembledTransaction}.
|
|
71
119
|
* When one of these method calls encounters an error, `AssembledTransaction`
|
|
72
120
|
* will first attempt to parse the error as an "official" `contracterror`
|
|
73
121
|
* error, by using this passed-in `errorTypes` object. See
|
|
74
|
-
* {@link AssembledTransaction#parseError}. If `errorTypes` is blank or no
|
|
122
|
+
* {@link module:contract.AssembledTransaction#parseError parseError}. If `errorTypes` is blank or no
|
|
75
123
|
* matching error is found, then it will throw the raw error.
|
|
76
124
|
* @default {}
|
|
77
125
|
*/
|
|
@@ -79,24 +127,32 @@ export type ClientOptions = {
|
|
|
79
127
|
message: string;
|
|
80
128
|
}>;
|
|
81
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* Options for a smart contract method invocation.
|
|
132
|
+
* @memberof module:contract
|
|
133
|
+
*/
|
|
82
134
|
export type MethodOptions = {
|
|
83
135
|
/**
|
|
84
|
-
* The fee to pay for the transaction.
|
|
136
|
+
* The fee to pay for the transaction.
|
|
137
|
+
* @default 100
|
|
85
138
|
*/
|
|
86
139
|
fee?: string;
|
|
87
140
|
/**
|
|
88
|
-
* The
|
|
89
|
-
*
|
|
141
|
+
* The timebounds which should be set for transactions generated by this
|
|
142
|
+
* contract client. {@link module:contract#.DEFAULT_TIMEOUT}
|
|
143
|
+
* @default 300
|
|
90
144
|
*/
|
|
91
145
|
timeoutInSeconds?: number;
|
|
92
146
|
/**
|
|
93
147
|
* Whether to automatically simulate the transaction when constructing the
|
|
94
|
-
* AssembledTransaction.
|
|
148
|
+
* AssembledTransaction.
|
|
149
|
+
* @default true
|
|
95
150
|
*/
|
|
96
151
|
simulate?: boolean;
|
|
97
152
|
/**
|
|
98
153
|
* If true, will automatically attempt to restore the transaction if there
|
|
99
|
-
* are archived entries that need renewal.
|
|
154
|
+
* are archived entries that need renewal.
|
|
155
|
+
* @default false
|
|
100
156
|
*/
|
|
101
157
|
restore?: boolean;
|
|
102
158
|
};
|
|
@@ -106,7 +162,19 @@ export type AssembledTransactionOptions<T = string> = MethodOptions & ClientOpti
|
|
|
106
162
|
parseResultXdr: (xdr: xdr.ScVal) => T;
|
|
107
163
|
};
|
|
108
164
|
/**
|
|
109
|
-
* The default
|
|
165
|
+
* The default timebounds, in seconds, during which a transaction will be valid.
|
|
166
|
+
* This is attached to the transaction _before_ transaction simulation (it is
|
|
167
|
+
* needed for simulation to succeed). It is also re-calculated and re-added
|
|
168
|
+
* _before_ transaction signing.
|
|
169
|
+
* @constant {number}
|
|
170
|
+
* @default 300
|
|
171
|
+
* @memberof module:contract
|
|
110
172
|
*/
|
|
111
173
|
export declare const DEFAULT_TIMEOUT: number;
|
|
174
|
+
/**
|
|
175
|
+
* An impossible account on the Stellar network
|
|
176
|
+
* @constant {string}
|
|
177
|
+
* @default GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF
|
|
178
|
+
* @memberof module:contract
|
|
179
|
+
*/
|
|
112
180
|
export declare const NULL_ACCOUNT = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
|
package/lib/contract/utils.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { xdr, Account } from "@stellar/stellar-base";
|
|
2
|
-
import { Server } from "../rpc
|
|
2
|
+
import { Server } from "../rpc";
|
|
3
3
|
import { AssembledTransactionOptions } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Keep calling a `fn` for `timeoutInSeconds` seconds, if `keepWaitingIf` is
|
|
6
6
|
* true. Returns an array of all attempts to call the function.
|
|
7
|
+
* @private
|
|
7
8
|
*/
|
|
8
9
|
export declare function withExponentialBackoff<T>(
|
|
9
10
|
/** Function to call repeatedly */
|
|
@@ -22,10 +23,15 @@ verbose?: boolean): Promise<T[]>;
|
|
|
22
23
|
* methods. Each error will have a specific number. This Regular Expression
|
|
23
24
|
* matches these "expected error types" that a contract may throw, and helps
|
|
24
25
|
* {@link AssembledTransaction} parse these errors.
|
|
26
|
+
*
|
|
27
|
+
* @constant {RegExp}
|
|
28
|
+
* @default "/Error\(Contract, #(\d+)\)/"
|
|
29
|
+
* @memberof module:contract.Client
|
|
25
30
|
*/
|
|
26
31
|
export declare const contractErrorPattern: RegExp;
|
|
27
32
|
/**
|
|
28
33
|
* A TypeScript type guard that checks if an object has a `toString` method.
|
|
34
|
+
* @private
|
|
29
35
|
*/
|
|
30
36
|
export declare function implementsToString(
|
|
31
37
|
/** some object that may or may not have a `toString` method */
|
|
@@ -34,6 +40,7 @@ obj: unknown): obj is {
|
|
|
34
40
|
};
|
|
35
41
|
/**
|
|
36
42
|
* Reads a binary stream of ScSpecEntries into an array for processing by ContractSpec
|
|
43
|
+
* @private
|
|
37
44
|
*/
|
|
38
45
|
export declare function processSpecEntryStream(buffer: Buffer): xdr.ScSpecEntry[];
|
|
39
46
|
export declare function getAccount<T>(options: AssembledTransactionOptions<T>, server: Server): Promise<Account>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AccountRequiresMemoError is raised when a transaction is trying to submit an
|
|
3
|
+
* operation to an account which requires a memo. See
|
|
4
|
+
* [SEP0029](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md)
|
|
5
|
+
* for more information.
|
|
6
|
+
*
|
|
7
|
+
* This error contains two attributes to help you identify the account requiring
|
|
8
|
+
* the memo and the operation where the account is the destination
|
|
9
|
+
* @category Errors
|
|
10
|
+
*
|
|
11
|
+
* @param {string} message Human-readable error message
|
|
12
|
+
* @param {string} accountId The account which requires a memo
|
|
13
|
+
* @param {number} operationIndex The index of the operation where `accountId` is the destination
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* console.log('The following account requires a memo ', err.accountId)
|
|
17
|
+
* console.log('The account is used in operation: ', err.operationIndex)
|
|
18
|
+
*/
|
|
19
|
+
export declare class AccountRequiresMemoError extends Error {
|
|
20
|
+
__proto__: AccountRequiresMemoError;
|
|
21
|
+
accountId: string;
|
|
22
|
+
operationIndex: number;
|
|
23
|
+
constructor(message: string, accountId: string, operationIndex: number);
|
|
24
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AccountRequiresMemoError = void 0;
|
|
8
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
9
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
15
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
16
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
17
|
+
function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
|
|
18
|
+
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
|
|
19
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
+
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
|
|
21
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
22
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
|
+
var AccountRequiresMemoError = exports.AccountRequiresMemoError = function (_Error) {
|
|
24
|
+
function AccountRequiresMemoError(message, accountId, operationIndex) {
|
|
25
|
+
var _this;
|
|
26
|
+
_classCallCheck(this, AccountRequiresMemoError);
|
|
27
|
+
var trueProto = (this instanceof AccountRequiresMemoError ? this.constructor : void 0).prototype;
|
|
28
|
+
_this = _callSuper(this, AccountRequiresMemoError, [message]);
|
|
29
|
+
_this.__proto__ = trueProto;
|
|
30
|
+
_this.constructor = AccountRequiresMemoError;
|
|
31
|
+
_this.name = "AccountRequiresMemoError";
|
|
32
|
+
_this.accountId = accountId;
|
|
33
|
+
_this.operationIndex = operationIndex;
|
|
34
|
+
return _this;
|
|
35
|
+
}
|
|
36
|
+
_inherits(AccountRequiresMemoError, _Error);
|
|
37
|
+
return _createClass(AccountRequiresMemoError);
|
|
38
|
+
}(_wrapNativeSuper(Error));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NetworkError } from "./network";
|
|
2
|
+
/**
|
|
3
|
+
* BadRequestError is raised when a request made to Horizon is invalid in some
|
|
4
|
+
* way (incorrect timebounds for trade call builders, for example.)
|
|
5
|
+
* @augments NetworkError
|
|
6
|
+
* @inheritdoc
|
|
7
|
+
* @category Errors
|
|
8
|
+
*
|
|
9
|
+
* @param {string} message Human-readable error message
|
|
10
|
+
* @param {any} response Response details, received from the Horizon server
|
|
11
|
+
*/
|
|
12
|
+
export declare class BadRequestError extends NetworkError {
|
|
13
|
+
constructor(message: string, response: any);
|
|
14
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.BadRequestError = void 0;
|
|
8
|
+
var _network = require("./network");
|
|
9
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
16
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
19
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
+
var BadRequestError = exports.BadRequestError = function (_NetworkError) {
|
|
22
|
+
function BadRequestError(message, response) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, BadRequestError);
|
|
25
|
+
var trueProto = (this instanceof BadRequestError ? this.constructor : void 0).prototype;
|
|
26
|
+
_this = _callSuper(this, BadRequestError, [message, response]);
|
|
27
|
+
_this.__proto__ = trueProto;
|
|
28
|
+
_this.constructor = BadRequestError;
|
|
29
|
+
_this.name = "BadRequestError";
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
_inherits(BadRequestError, _NetworkError);
|
|
33
|
+
return _createClass(BadRequestError);
|
|
34
|
+
}(_network.NetworkError);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NetworkError } from "./network";
|
|
2
|
+
/**
|
|
3
|
+
* BadResponseError is raised when a response from a
|
|
4
|
+
* {@link module:Horizon | Horizon} or {@link module:Federation | Federation}
|
|
5
|
+
* server is invalid in some way. For example, a federation response may exceed
|
|
6
|
+
* the maximum allowed size, or a transaction submission may have failed with
|
|
7
|
+
* Horizon.
|
|
8
|
+
* @augments NetworkError
|
|
9
|
+
* @inheritdoc
|
|
10
|
+
* @category Errors
|
|
11
|
+
*
|
|
12
|
+
* @param {string} message Human-readable error message.
|
|
13
|
+
* @param {any} response Response details, received from the server.
|
|
14
|
+
*/
|
|
15
|
+
export declare class BadResponseError extends NetworkError {
|
|
16
|
+
constructor(message: string, response: any);
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.BadResponseError = void 0;
|
|
8
|
+
var _network = require("./network");
|
|
9
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
16
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
19
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
+
var BadResponseError = exports.BadResponseError = function (_NetworkError) {
|
|
22
|
+
function BadResponseError(message, response) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, BadResponseError);
|
|
25
|
+
var trueProto = (this instanceof BadResponseError ? this.constructor : void 0).prototype;
|
|
26
|
+
_this = _callSuper(this, BadResponseError, [message, response]);
|
|
27
|
+
_this.__proto__ = trueProto;
|
|
28
|
+
_this.constructor = BadResponseError;
|
|
29
|
+
_this.name = "BadResponseError";
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
_inherits(BadResponseError, _NetworkError);
|
|
33
|
+
return _createClass(BadResponseError);
|
|
34
|
+
}(_network.NetworkError);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _network = require("./network");
|
|
7
|
+
Object.keys(_network).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _network[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _network[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _not_found = require("./not_found");
|
|
18
|
+
Object.keys(_not_found).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _not_found[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _not_found[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _bad_request = require("./bad_request");
|
|
29
|
+
Object.keys(_bad_request).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _bad_request[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _bad_request[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _bad_response = require("./bad_response");
|
|
40
|
+
Object.keys(_bad_response).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _bad_response[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _bad_response[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _account_requires_memo = require("./account_requires_memo");
|
|
51
|
+
Object.keys(_account_requires_memo).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _account_requires_memo[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _account_requires_memo[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { HorizonApi } from "../horizon/horizon_api";
|
|
2
|
+
/**
|
|
3
|
+
* NetworkError is raised when an interaction with a Horizon server has caused
|
|
4
|
+
* some kind of problem.
|
|
5
|
+
* @category Errors
|
|
6
|
+
*
|
|
7
|
+
* @param {string} message Human-readable error message
|
|
8
|
+
* @param {any} response Response details, received from the Horizon server.
|
|
9
|
+
* @param {HorizonApi.ErrorResponseData} [response.data] The data returned by Horizon as part of the error: {@link https://developers.stellar.org/docs/data/horizon/api-reference/errors/response | Error Response}
|
|
10
|
+
* @param {number} [response.status] HTTP status code describing the basic issue with a submitted transaction {@link https://developers.stellar.org/docs/data/horizon/api-reference/errors/http-status-codes/standard | Standard Status Codes}
|
|
11
|
+
* @param {string} [response.statusText] A human-readable description of what the status code means: {@link https://developers.stellar.org/docs/data/horizon/api-reference/errors/http-status-codes/horizon-specific | Horizon-Specific Status Codes}
|
|
12
|
+
* @param {string} [response.url] URL which can provide more information about the problem that occurred.
|
|
13
|
+
*/
|
|
14
|
+
export declare class NetworkError extends Error {
|
|
15
|
+
response: {
|
|
16
|
+
data?: HorizonApi.ErrorResponseData;
|
|
17
|
+
status?: number;
|
|
18
|
+
statusText?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
};
|
|
21
|
+
__proto__: NetworkError;
|
|
22
|
+
constructor(message: string, response: any);
|
|
23
|
+
/**
|
|
24
|
+
* Returns the error response sent by the Horizon server.
|
|
25
|
+
* @returns {any}
|
|
26
|
+
*/
|
|
27
|
+
getResponse(): {
|
|
28
|
+
data?: HorizonApi.ErrorResponseData;
|
|
29
|
+
status?: number;
|
|
30
|
+
statusText?: string;
|
|
31
|
+
url?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.NetworkError = void 0;
|
|
8
8
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
9
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
10
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -38,62 +38,4 @@ var NetworkError = exports.NetworkError = function (_Error) {
|
|
|
38
38
|
return this.response;
|
|
39
39
|
}
|
|
40
40
|
}]);
|
|
41
|
-
}(_wrapNativeSuper(Error));
|
|
42
|
-
var NotFoundError = exports.NotFoundError = function (_NetworkError) {
|
|
43
|
-
function NotFoundError(message, response) {
|
|
44
|
-
var _this2;
|
|
45
|
-
_classCallCheck(this, NotFoundError);
|
|
46
|
-
var trueProto = (this instanceof NotFoundError ? this.constructor : void 0).prototype;
|
|
47
|
-
_this2 = _callSuper(this, NotFoundError, [message, response]);
|
|
48
|
-
_this2.__proto__ = trueProto;
|
|
49
|
-
_this2.constructor = NotFoundError;
|
|
50
|
-
_this2.name = "NotFoundError";
|
|
51
|
-
return _this2;
|
|
52
|
-
}
|
|
53
|
-
_inherits(NotFoundError, _NetworkError);
|
|
54
|
-
return _createClass(NotFoundError);
|
|
55
|
-
}(NetworkError);
|
|
56
|
-
var BadRequestError = exports.BadRequestError = function (_NetworkError2) {
|
|
57
|
-
function BadRequestError(message, response) {
|
|
58
|
-
var _this3;
|
|
59
|
-
_classCallCheck(this, BadRequestError);
|
|
60
|
-
var trueProto = (this instanceof BadRequestError ? this.constructor : void 0).prototype;
|
|
61
|
-
_this3 = _callSuper(this, BadRequestError, [message, response]);
|
|
62
|
-
_this3.__proto__ = trueProto;
|
|
63
|
-
_this3.constructor = BadRequestError;
|
|
64
|
-
_this3.name = "BadRequestError";
|
|
65
|
-
return _this3;
|
|
66
|
-
}
|
|
67
|
-
_inherits(BadRequestError, _NetworkError2);
|
|
68
|
-
return _createClass(BadRequestError);
|
|
69
|
-
}(NetworkError);
|
|
70
|
-
var BadResponseError = exports.BadResponseError = function (_NetworkError3) {
|
|
71
|
-
function BadResponseError(message, response) {
|
|
72
|
-
var _this4;
|
|
73
|
-
_classCallCheck(this, BadResponseError);
|
|
74
|
-
var trueProto = (this instanceof BadResponseError ? this.constructor : void 0).prototype;
|
|
75
|
-
_this4 = _callSuper(this, BadResponseError, [message, response]);
|
|
76
|
-
_this4.__proto__ = trueProto;
|
|
77
|
-
_this4.constructor = BadResponseError;
|
|
78
|
-
_this4.name = "BadResponseError";
|
|
79
|
-
return _this4;
|
|
80
|
-
}
|
|
81
|
-
_inherits(BadResponseError, _NetworkError3);
|
|
82
|
-
return _createClass(BadResponseError);
|
|
83
|
-
}(NetworkError);
|
|
84
|
-
var AccountRequiresMemoError = exports.AccountRequiresMemoError = function (_Error2) {
|
|
85
|
-
function AccountRequiresMemoError(message, accountId, operationIndex) {
|
|
86
|
-
var _this5;
|
|
87
|
-
_classCallCheck(this, AccountRequiresMemoError);
|
|
88
|
-
var trueProto = (this instanceof AccountRequiresMemoError ? this.constructor : void 0).prototype;
|
|
89
|
-
_this5 = _callSuper(this, AccountRequiresMemoError, [message]);
|
|
90
|
-
_this5.__proto__ = trueProto;
|
|
91
|
-
_this5.constructor = AccountRequiresMemoError;
|
|
92
|
-
_this5.name = "AccountRequiresMemoError";
|
|
93
|
-
_this5.accountId = accountId;
|
|
94
|
-
_this5.operationIndex = operationIndex;
|
|
95
|
-
return _this5;
|
|
96
|
-
}
|
|
97
|
-
_inherits(AccountRequiresMemoError, _Error2);
|
|
98
|
-
return _createClass(AccountRequiresMemoError);
|
|
99
41
|
}(_wrapNativeSuper(Error));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NetworkError } from "./network";
|
|
2
|
+
/**
|
|
3
|
+
* NotFoundError is raised when the resource requested from Horizon is
|
|
4
|
+
* unavailable.
|
|
5
|
+
* @augments NetworkError
|
|
6
|
+
* @inheritdoc
|
|
7
|
+
* @category Errors
|
|
8
|
+
*
|
|
9
|
+
* @param {string} message Human-readable error message
|
|
10
|
+
* @param {any} response Response details, received from the Horizon server
|
|
11
|
+
*/
|
|
12
|
+
export declare class NotFoundError extends NetworkError {
|
|
13
|
+
constructor(message: string, response: any);
|
|
14
|
+
}
|