@stellar/stellar-sdk 12.3.0 → 13.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +29 -7
- package/dist/stellar-sdk-minimal.js +45947 -0
- package/dist/stellar-sdk-minimal.min.js +2 -0
- package/dist/stellar-sdk-minimal.min.js.LICENSE.txt +69 -0
- package/dist/stellar-sdk-no-axios.js +56586 -0
- package/dist/stellar-sdk-no-axios.min.js +2 -0
- package/dist/stellar-sdk-no-axios.min.js.LICENSE.txt +71 -0
- package/dist/stellar-sdk-no-eventsource.js +49760 -0
- package/dist/stellar-sdk-no-eventsource.min.js +2 -0
- package/dist/stellar-sdk-no-eventsource.min.js.LICENSE.txt +69 -0
- package/dist/stellar-sdk.js +28203 -27336
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/browser.d.ts +2 -2
- package/lib/browser.js +5 -7
- package/lib/config.d.ts +31 -19
- package/lib/contract/assembled_transaction.d.ts +22 -14
- package/lib/contract/assembled_transaction.js +158 -127
- package/lib/contract/basic_node_signer.d.ts +6 -1
- package/lib/contract/client.d.ts +24 -24
- package/lib/contract/rust_result.d.ts +22 -12
- package/lib/contract/sent_transaction.d.ts +7 -1
- package/lib/contract/sent_transaction.js +2 -2
- package/lib/contract/spec.d.ts +8 -14
- package/lib/contract/types.d.ts +81 -13
- package/lib/contract/utils.d.ts +8 -1
- package/lib/errors/account_requires_memo.d.ts +24 -0
- package/lib/errors/account_requires_memo.js +38 -0
- package/lib/errors/bad_request.d.ts +14 -0
- package/lib/errors/bad_request.js +34 -0
- package/lib/errors/bad_response.d.ts +17 -0
- package/lib/errors/bad_response.js +34 -0
- package/lib/errors/index.d.ts +5 -0
- package/lib/errors/index.js +60 -0
- package/lib/errors/network.d.ts +33 -0
- package/lib/{errors.js → errors/network.js} +1 -59
- package/lib/errors/not_found.d.ts +14 -0
- package/lib/errors/not_found.js +34 -0
- package/lib/federation/api.d.ts +21 -0
- package/lib/federation/index.d.ts +1 -1
- package/lib/federation/index.js +16 -6
- package/lib/federation/server.d.ts +36 -38
- package/lib/federation/server.js +2 -2
- package/lib/horizon/account_call_builder.d.ts +10 -8
- package/lib/horizon/account_response.d.ts +5 -2
- package/lib/horizon/assets_call_builder.d.ts +3 -2
- package/lib/horizon/call_builder.js +9 -3
- package/lib/horizon/claimable_balances_call_builder.d.ts +10 -8
- package/lib/horizon/effect_call_builder.d.ts +8 -7
- package/lib/horizon/horizon_axios_client.d.ts +13 -6
- package/lib/horizon/horizon_axios_client.js +16 -4
- package/lib/horizon/index.d.ts +2 -1
- package/lib/horizon/index.js +1 -1
- package/lib/horizon/ledger_call_builder.d.ts +6 -4
- package/lib/horizon/liquidity_pool_call_builder.d.ts +3 -2
- package/lib/horizon/offer_call_builder.d.ts +12 -10
- package/lib/horizon/operation_call_builder.d.ts +11 -9
- package/lib/horizon/orderbook_call_builder.d.ts +7 -2
- package/lib/horizon/path_call_builder.d.ts +7 -2
- package/lib/horizon/payment_call_builder.d.ts +10 -6
- package/lib/horizon/server.d.ts +64 -55
- package/lib/horizon/server.js +6 -5
- package/lib/horizon/strict_receive_path_call_builder.d.ts +7 -2
- package/lib/horizon/strict_send_path_call_builder.d.ts +7 -2
- package/lib/horizon/trade_aggregation_call_builder.d.ts +4 -2
- package/lib/horizon/trades_call_builder.d.ts +8 -5
- package/lib/horizon/transaction_call_builder.d.ts +10 -7
- package/lib/http-client/axios-client.d.ts +2 -0
- package/lib/http-client/axios-client.js +10 -0
- package/lib/http-client/fetch-client.d.ts +11 -0
- package/lib/http-client/fetch-client.js +229 -0
- package/lib/http-client/index.d.ts +5 -0
- package/lib/http-client/index.js +33 -0
- package/lib/http-client/types.d.ts +69 -0
- package/lib/http-client/types.js +34 -0
- package/lib/index.d.ts +3 -4
- package/lib/index.js +7 -1
- package/lib/minimal/browser.d.ts +6 -0
- package/lib/minimal/browser.js +35 -0
- package/lib/minimal/config.d.ts +64 -0
- package/lib/minimal/config.js +51 -0
- package/lib/minimal/contract/assembled_transaction.d.ts +555 -0
- package/lib/minimal/contract/assembled_transaction.js +752 -0
- package/lib/minimal/contract/basic_node_signer.d.ts +17 -0
- package/lib/minimal/contract/basic_node_signer.js +52 -0
- package/lib/minimal/contract/client.d.ts +52 -0
- package/lib/minimal/contract/client.js +180 -0
- package/lib/minimal/contract/index.d.ts +7 -0
- package/lib/minimal/contract/index.js +82 -0
- package/lib/minimal/contract/rust_result.d.ts +81 -0
- package/lib/minimal/contract/rust_result.js +66 -0
- package/lib/minimal/contract/sent_transaction.d.ts +85 -0
- package/lib/minimal/contract/sent_transaction.js +151 -0
- package/lib/minimal/contract/spec.d.ts +152 -0
- package/lib/minimal/contract/spec.js +1020 -0
- package/lib/minimal/contract/types.d.ts +180 -0
- package/lib/minimal/contract/types.js +8 -0
- package/lib/minimal/contract/utils.d.ts +46 -0
- package/lib/minimal/contract/utils.js +123 -0
- package/lib/minimal/errors/account_requires_memo.d.ts +24 -0
- package/lib/minimal/errors/account_requires_memo.js +38 -0
- package/lib/minimal/errors/bad_request.d.ts +14 -0
- package/lib/minimal/errors/bad_request.js +34 -0
- package/lib/minimal/errors/bad_response.d.ts +17 -0
- package/lib/minimal/errors/bad_response.js +34 -0
- package/lib/minimal/errors/index.d.ts +5 -0
- package/lib/minimal/errors/index.js +60 -0
- package/lib/minimal/errors/network.d.ts +33 -0
- package/lib/minimal/errors/network.js +41 -0
- package/lib/minimal/errors/not_found.d.ts +14 -0
- package/lib/minimal/errors/not_found.js +34 -0
- package/lib/minimal/federation/api.d.ts +32 -0
- package/lib/minimal/federation/api.js +7 -0
- package/lib/minimal/federation/index.d.ts +2 -0
- package/lib/minimal/federation/index.js +34 -0
- package/lib/minimal/federation/server.d.ts +116 -0
- package/lib/minimal/federation/server.js +252 -0
- package/lib/minimal/friendbot/index.d.ts +5 -0
- package/lib/minimal/friendbot/index.js +7 -0
- package/lib/minimal/horizon/account_call_builder.d.ts +56 -0
- package/lib/minimal/horizon/account_call_builder.js +62 -0
- package/lib/minimal/horizon/account_response.d.ts +61 -0
- package/lib/minimal/horizon/account_response.js +49 -0
- package/lib/minimal/horizon/assets_call_builder.d.ts +27 -0
- package/lib/minimal/horizon/assets_call_builder.js +43 -0
- package/lib/minimal/horizon/call_builder.d.ts +128 -0
- package/lib/minimal/horizon/call_builder.js +362 -0
- package/lib/minimal/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/minimal/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/minimal/horizon/effect_call_builder.d.ts +53 -0
- package/lib/minimal/horizon/effect_call_builder.js +56 -0
- package/lib/minimal/horizon/friendbot_builder.d.ts +4 -0
- package/lib/minimal/horizon/friendbot_builder.js +32 -0
- package/lib/minimal/horizon/horizon_api.d.ts +527 -0
- package/lib/minimal/horizon/horizon_api.js +96 -0
- package/lib/minimal/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/minimal/horizon/horizon_axios_client.js +60 -0
- package/lib/minimal/horizon/index.d.ts +8 -0
- package/lib/minimal/horizon/index.js +78 -0
- package/lib/minimal/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/minimal/horizon/ledger_call_builder.js +37 -0
- package/lib/minimal/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/minimal/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/minimal/horizon/offer_call_builder.d.ts +65 -0
- package/lib/minimal/horizon/offer_call_builder.js +79 -0
- package/lib/minimal/horizon/operation_call_builder.d.ts +69 -0
- package/lib/minimal/horizon/operation_call_builder.js +69 -0
- package/lib/minimal/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/minimal/horizon/orderbook_call_builder.js +45 -0
- package/lib/minimal/horizon/path_call_builder.d.ts +35 -0
- package/lib/minimal/horizon/path_call_builder.js +41 -0
- package/lib/minimal/horizon/payment_call_builder.d.ts +39 -0
- package/lib/minimal/horizon/payment_call_builder.js +46 -0
- package/lib/minimal/horizon/server.d.ts +389 -0
- package/lib/minimal/horizon/server.js +550 -0
- package/lib/minimal/horizon/server_api.d.ts +278 -0
- package/lib/minimal/horizon/server_api.js +19 -0
- package/lib/minimal/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/minimal/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/minimal/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/minimal/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/minimal/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/minimal/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/minimal/horizon/trades_call_builder.d.ts +52 -0
- package/lib/minimal/horizon/trades_call_builder.js +72 -0
- package/lib/minimal/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/minimal/horizon/transaction_call_builder.js +64 -0
- package/lib/minimal/horizon/types/account.d.ts +5 -0
- package/lib/minimal/horizon/types/account.js +5 -0
- package/lib/minimal/horizon/types/assets.d.ts +19 -0
- package/lib/minimal/horizon/types/assets.js +5 -0
- package/lib/minimal/horizon/types/effects.d.ts +285 -0
- package/lib/minimal/horizon/types/effects.js +62 -0
- package/lib/minimal/horizon/types/offer.d.ts +20 -0
- package/lib/minimal/horizon/types/offer.js +5 -0
- package/lib/minimal/horizon/types/trade.d.ts +13 -0
- package/lib/minimal/horizon/types/trade.js +5 -0
- package/lib/minimal/http-client/axios-client.d.ts +2 -0
- package/lib/minimal/http-client/axios-client.js +10 -0
- package/lib/minimal/http-client/fetch-client.d.ts +11 -0
- package/lib/minimal/http-client/fetch-client.js +229 -0
- package/lib/minimal/http-client/index.d.ts +5 -0
- package/lib/minimal/http-client/index.js +33 -0
- package/lib/minimal/http-client/types.d.ts +69 -0
- package/lib/minimal/http-client/types.js +34 -0
- package/lib/minimal/index.d.ts +36 -0
- package/lib/minimal/index.js +83 -0
- package/lib/minimal/rpc/api.d.ts +359 -0
- package/lib/minimal/rpc/api.js +32 -0
- package/lib/minimal/rpc/axios.d.ts +4 -0
- package/lib/minimal/rpc/axios.js +15 -0
- package/lib/minimal/rpc/browser.d.ts +4 -0
- package/lib/minimal/rpc/browser.js +27 -0
- package/lib/minimal/rpc/index.d.ts +8 -0
- package/lib/minimal/rpc/index.js +72 -0
- package/lib/minimal/rpc/jsonrpc.d.ts +35 -0
- package/lib/minimal/rpc/jsonrpc.js +52 -0
- package/lib/minimal/rpc/parsers.d.ts +39 -0
- package/lib/minimal/rpc/parsers.js +155 -0
- package/lib/minimal/rpc/server.d.ts +584 -0
- package/lib/minimal/rpc/server.js +823 -0
- package/lib/minimal/rpc/transaction.d.ts +21 -0
- package/lib/minimal/rpc/transaction.js +53 -0
- package/lib/minimal/rpc/utils.d.ts +1 -0
- package/lib/minimal/rpc/utils.js +9 -0
- package/lib/minimal/stellartoml/index.d.ts +131 -0
- package/lib/minimal/stellartoml/index.js +77 -0
- package/lib/minimal/utils.d.ts +19 -0
- package/lib/minimal/utils.js +31 -0
- package/lib/minimal/webauth/errors.d.ts +13 -0
- package/lib/minimal/webauth/errors.js +36 -0
- package/lib/minimal/webauth/index.d.ts +2 -0
- package/lib/minimal/webauth/index.js +27 -0
- package/lib/minimal/webauth/utils.d.ts +307 -0
- package/lib/minimal/webauth/utils.js +332 -0
- package/lib/no-axios/browser.d.ts +6 -0
- package/lib/no-axios/browser.js +35 -0
- package/lib/no-axios/config.d.ts +64 -0
- package/lib/no-axios/config.js +51 -0
- package/lib/no-axios/contract/assembled_transaction.d.ts +555 -0
- package/lib/no-axios/contract/assembled_transaction.js +752 -0
- package/lib/no-axios/contract/basic_node_signer.d.ts +17 -0
- package/lib/no-axios/contract/basic_node_signer.js +52 -0
- package/lib/no-axios/contract/client.d.ts +52 -0
- package/lib/no-axios/contract/client.js +180 -0
- package/lib/no-axios/contract/index.d.ts +7 -0
- package/lib/no-axios/contract/index.js +82 -0
- package/lib/no-axios/contract/rust_result.d.ts +81 -0
- package/lib/no-axios/contract/rust_result.js +66 -0
- package/lib/no-axios/contract/sent_transaction.d.ts +85 -0
- package/lib/no-axios/contract/sent_transaction.js +151 -0
- package/lib/no-axios/contract/spec.d.ts +152 -0
- package/lib/no-axios/contract/spec.js +1020 -0
- package/lib/no-axios/contract/types.d.ts +180 -0
- package/lib/no-axios/contract/types.js +8 -0
- package/lib/no-axios/contract/utils.d.ts +46 -0
- package/lib/no-axios/contract/utils.js +123 -0
- package/lib/no-axios/errors/account_requires_memo.d.ts +24 -0
- package/lib/no-axios/errors/account_requires_memo.js +38 -0
- package/lib/no-axios/errors/bad_request.d.ts +14 -0
- package/lib/no-axios/errors/bad_request.js +34 -0
- package/lib/no-axios/errors/bad_response.d.ts +17 -0
- package/lib/no-axios/errors/bad_response.js +34 -0
- package/lib/no-axios/errors/index.d.ts +5 -0
- package/lib/no-axios/errors/index.js +60 -0
- package/lib/no-axios/errors/network.d.ts +33 -0
- package/lib/no-axios/errors/network.js +41 -0
- package/lib/no-axios/errors/not_found.d.ts +14 -0
- package/lib/no-axios/errors/not_found.js +34 -0
- package/lib/no-axios/federation/api.d.ts +32 -0
- package/lib/no-axios/federation/api.js +7 -0
- package/lib/no-axios/federation/index.d.ts +2 -0
- package/lib/no-axios/federation/index.js +34 -0
- package/lib/no-axios/federation/server.d.ts +116 -0
- package/lib/no-axios/federation/server.js +252 -0
- package/lib/no-axios/friendbot/index.d.ts +5 -0
- package/lib/no-axios/friendbot/index.js +7 -0
- package/lib/no-axios/horizon/account_call_builder.d.ts +56 -0
- package/lib/no-axios/horizon/account_call_builder.js +62 -0
- package/lib/no-axios/horizon/account_response.d.ts +61 -0
- package/lib/no-axios/horizon/account_response.js +49 -0
- package/lib/no-axios/horizon/assets_call_builder.d.ts +27 -0
- package/lib/no-axios/horizon/assets_call_builder.js +43 -0
- package/lib/no-axios/horizon/call_builder.d.ts +128 -0
- package/lib/no-axios/horizon/call_builder.js +362 -0
- package/lib/no-axios/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/no-axios/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/no-axios/horizon/effect_call_builder.d.ts +53 -0
- package/lib/no-axios/horizon/effect_call_builder.js +56 -0
- package/lib/no-axios/horizon/friendbot_builder.d.ts +4 -0
- package/lib/no-axios/horizon/friendbot_builder.js +32 -0
- package/lib/no-axios/horizon/horizon_api.d.ts +527 -0
- package/lib/no-axios/horizon/horizon_api.js +96 -0
- package/lib/no-axios/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/no-axios/horizon/horizon_axios_client.js +60 -0
- package/lib/no-axios/horizon/index.d.ts +8 -0
- package/lib/no-axios/horizon/index.js +78 -0
- package/lib/no-axios/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/no-axios/horizon/ledger_call_builder.js +37 -0
- package/lib/no-axios/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/no-axios/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/no-axios/horizon/offer_call_builder.d.ts +65 -0
- package/lib/no-axios/horizon/offer_call_builder.js +79 -0
- package/lib/no-axios/horizon/operation_call_builder.d.ts +69 -0
- package/lib/no-axios/horizon/operation_call_builder.js +69 -0
- package/lib/no-axios/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/no-axios/horizon/orderbook_call_builder.js +45 -0
- package/lib/no-axios/horizon/path_call_builder.d.ts +35 -0
- package/lib/no-axios/horizon/path_call_builder.js +41 -0
- package/lib/no-axios/horizon/payment_call_builder.d.ts +39 -0
- package/lib/no-axios/horizon/payment_call_builder.js +46 -0
- package/lib/no-axios/horizon/server.d.ts +389 -0
- package/lib/no-axios/horizon/server.js +550 -0
- package/lib/no-axios/horizon/server_api.d.ts +278 -0
- package/lib/no-axios/horizon/server_api.js +19 -0
- package/lib/no-axios/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/no-axios/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/no-axios/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/no-axios/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/no-axios/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/no-axios/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/no-axios/horizon/trades_call_builder.d.ts +52 -0
- package/lib/no-axios/horizon/trades_call_builder.js +72 -0
- package/lib/no-axios/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/no-axios/horizon/transaction_call_builder.js +64 -0
- package/lib/no-axios/horizon/types/account.d.ts +5 -0
- package/lib/no-axios/horizon/types/account.js +5 -0
- package/lib/no-axios/horizon/types/assets.d.ts +19 -0
- package/lib/no-axios/horizon/types/assets.js +5 -0
- package/lib/no-axios/horizon/types/effects.d.ts +285 -0
- package/lib/no-axios/horizon/types/effects.js +62 -0
- package/lib/no-axios/horizon/types/offer.d.ts +20 -0
- package/lib/no-axios/horizon/types/offer.js +5 -0
- package/lib/no-axios/horizon/types/trade.d.ts +13 -0
- package/lib/no-axios/horizon/types/trade.js +5 -0
- package/lib/no-axios/http-client/axios-client.d.ts +2 -0
- package/lib/no-axios/http-client/axios-client.js +10 -0
- package/lib/no-axios/http-client/fetch-client.d.ts +11 -0
- package/lib/no-axios/http-client/fetch-client.js +229 -0
- package/lib/no-axios/http-client/index.d.ts +5 -0
- package/lib/no-axios/http-client/index.js +33 -0
- package/lib/no-axios/http-client/types.d.ts +69 -0
- package/lib/no-axios/http-client/types.js +34 -0
- package/lib/no-axios/index.d.ts +36 -0
- package/lib/no-axios/index.js +83 -0
- package/lib/no-axios/rpc/api.d.ts +359 -0
- package/lib/no-axios/rpc/api.js +32 -0
- package/lib/no-axios/rpc/axios.d.ts +4 -0
- package/lib/no-axios/rpc/axios.js +15 -0
- package/lib/no-axios/rpc/browser.d.ts +4 -0
- package/lib/no-axios/rpc/browser.js +27 -0
- package/lib/no-axios/rpc/index.d.ts +8 -0
- package/lib/no-axios/rpc/index.js +72 -0
- package/lib/no-axios/rpc/jsonrpc.d.ts +35 -0
- package/lib/no-axios/rpc/jsonrpc.js +52 -0
- package/lib/no-axios/rpc/parsers.d.ts +39 -0
- package/lib/no-axios/rpc/parsers.js +155 -0
- package/lib/no-axios/rpc/server.d.ts +584 -0
- package/lib/no-axios/rpc/server.js +823 -0
- package/lib/no-axios/rpc/transaction.d.ts +21 -0
- package/lib/no-axios/rpc/transaction.js +53 -0
- package/lib/no-axios/rpc/utils.d.ts +1 -0
- package/lib/no-axios/rpc/utils.js +9 -0
- package/lib/no-axios/stellartoml/index.d.ts +131 -0
- package/lib/no-axios/stellartoml/index.js +77 -0
- package/lib/no-axios/utils.d.ts +19 -0
- package/lib/no-axios/utils.js +31 -0
- package/lib/no-axios/webauth/errors.d.ts +13 -0
- package/lib/no-axios/webauth/errors.js +36 -0
- package/lib/no-axios/webauth/index.d.ts +2 -0
- package/lib/no-axios/webauth/index.js +27 -0
- package/lib/no-axios/webauth/utils.d.ts +307 -0
- package/lib/no-axios/webauth/utils.js +332 -0
- package/lib/no-eventsource/browser.d.ts +6 -0
- package/lib/no-eventsource/browser.js +35 -0
- package/lib/no-eventsource/config.d.ts +64 -0
- package/lib/no-eventsource/config.js +51 -0
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +555 -0
- package/lib/no-eventsource/contract/assembled_transaction.js +752 -0
- package/lib/no-eventsource/contract/basic_node_signer.d.ts +17 -0
- package/lib/no-eventsource/contract/basic_node_signer.js +52 -0
- package/lib/no-eventsource/contract/client.d.ts +52 -0
- package/lib/no-eventsource/contract/client.js +180 -0
- package/lib/no-eventsource/contract/index.d.ts +7 -0
- package/lib/no-eventsource/contract/index.js +82 -0
- package/lib/no-eventsource/contract/rust_result.d.ts +81 -0
- package/lib/no-eventsource/contract/rust_result.js +66 -0
- package/lib/no-eventsource/contract/sent_transaction.d.ts +85 -0
- package/lib/no-eventsource/contract/sent_transaction.js +151 -0
- package/lib/no-eventsource/contract/spec.d.ts +152 -0
- package/lib/no-eventsource/contract/spec.js +1020 -0
- package/lib/no-eventsource/contract/types.d.ts +180 -0
- package/lib/no-eventsource/contract/types.js +8 -0
- package/lib/no-eventsource/contract/utils.d.ts +46 -0
- package/lib/no-eventsource/contract/utils.js +123 -0
- package/lib/no-eventsource/errors/account_requires_memo.d.ts +24 -0
- package/lib/no-eventsource/errors/account_requires_memo.js +38 -0
- package/lib/no-eventsource/errors/bad_request.d.ts +14 -0
- package/lib/no-eventsource/errors/bad_request.js +34 -0
- package/lib/no-eventsource/errors/bad_response.d.ts +17 -0
- package/lib/no-eventsource/errors/bad_response.js +34 -0
- package/lib/no-eventsource/errors/index.d.ts +5 -0
- package/lib/no-eventsource/errors/index.js +60 -0
- package/lib/no-eventsource/errors/network.d.ts +33 -0
- package/lib/no-eventsource/errors/network.js +41 -0
- package/lib/no-eventsource/errors/not_found.d.ts +14 -0
- package/lib/no-eventsource/errors/not_found.js +34 -0
- package/lib/no-eventsource/federation/api.d.ts +32 -0
- package/lib/no-eventsource/federation/api.js +7 -0
- package/lib/no-eventsource/federation/index.d.ts +2 -0
- package/lib/no-eventsource/federation/index.js +34 -0
- package/lib/no-eventsource/federation/server.d.ts +116 -0
- package/lib/no-eventsource/federation/server.js +252 -0
- package/lib/no-eventsource/friendbot/index.d.ts +5 -0
- package/lib/no-eventsource/friendbot/index.js +7 -0
- package/lib/no-eventsource/horizon/account_call_builder.d.ts +56 -0
- package/lib/no-eventsource/horizon/account_call_builder.js +62 -0
- package/lib/no-eventsource/horizon/account_response.d.ts +61 -0
- package/lib/no-eventsource/horizon/account_response.js +49 -0
- package/lib/no-eventsource/horizon/assets_call_builder.d.ts +27 -0
- package/lib/no-eventsource/horizon/assets_call_builder.js +43 -0
- package/lib/no-eventsource/horizon/call_builder.d.ts +128 -0
- package/lib/no-eventsource/horizon/call_builder.js +362 -0
- package/lib/no-eventsource/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/no-eventsource/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/no-eventsource/horizon/effect_call_builder.d.ts +53 -0
- package/lib/no-eventsource/horizon/effect_call_builder.js +56 -0
- package/lib/no-eventsource/horizon/friendbot_builder.d.ts +4 -0
- package/lib/no-eventsource/horizon/friendbot_builder.js +32 -0
- package/lib/no-eventsource/horizon/horizon_api.d.ts +527 -0
- package/lib/no-eventsource/horizon/horizon_api.js +96 -0
- package/lib/no-eventsource/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/no-eventsource/horizon/horizon_axios_client.js +60 -0
- package/lib/no-eventsource/horizon/index.d.ts +8 -0
- package/lib/no-eventsource/horizon/index.js +78 -0
- package/lib/no-eventsource/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/no-eventsource/horizon/ledger_call_builder.js +37 -0
- package/lib/no-eventsource/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/no-eventsource/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/no-eventsource/horizon/offer_call_builder.d.ts +65 -0
- package/lib/no-eventsource/horizon/offer_call_builder.js +79 -0
- package/lib/no-eventsource/horizon/operation_call_builder.d.ts +69 -0
- package/lib/no-eventsource/horizon/operation_call_builder.js +69 -0
- package/lib/no-eventsource/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/no-eventsource/horizon/orderbook_call_builder.js +45 -0
- package/lib/no-eventsource/horizon/path_call_builder.d.ts +35 -0
- package/lib/no-eventsource/horizon/path_call_builder.js +41 -0
- package/lib/no-eventsource/horizon/payment_call_builder.d.ts +39 -0
- package/lib/no-eventsource/horizon/payment_call_builder.js +46 -0
- package/lib/no-eventsource/horizon/server.d.ts +389 -0
- package/lib/no-eventsource/horizon/server.js +550 -0
- package/lib/no-eventsource/horizon/server_api.d.ts +278 -0
- package/lib/no-eventsource/horizon/server_api.js +19 -0
- package/lib/no-eventsource/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/no-eventsource/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/no-eventsource/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/no-eventsource/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/no-eventsource/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/no-eventsource/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/no-eventsource/horizon/trades_call_builder.d.ts +52 -0
- package/lib/no-eventsource/horizon/trades_call_builder.js +72 -0
- package/lib/no-eventsource/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/no-eventsource/horizon/transaction_call_builder.js +64 -0
- package/lib/no-eventsource/horizon/types/account.d.ts +5 -0
- package/lib/no-eventsource/horizon/types/account.js +5 -0
- package/lib/no-eventsource/horizon/types/assets.d.ts +19 -0
- package/lib/no-eventsource/horizon/types/assets.js +5 -0
- package/lib/no-eventsource/horizon/types/effects.d.ts +285 -0
- package/lib/no-eventsource/horizon/types/effects.js +62 -0
- package/lib/no-eventsource/horizon/types/offer.d.ts +20 -0
- package/lib/no-eventsource/horizon/types/offer.js +5 -0
- package/lib/no-eventsource/horizon/types/trade.d.ts +13 -0
- package/lib/no-eventsource/horizon/types/trade.js +5 -0
- package/lib/no-eventsource/http-client/axios-client.d.ts +2 -0
- package/lib/no-eventsource/http-client/axios-client.js +10 -0
- package/lib/no-eventsource/http-client/fetch-client.d.ts +11 -0
- package/lib/no-eventsource/http-client/fetch-client.js +229 -0
- package/lib/no-eventsource/http-client/index.d.ts +5 -0
- package/lib/no-eventsource/http-client/index.js +33 -0
- package/lib/no-eventsource/http-client/types.d.ts +69 -0
- package/lib/no-eventsource/http-client/types.js +34 -0
- package/lib/no-eventsource/index.d.ts +36 -0
- package/lib/no-eventsource/index.js +83 -0
- package/lib/no-eventsource/rpc/api.d.ts +359 -0
- package/lib/no-eventsource/rpc/api.js +32 -0
- package/lib/no-eventsource/rpc/axios.d.ts +4 -0
- package/lib/no-eventsource/rpc/axios.js +15 -0
- package/lib/no-eventsource/rpc/browser.d.ts +4 -0
- package/lib/no-eventsource/rpc/browser.js +27 -0
- package/lib/no-eventsource/rpc/index.d.ts +8 -0
- package/lib/no-eventsource/rpc/index.js +72 -0
- package/lib/no-eventsource/rpc/jsonrpc.d.ts +35 -0
- package/lib/no-eventsource/rpc/jsonrpc.js +52 -0
- package/lib/no-eventsource/rpc/parsers.d.ts +39 -0
- package/lib/no-eventsource/rpc/parsers.js +155 -0
- package/lib/no-eventsource/rpc/server.d.ts +584 -0
- package/lib/no-eventsource/rpc/server.js +823 -0
- package/lib/no-eventsource/rpc/transaction.d.ts +21 -0
- package/lib/no-eventsource/rpc/transaction.js +53 -0
- package/lib/no-eventsource/rpc/utils.d.ts +1 -0
- package/lib/no-eventsource/rpc/utils.js +9 -0
- package/lib/no-eventsource/stellartoml/index.d.ts +131 -0
- package/lib/no-eventsource/stellartoml/index.js +77 -0
- package/lib/no-eventsource/utils.d.ts +19 -0
- package/lib/no-eventsource/utils.js +31 -0
- package/lib/no-eventsource/webauth/errors.d.ts +13 -0
- package/lib/no-eventsource/webauth/errors.js +36 -0
- package/lib/no-eventsource/webauth/index.d.ts +2 -0
- package/lib/no-eventsource/webauth/index.js +27 -0
- package/lib/no-eventsource/webauth/utils.d.ts +307 -0
- package/lib/no-eventsource/webauth/utils.js +332 -0
- package/lib/rpc/api.d.ts +13 -2
- package/lib/rpc/axios.d.ts +3 -2
- package/lib/rpc/axios.js +3 -4
- package/lib/rpc/browser.d.ts +0 -2
- package/lib/rpc/browser.js +1 -11
- package/lib/rpc/index.d.ts +2 -1
- package/lib/rpc/index.js +1 -1
- package/lib/rpc/jsonrpc.d.ts +9 -1
- package/lib/rpc/parsers.d.ts +30 -10
- package/lib/rpc/parsers.js +11 -11
- package/lib/rpc/server.d.ts +169 -99
- package/lib/rpc/server.js +92 -6
- package/lib/rpc/transaction.d.ts +11 -9
- package/lib/stellartoml/index.d.ts +21 -11
- package/lib/stellartoml/index.js +3 -3
- package/lib/utils.d.ts +11 -4
- package/lib/webauth/errors.d.ts +9 -0
- package/lib/webauth/utils.d.ts +67 -54
- package/package.json +59 -7
- package/lib/errors.d.ts +0 -59
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
import { AssetType, MemoType } from "@stellar/stellar-base";
|
|
2
|
+
export declare namespace HorizonApi {
|
|
3
|
+
interface ResponseLink {
|
|
4
|
+
href: string;
|
|
5
|
+
templated?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface BaseResponse<T extends string = never> {
|
|
8
|
+
_links: {
|
|
9
|
+
[key in T | "self"]: ResponseLink;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
interface SubmitTransactionResponse {
|
|
13
|
+
hash: string;
|
|
14
|
+
ledger: number;
|
|
15
|
+
successful: boolean;
|
|
16
|
+
envelope_xdr: string;
|
|
17
|
+
result_xdr: string;
|
|
18
|
+
result_meta_xdr: string;
|
|
19
|
+
paging_token: string;
|
|
20
|
+
}
|
|
21
|
+
interface SubmitAsyncTransactionResponse {
|
|
22
|
+
hash: string;
|
|
23
|
+
tx_status: string;
|
|
24
|
+
error_result_xdr: string;
|
|
25
|
+
}
|
|
26
|
+
interface FeeBumpTransactionResponse {
|
|
27
|
+
hash: string;
|
|
28
|
+
signatures: string[];
|
|
29
|
+
}
|
|
30
|
+
interface InnerTransactionResponse {
|
|
31
|
+
hash: string;
|
|
32
|
+
signatures: string[];
|
|
33
|
+
max_fee: string;
|
|
34
|
+
}
|
|
35
|
+
interface TransactionPreconditions {
|
|
36
|
+
timebounds?: {
|
|
37
|
+
min_time: string;
|
|
38
|
+
max_time: string;
|
|
39
|
+
};
|
|
40
|
+
ledgerbounds?: {
|
|
41
|
+
min_ledger: number;
|
|
42
|
+
max_ledger: number;
|
|
43
|
+
};
|
|
44
|
+
min_account_sequence?: string;
|
|
45
|
+
min_account_sequence_age?: string;
|
|
46
|
+
min_account_sequence_ledger_gap?: number;
|
|
47
|
+
extra_signers?: string[];
|
|
48
|
+
}
|
|
49
|
+
interface TransactionResponse extends SubmitTransactionResponse, BaseResponse<"account" | "ledger" | "operations" | "effects" | "succeeds" | "precedes"> {
|
|
50
|
+
created_at: string;
|
|
51
|
+
fee_meta_xdr: string;
|
|
52
|
+
fee_charged: number | string;
|
|
53
|
+
max_fee: number | string;
|
|
54
|
+
id: string;
|
|
55
|
+
memo_type: MemoType;
|
|
56
|
+
memo?: string;
|
|
57
|
+
memo_bytes?: string;
|
|
58
|
+
operation_count: number;
|
|
59
|
+
paging_token: string;
|
|
60
|
+
signatures: string[];
|
|
61
|
+
source_account: string;
|
|
62
|
+
source_account_sequence: string;
|
|
63
|
+
fee_account: string;
|
|
64
|
+
inner_transaction?: InnerTransactionResponse;
|
|
65
|
+
fee_bump_transaction?: FeeBumpTransactionResponse;
|
|
66
|
+
preconditions?: TransactionPreconditions;
|
|
67
|
+
}
|
|
68
|
+
interface BalanceLineNative {
|
|
69
|
+
balance: string;
|
|
70
|
+
asset_type: AssetType.native;
|
|
71
|
+
buying_liabilities: string;
|
|
72
|
+
selling_liabilities: string;
|
|
73
|
+
}
|
|
74
|
+
interface BalanceLineLiquidityPool {
|
|
75
|
+
liquidity_pool_id: string;
|
|
76
|
+
asset_type: AssetType.liquidityPoolShares;
|
|
77
|
+
balance: string;
|
|
78
|
+
limit: string;
|
|
79
|
+
last_modified_ledger: number;
|
|
80
|
+
is_authorized: boolean;
|
|
81
|
+
is_authorized_to_maintain_liabilities: boolean;
|
|
82
|
+
is_clawback_enabled: boolean;
|
|
83
|
+
sponsor?: string;
|
|
84
|
+
}
|
|
85
|
+
interface BalanceLineAsset<T extends AssetType.credit4 | AssetType.credit12 = AssetType.credit4 | AssetType.credit12> {
|
|
86
|
+
balance: string;
|
|
87
|
+
limit: string;
|
|
88
|
+
asset_type: T;
|
|
89
|
+
asset_code: string;
|
|
90
|
+
asset_issuer: string;
|
|
91
|
+
buying_liabilities: string;
|
|
92
|
+
selling_liabilities: string;
|
|
93
|
+
last_modified_ledger: number;
|
|
94
|
+
is_authorized: boolean;
|
|
95
|
+
is_authorized_to_maintain_liabilities: boolean;
|
|
96
|
+
is_clawback_enabled: boolean;
|
|
97
|
+
sponsor?: string;
|
|
98
|
+
}
|
|
99
|
+
type BalanceLine<T extends AssetType = AssetType> = T extends AssetType.native ? BalanceLineNative : T extends AssetType.credit4 | AssetType.credit12 ? BalanceLineAsset<T> : T extends AssetType.liquidityPoolShares ? BalanceLineLiquidityPool : BalanceLineNative | BalanceLineAsset | BalanceLineLiquidityPool;
|
|
100
|
+
interface AssetAccounts {
|
|
101
|
+
authorized: number;
|
|
102
|
+
authorized_to_maintain_liabilities: number;
|
|
103
|
+
unauthorized: number;
|
|
104
|
+
}
|
|
105
|
+
interface AssetBalances {
|
|
106
|
+
authorized: string;
|
|
107
|
+
authorized_to_maintain_liabilities: string;
|
|
108
|
+
unauthorized: string;
|
|
109
|
+
}
|
|
110
|
+
interface PriceR {
|
|
111
|
+
numerator: number;
|
|
112
|
+
denominator: number;
|
|
113
|
+
}
|
|
114
|
+
interface PriceRShorthand {
|
|
115
|
+
n: number;
|
|
116
|
+
d: number;
|
|
117
|
+
}
|
|
118
|
+
interface AccountThresholds {
|
|
119
|
+
low_threshold: number;
|
|
120
|
+
med_threshold: number;
|
|
121
|
+
high_threshold: number;
|
|
122
|
+
}
|
|
123
|
+
interface Flags {
|
|
124
|
+
auth_immutable: boolean;
|
|
125
|
+
auth_required: boolean;
|
|
126
|
+
auth_revocable: boolean;
|
|
127
|
+
auth_clawback_enabled: boolean;
|
|
128
|
+
}
|
|
129
|
+
interface AccountSigner {
|
|
130
|
+
key: string;
|
|
131
|
+
weight: number;
|
|
132
|
+
type: string;
|
|
133
|
+
sponsor?: string;
|
|
134
|
+
}
|
|
135
|
+
interface AccountResponse extends BaseResponse<"transactions" | "operations" | "payments" | "effects" | "offers" | "trades" | "data"> {
|
|
136
|
+
id: string;
|
|
137
|
+
paging_token: string;
|
|
138
|
+
account_id: string;
|
|
139
|
+
sequence: string;
|
|
140
|
+
sequence_ledger?: number;
|
|
141
|
+
sequence_time?: string;
|
|
142
|
+
subentry_count: number;
|
|
143
|
+
thresholds: AccountThresholds;
|
|
144
|
+
last_modified_ledger: number;
|
|
145
|
+
last_modified_time: string;
|
|
146
|
+
flags: Flags;
|
|
147
|
+
balances: BalanceLine[];
|
|
148
|
+
signers: AccountSigner[];
|
|
149
|
+
data: {
|
|
150
|
+
[key: string]: string;
|
|
151
|
+
};
|
|
152
|
+
sponsor?: string;
|
|
153
|
+
num_sponsoring: number;
|
|
154
|
+
num_sponsored: number;
|
|
155
|
+
}
|
|
156
|
+
enum LiquidityPoolType {
|
|
157
|
+
constantProduct = "constant_product"
|
|
158
|
+
}
|
|
159
|
+
enum OperationResponseType {
|
|
160
|
+
createAccount = "create_account",
|
|
161
|
+
payment = "payment",
|
|
162
|
+
pathPayment = "path_payment_strict_receive",
|
|
163
|
+
createPassiveOffer = "create_passive_sell_offer",
|
|
164
|
+
manageOffer = "manage_sell_offer",
|
|
165
|
+
setOptions = "set_options",
|
|
166
|
+
changeTrust = "change_trust",
|
|
167
|
+
allowTrust = "allow_trust",
|
|
168
|
+
accountMerge = "account_merge",
|
|
169
|
+
inflation = "inflation",
|
|
170
|
+
manageData = "manage_data",
|
|
171
|
+
bumpSequence = "bump_sequence",
|
|
172
|
+
manageBuyOffer = "manage_buy_offer",
|
|
173
|
+
pathPaymentStrictSend = "path_payment_strict_send",
|
|
174
|
+
createClaimableBalance = "create_claimable_balance",
|
|
175
|
+
claimClaimableBalance = "claim_claimable_balance",
|
|
176
|
+
beginSponsoringFutureReserves = "begin_sponsoring_future_reserves",
|
|
177
|
+
endSponsoringFutureReserves = "end_sponsoring_future_reserves",
|
|
178
|
+
revokeSponsorship = "revoke_sponsorship",
|
|
179
|
+
clawback = "clawback",
|
|
180
|
+
clawbackClaimableBalance = "clawback_claimable_balance",
|
|
181
|
+
setTrustLineFlags = "set_trust_line_flags",
|
|
182
|
+
liquidityPoolDeposit = "liquidity_pool_deposit",
|
|
183
|
+
liquidityPoolWithdraw = "liquidity_pool_withdraw",
|
|
184
|
+
invokeHostFunction = "invoke_host_function",
|
|
185
|
+
bumpFootprintExpiration = "bump_footprint_expiration",
|
|
186
|
+
restoreFootprint = "restore_footprint"
|
|
187
|
+
}
|
|
188
|
+
enum OperationResponseTypeI {
|
|
189
|
+
createAccount = 0,
|
|
190
|
+
payment = 1,
|
|
191
|
+
pathPayment = 2,
|
|
192
|
+
createPassiveOffer = 3,
|
|
193
|
+
manageOffer = 4,
|
|
194
|
+
setOptions = 5,
|
|
195
|
+
changeTrust = 6,
|
|
196
|
+
allowTrust = 7,
|
|
197
|
+
accountMerge = 8,
|
|
198
|
+
inflation = 9,
|
|
199
|
+
manageData = 10,
|
|
200
|
+
bumpSequence = 11,
|
|
201
|
+
manageBuyOffer = 12,
|
|
202
|
+
pathPaymentStrictSend = 13,
|
|
203
|
+
createClaimableBalance = 14,
|
|
204
|
+
claimClaimableBalance = 15,
|
|
205
|
+
beginSponsoringFutureReserves = 16,
|
|
206
|
+
endSponsoringFutureReserves = 17,
|
|
207
|
+
revokeSponsorship = 18,
|
|
208
|
+
clawback = 19,
|
|
209
|
+
clawbackClaimableBalance = 20,
|
|
210
|
+
setTrustLineFlags = 21,
|
|
211
|
+
liquidityPoolDeposit = 22,
|
|
212
|
+
liquidityPoolWithdraw = 23,
|
|
213
|
+
invokeHostFunction = 24,
|
|
214
|
+
bumpFootprintExpiration = 25,
|
|
215
|
+
restoreFootprint = 26
|
|
216
|
+
}
|
|
217
|
+
interface BaseOperationResponse<T extends OperationResponseType = OperationResponseType, TI extends OperationResponseTypeI = OperationResponseTypeI> extends BaseResponse<"succeeds" | "precedes" | "effects" | "transaction"> {
|
|
218
|
+
id: string;
|
|
219
|
+
paging_token: string;
|
|
220
|
+
source_account: string;
|
|
221
|
+
type: T;
|
|
222
|
+
type_i: TI;
|
|
223
|
+
created_at: string;
|
|
224
|
+
transaction_hash: string;
|
|
225
|
+
transaction_successful: boolean;
|
|
226
|
+
}
|
|
227
|
+
interface CreateAccountOperationResponse extends BaseOperationResponse<OperationResponseType.createAccount, OperationResponseTypeI.createAccount> {
|
|
228
|
+
account: string;
|
|
229
|
+
funder: string;
|
|
230
|
+
starting_balance: string;
|
|
231
|
+
}
|
|
232
|
+
interface PaymentOperationResponse extends BaseOperationResponse<OperationResponseType.payment, OperationResponseTypeI.payment> {
|
|
233
|
+
from: string;
|
|
234
|
+
to: string;
|
|
235
|
+
asset_type: AssetType;
|
|
236
|
+
asset_code?: string;
|
|
237
|
+
asset_issuer?: string;
|
|
238
|
+
amount: string;
|
|
239
|
+
}
|
|
240
|
+
interface PathPaymentOperationResponse extends BaseOperationResponse<OperationResponseType.pathPayment, OperationResponseTypeI.pathPayment> {
|
|
241
|
+
amount: string;
|
|
242
|
+
asset_code?: string;
|
|
243
|
+
asset_issuer?: string;
|
|
244
|
+
asset_type: AssetType;
|
|
245
|
+
from: string;
|
|
246
|
+
path: Array<{
|
|
247
|
+
asset_code: string;
|
|
248
|
+
asset_issuer: string;
|
|
249
|
+
asset_type: AssetType;
|
|
250
|
+
}>;
|
|
251
|
+
source_amount: string;
|
|
252
|
+
source_asset_code?: string;
|
|
253
|
+
source_asset_issuer?: string;
|
|
254
|
+
source_asset_type: AssetType;
|
|
255
|
+
source_max: string;
|
|
256
|
+
to: string;
|
|
257
|
+
}
|
|
258
|
+
interface PathPaymentStrictSendOperationResponse extends BaseOperationResponse<OperationResponseType.pathPaymentStrictSend, OperationResponseTypeI.pathPaymentStrictSend> {
|
|
259
|
+
amount: string;
|
|
260
|
+
asset_code?: string;
|
|
261
|
+
asset_issuer?: string;
|
|
262
|
+
asset_type: AssetType;
|
|
263
|
+
destination_min: string;
|
|
264
|
+
from: string;
|
|
265
|
+
path: Array<{
|
|
266
|
+
asset_code: string;
|
|
267
|
+
asset_issuer: string;
|
|
268
|
+
asset_type: AssetType;
|
|
269
|
+
}>;
|
|
270
|
+
source_amount: string;
|
|
271
|
+
source_asset_code?: string;
|
|
272
|
+
source_asset_issuer?: string;
|
|
273
|
+
source_asset_type: AssetType;
|
|
274
|
+
to: string;
|
|
275
|
+
}
|
|
276
|
+
interface ManageOfferOperationResponse extends BaseOperationResponse<OperationResponseType.manageOffer, OperationResponseTypeI.manageOffer> {
|
|
277
|
+
offer_id: number | string;
|
|
278
|
+
amount: string;
|
|
279
|
+
buying_asset_type: AssetType;
|
|
280
|
+
buying_asset_code?: string;
|
|
281
|
+
buying_asset_issuer?: string;
|
|
282
|
+
price: string;
|
|
283
|
+
price_r: PriceR;
|
|
284
|
+
selling_asset_type: AssetType;
|
|
285
|
+
selling_asset_code?: string;
|
|
286
|
+
selling_asset_issuer?: string;
|
|
287
|
+
}
|
|
288
|
+
interface PassiveOfferOperationResponse extends BaseOperationResponse<OperationResponseType.createPassiveOffer, OperationResponseTypeI.createPassiveOffer> {
|
|
289
|
+
offer_id: number | string;
|
|
290
|
+
amount: string;
|
|
291
|
+
buying_asset_type: AssetType;
|
|
292
|
+
buying_asset_code?: string;
|
|
293
|
+
buying_asset_issuer?: string;
|
|
294
|
+
price: string;
|
|
295
|
+
price_r: PriceR;
|
|
296
|
+
selling_asset_type: AssetType;
|
|
297
|
+
selling_asset_code?: string;
|
|
298
|
+
selling_asset_issuer?: string;
|
|
299
|
+
}
|
|
300
|
+
interface SetOptionsOperationResponse extends BaseOperationResponse<OperationResponseType.setOptions, OperationResponseTypeI.setOptions> {
|
|
301
|
+
signer_key?: string;
|
|
302
|
+
signer_weight?: number;
|
|
303
|
+
master_key_weight?: number;
|
|
304
|
+
low_threshold?: number;
|
|
305
|
+
med_threshold?: number;
|
|
306
|
+
high_threshold?: number;
|
|
307
|
+
home_domain?: string;
|
|
308
|
+
set_flags: Array<1 | 2 | 4>;
|
|
309
|
+
set_flags_s: Array<"auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag">;
|
|
310
|
+
clear_flags: Array<1 | 2 | 4>;
|
|
311
|
+
clear_flags_s: Array<"auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag">;
|
|
312
|
+
}
|
|
313
|
+
interface ChangeTrustOperationResponse extends BaseOperationResponse<OperationResponseType.changeTrust, OperationResponseTypeI.changeTrust> {
|
|
314
|
+
asset_type: AssetType.credit4 | AssetType.credit12 | AssetType.liquidityPoolShares;
|
|
315
|
+
asset_code?: string;
|
|
316
|
+
asset_issuer?: string;
|
|
317
|
+
liquidity_pool_id?: string;
|
|
318
|
+
trustee?: string;
|
|
319
|
+
trustor: string;
|
|
320
|
+
limit: string;
|
|
321
|
+
}
|
|
322
|
+
interface AllowTrustOperationResponse extends BaseOperationResponse<OperationResponseType.allowTrust, OperationResponseTypeI.allowTrust> {
|
|
323
|
+
asset_type: AssetType;
|
|
324
|
+
asset_code: string;
|
|
325
|
+
asset_issuer: string;
|
|
326
|
+
authorize: boolean;
|
|
327
|
+
authorize_to_maintain_liabilities: boolean;
|
|
328
|
+
trustee: string;
|
|
329
|
+
trustor: string;
|
|
330
|
+
}
|
|
331
|
+
interface AccountMergeOperationResponse extends BaseOperationResponse<OperationResponseType.accountMerge, OperationResponseTypeI.accountMerge> {
|
|
332
|
+
into: string;
|
|
333
|
+
}
|
|
334
|
+
interface InflationOperationResponse extends BaseOperationResponse<OperationResponseType.inflation, OperationResponseTypeI.inflation> {
|
|
335
|
+
}
|
|
336
|
+
interface ManageDataOperationResponse extends BaseOperationResponse<OperationResponseType.manageData, OperationResponseTypeI.manageData> {
|
|
337
|
+
name: string;
|
|
338
|
+
value: Buffer;
|
|
339
|
+
}
|
|
340
|
+
interface BumpSequenceOperationResponse extends BaseOperationResponse<OperationResponseType.bumpSequence, OperationResponseTypeI.bumpSequence> {
|
|
341
|
+
bump_to: string;
|
|
342
|
+
}
|
|
343
|
+
interface Predicate {
|
|
344
|
+
and?: Predicate[];
|
|
345
|
+
or?: Predicate[];
|
|
346
|
+
not?: Predicate;
|
|
347
|
+
abs_before?: string;
|
|
348
|
+
rel_before?: string;
|
|
349
|
+
}
|
|
350
|
+
interface Claimant {
|
|
351
|
+
destination: string;
|
|
352
|
+
predicate: Predicate;
|
|
353
|
+
}
|
|
354
|
+
interface CreateClaimableBalanceOperationResponse extends BaseOperationResponse<OperationResponseType.createClaimableBalance, OperationResponseTypeI.createClaimableBalance> {
|
|
355
|
+
asset: string;
|
|
356
|
+
amount: string;
|
|
357
|
+
sponsor: string;
|
|
358
|
+
claimants: Claimant[];
|
|
359
|
+
}
|
|
360
|
+
interface ClaimClaimableBalanceOperationResponse extends BaseOperationResponse<OperationResponseType.claimClaimableBalance, OperationResponseTypeI.claimClaimableBalance> {
|
|
361
|
+
balance_id: string;
|
|
362
|
+
claimant: string;
|
|
363
|
+
}
|
|
364
|
+
interface BeginSponsoringFutureReservesOperationResponse extends BaseOperationResponse<OperationResponseType.beginSponsoringFutureReserves, OperationResponseTypeI.beginSponsoringFutureReserves> {
|
|
365
|
+
sponsored_id: string;
|
|
366
|
+
}
|
|
367
|
+
interface EndSponsoringFutureReservesOperationResponse extends BaseOperationResponse<OperationResponseType.endSponsoringFutureReserves, OperationResponseTypeI.endSponsoringFutureReserves> {
|
|
368
|
+
begin_sponsor: string;
|
|
369
|
+
}
|
|
370
|
+
interface RevokeSponsorshipOperationResponse extends BaseOperationResponse<OperationResponseType.revokeSponsorship, OperationResponseTypeI.revokeSponsorship> {
|
|
371
|
+
account_id?: string;
|
|
372
|
+
claimable_balance_id?: string;
|
|
373
|
+
data_account_id?: string;
|
|
374
|
+
data_name?: string;
|
|
375
|
+
offer_id?: string;
|
|
376
|
+
trustline_account_id?: string;
|
|
377
|
+
trustline_asset?: string;
|
|
378
|
+
trustline_liquidity_pool_id?: string;
|
|
379
|
+
signer_account_id?: string;
|
|
380
|
+
signer_key?: string;
|
|
381
|
+
}
|
|
382
|
+
interface ClawbackOperationResponse extends BaseOperationResponse<OperationResponseType.clawback, OperationResponseTypeI.clawback> {
|
|
383
|
+
asset_type: AssetType;
|
|
384
|
+
asset_code: string;
|
|
385
|
+
asset_issuer: string;
|
|
386
|
+
from: string;
|
|
387
|
+
amount: string;
|
|
388
|
+
}
|
|
389
|
+
interface ClawbackClaimableBalanceOperationResponse extends BaseOperationResponse<OperationResponseType.clawbackClaimableBalance, OperationResponseTypeI.clawbackClaimableBalance> {
|
|
390
|
+
balance_id: string;
|
|
391
|
+
}
|
|
392
|
+
interface SetTrustLineFlagsOperationResponse extends BaseOperationResponse<OperationResponseType.setTrustLineFlags, OperationResponseTypeI.setTrustLineFlags> {
|
|
393
|
+
asset_type: AssetType;
|
|
394
|
+
asset_code: string;
|
|
395
|
+
asset_issuer: string;
|
|
396
|
+
trustor: string;
|
|
397
|
+
set_flags: Array<1 | 2 | 4>;
|
|
398
|
+
clear_flags: Array<1 | 2 | 4>;
|
|
399
|
+
}
|
|
400
|
+
interface Reserve {
|
|
401
|
+
asset: string;
|
|
402
|
+
amount: string;
|
|
403
|
+
}
|
|
404
|
+
interface DepositLiquidityOperationResponse extends BaseOperationResponse<OperationResponseType.liquidityPoolDeposit, OperationResponseTypeI.liquidityPoolDeposit> {
|
|
405
|
+
liquidity_pool_id: string;
|
|
406
|
+
reserves_max: Reserve[];
|
|
407
|
+
min_price: string;
|
|
408
|
+
min_price_r: PriceRShorthand;
|
|
409
|
+
max_price: string;
|
|
410
|
+
max_price_r: PriceRShorthand;
|
|
411
|
+
reserves_deposited: Reserve[];
|
|
412
|
+
shares_received: string;
|
|
413
|
+
}
|
|
414
|
+
interface WithdrawLiquidityOperationResponse extends BaseOperationResponse<OperationResponseType.liquidityPoolWithdraw, OperationResponseTypeI.liquidityPoolWithdraw> {
|
|
415
|
+
liquidity_pool_id: string;
|
|
416
|
+
reserves_min: Reserve[];
|
|
417
|
+
shares: string;
|
|
418
|
+
reserves_received: Reserve[];
|
|
419
|
+
}
|
|
420
|
+
interface BalanceChange {
|
|
421
|
+
asset_type: string;
|
|
422
|
+
asset_code?: string;
|
|
423
|
+
asset_issuer?: string;
|
|
424
|
+
type: string;
|
|
425
|
+
from: string;
|
|
426
|
+
to: string;
|
|
427
|
+
amount: string;
|
|
428
|
+
}
|
|
429
|
+
interface InvokeHostFunctionOperationResponse extends BaseOperationResponse<OperationResponseType.invokeHostFunction, OperationResponseTypeI.invokeHostFunction> {
|
|
430
|
+
function: string;
|
|
431
|
+
parameters: {
|
|
432
|
+
value: string;
|
|
433
|
+
type: string;
|
|
434
|
+
}[];
|
|
435
|
+
address: string;
|
|
436
|
+
salt: string;
|
|
437
|
+
asset_balance_changes: BalanceChange[];
|
|
438
|
+
}
|
|
439
|
+
interface BumpFootprintExpirationOperationResponse extends BaseOperationResponse<OperationResponseType.bumpFootprintExpiration, OperationResponseTypeI.bumpFootprintExpiration> {
|
|
440
|
+
ledgers_to_expire: number;
|
|
441
|
+
}
|
|
442
|
+
interface RestoreFootprintOperationResponse extends BaseOperationResponse<OperationResponseType.restoreFootprint, OperationResponseTypeI.restoreFootprint> {
|
|
443
|
+
}
|
|
444
|
+
interface ResponseCollection<T extends BaseResponse = BaseResponse> {
|
|
445
|
+
_links: {
|
|
446
|
+
self: ResponseLink;
|
|
447
|
+
next: ResponseLink;
|
|
448
|
+
prev: ResponseLink;
|
|
449
|
+
};
|
|
450
|
+
_embedded: {
|
|
451
|
+
records: T[];
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
interface TransactionResponseCollection extends ResponseCollection<TransactionResponse> {
|
|
455
|
+
}
|
|
456
|
+
interface FeeDistribution {
|
|
457
|
+
max: string;
|
|
458
|
+
min: string;
|
|
459
|
+
mode: string;
|
|
460
|
+
p10: string;
|
|
461
|
+
p20: string;
|
|
462
|
+
p30: string;
|
|
463
|
+
p40: string;
|
|
464
|
+
p50: string;
|
|
465
|
+
p60: string;
|
|
466
|
+
p70: string;
|
|
467
|
+
p80: string;
|
|
468
|
+
p90: string;
|
|
469
|
+
p95: string;
|
|
470
|
+
p99: string;
|
|
471
|
+
}
|
|
472
|
+
interface FeeStatsResponse {
|
|
473
|
+
last_ledger: string;
|
|
474
|
+
last_ledger_base_fee: string;
|
|
475
|
+
ledger_capacity_usage: string;
|
|
476
|
+
fee_charged: FeeDistribution;
|
|
477
|
+
max_fee: FeeDistribution;
|
|
478
|
+
}
|
|
479
|
+
type ErrorResponseData = ErrorResponseData.RateLimitExceeded | ErrorResponseData.InternalServerError | ErrorResponseData.TransactionFailed;
|
|
480
|
+
namespace ErrorResponseData {
|
|
481
|
+
interface Base {
|
|
482
|
+
status: number;
|
|
483
|
+
title: string;
|
|
484
|
+
type: string;
|
|
485
|
+
details: string;
|
|
486
|
+
instance: string;
|
|
487
|
+
}
|
|
488
|
+
interface RateLimitExceeded extends Base {
|
|
489
|
+
status: 429;
|
|
490
|
+
title: "Rate Limit Exceeded";
|
|
491
|
+
}
|
|
492
|
+
interface InternalServerError extends Base {
|
|
493
|
+
status: 500;
|
|
494
|
+
title: "Internal Server Error";
|
|
495
|
+
}
|
|
496
|
+
interface TransactionFailed extends Base {
|
|
497
|
+
status: 400;
|
|
498
|
+
title: "Transaction Failed";
|
|
499
|
+
extras: TransactionFailedExtras;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
enum TransactionFailedResultCodes {
|
|
503
|
+
TX_FAILED = "tx_failed",
|
|
504
|
+
TX_BAD_SEQ = "tx_bad_seq",
|
|
505
|
+
TX_BAD_AUTH = "tx_bad_auth",
|
|
506
|
+
TX_BAD_AUTH_EXTRA = "tx_bad_auth_extra",
|
|
507
|
+
TX_FEE_BUMP_INNER_SUCCESS = "tx_fee_bump_inner_success",
|
|
508
|
+
TX_FEE_BUMP_INNER_FAILED = "tx_fee_bump_inner_failed",
|
|
509
|
+
TX_NOT_SUPPORTED = "tx_not_supported",
|
|
510
|
+
TX_SUCCESS = "tx_success",
|
|
511
|
+
TX_TOO_EARLY = "tx_too_early",
|
|
512
|
+
TX_TOO_LATE = "tx_too_late",
|
|
513
|
+
TX_MISSING_OPERATION = "tx_missing_operation",
|
|
514
|
+
TX_INSUFFICIENT_BALANCE = "tx_insufficient_balance",
|
|
515
|
+
TX_NO_SOURCE_ACCOUNT = "tx_no_source_account",
|
|
516
|
+
TX_INSUFFICIENT_FEE = "tx_insufficient_fee",
|
|
517
|
+
TX_INTERNAL_ERROR = "tx_internal_error"
|
|
518
|
+
}
|
|
519
|
+
interface TransactionFailedExtras {
|
|
520
|
+
envelope_xdr: string;
|
|
521
|
+
result_codes: {
|
|
522
|
+
transaction: TransactionFailedResultCodes;
|
|
523
|
+
operations: string[];
|
|
524
|
+
};
|
|
525
|
+
result_xdr: string;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.HorizonApi = void 0;
|
|
7
|
+
var HorizonApi;
|
|
8
|
+
(function (_HorizonApi) {
|
|
9
|
+
var LiquidityPoolType = function (LiquidityPoolType) {
|
|
10
|
+
LiquidityPoolType["constantProduct"] = "constant_product";
|
|
11
|
+
return LiquidityPoolType;
|
|
12
|
+
}({});
|
|
13
|
+
_HorizonApi.LiquidityPoolType = LiquidityPoolType;
|
|
14
|
+
var OperationResponseType = function (OperationResponseType) {
|
|
15
|
+
OperationResponseType["createAccount"] = "create_account";
|
|
16
|
+
OperationResponseType["payment"] = "payment";
|
|
17
|
+
OperationResponseType["pathPayment"] = "path_payment_strict_receive";
|
|
18
|
+
OperationResponseType["createPassiveOffer"] = "create_passive_sell_offer";
|
|
19
|
+
OperationResponseType["manageOffer"] = "manage_sell_offer";
|
|
20
|
+
OperationResponseType["setOptions"] = "set_options";
|
|
21
|
+
OperationResponseType["changeTrust"] = "change_trust";
|
|
22
|
+
OperationResponseType["allowTrust"] = "allow_trust";
|
|
23
|
+
OperationResponseType["accountMerge"] = "account_merge";
|
|
24
|
+
OperationResponseType["inflation"] = "inflation";
|
|
25
|
+
OperationResponseType["manageData"] = "manage_data";
|
|
26
|
+
OperationResponseType["bumpSequence"] = "bump_sequence";
|
|
27
|
+
OperationResponseType["manageBuyOffer"] = "manage_buy_offer";
|
|
28
|
+
OperationResponseType["pathPaymentStrictSend"] = "path_payment_strict_send";
|
|
29
|
+
OperationResponseType["createClaimableBalance"] = "create_claimable_balance";
|
|
30
|
+
OperationResponseType["claimClaimableBalance"] = "claim_claimable_balance";
|
|
31
|
+
OperationResponseType["beginSponsoringFutureReserves"] = "begin_sponsoring_future_reserves";
|
|
32
|
+
OperationResponseType["endSponsoringFutureReserves"] = "end_sponsoring_future_reserves";
|
|
33
|
+
OperationResponseType["revokeSponsorship"] = "revoke_sponsorship";
|
|
34
|
+
OperationResponseType["clawback"] = "clawback";
|
|
35
|
+
OperationResponseType["clawbackClaimableBalance"] = "clawback_claimable_balance";
|
|
36
|
+
OperationResponseType["setTrustLineFlags"] = "set_trust_line_flags";
|
|
37
|
+
OperationResponseType["liquidityPoolDeposit"] = "liquidity_pool_deposit";
|
|
38
|
+
OperationResponseType["liquidityPoolWithdraw"] = "liquidity_pool_withdraw";
|
|
39
|
+
OperationResponseType["invokeHostFunction"] = "invoke_host_function";
|
|
40
|
+
OperationResponseType["bumpFootprintExpiration"] = "bump_footprint_expiration";
|
|
41
|
+
OperationResponseType["restoreFootprint"] = "restore_footprint";
|
|
42
|
+
return OperationResponseType;
|
|
43
|
+
}({});
|
|
44
|
+
_HorizonApi.OperationResponseType = OperationResponseType;
|
|
45
|
+
var OperationResponseTypeI = function (OperationResponseTypeI) {
|
|
46
|
+
OperationResponseTypeI[OperationResponseTypeI["createAccount"] = 0] = "createAccount";
|
|
47
|
+
OperationResponseTypeI[OperationResponseTypeI["payment"] = 1] = "payment";
|
|
48
|
+
OperationResponseTypeI[OperationResponseTypeI["pathPayment"] = 2] = "pathPayment";
|
|
49
|
+
OperationResponseTypeI[OperationResponseTypeI["createPassiveOffer"] = 3] = "createPassiveOffer";
|
|
50
|
+
OperationResponseTypeI[OperationResponseTypeI["manageOffer"] = 4] = "manageOffer";
|
|
51
|
+
OperationResponseTypeI[OperationResponseTypeI["setOptions"] = 5] = "setOptions";
|
|
52
|
+
OperationResponseTypeI[OperationResponseTypeI["changeTrust"] = 6] = "changeTrust";
|
|
53
|
+
OperationResponseTypeI[OperationResponseTypeI["allowTrust"] = 7] = "allowTrust";
|
|
54
|
+
OperationResponseTypeI[OperationResponseTypeI["accountMerge"] = 8] = "accountMerge";
|
|
55
|
+
OperationResponseTypeI[OperationResponseTypeI["inflation"] = 9] = "inflation";
|
|
56
|
+
OperationResponseTypeI[OperationResponseTypeI["manageData"] = 10] = "manageData";
|
|
57
|
+
OperationResponseTypeI[OperationResponseTypeI["bumpSequence"] = 11] = "bumpSequence";
|
|
58
|
+
OperationResponseTypeI[OperationResponseTypeI["manageBuyOffer"] = 12] = "manageBuyOffer";
|
|
59
|
+
OperationResponseTypeI[OperationResponseTypeI["pathPaymentStrictSend"] = 13] = "pathPaymentStrictSend";
|
|
60
|
+
OperationResponseTypeI[OperationResponseTypeI["createClaimableBalance"] = 14] = "createClaimableBalance";
|
|
61
|
+
OperationResponseTypeI[OperationResponseTypeI["claimClaimableBalance"] = 15] = "claimClaimableBalance";
|
|
62
|
+
OperationResponseTypeI[OperationResponseTypeI["beginSponsoringFutureReserves"] = 16] = "beginSponsoringFutureReserves";
|
|
63
|
+
OperationResponseTypeI[OperationResponseTypeI["endSponsoringFutureReserves"] = 17] = "endSponsoringFutureReserves";
|
|
64
|
+
OperationResponseTypeI[OperationResponseTypeI["revokeSponsorship"] = 18] = "revokeSponsorship";
|
|
65
|
+
OperationResponseTypeI[OperationResponseTypeI["clawback"] = 19] = "clawback";
|
|
66
|
+
OperationResponseTypeI[OperationResponseTypeI["clawbackClaimableBalance"] = 20] = "clawbackClaimableBalance";
|
|
67
|
+
OperationResponseTypeI[OperationResponseTypeI["setTrustLineFlags"] = 21] = "setTrustLineFlags";
|
|
68
|
+
OperationResponseTypeI[OperationResponseTypeI["liquidityPoolDeposit"] = 22] = "liquidityPoolDeposit";
|
|
69
|
+
OperationResponseTypeI[OperationResponseTypeI["liquidityPoolWithdraw"] = 23] = "liquidityPoolWithdraw";
|
|
70
|
+
OperationResponseTypeI[OperationResponseTypeI["invokeHostFunction"] = 24] = "invokeHostFunction";
|
|
71
|
+
OperationResponseTypeI[OperationResponseTypeI["bumpFootprintExpiration"] = 25] = "bumpFootprintExpiration";
|
|
72
|
+
OperationResponseTypeI[OperationResponseTypeI["restoreFootprint"] = 26] = "restoreFootprint";
|
|
73
|
+
return OperationResponseTypeI;
|
|
74
|
+
}({});
|
|
75
|
+
_HorizonApi.OperationResponseTypeI = OperationResponseTypeI;
|
|
76
|
+
;
|
|
77
|
+
var TransactionFailedResultCodes = function (TransactionFailedResultCodes) {
|
|
78
|
+
TransactionFailedResultCodes["TX_FAILED"] = "tx_failed";
|
|
79
|
+
TransactionFailedResultCodes["TX_BAD_SEQ"] = "tx_bad_seq";
|
|
80
|
+
TransactionFailedResultCodes["TX_BAD_AUTH"] = "tx_bad_auth";
|
|
81
|
+
TransactionFailedResultCodes["TX_BAD_AUTH_EXTRA"] = "tx_bad_auth_extra";
|
|
82
|
+
TransactionFailedResultCodes["TX_FEE_BUMP_INNER_SUCCESS"] = "tx_fee_bump_inner_success";
|
|
83
|
+
TransactionFailedResultCodes["TX_FEE_BUMP_INNER_FAILED"] = "tx_fee_bump_inner_failed";
|
|
84
|
+
TransactionFailedResultCodes["TX_NOT_SUPPORTED"] = "tx_not_supported";
|
|
85
|
+
TransactionFailedResultCodes["TX_SUCCESS"] = "tx_success";
|
|
86
|
+
TransactionFailedResultCodes["TX_TOO_EARLY"] = "tx_too_early";
|
|
87
|
+
TransactionFailedResultCodes["TX_TOO_LATE"] = "tx_too_late";
|
|
88
|
+
TransactionFailedResultCodes["TX_MISSING_OPERATION"] = "tx_missing_operation";
|
|
89
|
+
TransactionFailedResultCodes["TX_INSUFFICIENT_BALANCE"] = "tx_insufficient_balance";
|
|
90
|
+
TransactionFailedResultCodes["TX_NO_SOURCE_ACCOUNT"] = "tx_no_source_account";
|
|
91
|
+
TransactionFailedResultCodes["TX_INSUFFICIENT_FEE"] = "tx_insufficient_fee";
|
|
92
|
+
TransactionFailedResultCodes["TX_INTERNAL_ERROR"] = "tx_internal_error";
|
|
93
|
+
return TransactionFailedResultCodes;
|
|
94
|
+
}({});
|
|
95
|
+
_HorizonApi.TransactionFailedResultCodes = TransactionFailedResultCodes;
|
|
96
|
+
})(HorizonApi || (exports.HorizonApi = HorizonApi = {}));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const version: string;
|
|
2
|
+
export interface ServerTime {
|
|
3
|
+
serverTime: number;
|
|
4
|
+
localTimeRecorded: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* keep a local map of server times
|
|
8
|
+
* (export this purely for testing purposes)
|
|
9
|
+
*
|
|
10
|
+
* each entry will map the server domain to the last-known time and the local
|
|
11
|
+
* time it was recorded, ex:
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* "horizon-testnet.stellar.org": {
|
|
15
|
+
* serverTime: 1552513039,
|
|
16
|
+
* localTimeRecorded: 1552513052
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* @constant {Record.<string, ServerTime>}
|
|
20
|
+
* @default {}
|
|
21
|
+
* @memberof module:Horizon
|
|
22
|
+
*/
|
|
23
|
+
export declare const SERVER_TIME_MAP: Record<string, ServerTime>;
|
|
24
|
+
export declare const AxiosClient: import("../http-client").HttpClient;
|
|
25
|
+
export default AxiosClient;
|
|
26
|
+
/**
|
|
27
|
+
* Given a hostname, get the current time of that server (i.e., use the last-
|
|
28
|
+
* recorded server time and offset it by the time since then.) If there IS no
|
|
29
|
+
* recorded server time, or it's been 5 minutes since the last, return null.
|
|
30
|
+
* @memberof module:Horizon
|
|
31
|
+
*
|
|
32
|
+
* @param {string} hostname Hostname of a Horizon server.
|
|
33
|
+
* @returns {number} The UNIX timestamp (in seconds, not milliseconds)
|
|
34
|
+
* representing the current time on that server, or `null` if we don't have
|
|
35
|
+
* a record of that time.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getCurrentServerTime(hostname: string): number | null;
|