@stellar/stellar-sdk 12.3.0 → 13.0.0-rc.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 +68 -0
- package/README.md +29 -7
- package/dist/stellar-sdk-minimal.js +46009 -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 +56648 -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 +49822 -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 +28279 -27350
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/browser.d.ts +2 -2
- package/lib/browser.js +5 -7
- package/lib/config.d.ts +31 -19
- package/lib/contract/assembled_transaction.d.ts +22 -14
- package/lib/contract/assembled_transaction.js +159 -128
- 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 +9 -4
- package/lib/contract/sent_transaction.js +6 -6
- package/lib/contract/spec.d.ts +8 -14
- package/lib/contract/types.d.ts +81 -13
- package/lib/contract/utils.d.ts +8 -1
- package/lib/errors/account_requires_memo.d.ts +24 -0
- package/lib/errors/account_requires_memo.js +38 -0
- package/lib/errors/bad_request.d.ts +14 -0
- package/lib/errors/bad_request.js +34 -0
- package/lib/errors/bad_response.d.ts +17 -0
- package/lib/errors/bad_response.js +34 -0
- package/lib/errors/index.d.ts +5 -0
- package/lib/errors/index.js +60 -0
- package/lib/errors/network.d.ts +33 -0
- package/lib/{errors.js → errors/network.js} +1 -59
- package/lib/errors/not_found.d.ts +14 -0
- package/lib/errors/not_found.js +34 -0
- package/lib/federation/api.d.ts +21 -0
- package/lib/federation/index.d.ts +1 -1
- package/lib/federation/index.js +16 -6
- package/lib/federation/server.d.ts +36 -38
- package/lib/federation/server.js +2 -2
- package/lib/horizon/account_call_builder.d.ts +10 -8
- package/lib/horizon/account_response.d.ts +5 -2
- package/lib/horizon/assets_call_builder.d.ts +3 -2
- package/lib/horizon/call_builder.js +9 -3
- package/lib/horizon/claimable_balances_call_builder.d.ts +10 -8
- package/lib/horizon/effect_call_builder.d.ts +8 -7
- package/lib/horizon/horizon_axios_client.d.ts +13 -6
- package/lib/horizon/horizon_axios_client.js +16 -4
- package/lib/horizon/index.d.ts +2 -1
- package/lib/horizon/index.js +1 -1
- package/lib/horizon/ledger_call_builder.d.ts +6 -4
- package/lib/horizon/liquidity_pool_call_builder.d.ts +3 -2
- package/lib/horizon/offer_call_builder.d.ts +12 -10
- package/lib/horizon/operation_call_builder.d.ts +11 -9
- package/lib/horizon/orderbook_call_builder.d.ts +7 -2
- package/lib/horizon/path_call_builder.d.ts +7 -2
- package/lib/horizon/payment_call_builder.d.ts +10 -6
- package/lib/horizon/server.d.ts +64 -55
- package/lib/horizon/server.js +6 -5
- package/lib/horizon/server_api.d.ts +0 -15
- 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/horizon/types/assets.d.ts +0 -2
- 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 -8
- package/lib/index.js +8 -5
- 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 +84 -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 +263 -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 +17 -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 +32 -0
- package/lib/minimal/index.js +80 -0
- package/lib/minimal/rpc/api.d.ts +362 -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 +86 -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 +622 -0
- package/lib/minimal/rpc/server.js +877 -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 +20 -0
- package/lib/minimal/utils.js +38 -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 +84 -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 +263 -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 +17 -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 +32 -0
- package/lib/no-axios/index.js +80 -0
- package/lib/no-axios/rpc/api.d.ts +362 -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 +86 -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 +622 -0
- package/lib/no-axios/rpc/server.js +877 -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 +20 -0
- package/lib/no-axios/utils.js +38 -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 +84 -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 +263 -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 +17 -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 +32 -0
- package/lib/no-eventsource/index.js +80 -0
- package/lib/no-eventsource/rpc/api.d.ts +362 -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 +86 -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 +622 -0
- package/lib/no-eventsource/rpc/server.js +877 -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 +20 -0
- package/lib/no-eventsource/utils.js +38 -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 +25 -11
- 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 +15 -1
- package/lib/rpc/jsonrpc.d.ts +9 -1
- package/lib/rpc/parsers.d.ts +31 -11
- package/lib/rpc/parsers.js +14 -14
- package/lib/rpc/server.d.ts +207 -99
- package/lib/rpc/server.js +273 -133
- 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 +12 -4
- package/lib/utils.js +7 -0
- 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.d.ts
CHANGED
|
@@ -1,21 +1,57 @@
|
|
|
1
1
|
import URI from 'urijs';
|
|
2
|
-
import { Account, Address, Contract, FeeBumpTransaction, Transaction, xdr } from '@stellar/stellar-base';
|
|
2
|
+
import { Account, Address, Asset, Contract, FeeBumpTransaction, Transaction, xdr } from '@stellar/stellar-base';
|
|
3
3
|
import { Api } from './api';
|
|
4
|
+
/**
|
|
5
|
+
* Default transaction submission timeout for RPC requests, in milliseconds
|
|
6
|
+
* @constant {number}
|
|
7
|
+
* @default 60000
|
|
8
|
+
* @memberof module:rpc.Server
|
|
9
|
+
*/
|
|
4
10
|
export declare const SUBMIT_TRANSACTION_TIMEOUT: number;
|
|
5
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Specifies the durability namespace of contract-related ledger entries.
|
|
13
|
+
* @enum {('temporary' | 'persistent')}
|
|
14
|
+
* @memberof module:rpc
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://developers.stellar.org/docs/learn/smart-contract-internals/state-archival | State Archival docs}
|
|
17
|
+
* @see {@link https://docs.rs/soroban-sdk/latest/soroban_sdk/storage/struct.Storage.html | Rust SDK Storage docs}
|
|
18
|
+
*/
|
|
6
19
|
export declare enum Durability {
|
|
7
20
|
Temporary = "temporary",
|
|
8
21
|
Persistent = "persistent"
|
|
9
22
|
}
|
|
10
|
-
|
|
11
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @typedef {object} GetEventsRequest Describes the complex filter combinations available for event queries.
|
|
25
|
+
* @property {Array.<module:rpc.Api.EventFilter>} filters Filters to use when querying events from the RPC server.
|
|
26
|
+
* @property {number} [startLedger] Ledger number (inclusive) to begin querying events.
|
|
27
|
+
* @property {string} [cursor] Page cursor (exclusive) to begin querying events.
|
|
28
|
+
* @property {number} [limit=100] The maximum number of events that should be returned in the RPC response.
|
|
29
|
+
* @memberof module:rpc.Server
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {object} ResourceLeeway Describes additional resource leeways for transaction simulation.
|
|
33
|
+
* @property {number} cpuInstructions Simulate the transaction with more CPU instructions available.
|
|
34
|
+
* @memberof module:rpc.Server
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* @typedef {object} Options Options for configuring connections to RPC servers.
|
|
38
|
+
* @property {boolean} [allowHttp=false] Allow connecting to http servers, default: `false`. This must be set to false in production deployments!
|
|
39
|
+
* @property {number} [timeout=0] Allow a timeout, default: 0. Allows user to avoid nasty lag. You can also use {@link Config} class to set this globally.
|
|
40
|
+
* @property {Record<string, string>} [headers] Additional headers that should be added to any requests to the RPC server.
|
|
41
|
+
* @memberof module:rpc.Server
|
|
42
|
+
*/
|
|
43
|
+
export declare namespace RpcServer {
|
|
12
44
|
interface GetEventsRequest {
|
|
13
45
|
filters: Api.EventFilter[];
|
|
14
46
|
startLedger?: number;
|
|
47
|
+
endLedger?: number;
|
|
15
48
|
cursor?: string;
|
|
16
49
|
limit?: number;
|
|
17
50
|
}
|
|
18
|
-
|
|
51
|
+
interface PollingOptions {
|
|
52
|
+
attempts?: number;
|
|
53
|
+
sleepStrategy?: SleepStrategy;
|
|
54
|
+
}
|
|
19
55
|
interface ResourceLeeway {
|
|
20
56
|
cpuInstructions: number;
|
|
21
57
|
}
|
|
@@ -25,38 +61,44 @@ export declare namespace Server {
|
|
|
25
61
|
headers?: Record<string, string>;
|
|
26
62
|
}
|
|
27
63
|
}
|
|
64
|
+
export declare const BasicSleepStrategy: SleepStrategy;
|
|
65
|
+
export declare const LinearSleepStrategy: SleepStrategy;
|
|
66
|
+
/**
|
|
67
|
+
* A function that returns the number of *milliseconds* to sleep
|
|
68
|
+
* on a given `iter`ation.
|
|
69
|
+
*/
|
|
70
|
+
export type SleepStrategy = (iter: number) => number;
|
|
28
71
|
/**
|
|
29
72
|
* Handles the network connection to a Soroban RPC instance, exposing an
|
|
30
73
|
* interface for requests to that instance.
|
|
31
74
|
*
|
|
32
|
-
* @
|
|
75
|
+
* @alias module:rpc.Server
|
|
76
|
+
* @memberof module:rpc
|
|
33
77
|
*
|
|
34
|
-
* @param {string} serverURL Soroban-RPC Server URL (ex.
|
|
35
|
-
*
|
|
36
|
-
* @param {
|
|
37
|
-
* @param {boolean} [opts.allowHttp] allows connecting to insecure http servers
|
|
78
|
+
* @param {string} serverURL Soroban-RPC Server URL (ex. `http://localhost:8000/soroban/rpc`).
|
|
79
|
+
* @param {module:rpc.Server.Options} [opts] Options object
|
|
80
|
+
* @param {boolean} [opts.allowHttp] Allows connecting to insecure http servers
|
|
38
81
|
* (default: `false`). This must be set to false in production deployments!
|
|
39
82
|
* You can also use {@link Config} class to set this globally.
|
|
40
|
-
* @param {Record<string, string>} [opts.headers]
|
|
83
|
+
* @param {Record<string, string>} [opts.headers] Allows setting custom headers
|
|
41
84
|
*
|
|
42
|
-
* @see https://
|
|
85
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods | API reference docs}
|
|
43
86
|
*/
|
|
44
|
-
export declare class
|
|
45
|
-
/** Soroban RPC Server URL (ex. `http://localhost:8000/soroban/rpc`). */
|
|
87
|
+
export declare class RpcServer {
|
|
46
88
|
readonly serverURL: URI;
|
|
47
|
-
constructor(serverURL: string, opts?:
|
|
89
|
+
constructor(serverURL: string, opts?: RpcServer.Options);
|
|
48
90
|
/**
|
|
49
91
|
* Fetch a minimal set of current info about a Stellar account.
|
|
50
92
|
*
|
|
51
93
|
* Needed to get the current sequence number for the account so you can build
|
|
52
94
|
* a successful transaction with {@link TransactionBuilder}.
|
|
53
95
|
*
|
|
54
|
-
* @param {string} address
|
|
96
|
+
* @param {string} address The public address of the account to load.
|
|
97
|
+
* @returns {Promise<Account>} A promise which resolves to the {@link Account}
|
|
98
|
+
* object with a populated sequence number
|
|
55
99
|
*
|
|
56
|
-
* @
|
|
57
|
-
* a populated sequence number
|
|
100
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
|
|
58
101
|
*
|
|
59
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries
|
|
60
102
|
* @example
|
|
61
103
|
* const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";
|
|
62
104
|
* server.getAccount(accountId).then((account) => {
|
|
@@ -67,11 +109,12 @@ export declare class Server {
|
|
|
67
109
|
/**
|
|
68
110
|
* General node health check.
|
|
69
111
|
*
|
|
70
|
-
* @returns {Promise<Api.GetHealthResponse>}
|
|
71
|
-
*
|
|
72
|
-
*
|
|
112
|
+
* @returns {Promise<Api.GetHealthResponse>} A promise which resolves to the
|
|
113
|
+
* {@link Api.GetHealthResponse} object with the status of the
|
|
114
|
+
* server (e.g. "healthy").
|
|
115
|
+
*
|
|
116
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getHealth | getLedgerEntries docs}
|
|
73
117
|
*
|
|
74
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getHealth
|
|
75
118
|
* @example
|
|
76
119
|
* server.getHealth().then((health) => {
|
|
77
120
|
* console.log("status:", health.status);
|
|
@@ -83,21 +126,22 @@ export declare class Server {
|
|
|
83
126
|
*
|
|
84
127
|
* Allows you to directly inspect the current state of a contract. This is a
|
|
85
128
|
* backup way to access your contract data which may not be available via
|
|
86
|
-
* events or {@link Server
|
|
87
|
-
* Warning: If the data entry in question is a 'temporary' entry, it's
|
|
88
|
-
* entirely possible that it has expired out of existence.
|
|
129
|
+
* events or {@link module:rpc.Server#simulateTransaction}.
|
|
89
130
|
*
|
|
90
|
-
* @param {string|Address|Contract} contract
|
|
131
|
+
* @param {string|Address|Contract} contract The contract ID containing the
|
|
91
132
|
* data to load as a strkey (`C...` form), a {@link Contract}, or an
|
|
92
133
|
* {@link Address} instance
|
|
93
|
-
* @param {xdr.ScVal} key
|
|
94
|
-
* @param {Durability} [durability=Durability.Persistent]
|
|
134
|
+
* @param {xdr.ScVal} key The key of the contract data to load
|
|
135
|
+
* @param {module:rpc.Durability} [durability=Durability.Persistent] The "durability
|
|
95
136
|
* keyspace" that this ledger key belongs to, which is either 'temporary'
|
|
96
|
-
* or 'persistent' (the default), see {@link Durability}.
|
|
137
|
+
* or 'persistent' (the default), see {@link module:rpc.Durability}.
|
|
138
|
+
* @returns {Promise<Api.LedgerEntryResult>} The current data value
|
|
97
139
|
*
|
|
98
|
-
* @
|
|
140
|
+
* @warning If the data entry in question is a 'temporary' entry, it's
|
|
141
|
+
* entirely possible that it has expired out of existence.
|
|
142
|
+
*
|
|
143
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
|
|
99
144
|
*
|
|
100
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries
|
|
101
145
|
* @example
|
|
102
146
|
* const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
|
|
103
147
|
* const key = xdr.ScVal.scvSymbol("counter");
|
|
@@ -116,13 +160,10 @@ export declare class Server {
|
|
|
116
160
|
* deployed on the Soroban network. The WASM bytecode represents the executable
|
|
117
161
|
* code of the contract.
|
|
118
162
|
*
|
|
119
|
-
* @param {string} contractId
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* @returns {Promise<Buffer>} a Buffer containing the WASM bytecode
|
|
123
|
-
*
|
|
163
|
+
* @param {string} contractId The contract ID containing the WASM bytecode to retrieve
|
|
164
|
+
* @returns {Promise<Buffer>} A Buffer containing the WASM bytecode
|
|
124
165
|
* @throws {Error} If the contract or its associated WASM bytecode cannot be
|
|
125
|
-
*
|
|
166
|
+
* found on the network.
|
|
126
167
|
*
|
|
127
168
|
* @example
|
|
128
169
|
* const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
|
|
@@ -141,12 +182,10 @@ export declare class Server {
|
|
|
141
182
|
* deployed on the Soroban network using the contract's WASM hash. The WASM bytecode
|
|
142
183
|
* represents the executable code of the contract.
|
|
143
184
|
*
|
|
144
|
-
* @param {Buffer} wasmHash
|
|
145
|
-
*
|
|
146
|
-
* @returns {Promise<Buffer>} a Buffer containing the WASM bytecode
|
|
147
|
-
*
|
|
185
|
+
* @param {Buffer} wasmHash The WASM hash of the contract
|
|
186
|
+
* @returns {Promise<Buffer>} A Buffer containing the WASM bytecode
|
|
148
187
|
* @throws {Error} If the contract or its associated WASM bytecode cannot be
|
|
149
|
-
*
|
|
188
|
+
* found on the network.
|
|
150
189
|
*
|
|
151
190
|
* @example
|
|
152
191
|
* const wasmHash = Buffer.from("...");
|
|
@@ -168,13 +207,12 @@ export declare class Server {
|
|
|
168
207
|
* {@link xdr.LedgerKeyContractCode} ledger entry key (or see
|
|
169
208
|
* {@link Contract.getFootprint}).
|
|
170
209
|
*
|
|
171
|
-
* @param {xdr.ScVal[]} keys
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* on-chain values for the given ledger keys
|
|
210
|
+
* @param {xdr.ScVal[]} keys One or more ledger entry keys to load
|
|
211
|
+
* @returns {Promise<Api.GetLedgerEntriesResponse>} The current on-chain
|
|
212
|
+
* values for the given ledger keys
|
|
175
213
|
*
|
|
176
|
-
* @see
|
|
177
|
-
* @see
|
|
214
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
|
|
215
|
+
* @see RpcServer._getLedgerEntries
|
|
178
216
|
* @example
|
|
179
217
|
* const contractId = "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM";
|
|
180
218
|
* const key = xdr.LedgerKey.contractData(new xdr.LedgerKeyContractData({
|
|
@@ -193,18 +231,45 @@ export declare class Server {
|
|
|
193
231
|
*/
|
|
194
232
|
getLedgerEntries(...keys: xdr.LedgerKey[]): Promise<Api.GetLedgerEntriesResponse>;
|
|
195
233
|
_getLedgerEntries(...keys: xdr.LedgerKey[]): Promise<Api.RawGetLedgerEntriesResponse>;
|
|
234
|
+
/**
|
|
235
|
+
* Poll for a particular transaction with certain parameters.
|
|
236
|
+
*
|
|
237
|
+
* After submitting a transaction, clients can use this to poll for
|
|
238
|
+
* transaction completion and return a definitive state of success or failure.
|
|
239
|
+
*
|
|
240
|
+
* @param {string} hash the transaction you're polling for
|
|
241
|
+
* @param {number} [opts.attempts] (optional) the number of attempts to make
|
|
242
|
+
* before returning the last-seen status. By default or on invalid inputs,
|
|
243
|
+
* try 5 times.
|
|
244
|
+
* @param {SleepStrategy} [opts.sleepStrategy] (optional) the amount of time
|
|
245
|
+
* to wait for between each attempt. By default, sleep for 1 second between
|
|
246
|
+
* each attempt.
|
|
247
|
+
*
|
|
248
|
+
* @return {Promise<Api.GetTransactionsResponse>} the response after a "found"
|
|
249
|
+
* response (which may be success or failure) or the last response obtained
|
|
250
|
+
* after polling the maximum number of specified attempts.
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* const h = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";
|
|
254
|
+
* const txStatus = await server.pollTransaction(h, {
|
|
255
|
+
* attempts: 100, // I'm a maniac
|
|
256
|
+
* sleepStrategy: rpc.LinearSleepStrategy
|
|
257
|
+
* }); // this will take 5,050 seconds to complete
|
|
258
|
+
*/
|
|
259
|
+
pollTransaction(hash: string, opts?: RpcServer.PollingOptions): Promise<Api.GetTransactionResponse>;
|
|
196
260
|
/**
|
|
197
261
|
* Fetch the details of a submitted transaction.
|
|
198
262
|
*
|
|
199
263
|
* After submitting a transaction, clients should poll this to tell when the
|
|
200
264
|
* transaction has completed.
|
|
201
265
|
*
|
|
202
|
-
* @param {string} hash
|
|
266
|
+
* @param {string} hash Hex-encoded hash of the transaction to check
|
|
267
|
+
* @returns {Promise<Api.GetTransactionResponse>} The status, result, and
|
|
268
|
+
* other details about the transaction
|
|
203
269
|
*
|
|
204
|
-
* @
|
|
205
|
-
*
|
|
270
|
+
* @see
|
|
271
|
+
* {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction | getTransaction docs}
|
|
206
272
|
*
|
|
207
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction
|
|
208
273
|
* @example
|
|
209
274
|
* const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";
|
|
210
275
|
* server.getTransaction(transactionHash).then((tx) => {
|
|
@@ -239,21 +304,23 @@ export declare class Server {
|
|
|
239
304
|
/**
|
|
240
305
|
* Fetch all events that match a given set of filters.
|
|
241
306
|
*
|
|
242
|
-
* The given filters (see {@link Api.EventFilter
|
|
243
|
-
* are combined only in a logical OR fashion, and all of
|
|
244
|
-
* filter are optional.
|
|
307
|
+
* The given filters (see {@link module:rpc.Api.EventFilter | Api.EventFilter}
|
|
308
|
+
* for detailed fields) are combined only in a logical OR fashion, and all of
|
|
309
|
+
* the fields in each filter are optional.
|
|
245
310
|
*
|
|
246
311
|
* To page through events, use the `pagingToken` field on the relevant
|
|
247
312
|
* {@link Api.EventResponse} object to set the `cursor` parameter.
|
|
248
313
|
*
|
|
249
|
-
* @param {Server.GetEventsRequest} request
|
|
250
|
-
* @returns {Promise<Api.GetEventsResponse>}
|
|
251
|
-
*
|
|
314
|
+
* @param {module:rpc.Server.GetEventsRequest} request Event filters
|
|
315
|
+
* @returns {Promise<Api.GetEventsResponse>} A paginatable set of the events
|
|
316
|
+
* matching the given event filters
|
|
317
|
+
*
|
|
318
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getEvents | getEvents docs}
|
|
252
319
|
*
|
|
253
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getEvents
|
|
254
320
|
* @example
|
|
255
321
|
* server.getEvents({
|
|
256
322
|
* startLedger: 1000,
|
|
323
|
+
* endLedger: 2000,
|
|
257
324
|
* filters: [
|
|
258
325
|
* {
|
|
259
326
|
* type: "contract",
|
|
@@ -274,15 +341,16 @@ export declare class Server {
|
|
|
274
341
|
* limit: 10,
|
|
275
342
|
* });
|
|
276
343
|
*/
|
|
277
|
-
getEvents(request:
|
|
278
|
-
_getEvents(request:
|
|
344
|
+
getEvents(request: RpcServer.GetEventsRequest): Promise<Api.GetEventsResponse>;
|
|
345
|
+
_getEvents(request: RpcServer.GetEventsRequest): Promise<Api.RawGetEventsResponse>;
|
|
279
346
|
/**
|
|
280
347
|
* Fetch metadata about the network this Soroban RPC server is connected to.
|
|
281
348
|
*
|
|
282
|
-
* @returns {Promise<Api.GetNetworkResponse>}
|
|
283
|
-
*
|
|
349
|
+
* @returns {Promise<Api.GetNetworkResponse>} Metadata about the current
|
|
350
|
+
* network this RPC server is connected to
|
|
351
|
+
*
|
|
352
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getNetwork | getNetwork docs}
|
|
284
353
|
*
|
|
285
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getNetwork
|
|
286
354
|
* @example
|
|
287
355
|
* server.getNetwork().then((network) => {
|
|
288
356
|
* console.log("friendbotUrl:", network.friendbotUrl);
|
|
@@ -298,7 +366,8 @@ export declare class Server {
|
|
|
298
366
|
* @returns {Promise<Api.GetLatestLedgerResponse>} metadata about the
|
|
299
367
|
* latest ledger on the network that this RPC server is connected to
|
|
300
368
|
*
|
|
301
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLatestLedger
|
|
369
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLatestLedger | getLatestLedger docs}
|
|
370
|
+
*
|
|
302
371
|
* @example
|
|
303
372
|
* server.getLatestLedger().then((response) => {
|
|
304
373
|
* console.log("hash:", response.id);
|
|
@@ -316,15 +385,14 @@ export declare class Server {
|
|
|
316
385
|
* {@link xdr.InvokeHostFunctionOp}, {@link xdr.ExtendFootprintTTLOp}, or
|
|
317
386
|
* {@link xdr.RestoreFootprintOp}). Any provided footprint or auth
|
|
318
387
|
* information will be ignored.
|
|
319
|
-
*
|
|
320
|
-
* @returns {Promise<Api.SimulateTransactionResponse>} an object with the
|
|
388
|
+
* @returns {Promise<Api.SimulateTransactionResponse>} An object with the
|
|
321
389
|
* cost, footprint, result/auth requirements (if applicable), and error of
|
|
322
390
|
* the transaction
|
|
323
391
|
*
|
|
324
|
-
* @see https://developers.stellar.org/docs/
|
|
325
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction
|
|
326
|
-
* @see Server
|
|
327
|
-
* @see assembleTransaction
|
|
392
|
+
* @see {@link https://developers.stellar.org/docs/learn/fundamentals/stellar-data-structures/operations-and-transactions | transaction docs}
|
|
393
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction | simulateTransaction docs}
|
|
394
|
+
* @see module:rpc.Server#prepareTransaction
|
|
395
|
+
* @see module:rpc.assembleTransaction
|
|
328
396
|
*
|
|
329
397
|
* @example
|
|
330
398
|
* const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
|
|
@@ -349,8 +417,8 @@ export declare class Server {
|
|
|
349
417
|
* console.log("latestLedger:", sim.latestLedger);
|
|
350
418
|
* });
|
|
351
419
|
*/
|
|
352
|
-
simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?:
|
|
353
|
-
_simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?:
|
|
420
|
+
simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: RpcServer.ResourceLeeway): Promise<Api.SimulateTransactionResponse>;
|
|
421
|
+
_simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: RpcServer.ResourceLeeway): Promise<Api.RawSimulateTransactionResponse>;
|
|
354
422
|
/**
|
|
355
423
|
* Submit a trial contract invocation, first run a simulation of the contract
|
|
356
424
|
* invocation as defined on the incoming transaction, and apply the results to
|
|
@@ -360,13 +428,14 @@ export declare class Server {
|
|
|
360
428
|
*
|
|
361
429
|
* The returned transaction will also have an updated fee that is the sum of
|
|
362
430
|
* fee set on incoming transaction with the contract resource fees estimated
|
|
363
|
-
* from simulation. It is
|
|
431
|
+
* from simulation. It is advisable to check the fee on returned transaction
|
|
364
432
|
* and validate or take appropriate measures for interaction with user to
|
|
365
433
|
* confirm it is acceptable.
|
|
366
434
|
*
|
|
367
|
-
* You can call the {@link Server
|
|
368
|
-
* if you want to inspect estimated fees for a given
|
|
369
|
-
* first, then re-assemble it manually or via
|
|
435
|
+
* You can call the {@link module:rpc.Server#simulateTransaction} method
|
|
436
|
+
* directly first if you want to inspect estimated fees for a given
|
|
437
|
+
* transaction in detail first, then re-assemble it manually or via
|
|
438
|
+
* {@link module:rpc.assembleTransaction}.
|
|
370
439
|
*
|
|
371
440
|
* @param {Transaction | FeeBumpTransaction} tx the transaction to
|
|
372
441
|
* prepare. It should include exactly one operation, which must be one of
|
|
@@ -378,17 +447,17 @@ export declare class Server {
|
|
|
378
447
|
* from the simulation. In other words, if you include auth entries, you
|
|
379
448
|
* don't care about the auth returned from the simulation. Other fields
|
|
380
449
|
* (footprint, etc.) will be filled as normal.
|
|
381
|
-
*
|
|
382
|
-
* @returns {Promise<Transaction | FeeBumpTransaction>} a copy of the
|
|
450
|
+
* @returns {Promise<Transaction | FeeBumpTransaction>} A copy of the
|
|
383
451
|
* transaction with the expected authorizations (in the case of
|
|
384
452
|
* invocation), resources, and ledger footprints added. The transaction fee
|
|
385
453
|
* will also automatically be padded with the contract's minimum resource
|
|
386
454
|
* fees discovered from the simulation.
|
|
387
|
-
*
|
|
388
|
-
* @see assembleTransaction
|
|
389
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction
|
|
390
455
|
* @throws {jsonrpc.Error<any>|Error|Api.SimulateTransactionErrorResponse}
|
|
391
|
-
*
|
|
456
|
+
* If simulation fails
|
|
457
|
+
*
|
|
458
|
+
* @see module:rpc.assembleTransaction
|
|
459
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction | simulateTransaction docs}
|
|
460
|
+
*
|
|
392
461
|
* @example
|
|
393
462
|
* const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
|
|
394
463
|
* const contract = new StellarSdk.Contract(contractId);
|
|
@@ -426,15 +495,16 @@ export declare class Server {
|
|
|
426
495
|
*
|
|
427
496
|
* Unlike Horizon, Soroban RPC does not wait for transaction completion. It
|
|
428
497
|
* simply validates the transaction and enqueues it. Clients should call
|
|
429
|
-
* {@link Server
|
|
498
|
+
* {@link module:rpc.Server#getTransaction} to learn about transaction
|
|
430
499
|
* success/failure.
|
|
431
500
|
*
|
|
432
501
|
* @param {Transaction | FeeBumpTransaction} transaction to submit
|
|
433
502
|
* @returns {Promise<Api.SendTransactionResponse>} the
|
|
434
503
|
* transaction id, status, and any error if available
|
|
435
504
|
*
|
|
436
|
-
* @see https://developers.stellar.org/docs/
|
|
437
|
-
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/sendTransaction
|
|
505
|
+
* @see {@link https://developers.stellar.org/docs/learn/fundamentals/stellar-data-structures/operations-and-transactions | transaction docs}
|
|
506
|
+
* @see {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/sendTransaction | sendTransaction docs}
|
|
507
|
+
*
|
|
438
508
|
* @example
|
|
439
509
|
* const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
|
|
440
510
|
* const contract = new StellarSdk.Contract(contractId);
|
|
@@ -467,25 +537,23 @@ export declare class Server {
|
|
|
467
537
|
sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<Api.SendTransactionResponse>;
|
|
468
538
|
_sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise<Api.RawSendTransactionResponse>;
|
|
469
539
|
/**
|
|
470
|
-
* Fund a new account using the network's
|
|
540
|
+
* Fund a new account using the network's Friendbot faucet, if any.
|
|
471
541
|
*
|
|
472
|
-
* @param {string | Account} address
|
|
473
|
-
* want to create and fund with
|
|
474
|
-
* @param {string} [friendbotUrl]
|
|
542
|
+
* @param {string | Account} address The address or account instance that we
|
|
543
|
+
* want to create and fund with Friendbot
|
|
544
|
+
* @param {string} [friendbotUrl] Optionally, an explicit address for
|
|
475
545
|
* friendbot (by default: this calls the Soroban RPC
|
|
476
|
-
* {@link Server
|
|
477
|
-
* Friendbot url).
|
|
478
|
-
*
|
|
479
|
-
* @returns {Promise<Account>} an {@link Account} object for the created
|
|
546
|
+
* {@link module:rpc.Server#getNetwork | getNetwork} method to try to
|
|
547
|
+
* discover this network's Friendbot url).
|
|
548
|
+
* @returns {Promise<Account>} An {@link Account} object for the created
|
|
480
549
|
* account, or the existing account if it's already funded with the
|
|
481
550
|
* populated sequence number (note that the account will not be "topped
|
|
482
551
|
* off" if it already exists)
|
|
552
|
+
* @throws If Friendbot is not configured on this network or request failure
|
|
483
553
|
*
|
|
484
|
-
* @
|
|
554
|
+
* @see {@link https://developers.stellar.org/docs/learn/networks#friendbot | Friendbot docs}
|
|
555
|
+
* @see {@link module:Friendbot.Api.Response}
|
|
485
556
|
*
|
|
486
|
-
* @see
|
|
487
|
-
* https://developers.stellar.org/docs/fundamentals-and-concepts/testnet-and-pubnet#friendbot
|
|
488
|
-
* @see Friendbot.Response
|
|
489
557
|
* @example
|
|
490
558
|
* server
|
|
491
559
|
* .requestAirdrop("GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4")
|
|
@@ -511,4 +579,44 @@ export declare class Server {
|
|
|
511
579
|
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getVersionInfo
|
|
512
580
|
*/
|
|
513
581
|
getVersionInfo(): Promise<Api.GetVersionInfoResponse>;
|
|
582
|
+
/**
|
|
583
|
+
* Returns a contract's balance of a particular SAC asset, if any.
|
|
584
|
+
*
|
|
585
|
+
* This is a convenience wrapper around {@link Server.getLedgerEntries}.
|
|
586
|
+
*
|
|
587
|
+
* @param {string} contractId the contract ID (string `C...`) whose
|
|
588
|
+
* balance of `sac` you want to know
|
|
589
|
+
* @param {Asset} sac the built-in SAC token (e.g. `USDC:GABC...`) that
|
|
590
|
+
* you are querying from the given `contract`.
|
|
591
|
+
* @param {string} [networkPassphrase] optionally, the network passphrase to
|
|
592
|
+
* which this token applies. If omitted, a request about network
|
|
593
|
+
* information will be made (see {@link getNetwork}), since contract IDs
|
|
594
|
+
* for assets are specific to a network. You can refer to {@link Networks}
|
|
595
|
+
* for a list of built-in passphrases, e.g., `Networks.TESTNET`.
|
|
596
|
+
*
|
|
597
|
+
* @returns {Promise<Api.BalanceResponse>}, which will contain the balance
|
|
598
|
+
* entry details if and only if the request returned a valid balance ledger
|
|
599
|
+
* entry. If it doesn't, the `balanceEntry` field will not exist.
|
|
600
|
+
*
|
|
601
|
+
* @throws {TypeError} If `contractId` is not a valid contract strkey (C...).
|
|
602
|
+
*
|
|
603
|
+
* @see getLedgerEntries
|
|
604
|
+
* @see https://developers.stellar.org/docs/tokens/stellar-asset-contract
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* // assume `contractId` is some contract with an XLM balance
|
|
608
|
+
* // assume server is an instantiated `Server` instance.
|
|
609
|
+
* const entry = (await server.getSACBalance(
|
|
610
|
+
* new Address(contractId),
|
|
611
|
+
* Asset.native(),
|
|
612
|
+
* Networks.PUBLIC
|
|
613
|
+
* ));
|
|
614
|
+
*
|
|
615
|
+
* // assumes BigInt support:
|
|
616
|
+
* console.log(
|
|
617
|
+
* entry.balanceEntry ?
|
|
618
|
+
* BigInt(entry.balanceEntry.amount) :
|
|
619
|
+
* "Contract has no XLM");
|
|
620
|
+
*/
|
|
621
|
+
getSACBalance(contractId: string, sac: Asset, networkPassphrase?: string): Promise<Api.BalanceResponse>;
|
|
514
622
|
}
|