@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
|
@@ -2,40 +2,43 @@ import { CallBuilder } from "./call_builder";
|
|
|
2
2
|
import { ServerApi } from "./server_api";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a new {@link TransactionCallBuilder} pointed to server defined by serverUrl.
|
|
5
|
-
* Do not create this object directly, use {@link Server#transactions}.
|
|
6
5
|
*
|
|
7
|
-
* @
|
|
6
|
+
* Do not create this object directly, use {@link Horizon.Server#transactions}.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/list-all-transactions|All Transactions}
|
|
9
|
+
*
|
|
8
10
|
* @augments CallBuilder
|
|
9
|
-
* @
|
|
11
|
+
* @private
|
|
10
12
|
* @class
|
|
13
|
+
*
|
|
11
14
|
* @param {string} serverUrl Horizon server URL.
|
|
12
15
|
*/
|
|
13
16
|
export declare class TransactionCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.TransactionRecord>> {
|
|
14
17
|
constructor(serverUrl: URI);
|
|
15
18
|
/**
|
|
16
19
|
* The transaction details endpoint provides information on a single transaction. The transaction hash provided in the hash argument specifies which transaction to load.
|
|
17
|
-
* @see
|
|
20
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-transaction|Transaction Details}
|
|
18
21
|
* @param {string} transactionId Transaction ID
|
|
19
22
|
* @returns {CallBuilder} a CallBuilder instance
|
|
20
23
|
*/
|
|
21
24
|
transaction(transactionId: string): CallBuilder<ServerApi.TransactionRecord>;
|
|
22
25
|
/**
|
|
23
26
|
* This endpoint represents all transactions that affected a given account.
|
|
24
|
-
* @see
|
|
27
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-transactions-by-account-id|Transactions for Account}
|
|
25
28
|
* @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
|
|
26
29
|
* @returns {TransactionCallBuilder} current TransactionCallBuilder instance
|
|
27
30
|
*/
|
|
28
31
|
forAccount(accountId: string): this;
|
|
29
32
|
/**
|
|
30
33
|
* This endpoint represents all transactions that reference a given claimable_balance.
|
|
31
|
-
* @see
|
|
34
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/cb-retrieve-related-transactions|Transactions for Claimable Balance}
|
|
32
35
|
* @param {string} claimableBalanceId Claimable Balance ID
|
|
33
36
|
* @returns {TransactionCallBuilder} this TransactionCallBuilder instance
|
|
34
37
|
*/
|
|
35
38
|
forClaimableBalance(claimableBalanceId: string): this;
|
|
36
39
|
/**
|
|
37
40
|
* This endpoint represents all transactions in a given ledger.
|
|
38
|
-
* @see
|
|
41
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-ledgers-transactions|Transactions for Ledger}
|
|
39
42
|
* @param {number|string} sequence Ledger sequence
|
|
40
43
|
* @returns {TransactionCallBuilder} current TransactionCallBuilder instance
|
|
41
44
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.create = exports.axiosClient = void 0;
|
|
7
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var axiosClient = exports.axiosClient = _axios.default;
|
|
10
|
+
var create = exports.create = _axios.default.create;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosRequestConfig, AxiosResponse } from 'feaxios';
|
|
2
|
+
import { CancelToken, HttpClient, HttpClientRequestConfig, HttpClientResponse } from './types';
|
|
3
|
+
export interface HttpResponse<T = any> extends AxiosResponse<T> {
|
|
4
|
+
}
|
|
5
|
+
export interface FetchClientConfig<T = any> extends AxiosRequestConfig {
|
|
6
|
+
adapter?: (config: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
7
|
+
cancelToken?: CancelToken;
|
|
8
|
+
}
|
|
9
|
+
declare function createFetchClient(fetchConfig?: HttpClientRequestConfig): HttpClient;
|
|
10
|
+
export declare const fetchClient: HttpClient;
|
|
11
|
+
export { createFetchClient as create };
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.create = createFetchClient;
|
|
7
|
+
exports.fetchClient = void 0;
|
|
8
|
+
var _feaxios = _interopRequireDefault(require("feaxios"));
|
|
9
|
+
var _types = require("./types");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
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); }
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
15
|
+
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); } }
|
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
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); }
|
|
20
|
+
var InterceptorManager = function () {
|
|
21
|
+
function InterceptorManager() {
|
|
22
|
+
_classCallCheck(this, InterceptorManager);
|
|
23
|
+
_defineProperty(this, "handlers", []);
|
|
24
|
+
}
|
|
25
|
+
return _createClass(InterceptorManager, [{
|
|
26
|
+
key: "use",
|
|
27
|
+
value: function use(fulfilled, rejected) {
|
|
28
|
+
this.handlers.push({
|
|
29
|
+
fulfilled: fulfilled,
|
|
30
|
+
rejected: rejected
|
|
31
|
+
});
|
|
32
|
+
return this.handlers.length - 1;
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "eject",
|
|
36
|
+
value: function eject(id) {
|
|
37
|
+
if (this.handlers[id]) {
|
|
38
|
+
this.handlers[id] = null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
key: "forEach",
|
|
43
|
+
value: function forEach(fn) {
|
|
44
|
+
this.handlers.forEach(function (h) {
|
|
45
|
+
if (h !== null) {
|
|
46
|
+
fn(h);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}]);
|
|
51
|
+
}();
|
|
52
|
+
function getFormConfig(config) {
|
|
53
|
+
var formConfig = config || {};
|
|
54
|
+
formConfig.headers = new Headers(formConfig.headers || {});
|
|
55
|
+
formConfig.headers.set('Content-Type', 'application/x-www-form-urlencoded');
|
|
56
|
+
return formConfig;
|
|
57
|
+
}
|
|
58
|
+
function createFetchClient() {
|
|
59
|
+
var fetchConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
60
|
+
var defaults = _objectSpread(_objectSpread({}, fetchConfig), {}, {
|
|
61
|
+
headers: fetchConfig.headers || {}
|
|
62
|
+
});
|
|
63
|
+
var instance = _feaxios.default.create(defaults);
|
|
64
|
+
var requestInterceptors = new InterceptorManager();
|
|
65
|
+
var responseInterceptors = new InterceptorManager();
|
|
66
|
+
var httpClient = {
|
|
67
|
+
interceptors: {
|
|
68
|
+
request: requestInterceptors,
|
|
69
|
+
response: responseInterceptors
|
|
70
|
+
},
|
|
71
|
+
defaults: _objectSpread(_objectSpread({}, defaults), {}, {
|
|
72
|
+
adapter: function adapter(config) {
|
|
73
|
+
return instance.request(config);
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
create: function create(config) {
|
|
77
|
+
return createFetchClient(_objectSpread(_objectSpread({}, this.defaults), config));
|
|
78
|
+
},
|
|
79
|
+
makeRequest: function makeRequest(config) {
|
|
80
|
+
var _this = this;
|
|
81
|
+
return new Promise(function (resolve, reject) {
|
|
82
|
+
var abortController = new AbortController();
|
|
83
|
+
config.signal = abortController.signal;
|
|
84
|
+
if (config.cancelToken) {
|
|
85
|
+
config.cancelToken.promise.then(function () {
|
|
86
|
+
abortController.abort();
|
|
87
|
+
reject(new Error('Request canceled'));
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
var modifiedConfig = config;
|
|
91
|
+
if (requestInterceptors.handlers.length > 0) {
|
|
92
|
+
var chain = requestInterceptors.handlers.filter(function (interceptor) {
|
|
93
|
+
return interceptor !== null;
|
|
94
|
+
}).flatMap(function (interceptor) {
|
|
95
|
+
return [interceptor.fulfilled, interceptor.rejected];
|
|
96
|
+
});
|
|
97
|
+
for (var i = 0, len = chain.length; i < len; i += 2) {
|
|
98
|
+
var onFulfilled = chain[i];
|
|
99
|
+
var onRejected = chain[i + 1];
|
|
100
|
+
try {
|
|
101
|
+
if (onFulfilled) modifiedConfig = onFulfilled(modifiedConfig);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (onRejected) onRejected === null || onRejected === void 0 || onRejected(error);
|
|
104
|
+
reject(error);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
var adapter = modifiedConfig.adapter || _this.defaults.adapter;
|
|
110
|
+
if (!adapter) {
|
|
111
|
+
throw new Error('No adapter available');
|
|
112
|
+
}
|
|
113
|
+
var responsePromise = adapter(modifiedConfig).then(function (axiosResponse) {
|
|
114
|
+
var httpClientResponse = {
|
|
115
|
+
data: axiosResponse.data,
|
|
116
|
+
headers: axiosResponse.headers,
|
|
117
|
+
config: axiosResponse.config,
|
|
118
|
+
status: axiosResponse.status,
|
|
119
|
+
statusText: axiosResponse.statusText
|
|
120
|
+
};
|
|
121
|
+
return httpClientResponse;
|
|
122
|
+
});
|
|
123
|
+
if (responseInterceptors.handlers.length > 0) {
|
|
124
|
+
var _chain = responseInterceptors.handlers.filter(function (interceptor) {
|
|
125
|
+
return interceptor !== null;
|
|
126
|
+
}).flatMap(function (interceptor) {
|
|
127
|
+
return [interceptor.fulfilled, interceptor.rejected];
|
|
128
|
+
});
|
|
129
|
+
var _loop = function _loop(_i) {
|
|
130
|
+
responsePromise = responsePromise.then(function (response) {
|
|
131
|
+
var fulfilledInterceptor = _chain[_i];
|
|
132
|
+
if (typeof fulfilledInterceptor === 'function') {
|
|
133
|
+
return fulfilledInterceptor(response);
|
|
134
|
+
}
|
|
135
|
+
return response;
|
|
136
|
+
}, function (error) {
|
|
137
|
+
var rejectedInterceptor = _chain[_i + 1];
|
|
138
|
+
if (typeof rejectedInterceptor === 'function') {
|
|
139
|
+
return rejectedInterceptor(error);
|
|
140
|
+
}
|
|
141
|
+
throw error;
|
|
142
|
+
}).then(function (interceptedResponse) {
|
|
143
|
+
return interceptedResponse;
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
for (var _i = 0, _len = _chain.length; _i < _len; _i += 2) {
|
|
147
|
+
_loop(_i);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
responsePromise.then(resolve).catch(reject);
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
get: function get(url, config) {
|
|
154
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
155
|
+
url: url,
|
|
156
|
+
method: 'get'
|
|
157
|
+
}));
|
|
158
|
+
},
|
|
159
|
+
delete: function _delete(url, config) {
|
|
160
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
161
|
+
url: url,
|
|
162
|
+
method: 'delete'
|
|
163
|
+
}));
|
|
164
|
+
},
|
|
165
|
+
head: function head(url, config) {
|
|
166
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
167
|
+
url: url,
|
|
168
|
+
method: 'head'
|
|
169
|
+
}));
|
|
170
|
+
},
|
|
171
|
+
options: function options(url, config) {
|
|
172
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
173
|
+
url: url,
|
|
174
|
+
method: 'options'
|
|
175
|
+
}));
|
|
176
|
+
},
|
|
177
|
+
post: function post(url, data, config) {
|
|
178
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
179
|
+
url: url,
|
|
180
|
+
method: 'post',
|
|
181
|
+
data: data
|
|
182
|
+
}));
|
|
183
|
+
},
|
|
184
|
+
put: function put(url, data, config) {
|
|
185
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
186
|
+
url: url,
|
|
187
|
+
method: 'put',
|
|
188
|
+
data: data
|
|
189
|
+
}));
|
|
190
|
+
},
|
|
191
|
+
patch: function patch(url, data, config) {
|
|
192
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
|
|
193
|
+
url: url,
|
|
194
|
+
method: 'patch',
|
|
195
|
+
data: data
|
|
196
|
+
}));
|
|
197
|
+
},
|
|
198
|
+
postForm: function postForm(url, data, config) {
|
|
199
|
+
var formConfig = getFormConfig(config);
|
|
200
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
|
|
201
|
+
url: url,
|
|
202
|
+
method: 'post',
|
|
203
|
+
data: data
|
|
204
|
+
}));
|
|
205
|
+
},
|
|
206
|
+
putForm: function putForm(url, data, config) {
|
|
207
|
+
var formConfig = getFormConfig(config);
|
|
208
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
|
|
209
|
+
url: url,
|
|
210
|
+
method: 'put',
|
|
211
|
+
data: data
|
|
212
|
+
}));
|
|
213
|
+
},
|
|
214
|
+
patchForm: function patchForm(url, data, config) {
|
|
215
|
+
var formConfig = getFormConfig(config);
|
|
216
|
+
return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
|
|
217
|
+
url: url,
|
|
218
|
+
method: 'patch',
|
|
219
|
+
data: data
|
|
220
|
+
}));
|
|
221
|
+
},
|
|
222
|
+
CancelToken: _types.CancelToken,
|
|
223
|
+
isCancel: function isCancel(value) {
|
|
224
|
+
return value instanceof Error && value.message === 'Request canceled';
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
return httpClient;
|
|
228
|
+
}
|
|
229
|
+
var fetchClient = exports.fetchClient = createFetchClient();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
httpClient: true,
|
|
8
|
+
create: true
|
|
9
|
+
};
|
|
10
|
+
exports.httpClient = exports.create = void 0;
|
|
11
|
+
var _types = require("./types");
|
|
12
|
+
Object.keys(_types).forEach(function (key) {
|
|
13
|
+
if (key === "default" || key === "__esModule") return;
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
15
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
16
|
+
Object.defineProperty(exports, key, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function get() {
|
|
19
|
+
return _types[key];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
var httpClient;
|
|
24
|
+
var create;
|
|
25
|
+
if (true) {
|
|
26
|
+
var axiosModule = require('./axios-client');
|
|
27
|
+
exports.httpClient = httpClient = axiosModule.axiosClient;
|
|
28
|
+
exports.create = create = axiosModule.create;
|
|
29
|
+
} else {
|
|
30
|
+
var fetchModule = require('./fetch-client');
|
|
31
|
+
exports.httpClient = httpClient = fetchModule.fetchClient;
|
|
32
|
+
exports.create = create = fetchModule.create;
|
|
33
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type HttpResponseHeaders = Record<string, string | boolean | undefined> & {
|
|
2
|
+
'set-cookie'?: string[];
|
|
3
|
+
};
|
|
4
|
+
export interface HttpClientDefaults extends Omit<HttpClientRequestConfig, 'headers'> {
|
|
5
|
+
headers?: [string, string][] | Record<string, string> | Headers | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface HttpClientResponse<T = any> {
|
|
8
|
+
data: T;
|
|
9
|
+
headers: HttpResponseHeaders;
|
|
10
|
+
config: any;
|
|
11
|
+
status: number;
|
|
12
|
+
statusText: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CancelToken {
|
|
15
|
+
promise: Promise<void>;
|
|
16
|
+
throwIfRequested(): void;
|
|
17
|
+
reason?: string;
|
|
18
|
+
}
|
|
19
|
+
type HeadersInit = [string, string][] | Record<string, string> | Headers;
|
|
20
|
+
export interface HttpClientRequestConfig<D = any> {
|
|
21
|
+
url?: string;
|
|
22
|
+
method?: string;
|
|
23
|
+
baseURL?: string;
|
|
24
|
+
data?: D;
|
|
25
|
+
timeout?: number;
|
|
26
|
+
fetchOptions?: Record<string, any>;
|
|
27
|
+
headers?: HeadersInit;
|
|
28
|
+
params?: Record<string, any>;
|
|
29
|
+
maxContentLength?: number;
|
|
30
|
+
cancelToken?: CancelToken;
|
|
31
|
+
adapter?: (config: HttpClientRequestConfig) => Promise<HttpClientResponse>;
|
|
32
|
+
}
|
|
33
|
+
export interface HttpClient {
|
|
34
|
+
get: <T = any>(url: string, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
35
|
+
delete: <T = any>(url: string, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
36
|
+
head: <T = any>(url: string, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
37
|
+
options: <T = any>(url: string, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
38
|
+
post: <T = any>(url: string, data?: any, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
39
|
+
put: <T = any>(url: string, data?: any, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
40
|
+
patch: <T = any>(url: string, data?: any, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
41
|
+
postForm: <T = any>(url: string, data?: any, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
42
|
+
putForm: <T = any>(url: string, data?: any, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
43
|
+
patchForm: <T = any>(url: string, data?: any, config?: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
44
|
+
interceptors: {
|
|
45
|
+
request: InterceptorManager<HttpClientRequestConfig>;
|
|
46
|
+
response: InterceptorManager<HttpClientResponse>;
|
|
47
|
+
};
|
|
48
|
+
defaults: HttpClientDefaults;
|
|
49
|
+
CancelToken: typeof CancelToken;
|
|
50
|
+
isCancel: (value: any) => boolean;
|
|
51
|
+
makeRequest: <T = any>(config: HttpClientRequestConfig) => Promise<HttpClientResponse<T>>;
|
|
52
|
+
create: (config?: HttpClientRequestConfig) => HttpClient;
|
|
53
|
+
}
|
|
54
|
+
export interface Interceptor<V> {
|
|
55
|
+
fulfilled: (value: V) => V | Promise<V>;
|
|
56
|
+
rejected?: (error: any) => any;
|
|
57
|
+
}
|
|
58
|
+
export interface InterceptorManager<V> {
|
|
59
|
+
use(fulfilled: (value: V) => V | Promise<V>, rejected?: (error: any) => any): number;
|
|
60
|
+
eject(id: number): void;
|
|
61
|
+
forEach(fn: (interceptor: Interceptor<V>) => void): void;
|
|
62
|
+
handlers: Array<Interceptor<V> | null>;
|
|
63
|
+
}
|
|
64
|
+
export declare class CancelToken {
|
|
65
|
+
promise: Promise<void>;
|
|
66
|
+
reason?: string;
|
|
67
|
+
constructor(executor: (cancel: (reason?: string) => void) => void);
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CancelToken = void 0;
|
|
7
|
+
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); }
|
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
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
|
+
var CancelToken = exports.CancelToken = function () {
|
|
14
|
+
function CancelToken(executor) {
|
|
15
|
+
var _this = this;
|
|
16
|
+
_classCallCheck(this, CancelToken);
|
|
17
|
+
var resolvePromise;
|
|
18
|
+
this.promise = new Promise(function (resolve) {
|
|
19
|
+
resolvePromise = resolve;
|
|
20
|
+
});
|
|
21
|
+
executor(function (reason) {
|
|
22
|
+
_this.reason = reason;
|
|
23
|
+
resolvePromise();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return _createClass(CancelToken, [{
|
|
27
|
+
key: "throwIfRequested",
|
|
28
|
+
value: function throwIfRequested() {
|
|
29
|
+
if (this.reason) {
|
|
30
|
+
throw new Error(this.reason);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}]);
|
|
34
|
+
}();
|
package/lib/index.d.ts
CHANGED
|
@@ -12,9 +12,8 @@ export * as Horizon from './horizon';
|
|
|
12
12
|
* `/rpc` entrypoint, if your version of Node and your TypeScript configuration
|
|
13
13
|
* allow it:
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* @example
|
|
16
16
|
* import { Server } from '@stellar/stellar-sdk/rpc';
|
|
17
|
-
* ```
|
|
18
17
|
*/
|
|
19
18
|
export * as rpc from './rpc';
|
|
20
19
|
/**
|
|
@@ -27,9 +26,9 @@ export * as SorobanRpc from './rpc';
|
|
|
27
26
|
* entrypoint, if your version of Node and your TypeScript configuration allow
|
|
28
27
|
* it:
|
|
29
28
|
*
|
|
30
|
-
*
|
|
29
|
+
* @example
|
|
31
30
|
* import { Client } from '@stellar/stellar-sdk/contract';
|
|
32
|
-
*
|
|
31
|
+
* @private
|
|
33
32
|
*/
|
|
34
33
|
export * as contract from './contract';
|
|
35
34
|
export * from '@stellar/stellar-base';
|
package/lib/index.js
CHANGED
|
@@ -74,4 +74,10 @@ Object.keys(_stellarBase).forEach(function (key) {
|
|
|
74
74
|
});
|
|
75
75
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
76
76
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
77
|
-
var _default = exports.default = module.exports;
|
|
77
|
+
var _default = exports.default = module.exports;
|
|
78
|
+
if (typeof global.__USE_AXIOS__ === 'undefined') {
|
|
79
|
+
global.__USE_AXIOS__ = true;
|
|
80
|
+
}
|
|
81
|
+
if (typeof global.__USE_EVENTSOURCE__ === 'undefined') {
|
|
82
|
+
global.__USE_EVENTSOURCE__ = false;
|
|
83
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
var _exportNames = {
|
|
8
|
+
httpClient: true,
|
|
9
|
+
StellarBase: true
|
|
10
|
+
};
|
|
11
|
+
exports.default = exports.StellarBase = void 0;
|
|
12
|
+
Object.defineProperty(exports, "httpClient", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _httpClient.httpClient;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _httpClient = require("./http-client");
|
|
19
|
+
var _index = require("./index");
|
|
20
|
+
Object.keys(_index).forEach(function (key) {
|
|
21
|
+
if (key === "default" || key === "__esModule") return;
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
23
|
+
if (key in exports && exports[key] === _index[key]) return;
|
|
24
|
+
Object.defineProperty(exports, key, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _index[key];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
var _StellarBase = _interopRequireWildcard(require("@stellar/stellar-base"));
|
|
32
|
+
exports.StellarBase = _StellarBase;
|
|
33
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
34
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
35
|
+
var _default = exports.default = module.exports;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global config parameters.
|
|
3
|
+
*/
|
|
4
|
+
export interface Configuration {
|
|
5
|
+
/**
|
|
6
|
+
* Allow connecting to http servers. This must be set to false in production deployments!
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
allowHttp: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Allow a timeout. Allows user to avoid nasty lag due network issues.
|
|
12
|
+
* @default 0
|
|
13
|
+
*/
|
|
14
|
+
timeout: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Global config class.
|
|
18
|
+
*
|
|
19
|
+
* @hideconstructor
|
|
20
|
+
*
|
|
21
|
+
* @example <caption>Usage in node</caption>
|
|
22
|
+
* import { Config } from '@stellar/stellar-sdk';
|
|
23
|
+
* Config.setAllowHttp(true);
|
|
24
|
+
* Config.setTimeout(5000);
|
|
25
|
+
*
|
|
26
|
+
* @example <caption>Usage in the browser</caption>
|
|
27
|
+
* StellarSdk.Config.setAllowHttp(true);
|
|
28
|
+
* StellarSdk.Config.setTimeout(5000);
|
|
29
|
+
*/
|
|
30
|
+
declare class Config {
|
|
31
|
+
/**
|
|
32
|
+
* Sets `allowHttp` flag globally. When set to `true`, connections to insecure
|
|
33
|
+
* http protocol servers will be allowed. Must be set to `false` in
|
|
34
|
+
* production.
|
|
35
|
+
* @default false
|
|
36
|
+
* @static
|
|
37
|
+
*/
|
|
38
|
+
static setAllowHttp(value: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets `timeout` flag globally. When set to anything besides 0, the request
|
|
41
|
+
* will timeout after specified time (ms).
|
|
42
|
+
* @default 0
|
|
43
|
+
* @static
|
|
44
|
+
*/
|
|
45
|
+
static setTimeout(value: number): void;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the configured `allowHttp` flag.
|
|
48
|
+
* @static
|
|
49
|
+
* @returns {boolean}
|
|
50
|
+
*/
|
|
51
|
+
static isAllowHttp(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the configured `timeout` flag.
|
|
54
|
+
* @static
|
|
55
|
+
* @returns {number}
|
|
56
|
+
*/
|
|
57
|
+
static getTimeout(): number;
|
|
58
|
+
/**
|
|
59
|
+
* Sets all global config flags to default values.
|
|
60
|
+
* @static
|
|
61
|
+
*/
|
|
62
|
+
static setDefault(): void;
|
|
63
|
+
}
|
|
64
|
+
export { Config };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Config = void 0;
|
|
7
|
+
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); }
|
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
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); }
|
|
16
|
+
var defaultConfig = {
|
|
17
|
+
allowHttp: false,
|
|
18
|
+
timeout: 0
|
|
19
|
+
};
|
|
20
|
+
var config = _objectSpread({}, defaultConfig);
|
|
21
|
+
var Config = exports.Config = function () {
|
|
22
|
+
function Config() {
|
|
23
|
+
_classCallCheck(this, Config);
|
|
24
|
+
}
|
|
25
|
+
return _createClass(Config, null, [{
|
|
26
|
+
key: "setAllowHttp",
|
|
27
|
+
value: function setAllowHttp(value) {
|
|
28
|
+
config.allowHttp = value;
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
key: "setTimeout",
|
|
32
|
+
value: function setTimeout(value) {
|
|
33
|
+
config.timeout = value;
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "isAllowHttp",
|
|
37
|
+
value: function isAllowHttp() {
|
|
38
|
+
return config.allowHttp;
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "getTimeout",
|
|
42
|
+
value: function getTimeout() {
|
|
43
|
+
return config.timeout;
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
key: "setDefault",
|
|
47
|
+
value: function setDefault() {
|
|
48
|
+
config = _objectSpread({}, defaultConfig);
|
|
49
|
+
}
|
|
50
|
+
}]);
|
|
51
|
+
}();
|