@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/api.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Contract, SorobanDataBuilder, xdr } from '@stellar/stellar-base';
|
|
2
|
-
/** @namespace Api */
|
|
3
2
|
export declare namespace Api {
|
|
4
3
|
export interface Cost {
|
|
5
4
|
cpuInsns: string;
|
|
@@ -31,18 +30,18 @@ export declare namespace Api {
|
|
|
31
30
|
entries: LedgerEntryResult[];
|
|
32
31
|
latestLedger: number;
|
|
33
32
|
}
|
|
34
|
-
/** @see https://
|
|
33
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries */
|
|
35
34
|
export interface RawGetLedgerEntriesResponse {
|
|
36
35
|
entries?: RawLedgerEntryResult[];
|
|
37
36
|
latestLedger: number;
|
|
38
37
|
}
|
|
39
|
-
/** @see https://
|
|
38
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getNetwork */
|
|
40
39
|
export interface GetNetworkResponse {
|
|
41
40
|
friendbotUrl?: string;
|
|
42
41
|
passphrase: string;
|
|
43
42
|
protocolVersion: string;
|
|
44
43
|
}
|
|
45
|
-
/** @see https://
|
|
44
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLatestLedger */
|
|
46
45
|
export interface GetLatestLedgerResponse {
|
|
47
46
|
id: string;
|
|
48
47
|
sequence: number;
|
|
@@ -53,7 +52,7 @@ export declare namespace Api {
|
|
|
53
52
|
NOT_FOUND = "NOT_FOUND",
|
|
54
53
|
FAILED = "FAILED"
|
|
55
54
|
}
|
|
56
|
-
/** @see https://
|
|
55
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction */
|
|
57
56
|
export type GetTransactionResponse = GetSuccessfulTransactionResponse | GetFailedTransactionResponse | GetMissingTransactionResponse;
|
|
58
57
|
interface GetAnyTransactionResponse {
|
|
59
58
|
status: GetTransactionStatus;
|
|
@@ -74,6 +73,7 @@ export declare namespace Api {
|
|
|
74
73
|
envelopeXdr: xdr.TransactionEnvelope;
|
|
75
74
|
resultXdr: xdr.TransactionResult;
|
|
76
75
|
resultMetaXdr: xdr.TransactionMeta;
|
|
76
|
+
diagnosticEventsXdr?: xdr.DiagnosticEvent[];
|
|
77
77
|
}
|
|
78
78
|
export interface GetSuccessfulTransactionResponse extends GetAnyTransactionResponse {
|
|
79
79
|
status: GetTransactionStatus.SUCCESS;
|
|
@@ -84,6 +84,7 @@ export declare namespace Api {
|
|
|
84
84
|
envelopeXdr: xdr.TransactionEnvelope;
|
|
85
85
|
resultXdr: xdr.TransactionResult;
|
|
86
86
|
resultMetaXdr: xdr.TransactionMeta;
|
|
87
|
+
diagnosticEventsXdr?: xdr.DiagnosticEvent[];
|
|
87
88
|
returnValue?: xdr.ScVal;
|
|
88
89
|
}
|
|
89
90
|
export interface RawGetTransactionResponse {
|
|
@@ -99,6 +100,51 @@ export declare namespace Api {
|
|
|
99
100
|
resultMetaXdr?: string;
|
|
100
101
|
ledger?: number;
|
|
101
102
|
createdAt?: number;
|
|
103
|
+
diagnosticEventsXdr?: string[];
|
|
104
|
+
}
|
|
105
|
+
export interface GetTransactionsRequest {
|
|
106
|
+
startLedger: number;
|
|
107
|
+
cursor?: string;
|
|
108
|
+
limit?: number;
|
|
109
|
+
}
|
|
110
|
+
export interface RawTransactionInfo {
|
|
111
|
+
status: GetTransactionStatus;
|
|
112
|
+
ledger: number;
|
|
113
|
+
createdAt: number;
|
|
114
|
+
applicationOrder: number;
|
|
115
|
+
feeBump: boolean;
|
|
116
|
+
envelopeXdr?: string;
|
|
117
|
+
resultXdr?: string;
|
|
118
|
+
resultMetaXdr?: string;
|
|
119
|
+
diagnosticEventsXdr?: string[];
|
|
120
|
+
}
|
|
121
|
+
export interface TransactionInfo {
|
|
122
|
+
status: GetTransactionStatus;
|
|
123
|
+
ledger: number;
|
|
124
|
+
createdAt: number;
|
|
125
|
+
applicationOrder: number;
|
|
126
|
+
feeBump: boolean;
|
|
127
|
+
envelopeXdr: xdr.TransactionEnvelope;
|
|
128
|
+
resultXdr: xdr.TransactionResult;
|
|
129
|
+
resultMetaXdr: xdr.TransactionMeta;
|
|
130
|
+
returnValue?: xdr.ScVal;
|
|
131
|
+
diagnosticEventsXdr?: xdr.DiagnosticEvent[];
|
|
132
|
+
}
|
|
133
|
+
export interface GetTransactionsResponse {
|
|
134
|
+
transactions: TransactionInfo[];
|
|
135
|
+
latestLedger: number;
|
|
136
|
+
latestLedgerCloseTimestamp: number;
|
|
137
|
+
oldestLedger: number;
|
|
138
|
+
oldestLedgerCloseTimestamp: number;
|
|
139
|
+
cursor: string;
|
|
140
|
+
}
|
|
141
|
+
export interface RawGetTransactionsResponse {
|
|
142
|
+
transactions: RawTransactionInfo[];
|
|
143
|
+
latestLedger: number;
|
|
144
|
+
latestLedgerCloseTimestamp: number;
|
|
145
|
+
oldestLedger: number;
|
|
146
|
+
oldestLedgerCloseTimestamp: number;
|
|
147
|
+
cursor: string;
|
|
102
148
|
}
|
|
103
149
|
export type EventType = 'contract' | 'system' | 'diagnostic';
|
|
104
150
|
export interface EventFilter {
|
|
@@ -188,7 +234,7 @@ export declare namespace Api {
|
|
|
188
234
|
* fields
|
|
189
235
|
* - for all other errors, this only includes error fields
|
|
190
236
|
*
|
|
191
|
-
* @see https://
|
|
237
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction
|
|
192
238
|
*/
|
|
193
239
|
export type SimulateTransactionResponse = SimulateTransactionSuccessResponse | SimulateTransactionRestoreResponse | SimulateTransactionErrorResponse;
|
|
194
240
|
export interface BaseSimulateTransactionResponse {
|
|
@@ -243,7 +289,7 @@ export declare namespace Api {
|
|
|
243
289
|
auth?: string[];
|
|
244
290
|
xdr: string;
|
|
245
291
|
}
|
|
246
|
-
/** @see https://
|
|
292
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction */
|
|
247
293
|
export interface RawSimulateTransactionResponse {
|
|
248
294
|
id: string;
|
|
249
295
|
latestLedger: number;
|
|
@@ -264,9 +310,16 @@ export declare namespace Api {
|
|
|
264
310
|
minResourceFee: string;
|
|
265
311
|
transactionData: string;
|
|
266
312
|
};
|
|
267
|
-
/** State
|
|
313
|
+
/** State difference information */
|
|
268
314
|
stateChanges?: RawLedgerEntryChange[];
|
|
269
315
|
}
|
|
316
|
+
export interface GetVersionInfoResponse {
|
|
317
|
+
version: string;
|
|
318
|
+
commit_hash: string;
|
|
319
|
+
build_time_stamp: string;
|
|
320
|
+
captive_core_version: string;
|
|
321
|
+
protocol_version: number;
|
|
322
|
+
}
|
|
270
323
|
export interface GetFeeStatsResponse {
|
|
271
324
|
sorobanInclusionFee: FeeDistribution;
|
|
272
325
|
inclusionFee: FeeDistribution;
|
|
@@ -290,5 +343,17 @@ export declare namespace Api {
|
|
|
290
343
|
transactionCount: string;
|
|
291
344
|
ledgerCount: number;
|
|
292
345
|
}
|
|
346
|
+
export interface BalanceResponse {
|
|
347
|
+
latestLedger: number;
|
|
348
|
+
/** present only on success, otherwise request malformed or no balance */
|
|
349
|
+
balanceEntry?: {
|
|
350
|
+
/** a 64-bit integer */
|
|
351
|
+
amount: string;
|
|
352
|
+
authorized: boolean;
|
|
353
|
+
clawback: boolean;
|
|
354
|
+
lastModifiedLedgerSeq?: number;
|
|
355
|
+
liveUntilLedgerSeq?: number;
|
|
356
|
+
};
|
|
357
|
+
}
|
|
293
358
|
export {};
|
|
294
359
|
}
|
package/lib/rpc/axios.d.ts
CHANGED
package/lib/rpc/axios.js
CHANGED
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.default = exports.AxiosClient = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var AxiosClient = exports.AxiosClient = _axios.default.create({
|
|
7
|
+
var _httpClient = require("../http-client");
|
|
8
|
+
var version = exports.version = "13.0.0-beta.1";
|
|
9
|
+
var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
|
|
11
10
|
headers: {
|
|
12
11
|
'X-Client-Name': 'js-soroban-client',
|
|
13
12
|
'X-Client-Version': version
|
package/lib/rpc/browser.d.ts
CHANGED
package/lib/rpc/browser.js
CHANGED
|
@@ -5,18 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
var _exportNames = {
|
|
8
|
-
axios: true,
|
|
9
8
|
StellarBase: true
|
|
10
9
|
};
|
|
11
|
-
exports.StellarBase = void 0;
|
|
12
|
-
Object.defineProperty(exports, "axios", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _axios.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
exports.default = void 0;
|
|
19
|
-
var _axios = _interopRequireDefault(require("axios"));
|
|
10
|
+
exports.default = exports.StellarBase = void 0;
|
|
20
11
|
var _index = require("./index");
|
|
21
12
|
Object.keys(_index).forEach(function (key) {
|
|
22
13
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -33,5 +24,4 @@ var _StellarBase = _interopRequireWildcard(require("@stellar/stellar-base"));
|
|
|
33
24
|
exports.StellarBase = _StellarBase;
|
|
34
25
|
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); }
|
|
35
26
|
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; }
|
|
36
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
37
27
|
var _default = exports.default = module.exports;
|
package/lib/rpc/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @module rpc */
|
|
1
2
|
export * from "./api";
|
|
2
|
-
export { Server, Durability } from "./server";
|
|
3
|
+
export { RpcServer as Server, Durability } from "./server";
|
|
3
4
|
export { default as AxiosClient } from "./axios";
|
|
4
5
|
export { parseRawSimulation, parseRawEvents } from "./parsers";
|
|
5
6
|
export * from "./transaction";
|
package/lib/rpc/index.js
CHANGED
package/lib/rpc/jsonrpc.d.ts
CHANGED
|
@@ -23,5 +23,13 @@ export interface Error<E = any> {
|
|
|
23
23
|
message?: string;
|
|
24
24
|
data?: E;
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Sends the jsonrpc 'params' as a single 'param' object (no array support).
|
|
28
|
+
*
|
|
29
|
+
* @param {string} url URL to the RPC instance
|
|
30
|
+
* @param {string} method RPC method name that should be called
|
|
31
|
+
* @param {(any | null)} [param=null] params that should be supplied to the method
|
|
32
|
+
* @returns {Promise<T>}
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
27
35
|
export declare function postObject<T>(url: string, method: string, param?: any): Promise<T>;
|
package/lib/rpc/parsers.d.ts
CHANGED
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
import { Api } from './api';
|
|
2
|
-
export declare function parseRawSendTransaction(r: Api.RawSendTransactionResponse): Api.SendTransactionResponse;
|
|
3
|
-
export declare function parseRawEvents(r: Api.RawGetEventsResponse): Api.GetEventsResponse;
|
|
4
|
-
export declare function parseRawLedgerEntries(raw: Api.RawGetLedgerEntriesResponse): Api.GetLedgerEntriesResponse;
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* relied on or considered "stable".
|
|
3
|
+
* Parse the response from invoking the `submitTransaction` method of a Soroban RPC server.
|
|
4
|
+
* @memberof module:rpc
|
|
5
|
+
* @private
|
|
10
6
|
*
|
|
11
|
-
* @param {Api.
|
|
12
|
-
*
|
|
7
|
+
* @param {Api.RawSendTransactionResponse} raw the raw `submitTransaction` response from the Soroban RPC server to parse
|
|
8
|
+
* @returns {Api.SendTransactionResponse} transaction response parsed from the Soroban RPC server's response
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseRawSendTransaction(raw: Api.RawSendTransactionResponse): Api.SendTransactionResponse;
|
|
11
|
+
export declare function parseTransactionInfo(raw: Api.RawTransactionInfo | Api.RawGetTransactionResponse): Omit<Api.TransactionInfo, 'status'>;
|
|
12
|
+
export declare function parseRawTransactions(r: Api.RawTransactionInfo): Api.TransactionInfo;
|
|
13
|
+
/**
|
|
14
|
+
* Parse and return the retrieved events, if any, from a raw response from a Soroban RPC server.
|
|
15
|
+
* @memberof module:rpc
|
|
13
16
|
*
|
|
14
|
-
* @
|
|
17
|
+
* @param {Api.RawGetEventsResponse} raw the raw `getEvents` response from the Soroban RPC server to parse
|
|
18
|
+
* @returns {Api.GetEventsResponse} events parsed from the Soroban RPC server's response
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseRawEvents(raw: Api.RawGetEventsResponse): Api.GetEventsResponse;
|
|
21
|
+
/**
|
|
22
|
+
* Parse and return the retrieved ledger entries, if any, from a raw response from a Soroban RPC server.
|
|
23
|
+
* @memberof module:rpc
|
|
24
|
+
* @private
|
|
15
25
|
*
|
|
26
|
+
* @param {Api.RawGetLedgerEntriesResponse} raw he raw `getLedgerEntries` response from the Soroban RPC server to parse
|
|
27
|
+
* @returns {Api.GetLedgerEntriesResponse} ledger entries parsed from the Soroban RPC server's response
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseRawLedgerEntries(raw: Api.RawGetLedgerEntriesResponse): Api.GetLedgerEntriesResponse;
|
|
30
|
+
/**
|
|
31
|
+
* Converts a raw response schema into one with parsed XDR fields and a simplified interface.
|
|
32
|
+
* @warning This API is only exported for testing purposes and should not be relied on or considered "stable".
|
|
33
|
+
* @memberof module:rpc
|
|
34
|
+
*
|
|
35
|
+
* @param {Api.SimulateTransactionResponse | Api.RawSimulateTransactionResponse} sim the raw response schema (parsed ones are allowed, best-effort
|
|
36
|
+
* detected, and returned untouched)
|
|
37
|
+
* @returns {Api.SimulateTransactionResponse} the original parameter (if already parsed), parsed otherwise
|
|
16
38
|
*/
|
|
17
39
|
export declare function parseRawSimulation(sim: Api.SimulateTransactionResponse | Api.RawSimulateTransactionResponse): Api.SimulateTransactionResponse;
|
package/lib/rpc/parsers.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.parseRawEvents = parseRawEvents;
|
|
|
7
7
|
exports.parseRawLedgerEntries = parseRawLedgerEntries;
|
|
8
8
|
exports.parseRawSendTransaction = parseRawSendTransaction;
|
|
9
9
|
exports.parseRawSimulation = parseRawSimulation;
|
|
10
|
+
exports.parseRawTransactions = parseRawTransactions;
|
|
11
|
+
exports.parseTransactionInfo = parseTransactionInfo;
|
|
10
12
|
var _stellarBase = require("@stellar/stellar-base");
|
|
11
13
|
var _api = require("./api");
|
|
12
14
|
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); }
|
|
@@ -15,13 +17,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
15
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; }
|
|
16
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
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); }
|
|
18
|
-
function parseRawSendTransaction(
|
|
19
|
-
var errorResultXdr =
|
|
20
|
-
diagnosticEventsXdr =
|
|
21
|
-
delete
|
|
22
|
-
delete
|
|
20
|
+
function parseRawSendTransaction(raw) {
|
|
21
|
+
var errorResultXdr = raw.errorResultXdr,
|
|
22
|
+
diagnosticEventsXdr = raw.diagnosticEventsXdr;
|
|
23
|
+
delete raw.errorResultXdr;
|
|
24
|
+
delete raw.diagnosticEventsXdr;
|
|
23
25
|
if (errorResultXdr) {
|
|
24
|
-
return _objectSpread(_objectSpread(_objectSpread({},
|
|
26
|
+
return _objectSpread(_objectSpread(_objectSpread({}, raw), diagnosticEventsXdr !== undefined && diagnosticEventsXdr.length > 0 && {
|
|
25
27
|
diagnosticEvents: diagnosticEventsXdr.map(function (evt) {
|
|
26
28
|
return _stellarBase.xdr.DiagnosticEvent.fromXDR(evt, 'base64');
|
|
27
29
|
})
|
|
@@ -29,13 +31,40 @@ function parseRawSendTransaction(r) {
|
|
|
29
31
|
errorResult: _stellarBase.xdr.TransactionResult.fromXDR(errorResultXdr, 'base64')
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
|
-
return _objectSpread({},
|
|
34
|
+
return _objectSpread({}, raw);
|
|
33
35
|
}
|
|
34
|
-
function
|
|
35
|
-
var
|
|
36
|
+
function parseTransactionInfo(raw) {
|
|
37
|
+
var meta = _stellarBase.xdr.TransactionMeta.fromXDR(raw.resultMetaXdr, 'base64');
|
|
38
|
+
var info = {
|
|
39
|
+
ledger: raw.ledger,
|
|
40
|
+
createdAt: raw.createdAt,
|
|
41
|
+
applicationOrder: raw.applicationOrder,
|
|
42
|
+
feeBump: raw.feeBump,
|
|
43
|
+
envelopeXdr: _stellarBase.xdr.TransactionEnvelope.fromXDR(raw.envelopeXdr, 'base64'),
|
|
44
|
+
resultXdr: _stellarBase.xdr.TransactionResult.fromXDR(raw.resultXdr, 'base64'),
|
|
45
|
+
resultMetaXdr: meta
|
|
46
|
+
};
|
|
47
|
+
if (meta.switch() === 3 && meta.v3().sorobanMeta() !== null) {
|
|
48
|
+
var _meta$v3$sorobanMeta;
|
|
49
|
+
info.returnValue = (_meta$v3$sorobanMeta = meta.v3().sorobanMeta()) === null || _meta$v3$sorobanMeta === void 0 ? void 0 : _meta$v3$sorobanMeta.returnValue();
|
|
50
|
+
}
|
|
51
|
+
if ('diagnosticEventsXdr' in raw && raw.diagnosticEventsXdr) {
|
|
52
|
+
info.diagnosticEventsXdr = raw.diagnosticEventsXdr.map(function (diagnosticEvent) {
|
|
53
|
+
return _stellarBase.xdr.DiagnosticEvent.fromXDR(diagnosticEvent, 'base64');
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return info;
|
|
57
|
+
}
|
|
58
|
+
function parseRawTransactions(r) {
|
|
59
|
+
return _objectSpread({
|
|
60
|
+
status: r.status
|
|
61
|
+
}, parseTransactionInfo(r));
|
|
62
|
+
}
|
|
63
|
+
function parseRawEvents(raw) {
|
|
64
|
+
var _raw$events;
|
|
36
65
|
return {
|
|
37
|
-
latestLedger:
|
|
38
|
-
events: ((
|
|
66
|
+
latestLedger: raw.latestLedger,
|
|
67
|
+
events: ((_raw$events = raw.events) !== null && _raw$events !== void 0 ? _raw$events : []).map(function (evt) {
|
|
39
68
|
var clone = _objectSpread({}, evt);
|
|
40
69
|
delete clone.contractId;
|
|
41
70
|
return _objectSpread(_objectSpread(_objectSpread({}, clone), evt.contractId !== '' && {
|