@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/transaction.d.ts
CHANGED
|
@@ -3,17 +3,19 @@ import { Api } from './api';
|
|
|
3
3
|
/**
|
|
4
4
|
* Combines the given raw transaction alongside the simulation results.
|
|
5
5
|
* If the given transaction already has authorization entries in a host
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* function invocation (see {@link Operation.invokeHostFunction}), **the
|
|
7
|
+
* simulation entries are ignored**.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* @
|
|
11
|
-
*
|
|
9
|
+
* If the given transaction already has authorization entries in a host function
|
|
10
|
+
* invocation (see {@link Operation.invokeHostFunction}), **the simulation
|
|
11
|
+
* entries are ignored**.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
14
|
-
*
|
|
13
|
+
* @param {Transaction|FeeBumpTransaction} raw the initial transaction, w/o simulation applied
|
|
14
|
+
* @param {Api.SimulateTransactionResponse|Api.RawSimulateTransactionResponse} simulation the Soroban RPC simulation result (see {@link module:rpc.Server#simulateTransaction})
|
|
15
|
+
* @returns {TransactionBuilder} a new, cloned transaction with the proper auth and resource (fee, footprint) simulation data applied
|
|
15
16
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @see {Server
|
|
17
|
+
* @memberof module:rpc
|
|
18
|
+
* @see {@link module:rpc.Server#simulateTransaction}
|
|
19
|
+
* @see {@link module:rpc.Server#prepareTransaction}
|
|
18
20
|
*/
|
|
19
21
|
export declare function assembleTransaction(raw: Transaction | FeeBumpTransaction, simulation: Api.SimulateTransactionResponse | Api.RawSimulateTransactionResponse): TransactionBuilder;
|
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
import { Networks } from "@stellar/stellar-base";
|
|
2
|
-
/**
|
|
2
|
+
/** @module StellarToml */
|
|
3
|
+
/**
|
|
4
|
+
* The maximum size of stellar.toml file, in bytes
|
|
5
|
+
* @constant {number}
|
|
6
|
+
* @default 102400
|
|
7
|
+
*/
|
|
3
8
|
export declare const STELLAR_TOML_MAX_SIZE: number;
|
|
4
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Resolver allows resolving `stellar.toml` files.
|
|
11
|
+
* @memberof module:StellarToml
|
|
12
|
+
* @hideconstructor
|
|
13
|
+
*/
|
|
5
14
|
export declare class Resolver {
|
|
6
15
|
/**
|
|
7
16
|
* Returns a parsed `stellar.toml` file for a given domain.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
17
|
+
* @see {@link https://developers.stellar.org/docs/tokens/publishing-asset-info | Stellar.toml doc}
|
|
18
|
+
*
|
|
19
|
+
* @param {string} domain Domain to get stellar.toml file for
|
|
20
|
+
* @param {object} [opts] Options object
|
|
21
|
+
* @param {boolean} [opts.allowHttp=false] - Allow connecting to http servers. This must be set to false in production deployments!
|
|
22
|
+
* @param {number} [opts.timeout=0] - Allow a timeout. Allows user to avoid nasty lag due to TOML resolve issue.
|
|
23
|
+
* @returns {Promise} A `Promise` that resolves to the parsed stellar.toml object
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* StellarSdk.StellarToml.Resolver.resolve('acme.com')
|
|
10
27
|
* .then(stellarToml => {
|
|
11
28
|
* // stellarToml in an object representing domain stellar.toml file.
|
|
12
29
|
* })
|
|
13
30
|
* .catch(error => {
|
|
14
31
|
* // stellar.toml does not exist or is invalid
|
|
15
32
|
* });
|
|
16
|
-
* ```
|
|
17
|
-
* @see <a href="https://developers.stellar.org/docs/issuing-assets/publishing-asset-info/" target="_blank">Stellar.toml doc</a>
|
|
18
|
-
* @param {string} domain Domain to get stellar.toml file for
|
|
19
|
-
* @param {object} [opts] Options object
|
|
20
|
-
* @param {boolean} [opts.allowHttp] - Allow connecting to http servers, default: `false`. This must be set to false in production deployments!
|
|
21
|
-
* @param {number} [opts.timeout] - Allow a timeout, default: 0. Allows user to avoid nasty lag due to TOML resolve issue.
|
|
22
|
-
* @returns {Promise} A `Promise` that resolves to the parsed stellar.toml object
|
|
23
33
|
*/
|
|
24
34
|
static resolve(domain: string, opts?: Api.StellarTomlResolveOptions): Promise<Api.StellarToml>;
|
|
25
35
|
}
|
package/lib/stellartoml/index.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.STELLAR_TOML_MAX_SIZE = exports.Resolver = exports.Api = void 0;
|
|
7
|
-
var _axios = _interopRequireDefault(require("axios"));
|
|
8
7
|
var _toml = _interopRequireDefault(require("toml"));
|
|
8
|
+
var _httpClient = require("../http-client");
|
|
9
9
|
var _config = require("../config");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
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); }
|
|
@@ -18,7 +18,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
19
|
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); }
|
|
20
20
|
var STELLAR_TOML_MAX_SIZE = exports.STELLAR_TOML_MAX_SIZE = 100 * 1024;
|
|
21
|
-
var CancelToken =
|
|
21
|
+
var CancelToken = _httpClient.httpClient.CancelToken;
|
|
22
22
|
var Resolver = exports.Resolver = function () {
|
|
23
23
|
function Resolver() {
|
|
24
24
|
_classCallCheck(this, Resolver);
|
|
@@ -39,7 +39,7 @@ var Resolver = exports.Resolver = function () {
|
|
|
39
39
|
allowHttp = typeof opts.allowHttp === "undefined" ? _config.Config.isAllowHttp() : opts.allowHttp;
|
|
40
40
|
timeout = typeof opts.timeout === "undefined" ? _config.Config.getTimeout() : opts.timeout;
|
|
41
41
|
protocol = allowHttp ? "http" : "https";
|
|
42
|
-
return _context.abrupt("return",
|
|
42
|
+
return _context.abrupt("return", _httpClient.httpClient.get("".concat(protocol, "://").concat(domain, "/.well-known/stellar.toml"), {
|
|
43
43
|
maxContentLength: STELLAR_TOML_MAX_SIZE,
|
|
44
44
|
cancelToken: timeout ? new CancelToken(function (cancel) {
|
|
45
45
|
return setTimeout(function () {
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { Transaction } from "@stellar/stellar-base";
|
|
2
|
+
/**
|
|
3
|
+
* Miscellaneous utilities.
|
|
4
|
+
*
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
2
7
|
export declare class Utils {
|
|
3
8
|
/**
|
|
4
|
-
* Verifies if the current date is within the transaction's
|
|
9
|
+
* Verifies if the current date is within the transaction's timebounds
|
|
10
|
+
*
|
|
11
|
+
* @param {Transaction} transaction The transaction whose timebounds will be validated.
|
|
12
|
+
* @param {number} [gracePeriod=0] An additional window of time that should be considered valid on either end of the transaction's time range.
|
|
13
|
+
*
|
|
14
|
+
* @returns {boolean} Returns true if the current time is within the transaction's [minTime, maxTime] range.
|
|
5
15
|
*
|
|
6
16
|
* @static
|
|
7
|
-
* @function
|
|
8
|
-
* @param {Transaction} transaction the transaction whose timebonds will be validated.
|
|
9
|
-
* @returns {boolean} returns true if the current time is within the transaction's [minTime, maxTime] range.
|
|
10
17
|
*/
|
|
11
18
|
static validateTimebounds(transaction: Transaction, gracePeriod?: number): boolean;
|
|
19
|
+
static sleep(ms: number): Promise<void>;
|
|
12
20
|
}
|
package/lib/utils.js
CHANGED
|
@@ -27,5 +27,12 @@ var Utils = exports.Utils = function () {
|
|
|
27
27
|
maxTime = _transaction$timeBoun.maxTime;
|
|
28
28
|
return now >= Number.parseInt(minTime, 10) - gracePeriod && now <= Number.parseInt(maxTime, 10) + gracePeriod;
|
|
29
29
|
}
|
|
30
|
+
}, {
|
|
31
|
+
key: "sleep",
|
|
32
|
+
value: function sleep(ms) {
|
|
33
|
+
return new Promise(function (resolve) {
|
|
34
|
+
return setTimeout(resolve, ms);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
30
37
|
}]);
|
|
31
38
|
}();
|
package/lib/webauth/errors.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InvalidChallengeError is raised when a challenge transaction does not meet
|
|
3
|
+
* the requirements for a SEP-10 challenge transaction (for example, a non-zero
|
|
4
|
+
* sequence number).
|
|
5
|
+
* @memberof module:WebAuth
|
|
6
|
+
* @category Errors
|
|
7
|
+
*
|
|
8
|
+
* @param {string} message Human-readable error message.
|
|
9
|
+
*/
|
|
1
10
|
export declare class InvalidChallengeError extends Error {
|
|
2
11
|
__proto__: InvalidChallengeError;
|
|
3
12
|
constructor(message: string);
|
package/lib/webauth/utils.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stellar Web Authentication
|
|
3
|
+
* @module WebAuth
|
|
4
|
+
* @see {@link https://stellar.org/protocol-10 | SEP-10 Specification}
|
|
5
|
+
*/
|
|
1
6
|
import { FeeBumpTransaction, Keypair, Transaction } from "@stellar/stellar-base";
|
|
2
7
|
import { ServerApi } from "../horizon/server_api";
|
|
3
8
|
/**
|
|
4
|
-
* Returns a valid
|
|
5
|
-
* transaction which you can use for Stellar Web Authentication.
|
|
6
|
-
*
|
|
7
|
-
* @function
|
|
8
|
-
* @memberof WebAuth
|
|
9
|
+
* Returns a valid {@link https://stellar.org/protocol/sep-10 | SEP-10}
|
|
10
|
+
* challenge transaction which you can use for Stellar Web Authentication.
|
|
9
11
|
*
|
|
10
12
|
* @param {Keypair} serverKeypair Keypair for server's signing account.
|
|
11
13
|
* @param {string} clientAccountID The stellar account (G...) or muxed account
|
|
@@ -26,13 +28,17 @@ import { ServerApi } from "../horizon/server_api";
|
|
|
26
28
|
* @param {string} [clientSigningKey] The public key assigned to the SIGNING_KEY
|
|
27
29
|
* attribute specified on the stellar.toml hosted on the client domain. Only
|
|
28
30
|
* necessary when the 'client_domain' parameter is passed.
|
|
29
|
-
*
|
|
30
31
|
* @returns {string} A base64 encoded string of the raw TransactionEnvelope xdr
|
|
31
32
|
* struct for the transaction.
|
|
32
|
-
* @
|
|
33
|
+
* @throws {Error} Will throw if `clientAccountID is a muxed account, and `memo`
|
|
34
|
+
* is present.
|
|
35
|
+
* @throws {Error} Will throw if `clientDomain` is provided, but
|
|
36
|
+
* `clientSigningKey` is missing
|
|
37
|
+
*
|
|
38
|
+
* @see {@link https://stellar.org/protocol/sep-10 | SEP-10: Stellar Web Auth}
|
|
33
39
|
*
|
|
34
40
|
* @example
|
|
35
|
-
* import { Keypair, Networks, WebAuth }
|
|
41
|
+
* import { Keypair, Networks, WebAuth } from 'stellar-sdk'
|
|
36
42
|
*
|
|
37
43
|
* let serverKeyPair = Keypair.fromSecret("server-secret")
|
|
38
44
|
* let challenge = WebAuth.buildChallengeTx(
|
|
@@ -44,7 +50,21 @@ import { ServerApi } from "../horizon/server_api";
|
|
|
44
50
|
*/
|
|
45
51
|
export declare function buildChallengeTx(serverKeypair: Keypair, clientAccountID: string, homeDomain: string, timeout: number | undefined, networkPassphrase: string, webAuthDomain: string, memo?: string | null, clientDomain?: string | null, clientSigningKey?: string | null): string;
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
53
|
+
* A parsed and validated challenge transaction, and some of its constituent details.
|
|
54
|
+
* @memberof module:WebAuth
|
|
55
|
+
*/
|
|
56
|
+
export type ChallengeTxDetails = {
|
|
57
|
+
/** The challenge transaction. */
|
|
58
|
+
tx: Transaction;
|
|
59
|
+
/** The Stellar public key (master key) used to sign the Manage Data operation. */
|
|
60
|
+
clientAccountId: string;
|
|
61
|
+
/** The matched home domain. */
|
|
62
|
+
matchedHomeDomain: string;
|
|
63
|
+
/** The memo attached to the transaction, which will be null if not present */
|
|
64
|
+
memo?: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Reads a SEP-10 challenge transaction and returns the decoded transaction and
|
|
48
68
|
* client account ID contained within.
|
|
49
69
|
*
|
|
50
70
|
* It also verifies that the transaction has been signed by the server.
|
|
@@ -52,29 +72,26 @@ export declare function buildChallengeTx(serverKeypair: Keypair, clientAccountID
|
|
|
52
72
|
* It does not verify that the transaction has been signed by the client or that
|
|
53
73
|
* any signatures other than the server's on the transaction are valid. Use one
|
|
54
74
|
* of the following functions to completely verify the transaction:
|
|
55
|
-
* - {@link verifyChallengeTxThreshold}
|
|
56
|
-
* - {@link verifyChallengeTxSigners}
|
|
57
75
|
*
|
|
58
|
-
* @
|
|
59
|
-
* @
|
|
76
|
+
* - {@link module:WebAuth~verifyChallengeTxThreshold}
|
|
77
|
+
* - {@link module:WebAuth~verifyChallengeTxSigners}
|
|
60
78
|
*
|
|
61
79
|
* @param {string} challengeTx SEP0010 challenge transaction in base64.
|
|
62
80
|
* @param {string} serverAccountID The server's stellar account (public key).
|
|
63
81
|
* @param {string} networkPassphrase The network passphrase, e.g.: 'Test SDF
|
|
64
82
|
* Network ; September 2015' (see {@link Networks})
|
|
65
|
-
* @param {string|string
|
|
66
|
-
* included in the first Manage Data operation's string key. If an
|
|
67
|
-
* provided, one of the domain names in the array must match.
|
|
83
|
+
* @param {string | Array.<string>} homeDomains The home domain that is expected
|
|
84
|
+
* to be included in the first Manage Data operation's string key. If an
|
|
85
|
+
* array is provided, one of the domain names in the array must match.
|
|
68
86
|
* @param {string} webAuthDomain The home domain that is expected to be included
|
|
69
87
|
* as the value of the Manage Data operation with the 'web_auth_domain' key.
|
|
70
88
|
* If no such operation is included, this parameter is not used.
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* stellar public key (master key) used to sign the Manage Data operation,
|
|
89
|
+
* @returns {module:WebAuth.ChallengeTxDetails} The actual transaction and the
|
|
90
|
+
* Stellar public key (master key) used to sign the Manage Data operation,
|
|
74
91
|
* the matched home domain, and the memo attached to the transaction, which
|
|
75
92
|
* will be null if not present.
|
|
76
93
|
*
|
|
77
|
-
* @see
|
|
94
|
+
* @see {@link https://stellar.org/protocol/sep-10 | SEP-10: Stellar Web Auth}
|
|
78
95
|
*/
|
|
79
96
|
export declare function readChallengeTx(challengeTx: string, serverAccountID: string, networkPassphrase: string, homeDomains: string | string[], webAuthDomain: string): {
|
|
80
97
|
tx: Transaction;
|
|
@@ -93,38 +110,39 @@ export declare function readChallengeTx(challengeTx: string, serverAccountID: st
|
|
|
93
110
|
* ignored.
|
|
94
111
|
*
|
|
95
112
|
* Errors will be raised if:
|
|
96
|
-
* - The transaction is invalid according to
|
|
113
|
+
* - The transaction is invalid according to
|
|
114
|
+
* {@link module:WebAuth~readChallengeTx}.
|
|
97
115
|
* - No client signatures are found on the transaction.
|
|
98
116
|
* - One or more signatures in the transaction are not identifiable as the
|
|
99
117
|
* server account or one of the signers provided in the arguments.
|
|
100
118
|
* - The signatures are all valid but do not meet the threshold.
|
|
101
119
|
*
|
|
102
|
-
* @function
|
|
103
|
-
* @memberof WebAuth
|
|
104
|
-
*
|
|
105
120
|
* @param {string} challengeTx SEP0010 challenge transaction in base64.
|
|
106
121
|
* @param {string} serverAccountID The server's stellar account (public key).
|
|
107
122
|
* @param {string} networkPassphrase The network passphrase, e.g.: 'Test SDF
|
|
108
123
|
* Network ; September 2015' (see {@link Networks}).
|
|
109
124
|
* @param {number} threshold The required signatures threshold for verifying
|
|
110
125
|
* this transaction.
|
|
111
|
-
* @param {ServerApi.AccountRecordSigners
|
|
126
|
+
* @param {Array.<ServerApi.AccountRecordSigners>} signerSummary a map of all
|
|
112
127
|
* authorized signers to their weights. It's used to validate if the
|
|
113
128
|
* transaction signatures have met the given threshold.
|
|
114
|
-
* @param {string|string
|
|
115
|
-
* included in the first Manage Data operation's string key. Required in
|
|
129
|
+
* @param {string | Array.<string>} homeDomains The home domain(s) that should
|
|
130
|
+
* be included in the first Manage Data operation's string key. Required in
|
|
116
131
|
* verifyChallengeTxSigners() => readChallengeTx().
|
|
117
132
|
* @param {string} webAuthDomain The home domain that is expected to be included
|
|
118
133
|
* as the value of the Manage Data operation with the 'web_auth_domain' key,
|
|
119
134
|
* if present. Used in verifyChallengeTxSigners() => readChallengeTx().
|
|
135
|
+
* @returns {Array.<string>} The list of signers public keys that have signed
|
|
136
|
+
* the transaction, excluding the server account ID, given that the threshold
|
|
137
|
+
* was met.
|
|
138
|
+
* @throws {module:WebAuth.InvalidChallengeError} Will throw if the collective
|
|
139
|
+
* weight of the transaction's signers does not meet the necessary threshold
|
|
140
|
+
* to verify this transaction.
|
|
120
141
|
*
|
|
121
|
-
* @
|
|
122
|
-
* transaction, excluding the server account ID, given that the threshold was
|
|
123
|
-
* met.
|
|
142
|
+
* @see {@link https://stellar.org/protocol/sep-10 | SEP-10: Stellar Web Auth}
|
|
124
143
|
*
|
|
125
|
-
* @see [SEP-10: Stellar Web Auth](https://stellar.org/protocol/sep-10).
|
|
126
144
|
* @example
|
|
127
|
-
* import { Networks, TransactionBuilder, WebAuth }
|
|
145
|
+
* import { Networks, TransactionBuilder, WebAuth } from 'stellar-sdk';
|
|
128
146
|
*
|
|
129
147
|
* const serverKP = Keypair.random();
|
|
130
148
|
* const clientKP1 = Keypair.random();
|
|
@@ -186,30 +204,28 @@ export declare function verifyChallengeTxThreshold(challengeTx: string, serverAc
|
|
|
186
204
|
* ignored.
|
|
187
205
|
*
|
|
188
206
|
* Errors will be raised if:
|
|
189
|
-
* - The transaction is invalid according to
|
|
207
|
+
* - The transaction is invalid according to
|
|
208
|
+
* {@link module:WebAuth~readChallengeTx}.
|
|
190
209
|
* - No client signatures are found on the transaction.
|
|
191
210
|
* - One or more signatures in the transaction are not identifiable as the
|
|
192
211
|
* server account or one of the signers provided in the arguments.
|
|
193
212
|
*
|
|
194
|
-
* @function
|
|
195
|
-
* @memberof WebAuth
|
|
196
|
-
*
|
|
197
213
|
* @param {string} challengeTx SEP0010 challenge transaction in base64.
|
|
198
214
|
* @param {string} serverAccountID The server's stellar account (public key).
|
|
199
215
|
* @param {string} networkPassphrase The network passphrase, e.g.: 'Test SDF
|
|
200
216
|
* Network ; September 2015' (see {@link Networks}).
|
|
201
|
-
* @param {string
|
|
202
|
-
* the public keys for all signers that have signed the transaction.
|
|
203
|
-
* @param {string|string
|
|
204
|
-
* included in the first Manage Data operation's string key. Required in
|
|
217
|
+
* @param {Array.<string>} signers The signers public keys. This list should
|
|
218
|
+
* contain the public keys for all signers that have signed the transaction.
|
|
219
|
+
* @param {string | Array.<string>} [homeDomains] The home domain(s) that should
|
|
220
|
+
* be included in the first Manage Data operation's string key. Required in
|
|
205
221
|
* readChallengeTx().
|
|
206
222
|
* @param {string} webAuthDomain The home domain that is expected to be included
|
|
207
223
|
* as the value of the Manage Data operation with the 'web_auth_domain' key,
|
|
208
224
|
* if present. Used in readChallengeTx().
|
|
209
|
-
* @returns {string
|
|
210
|
-
* transaction, excluding the server account ID.
|
|
225
|
+
* @returns {Array.<string>} The list of signers public keys that have signed
|
|
226
|
+
* the transaction, excluding the server account ID.
|
|
211
227
|
*
|
|
212
|
-
* @see
|
|
228
|
+
* @see {@link https://stellar.org/protocol/sep-10|SEP-10: Stellar Web Auth}
|
|
213
229
|
* @example
|
|
214
230
|
* import { Networks, TransactionBuilder, WebAuth } from 'stellar-sdk';
|
|
215
231
|
*
|
|
@@ -249,11 +265,10 @@ export declare function verifyChallengeTxSigners(challengeTx: string, serverAcco
|
|
|
249
265
|
/**
|
|
250
266
|
* Verifies if a transaction was signed by the given account id.
|
|
251
267
|
*
|
|
252
|
-
* @
|
|
253
|
-
* @
|
|
254
|
-
* @
|
|
255
|
-
*
|
|
256
|
-
* @returns {boolean}.
|
|
268
|
+
* @param {Transaction | FeeBumpTransaction} transaction The signed transaction.
|
|
269
|
+
* @param {string} accountID The signer's public key.
|
|
270
|
+
* @returns {boolean} Whether or not `accountID` was found to have signed the
|
|
271
|
+
* transaction.
|
|
257
272
|
*
|
|
258
273
|
* @example
|
|
259
274
|
* let keypair = Keypair.random();
|
|
@@ -272,12 +287,10 @@ export declare function verifyTxSignedBy(transaction: FeeBumpTransaction | Trans
|
|
|
272
287
|
* returning a list of non-repeated signers that were found to have signed the
|
|
273
288
|
* given transaction.
|
|
274
289
|
*
|
|
275
|
-
* @
|
|
276
|
-
* @
|
|
277
|
-
* @
|
|
278
|
-
*
|
|
279
|
-
* @returns {string[]} a list of signers that were found to have signed the
|
|
280
|
-
* transaction.
|
|
290
|
+
* @param {Transaction | FeeBumpTransaction} transaction The signed transaction.
|
|
291
|
+
* @param {Array.<string>} signers The signer's public keys.
|
|
292
|
+
* @returns {Array.<string>} A list of signers that were found to have signed
|
|
293
|
+
* the transaction.
|
|
281
294
|
*
|
|
282
295
|
* @example
|
|
283
296
|
* let keypair1 = Keypair.random();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stellar/stellar-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0-rc.1",
|
|
4
4
|
"description": "A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stellar"
|
|
@@ -36,28 +36,77 @@
|
|
|
36
36
|
"./rpc": {
|
|
37
37
|
"types": "./lib/rpc/index.d.ts",
|
|
38
38
|
"default": "./lib/rpc/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./no-axios": {
|
|
41
|
+
"browser": "./dist/stellar-sdk-no-axios.min.js",
|
|
42
|
+
"types": "./lib/no-axios/index.d.ts",
|
|
43
|
+
"default": "./lib/no-axios/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./no-axios/contract": {
|
|
46
|
+
"types": "./lib/no-axios/contract/index.d.ts",
|
|
47
|
+
"default": "./lib/no-axios/contract/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./no-axios/rpc": {
|
|
50
|
+
"types": "./lib/no-axios/rpc/index.d.ts",
|
|
51
|
+
"default": "./lib/no-axios/rpc/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./no-eventsource": {
|
|
54
|
+
"browser": "./dist/stellar-sdk-no-eventsource.min.js",
|
|
55
|
+
"types": "./lib/no-eventsource/index.d.ts",
|
|
56
|
+
"default": "./lib/no-eventsource/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./no-eventsource/contract": {
|
|
59
|
+
"types": "./lib/no-eventsource/contract/index.d.ts",
|
|
60
|
+
"default": "./lib/no-eventsource/contract/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./no-eventsource/rpc": {
|
|
63
|
+
"types": "./lib/no-eventsource/rpc/index.d.ts",
|
|
64
|
+
"default": "./lib/no-eventsource/rpc/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./minimal": {
|
|
67
|
+
"browser": "./dist/stellar-sdk-minimal.min.js",
|
|
68
|
+
"types": "./lib/minimal/index.d.ts",
|
|
69
|
+
"default": "./lib/minimal/index.js"
|
|
70
|
+
},
|
|
71
|
+
"./minimal/contract": {
|
|
72
|
+
"types": "./lib/minimal/contract/index.d.ts",
|
|
73
|
+
"default": "./lib/minimal/contract/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./minimal/rpc": {
|
|
76
|
+
"types": "./lib/minimal/rpc/index.d.ts",
|
|
77
|
+
"default": "./lib/minimal/rpc/index.js"
|
|
39
78
|
}
|
|
40
79
|
},
|
|
41
80
|
"scripts": {
|
|
42
81
|
"build": "cross-env NODE_ENV=development yarn _build",
|
|
43
82
|
"build:prod": "cross-env NODE_ENV=production yarn _build",
|
|
44
83
|
"build:node": "yarn _babel && yarn build:ts",
|
|
45
|
-
"build:
|
|
84
|
+
"build:node:no-axios": "cross-env OUTPUT_DIR=lib/no-axios USE_AXIOS=false yarn build:node",
|
|
85
|
+
"build:node:no-eventsource": "cross-env OUTPUT_DIR=lib/no-eventsource USE_EVENTSOURCE=false yarn build:node",
|
|
86
|
+
"build:node:minimal": "cross-env OUTPUT_DIR=lib/minimal USE_AXIOS=false USE_EVENTSOURCE=false yarn build:node",
|
|
87
|
+
"build:node:all": "yarn build:node && yarn build:node:no-axios && yarn build:node:no-eventsource && yarn build:node:minimal",
|
|
88
|
+
"clean:temp": "rm -f ./config/tsconfig.tmp.json",
|
|
89
|
+
"build:ts": "node config/set-output-dir.js && tsc -p ./config/tsconfig.tmp.json && yarn clean:temp",
|
|
46
90
|
"build:test": "tsc -p ./test/unit/tsconfig.json",
|
|
47
91
|
"build:browser": "webpack -c config/webpack.config.browser.js",
|
|
92
|
+
"build:browser:no-axios": "cross-env USE_AXIOS=false webpack -c config/webpack.config.browser.js",
|
|
93
|
+
"build:browser:no-eventsource": "cross-env USE_EVENTSOURCE=false webpack -c config/webpack.config.browser.js",
|
|
94
|
+
"build:browser:minimal": "cross-env USE_AXIOS=false USE_EVENTSOURCE=false webpack -c config/webpack.config.browser.js",
|
|
95
|
+
"build:browser:all": "yarn build:browser && cross-env no_clean=true yarn build:browser:no-axios && cross-env no_clean=true yarn build:browser:no-eventsource && cross-env no_clean=true yarn build:browser:minimal",
|
|
48
96
|
"build:docs": "cross-env NODE_ENV=docs yarn _babel",
|
|
49
97
|
"clean": "rm -rf lib/ dist/ coverage/ .nyc_output/ jsdoc/ test/e2e/.soroban",
|
|
50
|
-
"docs": "yarn build:docs && jsdoc -c ./config/.jsdoc.json
|
|
98
|
+
"docs": "yarn build:docs && jsdoc -c ./config/.jsdoc.json",
|
|
51
99
|
"test": "yarn build:test && yarn test:node && yarn test:integration && yarn test:browser",
|
|
52
100
|
"test:e2e": "./test/e2e/initialize.sh && yarn _nyc mocha --recursive 'test/e2e/src/test-*.js'",
|
|
53
101
|
"test:node": "yarn _nyc mocha --recursive 'test/unit/**/*.js'",
|
|
54
102
|
"test:integration": "yarn _nyc mocha --recursive 'test/integration/**/*.js'",
|
|
55
103
|
"test:browser": "karma start config/karma.conf.js",
|
|
104
|
+
"test:browser:no-axios": "cross-env USE_AXIOS=false yarn build:browser && cross-env USE_AXIOS=false karma start config/karma.conf.js",
|
|
56
105
|
"fmt": "yarn _prettier && yarn eslint -c .eslintrc.js src/ --fix",
|
|
57
106
|
"preversion": "yarn clean && yarn _prettier && yarn build:prod && yarn test",
|
|
58
107
|
"prepare": "yarn build:prod",
|
|
59
|
-
"_build": "yarn build:node && yarn build:test && yarn build:browser",
|
|
60
|
-
"_babel": "babel --extensions '.ts' --out-dir lib
|
|
108
|
+
"_build": "yarn build:node:all && yarn build:test && yarn build:browser:all",
|
|
109
|
+
"_babel": "babel --extensions '.ts' --out-dir ${OUTPUT_DIR:-lib} src/",
|
|
61
110
|
"_nyc": "nyc --nycrc-path config/.nycrc",
|
|
62
111
|
"_prettier": "prettier --ignore-path config/.prettierignore --write './test/**/*.js'"
|
|
63
112
|
},
|
|
@@ -93,21 +142,21 @@
|
|
|
93
142
|
]
|
|
94
143
|
},
|
|
95
144
|
"devDependencies": {
|
|
96
|
-
"@babel/cli": "^7.25.
|
|
97
|
-
"@babel/core": "^7.
|
|
98
|
-
"@babel/eslint-plugin": "^7.
|
|
99
|
-
"@babel/preset-env": "^7.
|
|
100
|
-
"@babel/preset-typescript": "^7.
|
|
101
|
-
"@babel/register": "^7.
|
|
102
|
-
"@definitelytyped/dtslint": "^0.2.
|
|
145
|
+
"@babel/cli": "^7.25.9",
|
|
146
|
+
"@babel/core": "^7.26.0",
|
|
147
|
+
"@babel/eslint-plugin": "^7.25.9",
|
|
148
|
+
"@babel/preset-env": "^7.26.0",
|
|
149
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
150
|
+
"@babel/register": "^7.25.9",
|
|
151
|
+
"@definitelytyped/dtslint": "^0.2.27",
|
|
103
152
|
"@istanbuljs/nyc-config-babel": "3.0.0",
|
|
104
153
|
"@stellar/tsconfig": "^1.0.2",
|
|
105
154
|
"@types/chai": "^4.3.19",
|
|
106
155
|
"@types/detect-node": "^2.0.0",
|
|
107
156
|
"@types/eventsource": "^1.1.12",
|
|
108
157
|
"@types/json-schema": "^7.0.15",
|
|
109
|
-
"@types/lodash": "^4.17.
|
|
110
|
-
"@types/mocha": "^10.0.
|
|
158
|
+
"@types/lodash": "^4.17.13",
|
|
159
|
+
"@types/mocha": "^10.0.9",
|
|
111
160
|
"@types/node": "^20.14.11",
|
|
112
161
|
"@types/randombytes": "^2.0.1",
|
|
113
162
|
"@types/sinon": "^17.0.2",
|
|
@@ -116,6 +165,8 @@
|
|
|
116
165
|
"axios-mock-adapter": "^1.22.0",
|
|
117
166
|
"babel-loader": "^9.1.3",
|
|
118
167
|
"babel-plugin-istanbul": "^7.0.0",
|
|
168
|
+
"babel-plugin-transform-define": "^2.1.4",
|
|
169
|
+
"better-docs": "^2.7.3",
|
|
119
170
|
"buffer": "^6.0.3",
|
|
120
171
|
"chai": "^4.3.10",
|
|
121
172
|
"chai-as-promised": "^7.1.1",
|
|
@@ -134,8 +185,8 @@
|
|
|
134
185
|
"eslint-webpack-plugin": "^4.2.0",
|
|
135
186
|
"ghooks": "^2.0.4",
|
|
136
187
|
"husky": "^9.1.6",
|
|
137
|
-
"jsdoc": "^4.0.
|
|
138
|
-
"json-schema-faker": "^0.5.
|
|
188
|
+
"jsdoc": "^4.0.4",
|
|
189
|
+
"json-schema-faker": "^0.5.8",
|
|
139
190
|
"karma": "^6.4.3",
|
|
140
191
|
"karma-chai": "^0.1.0",
|
|
141
192
|
"karma-chrome-launcher": "^3.1.0",
|
|
@@ -146,9 +197,9 @@
|
|
|
146
197
|
"karma-webpack": "^5.0.1",
|
|
147
198
|
"lint-staged": "^15.2.10",
|
|
148
199
|
"lodash": "^4.17.21",
|
|
149
|
-
"
|
|
150
|
-
"mocha": "^10.6.0",
|
|
200
|
+
"mocha": "^10.8.2",
|
|
151
201
|
"node-polyfill-webpack-plugin": "^3.0.0",
|
|
202
|
+
"null-loader": "^4.0.1",
|
|
152
203
|
"nyc": "^17.0.0",
|
|
153
204
|
"prettier": "^3.3.3",
|
|
154
205
|
"randombytes": "^2.1.0",
|
|
@@ -157,15 +208,16 @@
|
|
|
157
208
|
"taffydb": "^2.7.3",
|
|
158
209
|
"terser-webpack-plugin": "^5.3.10",
|
|
159
210
|
"ts-node": "^10.9.2",
|
|
160
|
-
"typescript": "^5.6.
|
|
161
|
-
"webpack": "^5.
|
|
211
|
+
"typescript": "^5.6.3",
|
|
212
|
+
"webpack": "^5.96.1",
|
|
162
213
|
"webpack-cli": "^5.0.1"
|
|
163
214
|
},
|
|
164
215
|
"dependencies": {
|
|
165
|
-
"@stellar/stellar-base": "^
|
|
216
|
+
"@stellar/stellar-base": "^13.0.0",
|
|
166
217
|
"axios": "^1.7.7",
|
|
167
218
|
"bignumber.js": "^9.1.2",
|
|
168
219
|
"eventsource": "^2.0.2",
|
|
220
|
+
"feaxios": "^0.0.20",
|
|
169
221
|
"randombytes": "^2.1.0",
|
|
170
222
|
"toml": "^3.0.0",
|
|
171
223
|
"urijs": "^1.19.1"
|
package/lib/errors.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { HorizonApi } from "./horizon/horizon_api";
|
|
2
|
-
export declare class NetworkError extends Error {
|
|
3
|
-
response: {
|
|
4
|
-
data?: HorizonApi.ErrorResponseData;
|
|
5
|
-
status?: number;
|
|
6
|
-
statusText?: string;
|
|
7
|
-
url?: string;
|
|
8
|
-
};
|
|
9
|
-
__proto__: NetworkError;
|
|
10
|
-
constructor(message: string, response: any);
|
|
11
|
-
getResponse(): {
|
|
12
|
-
data?: HorizonApi.ErrorResponseData;
|
|
13
|
-
status?: number;
|
|
14
|
-
statusText?: string;
|
|
15
|
-
url?: string;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export declare class NotFoundError extends NetworkError {
|
|
19
|
-
constructor(message: string, response: any);
|
|
20
|
-
}
|
|
21
|
-
export declare class BadRequestError extends NetworkError {
|
|
22
|
-
constructor(message: string, response: any);
|
|
23
|
-
}
|
|
24
|
-
export declare class BadResponseError extends NetworkError {
|
|
25
|
-
constructor(message: string, response: any);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* AccountRequiresMemoError is raised when a transaction is trying to submit an
|
|
29
|
-
* operation to an account which requires a memo. See
|
|
30
|
-
* [SEP0029](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md)
|
|
31
|
-
* for more information.
|
|
32
|
-
*
|
|
33
|
-
* This error contains two attributes to help you identify the account requiring
|
|
34
|
-
* the memo and the operation where the account is the destination
|
|
35
|
-
*
|
|
36
|
-
* ```
|
|
37
|
-
* console.log('The following account requires a memo ', err.accountId)
|
|
38
|
-
* console.log('The account is used in operation: ', err.operationIndex)
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
export declare class AccountRequiresMemoError extends Error {
|
|
43
|
-
__proto__: AccountRequiresMemoError;
|
|
44
|
-
/**
|
|
45
|
-
* accountId account which requires a memo.
|
|
46
|
-
*/
|
|
47
|
-
accountId: string;
|
|
48
|
-
/**
|
|
49
|
-
* operationIndex operation where accountId is the destination.
|
|
50
|
-
*/
|
|
51
|
-
operationIndex: number;
|
|
52
|
-
/**
|
|
53
|
-
* Create an AccountRequiresMemoError
|
|
54
|
-
* @param {message} message - error message
|
|
55
|
-
* @param {string} accountId - The account which requires a memo.
|
|
56
|
-
* @param {number} operationIndex - The index of the operation where `accountId` is the destination.
|
|
57
|
-
*/
|
|
58
|
-
constructor(message: string, accountId: string, operationIndex: number);
|
|
59
|
-
}
|