@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,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SERVER_TIME_MAP = exports.AxiosClient = void 0;
|
|
7
|
+
exports.getCurrentServerTime = getCurrentServerTime;
|
|
8
|
+
exports.version = void 0;
|
|
9
|
+
var _urijs = _interopRequireDefault(require("urijs"));
|
|
10
|
+
var _httpClient = require("../http-client");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
13
|
+
var version = exports.version = "13.0.0-beta.1";
|
|
14
|
+
var SERVER_TIME_MAP = exports.SERVER_TIME_MAP = {};
|
|
15
|
+
var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
|
|
16
|
+
headers: {
|
|
17
|
+
"X-Client-Name": "js-stellar-sdk",
|
|
18
|
+
"X-Client-Version": version
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
function toSeconds(ms) {
|
|
22
|
+
return Math.floor(ms / 1000);
|
|
23
|
+
}
|
|
24
|
+
AxiosClient.interceptors.response.use(function (response) {
|
|
25
|
+
var hostname = (0, _urijs.default)(response.config.url).hostname();
|
|
26
|
+
var serverTime = 0;
|
|
27
|
+
if (response.headers instanceof Headers) {
|
|
28
|
+
var dateHeader = response.headers.get('date');
|
|
29
|
+
if (dateHeader) {
|
|
30
|
+
serverTime = toSeconds(Date.parse(dateHeader));
|
|
31
|
+
}
|
|
32
|
+
} else if (_typeof(response.headers) === 'object' && 'date' in response.headers) {
|
|
33
|
+
var headers = response.headers;
|
|
34
|
+
if (typeof headers.date === 'string') {
|
|
35
|
+
serverTime = toSeconds(Date.parse(headers.date));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
var localTimeRecorded = toSeconds(new Date().getTime());
|
|
39
|
+
if (!Number.isNaN(serverTime)) {
|
|
40
|
+
SERVER_TIME_MAP[hostname] = {
|
|
41
|
+
serverTime: serverTime,
|
|
42
|
+
localTimeRecorded: localTimeRecorded
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return response;
|
|
46
|
+
});
|
|
47
|
+
var _default = exports.default = AxiosClient;
|
|
48
|
+
function getCurrentServerTime(hostname) {
|
|
49
|
+
var entry = SERVER_TIME_MAP[hostname];
|
|
50
|
+
if (!entry || !entry.localTimeRecorded || !entry.serverTime) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
var serverTime = entry.serverTime,
|
|
54
|
+
localTimeRecorded = entry.localTimeRecorded;
|
|
55
|
+
var currentTime = toSeconds(new Date().getTime());
|
|
56
|
+
if (currentTime - localTimeRecorded > 60 * 5) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return currentTime - localTimeRecorded + serverTime;
|
|
60
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @module Horizon */
|
|
2
|
+
export * from "./horizon_api";
|
|
3
|
+
export * from "./server_api";
|
|
4
|
+
export * from "./account_response";
|
|
5
|
+
export { HorizonServer as Server } from "./server";
|
|
6
|
+
export { default as AxiosClient, SERVER_TIME_MAP, getCurrentServerTime } from "./horizon_axios_client";
|
|
7
|
+
declare const _default: any;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
var _exportNames = {
|
|
8
|
+
Server: true,
|
|
9
|
+
AxiosClient: true,
|
|
10
|
+
SERVER_TIME_MAP: true,
|
|
11
|
+
getCurrentServerTime: true
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "AxiosClient", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _horizon_axios_client.default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "SERVER_TIME_MAP", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _horizon_axios_client.SERVER_TIME_MAP;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "Server", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _server.HorizonServer;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
exports.default = void 0;
|
|
32
|
+
Object.defineProperty(exports, "getCurrentServerTime", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _horizon_axios_client.getCurrentServerTime;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
var _horizon_api = require("./horizon_api");
|
|
39
|
+
Object.keys(_horizon_api).forEach(function (key) {
|
|
40
|
+
if (key === "default" || key === "__esModule") return;
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
|
+
if (key in exports && exports[key] === _horizon_api[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _horizon_api[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _server_api = require("./server_api");
|
|
51
|
+
Object.keys(_server_api).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
54
|
+
if (key in exports && exports[key] === _server_api[key]) return;
|
|
55
|
+
Object.defineProperty(exports, key, {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function get() {
|
|
58
|
+
return _server_api[key];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
var _account_response = require("./account_response");
|
|
63
|
+
Object.keys(_account_response).forEach(function (key) {
|
|
64
|
+
if (key === "default" || key === "__esModule") return;
|
|
65
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
66
|
+
if (key in exports && exports[key] === _account_response[key]) return;
|
|
67
|
+
Object.defineProperty(exports, key, {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _account_response[key];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
var _server = require("./server");
|
|
75
|
+
var _horizon_axios_client = _interopRequireWildcard(require("./horizon_axios_client"));
|
|
76
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
77
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
78
|
+
var _default = exports.default = module.exports;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CallBuilder } from "./call_builder";
|
|
2
|
+
import { ServerApi } from "./server_api";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new {@link LedgerCallBuilder} pointed to server defined by serverUrl.
|
|
5
|
+
*
|
|
6
|
+
* Do not create this object directly, use {@link Horizon.Server#ledgers}.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/list-all-ledgers|All Ledgers}
|
|
9
|
+
*
|
|
10
|
+
* @augments CallBuilder
|
|
11
|
+
* @private
|
|
12
|
+
* @class
|
|
13
|
+
* @param {string} serverUrl Horizon server URL.
|
|
14
|
+
*/
|
|
15
|
+
export declare class LedgerCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.LedgerRecord>> {
|
|
16
|
+
constructor(serverUrl: URI);
|
|
17
|
+
/**
|
|
18
|
+
* Provides information on a single ledger.
|
|
19
|
+
* @param {number|string} sequence Ledger sequence
|
|
20
|
+
* @returns {LedgerCallBuilder} current LedgerCallBuilder instance
|
|
21
|
+
*/
|
|
22
|
+
ledger(sequence: number | string): this;
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.LedgerCallBuilder = 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 LedgerCallBuilder = exports.LedgerCallBuilder = function (_CallBuilder) {
|
|
22
|
+
function LedgerCallBuilder(serverUrl) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, LedgerCallBuilder);
|
|
25
|
+
_this = _callSuper(this, LedgerCallBuilder, [serverUrl]);
|
|
26
|
+
_this.url.segment("ledgers");
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
_inherits(LedgerCallBuilder, _CallBuilder);
|
|
30
|
+
return _createClass(LedgerCallBuilder, [{
|
|
31
|
+
key: "ledger",
|
|
32
|
+
value: function ledger(sequence) {
|
|
33
|
+
this.filter.push(["ledgers", sequence.toString()]);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
}]);
|
|
37
|
+
}(_call_builder.CallBuilder);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Asset } from "@stellar/stellar-base";
|
|
2
|
+
import { CallBuilder } from "./call_builder";
|
|
3
|
+
import { ServerApi } from "./server_api";
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new {@link LiquidityPoolCallBuilder} pointed to server defined by serverUrl.
|
|
6
|
+
*
|
|
7
|
+
* Do not create this object directly, use {@link Horizon.Server#liquidityPools}.
|
|
8
|
+
*
|
|
9
|
+
* @augments CallBuilder
|
|
10
|
+
* @private
|
|
11
|
+
* @class
|
|
12
|
+
* @param {string} serverUrl Horizon server URL.
|
|
13
|
+
*/
|
|
14
|
+
export declare class LiquidityPoolCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.LiquidityPoolRecord>> {
|
|
15
|
+
constructor(serverUrl: URI);
|
|
16
|
+
/**
|
|
17
|
+
* Filters out pools whose reserves don't exactly match these assets.
|
|
18
|
+
*
|
|
19
|
+
* @see Asset
|
|
20
|
+
* @returns {LiquidityPoolCallBuilder} current LiquidityPoolCallBuilder instance
|
|
21
|
+
*/
|
|
22
|
+
forAssets(...assets: Asset[]): this;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves all pools an account is participating in.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} id the participant account to filter by
|
|
27
|
+
* @returns {LiquidityPoolCallBuilder} current LiquidityPoolCallBuilder instance
|
|
28
|
+
*/
|
|
29
|
+
forAccount(id: string): this;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves a specific liquidity pool by ID.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} id the hash/ID of the liquidity pool
|
|
34
|
+
* @returns {CallBuilder} a new CallBuilder instance for the /liquidity_pools/:id endpoint
|
|
35
|
+
*/
|
|
36
|
+
liquidityPoolId(id: string): CallBuilder<ServerApi.LiquidityPoolRecord>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.LiquidityPoolCallBuilder = 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 LiquidityPoolCallBuilder = exports.LiquidityPoolCallBuilder = function (_CallBuilder) {
|
|
22
|
+
function LiquidityPoolCallBuilder(serverUrl) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, LiquidityPoolCallBuilder);
|
|
25
|
+
_this = _callSuper(this, LiquidityPoolCallBuilder, [serverUrl]);
|
|
26
|
+
_this.url.segment("liquidity_pools");
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
_inherits(LiquidityPoolCallBuilder, _CallBuilder);
|
|
30
|
+
return _createClass(LiquidityPoolCallBuilder, [{
|
|
31
|
+
key: "forAssets",
|
|
32
|
+
value: function forAssets() {
|
|
33
|
+
for (var _len = arguments.length, assets = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
|
+
assets[_key] = arguments[_key];
|
|
35
|
+
}
|
|
36
|
+
var assetList = assets.map(function (asset) {
|
|
37
|
+
return asset.toString();
|
|
38
|
+
}).join(",");
|
|
39
|
+
this.url.setQuery("reserves", assetList);
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "forAccount",
|
|
44
|
+
value: function forAccount(id) {
|
|
45
|
+
this.url.setQuery("account", id);
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "liquidityPoolId",
|
|
50
|
+
value: function liquidityPoolId(id) {
|
|
51
|
+
if (!id.match(/[a-fA-F0-9]{64}/)) {
|
|
52
|
+
throw new TypeError("".concat(id, " does not look like a liquidity pool ID"));
|
|
53
|
+
}
|
|
54
|
+
var builder = new _call_builder.CallBuilder(this.url.clone());
|
|
55
|
+
builder.filter.push([id.toLowerCase()]);
|
|
56
|
+
return builder;
|
|
57
|
+
}
|
|
58
|
+
}]);
|
|
59
|
+
}(_call_builder.CallBuilder);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Asset } from "@stellar/stellar-base";
|
|
2
|
+
import { CallBuilder } from "./call_builder";
|
|
3
|
+
import { ServerApi } from "./server_api";
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new {@link OfferCallBuilder} pointed to server defined by serverUrl.
|
|
6
|
+
*
|
|
7
|
+
* Do not create this object directly, use {@link Horizon.Server#offers}.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/offers/|Offers}
|
|
10
|
+
*
|
|
11
|
+
* @augments CallBuilder
|
|
12
|
+
* @private
|
|
13
|
+
* @class
|
|
14
|
+
* @param {string} serverUrl Horizon server URL.
|
|
15
|
+
*/
|
|
16
|
+
export declare class OfferCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.OfferRecord>> {
|
|
17
|
+
constructor(serverUrl: URI);
|
|
18
|
+
/**
|
|
19
|
+
* The offer details endpoint provides information on a single offer. The offer ID provided in the id
|
|
20
|
+
* argument specifies which offer to load.
|
|
21
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/offers/single/|Offer Details}
|
|
22
|
+
* @param {string} offerId Offer ID
|
|
23
|
+
* @returns {CallBuilder<ServerApi.OfferRecord>} CallBuilder<ServerApi.OfferRecord> OperationCallBuilder instance
|
|
24
|
+
*/
|
|
25
|
+
offer(offerId: string): CallBuilder<ServerApi.OfferRecord>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns all offers where the given account is involved.
|
|
28
|
+
*
|
|
29
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/accounts/offers/|Offers}
|
|
30
|
+
* @param {string} id For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
|
|
31
|
+
* @returns {OfferCallBuilder} current OfferCallBuilder instance
|
|
32
|
+
*/
|
|
33
|
+
forAccount(id: string): this;
|
|
34
|
+
/**
|
|
35
|
+
* Returns all offers buying an asset.
|
|
36
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/offers/list/|Offers}
|
|
37
|
+
* @see Asset
|
|
38
|
+
* @param {Asset} asset For example: `new Asset('USD','GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD')`
|
|
39
|
+
* @returns {OfferCallBuilder} current OfferCallBuilder instance
|
|
40
|
+
*/
|
|
41
|
+
buying(asset: Asset): this;
|
|
42
|
+
/**
|
|
43
|
+
* Returns all offers selling an asset.
|
|
44
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/offers/list/|Offers}
|
|
45
|
+
* @see Asset
|
|
46
|
+
* @param {Asset} asset For example: `new Asset('EUR','GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD')`
|
|
47
|
+
* @returns {OfferCallBuilder} current OfferCallBuilder instance
|
|
48
|
+
*/
|
|
49
|
+
selling(asset: Asset): this;
|
|
50
|
+
/**
|
|
51
|
+
* This endpoint filters offers where the given account is sponsoring the offer entry.
|
|
52
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-all-offers|Offers}
|
|
53
|
+
* @param {string} id For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
|
|
54
|
+
* @returns {OfferCallBuilder} current OfferCallBuilder instance
|
|
55
|
+
*/
|
|
56
|
+
sponsor(id: string): this;
|
|
57
|
+
/**
|
|
58
|
+
* This endpoint filters offers where the given account is the seller.
|
|
59
|
+
*
|
|
60
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-all-offers|Offers}
|
|
61
|
+
* @param {string} seller For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
|
|
62
|
+
* @returns {OfferCallBuilder} current OfferCallBuilder instance
|
|
63
|
+
*/
|
|
64
|
+
seller(seller: string): this;
|
|
65
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.OfferCallBuilder = 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 OfferCallBuilder = exports.OfferCallBuilder = function (_CallBuilder) {
|
|
22
|
+
function OfferCallBuilder(serverUrl) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, OfferCallBuilder);
|
|
25
|
+
_this = _callSuper(this, OfferCallBuilder, [serverUrl, "offers"]);
|
|
26
|
+
_this.url.segment("offers");
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
_inherits(OfferCallBuilder, _CallBuilder);
|
|
30
|
+
return _createClass(OfferCallBuilder, [{
|
|
31
|
+
key: "offer",
|
|
32
|
+
value: function offer(offerId) {
|
|
33
|
+
var builder = new _call_builder.CallBuilder(this.url.clone());
|
|
34
|
+
builder.filter.push([offerId]);
|
|
35
|
+
return builder;
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
key: "forAccount",
|
|
39
|
+
value: function forAccount(id) {
|
|
40
|
+
return this.forEndpoint("accounts", id);
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "buying",
|
|
44
|
+
value: function buying(asset) {
|
|
45
|
+
if (!asset.isNative()) {
|
|
46
|
+
this.url.setQuery("buying_asset_type", asset.getAssetType());
|
|
47
|
+
this.url.setQuery("buying_asset_code", asset.getCode());
|
|
48
|
+
this.url.setQuery("buying_asset_issuer", asset.getIssuer());
|
|
49
|
+
} else {
|
|
50
|
+
this.url.setQuery("buying_asset_type", "native");
|
|
51
|
+
}
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
key: "selling",
|
|
56
|
+
value: function selling(asset) {
|
|
57
|
+
if (!asset.isNative()) {
|
|
58
|
+
this.url.setQuery("selling_asset_type", asset.getAssetType());
|
|
59
|
+
this.url.setQuery("selling_asset_code", asset.getCode());
|
|
60
|
+
this.url.setQuery("selling_asset_issuer", asset.getIssuer());
|
|
61
|
+
} else {
|
|
62
|
+
this.url.setQuery("selling_asset_type", "native");
|
|
63
|
+
}
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "sponsor",
|
|
68
|
+
value: function sponsor(id) {
|
|
69
|
+
this.url.setQuery("sponsor", id);
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "seller",
|
|
74
|
+
value: function seller(_seller) {
|
|
75
|
+
this.url.setQuery("seller", _seller);
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
}]);
|
|
79
|
+
}(_call_builder.CallBuilder);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { CallBuilder } from "./call_builder";
|
|
2
|
+
import { ServerApi } from "./server_api";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new {@link OperationCallBuilder} pointed to server defined by serverUrl.
|
|
5
|
+
*
|
|
6
|
+
* Do not create this object directly, use {@link Horizon.Server#operations}.
|
|
7
|
+
*
|
|
8
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/operations|All Operations}
|
|
9
|
+
*
|
|
10
|
+
* @augments CallBuilder
|
|
11
|
+
* @private
|
|
12
|
+
* @class
|
|
13
|
+
* @param {string} serverUrl Horizon server URL.
|
|
14
|
+
*/
|
|
15
|
+
export declare class OperationCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.OperationRecord>> {
|
|
16
|
+
constructor(serverUrl: URI);
|
|
17
|
+
/**
|
|
18
|
+
* The operation details endpoint provides information on a single operation. The operation ID provided in the id
|
|
19
|
+
* argument specifies which operation to load.
|
|
20
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-an-operation|Operation Details}
|
|
21
|
+
* @param {number} operationId Operation ID
|
|
22
|
+
* @returns {CallBuilder} this OperationCallBuilder instance
|
|
23
|
+
*/
|
|
24
|
+
operation(operationId: string): CallBuilder<ServerApi.OperationRecord>;
|
|
25
|
+
/**
|
|
26
|
+
* This endpoint represents all operations that were included in valid transactions that affected a particular account.
|
|
27
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-operations-by-account-id|Operations for Account}
|
|
28
|
+
* @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
|
|
29
|
+
* @returns {OperationCallBuilder} this OperationCallBuilder instance
|
|
30
|
+
*/
|
|
31
|
+
forAccount(accountId: string): this;
|
|
32
|
+
/**
|
|
33
|
+
* This endpoint represents all operations that reference a given claimable_balance.
|
|
34
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/cb-retrieve-related-operations|Operations for Claimable Balance}
|
|
35
|
+
* @param {string} claimableBalanceId Claimable Balance ID
|
|
36
|
+
* @returns {OperationCallBuilder} this OperationCallBuilder instance
|
|
37
|
+
*/
|
|
38
|
+
forClaimableBalance(claimableBalanceId: string): this;
|
|
39
|
+
/**
|
|
40
|
+
* This endpoint returns all operations that occurred in a given ledger.
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-ledgers-operations|Operations for Ledger}
|
|
43
|
+
* @param {number|string} sequence Ledger sequence
|
|
44
|
+
* @returns {OperationCallBuilder} this OperationCallBuilder instance
|
|
45
|
+
*/
|
|
46
|
+
forLedger(sequence: number | string): this;
|
|
47
|
+
/**
|
|
48
|
+
* This endpoint represents all operations that are part of a given transaction.
|
|
49
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/retrieve-a-transactions-operations|Operations for Transaction}
|
|
50
|
+
* @param {string} transactionId Transaction ID
|
|
51
|
+
* @returns {OperationCallBuilder} this OperationCallBuilder instance
|
|
52
|
+
*/
|
|
53
|
+
forTransaction(transactionId: string): this;
|
|
54
|
+
/**
|
|
55
|
+
* This endpoint represents all operations involving a particular liquidity pool.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} poolId liquidity pool ID
|
|
58
|
+
* @returns {OperationCallBuilder} this OperationCallBuilder instance
|
|
59
|
+
*/
|
|
60
|
+
forLiquidityPool(poolId: string): this;
|
|
61
|
+
/**
|
|
62
|
+
* Adds a parameter defining whether to include failed transactions.
|
|
63
|
+
* By default, only operations of successful transactions are returned.
|
|
64
|
+
*
|
|
65
|
+
* @param {boolean} value Set to `true` to include operations of failed transactions.
|
|
66
|
+
* @returns {OperationCallBuilder} this OperationCallBuilder instance
|
|
67
|
+
*/
|
|
68
|
+
includeFailed(value: boolean): this;
|
|
69
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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.OperationCallBuilder = 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 OperationCallBuilder = exports.OperationCallBuilder = function (_CallBuilder) {
|
|
22
|
+
function OperationCallBuilder(serverUrl) {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, OperationCallBuilder);
|
|
25
|
+
_this = _callSuper(this, OperationCallBuilder, [serverUrl, "operations"]);
|
|
26
|
+
_this.url.segment("operations");
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
_inherits(OperationCallBuilder, _CallBuilder);
|
|
30
|
+
return _createClass(OperationCallBuilder, [{
|
|
31
|
+
key: "operation",
|
|
32
|
+
value: function operation(operationId) {
|
|
33
|
+
var builder = new _call_builder.CallBuilder(this.url.clone());
|
|
34
|
+
builder.filter.push([operationId]);
|
|
35
|
+
return builder;
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
key: "forAccount",
|
|
39
|
+
value: function forAccount(accountId) {
|
|
40
|
+
return this.forEndpoint("accounts", accountId);
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "forClaimableBalance",
|
|
44
|
+
value: function forClaimableBalance(claimableBalanceId) {
|
|
45
|
+
return this.forEndpoint("claimable_balances", claimableBalanceId);
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "forLedger",
|
|
49
|
+
value: function forLedger(sequence) {
|
|
50
|
+
return this.forEndpoint("ledgers", sequence.toString());
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
key: "forTransaction",
|
|
54
|
+
value: function forTransaction(transactionId) {
|
|
55
|
+
return this.forEndpoint("transactions", transactionId);
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "forLiquidityPool",
|
|
59
|
+
value: function forLiquidityPool(poolId) {
|
|
60
|
+
return this.forEndpoint("liquidity_pools", poolId);
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
key: "includeFailed",
|
|
64
|
+
value: function includeFailed(value) {
|
|
65
|
+
this.url.setQuery("include_failed", value.toString());
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
}]);
|
|
69
|
+
}(_call_builder.CallBuilder);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Asset } from "@stellar/stellar-base";
|
|
2
|
+
import { CallBuilder } from "./call_builder";
|
|
3
|
+
import { ServerApi } from "./server_api";
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new {@link OrderbookCallBuilder} pointed to server defined by serverUrl.
|
|
6
|
+
*
|
|
7
|
+
* Do not create this object directly, use {@link Horizon.Server#orderbook}.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/aggregations/order-books|Orderbook Details}
|
|
10
|
+
*
|
|
11
|
+
* @augments CallBuilder
|
|
12
|
+
* @private
|
|
13
|
+
* @class
|
|
14
|
+
* @param {string} serverUrl serverUrl Horizon server URL.
|
|
15
|
+
* @param {Asset} selling Asset being sold
|
|
16
|
+
* @param {Asset} buying Asset being bought
|
|
17
|
+
*/
|
|
18
|
+
export declare class OrderbookCallBuilder extends CallBuilder<ServerApi.OrderbookRecord> {
|
|
19
|
+
constructor(serverUrl: URI, selling: Asset, buying: Asset);
|
|
20
|
+
}
|