@stellar/stellar-sdk 12.2.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 +57 -0
- package/README.md +30 -8
- 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 +28423 -27354
- 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 +23 -17
- package/lib/contract/assembled_transaction.js +177 -154
- 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 +17 -10
- 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 +73 -8
- 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 +32 -10
- package/lib/rpc/parsers.js +40 -11
- package/lib/rpc/server.d.ts +197 -100
- package/lib/rpc/server.js +251 -110
- 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 +73 -21
- package/lib/errors.d.ts +0 -59
package/lib/rpc/server.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SUBMIT_TRANSACTION_TIMEOUT = exports.RpcServer = exports.Durability = void 0;
|
|
7
7
|
var _urijs = _interopRequireDefault(require("urijs"));
|
|
8
8
|
var _stellarBase = require("@stellar/stellar-base");
|
|
9
9
|
var _axios = _interopRequireDefault(require("./axios"));
|
|
@@ -57,10 +57,10 @@ function findCreatedAccountSequenceInTransactionMeta(meta) {
|
|
|
57
57
|
}
|
|
58
58
|
throw new Error('No account created in transaction');
|
|
59
59
|
}
|
|
60
|
-
var
|
|
61
|
-
function
|
|
60
|
+
var RpcServer = exports.RpcServer = function () {
|
|
61
|
+
function RpcServer(serverURL) {
|
|
62
62
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
63
|
-
_classCallCheck(this,
|
|
63
|
+
_classCallCheck(this, RpcServer);
|
|
64
64
|
this.serverURL = (0, _urijs.default)(serverURL);
|
|
65
65
|
if (opts.headers && Object.keys(opts.headers).length !== 0) {
|
|
66
66
|
_axios.default.interceptors.request.use(function (config) {
|
|
@@ -72,7 +72,7 @@ var Server = exports.Server = function () {
|
|
|
72
72
|
throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set");
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
return _createClass(
|
|
75
|
+
return _createClass(RpcServer, [{
|
|
76
76
|
key: "getAccount",
|
|
77
77
|
value: (function () {
|
|
78
78
|
var _getAccount = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(address) {
|
|
@@ -345,19 +345,7 @@ var Server = exports.Server = function () {
|
|
|
345
345
|
return _context8.abrupt("return", this._getTransaction(hash).then(function (raw) {
|
|
346
346
|
var foundInfo = {};
|
|
347
347
|
if (raw.status !== _api.Api.GetTransactionStatus.NOT_FOUND) {
|
|
348
|
-
|
|
349
|
-
var meta = _stellarBase.xdr.TransactionMeta.fromXDR(raw.resultMetaXdr, 'base64');
|
|
350
|
-
foundInfo = _objectSpread({
|
|
351
|
-
ledger: raw.ledger,
|
|
352
|
-
createdAt: raw.createdAt,
|
|
353
|
-
applicationOrder: raw.applicationOrder,
|
|
354
|
-
feeBump: raw.feeBump,
|
|
355
|
-
envelopeXdr: _stellarBase.xdr.TransactionEnvelope.fromXDR(raw.envelopeXdr, 'base64'),
|
|
356
|
-
resultXdr: _stellarBase.xdr.TransactionResult.fromXDR(raw.resultXdr, 'base64'),
|
|
357
|
-
resultMetaXdr: meta
|
|
358
|
-
}, meta.switch() === 3 && meta.v3().sorobanMeta() !== null && raw.status === _api.Api.GetTransactionStatus.SUCCESS && {
|
|
359
|
-
returnValue: (_meta$v3$sorobanMeta = meta.v3().sorobanMeta()) === null || _meta$v3$sorobanMeta === void 0 ? void 0 : _meta$v3$sorobanMeta.returnValue()
|
|
360
|
-
});
|
|
348
|
+
Object.assign(foundInfo, (0, _parsers.parseTransactionInfo)(raw));
|
|
361
349
|
}
|
|
362
350
|
var result = _objectSpread({
|
|
363
351
|
status: raw.status,
|
|
@@ -401,20 +389,68 @@ var Server = exports.Server = function () {
|
|
|
401
389
|
return _getTransaction;
|
|
402
390
|
}()
|
|
403
391
|
}, {
|
|
404
|
-
key: "
|
|
392
|
+
key: "getTransactions",
|
|
405
393
|
value: (function () {
|
|
406
|
-
var
|
|
394
|
+
var _getTransactions2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee10(request) {
|
|
407
395
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
408
396
|
while (1) switch (_context10.prev = _context10.next) {
|
|
409
397
|
case 0:
|
|
410
|
-
return _context10.abrupt("return", this.
|
|
398
|
+
return _context10.abrupt("return", this._getTransactions(request).then(function (raw) {
|
|
399
|
+
var result = {
|
|
400
|
+
transactions: raw.transactions.map(_parsers.parseRawTransactions),
|
|
401
|
+
latestLedger: raw.latestLedger,
|
|
402
|
+
latestLedgerCloseTimestamp: raw.latestLedgerCloseTimestamp,
|
|
403
|
+
oldestLedger: raw.oldestLedger,
|
|
404
|
+
oldestLedgerCloseTimestamp: raw.oldestLedgerCloseTimestamp,
|
|
405
|
+
cursor: raw.cursor
|
|
406
|
+
};
|
|
407
|
+
return result;
|
|
408
|
+
}));
|
|
411
409
|
case 1:
|
|
412
410
|
case "end":
|
|
413
411
|
return _context10.stop();
|
|
414
412
|
}
|
|
415
413
|
}, _callee10, this);
|
|
416
414
|
}));
|
|
417
|
-
function
|
|
415
|
+
function getTransactions(_x8) {
|
|
416
|
+
return _getTransactions2.apply(this, arguments);
|
|
417
|
+
}
|
|
418
|
+
return getTransactions;
|
|
419
|
+
}())
|
|
420
|
+
}, {
|
|
421
|
+
key: "_getTransactions",
|
|
422
|
+
value: function () {
|
|
423
|
+
var _getTransactions3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee11(request) {
|
|
424
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
425
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
426
|
+
case 0:
|
|
427
|
+
return _context11.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getTransactions', request));
|
|
428
|
+
case 1:
|
|
429
|
+
case "end":
|
|
430
|
+
return _context11.stop();
|
|
431
|
+
}
|
|
432
|
+
}, _callee11, this);
|
|
433
|
+
}));
|
|
434
|
+
function _getTransactions(_x9) {
|
|
435
|
+
return _getTransactions3.apply(this, arguments);
|
|
436
|
+
}
|
|
437
|
+
return _getTransactions;
|
|
438
|
+
}()
|
|
439
|
+
}, {
|
|
440
|
+
key: "getEvents",
|
|
441
|
+
value: (function () {
|
|
442
|
+
var _getEvents2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee12(request) {
|
|
443
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
444
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
445
|
+
case 0:
|
|
446
|
+
return _context12.abrupt("return", this._getEvents(request).then(_parsers.parseRawEvents));
|
|
447
|
+
case 1:
|
|
448
|
+
case "end":
|
|
449
|
+
return _context12.stop();
|
|
450
|
+
}
|
|
451
|
+
}, _callee12, this);
|
|
452
|
+
}));
|
|
453
|
+
function getEvents(_x10) {
|
|
418
454
|
return _getEvents2.apply(this, arguments);
|
|
419
455
|
}
|
|
420
456
|
return getEvents;
|
|
@@ -422,12 +458,12 @@ var Server = exports.Server = function () {
|
|
|
422
458
|
}, {
|
|
423
459
|
key: "_getEvents",
|
|
424
460
|
value: function () {
|
|
425
|
-
var _getEvents3 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
461
|
+
var _getEvents3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee13(request) {
|
|
426
462
|
var _request$filters;
|
|
427
|
-
return _regeneratorRuntime().wrap(function
|
|
428
|
-
while (1) switch (
|
|
463
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
464
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
429
465
|
case 0:
|
|
430
|
-
return
|
|
466
|
+
return _context13.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
|
|
431
467
|
filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
|
|
432
468
|
pagination: _objectSpread(_objectSpread({}, request.cursor && {
|
|
433
469
|
cursor: request.cursor
|
|
@@ -436,14 +472,16 @@ var Server = exports.Server = function () {
|
|
|
436
472
|
})
|
|
437
473
|
}, request.startLedger && {
|
|
438
474
|
startLedger: request.startLedger
|
|
475
|
+
}), request.endLedger && {
|
|
476
|
+
endLedger: request.endLedger
|
|
439
477
|
})));
|
|
440
478
|
case 1:
|
|
441
479
|
case "end":
|
|
442
|
-
return
|
|
480
|
+
return _context13.stop();
|
|
443
481
|
}
|
|
444
|
-
},
|
|
482
|
+
}, _callee13, this);
|
|
445
483
|
}));
|
|
446
|
-
function _getEvents(
|
|
484
|
+
function _getEvents(_x11) {
|
|
447
485
|
return _getEvents3.apply(this, arguments);
|
|
448
486
|
}
|
|
449
487
|
return _getEvents;
|
|
@@ -451,16 +489,16 @@ var Server = exports.Server = function () {
|
|
|
451
489
|
}, {
|
|
452
490
|
key: "getNetwork",
|
|
453
491
|
value: (function () {
|
|
454
|
-
var _getNetwork = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
455
|
-
return _regeneratorRuntime().wrap(function
|
|
456
|
-
while (1) switch (
|
|
492
|
+
var _getNetwork = _asyncToGenerator(_regeneratorRuntime().mark(function _callee14() {
|
|
493
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
494
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
457
495
|
case 0:
|
|
458
|
-
return
|
|
496
|
+
return _context14.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getNetwork'));
|
|
459
497
|
case 1:
|
|
460
498
|
case "end":
|
|
461
|
-
return
|
|
499
|
+
return _context14.stop();
|
|
462
500
|
}
|
|
463
|
-
},
|
|
501
|
+
}, _callee14, this);
|
|
464
502
|
}));
|
|
465
503
|
function getNetwork() {
|
|
466
504
|
return _getNetwork.apply(this, arguments);
|
|
@@ -470,16 +508,16 @@ var Server = exports.Server = function () {
|
|
|
470
508
|
}, {
|
|
471
509
|
key: "getLatestLedger",
|
|
472
510
|
value: (function () {
|
|
473
|
-
var _getLatestLedger = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
474
|
-
return _regeneratorRuntime().wrap(function
|
|
475
|
-
while (1) switch (
|
|
511
|
+
var _getLatestLedger = _asyncToGenerator(_regeneratorRuntime().mark(function _callee15() {
|
|
512
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
513
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
476
514
|
case 0:
|
|
477
|
-
return
|
|
515
|
+
return _context15.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getLatestLedger'));
|
|
478
516
|
case 1:
|
|
479
517
|
case "end":
|
|
480
|
-
return
|
|
518
|
+
return _context15.stop();
|
|
481
519
|
}
|
|
482
|
-
},
|
|
520
|
+
}, _callee15, this);
|
|
483
521
|
}));
|
|
484
522
|
function getLatestLedger() {
|
|
485
523
|
return _getLatestLedger.apply(this, arguments);
|
|
@@ -489,18 +527,18 @@ var Server = exports.Server = function () {
|
|
|
489
527
|
}, {
|
|
490
528
|
key: "simulateTransaction",
|
|
491
529
|
value: (function () {
|
|
492
|
-
var _simulateTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
493
|
-
return _regeneratorRuntime().wrap(function
|
|
494
|
-
while (1) switch (
|
|
530
|
+
var _simulateTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee16(tx, addlResources) {
|
|
531
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
532
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
495
533
|
case 0:
|
|
496
|
-
return
|
|
534
|
+
return _context16.abrupt("return", this._simulateTransaction(tx, addlResources).then(_parsers.parseRawSimulation));
|
|
497
535
|
case 1:
|
|
498
536
|
case "end":
|
|
499
|
-
return
|
|
537
|
+
return _context16.stop();
|
|
500
538
|
}
|
|
501
|
-
},
|
|
539
|
+
}, _callee16, this);
|
|
502
540
|
}));
|
|
503
|
-
function simulateTransaction(
|
|
541
|
+
function simulateTransaction(_x12, _x13) {
|
|
504
542
|
return _simulateTransaction2.apply(this, arguments);
|
|
505
543
|
}
|
|
506
544
|
return simulateTransaction;
|
|
@@ -508,11 +546,11 @@ var Server = exports.Server = function () {
|
|
|
508
546
|
}, {
|
|
509
547
|
key: "_simulateTransaction",
|
|
510
548
|
value: function () {
|
|
511
|
-
var _simulateTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
512
|
-
return _regeneratorRuntime().wrap(function
|
|
513
|
-
while (1) switch (
|
|
549
|
+
var _simulateTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee17(transaction, addlResources) {
|
|
550
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
551
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
514
552
|
case 0:
|
|
515
|
-
return
|
|
553
|
+
return _context17.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
|
|
516
554
|
transaction: transaction.toXDR()
|
|
517
555
|
}, addlResources !== undefined && {
|
|
518
556
|
resourceConfig: {
|
|
@@ -521,11 +559,11 @@ var Server = exports.Server = function () {
|
|
|
521
559
|
})));
|
|
522
560
|
case 1:
|
|
523
561
|
case "end":
|
|
524
|
-
return
|
|
562
|
+
return _context17.stop();
|
|
525
563
|
}
|
|
526
|
-
},
|
|
564
|
+
}, _callee17, this);
|
|
527
565
|
}));
|
|
528
|
-
function _simulateTransaction(
|
|
566
|
+
function _simulateTransaction(_x14, _x15) {
|
|
529
567
|
return _simulateTransaction3.apply(this, arguments);
|
|
530
568
|
}
|
|
531
569
|
return _simulateTransaction;
|
|
@@ -533,29 +571,29 @@ var Server = exports.Server = function () {
|
|
|
533
571
|
}, {
|
|
534
572
|
key: "prepareTransaction",
|
|
535
573
|
value: (function () {
|
|
536
|
-
var _prepareTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
574
|
+
var _prepareTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee18(tx) {
|
|
537
575
|
var simResponse;
|
|
538
|
-
return _regeneratorRuntime().wrap(function
|
|
539
|
-
while (1) switch (
|
|
576
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
577
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
540
578
|
case 0:
|
|
541
|
-
|
|
579
|
+
_context18.next = 2;
|
|
542
580
|
return this.simulateTransaction(tx);
|
|
543
581
|
case 2:
|
|
544
|
-
simResponse =
|
|
582
|
+
simResponse = _context18.sent;
|
|
545
583
|
if (!_api.Api.isSimulationError(simResponse)) {
|
|
546
|
-
|
|
584
|
+
_context18.next = 5;
|
|
547
585
|
break;
|
|
548
586
|
}
|
|
549
587
|
throw new Error(simResponse.error);
|
|
550
588
|
case 5:
|
|
551
|
-
return
|
|
589
|
+
return _context18.abrupt("return", (0, _transaction.assembleTransaction)(tx, simResponse).build());
|
|
552
590
|
case 6:
|
|
553
591
|
case "end":
|
|
554
|
-
return
|
|
592
|
+
return _context18.stop();
|
|
555
593
|
}
|
|
556
|
-
},
|
|
594
|
+
}, _callee18, this);
|
|
557
595
|
}));
|
|
558
|
-
function prepareTransaction(
|
|
596
|
+
function prepareTransaction(_x16) {
|
|
559
597
|
return _prepareTransaction.apply(this, arguments);
|
|
560
598
|
}
|
|
561
599
|
return prepareTransaction;
|
|
@@ -563,18 +601,18 @@ var Server = exports.Server = function () {
|
|
|
563
601
|
}, {
|
|
564
602
|
key: "sendTransaction",
|
|
565
603
|
value: (function () {
|
|
566
|
-
var _sendTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
567
|
-
return _regeneratorRuntime().wrap(function
|
|
568
|
-
while (1) switch (
|
|
604
|
+
var _sendTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee19(transaction) {
|
|
605
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
606
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
569
607
|
case 0:
|
|
570
|
-
return
|
|
608
|
+
return _context19.abrupt("return", this._sendTransaction(transaction).then(_parsers.parseRawSendTransaction));
|
|
571
609
|
case 1:
|
|
572
610
|
case "end":
|
|
573
|
-
return
|
|
611
|
+
return _context19.stop();
|
|
574
612
|
}
|
|
575
|
-
},
|
|
613
|
+
}, _callee19, this);
|
|
576
614
|
}));
|
|
577
|
-
function sendTransaction(
|
|
615
|
+
function sendTransaction(_x17) {
|
|
578
616
|
return _sendTransaction2.apply(this, arguments);
|
|
579
617
|
}
|
|
580
618
|
return sendTransaction;
|
|
@@ -582,20 +620,20 @@ var Server = exports.Server = function () {
|
|
|
582
620
|
}, {
|
|
583
621
|
key: "_sendTransaction",
|
|
584
622
|
value: function () {
|
|
585
|
-
var _sendTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
586
|
-
return _regeneratorRuntime().wrap(function
|
|
587
|
-
while (1) switch (
|
|
623
|
+
var _sendTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee20(transaction) {
|
|
624
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
625
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
588
626
|
case 0:
|
|
589
|
-
return
|
|
627
|
+
return _context20.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'sendTransaction', {
|
|
590
628
|
transaction: transaction.toXDR()
|
|
591
629
|
}));
|
|
592
630
|
case 1:
|
|
593
631
|
case "end":
|
|
594
|
-
return
|
|
632
|
+
return _context20.stop();
|
|
595
633
|
}
|
|
596
|
-
},
|
|
634
|
+
}, _callee20, this);
|
|
597
635
|
}));
|
|
598
|
-
function _sendTransaction(
|
|
636
|
+
function _sendTransaction(_x18) {
|
|
599
637
|
return _sendTransaction3.apply(this, arguments);
|
|
600
638
|
}
|
|
601
639
|
return _sendTransaction;
|
|
@@ -603,58 +641,58 @@ var Server = exports.Server = function () {
|
|
|
603
641
|
}, {
|
|
604
642
|
key: "requestAirdrop",
|
|
605
643
|
value: (function () {
|
|
606
|
-
var _requestAirdrop = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
644
|
+
var _requestAirdrop = _asyncToGenerator(_regeneratorRuntime().mark(function _callee21(address, friendbotUrl) {
|
|
607
645
|
var account, response, meta, sequence, _error$response, _error$response$detai;
|
|
608
|
-
return _regeneratorRuntime().wrap(function
|
|
609
|
-
while (1) switch (
|
|
646
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
647
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
610
648
|
case 0:
|
|
611
649
|
account = typeof address === 'string' ? address : address.accountId();
|
|
612
|
-
|
|
613
|
-
if (
|
|
614
|
-
|
|
650
|
+
_context21.t0 = friendbotUrl;
|
|
651
|
+
if (_context21.t0) {
|
|
652
|
+
_context21.next = 6;
|
|
615
653
|
break;
|
|
616
654
|
}
|
|
617
|
-
|
|
655
|
+
_context21.next = 5;
|
|
618
656
|
return this.getNetwork();
|
|
619
657
|
case 5:
|
|
620
|
-
|
|
658
|
+
_context21.t0 = _context21.sent.friendbotUrl;
|
|
621
659
|
case 6:
|
|
622
|
-
friendbotUrl =
|
|
660
|
+
friendbotUrl = _context21.t0;
|
|
623
661
|
if (friendbotUrl) {
|
|
624
|
-
|
|
662
|
+
_context21.next = 9;
|
|
625
663
|
break;
|
|
626
664
|
}
|
|
627
665
|
throw new Error('No friendbot URL configured for current network');
|
|
628
666
|
case 9:
|
|
629
|
-
|
|
630
|
-
|
|
667
|
+
_context21.prev = 9;
|
|
668
|
+
_context21.next = 12;
|
|
631
669
|
return _axios.default.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
|
|
632
670
|
case 12:
|
|
633
|
-
response =
|
|
671
|
+
response = _context21.sent;
|
|
634
672
|
meta = _stellarBase.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
|
|
635
673
|
sequence = findCreatedAccountSequenceInTransactionMeta(meta);
|
|
636
|
-
return
|
|
674
|
+
return _context21.abrupt("return", new _stellarBase.Account(account, sequence));
|
|
637
675
|
case 18:
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
if (!(((_error$response =
|
|
641
|
-
|
|
676
|
+
_context21.prev = 18;
|
|
677
|
+
_context21.t1 = _context21["catch"](9);
|
|
678
|
+
if (!(((_error$response = _context21.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
|
|
679
|
+
_context21.next = 23;
|
|
642
680
|
break;
|
|
643
681
|
}
|
|
644
|
-
if (!((_error$response$detai =
|
|
645
|
-
|
|
682
|
+
if (!((_error$response$detai = _context21.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
|
|
683
|
+
_context21.next = 23;
|
|
646
684
|
break;
|
|
647
685
|
}
|
|
648
|
-
return
|
|
686
|
+
return _context21.abrupt("return", this.getAccount(account));
|
|
649
687
|
case 23:
|
|
650
|
-
throw
|
|
688
|
+
throw _context21.t1;
|
|
651
689
|
case 24:
|
|
652
690
|
case "end":
|
|
653
|
-
return
|
|
691
|
+
return _context21.stop();
|
|
654
692
|
}
|
|
655
|
-
},
|
|
693
|
+
}, _callee21, this, [[9, 18]]);
|
|
656
694
|
}));
|
|
657
|
-
function requestAirdrop(
|
|
695
|
+
function requestAirdrop(_x19, _x20) {
|
|
658
696
|
return _requestAirdrop.apply(this, arguments);
|
|
659
697
|
}
|
|
660
698
|
return requestAirdrop;
|
|
@@ -662,21 +700,124 @@ var Server = exports.Server = function () {
|
|
|
662
700
|
}, {
|
|
663
701
|
key: "getFeeStats",
|
|
664
702
|
value: (function () {
|
|
665
|
-
var _getFeeStats = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
666
|
-
return _regeneratorRuntime().wrap(function
|
|
667
|
-
while (1) switch (
|
|
703
|
+
var _getFeeStats = _asyncToGenerator(_regeneratorRuntime().mark(function _callee22() {
|
|
704
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
705
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
668
706
|
case 0:
|
|
669
|
-
return
|
|
707
|
+
return _context22.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getFeeStats'));
|
|
670
708
|
case 1:
|
|
671
709
|
case "end":
|
|
672
|
-
return
|
|
710
|
+
return _context22.stop();
|
|
673
711
|
}
|
|
674
|
-
},
|
|
712
|
+
}, _callee22, this);
|
|
675
713
|
}));
|
|
676
714
|
function getFeeStats() {
|
|
677
715
|
return _getFeeStats.apply(this, arguments);
|
|
678
716
|
}
|
|
679
717
|
return getFeeStats;
|
|
680
718
|
}())
|
|
719
|
+
}, {
|
|
720
|
+
key: "getVersionInfo",
|
|
721
|
+
value: (function () {
|
|
722
|
+
var _getVersionInfo = _asyncToGenerator(_regeneratorRuntime().mark(function _callee23() {
|
|
723
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
724
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
725
|
+
case 0:
|
|
726
|
+
return _context23.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getVersionInfo'));
|
|
727
|
+
case 1:
|
|
728
|
+
case "end":
|
|
729
|
+
return _context23.stop();
|
|
730
|
+
}
|
|
731
|
+
}, _callee23, this);
|
|
732
|
+
}));
|
|
733
|
+
function getVersionInfo() {
|
|
734
|
+
return _getVersionInfo.apply(this, arguments);
|
|
735
|
+
}
|
|
736
|
+
return getVersionInfo;
|
|
737
|
+
}())
|
|
738
|
+
}, {
|
|
739
|
+
key: "getSACBalance",
|
|
740
|
+
value: (function () {
|
|
741
|
+
var _getSACBalance = _asyncToGenerator(_regeneratorRuntime().mark(function _callee24(contractId, sac, networkPassphrase) {
|
|
742
|
+
var passphrase, sacId, key, ledgerKey, response, _response$entries$2, lastModifiedLedgerSeq, liveUntilLedgerSeq, val, entry;
|
|
743
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
744
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
745
|
+
case 0:
|
|
746
|
+
if (_stellarBase.StrKey.isValidContract(contractId)) {
|
|
747
|
+
_context24.next = 2;
|
|
748
|
+
break;
|
|
749
|
+
}
|
|
750
|
+
throw new TypeError("expected contract ID, got ".concat(contractId));
|
|
751
|
+
case 2:
|
|
752
|
+
if (!(networkPassphrase !== null && networkPassphrase !== void 0)) {
|
|
753
|
+
_context24.next = 6;
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
_context24.t0 = networkPassphrase;
|
|
757
|
+
_context24.next = 9;
|
|
758
|
+
break;
|
|
759
|
+
case 6:
|
|
760
|
+
_context24.next = 8;
|
|
761
|
+
return this.getNetwork().then(function (n) {
|
|
762
|
+
return n.passphrase;
|
|
763
|
+
});
|
|
764
|
+
case 8:
|
|
765
|
+
_context24.t0 = _context24.sent;
|
|
766
|
+
case 9:
|
|
767
|
+
passphrase = _context24.t0;
|
|
768
|
+
sacId = sac.contractId(passphrase);
|
|
769
|
+
key = _stellarBase.xdr.ScVal.scvVec([(0, _stellarBase.nativeToScVal)("Balance", {
|
|
770
|
+
type: "symbol"
|
|
771
|
+
}), (0, _stellarBase.nativeToScVal)(contractId, {
|
|
772
|
+
type: "address"
|
|
773
|
+
})]);
|
|
774
|
+
ledgerKey = _stellarBase.xdr.LedgerKey.contractData(new _stellarBase.xdr.LedgerKeyContractData({
|
|
775
|
+
contract: new _stellarBase.Address(sacId).toScAddress(),
|
|
776
|
+
durability: _stellarBase.xdr.ContractDataDurability.persistent(),
|
|
777
|
+
key: key
|
|
778
|
+
}));
|
|
779
|
+
_context24.next = 15;
|
|
780
|
+
return this.getLedgerEntries(ledgerKey);
|
|
781
|
+
case 15:
|
|
782
|
+
response = _context24.sent;
|
|
783
|
+
if (!(response.entries.length === 0)) {
|
|
784
|
+
_context24.next = 18;
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
return _context24.abrupt("return", {
|
|
788
|
+
latestLedger: response.latestLedger
|
|
789
|
+
});
|
|
790
|
+
case 18:
|
|
791
|
+
_response$entries$2 = response.entries[0], lastModifiedLedgerSeq = _response$entries$2.lastModifiedLedgerSeq, liveUntilLedgerSeq = _response$entries$2.liveUntilLedgerSeq, val = _response$entries$2.val;
|
|
792
|
+
if (!(val.switch().value !== _stellarBase.xdr.LedgerEntryType.contractData().value)) {
|
|
793
|
+
_context24.next = 21;
|
|
794
|
+
break;
|
|
795
|
+
}
|
|
796
|
+
return _context24.abrupt("return", {
|
|
797
|
+
latestLedger: response.latestLedger
|
|
798
|
+
});
|
|
799
|
+
case 21:
|
|
800
|
+
entry = (0, _stellarBase.scValToNative)(val.contractData().val());
|
|
801
|
+
return _context24.abrupt("return", {
|
|
802
|
+
latestLedger: response.latestLedger,
|
|
803
|
+
balanceEntry: {
|
|
804
|
+
liveUntilLedgerSeq: liveUntilLedgerSeq,
|
|
805
|
+
lastModifiedLedgerSeq: lastModifiedLedgerSeq,
|
|
806
|
+
amount: entry.amount.toString(),
|
|
807
|
+
authorized: entry.authorized,
|
|
808
|
+
clawback: entry.clawback
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
case 23:
|
|
812
|
+
case "end":
|
|
813
|
+
return _context24.stop();
|
|
814
|
+
}
|
|
815
|
+
}, _callee24, this);
|
|
816
|
+
}));
|
|
817
|
+
function getSACBalance(_x21, _x22, _x23) {
|
|
818
|
+
return _getSACBalance.apply(this, arguments);
|
|
819
|
+
}
|
|
820
|
+
return getSACBalance;
|
|
821
|
+
}())
|
|
681
822
|
}]);
|
|
682
823
|
}();
|
package/lib/rpc/transaction.d.ts
CHANGED
|
@@ -3,17 +3,19 @@ import { Api } from './api';
|
|
|
3
3
|
/**
|
|
4
4
|
* Combines the given raw transaction alongside the simulation results.
|
|
5
5
|
* If the given transaction already has authorization entries in a host
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* function invocation (see {@link Operation.invokeHostFunction}), **the
|
|
7
|
+
* simulation entries are ignored**.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* @
|
|
11
|
-
*
|
|
9
|
+
* If the given transaction already has authorization entries in a host function
|
|
10
|
+
* invocation (see {@link Operation.invokeHostFunction}), **the simulation
|
|
11
|
+
* entries are ignored**.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
14
|
-
*
|
|
13
|
+
* @param {Transaction|FeeBumpTransaction} raw the initial transaction, w/o simulation applied
|
|
14
|
+
* @param {Api.SimulateTransactionResponse|Api.RawSimulateTransactionResponse} simulation the Soroban RPC simulation result (see {@link module:rpc.Server#simulateTransaction})
|
|
15
|
+
* @returns {TransactionBuilder} a new, cloned transaction with the proper auth and resource (fee, footprint) simulation data applied
|
|
15
16
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @see {Server
|
|
17
|
+
* @memberof module:rpc
|
|
18
|
+
* @see {@link module:rpc.Server#simulateTransaction}
|
|
19
|
+
* @see {@link module:rpc.Server#prepareTransaction}
|
|
18
20
|
*/
|
|
19
21
|
export declare function assembleTransaction(raw: Transaction | FeeBumpTransaction, simulation: Api.SimulateTransactionResponse | Api.RawSimulateTransactionResponse): TransactionBuilder;
|
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
import { Networks } from "@stellar/stellar-base";
|
|
2
|
-
/**
|
|
2
|
+
/** @module StellarToml */
|
|
3
|
+
/**
|
|
4
|
+
* The maximum size of stellar.toml file, in bytes
|
|
5
|
+
* @constant {number}
|
|
6
|
+
* @default 102400
|
|
7
|
+
*/
|
|
3
8
|
export declare const STELLAR_TOML_MAX_SIZE: number;
|
|
4
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Resolver allows resolving `stellar.toml` files.
|
|
11
|
+
* @memberof module:StellarToml
|
|
12
|
+
* @hideconstructor
|
|
13
|
+
*/
|
|
5
14
|
export declare class Resolver {
|
|
6
15
|
/**
|
|
7
16
|
* Returns a parsed `stellar.toml` file for a given domain.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
17
|
+
* @see {@link https://developers.stellar.org/docs/tokens/publishing-asset-info | Stellar.toml doc}
|
|
18
|
+
*
|
|
19
|
+
* @param {string} domain Domain to get stellar.toml file for
|
|
20
|
+
* @param {object} [opts] Options object
|
|
21
|
+
* @param {boolean} [opts.allowHttp=false] - Allow connecting to http servers. This must be set to false in production deployments!
|
|
22
|
+
* @param {number} [opts.timeout=0] - Allow a timeout. Allows user to avoid nasty lag due to TOML resolve issue.
|
|
23
|
+
* @returns {Promise} A `Promise` that resolves to the parsed stellar.toml object
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* StellarSdk.StellarToml.Resolver.resolve('acme.com')
|
|
10
27
|
* .then(stellarToml => {
|
|
11
28
|
* // stellarToml in an object representing domain stellar.toml file.
|
|
12
29
|
* })
|
|
13
30
|
* .catch(error => {
|
|
14
31
|
* // stellar.toml does not exist or is invalid
|
|
15
32
|
* });
|
|
16
|
-
* ```
|
|
17
|
-
* @see <a href="https://developers.stellar.org/docs/issuing-assets/publishing-asset-info/" target="_blank">Stellar.toml doc</a>
|
|
18
|
-
* @param {string} domain Domain to get stellar.toml file for
|
|
19
|
-
* @param {object} [opts] Options object
|
|
20
|
-
* @param {boolean} [opts.allowHttp] - Allow connecting to http servers, default: `false`. This must be set to false in production deployments!
|
|
21
|
-
* @param {number} [opts.timeout] - Allow a timeout, default: 0. Allows user to avoid nasty lag due to TOML resolve issue.
|
|
22
|
-
* @returns {Promise} A `Promise` that resolves to the parsed stellar.toml object
|
|
23
33
|
*/
|
|
24
34
|
static resolve(domain: string, opts?: Api.StellarTomlResolveOptions): Promise<Api.StellarToml>;
|
|
25
35
|
}
|