@stellar/stellar-sdk 14.2.0 → 14.3.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 +21 -0
- package/dist/stellar-sdk-minimal.js +273 -210
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +273 -210
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +273 -210
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +273 -210
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.js +9 -4
- package/lib/contract/client.d.ts +1 -1
- package/lib/contract/client.js +25 -14
- package/lib/contract/sent_transaction.js +9 -4
- package/lib/contract/spec.js +10 -2
- package/lib/contract/types.d.ts +9 -1
- package/lib/errors/account_requires_memo.d.ts +0 -1
- package/lib/errors/account_requires_memo.js +0 -4
- package/lib/errors/bad_request.d.ts +0 -1
- package/lib/errors/bad_request.js +2 -8
- package/lib/errors/bad_response.d.ts +0 -1
- package/lib/errors/bad_response.js +2 -8
- package/lib/errors/network.d.ts +0 -1
- package/lib/errors/network.js +0 -3
- package/lib/errors/not_found.d.ts +0 -1
- package/lib/errors/not_found.js +2 -8
- package/lib/horizon/account_call_builder.d.ts +2 -1
- package/lib/horizon/account_call_builder.js +3 -3
- package/lib/horizon/assets_call_builder.d.ts +2 -1
- package/lib/horizon/assets_call_builder.js +2 -2
- package/lib/horizon/call_builder.d.ts +3 -1
- package/lib/horizon/call_builder.js +4 -3
- package/lib/horizon/claimable_balances_call_builder.d.ts +2 -1
- package/lib/horizon/claimable_balances_call_builder.js +3 -3
- package/lib/horizon/effect_call_builder.d.ts +2 -1
- package/lib/horizon/effect_call_builder.js +2 -2
- package/lib/horizon/friendbot_builder.d.ts +2 -1
- package/lib/horizon/friendbot_builder.js +2 -2
- package/lib/horizon/horizon_axios_client.d.ts +2 -2
- package/lib/horizon/horizon_axios_client.js +38 -30
- package/lib/horizon/index.d.ts +1 -1
- package/lib/horizon/index.js +1 -10
- package/lib/horizon/ledger_call_builder.d.ts +2 -1
- package/lib/horizon/ledger_call_builder.js +2 -2
- package/lib/horizon/liquidity_pool_call_builder.d.ts +2 -1
- package/lib/horizon/liquidity_pool_call_builder.js +3 -3
- package/lib/horizon/offer_call_builder.d.ts +2 -1
- package/lib/horizon/offer_call_builder.js +3 -3
- package/lib/horizon/operation_call_builder.d.ts +2 -1
- package/lib/horizon/operation_call_builder.js +3 -3
- package/lib/horizon/orderbook_call_builder.d.ts +2 -1
- package/lib/horizon/orderbook_call_builder.js +2 -2
- package/lib/horizon/path_call_builder.d.ts +2 -1
- package/lib/horizon/path_call_builder.js +2 -2
- package/lib/horizon/payment_call_builder.d.ts +2 -1
- package/lib/horizon/payment_call_builder.js +2 -2
- package/lib/horizon/server.d.ts +25 -10
- package/lib/horizon/server.js +23 -30
- package/lib/horizon/strict_receive_path_call_builder.d.ts +2 -1
- package/lib/horizon/strict_receive_path_call_builder.js +2 -2
- package/lib/horizon/strict_send_path_call_builder.d.ts +2 -1
- package/lib/horizon/strict_send_path_call_builder.js +2 -2
- package/lib/horizon/trade_aggregation_call_builder.d.ts +2 -1
- package/lib/horizon/trade_aggregation_call_builder.js +2 -2
- package/lib/horizon/trades_call_builder.d.ts +2 -1
- package/lib/horizon/trades_call_builder.js +2 -2
- package/lib/horizon/transaction_call_builder.d.ts +2 -1
- package/lib/horizon/transaction_call_builder.js +3 -3
- package/lib/minimal/contract/assembled_transaction.js +9 -4
- package/lib/minimal/contract/client.d.ts +1 -1
- package/lib/minimal/contract/client.js +25 -14
- package/lib/minimal/contract/sent_transaction.js +9 -4
- package/lib/minimal/contract/spec.js +10 -2
- package/lib/minimal/contract/types.d.ts +9 -1
- package/lib/minimal/errors/account_requires_memo.d.ts +0 -1
- package/lib/minimal/errors/account_requires_memo.js +0 -4
- package/lib/minimal/errors/bad_request.d.ts +0 -1
- package/lib/minimal/errors/bad_request.js +2 -8
- package/lib/minimal/errors/bad_response.d.ts +0 -1
- package/lib/minimal/errors/bad_response.js +2 -8
- package/lib/minimal/errors/network.d.ts +0 -1
- package/lib/minimal/errors/network.js +0 -3
- package/lib/minimal/errors/not_found.d.ts +0 -1
- package/lib/minimal/errors/not_found.js +2 -8
- package/lib/minimal/horizon/account_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/account_call_builder.js +3 -3
- package/lib/minimal/horizon/assets_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/assets_call_builder.js +2 -2
- package/lib/minimal/horizon/call_builder.d.ts +3 -1
- package/lib/minimal/horizon/call_builder.js +4 -3
- package/lib/minimal/horizon/claimable_balances_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/claimable_balances_call_builder.js +3 -3
- package/lib/minimal/horizon/effect_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/effect_call_builder.js +2 -2
- package/lib/minimal/horizon/friendbot_builder.d.ts +2 -1
- package/lib/minimal/horizon/friendbot_builder.js +2 -2
- package/lib/minimal/horizon/horizon_axios_client.d.ts +2 -2
- package/lib/minimal/horizon/horizon_axios_client.js +38 -30
- package/lib/minimal/horizon/index.d.ts +1 -1
- package/lib/minimal/horizon/index.js +1 -10
- package/lib/minimal/horizon/ledger_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/ledger_call_builder.js +2 -2
- package/lib/minimal/horizon/liquidity_pool_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/liquidity_pool_call_builder.js +3 -3
- package/lib/minimal/horizon/offer_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/offer_call_builder.js +3 -3
- package/lib/minimal/horizon/operation_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/operation_call_builder.js +3 -3
- package/lib/minimal/horizon/orderbook_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/orderbook_call_builder.js +2 -2
- package/lib/minimal/horizon/path_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/path_call_builder.js +2 -2
- package/lib/minimal/horizon/payment_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/payment_call_builder.js +2 -2
- package/lib/minimal/horizon/server.d.ts +25 -10
- package/lib/minimal/horizon/server.js +23 -30
- package/lib/minimal/horizon/strict_receive_path_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/strict_receive_path_call_builder.js +2 -2
- package/lib/minimal/horizon/strict_send_path_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/strict_send_path_call_builder.js +2 -2
- package/lib/minimal/horizon/trade_aggregation_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/trade_aggregation_call_builder.js +2 -2
- package/lib/minimal/horizon/trades_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/trades_call_builder.js +2 -2
- package/lib/minimal/horizon/transaction_call_builder.d.ts +2 -1
- package/lib/minimal/horizon/transaction_call_builder.js +3 -3
- package/lib/minimal/rpc/api.d.ts +132 -0
- package/lib/minimal/rpc/axios.d.ts +1 -2
- package/lib/minimal/rpc/axios.js +17 -9
- package/lib/minimal/rpc/index.d.ts +0 -1
- package/lib/minimal/rpc/index.js +0 -9
- package/lib/minimal/rpc/jsonrpc.d.ts +2 -1
- package/lib/minimal/rpc/jsonrpc.js +4 -6
- package/lib/minimal/rpc/parsers.d.ts +1 -0
- package/lib/minimal/rpc/parsers.js +23 -0
- package/lib/minimal/rpc/server.d.ts +82 -20
- package/lib/minimal/rpc/server.js +56 -19
- package/lib/minimal/webauth/errors.d.ts +0 -2
- package/lib/minimal/webauth/errors.js +2 -8
- package/lib/no-axios/contract/assembled_transaction.js +9 -4
- package/lib/no-axios/contract/client.d.ts +1 -1
- package/lib/no-axios/contract/client.js +25 -14
- package/lib/no-axios/contract/sent_transaction.js +9 -4
- package/lib/no-axios/contract/spec.js +10 -2
- package/lib/no-axios/contract/types.d.ts +9 -1
- package/lib/no-axios/errors/account_requires_memo.d.ts +0 -1
- package/lib/no-axios/errors/account_requires_memo.js +0 -4
- package/lib/no-axios/errors/bad_request.d.ts +0 -1
- package/lib/no-axios/errors/bad_request.js +2 -8
- package/lib/no-axios/errors/bad_response.d.ts +0 -1
- package/lib/no-axios/errors/bad_response.js +2 -8
- package/lib/no-axios/errors/network.d.ts +0 -1
- package/lib/no-axios/errors/network.js +0 -3
- package/lib/no-axios/errors/not_found.d.ts +0 -1
- package/lib/no-axios/errors/not_found.js +2 -8
- package/lib/no-axios/horizon/account_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/account_call_builder.js +3 -3
- package/lib/no-axios/horizon/assets_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/assets_call_builder.js +2 -2
- package/lib/no-axios/horizon/call_builder.d.ts +3 -1
- package/lib/no-axios/horizon/call_builder.js +4 -3
- package/lib/no-axios/horizon/claimable_balances_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/claimable_balances_call_builder.js +3 -3
- package/lib/no-axios/horizon/effect_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/effect_call_builder.js +2 -2
- package/lib/no-axios/horizon/friendbot_builder.d.ts +2 -1
- package/lib/no-axios/horizon/friendbot_builder.js +2 -2
- package/lib/no-axios/horizon/horizon_axios_client.d.ts +2 -2
- package/lib/no-axios/horizon/horizon_axios_client.js +38 -30
- package/lib/no-axios/horizon/index.d.ts +1 -1
- package/lib/no-axios/horizon/index.js +1 -10
- package/lib/no-axios/horizon/ledger_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/ledger_call_builder.js +2 -2
- package/lib/no-axios/horizon/liquidity_pool_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/liquidity_pool_call_builder.js +3 -3
- package/lib/no-axios/horizon/offer_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/offer_call_builder.js +3 -3
- package/lib/no-axios/horizon/operation_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/operation_call_builder.js +3 -3
- package/lib/no-axios/horizon/orderbook_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/orderbook_call_builder.js +2 -2
- package/lib/no-axios/horizon/path_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/path_call_builder.js +2 -2
- package/lib/no-axios/horizon/payment_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/payment_call_builder.js +2 -2
- package/lib/no-axios/horizon/server.d.ts +25 -10
- package/lib/no-axios/horizon/server.js +23 -30
- package/lib/no-axios/horizon/strict_receive_path_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/strict_receive_path_call_builder.js +2 -2
- package/lib/no-axios/horizon/strict_send_path_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/strict_send_path_call_builder.js +2 -2
- package/lib/no-axios/horizon/trade_aggregation_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/trade_aggregation_call_builder.js +2 -2
- package/lib/no-axios/horizon/trades_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/trades_call_builder.js +2 -2
- package/lib/no-axios/horizon/transaction_call_builder.d.ts +2 -1
- package/lib/no-axios/horizon/transaction_call_builder.js +3 -3
- package/lib/no-axios/rpc/api.d.ts +132 -0
- package/lib/no-axios/rpc/axios.d.ts +1 -2
- package/lib/no-axios/rpc/axios.js +17 -9
- package/lib/no-axios/rpc/index.d.ts +0 -1
- package/lib/no-axios/rpc/index.js +0 -9
- package/lib/no-axios/rpc/jsonrpc.d.ts +2 -1
- package/lib/no-axios/rpc/jsonrpc.js +4 -6
- package/lib/no-axios/rpc/parsers.d.ts +1 -0
- package/lib/no-axios/rpc/parsers.js +23 -0
- package/lib/no-axios/rpc/server.d.ts +82 -20
- package/lib/no-axios/rpc/server.js +56 -19
- package/lib/no-axios/webauth/errors.d.ts +0 -2
- package/lib/no-axios/webauth/errors.js +2 -8
- package/lib/no-eventsource/contract/assembled_transaction.js +9 -4
- package/lib/no-eventsource/contract/client.d.ts +1 -1
- package/lib/no-eventsource/contract/client.js +25 -14
- package/lib/no-eventsource/contract/sent_transaction.js +9 -4
- package/lib/no-eventsource/contract/spec.js +10 -2
- package/lib/no-eventsource/contract/types.d.ts +9 -1
- package/lib/no-eventsource/errors/account_requires_memo.d.ts +0 -1
- package/lib/no-eventsource/errors/account_requires_memo.js +0 -4
- package/lib/no-eventsource/errors/bad_request.d.ts +0 -1
- package/lib/no-eventsource/errors/bad_request.js +2 -8
- package/lib/no-eventsource/errors/bad_response.d.ts +0 -1
- package/lib/no-eventsource/errors/bad_response.js +2 -8
- package/lib/no-eventsource/errors/network.d.ts +0 -1
- package/lib/no-eventsource/errors/network.js +0 -3
- package/lib/no-eventsource/errors/not_found.d.ts +0 -1
- package/lib/no-eventsource/errors/not_found.js +2 -8
- package/lib/no-eventsource/horizon/account_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/account_call_builder.js +3 -3
- package/lib/no-eventsource/horizon/assets_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/assets_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/call_builder.d.ts +3 -1
- package/lib/no-eventsource/horizon/call_builder.js +4 -3
- package/lib/no-eventsource/horizon/claimable_balances_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/claimable_balances_call_builder.js +3 -3
- package/lib/no-eventsource/horizon/effect_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/effect_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/friendbot_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/friendbot_builder.js +2 -2
- package/lib/no-eventsource/horizon/horizon_axios_client.d.ts +2 -2
- package/lib/no-eventsource/horizon/horizon_axios_client.js +38 -30
- package/lib/no-eventsource/horizon/index.d.ts +1 -1
- package/lib/no-eventsource/horizon/index.js +1 -10
- package/lib/no-eventsource/horizon/ledger_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/ledger_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/liquidity_pool_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/liquidity_pool_call_builder.js +3 -3
- package/lib/no-eventsource/horizon/offer_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/offer_call_builder.js +3 -3
- package/lib/no-eventsource/horizon/operation_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/operation_call_builder.js +3 -3
- package/lib/no-eventsource/horizon/orderbook_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/orderbook_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/path_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/path_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/payment_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/payment_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/server.d.ts +25 -10
- package/lib/no-eventsource/horizon/server.js +23 -30
- package/lib/no-eventsource/horizon/strict_receive_path_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/strict_receive_path_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/strict_send_path_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/strict_send_path_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/trade_aggregation_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/trade_aggregation_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/trades_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/trades_call_builder.js +2 -2
- package/lib/no-eventsource/horizon/transaction_call_builder.d.ts +2 -1
- package/lib/no-eventsource/horizon/transaction_call_builder.js +3 -3
- package/lib/no-eventsource/rpc/api.d.ts +132 -0
- package/lib/no-eventsource/rpc/axios.d.ts +1 -2
- package/lib/no-eventsource/rpc/axios.js +17 -9
- package/lib/no-eventsource/rpc/index.d.ts +0 -1
- package/lib/no-eventsource/rpc/index.js +0 -9
- package/lib/no-eventsource/rpc/jsonrpc.d.ts +2 -1
- package/lib/no-eventsource/rpc/jsonrpc.js +4 -6
- package/lib/no-eventsource/rpc/parsers.d.ts +1 -0
- package/lib/no-eventsource/rpc/parsers.js +23 -0
- package/lib/no-eventsource/rpc/server.d.ts +82 -20
- package/lib/no-eventsource/rpc/server.js +56 -19
- package/lib/no-eventsource/webauth/errors.d.ts +0 -2
- package/lib/no-eventsource/webauth/errors.js +2 -8
- package/lib/rpc/api.d.ts +132 -0
- package/lib/rpc/axios.d.ts +1 -2
- package/lib/rpc/axios.js +17 -9
- package/lib/rpc/index.d.ts +0 -1
- package/lib/rpc/index.js +0 -9
- package/lib/rpc/jsonrpc.d.ts +2 -1
- package/lib/rpc/jsonrpc.js +4 -6
- package/lib/rpc/parsers.d.ts +1 -0
- package/lib/rpc/parsers.js +23 -0
- package/lib/rpc/server.d.ts +82 -20
- package/lib/rpc/server.js +56 -19
- package/lib/webauth/errors.d.ts +0 -2
- package/lib/webauth/errors.js +2 -8
- package/package.json +20 -45
|
@@ -5597,8 +5597,7 @@ function sent_transaction_toPrimitive(t, r) { if ("object" != sent_transaction_t
|
|
|
5597
5597
|
|
|
5598
5598
|
var SentTransaction = function () {
|
|
5599
5599
|
function SentTransaction(assembled) {
|
|
5600
|
-
var _this = this
|
|
5601
|
-
_this$assembled$optio2;
|
|
5600
|
+
var _this = this;
|
|
5602
5601
|
sent_transaction_classCallCheck(this, SentTransaction);
|
|
5603
5602
|
_defineProperty(this, "send", function () {
|
|
5604
5603
|
var _ref = sent_transaction_asyncToGenerator(sent_transaction_regenerator().m(function _callee2(watcher) {
|
|
@@ -5655,8 +5654,14 @@ var SentTransaction = function () {
|
|
|
5655
5654
|
};
|
|
5656
5655
|
}());
|
|
5657
5656
|
this.assembled = assembled;
|
|
5658
|
-
|
|
5659
|
-
|
|
5657
|
+
var _this$assembled$optio2 = this.assembled.options,
|
|
5658
|
+
server = _this$assembled$optio2.server,
|
|
5659
|
+
allowHttp = _this$assembled$optio2.allowHttp,
|
|
5660
|
+
headers = _this$assembled$optio2.headers,
|
|
5661
|
+
rpcUrl = _this$assembled$optio2.rpcUrl;
|
|
5662
|
+
this.server = server !== null && server !== void 0 ? server : new rpc.Server(rpcUrl, {
|
|
5663
|
+
allowHttp: allowHttp,
|
|
5664
|
+
headers: headers
|
|
5660
5665
|
});
|
|
5661
5666
|
}
|
|
5662
5667
|
return sent_transaction_createClass(SentTransaction, [{
|
|
@@ -5777,8 +5782,7 @@ function assembled_transaction_toPrimitive(t, r) { if ("object" != assembled_tra
|
|
|
5777
5782
|
var AssembledTransaction = function () {
|
|
5778
5783
|
function AssembledTransaction(options) {
|
|
5779
5784
|
var _this = this,
|
|
5780
|
-
_this$options$simulat
|
|
5781
|
-
_this$options$allowHt;
|
|
5785
|
+
_this$options$simulat;
|
|
5782
5786
|
assembled_transaction_classCallCheck(this, AssembledTransaction);
|
|
5783
5787
|
assembled_transaction_defineProperty(this, "simulate", assembled_transaction_asyncToGenerator(assembled_transaction_regenerator().m(function _callee() {
|
|
5784
5788
|
var _ref2,
|
|
@@ -6134,8 +6138,14 @@ var AssembledTransaction = function () {
|
|
|
6134
6138
|
})));
|
|
6135
6139
|
this.options = options;
|
|
6136
6140
|
this.options.simulate = (_this$options$simulat = this.options.simulate) !== null && _this$options$simulat !== void 0 ? _this$options$simulat : true;
|
|
6137
|
-
|
|
6138
|
-
|
|
6141
|
+
var _this$options = this.options,
|
|
6142
|
+
server = _this$options.server,
|
|
6143
|
+
allowHttp = _this$options.allowHttp,
|
|
6144
|
+
headers = _this$options.headers,
|
|
6145
|
+
rpcUrl = _this$options.rpcUrl;
|
|
6146
|
+
this.server = server !== null && server !== void 0 ? server : new rpc.Server(rpcUrl, {
|
|
6147
|
+
allowHttp: allowHttp,
|
|
6148
|
+
headers: headers
|
|
6139
6149
|
});
|
|
6140
6150
|
}
|
|
6141
6151
|
return assembled_transaction_createClass(AssembledTransaction, [{
|
|
@@ -7151,7 +7161,7 @@ var Spec = function () {
|
|
|
7151
7161
|
}
|
|
7152
7162
|
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeOption().value) {
|
|
7153
7163
|
var opt = ty.option();
|
|
7154
|
-
if (val === undefined) {
|
|
7164
|
+
if (val === null || val === undefined) {
|
|
7155
7165
|
return stellar_base_min.xdr.ScVal.scvVoid();
|
|
7156
7166
|
}
|
|
7157
7167
|
return this.nativeToScVal(val, opt.valueType());
|
|
@@ -7415,12 +7425,20 @@ var Spec = function () {
|
|
|
7415
7425
|
var _this5 = this;
|
|
7416
7426
|
var t = typeDef.switch();
|
|
7417
7427
|
var value = t.value;
|
|
7428
|
+
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeOption().value) {
|
|
7429
|
+
switch (scv.switch().value) {
|
|
7430
|
+
case stellar_base_min.xdr.ScValType.scvVoid().value:
|
|
7431
|
+
return null;
|
|
7432
|
+
default:
|
|
7433
|
+
return this.scValToNative(scv, typeDef.option().valueType());
|
|
7434
|
+
}
|
|
7435
|
+
}
|
|
7418
7436
|
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeUdt().value) {
|
|
7419
7437
|
return this.scValUdtToNative(scv, typeDef.udt());
|
|
7420
7438
|
}
|
|
7421
7439
|
switch (scv.switch().value) {
|
|
7422
7440
|
case stellar_base_min.xdr.ScValType.scvVoid().value:
|
|
7423
|
-
return
|
|
7441
|
+
return null;
|
|
7424
7442
|
case stellar_base_min.xdr.ScValType.scvU64().value:
|
|
7425
7443
|
case stellar_base_min.xdr.ScValType.scvI64().value:
|
|
7426
7444
|
case stellar_base_min.xdr.ScValType.scvU128().value:
|
|
@@ -7671,6 +7689,7 @@ function _specFromWasmHash() {
|
|
|
7671
7689
|
var format,
|
|
7672
7690
|
rpcUrl,
|
|
7673
7691
|
allowHttp,
|
|
7692
|
+
headers,
|
|
7674
7693
|
serverOpts,
|
|
7675
7694
|
server,
|
|
7676
7695
|
wasm,
|
|
@@ -7685,9 +7704,10 @@ function _specFromWasmHash() {
|
|
|
7685
7704
|
}
|
|
7686
7705
|
throw new TypeError("options must contain rpcUrl");
|
|
7687
7706
|
case 1:
|
|
7688
|
-
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
|
|
7707
|
+
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp, headers = options.headers;
|
|
7689
7708
|
serverOpts = {
|
|
7690
|
-
allowHttp: allowHttp
|
|
7709
|
+
allowHttp: allowHttp,
|
|
7710
|
+
headers: headers
|
|
7691
7711
|
};
|
|
7692
7712
|
server = new rpc.Server(rpcUrl, serverOpts);
|
|
7693
7713
|
_context5.n = 2;
|
|
@@ -7720,6 +7740,14 @@ var Client = function () {
|
|
|
7720
7740
|
});
|
|
7721
7741
|
this.spec = spec;
|
|
7722
7742
|
this.options = options;
|
|
7743
|
+
if (options.server === undefined) {
|
|
7744
|
+
var allowHttp = options.allowHttp,
|
|
7745
|
+
headers = options.headers;
|
|
7746
|
+
options.server = new rpc.Server(options.rpcUrl, {
|
|
7747
|
+
allowHttp: allowHttp,
|
|
7748
|
+
headers: headers
|
|
7749
|
+
});
|
|
7750
|
+
}
|
|
7723
7751
|
this.spec.funcs().forEach(function (xdrFn) {
|
|
7724
7752
|
var method = xdrFn.name().toString();
|
|
7725
7753
|
if (method === CONSTRUCTOR_FUNC) {
|
|
@@ -7789,10 +7817,11 @@ var Client = function () {
|
|
|
7789
7817
|
key: "fromWasmHash",
|
|
7790
7818
|
value: (function () {
|
|
7791
7819
|
var _fromWasmHash = client_asyncToGenerator(client_regenerator().m(function _callee2(wasmHash, options) {
|
|
7820
|
+
var _options$server;
|
|
7792
7821
|
var format,
|
|
7793
7822
|
rpcUrl,
|
|
7794
7823
|
allowHttp,
|
|
7795
|
-
|
|
7824
|
+
headers,
|
|
7796
7825
|
server,
|
|
7797
7826
|
wasm,
|
|
7798
7827
|
_args2 = arguments;
|
|
@@ -7806,11 +7835,11 @@ var Client = function () {
|
|
|
7806
7835
|
}
|
|
7807
7836
|
throw new TypeError("options must contain rpcUrl");
|
|
7808
7837
|
case 1:
|
|
7809
|
-
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
|
|
7810
|
-
|
|
7811
|
-
allowHttp: allowHttp
|
|
7812
|
-
|
|
7813
|
-
|
|
7838
|
+
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp, headers = options.headers;
|
|
7839
|
+
server = (_options$server = options.server) !== null && _options$server !== void 0 ? _options$server : new rpc.Server(rpcUrl, {
|
|
7840
|
+
allowHttp: allowHttp,
|
|
7841
|
+
headers: headers
|
|
7842
|
+
});
|
|
7814
7843
|
_context2.n = 2;
|
|
7815
7844
|
return server.getContractWasmByHash(wasmHash, format);
|
|
7816
7845
|
case 2:
|
|
@@ -7849,7 +7878,7 @@ var Client = function () {
|
|
|
7849
7878
|
key: "from",
|
|
7850
7879
|
value: (function () {
|
|
7851
7880
|
var _from = client_asyncToGenerator(client_regenerator().m(function _callee4(options) {
|
|
7852
|
-
var rpcUrl, contractId, allowHttp,
|
|
7881
|
+
var rpcUrl, contractId, allowHttp, headers, server, wasm;
|
|
7853
7882
|
return client_regenerator().w(function (_context4) {
|
|
7854
7883
|
while (1) switch (_context4.n) {
|
|
7855
7884
|
case 0:
|
|
@@ -7859,11 +7888,11 @@ var Client = function () {
|
|
|
7859
7888
|
}
|
|
7860
7889
|
throw new TypeError("options must contain rpcUrl and contractId");
|
|
7861
7890
|
case 1:
|
|
7862
|
-
rpcUrl = options.rpcUrl, contractId = options.contractId, allowHttp = options.allowHttp;
|
|
7863
|
-
|
|
7864
|
-
allowHttp: allowHttp
|
|
7865
|
-
|
|
7866
|
-
|
|
7891
|
+
rpcUrl = options.rpcUrl, contractId = options.contractId, allowHttp = options.allowHttp, headers = options.headers;
|
|
7892
|
+
server = new rpc.Server(rpcUrl, {
|
|
7893
|
+
allowHttp: allowHttp,
|
|
7894
|
+
headers: headers
|
|
7895
|
+
});
|
|
7867
7896
|
_context4.n = 2;
|
|
7868
7897
|
return server.getContractWasmByContractId(contractId);
|
|
7869
7898
|
case 2:
|
|
@@ -8743,15 +8772,9 @@ function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).in
|
|
|
8743
8772
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
8744
8773
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
8745
8774
|
var InvalidChallengeError = function (_Error) {
|
|
8746
|
-
function InvalidChallengeError(
|
|
8747
|
-
var _this;
|
|
8775
|
+
function InvalidChallengeError() {
|
|
8748
8776
|
_classCallCheck(this, InvalidChallengeError);
|
|
8749
|
-
|
|
8750
|
-
_this = _callSuper(this, InvalidChallengeError, [message]);
|
|
8751
|
-
_this.__proto__ = trueProto;
|
|
8752
|
-
_this.constructor = InvalidChallengeError;
|
|
8753
|
-
_this.name = "InvalidChallengeError";
|
|
8754
|
-
return _this;
|
|
8777
|
+
return _callSuper(this, InvalidChallengeError, arguments);
|
|
8755
8778
|
}
|
|
8756
8779
|
_inherits(InvalidChallengeError, _Error);
|
|
8757
8780
|
return _createClass(InvalidChallengeError);
|
|
@@ -9094,7 +9117,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9094
9117
|
// EXPORTS
|
|
9095
9118
|
__webpack_require__.d(__webpack_exports__, {
|
|
9096
9119
|
Api: () => (/* reexport */ api/* Api */.j),
|
|
9097
|
-
AxiosClient: () => (/* reexport */ axios),
|
|
9098
9120
|
BasicSleepStrategy: () => (/* reexport */ BasicSleepStrategy),
|
|
9099
9121
|
Durability: () => (/* reexport */ Durability),
|
|
9100
9122
|
LinearSleepStrategy: () => (/* reexport */ LinearSleepStrategy),
|
|
@@ -9115,29 +9137,35 @@ var stellar_base_min = __webpack_require__(950);
|
|
|
9115
9137
|
// EXTERNAL MODULE: ./src/http-client/index.ts
|
|
9116
9138
|
var http_client = __webpack_require__(371);
|
|
9117
9139
|
;// ./src/rpc/axios.ts
|
|
9140
|
+
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); }
|
|
9141
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9142
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9143
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9144
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9145
|
+
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); }
|
|
9118
9146
|
|
|
9119
|
-
var version = "14.
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
})
|
|
9126
|
-
|
|
9147
|
+
var version = "14.3.1";
|
|
9148
|
+
function createHttpClient(headers) {
|
|
9149
|
+
return (0,http_client/* create */.vt)({
|
|
9150
|
+
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
9151
|
+
"X-Client-Name": "js-stellar-sdk",
|
|
9152
|
+
"X-Client-Version": version
|
|
9153
|
+
})
|
|
9154
|
+
});
|
|
9155
|
+
}
|
|
9127
9156
|
;// ./src/rpc/jsonrpc.ts
|
|
9128
9157
|
function _regenerator() { var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
9129
9158
|
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
9130
9159
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
9131
9160
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
9132
|
-
|
|
9133
9161
|
function jsonrpc_hasOwnProperty(obj, prop) {
|
|
9134
9162
|
return obj.hasOwnProperty(prop);
|
|
9135
9163
|
}
|
|
9136
|
-
function postObject(_x, _x2) {
|
|
9164
|
+
function postObject(_x, _x2, _x3) {
|
|
9137
9165
|
return _postObject.apply(this, arguments);
|
|
9138
9166
|
}
|
|
9139
9167
|
function _postObject() {
|
|
9140
|
-
_postObject = _asyncToGenerator(_regenerator().m(function _callee(url, method) {
|
|
9168
|
+
_postObject = _asyncToGenerator(_regenerator().m(function _callee(client, url, method) {
|
|
9141
9169
|
var param,
|
|
9142
9170
|
response,
|
|
9143
9171
|
_response$data,
|
|
@@ -9145,9 +9173,9 @@ function _postObject() {
|
|
|
9145
9173
|
return _regenerator().w(function (_context) {
|
|
9146
9174
|
while (1) switch (_context.n) {
|
|
9147
9175
|
case 0:
|
|
9148
|
-
param = _args.length >
|
|
9176
|
+
param = _args.length > 3 && _args[3] !== undefined ? _args[3] : null;
|
|
9149
9177
|
_context.n = 1;
|
|
9150
|
-
return
|
|
9178
|
+
return client.post(url, {
|
|
9151
9179
|
jsonrpc: "2.0",
|
|
9152
9180
|
id: 1,
|
|
9153
9181
|
method: method,
|
|
@@ -9177,19 +9205,19 @@ var parsers = __webpack_require__(784);
|
|
|
9177
9205
|
var utils = __webpack_require__(121);
|
|
9178
9206
|
;// ./src/rpc/server.ts
|
|
9179
9207
|
/* provided dependency */ var Buffer = __webpack_require__(287)["Buffer"];
|
|
9180
|
-
function
|
|
9181
|
-
function
|
|
9182
|
-
function
|
|
9183
|
-
function
|
|
9208
|
+
function server_typeof(o) { "@babel/helpers - typeof"; return server_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; }, server_typeof(o); }
|
|
9209
|
+
function server_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9210
|
+
function server_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? server_ownKeys(Object(t), !0).forEach(function (r) { server_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : server_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9211
|
+
function server_defineProperty(e, r, t) { return (r = server_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9184
9212
|
function server_regenerator() { var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return server_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (server_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, server_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, server_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), server_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", server_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), server_regeneratorDefine2(u), server_regeneratorDefine2(u, o, "Generator"), server_regeneratorDefine2(u, n, function () { return this; }), server_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (server_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
9185
9213
|
function server_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } server_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { server_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, server_regeneratorDefine2(e, r, n, t); }
|
|
9186
9214
|
function server_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
9187
9215
|
function server_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { server_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { server_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
9188
9216
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9189
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e,
|
|
9217
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, server_toPropertyKey(o.key), o); } }
|
|
9190
9218
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
9191
|
-
function
|
|
9192
|
-
function
|
|
9219
|
+
function server_toPropertyKey(t) { var i = server_toPrimitive(t, "string"); return "symbol" == server_typeof(i) ? i : i + ""; }
|
|
9220
|
+
function server_toPrimitive(t, r) { if ("object" != server_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != server_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9193
9221
|
|
|
9194
9222
|
|
|
9195
9223
|
|
|
@@ -9242,12 +9270,7 @@ var RpcServer = function () {
|
|
|
9242
9270
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9243
9271
|
_classCallCheck(this, RpcServer);
|
|
9244
9272
|
this.serverURL = URI_default()(serverURL);
|
|
9245
|
-
|
|
9246
|
-
axios.interceptors.request.use(function (config) {
|
|
9247
|
-
config.headers = Object.assign(config.headers, opts.headers);
|
|
9248
|
-
return config;
|
|
9249
|
-
});
|
|
9250
|
-
}
|
|
9273
|
+
this.httpClient = createHttpClient(opts.headers);
|
|
9251
9274
|
if (this.serverURL.protocol() !== "https" && !opts.allowHttp) {
|
|
9252
9275
|
throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set");
|
|
9253
9276
|
}
|
|
@@ -9402,7 +9425,7 @@ var RpcServer = function () {
|
|
|
9402
9425
|
return server_regenerator().w(function (_context5) {
|
|
9403
9426
|
while (1) switch (_context5.n) {
|
|
9404
9427
|
case 0:
|
|
9405
|
-
return _context5.a(2, postObject(this.serverURL.toString(), "getHealth"));
|
|
9428
|
+
return _context5.a(2, postObject(this.httpClient, this.serverURL.toString(), "getHealth"));
|
|
9406
9429
|
}
|
|
9407
9430
|
}, _callee5, this);
|
|
9408
9431
|
}));
|
|
@@ -9577,7 +9600,7 @@ var RpcServer = function () {
|
|
|
9577
9600
|
for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9578
9601
|
keys[_key] = arguments[_key];
|
|
9579
9602
|
}
|
|
9580
|
-
return postObject(this.serverURL.toString(), "getLedgerEntries", {
|
|
9603
|
+
return postObject(this.httpClient, this.serverURL.toString(), "getLedgerEntries", {
|
|
9581
9604
|
keys: keys.map(function (k) {
|
|
9582
9605
|
return k.toXDR("base64");
|
|
9583
9606
|
})
|
|
@@ -9664,7 +9687,7 @@ var RpcServer = function () {
|
|
|
9664
9687
|
if (raw.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND) {
|
|
9665
9688
|
Object.assign(foundInfo, (0,parsers/* parseTransactionInfo */.WC)(raw));
|
|
9666
9689
|
}
|
|
9667
|
-
var result =
|
|
9690
|
+
var result = server_objectSpread({
|
|
9668
9691
|
status: raw.status,
|
|
9669
9692
|
txHash: hash,
|
|
9670
9693
|
latestLedger: raw.latestLedger,
|
|
@@ -9689,7 +9712,7 @@ var RpcServer = function () {
|
|
|
9689
9712
|
return server_regenerator().w(function (_context10) {
|
|
9690
9713
|
while (1) switch (_context10.n) {
|
|
9691
9714
|
case 0:
|
|
9692
|
-
return _context10.a(2, postObject(this.serverURL.toString(), "getTransaction", {
|
|
9715
|
+
return _context10.a(2, postObject(this.httpClient, this.serverURL.toString(), "getTransaction", {
|
|
9693
9716
|
hash: hash
|
|
9694
9717
|
}));
|
|
9695
9718
|
}
|
|
@@ -9733,7 +9756,7 @@ var RpcServer = function () {
|
|
|
9733
9756
|
return server_regenerator().w(function (_context12) {
|
|
9734
9757
|
while (1) switch (_context12.n) {
|
|
9735
9758
|
case 0:
|
|
9736
|
-
return _context12.a(2, postObject(this.serverURL.toString(), "getTransactions", request));
|
|
9759
|
+
return _context12.a(2, postObject(this.httpClient, this.serverURL.toString(), "getTransactions", request));
|
|
9737
9760
|
}
|
|
9738
9761
|
}, _callee12, this);
|
|
9739
9762
|
}));
|
|
@@ -9766,9 +9789,9 @@ var RpcServer = function () {
|
|
|
9766
9789
|
return server_regenerator().w(function (_context14) {
|
|
9767
9790
|
while (1) switch (_context14.n) {
|
|
9768
9791
|
case 0:
|
|
9769
|
-
return _context14.a(2, postObject(this.serverURL.toString(), "getEvents",
|
|
9792
|
+
return _context14.a(2, postObject(this.httpClient, this.serverURL.toString(), "getEvents", server_objectSpread(server_objectSpread({
|
|
9770
9793
|
filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
|
|
9771
|
-
pagination:
|
|
9794
|
+
pagination: server_objectSpread(server_objectSpread({}, request.cursor && {
|
|
9772
9795
|
cursor: request.cursor
|
|
9773
9796
|
}), request.limit && {
|
|
9774
9797
|
limit: request.limit
|
|
@@ -9793,7 +9816,7 @@ var RpcServer = function () {
|
|
|
9793
9816
|
return server_regenerator().w(function (_context15) {
|
|
9794
9817
|
while (1) switch (_context15.n) {
|
|
9795
9818
|
case 0:
|
|
9796
|
-
return _context15.a(2, postObject(this.serverURL.toString(), "getNetwork"));
|
|
9819
|
+
return _context15.a(2, postObject(this.httpClient, this.serverURL.toString(), "getNetwork"));
|
|
9797
9820
|
}
|
|
9798
9821
|
}, _callee15, this);
|
|
9799
9822
|
}));
|
|
@@ -9809,7 +9832,7 @@ var RpcServer = function () {
|
|
|
9809
9832
|
return server_regenerator().w(function (_context16) {
|
|
9810
9833
|
while (1) switch (_context16.n) {
|
|
9811
9834
|
case 0:
|
|
9812
|
-
return _context16.a(2, postObject(this.serverURL.toString(), "getLatestLedger"));
|
|
9835
|
+
return _context16.a(2, postObject(this.httpClient, this.serverURL.toString(), "getLatestLedger"));
|
|
9813
9836
|
}
|
|
9814
9837
|
}, _callee16, this);
|
|
9815
9838
|
}));
|
|
@@ -9841,7 +9864,7 @@ var RpcServer = function () {
|
|
|
9841
9864
|
return server_regenerator().w(function (_context18) {
|
|
9842
9865
|
while (1) switch (_context18.n) {
|
|
9843
9866
|
case 0:
|
|
9844
|
-
return _context18.a(2, postObject(this.serverURL.toString(), "simulateTransaction",
|
|
9867
|
+
return _context18.a(2, postObject(this.httpClient, this.serverURL.toString(), "simulateTransaction", server_objectSpread({
|
|
9845
9868
|
transaction: transaction.toXDR(),
|
|
9846
9869
|
authMode: authMode
|
|
9847
9870
|
}, addlResources !== undefined && {
|
|
@@ -9907,7 +9930,7 @@ var RpcServer = function () {
|
|
|
9907
9930
|
return server_regenerator().w(function (_context21) {
|
|
9908
9931
|
while (1) switch (_context21.n) {
|
|
9909
9932
|
case 0:
|
|
9910
|
-
return _context21.a(2, postObject(this.serverURL.toString(), "sendTransaction", {
|
|
9933
|
+
return _context21.a(2, postObject(this.httpClient, this.serverURL.toString(), "sendTransaction", {
|
|
9911
9934
|
transaction: transaction.toXDR()
|
|
9912
9935
|
}));
|
|
9913
9936
|
}
|
|
@@ -9946,7 +9969,7 @@ var RpcServer = function () {
|
|
|
9946
9969
|
case 3:
|
|
9947
9970
|
_context22.p = 3;
|
|
9948
9971
|
_context22.n = 4;
|
|
9949
|
-
return
|
|
9972
|
+
return this.httpClient.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
|
|
9950
9973
|
case 4:
|
|
9951
9974
|
response = _context22.v;
|
|
9952
9975
|
if (response.data.result_meta_xdr) {
|
|
@@ -10002,7 +10025,7 @@ var RpcServer = function () {
|
|
|
10002
10025
|
return server_regenerator().w(function (_context23) {
|
|
10003
10026
|
while (1) switch (_context23.n) {
|
|
10004
10027
|
case 0:
|
|
10005
|
-
return _context23.a(2, postObject(this.serverURL.toString(), "getFeeStats"));
|
|
10028
|
+
return _context23.a(2, postObject(this.httpClient, this.serverURL.toString(), "getFeeStats"));
|
|
10006
10029
|
}
|
|
10007
10030
|
}, _callee23, this);
|
|
10008
10031
|
}));
|
|
@@ -10018,7 +10041,7 @@ var RpcServer = function () {
|
|
|
10018
10041
|
return server_regenerator().w(function (_context24) {
|
|
10019
10042
|
while (1) switch (_context24.n) {
|
|
10020
10043
|
case 0:
|
|
10021
|
-
return _context24.a(2, postObject(this.serverURL.toString(), "getVersionInfo"));
|
|
10044
|
+
return _context24.a(2, postObject(this.httpClient, this.serverURL.toString(), "getVersionInfo"));
|
|
10022
10045
|
}
|
|
10023
10046
|
}, _callee24, this);
|
|
10024
10047
|
}));
|
|
@@ -10107,6 +10130,48 @@ var RpcServer = function () {
|
|
|
10107
10130
|
}
|
|
10108
10131
|
return getSACBalance;
|
|
10109
10132
|
}())
|
|
10133
|
+
}, {
|
|
10134
|
+
key: "getLedgers",
|
|
10135
|
+
value: (function () {
|
|
10136
|
+
var _getLedgers2 = server_asyncToGenerator(server_regenerator().m(function _callee26(request) {
|
|
10137
|
+
return server_regenerator().w(function (_context26) {
|
|
10138
|
+
while (1) switch (_context26.n) {
|
|
10139
|
+
case 0:
|
|
10140
|
+
return _context26.a(2, this._getLedgers(request).then(function (raw) {
|
|
10141
|
+
var result = {
|
|
10142
|
+
ledgers: (raw.ledgers || []).map(parsers/* parseRawLedger */.$E),
|
|
10143
|
+
latestLedger: raw.latestLedger,
|
|
10144
|
+
latestLedgerCloseTime: raw.latestLedgerCloseTime,
|
|
10145
|
+
oldestLedger: raw.oldestLedger,
|
|
10146
|
+
oldestLedgerCloseTime: raw.oldestLedgerCloseTime,
|
|
10147
|
+
cursor: raw.cursor
|
|
10148
|
+
};
|
|
10149
|
+
return result;
|
|
10150
|
+
}));
|
|
10151
|
+
}
|
|
10152
|
+
}, _callee26, this);
|
|
10153
|
+
}));
|
|
10154
|
+
function getLedgers(_x31) {
|
|
10155
|
+
return _getLedgers2.apply(this, arguments);
|
|
10156
|
+
}
|
|
10157
|
+
return getLedgers;
|
|
10158
|
+
}())
|
|
10159
|
+
}, {
|
|
10160
|
+
key: "_getLedgers",
|
|
10161
|
+
value: function () {
|
|
10162
|
+
var _getLedgers3 = server_asyncToGenerator(server_regenerator().m(function _callee27(request) {
|
|
10163
|
+
return server_regenerator().w(function (_context27) {
|
|
10164
|
+
while (1) switch (_context27.n) {
|
|
10165
|
+
case 0:
|
|
10166
|
+
return _context27.a(2, postObject(this.httpClient, this.serverURL.toString(), "getLedgers", request));
|
|
10167
|
+
}
|
|
10168
|
+
}, _callee27, this);
|
|
10169
|
+
}));
|
|
10170
|
+
function _getLedgers(_x32) {
|
|
10171
|
+
return _getLedgers3.apply(this, arguments);
|
|
10172
|
+
}
|
|
10173
|
+
return _getLedgers;
|
|
10174
|
+
}()
|
|
10110
10175
|
}]);
|
|
10111
10176
|
}();
|
|
10112
10177
|
;// ./src/rpc/index.ts
|
|
@@ -10115,7 +10180,6 @@ var RpcServer = function () {
|
|
|
10115
10180
|
|
|
10116
10181
|
|
|
10117
10182
|
|
|
10118
|
-
|
|
10119
10183
|
/* harmony default export */ const rpc = (module.exports);
|
|
10120
10184
|
|
|
10121
10185
|
/***/ }),
|
|
@@ -14974,7 +15038,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14974
15038
|
// EXPORTS
|
|
14975
15039
|
__webpack_require__.d(__webpack_exports__, {
|
|
14976
15040
|
AccountResponse: () => (/* reexport */ AccountResponse),
|
|
14977
|
-
AxiosClient: () => (/* reexport */ horizon_axios_client),
|
|
14978
15041
|
HorizonApi: () => (/* reexport */ HorizonApi),
|
|
14979
15042
|
SERVER_TIME_MAP: () => (/* reexport */ SERVER_TIME_MAP),
|
|
14980
15043
|
Server: () => (/* reexport */ HorizonServer),
|
|
@@ -18113,43 +18176,50 @@ var errors = __webpack_require__(976);
|
|
|
18113
18176
|
var http_client = __webpack_require__(371);
|
|
18114
18177
|
;// ./src/horizon/horizon_axios_client.ts
|
|
18115
18178
|
function horizon_axios_client_typeof(o) { "@babel/helpers - typeof"; return horizon_axios_client_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; }, horizon_axios_client_typeof(o); }
|
|
18179
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18180
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18181
|
+
function _defineProperty(e, r, t) { return (r = horizon_axios_client_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18182
|
+
function horizon_axios_client_toPropertyKey(t) { var i = horizon_axios_client_toPrimitive(t, "string"); return "symbol" == horizon_axios_client_typeof(i) ? i : i + ""; }
|
|
18183
|
+
function horizon_axios_client_toPrimitive(t, r) { if ("object" != horizon_axios_client_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != horizon_axios_client_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18116
18184
|
|
|
18117
18185
|
|
|
18118
|
-
var version = "14.
|
|
18186
|
+
var version = "14.3.1";
|
|
18119
18187
|
var SERVER_TIME_MAP = {};
|
|
18120
|
-
var AxiosClient = (0,http_client/* create */.vt)({
|
|
18121
|
-
headers: {
|
|
18122
|
-
"X-Client-Name": "js-stellar-sdk",
|
|
18123
|
-
"X-Client-Version": version
|
|
18124
|
-
}
|
|
18125
|
-
});
|
|
18126
18188
|
function toSeconds(ms) {
|
|
18127
18189
|
return Math.floor(ms / 1000);
|
|
18128
18190
|
}
|
|
18129
|
-
|
|
18130
|
-
var
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
var
|
|
18139
|
-
if (
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18191
|
+
function createHttpClient(headers) {
|
|
18192
|
+
var httpClient = (0,http_client/* create */.vt)({
|
|
18193
|
+
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
18194
|
+
"X-Client-Name": "js-stellar-sdk",
|
|
18195
|
+
"X-Client-Version": version
|
|
18196
|
+
})
|
|
18197
|
+
});
|
|
18198
|
+
httpClient.interceptors.response.use(function (response) {
|
|
18199
|
+
var hostname = URI_default()(response.config.url).hostname();
|
|
18200
|
+
var serverTime = 0;
|
|
18201
|
+
if (response.headers instanceof Headers) {
|
|
18202
|
+
var dateHeader = response.headers.get("date");
|
|
18203
|
+
if (dateHeader) {
|
|
18204
|
+
serverTime = toSeconds(Date.parse(dateHeader));
|
|
18205
|
+
}
|
|
18206
|
+
} else if (horizon_axios_client_typeof(response.headers) === "object" && "date" in response.headers) {
|
|
18207
|
+
var responseHeader = response.headers;
|
|
18208
|
+
if (typeof responseHeader.date === "string") {
|
|
18209
|
+
serverTime = toSeconds(Date.parse(responseHeader.date));
|
|
18210
|
+
}
|
|
18211
|
+
}
|
|
18212
|
+
var localTimeRecorded = toSeconds(new Date().getTime());
|
|
18213
|
+
if (!Number.isNaN(serverTime)) {
|
|
18214
|
+
SERVER_TIME_MAP[hostname] = {
|
|
18215
|
+
serverTime: serverTime,
|
|
18216
|
+
localTimeRecorded: localTimeRecorded
|
|
18217
|
+
};
|
|
18218
|
+
}
|
|
18219
|
+
return response;
|
|
18220
|
+
});
|
|
18221
|
+
return httpClient;
|
|
18222
|
+
}
|
|
18153
18223
|
function getCurrentServerTime(hostname) {
|
|
18154
18224
|
var entry = SERVER_TIME_MAP[hostname];
|
|
18155
18225
|
if (!entry || !entry.localTimeRecorded || !entry.serverTime) {
|
|
@@ -18184,13 +18254,14 @@ var EventSource;
|
|
|
18184
18254
|
if (false) // removed by dead control flow
|
|
18185
18255
|
{ var _ref, _anyGlobal$EventSourc, _anyGlobal$window; }
|
|
18186
18256
|
var CallBuilder = function () {
|
|
18187
|
-
function CallBuilder(serverUrl) {
|
|
18188
|
-
var neighborRoot = arguments.length >
|
|
18257
|
+
function CallBuilder(serverUrl, httpClient) {
|
|
18258
|
+
var neighborRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
18189
18259
|
call_builder_classCallCheck(this, CallBuilder);
|
|
18190
18260
|
this.url = serverUrl.clone();
|
|
18191
18261
|
this.filter = [];
|
|
18192
18262
|
this.originalSegments = this.url.segment() || [];
|
|
18193
18263
|
this.neighborRoot = neighborRoot;
|
|
18264
|
+
this.httpClient = httpClient;
|
|
18194
18265
|
}
|
|
18195
18266
|
return call_builder_createClass(CallBuilder, [{
|
|
18196
18267
|
key: "call",
|
|
@@ -18398,7 +18469,7 @@ var CallBuilder = function () {
|
|
|
18398
18469
|
if (url.protocol() === "") {
|
|
18399
18470
|
url = url.protocol(this.url.protocol());
|
|
18400
18471
|
}
|
|
18401
|
-
return _context3.a(2,
|
|
18472
|
+
return _context3.a(2, this.httpClient.get(url.toString()).then(function (response) {
|
|
18402
18473
|
return response.data;
|
|
18403
18474
|
}).catch(this._handleNetworkError));
|
|
18404
18475
|
}
|
|
@@ -18521,10 +18592,10 @@ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new T
|
|
|
18521
18592
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
18522
18593
|
|
|
18523
18594
|
var AccountCallBuilder = function (_CallBuilder) {
|
|
18524
|
-
function AccountCallBuilder(serverUrl) {
|
|
18595
|
+
function AccountCallBuilder(serverUrl, httpClient) {
|
|
18525
18596
|
var _this;
|
|
18526
18597
|
account_call_builder_classCallCheck(this, AccountCallBuilder);
|
|
18527
|
-
_this = _callSuper(this, AccountCallBuilder, [serverUrl]);
|
|
18598
|
+
_this = _callSuper(this, AccountCallBuilder, [serverUrl, httpClient]);
|
|
18528
18599
|
_this.url.segment("accounts");
|
|
18529
18600
|
return _this;
|
|
18530
18601
|
}
|
|
@@ -18532,7 +18603,7 @@ var AccountCallBuilder = function (_CallBuilder) {
|
|
|
18532
18603
|
return account_call_builder_createClass(AccountCallBuilder, [{
|
|
18533
18604
|
key: "accountId",
|
|
18534
18605
|
value: function accountId(id) {
|
|
18535
|
-
var builder = new CallBuilder(this.url.clone());
|
|
18606
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
18536
18607
|
builder.filter.push([id]);
|
|
18537
18608
|
return builder;
|
|
18538
18609
|
}
|
|
@@ -18578,10 +18649,10 @@ function assets_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
18578
18649
|
function assets_call_builder_setPrototypeOf(t, e) { return assets_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, assets_call_builder_setPrototypeOf(t, e); }
|
|
18579
18650
|
|
|
18580
18651
|
var AssetsCallBuilder = function (_CallBuilder) {
|
|
18581
|
-
function AssetsCallBuilder(serverUrl) {
|
|
18652
|
+
function AssetsCallBuilder(serverUrl, httpClient) {
|
|
18582
18653
|
var _this;
|
|
18583
18654
|
assets_call_builder_classCallCheck(this, AssetsCallBuilder);
|
|
18584
|
-
_this = assets_call_builder_callSuper(this, AssetsCallBuilder, [serverUrl]);
|
|
18655
|
+
_this = assets_call_builder_callSuper(this, AssetsCallBuilder, [serverUrl, httpClient]);
|
|
18585
18656
|
_this.url.segment("assets");
|
|
18586
18657
|
return _this;
|
|
18587
18658
|
}
|
|
@@ -18616,10 +18687,10 @@ function claimable_balances_call_builder_inherits(t, e) { if ("function" != type
|
|
|
18616
18687
|
function claimable_balances_call_builder_setPrototypeOf(t, e) { return claimable_balances_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, claimable_balances_call_builder_setPrototypeOf(t, e); }
|
|
18617
18688
|
|
|
18618
18689
|
var ClaimableBalanceCallBuilder = function (_CallBuilder) {
|
|
18619
|
-
function ClaimableBalanceCallBuilder(serverUrl) {
|
|
18690
|
+
function ClaimableBalanceCallBuilder(serverUrl, httpClient) {
|
|
18620
18691
|
var _this;
|
|
18621
18692
|
claimable_balances_call_builder_classCallCheck(this, ClaimableBalanceCallBuilder);
|
|
18622
|
-
_this = claimable_balances_call_builder_callSuper(this, ClaimableBalanceCallBuilder, [serverUrl]);
|
|
18693
|
+
_this = claimable_balances_call_builder_callSuper(this, ClaimableBalanceCallBuilder, [serverUrl, httpClient]);
|
|
18623
18694
|
_this.url.segment("claimable_balances");
|
|
18624
18695
|
return _this;
|
|
18625
18696
|
}
|
|
@@ -18627,7 +18698,7 @@ var ClaimableBalanceCallBuilder = function (_CallBuilder) {
|
|
|
18627
18698
|
return claimable_balances_call_builder_createClass(ClaimableBalanceCallBuilder, [{
|
|
18628
18699
|
key: "claimableBalance",
|
|
18629
18700
|
value: function claimableBalance(claimableBalanceId) {
|
|
18630
|
-
var builder = new CallBuilder(this.url.clone());
|
|
18701
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
18631
18702
|
builder.filter.push([claimableBalanceId]);
|
|
18632
18703
|
return builder;
|
|
18633
18704
|
}
|
|
@@ -18667,10 +18738,10 @@ function effect_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
18667
18738
|
function effect_call_builder_setPrototypeOf(t, e) { return effect_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, effect_call_builder_setPrototypeOf(t, e); }
|
|
18668
18739
|
|
|
18669
18740
|
var EffectCallBuilder = function (_CallBuilder) {
|
|
18670
|
-
function EffectCallBuilder(serverUrl) {
|
|
18741
|
+
function EffectCallBuilder(serverUrl, httpClient) {
|
|
18671
18742
|
var _this;
|
|
18672
18743
|
effect_call_builder_classCallCheck(this, EffectCallBuilder);
|
|
18673
|
-
_this = effect_call_builder_callSuper(this, EffectCallBuilder, [serverUrl, "effects"]);
|
|
18744
|
+
_this = effect_call_builder_callSuper(this, EffectCallBuilder, [serverUrl, httpClient, "effects"]);
|
|
18674
18745
|
_this.url.segment("effects");
|
|
18675
18746
|
return _this;
|
|
18676
18747
|
}
|
|
@@ -18718,10 +18789,10 @@ function friendbot_builder_inherits(t, e) { if ("function" != typeof e && null !
|
|
|
18718
18789
|
function friendbot_builder_setPrototypeOf(t, e) { return friendbot_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, friendbot_builder_setPrototypeOf(t, e); }
|
|
18719
18790
|
|
|
18720
18791
|
var FriendbotBuilder = function (_CallBuilder) {
|
|
18721
|
-
function FriendbotBuilder(serverUrl, address) {
|
|
18792
|
+
function FriendbotBuilder(serverUrl, httpClient, address) {
|
|
18722
18793
|
var _this;
|
|
18723
18794
|
friendbot_builder_classCallCheck(this, FriendbotBuilder);
|
|
18724
|
-
_this = friendbot_builder_callSuper(this, FriendbotBuilder, [serverUrl]);
|
|
18795
|
+
_this = friendbot_builder_callSuper(this, FriendbotBuilder, [serverUrl, httpClient]);
|
|
18725
18796
|
_this.url.segment("friendbot");
|
|
18726
18797
|
_this.url.setQuery("addr", address);
|
|
18727
18798
|
return _this;
|
|
@@ -18745,10 +18816,10 @@ function ledger_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
18745
18816
|
function ledger_call_builder_setPrototypeOf(t, e) { return ledger_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, ledger_call_builder_setPrototypeOf(t, e); }
|
|
18746
18817
|
|
|
18747
18818
|
var LedgerCallBuilder = function (_CallBuilder) {
|
|
18748
|
-
function LedgerCallBuilder(serverUrl) {
|
|
18819
|
+
function LedgerCallBuilder(serverUrl, httpClient) {
|
|
18749
18820
|
var _this;
|
|
18750
18821
|
ledger_call_builder_classCallCheck(this, LedgerCallBuilder);
|
|
18751
|
-
_this = ledger_call_builder_callSuper(this, LedgerCallBuilder, [serverUrl]);
|
|
18822
|
+
_this = ledger_call_builder_callSuper(this, LedgerCallBuilder, [serverUrl, httpClient]);
|
|
18752
18823
|
_this.url.segment("ledgers");
|
|
18753
18824
|
return _this;
|
|
18754
18825
|
}
|
|
@@ -18777,10 +18848,10 @@ function liquidity_pool_call_builder_inherits(t, e) { if ("function" != typeof e
|
|
|
18777
18848
|
function liquidity_pool_call_builder_setPrototypeOf(t, e) { return liquidity_pool_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, liquidity_pool_call_builder_setPrototypeOf(t, e); }
|
|
18778
18849
|
|
|
18779
18850
|
var LiquidityPoolCallBuilder = function (_CallBuilder) {
|
|
18780
|
-
function LiquidityPoolCallBuilder(serverUrl) {
|
|
18851
|
+
function LiquidityPoolCallBuilder(serverUrl, httpClient) {
|
|
18781
18852
|
var _this;
|
|
18782
18853
|
liquidity_pool_call_builder_classCallCheck(this, LiquidityPoolCallBuilder);
|
|
18783
|
-
_this = liquidity_pool_call_builder_callSuper(this, LiquidityPoolCallBuilder, [serverUrl]);
|
|
18854
|
+
_this = liquidity_pool_call_builder_callSuper(this, LiquidityPoolCallBuilder, [serverUrl, httpClient]);
|
|
18784
18855
|
_this.url.segment("liquidity_pools");
|
|
18785
18856
|
return _this;
|
|
18786
18857
|
}
|
|
@@ -18809,7 +18880,7 @@ var LiquidityPoolCallBuilder = function (_CallBuilder) {
|
|
|
18809
18880
|
if (!id.match(/[a-fA-F0-9]{64}/)) {
|
|
18810
18881
|
throw new TypeError("".concat(id, " does not look like a liquidity pool ID"));
|
|
18811
18882
|
}
|
|
18812
|
-
var builder = new CallBuilder(this.url.clone());
|
|
18883
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
18813
18884
|
builder.filter.push([id.toLowerCase()]);
|
|
18814
18885
|
return builder;
|
|
18815
18886
|
}
|
|
@@ -18831,10 +18902,10 @@ function offer_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
18831
18902
|
function offer_call_builder_setPrototypeOf(t, e) { return offer_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, offer_call_builder_setPrototypeOf(t, e); }
|
|
18832
18903
|
|
|
18833
18904
|
var OfferCallBuilder = function (_CallBuilder) {
|
|
18834
|
-
function OfferCallBuilder(serverUrl) {
|
|
18905
|
+
function OfferCallBuilder(serverUrl, httpClient) {
|
|
18835
18906
|
var _this;
|
|
18836
18907
|
offer_call_builder_classCallCheck(this, OfferCallBuilder);
|
|
18837
|
-
_this = offer_call_builder_callSuper(this, OfferCallBuilder, [serverUrl, "offers"]);
|
|
18908
|
+
_this = offer_call_builder_callSuper(this, OfferCallBuilder, [serverUrl, httpClient, "offers"]);
|
|
18838
18909
|
_this.url.segment("offers");
|
|
18839
18910
|
return _this;
|
|
18840
18911
|
}
|
|
@@ -18842,7 +18913,7 @@ var OfferCallBuilder = function (_CallBuilder) {
|
|
|
18842
18913
|
return offer_call_builder_createClass(OfferCallBuilder, [{
|
|
18843
18914
|
key: "offer",
|
|
18844
18915
|
value: function offer(offerId) {
|
|
18845
|
-
var builder = new CallBuilder(this.url.clone());
|
|
18916
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
18846
18917
|
builder.filter.push([offerId]);
|
|
18847
18918
|
return builder;
|
|
18848
18919
|
}
|
|
@@ -18905,10 +18976,10 @@ function operation_call_builder_inherits(t, e) { if ("function" != typeof e && n
|
|
|
18905
18976
|
function operation_call_builder_setPrototypeOf(t, e) { return operation_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, operation_call_builder_setPrototypeOf(t, e); }
|
|
18906
18977
|
|
|
18907
18978
|
var OperationCallBuilder = function (_CallBuilder) {
|
|
18908
|
-
function OperationCallBuilder(serverUrl) {
|
|
18979
|
+
function OperationCallBuilder(serverUrl, httpClient) {
|
|
18909
18980
|
var _this;
|
|
18910
18981
|
operation_call_builder_classCallCheck(this, OperationCallBuilder);
|
|
18911
|
-
_this = operation_call_builder_callSuper(this, OperationCallBuilder, [serverUrl, "operations"]);
|
|
18982
|
+
_this = operation_call_builder_callSuper(this, OperationCallBuilder, [serverUrl, httpClient, "operations"]);
|
|
18912
18983
|
_this.url.segment("operations");
|
|
18913
18984
|
return _this;
|
|
18914
18985
|
}
|
|
@@ -18916,7 +18987,7 @@ var OperationCallBuilder = function (_CallBuilder) {
|
|
|
18916
18987
|
return operation_call_builder_createClass(OperationCallBuilder, [{
|
|
18917
18988
|
key: "operation",
|
|
18918
18989
|
value: function operation(operationId) {
|
|
18919
|
-
var builder = new CallBuilder(this.url.clone());
|
|
18990
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
18920
18991
|
builder.filter.push([operationId]);
|
|
18921
18992
|
return builder;
|
|
18922
18993
|
}
|
|
@@ -18969,10 +19040,10 @@ function orderbook_call_builder_inherits(t, e) { if ("function" != typeof e && n
|
|
|
18969
19040
|
function orderbook_call_builder_setPrototypeOf(t, e) { return orderbook_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, orderbook_call_builder_setPrototypeOf(t, e); }
|
|
18970
19041
|
|
|
18971
19042
|
var OrderbookCallBuilder = function (_CallBuilder) {
|
|
18972
|
-
function OrderbookCallBuilder(serverUrl, selling, buying) {
|
|
19043
|
+
function OrderbookCallBuilder(serverUrl, httpClient, selling, buying) {
|
|
18973
19044
|
var _this;
|
|
18974
19045
|
orderbook_call_builder_classCallCheck(this, OrderbookCallBuilder);
|
|
18975
|
-
_this = orderbook_call_builder_callSuper(this, OrderbookCallBuilder, [serverUrl]);
|
|
19046
|
+
_this = orderbook_call_builder_callSuper(this, OrderbookCallBuilder, [serverUrl, httpClient]);
|
|
18976
19047
|
_this.url.segment("order_book");
|
|
18977
19048
|
if (!selling.isNative()) {
|
|
18978
19049
|
_this.url.setQuery("selling_asset_type", selling.getAssetType());
|
|
@@ -19009,10 +19080,10 @@ function payment_call_builder_inherits(t, e) { if ("function" != typeof e && nul
|
|
|
19009
19080
|
function payment_call_builder_setPrototypeOf(t, e) { return payment_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, payment_call_builder_setPrototypeOf(t, e); }
|
|
19010
19081
|
|
|
19011
19082
|
var PaymentCallBuilder = function (_CallBuilder) {
|
|
19012
|
-
function PaymentCallBuilder(serverUrl) {
|
|
19083
|
+
function PaymentCallBuilder(serverUrl, httpClient) {
|
|
19013
19084
|
var _this;
|
|
19014
19085
|
payment_call_builder_classCallCheck(this, PaymentCallBuilder);
|
|
19015
|
-
_this = payment_call_builder_callSuper(this, PaymentCallBuilder, [serverUrl, "payments"]);
|
|
19086
|
+
_this = payment_call_builder_callSuper(this, PaymentCallBuilder, [serverUrl, httpClient, "payments"]);
|
|
19016
19087
|
_this.url.segment("payments");
|
|
19017
19088
|
return _this;
|
|
19018
19089
|
}
|
|
@@ -19056,10 +19127,10 @@ function strict_receive_path_call_builder_inherits(t, e) { if ("function" != typ
|
|
|
19056
19127
|
function strict_receive_path_call_builder_setPrototypeOf(t, e) { return strict_receive_path_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, strict_receive_path_call_builder_setPrototypeOf(t, e); }
|
|
19057
19128
|
|
|
19058
19129
|
var StrictReceivePathCallBuilder = function (_CallBuilder) {
|
|
19059
|
-
function StrictReceivePathCallBuilder(serverUrl, source, destinationAsset, destinationAmount) {
|
|
19130
|
+
function StrictReceivePathCallBuilder(serverUrl, httpClient, source, destinationAsset, destinationAmount) {
|
|
19060
19131
|
var _this;
|
|
19061
19132
|
strict_receive_path_call_builder_classCallCheck(this, StrictReceivePathCallBuilder);
|
|
19062
|
-
_this = strict_receive_path_call_builder_callSuper(this, StrictReceivePathCallBuilder, [serverUrl]);
|
|
19133
|
+
_this = strict_receive_path_call_builder_callSuper(this, StrictReceivePathCallBuilder, [serverUrl, httpClient]);
|
|
19063
19134
|
_this.url.segment("paths/strict-receive");
|
|
19064
19135
|
if (typeof source === "string") {
|
|
19065
19136
|
_this.url.setQuery("source_account", source);
|
|
@@ -19101,10 +19172,10 @@ function strict_send_path_call_builder_inherits(t, e) { if ("function" != typeof
|
|
|
19101
19172
|
function strict_send_path_call_builder_setPrototypeOf(t, e) { return strict_send_path_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, strict_send_path_call_builder_setPrototypeOf(t, e); }
|
|
19102
19173
|
|
|
19103
19174
|
var StrictSendPathCallBuilder = function (_CallBuilder) {
|
|
19104
|
-
function StrictSendPathCallBuilder(serverUrl, sourceAsset, sourceAmount, destination) {
|
|
19175
|
+
function StrictSendPathCallBuilder(serverUrl, httpClient, sourceAsset, sourceAmount, destination) {
|
|
19105
19176
|
var _this;
|
|
19106
19177
|
strict_send_path_call_builder_classCallCheck(this, StrictSendPathCallBuilder);
|
|
19107
|
-
_this = strict_send_path_call_builder_callSuper(this, StrictSendPathCallBuilder, [serverUrl]);
|
|
19178
|
+
_this = strict_send_path_call_builder_callSuper(this, StrictSendPathCallBuilder, [serverUrl, httpClient]);
|
|
19108
19179
|
_this.url.segment("paths/strict-send");
|
|
19109
19180
|
if (sourceAsset.isNative()) {
|
|
19110
19181
|
_this.url.setQuery("source_asset_type", "native");
|
|
@@ -19148,10 +19219,10 @@ function trade_aggregation_call_builder_setPrototypeOf(t, e) { return trade_aggr
|
|
|
19148
19219
|
|
|
19149
19220
|
var allowedResolutions = [60000, 300000, 900000, 3600000, 86400000, 604800000];
|
|
19150
19221
|
var TradeAggregationCallBuilder = function (_CallBuilder) {
|
|
19151
|
-
function TradeAggregationCallBuilder(serverUrl, base, counter, start_time, end_time, resolution, offset) {
|
|
19222
|
+
function TradeAggregationCallBuilder(serverUrl, httpClient, base, counter, start_time, end_time, resolution, offset) {
|
|
19152
19223
|
var _this;
|
|
19153
19224
|
trade_aggregation_call_builder_classCallCheck(this, TradeAggregationCallBuilder);
|
|
19154
|
-
_this = trade_aggregation_call_builder_callSuper(this, TradeAggregationCallBuilder, [serverUrl]);
|
|
19225
|
+
_this = trade_aggregation_call_builder_callSuper(this, TradeAggregationCallBuilder, [serverUrl, httpClient]);
|
|
19155
19226
|
_this.url.segment("trade_aggregations");
|
|
19156
19227
|
if (!base.isNative()) {
|
|
19157
19228
|
_this.url.setQuery("base_asset_type", base.getAssetType());
|
|
@@ -19217,10 +19288,10 @@ function trades_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
19217
19288
|
function trades_call_builder_setPrototypeOf(t, e) { return trades_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, trades_call_builder_setPrototypeOf(t, e); }
|
|
19218
19289
|
|
|
19219
19290
|
var TradesCallBuilder = function (_CallBuilder) {
|
|
19220
|
-
function TradesCallBuilder(serverUrl) {
|
|
19291
|
+
function TradesCallBuilder(serverUrl, httpClient) {
|
|
19221
19292
|
var _this;
|
|
19222
19293
|
trades_call_builder_classCallCheck(this, TradesCallBuilder);
|
|
19223
|
-
_this = trades_call_builder_callSuper(this, TradesCallBuilder, [serverUrl, "trades"]);
|
|
19294
|
+
_this = trades_call_builder_callSuper(this, TradesCallBuilder, [serverUrl, httpClient, "trades"]);
|
|
19224
19295
|
_this.url.segment("trades");
|
|
19225
19296
|
return _this;
|
|
19226
19297
|
}
|
|
@@ -19284,10 +19355,10 @@ function transaction_call_builder_inherits(t, e) { if ("function" != typeof e &&
|
|
|
19284
19355
|
function transaction_call_builder_setPrototypeOf(t, e) { return transaction_call_builder_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, transaction_call_builder_setPrototypeOf(t, e); }
|
|
19285
19356
|
|
|
19286
19357
|
var TransactionCallBuilder = function (_CallBuilder) {
|
|
19287
|
-
function TransactionCallBuilder(serverUrl) {
|
|
19358
|
+
function TransactionCallBuilder(serverUrl, httpClient) {
|
|
19288
19359
|
var _this;
|
|
19289
19360
|
transaction_call_builder_classCallCheck(this, TransactionCallBuilder);
|
|
19290
|
-
_this = transaction_call_builder_callSuper(this, TransactionCallBuilder, [serverUrl, "transactions"]);
|
|
19361
|
+
_this = transaction_call_builder_callSuper(this, TransactionCallBuilder, [serverUrl, httpClient, "transactions"]);
|
|
19291
19362
|
_this.url.segment("transactions");
|
|
19292
19363
|
return _this;
|
|
19293
19364
|
}
|
|
@@ -19295,7 +19366,7 @@ var TransactionCallBuilder = function (_CallBuilder) {
|
|
|
19295
19366
|
return transaction_call_builder_createClass(TransactionCallBuilder, [{
|
|
19296
19367
|
key: "transaction",
|
|
19297
19368
|
value: function transaction(transactionId) {
|
|
19298
|
-
var builder = new CallBuilder(this.url.clone());
|
|
19369
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
19299
19370
|
builder.filter.push([transactionId]);
|
|
19300
19371
|
return builder;
|
|
19301
19372
|
}
|
|
@@ -19329,9 +19400,9 @@ var TransactionCallBuilder = function (_CallBuilder) {
|
|
|
19329
19400
|
}(CallBuilder);
|
|
19330
19401
|
;// ./src/horizon/server.ts
|
|
19331
19402
|
function server_typeof(o) { "@babel/helpers - typeof"; return server_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; }, server_typeof(o); }
|
|
19332
|
-
function
|
|
19333
|
-
function
|
|
19334
|
-
function
|
|
19403
|
+
function server_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19404
|
+
function server_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? server_ownKeys(Object(t), !0).forEach(function (r) { server_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : server_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19405
|
+
function server_defineProperty(e, r, t) { return (r = server_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19335
19406
|
function server_regenerator() { var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return server_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (server_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, server_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, server_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), server_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", server_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), server_regeneratorDefine2(u), server_regeneratorDefine2(u, o, "Generator"), server_regeneratorDefine2(u, n, function () { return this; }), server_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (server_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
19336
19407
|
function server_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } server_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { server_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, server_regeneratorDefine2(e, r, n, t); }
|
|
19337
19408
|
function server_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
@@ -19390,13 +19461,7 @@ var HorizonServer = function () {
|
|
|
19390
19461
|
if (opts.headers) {
|
|
19391
19462
|
Object.assign(customHeaders, opts.headers);
|
|
19392
19463
|
}
|
|
19393
|
-
|
|
19394
|
-
horizon_axios_client.interceptors.request.use(function (config) {
|
|
19395
|
-
config.headers = config.headers || {};
|
|
19396
|
-
config.headers = Object.assign(config.headers, customHeaders);
|
|
19397
|
-
return config;
|
|
19398
|
-
});
|
|
19399
|
-
}
|
|
19464
|
+
this.httpClient = createHttpClient(customHeaders);
|
|
19400
19465
|
if (this.serverURL.protocol() !== "https" && !allowHttp) {
|
|
19401
19466
|
throw new Error("Cannot connect to insecure horizon server");
|
|
19402
19467
|
}
|
|
@@ -19432,7 +19497,7 @@ var HorizonServer = function () {
|
|
|
19432
19497
|
});
|
|
19433
19498
|
case 2:
|
|
19434
19499
|
_context.n = 3;
|
|
19435
|
-
return
|
|
19500
|
+
return this.httpClient.get(this.serverURL.toString());
|
|
19436
19501
|
case 3:
|
|
19437
19502
|
return _context.a(2, this.fetchTimebounds(seconds, true));
|
|
19438
19503
|
}
|
|
@@ -19472,7 +19537,7 @@ var HorizonServer = function () {
|
|
|
19472
19537
|
return server_regenerator().w(function (_context3) {
|
|
19473
19538
|
while (1) switch (_context3.n) {
|
|
19474
19539
|
case 0:
|
|
19475
|
-
cb = new CallBuilder(
|
|
19540
|
+
cb = new CallBuilder(this.serverURL, this.httpClient);
|
|
19476
19541
|
cb.filter.push(["fee_stats"]);
|
|
19477
19542
|
return _context3.a(2, cb.call());
|
|
19478
19543
|
}
|
|
@@ -19491,7 +19556,7 @@ var HorizonServer = function () {
|
|
|
19491
19556
|
return server_regenerator().w(function (_context4) {
|
|
19492
19557
|
while (1) switch (_context4.n) {
|
|
19493
19558
|
case 0:
|
|
19494
|
-
cb = new CallBuilder(
|
|
19559
|
+
cb = new CallBuilder(this.serverURL, this.httpClient);
|
|
19495
19560
|
return _context4.a(2, cb.call());
|
|
19496
19561
|
}
|
|
19497
19562
|
}, _callee4, this);
|
|
@@ -19522,7 +19587,7 @@ var HorizonServer = function () {
|
|
|
19522
19587
|
return this.checkMemoRequired(transaction);
|
|
19523
19588
|
case 1:
|
|
19524
19589
|
tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
|
|
19525
|
-
return _context5.a(2,
|
|
19590
|
+
return _context5.a(2, this.httpClient.post(this.serverURL.segment("transactions").toString(), "tx=".concat(tx), {
|
|
19526
19591
|
timeout: SUBMIT_TRANSACTION_TIMEOUT,
|
|
19527
19592
|
headers: {
|
|
19528
19593
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -19625,7 +19690,7 @@ var HorizonServer = function () {
|
|
|
19625
19690
|
return !!result;
|
|
19626
19691
|
});
|
|
19627
19692
|
}
|
|
19628
|
-
return
|
|
19693
|
+
return server_objectSpread(server_objectSpread({}, response.data), {}, {
|
|
19629
19694
|
offerResults: hasManageOffer ? offerResults : undefined
|
|
19630
19695
|
});
|
|
19631
19696
|
}).catch(function (response) {
|
|
@@ -19663,7 +19728,7 @@ var HorizonServer = function () {
|
|
|
19663
19728
|
return this.checkMemoRequired(transaction);
|
|
19664
19729
|
case 1:
|
|
19665
19730
|
tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
|
|
19666
|
-
return _context6.a(2,
|
|
19731
|
+
return _context6.a(2, this.httpClient.post(this.serverURL.segment("transactions_async").toString(), "tx=".concat(tx), {
|
|
19667
19732
|
headers: {
|
|
19668
19733
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
19669
19734
|
}
|
|
@@ -19686,77 +19751,77 @@ var HorizonServer = function () {
|
|
|
19686
19751
|
}, {
|
|
19687
19752
|
key: "accounts",
|
|
19688
19753
|
value: function accounts() {
|
|
19689
|
-
return new AccountCallBuilder(
|
|
19754
|
+
return new AccountCallBuilder(this.serverURL, this.httpClient);
|
|
19690
19755
|
}
|
|
19691
19756
|
}, {
|
|
19692
19757
|
key: "claimableBalances",
|
|
19693
19758
|
value: function claimableBalances() {
|
|
19694
|
-
return new ClaimableBalanceCallBuilder(
|
|
19759
|
+
return new ClaimableBalanceCallBuilder(this.serverURL, this.httpClient);
|
|
19695
19760
|
}
|
|
19696
19761
|
}, {
|
|
19697
19762
|
key: "ledgers",
|
|
19698
19763
|
value: function ledgers() {
|
|
19699
|
-
return new LedgerCallBuilder(
|
|
19764
|
+
return new LedgerCallBuilder(this.serverURL, this.httpClient);
|
|
19700
19765
|
}
|
|
19701
19766
|
}, {
|
|
19702
19767
|
key: "transactions",
|
|
19703
19768
|
value: function transactions() {
|
|
19704
|
-
return new TransactionCallBuilder(
|
|
19769
|
+
return new TransactionCallBuilder(this.serverURL, this.httpClient);
|
|
19705
19770
|
}
|
|
19706
19771
|
}, {
|
|
19707
19772
|
key: "offers",
|
|
19708
19773
|
value: function offers() {
|
|
19709
|
-
return new OfferCallBuilder(
|
|
19774
|
+
return new OfferCallBuilder(this.serverURL, this.httpClient);
|
|
19710
19775
|
}
|
|
19711
19776
|
}, {
|
|
19712
19777
|
key: "orderbook",
|
|
19713
19778
|
value: function orderbook(selling, buying) {
|
|
19714
|
-
return new OrderbookCallBuilder(
|
|
19779
|
+
return new OrderbookCallBuilder(this.serverURL, this.httpClient, selling, buying);
|
|
19715
19780
|
}
|
|
19716
19781
|
}, {
|
|
19717
19782
|
key: "trades",
|
|
19718
19783
|
value: function trades() {
|
|
19719
|
-
return new TradesCallBuilder(
|
|
19784
|
+
return new TradesCallBuilder(this.serverURL, this.httpClient);
|
|
19720
19785
|
}
|
|
19721
19786
|
}, {
|
|
19722
19787
|
key: "operations",
|
|
19723
19788
|
value: function operations() {
|
|
19724
|
-
return new OperationCallBuilder(
|
|
19789
|
+
return new OperationCallBuilder(this.serverURL, this.httpClient);
|
|
19725
19790
|
}
|
|
19726
19791
|
}, {
|
|
19727
19792
|
key: "liquidityPools",
|
|
19728
19793
|
value: function liquidityPools() {
|
|
19729
|
-
return new LiquidityPoolCallBuilder(
|
|
19794
|
+
return new LiquidityPoolCallBuilder(this.serverURL, this.httpClient);
|
|
19730
19795
|
}
|
|
19731
19796
|
}, {
|
|
19732
19797
|
key: "strictReceivePaths",
|
|
19733
19798
|
value: function strictReceivePaths(source, destinationAsset, destinationAmount) {
|
|
19734
|
-
return new StrictReceivePathCallBuilder(
|
|
19799
|
+
return new StrictReceivePathCallBuilder(this.serverURL, this.httpClient, source, destinationAsset, destinationAmount);
|
|
19735
19800
|
}
|
|
19736
19801
|
}, {
|
|
19737
19802
|
key: "strictSendPaths",
|
|
19738
19803
|
value: function strictSendPaths(sourceAsset, sourceAmount, destination) {
|
|
19739
|
-
return new StrictSendPathCallBuilder(
|
|
19804
|
+
return new StrictSendPathCallBuilder(this.serverURL, this.httpClient, sourceAsset, sourceAmount, destination);
|
|
19740
19805
|
}
|
|
19741
19806
|
}, {
|
|
19742
19807
|
key: "payments",
|
|
19743
19808
|
value: function payments() {
|
|
19744
|
-
return new PaymentCallBuilder(
|
|
19809
|
+
return new PaymentCallBuilder(this.serverURL, this.httpClient);
|
|
19745
19810
|
}
|
|
19746
19811
|
}, {
|
|
19747
19812
|
key: "effects",
|
|
19748
19813
|
value: function effects() {
|
|
19749
|
-
return new EffectCallBuilder(
|
|
19814
|
+
return new EffectCallBuilder(this.serverURL, this.httpClient);
|
|
19750
19815
|
}
|
|
19751
19816
|
}, {
|
|
19752
19817
|
key: "friendbot",
|
|
19753
19818
|
value: function friendbot(address) {
|
|
19754
|
-
return new FriendbotBuilder(
|
|
19819
|
+
return new FriendbotBuilder(this.serverURL, this.httpClient, address);
|
|
19755
19820
|
}
|
|
19756
19821
|
}, {
|
|
19757
19822
|
key: "assets",
|
|
19758
19823
|
value: function assets() {
|
|
19759
|
-
return new AssetsCallBuilder(
|
|
19824
|
+
return new AssetsCallBuilder(this.serverURL, this.httpClient);
|
|
19760
19825
|
}
|
|
19761
19826
|
}, {
|
|
19762
19827
|
key: "loadAccount",
|
|
@@ -19782,7 +19847,7 @@ var HorizonServer = function () {
|
|
|
19782
19847
|
}, {
|
|
19783
19848
|
key: "tradeAggregation",
|
|
19784
19849
|
value: function tradeAggregation(base, counter, start_time, end_time, resolution, offset) {
|
|
19785
|
-
return new TradeAggregationCallBuilder(
|
|
19850
|
+
return new TradeAggregationCallBuilder(this.serverURL, this.httpClient, base, counter, start_time, end_time, resolution, offset);
|
|
19786
19851
|
}
|
|
19787
19852
|
}, {
|
|
19788
19853
|
key: "checkMemoRequired",
|
|
@@ -19893,6 +19958,7 @@ var HorizonServer = function () {
|
|
|
19893
19958
|
"use strict";
|
|
19894
19959
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
19895
19960
|
/* harmony export */ $D: () => (/* binding */ parseRawLedgerEntries),
|
|
19961
|
+
/* harmony export */ $E: () => (/* binding */ parseRawLedger),
|
|
19896
19962
|
/* harmony export */ Af: () => (/* binding */ parseRawSendTransaction),
|
|
19897
19963
|
/* harmony export */ WC: () => (/* binding */ parseTransactionInfo),
|
|
19898
19964
|
/* harmony export */ fG: () => (/* binding */ parseRawEvents),
|
|
@@ -20066,6 +20132,28 @@ function parseRawSimulation(sim) {
|
|
|
20066
20132
|
}
|
|
20067
20133
|
return parseSuccessful(sim, base);
|
|
20068
20134
|
}
|
|
20135
|
+
function parseRawLedger(raw) {
|
|
20136
|
+
if (!raw.metadataXdr || !raw.headerXdr) {
|
|
20137
|
+
var missingFields;
|
|
20138
|
+
if (!raw.metadataXdr && !raw.headerXdr) {
|
|
20139
|
+
missingFields = "metadataXdr and headerXdr";
|
|
20140
|
+
} else if (!raw.metadataXdr) {
|
|
20141
|
+
missingFields = "metadataXdr";
|
|
20142
|
+
} else {
|
|
20143
|
+
missingFields = "headerXdr";
|
|
20144
|
+
}
|
|
20145
|
+
throw new TypeError("invalid ledger missing fields: ".concat(missingFields));
|
|
20146
|
+
}
|
|
20147
|
+
var metadataXdr = _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.xdr.LedgerCloseMeta.fromXDR(raw.metadataXdr, "base64");
|
|
20148
|
+
var headerXdr = _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.xdr.LedgerHeaderHistoryEntry.fromXDR(raw.headerXdr, "base64");
|
|
20149
|
+
return {
|
|
20150
|
+
hash: raw.hash,
|
|
20151
|
+
sequence: raw.sequence,
|
|
20152
|
+
ledgerCloseTime: raw.ledgerCloseTime,
|
|
20153
|
+
metadataXdr: metadataXdr,
|
|
20154
|
+
headerXdr: headerXdr
|
|
20155
|
+
};
|
|
20156
|
+
}
|
|
20069
20157
|
|
|
20070
20158
|
/***/ }),
|
|
20071
20159
|
|
|
@@ -20894,10 +20982,7 @@ var NetworkError = function (_Error) {
|
|
|
20894
20982
|
function NetworkError(message, response) {
|
|
20895
20983
|
var _this;
|
|
20896
20984
|
_classCallCheck(this, NetworkError);
|
|
20897
|
-
var trueProto = (this instanceof NetworkError ? this.constructor : void 0).prototype;
|
|
20898
20985
|
_this = _callSuper(this, NetworkError, [message]);
|
|
20899
|
-
_this.__proto__ = trueProto;
|
|
20900
|
-
_this.constructor = NetworkError;
|
|
20901
20986
|
_this.response = response;
|
|
20902
20987
|
return _this;
|
|
20903
20988
|
}
|
|
@@ -20925,15 +21010,9 @@ function not_found_inherits(t, e) { if ("function" != typeof e && null !== e) th
|
|
|
20925
21010
|
function not_found_setPrototypeOf(t, e) { return not_found_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, not_found_setPrototypeOf(t, e); }
|
|
20926
21011
|
|
|
20927
21012
|
var NotFoundError = function (_NetworkError) {
|
|
20928
|
-
function NotFoundError(
|
|
20929
|
-
var _this;
|
|
21013
|
+
function NotFoundError() {
|
|
20930
21014
|
not_found_classCallCheck(this, NotFoundError);
|
|
20931
|
-
|
|
20932
|
-
_this = not_found_callSuper(this, NotFoundError, [message, response]);
|
|
20933
|
-
_this.__proto__ = trueProto;
|
|
20934
|
-
_this.constructor = NotFoundError;
|
|
20935
|
-
_this.name = "NotFoundError";
|
|
20936
|
-
return _this;
|
|
21015
|
+
return not_found_callSuper(this, NotFoundError, arguments);
|
|
20937
21016
|
}
|
|
20938
21017
|
not_found_inherits(NotFoundError, _NetworkError);
|
|
20939
21018
|
return not_found_createClass(NotFoundError);
|
|
@@ -20954,15 +21033,9 @@ function bad_request_inherits(t, e) { if ("function" != typeof e && null !== e)
|
|
|
20954
21033
|
function bad_request_setPrototypeOf(t, e) { return bad_request_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, bad_request_setPrototypeOf(t, e); }
|
|
20955
21034
|
|
|
20956
21035
|
var BadRequestError = function (_NetworkError) {
|
|
20957
|
-
function BadRequestError(
|
|
20958
|
-
var _this;
|
|
21036
|
+
function BadRequestError() {
|
|
20959
21037
|
bad_request_classCallCheck(this, BadRequestError);
|
|
20960
|
-
|
|
20961
|
-
_this = bad_request_callSuper(this, BadRequestError, [message, response]);
|
|
20962
|
-
_this.__proto__ = trueProto;
|
|
20963
|
-
_this.constructor = BadRequestError;
|
|
20964
|
-
_this.name = "BadRequestError";
|
|
20965
|
-
return _this;
|
|
21038
|
+
return bad_request_callSuper(this, BadRequestError, arguments);
|
|
20966
21039
|
}
|
|
20967
21040
|
bad_request_inherits(BadRequestError, _NetworkError);
|
|
20968
21041
|
return bad_request_createClass(BadRequestError);
|
|
@@ -20983,15 +21056,9 @@ function bad_response_inherits(t, e) { if ("function" != typeof e && null !== e)
|
|
|
20983
21056
|
function bad_response_setPrototypeOf(t, e) { return bad_response_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, bad_response_setPrototypeOf(t, e); }
|
|
20984
21057
|
|
|
20985
21058
|
var BadResponseError = function (_NetworkError) {
|
|
20986
|
-
function BadResponseError(
|
|
20987
|
-
var _this;
|
|
21059
|
+
function BadResponseError() {
|
|
20988
21060
|
bad_response_classCallCheck(this, BadResponseError);
|
|
20989
|
-
|
|
20990
|
-
_this = bad_response_callSuper(this, BadResponseError, [message, response]);
|
|
20991
|
-
_this.__proto__ = trueProto;
|
|
20992
|
-
_this.constructor = BadResponseError;
|
|
20993
|
-
_this.name = "BadResponseError";
|
|
20994
|
-
return _this;
|
|
21061
|
+
return bad_response_callSuper(this, BadResponseError, arguments);
|
|
20995
21062
|
}
|
|
20996
21063
|
bad_response_inherits(BadResponseError, _NetworkError);
|
|
20997
21064
|
return bad_response_createClass(BadResponseError);
|
|
@@ -21017,11 +21084,7 @@ var AccountRequiresMemoError = function (_Error) {
|
|
|
21017
21084
|
function AccountRequiresMemoError(message, accountId, operationIndex) {
|
|
21018
21085
|
var _this;
|
|
21019
21086
|
account_requires_memo_classCallCheck(this, AccountRequiresMemoError);
|
|
21020
|
-
var trueProto = (this instanceof AccountRequiresMemoError ? this.constructor : void 0).prototype;
|
|
21021
21087
|
_this = account_requires_memo_callSuper(this, AccountRequiresMemoError, [message]);
|
|
21022
|
-
_this.__proto__ = trueProto;
|
|
21023
|
-
_this.constructor = AccountRequiresMemoError;
|
|
21024
|
-
_this.name = "AccountRequiresMemoError";
|
|
21025
21088
|
_this.accountId = accountId;
|
|
21026
21089
|
_this.operationIndex = operationIndex;
|
|
21027
21090
|
return _this;
|