@stellar/stellar-sdk 12.3.0 → 13.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/README.md +29 -7
- package/dist/stellar-sdk-minimal.js +46009 -0
- package/dist/stellar-sdk-minimal.min.js +2 -0
- package/dist/stellar-sdk-minimal.min.js.LICENSE.txt +69 -0
- package/dist/stellar-sdk-no-axios.js +56648 -0
- package/dist/stellar-sdk-no-axios.min.js +2 -0
- package/dist/stellar-sdk-no-axios.min.js.LICENSE.txt +71 -0
- package/dist/stellar-sdk-no-eventsource.js +49822 -0
- package/dist/stellar-sdk-no-eventsource.min.js +2 -0
- package/dist/stellar-sdk-no-eventsource.min.js.LICENSE.txt +69 -0
- package/dist/stellar-sdk.js +28279 -27350
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/browser.d.ts +2 -2
- package/lib/browser.js +5 -7
- package/lib/config.d.ts +31 -19
- package/lib/contract/assembled_transaction.d.ts +22 -14
- package/lib/contract/assembled_transaction.js +159 -128
- package/lib/contract/basic_node_signer.d.ts +6 -1
- package/lib/contract/client.d.ts +24 -24
- package/lib/contract/rust_result.d.ts +22 -12
- package/lib/contract/sent_transaction.d.ts +9 -4
- package/lib/contract/sent_transaction.js +6 -6
- package/lib/contract/spec.d.ts +8 -14
- package/lib/contract/types.d.ts +81 -13
- package/lib/contract/utils.d.ts +8 -1
- package/lib/errors/account_requires_memo.d.ts +24 -0
- package/lib/errors/account_requires_memo.js +38 -0
- package/lib/errors/bad_request.d.ts +14 -0
- package/lib/errors/bad_request.js +34 -0
- package/lib/errors/bad_response.d.ts +17 -0
- package/lib/errors/bad_response.js +34 -0
- package/lib/errors/index.d.ts +5 -0
- package/lib/errors/index.js +60 -0
- package/lib/errors/network.d.ts +33 -0
- package/lib/{errors.js → errors/network.js} +1 -59
- package/lib/errors/not_found.d.ts +14 -0
- package/lib/errors/not_found.js +34 -0
- package/lib/federation/api.d.ts +21 -0
- package/lib/federation/index.d.ts +1 -1
- package/lib/federation/index.js +16 -6
- package/lib/federation/server.d.ts +36 -38
- package/lib/federation/server.js +2 -2
- package/lib/horizon/account_call_builder.d.ts +10 -8
- package/lib/horizon/account_response.d.ts +5 -2
- package/lib/horizon/assets_call_builder.d.ts +3 -2
- package/lib/horizon/call_builder.js +9 -3
- package/lib/horizon/claimable_balances_call_builder.d.ts +10 -8
- package/lib/horizon/effect_call_builder.d.ts +8 -7
- package/lib/horizon/horizon_axios_client.d.ts +13 -6
- package/lib/horizon/horizon_axios_client.js +16 -4
- package/lib/horizon/index.d.ts +2 -1
- package/lib/horizon/index.js +1 -1
- package/lib/horizon/ledger_call_builder.d.ts +6 -4
- package/lib/horizon/liquidity_pool_call_builder.d.ts +3 -2
- package/lib/horizon/offer_call_builder.d.ts +12 -10
- package/lib/horizon/operation_call_builder.d.ts +11 -9
- package/lib/horizon/orderbook_call_builder.d.ts +7 -2
- package/lib/horizon/path_call_builder.d.ts +7 -2
- package/lib/horizon/payment_call_builder.d.ts +10 -6
- package/lib/horizon/server.d.ts +64 -55
- package/lib/horizon/server.js +6 -5
- package/lib/horizon/server_api.d.ts +0 -15
- package/lib/horizon/strict_receive_path_call_builder.d.ts +7 -2
- package/lib/horizon/strict_send_path_call_builder.d.ts +7 -2
- package/lib/horizon/trade_aggregation_call_builder.d.ts +4 -2
- package/lib/horizon/trades_call_builder.d.ts +8 -5
- package/lib/horizon/transaction_call_builder.d.ts +10 -7
- package/lib/horizon/types/assets.d.ts +0 -2
- package/lib/http-client/axios-client.d.ts +2 -0
- package/lib/http-client/axios-client.js +10 -0
- package/lib/http-client/fetch-client.d.ts +11 -0
- package/lib/http-client/fetch-client.js +229 -0
- package/lib/http-client/index.d.ts +5 -0
- package/lib/http-client/index.js +33 -0
- package/lib/http-client/types.d.ts +69 -0
- package/lib/http-client/types.js +34 -0
- package/lib/index.d.ts +3 -8
- package/lib/index.js +8 -5
- package/lib/minimal/browser.d.ts +6 -0
- package/lib/minimal/browser.js +35 -0
- package/lib/minimal/config.d.ts +64 -0
- package/lib/minimal/config.js +51 -0
- package/lib/minimal/contract/assembled_transaction.d.ts +555 -0
- package/lib/minimal/contract/assembled_transaction.js +752 -0
- package/lib/minimal/contract/basic_node_signer.d.ts +17 -0
- package/lib/minimal/contract/basic_node_signer.js +52 -0
- package/lib/minimal/contract/client.d.ts +52 -0
- package/lib/minimal/contract/client.js +180 -0
- package/lib/minimal/contract/index.d.ts +7 -0
- package/lib/minimal/contract/index.js +82 -0
- package/lib/minimal/contract/rust_result.d.ts +81 -0
- package/lib/minimal/contract/rust_result.js +66 -0
- package/lib/minimal/contract/sent_transaction.d.ts +84 -0
- package/lib/minimal/contract/sent_transaction.js +151 -0
- package/lib/minimal/contract/spec.d.ts +152 -0
- package/lib/minimal/contract/spec.js +1020 -0
- package/lib/minimal/contract/types.d.ts +180 -0
- package/lib/minimal/contract/types.js +8 -0
- package/lib/minimal/contract/utils.d.ts +46 -0
- package/lib/minimal/contract/utils.js +123 -0
- package/lib/minimal/errors/account_requires_memo.d.ts +24 -0
- package/lib/minimal/errors/account_requires_memo.js +38 -0
- package/lib/minimal/errors/bad_request.d.ts +14 -0
- package/lib/minimal/errors/bad_request.js +34 -0
- package/lib/minimal/errors/bad_response.d.ts +17 -0
- package/lib/minimal/errors/bad_response.js +34 -0
- package/lib/minimal/errors/index.d.ts +5 -0
- package/lib/minimal/errors/index.js +60 -0
- package/lib/minimal/errors/network.d.ts +33 -0
- package/lib/minimal/errors/network.js +41 -0
- package/lib/minimal/errors/not_found.d.ts +14 -0
- package/lib/minimal/errors/not_found.js +34 -0
- package/lib/minimal/federation/api.d.ts +32 -0
- package/lib/minimal/federation/api.js +7 -0
- package/lib/minimal/federation/index.d.ts +2 -0
- package/lib/minimal/federation/index.js +34 -0
- package/lib/minimal/federation/server.d.ts +116 -0
- package/lib/minimal/federation/server.js +252 -0
- package/lib/minimal/friendbot/index.d.ts +5 -0
- package/lib/minimal/friendbot/index.js +7 -0
- package/lib/minimal/horizon/account_call_builder.d.ts +56 -0
- package/lib/minimal/horizon/account_call_builder.js +62 -0
- package/lib/minimal/horizon/account_response.d.ts +61 -0
- package/lib/minimal/horizon/account_response.js +49 -0
- package/lib/minimal/horizon/assets_call_builder.d.ts +27 -0
- package/lib/minimal/horizon/assets_call_builder.js +43 -0
- package/lib/minimal/horizon/call_builder.d.ts +128 -0
- package/lib/minimal/horizon/call_builder.js +362 -0
- package/lib/minimal/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/minimal/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/minimal/horizon/effect_call_builder.d.ts +53 -0
- package/lib/minimal/horizon/effect_call_builder.js +56 -0
- package/lib/minimal/horizon/friendbot_builder.d.ts +4 -0
- package/lib/minimal/horizon/friendbot_builder.js +32 -0
- package/lib/minimal/horizon/horizon_api.d.ts +527 -0
- package/lib/minimal/horizon/horizon_api.js +96 -0
- package/lib/minimal/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/minimal/horizon/horizon_axios_client.js +60 -0
- package/lib/minimal/horizon/index.d.ts +8 -0
- package/lib/minimal/horizon/index.js +78 -0
- package/lib/minimal/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/minimal/horizon/ledger_call_builder.js +37 -0
- package/lib/minimal/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/minimal/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/minimal/horizon/offer_call_builder.d.ts +65 -0
- package/lib/minimal/horizon/offer_call_builder.js +79 -0
- package/lib/minimal/horizon/operation_call_builder.d.ts +69 -0
- package/lib/minimal/horizon/operation_call_builder.js +69 -0
- package/lib/minimal/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/minimal/horizon/orderbook_call_builder.js +45 -0
- package/lib/minimal/horizon/path_call_builder.d.ts +35 -0
- package/lib/minimal/horizon/path_call_builder.js +41 -0
- package/lib/minimal/horizon/payment_call_builder.d.ts +39 -0
- package/lib/minimal/horizon/payment_call_builder.js +46 -0
- package/lib/minimal/horizon/server.d.ts +389 -0
- package/lib/minimal/horizon/server.js +550 -0
- package/lib/minimal/horizon/server_api.d.ts +263 -0
- package/lib/minimal/horizon/server_api.js +19 -0
- package/lib/minimal/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/minimal/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/minimal/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/minimal/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/minimal/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/minimal/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/minimal/horizon/trades_call_builder.d.ts +52 -0
- package/lib/minimal/horizon/trades_call_builder.js +72 -0
- package/lib/minimal/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/minimal/horizon/transaction_call_builder.js +64 -0
- package/lib/minimal/horizon/types/account.d.ts +5 -0
- package/lib/minimal/horizon/types/account.js +5 -0
- package/lib/minimal/horizon/types/assets.d.ts +17 -0
- package/lib/minimal/horizon/types/assets.js +5 -0
- package/lib/minimal/horizon/types/effects.d.ts +285 -0
- package/lib/minimal/horizon/types/effects.js +62 -0
- package/lib/minimal/horizon/types/offer.d.ts +20 -0
- package/lib/minimal/horizon/types/offer.js +5 -0
- package/lib/minimal/horizon/types/trade.d.ts +13 -0
- package/lib/minimal/horizon/types/trade.js +5 -0
- package/lib/minimal/http-client/axios-client.d.ts +2 -0
- package/lib/minimal/http-client/axios-client.js +10 -0
- package/lib/minimal/http-client/fetch-client.d.ts +11 -0
- package/lib/minimal/http-client/fetch-client.js +229 -0
- package/lib/minimal/http-client/index.d.ts +5 -0
- package/lib/minimal/http-client/index.js +33 -0
- package/lib/minimal/http-client/types.d.ts +69 -0
- package/lib/minimal/http-client/types.js +34 -0
- package/lib/minimal/index.d.ts +32 -0
- package/lib/minimal/index.js +80 -0
- package/lib/minimal/rpc/api.d.ts +362 -0
- package/lib/minimal/rpc/api.js +32 -0
- package/lib/minimal/rpc/axios.d.ts +4 -0
- package/lib/minimal/rpc/axios.js +15 -0
- package/lib/minimal/rpc/browser.d.ts +4 -0
- package/lib/minimal/rpc/browser.js +27 -0
- package/lib/minimal/rpc/index.d.ts +8 -0
- package/lib/minimal/rpc/index.js +86 -0
- package/lib/minimal/rpc/jsonrpc.d.ts +35 -0
- package/lib/minimal/rpc/jsonrpc.js +52 -0
- package/lib/minimal/rpc/parsers.d.ts +39 -0
- package/lib/minimal/rpc/parsers.js +155 -0
- package/lib/minimal/rpc/server.d.ts +622 -0
- package/lib/minimal/rpc/server.js +877 -0
- package/lib/minimal/rpc/transaction.d.ts +21 -0
- package/lib/minimal/rpc/transaction.js +53 -0
- package/lib/minimal/rpc/utils.d.ts +1 -0
- package/lib/minimal/rpc/utils.js +9 -0
- package/lib/minimal/stellartoml/index.d.ts +131 -0
- package/lib/minimal/stellartoml/index.js +77 -0
- package/lib/minimal/utils.d.ts +20 -0
- package/lib/minimal/utils.js +38 -0
- package/lib/minimal/webauth/errors.d.ts +13 -0
- package/lib/minimal/webauth/errors.js +36 -0
- package/lib/minimal/webauth/index.d.ts +2 -0
- package/lib/minimal/webauth/index.js +27 -0
- package/lib/minimal/webauth/utils.d.ts +307 -0
- package/lib/minimal/webauth/utils.js +332 -0
- package/lib/no-axios/browser.d.ts +6 -0
- package/lib/no-axios/browser.js +35 -0
- package/lib/no-axios/config.d.ts +64 -0
- package/lib/no-axios/config.js +51 -0
- package/lib/no-axios/contract/assembled_transaction.d.ts +555 -0
- package/lib/no-axios/contract/assembled_transaction.js +752 -0
- package/lib/no-axios/contract/basic_node_signer.d.ts +17 -0
- package/lib/no-axios/contract/basic_node_signer.js +52 -0
- package/lib/no-axios/contract/client.d.ts +52 -0
- package/lib/no-axios/contract/client.js +180 -0
- package/lib/no-axios/contract/index.d.ts +7 -0
- package/lib/no-axios/contract/index.js +82 -0
- package/lib/no-axios/contract/rust_result.d.ts +81 -0
- package/lib/no-axios/contract/rust_result.js +66 -0
- package/lib/no-axios/contract/sent_transaction.d.ts +84 -0
- package/lib/no-axios/contract/sent_transaction.js +151 -0
- package/lib/no-axios/contract/spec.d.ts +152 -0
- package/lib/no-axios/contract/spec.js +1020 -0
- package/lib/no-axios/contract/types.d.ts +180 -0
- package/lib/no-axios/contract/types.js +8 -0
- package/lib/no-axios/contract/utils.d.ts +46 -0
- package/lib/no-axios/contract/utils.js +123 -0
- package/lib/no-axios/errors/account_requires_memo.d.ts +24 -0
- package/lib/no-axios/errors/account_requires_memo.js +38 -0
- package/lib/no-axios/errors/bad_request.d.ts +14 -0
- package/lib/no-axios/errors/bad_request.js +34 -0
- package/lib/no-axios/errors/bad_response.d.ts +17 -0
- package/lib/no-axios/errors/bad_response.js +34 -0
- package/lib/no-axios/errors/index.d.ts +5 -0
- package/lib/no-axios/errors/index.js +60 -0
- package/lib/no-axios/errors/network.d.ts +33 -0
- package/lib/no-axios/errors/network.js +41 -0
- package/lib/no-axios/errors/not_found.d.ts +14 -0
- package/lib/no-axios/errors/not_found.js +34 -0
- package/lib/no-axios/federation/api.d.ts +32 -0
- package/lib/no-axios/federation/api.js +7 -0
- package/lib/no-axios/federation/index.d.ts +2 -0
- package/lib/no-axios/federation/index.js +34 -0
- package/lib/no-axios/federation/server.d.ts +116 -0
- package/lib/no-axios/federation/server.js +252 -0
- package/lib/no-axios/friendbot/index.d.ts +5 -0
- package/lib/no-axios/friendbot/index.js +7 -0
- package/lib/no-axios/horizon/account_call_builder.d.ts +56 -0
- package/lib/no-axios/horizon/account_call_builder.js +62 -0
- package/lib/no-axios/horizon/account_response.d.ts +61 -0
- package/lib/no-axios/horizon/account_response.js +49 -0
- package/lib/no-axios/horizon/assets_call_builder.d.ts +27 -0
- package/lib/no-axios/horizon/assets_call_builder.js +43 -0
- package/lib/no-axios/horizon/call_builder.d.ts +128 -0
- package/lib/no-axios/horizon/call_builder.js +362 -0
- package/lib/no-axios/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/no-axios/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/no-axios/horizon/effect_call_builder.d.ts +53 -0
- package/lib/no-axios/horizon/effect_call_builder.js +56 -0
- package/lib/no-axios/horizon/friendbot_builder.d.ts +4 -0
- package/lib/no-axios/horizon/friendbot_builder.js +32 -0
- package/lib/no-axios/horizon/horizon_api.d.ts +527 -0
- package/lib/no-axios/horizon/horizon_api.js +96 -0
- package/lib/no-axios/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/no-axios/horizon/horizon_axios_client.js +60 -0
- package/lib/no-axios/horizon/index.d.ts +8 -0
- package/lib/no-axios/horizon/index.js +78 -0
- package/lib/no-axios/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/no-axios/horizon/ledger_call_builder.js +37 -0
- package/lib/no-axios/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/no-axios/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/no-axios/horizon/offer_call_builder.d.ts +65 -0
- package/lib/no-axios/horizon/offer_call_builder.js +79 -0
- package/lib/no-axios/horizon/operation_call_builder.d.ts +69 -0
- package/lib/no-axios/horizon/operation_call_builder.js +69 -0
- package/lib/no-axios/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/no-axios/horizon/orderbook_call_builder.js +45 -0
- package/lib/no-axios/horizon/path_call_builder.d.ts +35 -0
- package/lib/no-axios/horizon/path_call_builder.js +41 -0
- package/lib/no-axios/horizon/payment_call_builder.d.ts +39 -0
- package/lib/no-axios/horizon/payment_call_builder.js +46 -0
- package/lib/no-axios/horizon/server.d.ts +389 -0
- package/lib/no-axios/horizon/server.js +550 -0
- package/lib/no-axios/horizon/server_api.d.ts +263 -0
- package/lib/no-axios/horizon/server_api.js +19 -0
- package/lib/no-axios/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/no-axios/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/no-axios/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/no-axios/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/no-axios/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/no-axios/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/no-axios/horizon/trades_call_builder.d.ts +52 -0
- package/lib/no-axios/horizon/trades_call_builder.js +72 -0
- package/lib/no-axios/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/no-axios/horizon/transaction_call_builder.js +64 -0
- package/lib/no-axios/horizon/types/account.d.ts +5 -0
- package/lib/no-axios/horizon/types/account.js +5 -0
- package/lib/no-axios/horizon/types/assets.d.ts +17 -0
- package/lib/no-axios/horizon/types/assets.js +5 -0
- package/lib/no-axios/horizon/types/effects.d.ts +285 -0
- package/lib/no-axios/horizon/types/effects.js +62 -0
- package/lib/no-axios/horizon/types/offer.d.ts +20 -0
- package/lib/no-axios/horizon/types/offer.js +5 -0
- package/lib/no-axios/horizon/types/trade.d.ts +13 -0
- package/lib/no-axios/horizon/types/trade.js +5 -0
- package/lib/no-axios/http-client/axios-client.d.ts +2 -0
- package/lib/no-axios/http-client/axios-client.js +10 -0
- package/lib/no-axios/http-client/fetch-client.d.ts +11 -0
- package/lib/no-axios/http-client/fetch-client.js +229 -0
- package/lib/no-axios/http-client/index.d.ts +5 -0
- package/lib/no-axios/http-client/index.js +33 -0
- package/lib/no-axios/http-client/types.d.ts +69 -0
- package/lib/no-axios/http-client/types.js +34 -0
- package/lib/no-axios/index.d.ts +32 -0
- package/lib/no-axios/index.js +80 -0
- package/lib/no-axios/rpc/api.d.ts +362 -0
- package/lib/no-axios/rpc/api.js +32 -0
- package/lib/no-axios/rpc/axios.d.ts +4 -0
- package/lib/no-axios/rpc/axios.js +15 -0
- package/lib/no-axios/rpc/browser.d.ts +4 -0
- package/lib/no-axios/rpc/browser.js +27 -0
- package/lib/no-axios/rpc/index.d.ts +8 -0
- package/lib/no-axios/rpc/index.js +86 -0
- package/lib/no-axios/rpc/jsonrpc.d.ts +35 -0
- package/lib/no-axios/rpc/jsonrpc.js +52 -0
- package/lib/no-axios/rpc/parsers.d.ts +39 -0
- package/lib/no-axios/rpc/parsers.js +155 -0
- package/lib/no-axios/rpc/server.d.ts +622 -0
- package/lib/no-axios/rpc/server.js +877 -0
- package/lib/no-axios/rpc/transaction.d.ts +21 -0
- package/lib/no-axios/rpc/transaction.js +53 -0
- package/lib/no-axios/rpc/utils.d.ts +1 -0
- package/lib/no-axios/rpc/utils.js +9 -0
- package/lib/no-axios/stellartoml/index.d.ts +131 -0
- package/lib/no-axios/stellartoml/index.js +77 -0
- package/lib/no-axios/utils.d.ts +20 -0
- package/lib/no-axios/utils.js +38 -0
- package/lib/no-axios/webauth/errors.d.ts +13 -0
- package/lib/no-axios/webauth/errors.js +36 -0
- package/lib/no-axios/webauth/index.d.ts +2 -0
- package/lib/no-axios/webauth/index.js +27 -0
- package/lib/no-axios/webauth/utils.d.ts +307 -0
- package/lib/no-axios/webauth/utils.js +332 -0
- package/lib/no-eventsource/browser.d.ts +6 -0
- package/lib/no-eventsource/browser.js +35 -0
- package/lib/no-eventsource/config.d.ts +64 -0
- package/lib/no-eventsource/config.js +51 -0
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +555 -0
- package/lib/no-eventsource/contract/assembled_transaction.js +752 -0
- package/lib/no-eventsource/contract/basic_node_signer.d.ts +17 -0
- package/lib/no-eventsource/contract/basic_node_signer.js +52 -0
- package/lib/no-eventsource/contract/client.d.ts +52 -0
- package/lib/no-eventsource/contract/client.js +180 -0
- package/lib/no-eventsource/contract/index.d.ts +7 -0
- package/lib/no-eventsource/contract/index.js +82 -0
- package/lib/no-eventsource/contract/rust_result.d.ts +81 -0
- package/lib/no-eventsource/contract/rust_result.js +66 -0
- package/lib/no-eventsource/contract/sent_transaction.d.ts +84 -0
- package/lib/no-eventsource/contract/sent_transaction.js +151 -0
- package/lib/no-eventsource/contract/spec.d.ts +152 -0
- package/lib/no-eventsource/contract/spec.js +1020 -0
- package/lib/no-eventsource/contract/types.d.ts +180 -0
- package/lib/no-eventsource/contract/types.js +8 -0
- package/lib/no-eventsource/contract/utils.d.ts +46 -0
- package/lib/no-eventsource/contract/utils.js +123 -0
- package/lib/no-eventsource/errors/account_requires_memo.d.ts +24 -0
- package/lib/no-eventsource/errors/account_requires_memo.js +38 -0
- package/lib/no-eventsource/errors/bad_request.d.ts +14 -0
- package/lib/no-eventsource/errors/bad_request.js +34 -0
- package/lib/no-eventsource/errors/bad_response.d.ts +17 -0
- package/lib/no-eventsource/errors/bad_response.js +34 -0
- package/lib/no-eventsource/errors/index.d.ts +5 -0
- package/lib/no-eventsource/errors/index.js +60 -0
- package/lib/no-eventsource/errors/network.d.ts +33 -0
- package/lib/no-eventsource/errors/network.js +41 -0
- package/lib/no-eventsource/errors/not_found.d.ts +14 -0
- package/lib/no-eventsource/errors/not_found.js +34 -0
- package/lib/no-eventsource/federation/api.d.ts +32 -0
- package/lib/no-eventsource/federation/api.js +7 -0
- package/lib/no-eventsource/federation/index.d.ts +2 -0
- package/lib/no-eventsource/federation/index.js +34 -0
- package/lib/no-eventsource/federation/server.d.ts +116 -0
- package/lib/no-eventsource/federation/server.js +252 -0
- package/lib/no-eventsource/friendbot/index.d.ts +5 -0
- package/lib/no-eventsource/friendbot/index.js +7 -0
- package/lib/no-eventsource/horizon/account_call_builder.d.ts +56 -0
- package/lib/no-eventsource/horizon/account_call_builder.js +62 -0
- package/lib/no-eventsource/horizon/account_response.d.ts +61 -0
- package/lib/no-eventsource/horizon/account_response.js +49 -0
- package/lib/no-eventsource/horizon/assets_call_builder.d.ts +27 -0
- package/lib/no-eventsource/horizon/assets_call_builder.js +43 -0
- package/lib/no-eventsource/horizon/call_builder.d.ts +128 -0
- package/lib/no-eventsource/horizon/call_builder.js +362 -0
- package/lib/no-eventsource/horizon/claimable_balances_call_builder.d.ts +50 -0
- package/lib/no-eventsource/horizon/claimable_balances_call_builder.js +56 -0
- package/lib/no-eventsource/horizon/effect_call_builder.d.ts +53 -0
- package/lib/no-eventsource/horizon/effect_call_builder.js +56 -0
- package/lib/no-eventsource/horizon/friendbot_builder.d.ts +4 -0
- package/lib/no-eventsource/horizon/friendbot_builder.js +32 -0
- package/lib/no-eventsource/horizon/horizon_api.d.ts +527 -0
- package/lib/no-eventsource/horizon/horizon_api.js +96 -0
- package/lib/no-eventsource/horizon/horizon_axios_client.d.ts +37 -0
- package/lib/no-eventsource/horizon/horizon_axios_client.js +60 -0
- package/lib/no-eventsource/horizon/index.d.ts +8 -0
- package/lib/no-eventsource/horizon/index.js +78 -0
- package/lib/no-eventsource/horizon/ledger_call_builder.d.ts +23 -0
- package/lib/no-eventsource/horizon/ledger_call_builder.js +37 -0
- package/lib/no-eventsource/horizon/liquidity_pool_call_builder.d.ts +37 -0
- package/lib/no-eventsource/horizon/liquidity_pool_call_builder.js +59 -0
- package/lib/no-eventsource/horizon/offer_call_builder.d.ts +65 -0
- package/lib/no-eventsource/horizon/offer_call_builder.js +79 -0
- package/lib/no-eventsource/horizon/operation_call_builder.d.ts +69 -0
- package/lib/no-eventsource/horizon/operation_call_builder.js +69 -0
- package/lib/no-eventsource/horizon/orderbook_call_builder.d.ts +20 -0
- package/lib/no-eventsource/horizon/orderbook_call_builder.js +45 -0
- package/lib/no-eventsource/horizon/path_call_builder.d.ts +35 -0
- package/lib/no-eventsource/horizon/path_call_builder.js +41 -0
- package/lib/no-eventsource/horizon/payment_call_builder.d.ts +39 -0
- package/lib/no-eventsource/horizon/payment_call_builder.js +46 -0
- package/lib/no-eventsource/horizon/server.d.ts +389 -0
- package/lib/no-eventsource/horizon/server.js +550 -0
- package/lib/no-eventsource/horizon/server_api.d.ts +263 -0
- package/lib/no-eventsource/horizon/server_api.js +19 -0
- package/lib/no-eventsource/horizon/strict_receive_path_call_builder.d.ts +38 -0
- package/lib/no-eventsource/horizon/strict_receive_path_call_builder.js +50 -0
- package/lib/no-eventsource/horizon/strict_send_path_call_builder.d.ts +38 -0
- package/lib/no-eventsource/horizon/strict_send_path_call_builder.js +50 -0
- package/lib/no-eventsource/horizon/trade_aggregation_call_builder.d.ts +49 -0
- package/lib/no-eventsource/horizon/trade_aggregation_call_builder.js +76 -0
- package/lib/no-eventsource/horizon/trades_call_builder.d.ts +52 -0
- package/lib/no-eventsource/horizon/trades_call_builder.js +72 -0
- package/lib/no-eventsource/horizon/transaction_call_builder.d.ts +60 -0
- package/lib/no-eventsource/horizon/transaction_call_builder.js +64 -0
- package/lib/no-eventsource/horizon/types/account.d.ts +5 -0
- package/lib/no-eventsource/horizon/types/account.js +5 -0
- package/lib/no-eventsource/horizon/types/assets.d.ts +17 -0
- package/lib/no-eventsource/horizon/types/assets.js +5 -0
- package/lib/no-eventsource/horizon/types/effects.d.ts +285 -0
- package/lib/no-eventsource/horizon/types/effects.js +62 -0
- package/lib/no-eventsource/horizon/types/offer.d.ts +20 -0
- package/lib/no-eventsource/horizon/types/offer.js +5 -0
- package/lib/no-eventsource/horizon/types/trade.d.ts +13 -0
- package/lib/no-eventsource/horizon/types/trade.js +5 -0
- package/lib/no-eventsource/http-client/axios-client.d.ts +2 -0
- package/lib/no-eventsource/http-client/axios-client.js +10 -0
- package/lib/no-eventsource/http-client/fetch-client.d.ts +11 -0
- package/lib/no-eventsource/http-client/fetch-client.js +229 -0
- package/lib/no-eventsource/http-client/index.d.ts +5 -0
- package/lib/no-eventsource/http-client/index.js +33 -0
- package/lib/no-eventsource/http-client/types.d.ts +69 -0
- package/lib/no-eventsource/http-client/types.js +34 -0
- package/lib/no-eventsource/index.d.ts +32 -0
- package/lib/no-eventsource/index.js +80 -0
- package/lib/no-eventsource/rpc/api.d.ts +362 -0
- package/lib/no-eventsource/rpc/api.js +32 -0
- package/lib/no-eventsource/rpc/axios.d.ts +4 -0
- package/lib/no-eventsource/rpc/axios.js +15 -0
- package/lib/no-eventsource/rpc/browser.d.ts +4 -0
- package/lib/no-eventsource/rpc/browser.js +27 -0
- package/lib/no-eventsource/rpc/index.d.ts +8 -0
- package/lib/no-eventsource/rpc/index.js +86 -0
- package/lib/no-eventsource/rpc/jsonrpc.d.ts +35 -0
- package/lib/no-eventsource/rpc/jsonrpc.js +52 -0
- package/lib/no-eventsource/rpc/parsers.d.ts +39 -0
- package/lib/no-eventsource/rpc/parsers.js +155 -0
- package/lib/no-eventsource/rpc/server.d.ts +622 -0
- package/lib/no-eventsource/rpc/server.js +877 -0
- package/lib/no-eventsource/rpc/transaction.d.ts +21 -0
- package/lib/no-eventsource/rpc/transaction.js +53 -0
- package/lib/no-eventsource/rpc/utils.d.ts +1 -0
- package/lib/no-eventsource/rpc/utils.js +9 -0
- package/lib/no-eventsource/stellartoml/index.d.ts +131 -0
- package/lib/no-eventsource/stellartoml/index.js +77 -0
- package/lib/no-eventsource/utils.d.ts +20 -0
- package/lib/no-eventsource/utils.js +38 -0
- package/lib/no-eventsource/webauth/errors.d.ts +13 -0
- package/lib/no-eventsource/webauth/errors.js +36 -0
- package/lib/no-eventsource/webauth/index.d.ts +2 -0
- package/lib/no-eventsource/webauth/index.js +27 -0
- package/lib/no-eventsource/webauth/utils.d.ts +307 -0
- package/lib/no-eventsource/webauth/utils.js +332 -0
- package/lib/rpc/api.d.ts +25 -11
- package/lib/rpc/axios.d.ts +3 -2
- package/lib/rpc/axios.js +3 -4
- package/lib/rpc/browser.d.ts +0 -2
- package/lib/rpc/browser.js +1 -11
- package/lib/rpc/index.d.ts +2 -1
- package/lib/rpc/index.js +15 -1
- package/lib/rpc/jsonrpc.d.ts +9 -1
- package/lib/rpc/parsers.d.ts +31 -11
- package/lib/rpc/parsers.js +14 -14
- package/lib/rpc/server.d.ts +207 -99
- package/lib/rpc/server.js +273 -133
- package/lib/rpc/transaction.d.ts +11 -9
- package/lib/stellartoml/index.d.ts +21 -11
- package/lib/stellartoml/index.js +3 -3
- package/lib/utils.d.ts +12 -4
- package/lib/utils.js +7 -0
- package/lib/webauth/errors.d.ts +9 -0
- package/lib/webauth/utils.d.ts +67 -54
- package/package.json +73 -21
- package/lib/errors.d.ts +0 -59
package/lib/rpc/server.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SUBMIT_TRANSACTION_TIMEOUT = exports.RpcServer = exports.LinearSleepStrategy = exports.Durability = exports.BasicSleepStrategy = void 0;
|
|
7
7
|
var _urijs = _interopRequireDefault(require("urijs"));
|
|
8
8
|
var _stellarBase = require("@stellar/stellar-base");
|
|
9
9
|
var _axios = _interopRequireDefault(require("./axios"));
|
|
@@ -11,6 +11,7 @@ var jsonrpc = _interopRequireWildcard(require("./jsonrpc"));
|
|
|
11
11
|
var _api = require("./api");
|
|
12
12
|
var _transaction = require("./transaction");
|
|
13
13
|
var _parsers = require("./parsers");
|
|
14
|
+
var _utils = require("../utils");
|
|
14
15
|
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); }
|
|
15
16
|
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; }
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -32,6 +33,13 @@ var Durability = exports.Durability = function (Durability) {
|
|
|
32
33
|
Durability["Persistent"] = "persistent";
|
|
33
34
|
return Durability;
|
|
34
35
|
}({});
|
|
36
|
+
var DEFAULT_GET_TRANSACTION_TIMEOUT = 30;
|
|
37
|
+
var BasicSleepStrategy = exports.BasicSleepStrategy = function BasicSleepStrategy(_iter) {
|
|
38
|
+
return 1000;
|
|
39
|
+
};
|
|
40
|
+
var LinearSleepStrategy = exports.LinearSleepStrategy = function LinearSleepStrategy(iter) {
|
|
41
|
+
return 1000 * iter;
|
|
42
|
+
};
|
|
35
43
|
function findCreatedAccountSequenceInTransactionMeta(meta) {
|
|
36
44
|
var _operations$flatMap$f;
|
|
37
45
|
var operations = [];
|
|
@@ -57,10 +65,10 @@ function findCreatedAccountSequenceInTransactionMeta(meta) {
|
|
|
57
65
|
}
|
|
58
66
|
throw new Error('No account created in transaction');
|
|
59
67
|
}
|
|
60
|
-
var
|
|
61
|
-
function
|
|
68
|
+
var RpcServer = exports.RpcServer = function () {
|
|
69
|
+
function RpcServer(serverURL) {
|
|
62
70
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
63
|
-
_classCallCheck(this,
|
|
71
|
+
_classCallCheck(this, RpcServer);
|
|
64
72
|
this.serverURL = (0, _urijs.default)(serverURL);
|
|
65
73
|
if (opts.headers && Object.keys(opts.headers).length !== 0) {
|
|
66
74
|
_axios.default.interceptors.request.use(function (config) {
|
|
@@ -72,7 +80,7 @@ var Server = exports.Server = function () {
|
|
|
72
80
|
throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set");
|
|
73
81
|
}
|
|
74
82
|
}
|
|
75
|
-
return _createClass(
|
|
83
|
+
return _createClass(RpcServer, [{
|
|
76
84
|
key: "getAccount",
|
|
77
85
|
value: (function () {
|
|
78
86
|
var _getAccount = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(address) {
|
|
@@ -336,19 +344,65 @@ var Server = exports.Server = function () {
|
|
|
336
344
|
return _getLedgerEntries;
|
|
337
345
|
}()
|
|
338
346
|
}, {
|
|
339
|
-
key: "
|
|
347
|
+
key: "pollTransaction",
|
|
340
348
|
value: (function () {
|
|
341
|
-
var
|
|
349
|
+
var _pollTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee8(hash, opts) {
|
|
350
|
+
var _opts$attempts, _opts$attempts2;
|
|
351
|
+
var maxAttempts, foundInfo, attempt, _opts$sleepStrategy;
|
|
342
352
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
343
353
|
while (1) switch (_context8.prev = _context8.next) {
|
|
344
354
|
case 0:
|
|
345
|
-
|
|
355
|
+
maxAttempts = ((_opts$attempts = opts === null || opts === void 0 ? void 0 : opts.attempts) !== null && _opts$attempts !== void 0 ? _opts$attempts : 0) < 1 ? DEFAULT_GET_TRANSACTION_TIMEOUT : (_opts$attempts2 = opts === null || opts === void 0 ? void 0 : opts.attempts) !== null && _opts$attempts2 !== void 0 ? _opts$attempts2 : DEFAULT_GET_TRANSACTION_TIMEOUT;
|
|
356
|
+
attempt = 1;
|
|
357
|
+
case 2:
|
|
358
|
+
if (!(attempt < maxAttempts)) {
|
|
359
|
+
_context8.next = 13;
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
_context8.next = 5;
|
|
363
|
+
return this.getTransaction(hash);
|
|
364
|
+
case 5:
|
|
365
|
+
foundInfo = _context8.sent;
|
|
366
|
+
if (!(foundInfo.status !== _api.Api.GetTransactionStatus.NOT_FOUND)) {
|
|
367
|
+
_context8.next = 8;
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
return _context8.abrupt("return", foundInfo);
|
|
371
|
+
case 8:
|
|
372
|
+
_context8.next = 10;
|
|
373
|
+
return _utils.Utils.sleep(((_opts$sleepStrategy = opts === null || opts === void 0 ? void 0 : opts.sleepStrategy) !== null && _opts$sleepStrategy !== void 0 ? _opts$sleepStrategy : BasicSleepStrategy)(attempt));
|
|
374
|
+
case 10:
|
|
375
|
+
attempt++;
|
|
376
|
+
_context8.next = 2;
|
|
377
|
+
break;
|
|
378
|
+
case 13:
|
|
379
|
+
return _context8.abrupt("return", foundInfo);
|
|
380
|
+
case 14:
|
|
381
|
+
case "end":
|
|
382
|
+
return _context8.stop();
|
|
383
|
+
}
|
|
384
|
+
}, _callee8, this);
|
|
385
|
+
}));
|
|
386
|
+
function pollTransaction(_x6, _x7) {
|
|
387
|
+
return _pollTransaction.apply(this, arguments);
|
|
388
|
+
}
|
|
389
|
+
return pollTransaction;
|
|
390
|
+
}())
|
|
391
|
+
}, {
|
|
392
|
+
key: "getTransaction",
|
|
393
|
+
value: (function () {
|
|
394
|
+
var _getTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee9(hash) {
|
|
395
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
396
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
397
|
+
case 0:
|
|
398
|
+
return _context9.abrupt("return", this._getTransaction(hash).then(function (raw) {
|
|
346
399
|
var foundInfo = {};
|
|
347
400
|
if (raw.status !== _api.Api.GetTransactionStatus.NOT_FOUND) {
|
|
348
401
|
Object.assign(foundInfo, (0, _parsers.parseTransactionInfo)(raw));
|
|
349
402
|
}
|
|
350
403
|
var result = _objectSpread({
|
|
351
404
|
status: raw.status,
|
|
405
|
+
txHash: hash,
|
|
352
406
|
latestLedger: raw.latestLedger,
|
|
353
407
|
latestLedgerCloseTime: raw.latestLedgerCloseTime,
|
|
354
408
|
oldestLedger: raw.oldestLedger,
|
|
@@ -358,11 +412,11 @@ var Server = exports.Server = function () {
|
|
|
358
412
|
}));
|
|
359
413
|
case 1:
|
|
360
414
|
case "end":
|
|
361
|
-
return
|
|
415
|
+
return _context9.stop();
|
|
362
416
|
}
|
|
363
|
-
},
|
|
417
|
+
}, _callee9, this);
|
|
364
418
|
}));
|
|
365
|
-
function getTransaction(
|
|
419
|
+
function getTransaction(_x8) {
|
|
366
420
|
return _getTransaction2.apply(this, arguments);
|
|
367
421
|
}
|
|
368
422
|
return getTransaction;
|
|
@@ -370,20 +424,20 @@ var Server = exports.Server = function () {
|
|
|
370
424
|
}, {
|
|
371
425
|
key: "_getTransaction",
|
|
372
426
|
value: function () {
|
|
373
|
-
var _getTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
374
|
-
return _regeneratorRuntime().wrap(function
|
|
375
|
-
while (1) switch (
|
|
427
|
+
var _getTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee10(hash) {
|
|
428
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
429
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
376
430
|
case 0:
|
|
377
|
-
return
|
|
431
|
+
return _context10.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getTransaction', {
|
|
378
432
|
hash: hash
|
|
379
433
|
}));
|
|
380
434
|
case 1:
|
|
381
435
|
case "end":
|
|
382
|
-
return
|
|
436
|
+
return _context10.stop();
|
|
383
437
|
}
|
|
384
|
-
},
|
|
438
|
+
}, _callee10, this);
|
|
385
439
|
}));
|
|
386
|
-
function _getTransaction(
|
|
440
|
+
function _getTransaction(_x9) {
|
|
387
441
|
return _getTransaction3.apply(this, arguments);
|
|
388
442
|
}
|
|
389
443
|
return _getTransaction;
|
|
@@ -391,11 +445,11 @@ var Server = exports.Server = function () {
|
|
|
391
445
|
}, {
|
|
392
446
|
key: "getTransactions",
|
|
393
447
|
value: (function () {
|
|
394
|
-
var _getTransactions2 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
395
|
-
return _regeneratorRuntime().wrap(function
|
|
396
|
-
while (1) switch (
|
|
448
|
+
var _getTransactions2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee11(request) {
|
|
449
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
450
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
397
451
|
case 0:
|
|
398
|
-
return
|
|
452
|
+
return _context11.abrupt("return", this._getTransactions(request).then(function (raw) {
|
|
399
453
|
var result = {
|
|
400
454
|
transactions: raw.transactions.map(_parsers.parseRawTransactions),
|
|
401
455
|
latestLedger: raw.latestLedger,
|
|
@@ -408,11 +462,11 @@ var Server = exports.Server = function () {
|
|
|
408
462
|
}));
|
|
409
463
|
case 1:
|
|
410
464
|
case "end":
|
|
411
|
-
return
|
|
465
|
+
return _context11.stop();
|
|
412
466
|
}
|
|
413
|
-
},
|
|
467
|
+
}, _callee11, this);
|
|
414
468
|
}));
|
|
415
|
-
function getTransactions(
|
|
469
|
+
function getTransactions(_x10) {
|
|
416
470
|
return _getTransactions2.apply(this, arguments);
|
|
417
471
|
}
|
|
418
472
|
return getTransactions;
|
|
@@ -420,18 +474,18 @@ var Server = exports.Server = function () {
|
|
|
420
474
|
}, {
|
|
421
475
|
key: "_getTransactions",
|
|
422
476
|
value: function () {
|
|
423
|
-
var _getTransactions3 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
424
|
-
return _regeneratorRuntime().wrap(function
|
|
425
|
-
while (1) switch (
|
|
477
|
+
var _getTransactions3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee12(request) {
|
|
478
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
479
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
426
480
|
case 0:
|
|
427
|
-
return
|
|
481
|
+
return _context12.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getTransactions', request));
|
|
428
482
|
case 1:
|
|
429
483
|
case "end":
|
|
430
|
-
return
|
|
484
|
+
return _context12.stop();
|
|
431
485
|
}
|
|
432
|
-
},
|
|
486
|
+
}, _callee12, this);
|
|
433
487
|
}));
|
|
434
|
-
function _getTransactions(
|
|
488
|
+
function _getTransactions(_x11) {
|
|
435
489
|
return _getTransactions3.apply(this, arguments);
|
|
436
490
|
}
|
|
437
491
|
return _getTransactions;
|
|
@@ -439,18 +493,18 @@ var Server = exports.Server = function () {
|
|
|
439
493
|
}, {
|
|
440
494
|
key: "getEvents",
|
|
441
495
|
value: (function () {
|
|
442
|
-
var _getEvents2 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
443
|
-
return _regeneratorRuntime().wrap(function
|
|
444
|
-
while (1) switch (
|
|
496
|
+
var _getEvents2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee13(request) {
|
|
497
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
498
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
445
499
|
case 0:
|
|
446
|
-
return
|
|
500
|
+
return _context13.abrupt("return", this._getEvents(request).then(_parsers.parseRawEvents));
|
|
447
501
|
case 1:
|
|
448
502
|
case "end":
|
|
449
|
-
return
|
|
503
|
+
return _context13.stop();
|
|
450
504
|
}
|
|
451
|
-
},
|
|
505
|
+
}, _callee13, this);
|
|
452
506
|
}));
|
|
453
|
-
function getEvents(
|
|
507
|
+
function getEvents(_x12) {
|
|
454
508
|
return _getEvents2.apply(this, arguments);
|
|
455
509
|
}
|
|
456
510
|
return getEvents;
|
|
@@ -458,12 +512,12 @@ var Server = exports.Server = function () {
|
|
|
458
512
|
}, {
|
|
459
513
|
key: "_getEvents",
|
|
460
514
|
value: function () {
|
|
461
|
-
var _getEvents3 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
515
|
+
var _getEvents3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee14(request) {
|
|
462
516
|
var _request$filters;
|
|
463
|
-
return _regeneratorRuntime().wrap(function
|
|
464
|
-
while (1) switch (
|
|
517
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
518
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
465
519
|
case 0:
|
|
466
|
-
return
|
|
520
|
+
return _context14.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getEvents', _objectSpread(_objectSpread({
|
|
467
521
|
filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
|
|
468
522
|
pagination: _objectSpread(_objectSpread({}, request.cursor && {
|
|
469
523
|
cursor: request.cursor
|
|
@@ -472,14 +526,16 @@ var Server = exports.Server = function () {
|
|
|
472
526
|
})
|
|
473
527
|
}, request.startLedger && {
|
|
474
528
|
startLedger: request.startLedger
|
|
529
|
+
}), request.endLedger && {
|
|
530
|
+
endLedger: request.endLedger
|
|
475
531
|
})));
|
|
476
532
|
case 1:
|
|
477
533
|
case "end":
|
|
478
|
-
return
|
|
534
|
+
return _context14.stop();
|
|
479
535
|
}
|
|
480
|
-
},
|
|
536
|
+
}, _callee14, this);
|
|
481
537
|
}));
|
|
482
|
-
function _getEvents(
|
|
538
|
+
function _getEvents(_x13) {
|
|
483
539
|
return _getEvents3.apply(this, arguments);
|
|
484
540
|
}
|
|
485
541
|
return _getEvents;
|
|
@@ -487,16 +543,16 @@ var Server = exports.Server = function () {
|
|
|
487
543
|
}, {
|
|
488
544
|
key: "getNetwork",
|
|
489
545
|
value: (function () {
|
|
490
|
-
var _getNetwork = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
491
|
-
return _regeneratorRuntime().wrap(function
|
|
492
|
-
while (1) switch (
|
|
546
|
+
var _getNetwork = _asyncToGenerator(_regeneratorRuntime().mark(function _callee15() {
|
|
547
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
548
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
493
549
|
case 0:
|
|
494
|
-
return
|
|
550
|
+
return _context15.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getNetwork'));
|
|
495
551
|
case 1:
|
|
496
552
|
case "end":
|
|
497
|
-
return
|
|
553
|
+
return _context15.stop();
|
|
498
554
|
}
|
|
499
|
-
},
|
|
555
|
+
}, _callee15, this);
|
|
500
556
|
}));
|
|
501
557
|
function getNetwork() {
|
|
502
558
|
return _getNetwork.apply(this, arguments);
|
|
@@ -506,16 +562,16 @@ var Server = exports.Server = function () {
|
|
|
506
562
|
}, {
|
|
507
563
|
key: "getLatestLedger",
|
|
508
564
|
value: (function () {
|
|
509
|
-
var _getLatestLedger = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
510
|
-
return _regeneratorRuntime().wrap(function
|
|
511
|
-
while (1) switch (
|
|
565
|
+
var _getLatestLedger = _asyncToGenerator(_regeneratorRuntime().mark(function _callee16() {
|
|
566
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
567
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
512
568
|
case 0:
|
|
513
|
-
return
|
|
569
|
+
return _context16.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getLatestLedger'));
|
|
514
570
|
case 1:
|
|
515
571
|
case "end":
|
|
516
|
-
return
|
|
572
|
+
return _context16.stop();
|
|
517
573
|
}
|
|
518
|
-
},
|
|
574
|
+
}, _callee16, this);
|
|
519
575
|
}));
|
|
520
576
|
function getLatestLedger() {
|
|
521
577
|
return _getLatestLedger.apply(this, arguments);
|
|
@@ -525,18 +581,18 @@ var Server = exports.Server = function () {
|
|
|
525
581
|
}, {
|
|
526
582
|
key: "simulateTransaction",
|
|
527
583
|
value: (function () {
|
|
528
|
-
var _simulateTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
529
|
-
return _regeneratorRuntime().wrap(function
|
|
530
|
-
while (1) switch (
|
|
584
|
+
var _simulateTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee17(tx, addlResources) {
|
|
585
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
586
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
531
587
|
case 0:
|
|
532
|
-
return
|
|
588
|
+
return _context17.abrupt("return", this._simulateTransaction(tx, addlResources).then(_parsers.parseRawSimulation));
|
|
533
589
|
case 1:
|
|
534
590
|
case "end":
|
|
535
|
-
return
|
|
591
|
+
return _context17.stop();
|
|
536
592
|
}
|
|
537
|
-
},
|
|
593
|
+
}, _callee17, this);
|
|
538
594
|
}));
|
|
539
|
-
function simulateTransaction(
|
|
595
|
+
function simulateTransaction(_x14, _x15) {
|
|
540
596
|
return _simulateTransaction2.apply(this, arguments);
|
|
541
597
|
}
|
|
542
598
|
return simulateTransaction;
|
|
@@ -544,11 +600,11 @@ var Server = exports.Server = function () {
|
|
|
544
600
|
}, {
|
|
545
601
|
key: "_simulateTransaction",
|
|
546
602
|
value: function () {
|
|
547
|
-
var _simulateTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
548
|
-
return _regeneratorRuntime().wrap(function
|
|
549
|
-
while (1) switch (
|
|
603
|
+
var _simulateTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee18(transaction, addlResources) {
|
|
604
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
605
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
550
606
|
case 0:
|
|
551
|
-
return
|
|
607
|
+
return _context18.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'simulateTransaction', _objectSpread({
|
|
552
608
|
transaction: transaction.toXDR()
|
|
553
609
|
}, addlResources !== undefined && {
|
|
554
610
|
resourceConfig: {
|
|
@@ -557,11 +613,11 @@ var Server = exports.Server = function () {
|
|
|
557
613
|
})));
|
|
558
614
|
case 1:
|
|
559
615
|
case "end":
|
|
560
|
-
return
|
|
616
|
+
return _context18.stop();
|
|
561
617
|
}
|
|
562
|
-
},
|
|
618
|
+
}, _callee18, this);
|
|
563
619
|
}));
|
|
564
|
-
function _simulateTransaction(
|
|
620
|
+
function _simulateTransaction(_x16, _x17) {
|
|
565
621
|
return _simulateTransaction3.apply(this, arguments);
|
|
566
622
|
}
|
|
567
623
|
return _simulateTransaction;
|
|
@@ -569,29 +625,29 @@ var Server = exports.Server = function () {
|
|
|
569
625
|
}, {
|
|
570
626
|
key: "prepareTransaction",
|
|
571
627
|
value: (function () {
|
|
572
|
-
var _prepareTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
628
|
+
var _prepareTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee19(tx) {
|
|
573
629
|
var simResponse;
|
|
574
|
-
return _regeneratorRuntime().wrap(function
|
|
575
|
-
while (1) switch (
|
|
630
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
631
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
576
632
|
case 0:
|
|
577
|
-
|
|
633
|
+
_context19.next = 2;
|
|
578
634
|
return this.simulateTransaction(tx);
|
|
579
635
|
case 2:
|
|
580
|
-
simResponse =
|
|
636
|
+
simResponse = _context19.sent;
|
|
581
637
|
if (!_api.Api.isSimulationError(simResponse)) {
|
|
582
|
-
|
|
638
|
+
_context19.next = 5;
|
|
583
639
|
break;
|
|
584
640
|
}
|
|
585
641
|
throw new Error(simResponse.error);
|
|
586
642
|
case 5:
|
|
587
|
-
return
|
|
643
|
+
return _context19.abrupt("return", (0, _transaction.assembleTransaction)(tx, simResponse).build());
|
|
588
644
|
case 6:
|
|
589
645
|
case "end":
|
|
590
|
-
return
|
|
646
|
+
return _context19.stop();
|
|
591
647
|
}
|
|
592
|
-
},
|
|
648
|
+
}, _callee19, this);
|
|
593
649
|
}));
|
|
594
|
-
function prepareTransaction(
|
|
650
|
+
function prepareTransaction(_x18) {
|
|
595
651
|
return _prepareTransaction.apply(this, arguments);
|
|
596
652
|
}
|
|
597
653
|
return prepareTransaction;
|
|
@@ -599,18 +655,18 @@ var Server = exports.Server = function () {
|
|
|
599
655
|
}, {
|
|
600
656
|
key: "sendTransaction",
|
|
601
657
|
value: (function () {
|
|
602
|
-
var _sendTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
603
|
-
return _regeneratorRuntime().wrap(function
|
|
604
|
-
while (1) switch (
|
|
658
|
+
var _sendTransaction2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee20(transaction) {
|
|
659
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
660
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
605
661
|
case 0:
|
|
606
|
-
return
|
|
662
|
+
return _context20.abrupt("return", this._sendTransaction(transaction).then(_parsers.parseRawSendTransaction));
|
|
607
663
|
case 1:
|
|
608
664
|
case "end":
|
|
609
|
-
return
|
|
665
|
+
return _context20.stop();
|
|
610
666
|
}
|
|
611
|
-
},
|
|
667
|
+
}, _callee20, this);
|
|
612
668
|
}));
|
|
613
|
-
function sendTransaction(
|
|
669
|
+
function sendTransaction(_x19) {
|
|
614
670
|
return _sendTransaction2.apply(this, arguments);
|
|
615
671
|
}
|
|
616
672
|
return sendTransaction;
|
|
@@ -618,20 +674,20 @@ var Server = exports.Server = function () {
|
|
|
618
674
|
}, {
|
|
619
675
|
key: "_sendTransaction",
|
|
620
676
|
value: function () {
|
|
621
|
-
var _sendTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
622
|
-
return _regeneratorRuntime().wrap(function
|
|
623
|
-
while (1) switch (
|
|
677
|
+
var _sendTransaction3 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee21(transaction) {
|
|
678
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
679
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
624
680
|
case 0:
|
|
625
|
-
return
|
|
681
|
+
return _context21.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'sendTransaction', {
|
|
626
682
|
transaction: transaction.toXDR()
|
|
627
683
|
}));
|
|
628
684
|
case 1:
|
|
629
685
|
case "end":
|
|
630
|
-
return
|
|
686
|
+
return _context21.stop();
|
|
631
687
|
}
|
|
632
|
-
},
|
|
688
|
+
}, _callee21, this);
|
|
633
689
|
}));
|
|
634
|
-
function _sendTransaction(
|
|
690
|
+
function _sendTransaction(_x20) {
|
|
635
691
|
return _sendTransaction3.apply(this, arguments);
|
|
636
692
|
}
|
|
637
693
|
return _sendTransaction;
|
|
@@ -639,58 +695,58 @@ var Server = exports.Server = function () {
|
|
|
639
695
|
}, {
|
|
640
696
|
key: "requestAirdrop",
|
|
641
697
|
value: (function () {
|
|
642
|
-
var _requestAirdrop = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
698
|
+
var _requestAirdrop = _asyncToGenerator(_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
|
|
643
699
|
var account, response, meta, sequence, _error$response, _error$response$detai;
|
|
644
|
-
return _regeneratorRuntime().wrap(function
|
|
645
|
-
while (1) switch (
|
|
700
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
701
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
646
702
|
case 0:
|
|
647
703
|
account = typeof address === 'string' ? address : address.accountId();
|
|
648
|
-
|
|
649
|
-
if (
|
|
650
|
-
|
|
704
|
+
_context22.t0 = friendbotUrl;
|
|
705
|
+
if (_context22.t0) {
|
|
706
|
+
_context22.next = 6;
|
|
651
707
|
break;
|
|
652
708
|
}
|
|
653
|
-
|
|
709
|
+
_context22.next = 5;
|
|
654
710
|
return this.getNetwork();
|
|
655
711
|
case 5:
|
|
656
|
-
|
|
712
|
+
_context22.t0 = _context22.sent.friendbotUrl;
|
|
657
713
|
case 6:
|
|
658
|
-
friendbotUrl =
|
|
714
|
+
friendbotUrl = _context22.t0;
|
|
659
715
|
if (friendbotUrl) {
|
|
660
|
-
|
|
716
|
+
_context22.next = 9;
|
|
661
717
|
break;
|
|
662
718
|
}
|
|
663
719
|
throw new Error('No friendbot URL configured for current network');
|
|
664
720
|
case 9:
|
|
665
|
-
|
|
666
|
-
|
|
721
|
+
_context22.prev = 9;
|
|
722
|
+
_context22.next = 12;
|
|
667
723
|
return _axios.default.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
|
|
668
724
|
case 12:
|
|
669
|
-
response =
|
|
725
|
+
response = _context22.sent;
|
|
670
726
|
meta = _stellarBase.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
|
|
671
727
|
sequence = findCreatedAccountSequenceInTransactionMeta(meta);
|
|
672
|
-
return
|
|
728
|
+
return _context22.abrupt("return", new _stellarBase.Account(account, sequence));
|
|
673
729
|
case 18:
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
if (!(((_error$response =
|
|
677
|
-
|
|
730
|
+
_context22.prev = 18;
|
|
731
|
+
_context22.t1 = _context22["catch"](9);
|
|
732
|
+
if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
|
|
733
|
+
_context22.next = 23;
|
|
678
734
|
break;
|
|
679
735
|
}
|
|
680
|
-
if (!((_error$response$detai =
|
|
681
|
-
|
|
736
|
+
if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
|
|
737
|
+
_context22.next = 23;
|
|
682
738
|
break;
|
|
683
739
|
}
|
|
684
|
-
return
|
|
740
|
+
return _context22.abrupt("return", this.getAccount(account));
|
|
685
741
|
case 23:
|
|
686
|
-
throw
|
|
742
|
+
throw _context22.t1;
|
|
687
743
|
case 24:
|
|
688
744
|
case "end":
|
|
689
|
-
return
|
|
745
|
+
return _context22.stop();
|
|
690
746
|
}
|
|
691
|
-
},
|
|
747
|
+
}, _callee22, this, [[9, 18]]);
|
|
692
748
|
}));
|
|
693
|
-
function requestAirdrop(
|
|
749
|
+
function requestAirdrop(_x21, _x22) {
|
|
694
750
|
return _requestAirdrop.apply(this, arguments);
|
|
695
751
|
}
|
|
696
752
|
return requestAirdrop;
|
|
@@ -698,16 +754,16 @@ var Server = exports.Server = function () {
|
|
|
698
754
|
}, {
|
|
699
755
|
key: "getFeeStats",
|
|
700
756
|
value: (function () {
|
|
701
|
-
var _getFeeStats = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
702
|
-
return _regeneratorRuntime().wrap(function
|
|
703
|
-
while (1) switch (
|
|
757
|
+
var _getFeeStats = _asyncToGenerator(_regeneratorRuntime().mark(function _callee23() {
|
|
758
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
759
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
704
760
|
case 0:
|
|
705
|
-
return
|
|
761
|
+
return _context23.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getFeeStats'));
|
|
706
762
|
case 1:
|
|
707
763
|
case "end":
|
|
708
|
-
return
|
|
764
|
+
return _context23.stop();
|
|
709
765
|
}
|
|
710
|
-
},
|
|
766
|
+
}, _callee23, this);
|
|
711
767
|
}));
|
|
712
768
|
function getFeeStats() {
|
|
713
769
|
return _getFeeStats.apply(this, arguments);
|
|
@@ -717,21 +773,105 @@ var Server = exports.Server = function () {
|
|
|
717
773
|
}, {
|
|
718
774
|
key: "getVersionInfo",
|
|
719
775
|
value: (function () {
|
|
720
|
-
var _getVersionInfo = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
721
|
-
return _regeneratorRuntime().wrap(function
|
|
722
|
-
while (1) switch (
|
|
776
|
+
var _getVersionInfo = _asyncToGenerator(_regeneratorRuntime().mark(function _callee24() {
|
|
777
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
778
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
723
779
|
case 0:
|
|
724
|
-
return
|
|
780
|
+
return _context24.abrupt("return", jsonrpc.postObject(this.serverURL.toString(), 'getVersionInfo'));
|
|
725
781
|
case 1:
|
|
726
782
|
case "end":
|
|
727
|
-
return
|
|
783
|
+
return _context24.stop();
|
|
728
784
|
}
|
|
729
|
-
},
|
|
785
|
+
}, _callee24, this);
|
|
730
786
|
}));
|
|
731
787
|
function getVersionInfo() {
|
|
732
788
|
return _getVersionInfo.apply(this, arguments);
|
|
733
789
|
}
|
|
734
790
|
return getVersionInfo;
|
|
735
791
|
}())
|
|
792
|
+
}, {
|
|
793
|
+
key: "getSACBalance",
|
|
794
|
+
value: (function () {
|
|
795
|
+
var _getSACBalance = _asyncToGenerator(_regeneratorRuntime().mark(function _callee25(contractId, sac, networkPassphrase) {
|
|
796
|
+
var passphrase, sacId, key, ledgerKey, response, _response$entries$2, lastModifiedLedgerSeq, liveUntilLedgerSeq, val, entry;
|
|
797
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
798
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
799
|
+
case 0:
|
|
800
|
+
if (_stellarBase.StrKey.isValidContract(contractId)) {
|
|
801
|
+
_context25.next = 2;
|
|
802
|
+
break;
|
|
803
|
+
}
|
|
804
|
+
throw new TypeError("expected contract ID, got ".concat(contractId));
|
|
805
|
+
case 2:
|
|
806
|
+
if (!(networkPassphrase !== null && networkPassphrase !== void 0)) {
|
|
807
|
+
_context25.next = 6;
|
|
808
|
+
break;
|
|
809
|
+
}
|
|
810
|
+
_context25.t0 = networkPassphrase;
|
|
811
|
+
_context25.next = 9;
|
|
812
|
+
break;
|
|
813
|
+
case 6:
|
|
814
|
+
_context25.next = 8;
|
|
815
|
+
return this.getNetwork().then(function (n) {
|
|
816
|
+
return n.passphrase;
|
|
817
|
+
});
|
|
818
|
+
case 8:
|
|
819
|
+
_context25.t0 = _context25.sent;
|
|
820
|
+
case 9:
|
|
821
|
+
passphrase = _context25.t0;
|
|
822
|
+
sacId = sac.contractId(passphrase);
|
|
823
|
+
key = _stellarBase.xdr.ScVal.scvVec([(0, _stellarBase.nativeToScVal)("Balance", {
|
|
824
|
+
type: "symbol"
|
|
825
|
+
}), (0, _stellarBase.nativeToScVal)(contractId, {
|
|
826
|
+
type: "address"
|
|
827
|
+
})]);
|
|
828
|
+
ledgerKey = _stellarBase.xdr.LedgerKey.contractData(new _stellarBase.xdr.LedgerKeyContractData({
|
|
829
|
+
contract: new _stellarBase.Address(sacId).toScAddress(),
|
|
830
|
+
durability: _stellarBase.xdr.ContractDataDurability.persistent(),
|
|
831
|
+
key: key
|
|
832
|
+
}));
|
|
833
|
+
_context25.next = 15;
|
|
834
|
+
return this.getLedgerEntries(ledgerKey);
|
|
835
|
+
case 15:
|
|
836
|
+
response = _context25.sent;
|
|
837
|
+
if (!(response.entries.length === 0)) {
|
|
838
|
+
_context25.next = 18;
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
return _context25.abrupt("return", {
|
|
842
|
+
latestLedger: response.latestLedger
|
|
843
|
+
});
|
|
844
|
+
case 18:
|
|
845
|
+
_response$entries$2 = response.entries[0], lastModifiedLedgerSeq = _response$entries$2.lastModifiedLedgerSeq, liveUntilLedgerSeq = _response$entries$2.liveUntilLedgerSeq, val = _response$entries$2.val;
|
|
846
|
+
if (!(val.switch().value !== _stellarBase.xdr.LedgerEntryType.contractData().value)) {
|
|
847
|
+
_context25.next = 21;
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
return _context25.abrupt("return", {
|
|
851
|
+
latestLedger: response.latestLedger
|
|
852
|
+
});
|
|
853
|
+
case 21:
|
|
854
|
+
entry = (0, _stellarBase.scValToNative)(val.contractData().val());
|
|
855
|
+
return _context25.abrupt("return", {
|
|
856
|
+
latestLedger: response.latestLedger,
|
|
857
|
+
balanceEntry: {
|
|
858
|
+
liveUntilLedgerSeq: liveUntilLedgerSeq,
|
|
859
|
+
lastModifiedLedgerSeq: lastModifiedLedgerSeq,
|
|
860
|
+
amount: entry.amount.toString(),
|
|
861
|
+
authorized: entry.authorized,
|
|
862
|
+
clawback: entry.clawback
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
case 23:
|
|
866
|
+
case "end":
|
|
867
|
+
return _context25.stop();
|
|
868
|
+
}
|
|
869
|
+
}, _callee25, this);
|
|
870
|
+
}));
|
|
871
|
+
function getSACBalance(_x23, _x24, _x25) {
|
|
872
|
+
return _getSACBalance.apply(this, arguments);
|
|
873
|
+
}
|
|
874
|
+
return getSACBalance;
|
|
875
|
+
}())
|
|
736
876
|
}]);
|
|
737
877
|
}();
|