@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
|
@@ -19,15 +19,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var BadRequestError = exports.BadRequestError = function (_NetworkError) {
|
|
22
|
-
function BadRequestError(
|
|
23
|
-
var _this;
|
|
22
|
+
function BadRequestError() {
|
|
24
23
|
_classCallCheck(this, BadRequestError);
|
|
25
|
-
|
|
26
|
-
_this = _callSuper(this, BadRequestError, [message, response]);
|
|
27
|
-
_this.__proto__ = trueProto;
|
|
28
|
-
_this.constructor = BadRequestError;
|
|
29
|
-
_this.name = "BadRequestError";
|
|
30
|
-
return _this;
|
|
24
|
+
return _callSuper(this, BadRequestError, arguments);
|
|
31
25
|
}
|
|
32
26
|
_inherits(BadRequestError, _NetworkError);
|
|
33
27
|
return _createClass(BadRequestError);
|
|
@@ -19,15 +19,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var BadResponseError = exports.BadResponseError = function (_NetworkError) {
|
|
22
|
-
function BadResponseError(
|
|
23
|
-
var _this;
|
|
22
|
+
function BadResponseError() {
|
|
24
23
|
_classCallCheck(this, BadResponseError);
|
|
25
|
-
|
|
26
|
-
_this = _callSuper(this, BadResponseError, [message, response]);
|
|
27
|
-
_this.__proto__ = trueProto;
|
|
28
|
-
_this.constructor = BadResponseError;
|
|
29
|
-
_this.name = "BadResponseError";
|
|
30
|
-
return _this;
|
|
24
|
+
return _callSuper(this, BadResponseError, arguments);
|
|
31
25
|
}
|
|
32
26
|
_inherits(BadResponseError, _NetworkError);
|
|
33
27
|
return _createClass(BadResponseError);
|
|
@@ -24,10 +24,7 @@ var NetworkError = exports.NetworkError = function (_Error) {
|
|
|
24
24
|
function NetworkError(message, response) {
|
|
25
25
|
var _this;
|
|
26
26
|
_classCallCheck(this, NetworkError);
|
|
27
|
-
var trueProto = (this instanceof NetworkError ? this.constructor : void 0).prototype;
|
|
28
27
|
_this = _callSuper(this, NetworkError, [message]);
|
|
29
|
-
_this.__proto__ = trueProto;
|
|
30
|
-
_this.constructor = NetworkError;
|
|
31
28
|
_this.response = response;
|
|
32
29
|
return _this;
|
|
33
30
|
}
|
|
@@ -19,15 +19,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var NotFoundError = exports.NotFoundError = function (_NetworkError) {
|
|
22
|
-
function NotFoundError(
|
|
23
|
-
var _this;
|
|
22
|
+
function NotFoundError() {
|
|
24
23
|
_classCallCheck(this, NotFoundError);
|
|
25
|
-
|
|
26
|
-
_this = _callSuper(this, NotFoundError, [message, response]);
|
|
27
|
-
_this.__proto__ = trueProto;
|
|
28
|
-
_this.constructor = NotFoundError;
|
|
29
|
-
_this.name = "NotFoundError";
|
|
30
|
-
return _this;
|
|
24
|
+
return _callSuper(this, NotFoundError, arguments);
|
|
31
25
|
}
|
|
32
26
|
_inherits(NotFoundError, _NetworkError);
|
|
33
27
|
return _createClass(NotFoundError);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Asset } from "@stellar/stellar-base";
|
|
2
2
|
import { CallBuilder } from "./call_builder";
|
|
3
3
|
import { ServerApi } from "./server_api";
|
|
4
|
+
import { HttpClient } from "../http-client";
|
|
4
5
|
/**
|
|
5
6
|
* Creates a new {@link AccountCallBuilder} pointed to server defined by `serverUrl`.
|
|
6
7
|
*
|
|
@@ -14,7 +15,7 @@ import { ServerApi } from "./server_api";
|
|
|
14
15
|
* @param {string} serverUrl Horizon server URL.
|
|
15
16
|
*/
|
|
16
17
|
export declare class AccountCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.AccountRecord>> {
|
|
17
|
-
constructor(serverUrl: URI);
|
|
18
|
+
constructor(serverUrl: URI, httpClient: HttpClient);
|
|
18
19
|
/**
|
|
19
20
|
* Returns information and links relating to a single account.
|
|
20
21
|
* The balances section in the returned JSON will also list all the trust lines this account has set up.
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var AccountCallBuilder = exports.AccountCallBuilder = function (_CallBuilder) {
|
|
22
|
-
function AccountCallBuilder(serverUrl) {
|
|
22
|
+
function AccountCallBuilder(serverUrl, httpClient) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, AccountCallBuilder);
|
|
25
|
-
_this = _callSuper(this, AccountCallBuilder, [serverUrl]);
|
|
25
|
+
_this = _callSuper(this, AccountCallBuilder, [serverUrl, httpClient]);
|
|
26
26
|
_this.url.segment("accounts");
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ var AccountCallBuilder = exports.AccountCallBuilder = function (_CallBuilder) {
|
|
|
30
30
|
return _createClass(AccountCallBuilder, [{
|
|
31
31
|
key: "accountId",
|
|
32
32
|
value: function accountId(id) {
|
|
33
|
-
var builder = new _call_builder.CallBuilder(this.url.clone());
|
|
33
|
+
var builder = new _call_builder.CallBuilder(this.url.clone(), this.httpClient);
|
|
34
34
|
builder.filter.push([id]);
|
|
35
35
|
return builder;
|
|
36
36
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CallBuilder } from "./call_builder";
|
|
2
2
|
import { ServerApi } from "./server_api";
|
|
3
|
+
import { HttpClient } from "../http-client";
|
|
3
4
|
/**
|
|
4
5
|
* Creates a new {@link AssetsCallBuilder} pointed to server defined by serverUrl.
|
|
5
6
|
*
|
|
@@ -11,7 +12,7 @@ import { ServerApi } from "./server_api";
|
|
|
11
12
|
* @param {string} serverUrl Horizon server URL.
|
|
12
13
|
*/
|
|
13
14
|
export declare class AssetsCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.AssetRecord>> {
|
|
14
|
-
constructor(serverUrl: URI);
|
|
15
|
+
constructor(serverUrl: URI, httpClient: HttpClient);
|
|
15
16
|
/**
|
|
16
17
|
* This endpoint filters all assets by the asset code.
|
|
17
18
|
* @param {string} value For example: `USD`
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var AssetsCallBuilder = exports.AssetsCallBuilder = function (_CallBuilder) {
|
|
22
|
-
function AssetsCallBuilder(serverUrl) {
|
|
22
|
+
function AssetsCallBuilder(serverUrl, httpClient) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, AssetsCallBuilder);
|
|
25
|
-
_this = _callSuper(this, AssetsCallBuilder, [serverUrl]);
|
|
25
|
+
_this = _callSuper(this, AssetsCallBuilder, [serverUrl, httpClient]);
|
|
26
26
|
_this.url.segment("assets");
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import URI from "urijs";
|
|
2
2
|
import { HorizonApi } from "./horizon_api";
|
|
3
|
+
import { HttpClient } from "../http-client";
|
|
3
4
|
import { ServerApi } from "./server_api";
|
|
4
5
|
export interface EventSourceOptions<T> {
|
|
5
6
|
onmessage?: (value: T extends ServerApi.CollectionPage<infer U> ? U : T) => void;
|
|
@@ -18,7 +19,8 @@ export declare class CallBuilder<T extends HorizonApi.FeeStatsResponse | Horizon
|
|
|
18
19
|
filter: string[][];
|
|
19
20
|
protected originalSegments: string[];
|
|
20
21
|
protected neighborRoot: string;
|
|
21
|
-
|
|
22
|
+
protected httpClient: HttpClient;
|
|
23
|
+
constructor(serverUrl: URI, httpClient: HttpClient, neighborRoot?: string);
|
|
22
24
|
/**
|
|
23
25
|
* Triggers a HTTP request using this builder's current configuration.
|
|
24
26
|
* @returns {Promise} a Promise that resolves to the server's response.
|
|
@@ -27,13 +27,14 @@ if (typeof true !== "undefined" && true) {
|
|
|
27
27
|
EventSource = (_ref = (_anyGlobal$EventSourc = anyGlobal.EventSource) !== null && _anyGlobal$EventSourc !== void 0 ? _anyGlobal$EventSourc : (_anyGlobal$window = anyGlobal.window) === null || _anyGlobal$window === void 0 ? void 0 : _anyGlobal$window.EventSource) !== null && _ref !== void 0 ? _ref : require("eventsource");
|
|
28
28
|
}
|
|
29
29
|
var CallBuilder = exports.CallBuilder = function () {
|
|
30
|
-
function CallBuilder(serverUrl) {
|
|
31
|
-
var neighborRoot = arguments.length >
|
|
30
|
+
function CallBuilder(serverUrl, httpClient) {
|
|
31
|
+
var neighborRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
32
32
|
_classCallCheck(this, CallBuilder);
|
|
33
33
|
this.url = serverUrl.clone();
|
|
34
34
|
this.filter = [];
|
|
35
35
|
this.originalSegments = this.url.segment() || [];
|
|
36
36
|
this.neighborRoot = neighborRoot;
|
|
37
|
+
this.httpClient = httpClient;
|
|
37
38
|
}
|
|
38
39
|
return _createClass(CallBuilder, [{
|
|
39
40
|
key: "call",
|
|
@@ -241,7 +242,7 @@ var CallBuilder = exports.CallBuilder = function () {
|
|
|
241
242
|
if (url.protocol() === "") {
|
|
242
243
|
url = url.protocol(this.url.protocol());
|
|
243
244
|
}
|
|
244
|
-
return _context3.a(2,
|
|
245
|
+
return _context3.a(2, this.httpClient.get(url.toString()).then(function (response) {
|
|
245
246
|
return response.data;
|
|
246
247
|
}).catch(this._handleNetworkError));
|
|
247
248
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Asset } from "@stellar/stellar-base";
|
|
2
2
|
import { CallBuilder } from "./call_builder";
|
|
3
3
|
import { ServerApi } from "./server_api";
|
|
4
|
+
import { HttpClient } from "../http-client";
|
|
4
5
|
/**
|
|
5
6
|
* Creates a new {@link ClaimableBalanceCallBuilder} pointed to server defined by serverUrl.
|
|
6
7
|
*
|
|
@@ -14,7 +15,7 @@ import { ServerApi } from "./server_api";
|
|
|
14
15
|
* @param {string} serverUrl Horizon server URL.
|
|
15
16
|
*/
|
|
16
17
|
export declare class ClaimableBalanceCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.ClaimableBalanceRecord>> {
|
|
17
|
-
constructor(serverUrl: URI);
|
|
18
|
+
constructor(serverUrl: URI, httpClient: HttpClient);
|
|
18
19
|
/**
|
|
19
20
|
* The claimable balance details endpoint provides information on a single claimable balance.
|
|
20
21
|
*
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var ClaimableBalanceCallBuilder = exports.ClaimableBalanceCallBuilder = function (_CallBuilder) {
|
|
22
|
-
function ClaimableBalanceCallBuilder(serverUrl) {
|
|
22
|
+
function ClaimableBalanceCallBuilder(serverUrl, httpClient) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, ClaimableBalanceCallBuilder);
|
|
25
|
-
_this = _callSuper(this, ClaimableBalanceCallBuilder, [serverUrl]);
|
|
25
|
+
_this = _callSuper(this, ClaimableBalanceCallBuilder, [serverUrl, httpClient]);
|
|
26
26
|
_this.url.segment("claimable_balances");
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ var ClaimableBalanceCallBuilder = exports.ClaimableBalanceCallBuilder = function
|
|
|
30
30
|
return _createClass(ClaimableBalanceCallBuilder, [{
|
|
31
31
|
key: "claimableBalance",
|
|
32
32
|
value: function claimableBalance(claimableBalanceId) {
|
|
33
|
-
var builder = new _call_builder.CallBuilder(this.url.clone());
|
|
33
|
+
var builder = new _call_builder.CallBuilder(this.url.clone(), this.httpClient);
|
|
34
34
|
builder.filter.push([claimableBalanceId]);
|
|
35
35
|
return builder;
|
|
36
36
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CallBuilder } from "./call_builder";
|
|
2
2
|
import { ServerApi } from "./server_api";
|
|
3
|
+
import { HttpClient } from "../http-client";
|
|
3
4
|
/**
|
|
4
5
|
* Creates a new {@link EffectCallBuilder} pointed to server defined by serverUrl.
|
|
5
6
|
* Do not create this object directly, use {@link Horizon.Server#effects}.
|
|
@@ -12,7 +13,7 @@ import { ServerApi } from "./server_api";
|
|
|
12
13
|
* @param {string} serverUrl Horizon server URL.
|
|
13
14
|
*/
|
|
14
15
|
export declare class EffectCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.EffectRecord>> {
|
|
15
|
-
constructor(serverUrl: URI);
|
|
16
|
+
constructor(serverUrl: URI, httpClient: HttpClient);
|
|
16
17
|
/**
|
|
17
18
|
* This endpoint represents all effects that changed a given account. It will return relevant effects from the creation of the account to the current ledger.
|
|
18
19
|
* @see {@link https://developers.stellar.org/docs/data/horizon/api-reference/resources/get-effects-by-account-id|Effects for Account}
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var EffectCallBuilder = exports.EffectCallBuilder = function (_CallBuilder) {
|
|
22
|
-
function EffectCallBuilder(serverUrl) {
|
|
22
|
+
function EffectCallBuilder(serverUrl, httpClient) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, EffectCallBuilder);
|
|
25
|
-
_this = _callSuper(this, EffectCallBuilder, [serverUrl, "effects"]);
|
|
25
|
+
_this = _callSuper(this, EffectCallBuilder, [serverUrl, httpClient, "effects"]);
|
|
26
26
|
_this.url.segment("effects");
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CallBuilder } from "./call_builder";
|
|
2
|
+
import { HttpClient } from "../http-client";
|
|
2
3
|
export declare class FriendbotBuilder extends CallBuilder<any> {
|
|
3
|
-
constructor(serverUrl: URI, address: string);
|
|
4
|
+
constructor(serverUrl: URI, httpClient: HttpClient, address: string);
|
|
4
5
|
}
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var FriendbotBuilder = exports.FriendbotBuilder = function (_CallBuilder) {
|
|
22
|
-
function FriendbotBuilder(serverUrl, address) {
|
|
22
|
+
function FriendbotBuilder(serverUrl, httpClient, address) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, FriendbotBuilder);
|
|
25
|
-
_this = _callSuper(this, FriendbotBuilder, [serverUrl]);
|
|
25
|
+
_this = _callSuper(this, FriendbotBuilder, [serverUrl, httpClient]);
|
|
26
26
|
_this.url.segment("friendbot");
|
|
27
27
|
_this.url.setQuery("addr", address);
|
|
28
28
|
return _this;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HttpClient } from "../http-client";
|
|
1
2
|
export declare const version: string;
|
|
2
3
|
export interface ServerTime {
|
|
3
4
|
serverTime: number;
|
|
@@ -21,8 +22,7 @@ export interface ServerTime {
|
|
|
21
22
|
* @memberof module:Horizon
|
|
22
23
|
*/
|
|
23
24
|
export declare const SERVER_TIME_MAP: Record<string, ServerTime>;
|
|
24
|
-
export declare
|
|
25
|
-
export default AxiosClient;
|
|
25
|
+
export declare function createHttpClient(headers?: Record<string, string>): HttpClient;
|
|
26
26
|
/**
|
|
27
27
|
* Given a hostname, get the current time of that server (i.e., use the last-
|
|
28
28
|
* recorded server time and offset it by the time since then.) If there IS no
|
|
@@ -3,48 +3,56 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SERVER_TIME_MAP = void 0;
|
|
7
|
+
exports.createHttpClient = createHttpClient;
|
|
7
8
|
exports.getCurrentServerTime = getCurrentServerTime;
|
|
8
9
|
exports.version = void 0;
|
|
9
10
|
var _urijs = _interopRequireDefault(require("urijs"));
|
|
10
11
|
var _httpClient = require("../http-client");
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
|
-
var
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
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); }
|
|
19
|
+
var version = exports.version = "14.3.1";
|
|
14
20
|
var SERVER_TIME_MAP = exports.SERVER_TIME_MAP = {};
|
|
15
|
-
var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
|
|
16
|
-
headers: {
|
|
17
|
-
"X-Client-Name": "js-stellar-sdk",
|
|
18
|
-
"X-Client-Version": version
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
21
|
function toSeconds(ms) {
|
|
22
22
|
return Math.floor(ms / 1000);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
function createHttpClient(headers) {
|
|
25
|
+
var httpClient = (0, _httpClient.create)({
|
|
26
|
+
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
27
|
+
"X-Client-Name": "js-stellar-sdk",
|
|
28
|
+
"X-Client-Version": version
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
httpClient.interceptors.response.use(function (response) {
|
|
32
|
+
var hostname = (0, _urijs.default)(response.config.url).hostname();
|
|
33
|
+
var serverTime = 0;
|
|
34
|
+
if (response.headers instanceof Headers) {
|
|
35
|
+
var dateHeader = response.headers.get("date");
|
|
36
|
+
if (dateHeader) {
|
|
37
|
+
serverTime = toSeconds(Date.parse(dateHeader));
|
|
38
|
+
}
|
|
39
|
+
} else if (_typeof(response.headers) === "object" && "date" in response.headers) {
|
|
40
|
+
var responseHeader = response.headers;
|
|
41
|
+
if (typeof responseHeader.date === "string") {
|
|
42
|
+
serverTime = toSeconds(Date.parse(responseHeader.date));
|
|
43
|
+
}
|
|
31
44
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
var localTimeRecorded = toSeconds(new Date().getTime());
|
|
46
|
+
if (!Number.isNaN(serverTime)) {
|
|
47
|
+
SERVER_TIME_MAP[hostname] = {
|
|
48
|
+
serverTime: serverTime,
|
|
49
|
+
localTimeRecorded: localTimeRecorded
|
|
50
|
+
};
|
|
36
51
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
serverTime: serverTime,
|
|
42
|
-
localTimeRecorded: localTimeRecorded
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return response;
|
|
46
|
-
});
|
|
47
|
-
var _default = exports.default = AxiosClient;
|
|
52
|
+
return response;
|
|
53
|
+
});
|
|
54
|
+
return httpClient;
|
|
55
|
+
}
|
|
48
56
|
function getCurrentServerTime(hostname) {
|
|
49
57
|
var entry = SERVER_TIME_MAP[hostname];
|
|
50
58
|
if (!entry || !entry.localTimeRecorded || !entry.serverTime) {
|
|
@@ -3,6 +3,6 @@ export * from "./horizon_api";
|
|
|
3
3
|
export * from "./server_api";
|
|
4
4
|
export * from "./account_response";
|
|
5
5
|
export { HorizonServer as Server } from "./server";
|
|
6
|
-
export {
|
|
6
|
+
export { SERVER_TIME_MAP, getCurrentServerTime } from "./horizon_axios_client";
|
|
7
7
|
declare const _default: any;
|
|
8
8
|
export default _default;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
var _exportNames = {
|
|
8
7
|
Server: true,
|
|
9
|
-
AxiosClient: true,
|
|
10
8
|
SERVER_TIME_MAP: true,
|
|
11
9
|
getCurrentServerTime: true
|
|
12
10
|
};
|
|
13
|
-
Object.defineProperty(exports, "AxiosClient", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _horizon_axios_client.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
11
|
Object.defineProperty(exports, "SERVER_TIME_MAP", {
|
|
20
12
|
enumerable: true,
|
|
21
13
|
get: function get() {
|
|
@@ -72,6 +64,5 @@ Object.keys(_account_response).forEach(function (key) {
|
|
|
72
64
|
});
|
|
73
65
|
});
|
|
74
66
|
var _server = require("./server");
|
|
75
|
-
var _horizon_axios_client =
|
|
76
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
67
|
+
var _horizon_axios_client = require("./horizon_axios_client");
|
|
77
68
|
var _default = exports.default = module.exports;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CallBuilder } from "./call_builder";
|
|
2
2
|
import { ServerApi } from "./server_api";
|
|
3
|
+
import { HttpClient } from "../http-client";
|
|
3
4
|
/**
|
|
4
5
|
* Creates a new {@link LedgerCallBuilder} pointed to server defined by serverUrl.
|
|
5
6
|
*
|
|
@@ -13,7 +14,7 @@ import { ServerApi } from "./server_api";
|
|
|
13
14
|
* @param {string} serverUrl Horizon server URL.
|
|
14
15
|
*/
|
|
15
16
|
export declare class LedgerCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.LedgerRecord>> {
|
|
16
|
-
constructor(serverUrl: URI);
|
|
17
|
+
constructor(serverUrl: URI, httpClient: HttpClient);
|
|
17
18
|
/**
|
|
18
19
|
* Provides information on a single ledger.
|
|
19
20
|
* @param {number|string} sequence Ledger sequence
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var LedgerCallBuilder = exports.LedgerCallBuilder = function (_CallBuilder) {
|
|
22
|
-
function LedgerCallBuilder(serverUrl) {
|
|
22
|
+
function LedgerCallBuilder(serverUrl, httpClient) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, LedgerCallBuilder);
|
|
25
|
-
_this = _callSuper(this, LedgerCallBuilder, [serverUrl]);
|
|
25
|
+
_this = _callSuper(this, LedgerCallBuilder, [serverUrl, httpClient]);
|
|
26
26
|
_this.url.segment("ledgers");
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Asset } from "@stellar/stellar-base";
|
|
2
2
|
import { CallBuilder } from "./call_builder";
|
|
3
3
|
import { ServerApi } from "./server_api";
|
|
4
|
+
import { HttpClient } from "../http-client";
|
|
4
5
|
/**
|
|
5
6
|
* Creates a new {@link LiquidityPoolCallBuilder} pointed to server defined by serverUrl.
|
|
6
7
|
*
|
|
@@ -12,7 +13,7 @@ import { ServerApi } from "./server_api";
|
|
|
12
13
|
* @param {string} serverUrl Horizon server URL.
|
|
13
14
|
*/
|
|
14
15
|
export declare class LiquidityPoolCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.LiquidityPoolRecord>> {
|
|
15
|
-
constructor(serverUrl: URI);
|
|
16
|
+
constructor(serverUrl: URI, httpClient: HttpClient);
|
|
16
17
|
/**
|
|
17
18
|
* Filters out pools whose reserves don't exactly match these assets.
|
|
18
19
|
*
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var LiquidityPoolCallBuilder = exports.LiquidityPoolCallBuilder = function (_CallBuilder) {
|
|
22
|
-
function LiquidityPoolCallBuilder(serverUrl) {
|
|
22
|
+
function LiquidityPoolCallBuilder(serverUrl, httpClient) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, LiquidityPoolCallBuilder);
|
|
25
|
-
_this = _callSuper(this, LiquidityPoolCallBuilder, [serverUrl]);
|
|
25
|
+
_this = _callSuper(this, LiquidityPoolCallBuilder, [serverUrl, httpClient]);
|
|
26
26
|
_this.url.segment("liquidity_pools");
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
@@ -51,7 +51,7 @@ var LiquidityPoolCallBuilder = exports.LiquidityPoolCallBuilder = function (_Cal
|
|
|
51
51
|
if (!id.match(/[a-fA-F0-9]{64}/)) {
|
|
52
52
|
throw new TypeError("".concat(id, " does not look like a liquidity pool ID"));
|
|
53
53
|
}
|
|
54
|
-
var builder = new _call_builder.CallBuilder(this.url.clone());
|
|
54
|
+
var builder = new _call_builder.CallBuilder(this.url.clone(), this.httpClient);
|
|
55
55
|
builder.filter.push([id.toLowerCase()]);
|
|
56
56
|
return builder;
|
|
57
57
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Asset } from "@stellar/stellar-base";
|
|
2
2
|
import { CallBuilder } from "./call_builder";
|
|
3
3
|
import { ServerApi } from "./server_api";
|
|
4
|
+
import { HttpClient } from "../http-client";
|
|
4
5
|
/**
|
|
5
6
|
* Creates a new {@link OfferCallBuilder} pointed to server defined by serverUrl.
|
|
6
7
|
*
|
|
@@ -14,7 +15,7 @@ import { ServerApi } from "./server_api";
|
|
|
14
15
|
* @param {string} serverUrl Horizon server URL.
|
|
15
16
|
*/
|
|
16
17
|
export declare class OfferCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.OfferRecord>> {
|
|
17
|
-
constructor(serverUrl: URI);
|
|
18
|
+
constructor(serverUrl: URI, httpClient: HttpClient);
|
|
18
19
|
/**
|
|
19
20
|
* The offer details endpoint provides information on a single offer. The offer ID provided in the id
|
|
20
21
|
* argument specifies which offer to load.
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var OfferCallBuilder = exports.OfferCallBuilder = function (_CallBuilder) {
|
|
22
|
-
function OfferCallBuilder(serverUrl) {
|
|
22
|
+
function OfferCallBuilder(serverUrl, httpClient) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, OfferCallBuilder);
|
|
25
|
-
_this = _callSuper(this, OfferCallBuilder, [serverUrl, "offers"]);
|
|
25
|
+
_this = _callSuper(this, OfferCallBuilder, [serverUrl, httpClient, "offers"]);
|
|
26
26
|
_this.url.segment("offers");
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ var OfferCallBuilder = exports.OfferCallBuilder = function (_CallBuilder) {
|
|
|
30
30
|
return _createClass(OfferCallBuilder, [{
|
|
31
31
|
key: "offer",
|
|
32
32
|
value: function offer(offerId) {
|
|
33
|
-
var builder = new _call_builder.CallBuilder(this.url.clone());
|
|
33
|
+
var builder = new _call_builder.CallBuilder(this.url.clone(), this.httpClient);
|
|
34
34
|
builder.filter.push([offerId]);
|
|
35
35
|
return builder;
|
|
36
36
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CallBuilder } from "./call_builder";
|
|
2
2
|
import { ServerApi } from "./server_api";
|
|
3
|
+
import { HttpClient } from "../http-client";
|
|
3
4
|
/**
|
|
4
5
|
* Creates a new {@link OperationCallBuilder} pointed to server defined by serverUrl.
|
|
5
6
|
*
|
|
@@ -13,7 +14,7 @@ import { ServerApi } from "./server_api";
|
|
|
13
14
|
* @param {string} serverUrl Horizon server URL.
|
|
14
15
|
*/
|
|
15
16
|
export declare class OperationCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.OperationRecord>> {
|
|
16
|
-
constructor(serverUrl: URI);
|
|
17
|
+
constructor(serverUrl: URI, httpClient: HttpClient);
|
|
17
18
|
/**
|
|
18
19
|
* The operation details endpoint provides information on a single operation. The operation ID provided in the id
|
|
19
20
|
* argument specifies which operation to load.
|
|
@@ -19,10 +19,10 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
|
|
|
19
19
|
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
20
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
21
|
var OperationCallBuilder = exports.OperationCallBuilder = function (_CallBuilder) {
|
|
22
|
-
function OperationCallBuilder(serverUrl) {
|
|
22
|
+
function OperationCallBuilder(serverUrl, httpClient) {
|
|
23
23
|
var _this;
|
|
24
24
|
_classCallCheck(this, OperationCallBuilder);
|
|
25
|
-
_this = _callSuper(this, OperationCallBuilder, [serverUrl, "operations"]);
|
|
25
|
+
_this = _callSuper(this, OperationCallBuilder, [serverUrl, httpClient, "operations"]);
|
|
26
26
|
_this.url.segment("operations");
|
|
27
27
|
return _this;
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ var OperationCallBuilder = exports.OperationCallBuilder = function (_CallBuilder
|
|
|
30
30
|
return _createClass(OperationCallBuilder, [{
|
|
31
31
|
key: "operation",
|
|
32
32
|
value: function operation(operationId) {
|
|
33
|
-
var builder = new _call_builder.CallBuilder(this.url.clone());
|
|
33
|
+
var builder = new _call_builder.CallBuilder(this.url.clone(), this.httpClient);
|
|
34
34
|
builder.filter.push([operationId]);
|
|
35
35
|
return builder;
|
|
36
36
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Asset } from "@stellar/stellar-base";
|
|
2
2
|
import { CallBuilder } from "./call_builder";
|
|
3
3
|
import { ServerApi } from "./server_api";
|
|
4
|
+
import { HttpClient } from "../http-client";
|
|
4
5
|
/**
|
|
5
6
|
* Creates a new {@link OrderbookCallBuilder} pointed to server defined by serverUrl.
|
|
6
7
|
*
|
|
@@ -16,5 +17,5 @@ import { ServerApi } from "./server_api";
|
|
|
16
17
|
* @param {Asset} buying Asset being bought
|
|
17
18
|
*/
|
|
18
19
|
export declare class OrderbookCallBuilder extends CallBuilder<ServerApi.OrderbookRecord> {
|
|
19
|
-
constructor(serverUrl: URI, selling: Asset, buying: Asset);
|
|
20
|
+
constructor(serverUrl: URI, httpClient: HttpClient, selling: Asset, buying: Asset);
|
|
20
21
|
}
|