@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.OrderbookCallBuilder = void 0;
|
|
8
|
+
var _call_builder = require("./call_builder");
|
|
9
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
16
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
19
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
+
var OrderbookCallBuilder = exports.OrderbookCallBuilder = function (_CallBuilder) {
|
|
22
|
+
function OrderbookCallBuilder(serverUrl, selling, buying) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, OrderbookCallBuilder);
|
|
25
|
+
_this = _callSuper(this, OrderbookCallBuilder, [serverUrl]);
|
|
26
|
+
_this.url.segment("order_book");
|
|
27
|
+
if (!selling.isNative()) {
|
|
28
|
+
_this.url.setQuery("selling_asset_type", selling.getAssetType());
|
|
29
|
+
_this.url.setQuery("selling_asset_code", selling.getCode());
|
|
30
|
+
_this.url.setQuery("selling_asset_issuer", selling.getIssuer());
|
|
31
|
+
} else {
|
|
32
|
+
_this.url.setQuery("selling_asset_type", "native");
|
|
33
|
+
}
|
|
34
|
+
if (!buying.isNative()) {
|
|
35
|
+
_this.url.setQuery("buying_asset_type", buying.getAssetType());
|
|
36
|
+
_this.url.setQuery("buying_asset_code", buying.getCode());
|
|
37
|
+
_this.url.setQuery("buying_asset_issuer", buying.getIssuer());
|
|
38
|
+
} else {
|
|
39
|
+
_this.url.setQuery("buying_asset_type", "native");
|
|
40
|
+
}
|
|
41
|
+
return _this;
|
|
42
|
+
}
|
|
43
|
+
_inherits(OrderbookCallBuilder, _CallBuilder);
|
|
44
|
+
return _createClass(OrderbookCallBuilder);
|
|
45
|
+
}(_call_builder.CallBuilder);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Asset } from "@stellar/stellar-base";
|
|
2
|
+
import { CallBuilder } from "./call_builder";
|
|
3
|
+
import { ServerApi } from "./server_api";
|
|
4
|
+
/**
|
|
5
|
+
* The Stellar Network allows payments to be made across assets through path payments. A path payment specifies a
|
|
6
|
+
* series of assets to route a payment through, from source asset (the asset debited from the payer) to destination
|
|
7
|
+
* asset (the asset credited to the payee).
|
|
8
|
+
*
|
|
9
|
+
* A path search is specified using:
|
|
10
|
+
*
|
|
11
|
+
* * The destination address
|
|
12
|
+
* * The source address
|
|
13
|
+
* * The asset and amount that the destination account should receive
|
|
14
|
+
*
|
|
15
|
+
* As part of the search, horizon will load a list of assets available to the source address and will find any
|
|
16
|
+
* payment paths from those source assets to the desired destination asset. The search's amount parameter will be
|
|
17
|
+
* used to determine if there a given path can satisfy a payment of the desired amount.
|
|
18
|
+
*
|
|
19
|
+
* Do not create this object directly, use {@link Horizon.Server#paths}.
|
|
20
|
+
*
|
|
21
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/aggregations/paths|Find Payment Paths}
|
|
22
|
+
*
|
|
23
|
+
* @augments CallBuilder
|
|
24
|
+
* @private
|
|
25
|
+
* @class
|
|
26
|
+
*
|
|
27
|
+
* @param {string} serverUrl Horizon server URL.
|
|
28
|
+
* @param {string} source The sender's account ID. Any returned path must use a source that the sender can hold.
|
|
29
|
+
* @param {string} destination The destination account ID that any returned path should use.
|
|
30
|
+
* @param {Asset} destinationAsset The destination asset.
|
|
31
|
+
* @param {string} destinationAmount The amount, denominated in the destination asset, that any returned path should be able to satisfy.
|
|
32
|
+
*/
|
|
33
|
+
export declare class PathCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.PaymentPathRecord>> {
|
|
34
|
+
constructor(serverUrl: URI, source: string, destination: string, destinationAsset: Asset, destinationAmount: string);
|
|
35
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PathCallBuilder = void 0;
|
|
8
|
+
var _call_builder = require("./call_builder");
|
|
9
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
16
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
19
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
+
var PathCallBuilder = exports.PathCallBuilder = function (_CallBuilder) {
|
|
22
|
+
function PathCallBuilder(serverUrl, source, destination, destinationAsset, destinationAmount) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, PathCallBuilder);
|
|
25
|
+
_this = _callSuper(this, PathCallBuilder, [serverUrl]);
|
|
26
|
+
_this.url.segment("paths");
|
|
27
|
+
_this.url.setQuery("destination_account", destination);
|
|
28
|
+
_this.url.setQuery("source_account", source);
|
|
29
|
+
_this.url.setQuery("destination_amount", destinationAmount);
|
|
30
|
+
if (!destinationAsset.isNative()) {
|
|
31
|
+
_this.url.setQuery("destination_asset_type", destinationAsset.getAssetType());
|
|
32
|
+
_this.url.setQuery("destination_asset_code", destinationAsset.getCode());
|
|
33
|
+
_this.url.setQuery("destination_asset_issuer", destinationAsset.getIssuer());
|
|
34
|
+
} else {
|
|
35
|
+
_this.url.setQuery("destination_asset_type", "native");
|
|
36
|
+
}
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
_inherits(PathCallBuilder, _CallBuilder);
|
|
40
|
+
return _createClass(PathCallBuilder);
|
|
41
|
+
}(_call_builder.CallBuilder);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CallBuilder } from "./call_builder";
|
|
2
|
+
import { ServerApi } from "./server_api";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new {@link PaymentCallBuilder} pointed to server defined by serverUrl.
|
|
5
|
+
*
|
|
6
|
+
* Do not create this object directly, use {@link Horizon.Server#payments}.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/horizon/resources/list-all-payments/|All Payments}
|
|
9
|
+
*
|
|
10
|
+
* @augments CallBuilder
|
|
11
|
+
* @private
|
|
12
|
+
* @class
|
|
13
|
+
*
|
|
14
|
+
* @param {string} serverUrl Horizon server URL.
|
|
15
|
+
*/
|
|
16
|
+
export declare class PaymentCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.PaymentOperationRecord | ServerApi.CreateAccountOperationRecord | ServerApi.AccountMergeOperationRecord | ServerApi.PathPaymentOperationRecord | ServerApi.PathPaymentStrictSendOperationRecord | ServerApi.InvokeHostFunctionOperationRecord>> {
|
|
17
|
+
constructor(serverUrl: URI);
|
|
18
|
+
/**
|
|
19
|
+
* This endpoint responds with a collection of Payment operations where the given account was either the sender or receiver.
|
|
20
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/horizon/resources/get-payments-by-account-id|Payments for Account}
|
|
21
|
+
* @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
|
|
22
|
+
* @returns {PaymentCallBuilder} this PaymentCallBuilder instance
|
|
23
|
+
*/
|
|
24
|
+
forAccount(accountId: string): this;
|
|
25
|
+
/**
|
|
26
|
+
* This endpoint represents all payment operations that are part of a valid transactions in a given ledger.
|
|
27
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/horizon/resources/retrieve-a-ledgers-payments|Payments for Ledger}
|
|
28
|
+
* @param {number|string} sequence Ledger sequence
|
|
29
|
+
* @returns {PaymentCallBuilder} this PaymentCallBuilder instance
|
|
30
|
+
*/
|
|
31
|
+
forLedger(sequence: number | string): this;
|
|
32
|
+
/**
|
|
33
|
+
* This endpoint represents all payment operations that are part of a given transaction.
|
|
34
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/transactions/payments/|Payments for Transaction}
|
|
35
|
+
* @param {string} transactionId Transaction ID
|
|
36
|
+
* @returns {PaymentCallBuilder} this PaymentCallBuilder instance
|
|
37
|
+
*/
|
|
38
|
+
forTransaction(transactionId: string): this;
|
|
39
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PaymentCallBuilder = void 0;
|
|
8
|
+
var _call_builder = require("./call_builder");
|
|
9
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
10
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
11
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
|
+
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); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
16
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
19
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
+
var PaymentCallBuilder = exports.PaymentCallBuilder = function (_CallBuilder) {
|
|
22
|
+
function PaymentCallBuilder(serverUrl) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, PaymentCallBuilder);
|
|
25
|
+
_this = _callSuper(this, PaymentCallBuilder, [serverUrl, "payments"]);
|
|
26
|
+
_this.url.segment("payments");
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
_inherits(PaymentCallBuilder, _CallBuilder);
|
|
30
|
+
return _createClass(PaymentCallBuilder, [{
|
|
31
|
+
key: "forAccount",
|
|
32
|
+
value: function forAccount(accountId) {
|
|
33
|
+
return this.forEndpoint("accounts", accountId);
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "forLedger",
|
|
37
|
+
value: function forLedger(sequence) {
|
|
38
|
+
return this.forEndpoint("ledgers", sequence.toString());
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "forTransaction",
|
|
42
|
+
value: function forTransaction(transactionId) {
|
|
43
|
+
return this.forEndpoint("transactions", transactionId);
|
|
44
|
+
}
|
|
45
|
+
}]);
|
|
46
|
+
}(_call_builder.CallBuilder);
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { Asset, FeeBumpTransaction, Transaction } from "@stellar/stellar-base";
|
|
2
|
+
import URI from "urijs";
|
|
3
|
+
import { AccountCallBuilder } from "./account_call_builder";
|
|
4
|
+
import { AccountResponse } from "./account_response";
|
|
5
|
+
import { AssetsCallBuilder } from "./assets_call_builder";
|
|
6
|
+
import { ClaimableBalanceCallBuilder } from "./claimable_balances_call_builder";
|
|
7
|
+
import { EffectCallBuilder } from "./effect_call_builder";
|
|
8
|
+
import { FriendbotBuilder } from "./friendbot_builder";
|
|
9
|
+
import { HorizonApi } from "./horizon_api";
|
|
10
|
+
import { LedgerCallBuilder } from "./ledger_call_builder";
|
|
11
|
+
import { LiquidityPoolCallBuilder } from "./liquidity_pool_call_builder";
|
|
12
|
+
import { OfferCallBuilder } from "./offer_call_builder";
|
|
13
|
+
import { OperationCallBuilder } from "./operation_call_builder";
|
|
14
|
+
import { OrderbookCallBuilder } from "./orderbook_call_builder";
|
|
15
|
+
import { PathCallBuilder } from "./path_call_builder";
|
|
16
|
+
import { PaymentCallBuilder } from "./payment_call_builder";
|
|
17
|
+
import { TradeAggregationCallBuilder } from "./trade_aggregation_call_builder";
|
|
18
|
+
import { TradesCallBuilder } from "./trades_call_builder";
|
|
19
|
+
import { TransactionCallBuilder } from "./transaction_call_builder";
|
|
20
|
+
/**
|
|
21
|
+
* Default transaction submission timeout for Horizon requests, in milliseconds
|
|
22
|
+
* @constant {number}
|
|
23
|
+
* @default 60000
|
|
24
|
+
* @memberof module:Horizon.Server
|
|
25
|
+
*/
|
|
26
|
+
export declare const SUBMIT_TRANSACTION_TIMEOUT: number;
|
|
27
|
+
/**
|
|
28
|
+
* Server handles the network connection to a [Horizon](https://developers.stellar.org/docs/data/horizon)
|
|
29
|
+
* instance and exposes an interface for requests to that instance.
|
|
30
|
+
* @class
|
|
31
|
+
* @alias module:Horizon.Server
|
|
32
|
+
* @memberof module:Horizon
|
|
33
|
+
*
|
|
34
|
+
* @param {string} serverURL Horizon Server URL (ex. `https://horizon-testnet.stellar.org`).
|
|
35
|
+
* @param {module:Horizon.Server.Options} [opts] Options object
|
|
36
|
+
*/
|
|
37
|
+
export declare class HorizonServer {
|
|
38
|
+
/**
|
|
39
|
+
* Horizon Server URL (ex. `https://horizon-testnet.stellar.org`)
|
|
40
|
+
*
|
|
41
|
+
* @todo Solve `URI(this.serverURL as any)`.
|
|
42
|
+
*/
|
|
43
|
+
readonly serverURL: URI;
|
|
44
|
+
constructor(serverURL: string, opts?: HorizonServer.Options);
|
|
45
|
+
/**
|
|
46
|
+
* Get timebounds for N seconds from now, when you're creating a transaction
|
|
47
|
+
* with {@link TransactionBuilder}.
|
|
48
|
+
*
|
|
49
|
+
* By default, {@link TransactionBuilder} uses the current local time, but
|
|
50
|
+
* your machine's local time could be different from Horizon's. This gives you
|
|
51
|
+
* more assurance that your timebounds will reflect what you want.
|
|
52
|
+
*
|
|
53
|
+
* Note that this will generate your timebounds when you **init the transaction**,
|
|
54
|
+
* not when you build or submit the transaction! So give yourself enough time to get
|
|
55
|
+
* the transaction built and signed before submitting.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* const transaction = new StellarSdk.TransactionBuilder(accountId, {
|
|
59
|
+
* fee: await StellarSdk.Server.fetchBaseFee(),
|
|
60
|
+
* timebounds: await StellarSdk.Server.fetchTimebounds(100)
|
|
61
|
+
* })
|
|
62
|
+
* .addOperation(operation)
|
|
63
|
+
* // normally we would need to call setTimeout here, but setting timebounds
|
|
64
|
+
* // earlier does the trick!
|
|
65
|
+
* .build();
|
|
66
|
+
*
|
|
67
|
+
* @param {number} seconds Number of seconds past the current time to wait.
|
|
68
|
+
* @param {boolean} [_isRetry] True if this is a retry. Only set this internally!
|
|
69
|
+
* This is to avoid a scenario where Horizon is horking up the wrong date.
|
|
70
|
+
* @returns {Promise<Timebounds>} Promise that resolves a `timebounds` object
|
|
71
|
+
* (with the shape `{ minTime: 0, maxTime: N }`) that you can set the `timebounds` option to.
|
|
72
|
+
*/
|
|
73
|
+
fetchTimebounds(seconds: number, _isRetry?: boolean): Promise<HorizonServer.Timebounds>;
|
|
74
|
+
/**
|
|
75
|
+
* Fetch the base fee. Since this hits the server, if the server call fails,
|
|
76
|
+
* you might get an error. You should be prepared to use a default value if
|
|
77
|
+
* that happens!
|
|
78
|
+
* @returns {Promise<number>} Promise that resolves to the base fee.
|
|
79
|
+
*/
|
|
80
|
+
fetchBaseFee(): Promise<number>;
|
|
81
|
+
/**
|
|
82
|
+
* Fetch the fee stats endpoint.
|
|
83
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/aggregations/fee-stats|Fee Stats}
|
|
84
|
+
* @returns {Promise<HorizonApi.FeeStatsResponse>} Promise that resolves to the fee stats returned by Horizon.
|
|
85
|
+
*/
|
|
86
|
+
feeStats(): Promise<HorizonApi.FeeStatsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Submits a transaction to the network.
|
|
89
|
+
*
|
|
90
|
+
* By default this function calls {@link Horizon.Server#checkMemoRequired}, you can
|
|
91
|
+
* skip this check by setting the option `skipMemoRequiredCheck` to `true`.
|
|
92
|
+
*
|
|
93
|
+
* If you submit any number of `manageOffer` operations, this will add an
|
|
94
|
+
* attribute to the response that will help you analyze what happened with
|
|
95
|
+
* your offers.
|
|
96
|
+
*
|
|
97
|
+
* For example, you'll want to examine `offerResults` to add affordances like
|
|
98
|
+
* these to your app:
|
|
99
|
+
* - If `wasImmediatelyFilled` is true, then no offer was created. So if you
|
|
100
|
+
* normally watch the `Server.offers` endpoint for offer updates, you
|
|
101
|
+
* instead need to check `Server.trades` to find the result of this filled
|
|
102
|
+
* offer.
|
|
103
|
+
* - If `wasImmediatelyDeleted` is true, then the offer you submitted was
|
|
104
|
+
* deleted without reaching the orderbook or being matched (possibly because
|
|
105
|
+
* your amounts were rounded down to zero). So treat the just-submitted
|
|
106
|
+
* offer request as if it never happened.
|
|
107
|
+
* - If `wasPartiallyFilled` is true, you can tell the user that
|
|
108
|
+
* `amountBought` or `amountSold` have already been transferred.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* const res = {
|
|
112
|
+
* ...response,
|
|
113
|
+
* offerResults: [
|
|
114
|
+
* {
|
|
115
|
+
* // Exact ordered list of offers that executed, with the exception
|
|
116
|
+
* // that the last one may not have executed entirely.
|
|
117
|
+
* offersClaimed: [
|
|
118
|
+
* sellerId: String,
|
|
119
|
+
* offerId: String,
|
|
120
|
+
* assetSold: {
|
|
121
|
+
* type: 'native|credit_alphanum4|credit_alphanum12',
|
|
122
|
+
*
|
|
123
|
+
* // these are only present if the asset is not native
|
|
124
|
+
* assetCode: String,
|
|
125
|
+
* issuer: String,
|
|
126
|
+
* },
|
|
127
|
+
*
|
|
128
|
+
* // same shape as assetSold
|
|
129
|
+
* assetBought: {}
|
|
130
|
+
* ],
|
|
131
|
+
*
|
|
132
|
+
* // What effect your manageOffer op had
|
|
133
|
+
* effect: "manageOfferCreated|manageOfferUpdated|manageOfferDeleted",
|
|
134
|
+
*
|
|
135
|
+
* // Whether your offer immediately got matched and filled
|
|
136
|
+
* wasImmediatelyFilled: Boolean,
|
|
137
|
+
*
|
|
138
|
+
* // Whether your offer immediately got deleted, if for example the order was too small
|
|
139
|
+
* wasImmediatelyDeleted: Boolean,
|
|
140
|
+
*
|
|
141
|
+
* // Whether the offer was partially, but not completely, filled
|
|
142
|
+
* wasPartiallyFilled: Boolean,
|
|
143
|
+
*
|
|
144
|
+
* // The full requested amount of the offer is open for matching
|
|
145
|
+
* isFullyOpen: Boolean,
|
|
146
|
+
*
|
|
147
|
+
* // The total amount of tokens bought / sold during transaction execution
|
|
148
|
+
* amountBought: Number,
|
|
149
|
+
* amountSold: Number,
|
|
150
|
+
*
|
|
151
|
+
* // if the offer was created, updated, or partially filled, this is
|
|
152
|
+
* // the outstanding offer
|
|
153
|
+
* currentOffer: {
|
|
154
|
+
* offerId: String,
|
|
155
|
+
* amount: String,
|
|
156
|
+
* price: {
|
|
157
|
+
* n: String,
|
|
158
|
+
* d: String,
|
|
159
|
+
* },
|
|
160
|
+
*
|
|
161
|
+
* selling: {
|
|
162
|
+
* type: 'native|credit_alphanum4|credit_alphanum12',
|
|
163
|
+
*
|
|
164
|
+
* // these are only present if the asset is not native
|
|
165
|
+
* assetCode: String,
|
|
166
|
+
* issuer: String,
|
|
167
|
+
* },
|
|
168
|
+
*
|
|
169
|
+
* // same as `selling`
|
|
170
|
+
* buying: {},
|
|
171
|
+
* },
|
|
172
|
+
*
|
|
173
|
+
* // the index of this particular operation in the op stack
|
|
174
|
+
* operationIndex: Number
|
|
175
|
+
* }
|
|
176
|
+
* ]
|
|
177
|
+
* }
|
|
178
|
+
*
|
|
179
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/submit-a-transaction|Submit a Transaction}
|
|
180
|
+
* @param {Transaction|FeeBumpTransaction} transaction - The transaction to submit.
|
|
181
|
+
* @param {object} [opts] Options object
|
|
182
|
+
* @param {boolean} [opts.skipMemoRequiredCheck] - Allow skipping memo
|
|
183
|
+
* required check, default: `false`. See
|
|
184
|
+
* [SEP0029](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md).
|
|
185
|
+
* @returns {Promise} Promise that resolves or rejects with response from
|
|
186
|
+
* horizon.
|
|
187
|
+
*/
|
|
188
|
+
submitTransaction(transaction: Transaction | FeeBumpTransaction, opts?: HorizonServer.SubmitTransactionOptions): Promise<HorizonApi.SubmitTransactionResponse>;
|
|
189
|
+
/**
|
|
190
|
+
* Submits an asynchronous transaction to the network. Unlike the synchronous version, which blocks
|
|
191
|
+
* and waits for the transaction to be ingested in Horizon, this endpoint relays the response from
|
|
192
|
+
* core directly back to the user.
|
|
193
|
+
*
|
|
194
|
+
* By default, this function calls {@link HorizonServer#checkMemoRequired}, you can
|
|
195
|
+
* skip this check by setting the option `skipMemoRequiredCheck` to `true`.
|
|
196
|
+
*
|
|
197
|
+
* @see [Submit-Async-Transaction](https://developers.stellar.org/docs/data/horizon/api-reference/resources/submit-async-transaction)
|
|
198
|
+
* @param {Transaction|FeeBumpTransaction} transaction - The transaction to submit.
|
|
199
|
+
* @param {object} [opts] Options object
|
|
200
|
+
* @param {boolean} [opts.skipMemoRequiredCheck] - Allow skipping memo
|
|
201
|
+
* required check, default: `false`. See
|
|
202
|
+
* [SEP0029](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md).
|
|
203
|
+
* @returns {Promise} Promise that resolves or rejects with response from
|
|
204
|
+
* horizon.
|
|
205
|
+
*/
|
|
206
|
+
submitAsyncTransaction(transaction: Transaction | FeeBumpTransaction, opts?: HorizonServer.SubmitTransactionOptions): Promise<HorizonApi.SubmitAsyncTransactionResponse>;
|
|
207
|
+
/**
|
|
208
|
+
* @returns {AccountCallBuilder} New {@link AccountCallBuilder} object configured by a current Horizon server configuration.
|
|
209
|
+
*/
|
|
210
|
+
accounts(): AccountCallBuilder;
|
|
211
|
+
/**
|
|
212
|
+
* @returns {ClaimableBalanceCallBuilder} New {@link ClaimableBalanceCallBuilder} object configured by a current Horizon server configuration.
|
|
213
|
+
*/
|
|
214
|
+
claimableBalances(): ClaimableBalanceCallBuilder;
|
|
215
|
+
/**
|
|
216
|
+
* @returns {LedgerCallBuilder} New {@link LedgerCallBuilder} object configured by a current Horizon server configuration.
|
|
217
|
+
*/
|
|
218
|
+
ledgers(): LedgerCallBuilder;
|
|
219
|
+
/**
|
|
220
|
+
* @returns {TransactionCallBuilder} New {@link TransactionCallBuilder} object configured by a current Horizon server configuration.
|
|
221
|
+
*/
|
|
222
|
+
transactions(): TransactionCallBuilder;
|
|
223
|
+
/**
|
|
224
|
+
* People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the offers on the DEX.
|
|
225
|
+
*
|
|
226
|
+
* You can query all offers for account using the function `.accountId`.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* server.offers()
|
|
230
|
+
* .forAccount(accountId).call()
|
|
231
|
+
* .then(function(offers) {
|
|
232
|
+
* console.log(offers);
|
|
233
|
+
* });
|
|
234
|
+
*
|
|
235
|
+
* @returns {OfferCallBuilder} New {@link OfferCallBuilder} object
|
|
236
|
+
*/
|
|
237
|
+
offers(): OfferCallBuilder;
|
|
238
|
+
/**
|
|
239
|
+
* @param {Asset} selling Asset being sold
|
|
240
|
+
* @param {Asset} buying Asset being bought
|
|
241
|
+
* @returns {OrderbookCallBuilder} New {@link OrderbookCallBuilder} object configured by a current Horizon server configuration.
|
|
242
|
+
*/
|
|
243
|
+
orderbook(selling: Asset, buying: Asset): OrderbookCallBuilder;
|
|
244
|
+
/**
|
|
245
|
+
* Returns
|
|
246
|
+
* @returns {TradesCallBuilder} New {@link TradesCallBuilder} object configured by a current Horizon server configuration.
|
|
247
|
+
*/
|
|
248
|
+
trades(): TradesCallBuilder;
|
|
249
|
+
/**
|
|
250
|
+
* @returns {OperationCallBuilder} New {@link OperationCallBuilder} object configured by a current Horizon server configuration.
|
|
251
|
+
*/
|
|
252
|
+
operations(): OperationCallBuilder;
|
|
253
|
+
/**
|
|
254
|
+
* @returns {LiquidityPoolCallBuilder} New {@link LiquidityPoolCallBuilder}
|
|
255
|
+
* object configured to the current Horizon server settings.
|
|
256
|
+
*/
|
|
257
|
+
liquidityPools(): LiquidityPoolCallBuilder;
|
|
258
|
+
/**
|
|
259
|
+
* The Stellar Network allows payments to be made between assets through path
|
|
260
|
+
* payments. A strict receive path payment specifies a series of assets to
|
|
261
|
+
* route a payment through, from source asset (the asset debited from the
|
|
262
|
+
* payer) to destination asset (the asset credited to the payee).
|
|
263
|
+
*
|
|
264
|
+
* A strict receive path search is specified using:
|
|
265
|
+
*
|
|
266
|
+
* * The destination address.
|
|
267
|
+
* * The source address or source assets.
|
|
268
|
+
* * The asset and amount that the destination account should receive.
|
|
269
|
+
*
|
|
270
|
+
* As part of the search, horizon will load a list of assets available to the
|
|
271
|
+
* source address and will find any payment paths from those source assets to
|
|
272
|
+
* the desired destination asset. The search's amount parameter will be used
|
|
273
|
+
* to determine if there a given path can satisfy a payment of the desired
|
|
274
|
+
* amount.
|
|
275
|
+
*
|
|
276
|
+
* If a list of assets is passed as the source, horizon will find any payment
|
|
277
|
+
* paths from those source assets to the desired destination asset.
|
|
278
|
+
*
|
|
279
|
+
* @param {string|Asset[]} source The sender's account ID or a list of assets. Any returned path will use a source that the sender can hold.
|
|
280
|
+
* @param {Asset} destinationAsset The destination asset.
|
|
281
|
+
* @param {string} destinationAmount The amount, denominated in the destination asset, that any returned path should be able to satisfy.
|
|
282
|
+
* @returns {StrictReceivePathCallBuilder} New {@link StrictReceivePathCallBuilder} object configured with the current Horizon server configuration.
|
|
283
|
+
*/
|
|
284
|
+
strictReceivePaths(source: string | Asset[], destinationAsset: Asset, destinationAmount: string): PathCallBuilder;
|
|
285
|
+
/**
|
|
286
|
+
* The Stellar Network allows payments to be made between assets through path payments. A strict send path payment specifies a
|
|
287
|
+
* series of assets to route a payment through, from source asset (the asset debited from the payer) to destination
|
|
288
|
+
* asset (the asset credited to the payee).
|
|
289
|
+
*
|
|
290
|
+
* A strict send path search is specified using:
|
|
291
|
+
*
|
|
292
|
+
* The asset and amount that is being sent.
|
|
293
|
+
* The destination account or the destination assets.
|
|
294
|
+
*
|
|
295
|
+
* @param {Asset} sourceAsset The asset to be sent.
|
|
296
|
+
* @param {string} sourceAmount The amount, denominated in the source asset, that any returned path should be able to satisfy.
|
|
297
|
+
* @param {string|Asset[]} destination The destination account or the destination assets.
|
|
298
|
+
* @returns {StrictSendPathCallBuilder} New {@link StrictSendPathCallBuilder} object configured with the current Horizon server configuration.
|
|
299
|
+
*/
|
|
300
|
+
strictSendPaths(sourceAsset: Asset, sourceAmount: string, destination: string | Asset[]): PathCallBuilder;
|
|
301
|
+
/**
|
|
302
|
+
* @returns {PaymentCallBuilder} New {@link PaymentCallBuilder} instance configured with the current
|
|
303
|
+
* Horizon server configuration.
|
|
304
|
+
*/
|
|
305
|
+
payments(): PaymentCallBuilder;
|
|
306
|
+
/**
|
|
307
|
+
* @returns {EffectCallBuilder} New {@link EffectCallBuilder} instance configured with the current
|
|
308
|
+
* Horizon server configuration
|
|
309
|
+
*/
|
|
310
|
+
effects(): EffectCallBuilder;
|
|
311
|
+
/**
|
|
312
|
+
* @param {string} address The Stellar ID that you want Friendbot to send lumens to
|
|
313
|
+
* @returns {FriendbotBuilder} New {@link FriendbotBuilder} instance configured with the current
|
|
314
|
+
* Horizon server configuration
|
|
315
|
+
* @private
|
|
316
|
+
*/
|
|
317
|
+
friendbot(address: string): FriendbotBuilder;
|
|
318
|
+
/**
|
|
319
|
+
* Get a new {@link AssetsCallBuilder} instance configured with the current
|
|
320
|
+
* Horizon server configuration.
|
|
321
|
+
* @returns {AssetsCallBuilder} New AssetsCallBuilder instance
|
|
322
|
+
*/
|
|
323
|
+
assets(): AssetsCallBuilder;
|
|
324
|
+
/**
|
|
325
|
+
* Fetches an account's most current state in the ledger, then creates and
|
|
326
|
+
* returns an {@link AccountResponse} object.
|
|
327
|
+
*
|
|
328
|
+
* @param {string} accountId - The account to load.
|
|
329
|
+
*
|
|
330
|
+
* @returns {Promise} Returns a promise to the {@link AccountResponse} object
|
|
331
|
+
* with populated sequence number.
|
|
332
|
+
*/
|
|
333
|
+
loadAccount(accountId: string): Promise<AccountResponse>;
|
|
334
|
+
/**
|
|
335
|
+
*
|
|
336
|
+
* @param {Asset} base base asset
|
|
337
|
+
* @param {Asset} counter counter asset
|
|
338
|
+
* @param {number} start_time lower time boundary represented as millis since epoch
|
|
339
|
+
* @param {number} end_time upper time boundary represented as millis since epoch
|
|
340
|
+
* @param {number} resolution segment duration as millis since epoch. *Supported values are 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000).
|
|
341
|
+
* @param {number} offset segments can be offset using this parameter. Expressed in milliseconds. *Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours.
|
|
342
|
+
* Returns new {@link TradeAggregationCallBuilder} object configured with the current Horizon server configuration.
|
|
343
|
+
* @returns {TradeAggregationCallBuilder} New TradeAggregationCallBuilder instance
|
|
344
|
+
*/
|
|
345
|
+
tradeAggregation(base: Asset, counter: Asset, start_time: number, end_time: number, resolution: number, offset: number): TradeAggregationCallBuilder;
|
|
346
|
+
/**
|
|
347
|
+
* Check if any of the destination accounts requires a memo.
|
|
348
|
+
*
|
|
349
|
+
* This function implements a memo required check as defined in
|
|
350
|
+
* [SEP-29](https://stellar.org/protocol/sep-29). It will load each account
|
|
351
|
+
* which is the destination and check if it has the data field
|
|
352
|
+
* `config.memo_required` set to `"MQ=="`.
|
|
353
|
+
*
|
|
354
|
+
* Each account is checked sequentially instead of loading multiple accounts
|
|
355
|
+
* at the same time from Horizon.
|
|
356
|
+
*
|
|
357
|
+
* @see {@link https://stellar.org/protocol/sep-29|SEP-29: Account Memo Requirements}
|
|
358
|
+
* @param {Transaction} transaction - The transaction to check.
|
|
359
|
+
* @returns {Promise<void, Error>} - If any of the destination account
|
|
360
|
+
* requires a memo, the promise will throw {@link AccountRequiresMemoError}.
|
|
361
|
+
* @throws {AccountRequiresMemoError}
|
|
362
|
+
*/
|
|
363
|
+
checkMemoRequired(transaction: Transaction | FeeBumpTransaction): Promise<void>;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Options for configuring connections to Horizon servers.
|
|
367
|
+
* @typedef {object} Options
|
|
368
|
+
* @memberof module:Horizon.Server
|
|
369
|
+
* @property {boolean} [allowHttp] Allow connecting to http servers, default: `false`. This must be set to false in production deployments! You can also use {@link Config} class to set this globally.
|
|
370
|
+
* @property {string} [appName] Allow set custom header `X-App-Name`, default: `undefined`.
|
|
371
|
+
* @property {string} [appVersion] Allow set custom header `X-App-Version`, default: `undefined`.
|
|
372
|
+
* @property {string} [authToken] Allow set custom header `X-Auth-Token`, default: `undefined`.
|
|
373
|
+
*/
|
|
374
|
+
export declare namespace HorizonServer {
|
|
375
|
+
interface Options {
|
|
376
|
+
allowHttp?: boolean;
|
|
377
|
+
appName?: string;
|
|
378
|
+
appVersion?: string;
|
|
379
|
+
authToken?: string;
|
|
380
|
+
headers?: Record<string, string>;
|
|
381
|
+
}
|
|
382
|
+
interface Timebounds {
|
|
383
|
+
minTime: number;
|
|
384
|
+
maxTime: number;
|
|
385
|
+
}
|
|
386
|
+
interface SubmitTransactionOptions {
|
|
387
|
+
skipMemoRequiredCheck?: boolean;
|
|
388
|
+
}
|
|
389
|
+
}
|