@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
|
@@ -1473,6 +1473,7 @@ module.exports = $defineProperty;
|
|
|
1473
1473
|
"use strict";
|
|
1474
1474
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1475
1475
|
/* harmony export */ $D: () => (/* binding */ parseRawLedgerEntries),
|
|
1476
|
+
/* harmony export */ $E: () => (/* binding */ parseRawLedger),
|
|
1476
1477
|
/* harmony export */ Af: () => (/* binding */ parseRawSendTransaction),
|
|
1477
1478
|
/* harmony export */ WC: () => (/* binding */ parseTransactionInfo),
|
|
1478
1479
|
/* harmony export */ fG: () => (/* binding */ parseRawEvents),
|
|
@@ -1646,6 +1647,28 @@ function parseRawSimulation(sim) {
|
|
|
1646
1647
|
}
|
|
1647
1648
|
return parseSuccessful(sim, base);
|
|
1648
1649
|
}
|
|
1650
|
+
function parseRawLedger(raw) {
|
|
1651
|
+
if (!raw.metadataXdr || !raw.headerXdr) {
|
|
1652
|
+
var missingFields;
|
|
1653
|
+
if (!raw.metadataXdr && !raw.headerXdr) {
|
|
1654
|
+
missingFields = "metadataXdr and headerXdr";
|
|
1655
|
+
} else if (!raw.metadataXdr) {
|
|
1656
|
+
missingFields = "metadataXdr";
|
|
1657
|
+
} else {
|
|
1658
|
+
missingFields = "headerXdr";
|
|
1659
|
+
}
|
|
1660
|
+
throw new TypeError("invalid ledger missing fields: ".concat(missingFields));
|
|
1661
|
+
}
|
|
1662
|
+
var metadataXdr = _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.xdr.LedgerCloseMeta.fromXDR(raw.metadataXdr, "base64");
|
|
1663
|
+
var headerXdr = _stellar_stellar_base__WEBPACK_IMPORTED_MODULE_0__.xdr.LedgerHeaderHistoryEntry.fromXDR(raw.headerXdr, "base64");
|
|
1664
|
+
return {
|
|
1665
|
+
hash: raw.hash,
|
|
1666
|
+
sequence: raw.sequence,
|
|
1667
|
+
ledgerCloseTime: raw.ledgerCloseTime,
|
|
1668
|
+
metadataXdr: metadataXdr,
|
|
1669
|
+
headerXdr: headerXdr
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1649
1672
|
|
|
1650
1673
|
/***/ }),
|
|
1651
1674
|
|
|
@@ -4867,7 +4890,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4867
4890
|
// EXPORTS
|
|
4868
4891
|
__webpack_require__.d(__webpack_exports__, {
|
|
4869
4892
|
Api: () => (/* reexport */ api/* Api */.j),
|
|
4870
|
-
AxiosClient: () => (/* reexport */ axios),
|
|
4871
4893
|
BasicSleepStrategy: () => (/* reexport */ BasicSleepStrategy),
|
|
4872
4894
|
Durability: () => (/* reexport */ Durability),
|
|
4873
4895
|
LinearSleepStrategy: () => (/* reexport */ LinearSleepStrategy),
|
|
@@ -4888,29 +4910,35 @@ var stellar_base_min = __webpack_require__(8950);
|
|
|
4888
4910
|
// EXTERNAL MODULE: ./src/http-client/index.ts
|
|
4889
4911
|
var http_client = __webpack_require__(6371);
|
|
4890
4912
|
;// ./src/rpc/axios.ts
|
|
4913
|
+
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); }
|
|
4914
|
+
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; }
|
|
4915
|
+
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; }
|
|
4916
|
+
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; }
|
|
4917
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4918
|
+
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); }
|
|
4891
4919
|
|
|
4892
|
-
var version = "14.
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
})
|
|
4899
|
-
|
|
4920
|
+
var version = "14.3.1";
|
|
4921
|
+
function createHttpClient(headers) {
|
|
4922
|
+
return (0,http_client/* create */.vt)({
|
|
4923
|
+
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
4924
|
+
"X-Client-Name": "js-stellar-sdk",
|
|
4925
|
+
"X-Client-Version": version
|
|
4926
|
+
})
|
|
4927
|
+
});
|
|
4928
|
+
}
|
|
4900
4929
|
;// ./src/rpc/jsonrpc.ts
|
|
4901
4930
|
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 }; })(); }
|
|
4902
4931
|
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); }
|
|
4903
4932
|
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); }
|
|
4904
4933
|
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); }); }; }
|
|
4905
|
-
|
|
4906
4934
|
function jsonrpc_hasOwnProperty(obj, prop) {
|
|
4907
4935
|
return obj.hasOwnProperty(prop);
|
|
4908
4936
|
}
|
|
4909
|
-
function postObject(_x, _x2) {
|
|
4937
|
+
function postObject(_x, _x2, _x3) {
|
|
4910
4938
|
return _postObject.apply(this, arguments);
|
|
4911
4939
|
}
|
|
4912
4940
|
function _postObject() {
|
|
4913
|
-
_postObject = _asyncToGenerator(_regenerator().m(function _callee(url, method) {
|
|
4941
|
+
_postObject = _asyncToGenerator(_regenerator().m(function _callee(client, url, method) {
|
|
4914
4942
|
var param,
|
|
4915
4943
|
response,
|
|
4916
4944
|
_response$data,
|
|
@@ -4918,9 +4946,9 @@ function _postObject() {
|
|
|
4918
4946
|
return _regenerator().w(function (_context) {
|
|
4919
4947
|
while (1) switch (_context.n) {
|
|
4920
4948
|
case 0:
|
|
4921
|
-
param = _args.length >
|
|
4949
|
+
param = _args.length > 3 && _args[3] !== undefined ? _args[3] : null;
|
|
4922
4950
|
_context.n = 1;
|
|
4923
|
-
return
|
|
4951
|
+
return client.post(url, {
|
|
4924
4952
|
jsonrpc: "2.0",
|
|
4925
4953
|
id: 1,
|
|
4926
4954
|
method: method,
|
|
@@ -4950,19 +4978,19 @@ var parsers = __webpack_require__(784);
|
|
|
4950
4978
|
var utils = __webpack_require__(3121);
|
|
4951
4979
|
;// ./src/rpc/server.ts
|
|
4952
4980
|
/* provided dependency */ var Buffer = __webpack_require__(8287)["Buffer"];
|
|
4953
|
-
function
|
|
4954
|
-
function
|
|
4955
|
-
function
|
|
4956
|
-
function
|
|
4981
|
+
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); }
|
|
4982
|
+
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; }
|
|
4983
|
+
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; }
|
|
4984
|
+
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; }
|
|
4957
4985
|
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 }; })(); }
|
|
4958
4986
|
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); }
|
|
4959
4987
|
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); }
|
|
4960
4988
|
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); }); }; }
|
|
4961
4989
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
4962
|
-
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,
|
|
4990
|
+
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); } }
|
|
4963
4991
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4964
|
-
function
|
|
4965
|
-
function
|
|
4992
|
+
function server_toPropertyKey(t) { var i = server_toPrimitive(t, "string"); return "symbol" == server_typeof(i) ? i : i + ""; }
|
|
4993
|
+
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); }
|
|
4966
4994
|
|
|
4967
4995
|
|
|
4968
4996
|
|
|
@@ -5015,12 +5043,7 @@ var RpcServer = function () {
|
|
|
5015
5043
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5016
5044
|
_classCallCheck(this, RpcServer);
|
|
5017
5045
|
this.serverURL = URI_default()(serverURL);
|
|
5018
|
-
|
|
5019
|
-
axios.interceptors.request.use(function (config) {
|
|
5020
|
-
config.headers = Object.assign(config.headers, opts.headers);
|
|
5021
|
-
return config;
|
|
5022
|
-
});
|
|
5023
|
-
}
|
|
5046
|
+
this.httpClient = createHttpClient(opts.headers);
|
|
5024
5047
|
if (this.serverURL.protocol() !== "https" && !opts.allowHttp) {
|
|
5025
5048
|
throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set");
|
|
5026
5049
|
}
|
|
@@ -5175,7 +5198,7 @@ var RpcServer = function () {
|
|
|
5175
5198
|
return server_regenerator().w(function (_context5) {
|
|
5176
5199
|
while (1) switch (_context5.n) {
|
|
5177
5200
|
case 0:
|
|
5178
|
-
return _context5.a(2, postObject(this.serverURL.toString(), "getHealth"));
|
|
5201
|
+
return _context5.a(2, postObject(this.httpClient, this.serverURL.toString(), "getHealth"));
|
|
5179
5202
|
}
|
|
5180
5203
|
}, _callee5, this);
|
|
5181
5204
|
}));
|
|
@@ -5350,7 +5373,7 @@ var RpcServer = function () {
|
|
|
5350
5373
|
for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5351
5374
|
keys[_key] = arguments[_key];
|
|
5352
5375
|
}
|
|
5353
|
-
return postObject(this.serverURL.toString(), "getLedgerEntries", {
|
|
5376
|
+
return postObject(this.httpClient, this.serverURL.toString(), "getLedgerEntries", {
|
|
5354
5377
|
keys: keys.map(function (k) {
|
|
5355
5378
|
return k.toXDR("base64");
|
|
5356
5379
|
})
|
|
@@ -5437,7 +5460,7 @@ var RpcServer = function () {
|
|
|
5437
5460
|
if (raw.status !== api/* Api */.j.GetTransactionStatus.NOT_FOUND) {
|
|
5438
5461
|
Object.assign(foundInfo, (0,parsers/* parseTransactionInfo */.WC)(raw));
|
|
5439
5462
|
}
|
|
5440
|
-
var result =
|
|
5463
|
+
var result = server_objectSpread({
|
|
5441
5464
|
status: raw.status,
|
|
5442
5465
|
txHash: hash,
|
|
5443
5466
|
latestLedger: raw.latestLedger,
|
|
@@ -5462,7 +5485,7 @@ var RpcServer = function () {
|
|
|
5462
5485
|
return server_regenerator().w(function (_context10) {
|
|
5463
5486
|
while (1) switch (_context10.n) {
|
|
5464
5487
|
case 0:
|
|
5465
|
-
return _context10.a(2, postObject(this.serverURL.toString(), "getTransaction", {
|
|
5488
|
+
return _context10.a(2, postObject(this.httpClient, this.serverURL.toString(), "getTransaction", {
|
|
5466
5489
|
hash: hash
|
|
5467
5490
|
}));
|
|
5468
5491
|
}
|
|
@@ -5506,7 +5529,7 @@ var RpcServer = function () {
|
|
|
5506
5529
|
return server_regenerator().w(function (_context12) {
|
|
5507
5530
|
while (1) switch (_context12.n) {
|
|
5508
5531
|
case 0:
|
|
5509
|
-
return _context12.a(2, postObject(this.serverURL.toString(), "getTransactions", request));
|
|
5532
|
+
return _context12.a(2, postObject(this.httpClient, this.serverURL.toString(), "getTransactions", request));
|
|
5510
5533
|
}
|
|
5511
5534
|
}, _callee12, this);
|
|
5512
5535
|
}));
|
|
@@ -5539,9 +5562,9 @@ var RpcServer = function () {
|
|
|
5539
5562
|
return server_regenerator().w(function (_context14) {
|
|
5540
5563
|
while (1) switch (_context14.n) {
|
|
5541
5564
|
case 0:
|
|
5542
|
-
return _context14.a(2, postObject(this.serverURL.toString(), "getEvents",
|
|
5565
|
+
return _context14.a(2, postObject(this.httpClient, this.serverURL.toString(), "getEvents", server_objectSpread(server_objectSpread({
|
|
5543
5566
|
filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
|
|
5544
|
-
pagination:
|
|
5567
|
+
pagination: server_objectSpread(server_objectSpread({}, request.cursor && {
|
|
5545
5568
|
cursor: request.cursor
|
|
5546
5569
|
}), request.limit && {
|
|
5547
5570
|
limit: request.limit
|
|
@@ -5566,7 +5589,7 @@ var RpcServer = function () {
|
|
|
5566
5589
|
return server_regenerator().w(function (_context15) {
|
|
5567
5590
|
while (1) switch (_context15.n) {
|
|
5568
5591
|
case 0:
|
|
5569
|
-
return _context15.a(2, postObject(this.serverURL.toString(), "getNetwork"));
|
|
5592
|
+
return _context15.a(2, postObject(this.httpClient, this.serverURL.toString(), "getNetwork"));
|
|
5570
5593
|
}
|
|
5571
5594
|
}, _callee15, this);
|
|
5572
5595
|
}));
|
|
@@ -5582,7 +5605,7 @@ var RpcServer = function () {
|
|
|
5582
5605
|
return server_regenerator().w(function (_context16) {
|
|
5583
5606
|
while (1) switch (_context16.n) {
|
|
5584
5607
|
case 0:
|
|
5585
|
-
return _context16.a(2, postObject(this.serverURL.toString(), "getLatestLedger"));
|
|
5608
|
+
return _context16.a(2, postObject(this.httpClient, this.serverURL.toString(), "getLatestLedger"));
|
|
5586
5609
|
}
|
|
5587
5610
|
}, _callee16, this);
|
|
5588
5611
|
}));
|
|
@@ -5614,7 +5637,7 @@ var RpcServer = function () {
|
|
|
5614
5637
|
return server_regenerator().w(function (_context18) {
|
|
5615
5638
|
while (1) switch (_context18.n) {
|
|
5616
5639
|
case 0:
|
|
5617
|
-
return _context18.a(2, postObject(this.serverURL.toString(), "simulateTransaction",
|
|
5640
|
+
return _context18.a(2, postObject(this.httpClient, this.serverURL.toString(), "simulateTransaction", server_objectSpread({
|
|
5618
5641
|
transaction: transaction.toXDR(),
|
|
5619
5642
|
authMode: authMode
|
|
5620
5643
|
}, addlResources !== undefined && {
|
|
@@ -5680,7 +5703,7 @@ var RpcServer = function () {
|
|
|
5680
5703
|
return server_regenerator().w(function (_context21) {
|
|
5681
5704
|
while (1) switch (_context21.n) {
|
|
5682
5705
|
case 0:
|
|
5683
|
-
return _context21.a(2, postObject(this.serverURL.toString(), "sendTransaction", {
|
|
5706
|
+
return _context21.a(2, postObject(this.httpClient, this.serverURL.toString(), "sendTransaction", {
|
|
5684
5707
|
transaction: transaction.toXDR()
|
|
5685
5708
|
}));
|
|
5686
5709
|
}
|
|
@@ -5719,7 +5742,7 @@ var RpcServer = function () {
|
|
|
5719
5742
|
case 3:
|
|
5720
5743
|
_context22.p = 3;
|
|
5721
5744
|
_context22.n = 4;
|
|
5722
|
-
return
|
|
5745
|
+
return this.httpClient.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
|
|
5723
5746
|
case 4:
|
|
5724
5747
|
response = _context22.v;
|
|
5725
5748
|
if (response.data.result_meta_xdr) {
|
|
@@ -5775,7 +5798,7 @@ var RpcServer = function () {
|
|
|
5775
5798
|
return server_regenerator().w(function (_context23) {
|
|
5776
5799
|
while (1) switch (_context23.n) {
|
|
5777
5800
|
case 0:
|
|
5778
|
-
return _context23.a(2, postObject(this.serverURL.toString(), "getFeeStats"));
|
|
5801
|
+
return _context23.a(2, postObject(this.httpClient, this.serverURL.toString(), "getFeeStats"));
|
|
5779
5802
|
}
|
|
5780
5803
|
}, _callee23, this);
|
|
5781
5804
|
}));
|
|
@@ -5791,7 +5814,7 @@ var RpcServer = function () {
|
|
|
5791
5814
|
return server_regenerator().w(function (_context24) {
|
|
5792
5815
|
while (1) switch (_context24.n) {
|
|
5793
5816
|
case 0:
|
|
5794
|
-
return _context24.a(2, postObject(this.serverURL.toString(), "getVersionInfo"));
|
|
5817
|
+
return _context24.a(2, postObject(this.httpClient, this.serverURL.toString(), "getVersionInfo"));
|
|
5795
5818
|
}
|
|
5796
5819
|
}, _callee24, this);
|
|
5797
5820
|
}));
|
|
@@ -5880,6 +5903,48 @@ var RpcServer = function () {
|
|
|
5880
5903
|
}
|
|
5881
5904
|
return getSACBalance;
|
|
5882
5905
|
}())
|
|
5906
|
+
}, {
|
|
5907
|
+
key: "getLedgers",
|
|
5908
|
+
value: (function () {
|
|
5909
|
+
var _getLedgers2 = server_asyncToGenerator(server_regenerator().m(function _callee26(request) {
|
|
5910
|
+
return server_regenerator().w(function (_context26) {
|
|
5911
|
+
while (1) switch (_context26.n) {
|
|
5912
|
+
case 0:
|
|
5913
|
+
return _context26.a(2, this._getLedgers(request).then(function (raw) {
|
|
5914
|
+
var result = {
|
|
5915
|
+
ledgers: (raw.ledgers || []).map(parsers/* parseRawLedger */.$E),
|
|
5916
|
+
latestLedger: raw.latestLedger,
|
|
5917
|
+
latestLedgerCloseTime: raw.latestLedgerCloseTime,
|
|
5918
|
+
oldestLedger: raw.oldestLedger,
|
|
5919
|
+
oldestLedgerCloseTime: raw.oldestLedgerCloseTime,
|
|
5920
|
+
cursor: raw.cursor
|
|
5921
|
+
};
|
|
5922
|
+
return result;
|
|
5923
|
+
}));
|
|
5924
|
+
}
|
|
5925
|
+
}, _callee26, this);
|
|
5926
|
+
}));
|
|
5927
|
+
function getLedgers(_x31) {
|
|
5928
|
+
return _getLedgers2.apply(this, arguments);
|
|
5929
|
+
}
|
|
5930
|
+
return getLedgers;
|
|
5931
|
+
}())
|
|
5932
|
+
}, {
|
|
5933
|
+
key: "_getLedgers",
|
|
5934
|
+
value: function () {
|
|
5935
|
+
var _getLedgers3 = server_asyncToGenerator(server_regenerator().m(function _callee27(request) {
|
|
5936
|
+
return server_regenerator().w(function (_context27) {
|
|
5937
|
+
while (1) switch (_context27.n) {
|
|
5938
|
+
case 0:
|
|
5939
|
+
return _context27.a(2, postObject(this.httpClient, this.serverURL.toString(), "getLedgers", request));
|
|
5940
|
+
}
|
|
5941
|
+
}, _callee27, this);
|
|
5942
|
+
}));
|
|
5943
|
+
function _getLedgers(_x32) {
|
|
5944
|
+
return _getLedgers3.apply(this, arguments);
|
|
5945
|
+
}
|
|
5946
|
+
return _getLedgers;
|
|
5947
|
+
}()
|
|
5883
5948
|
}]);
|
|
5884
5949
|
}();
|
|
5885
5950
|
;// ./src/rpc/index.ts
|
|
@@ -5888,7 +5953,6 @@ var RpcServer = function () {
|
|
|
5888
5953
|
|
|
5889
5954
|
|
|
5890
5955
|
|
|
5891
|
-
|
|
5892
5956
|
/* harmony default export */ const rpc = (module.exports);
|
|
5893
5957
|
|
|
5894
5958
|
/***/ }),
|
|
@@ -10610,15 +10674,9 @@ function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).in
|
|
|
10610
10674
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
10611
10675
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10612
10676
|
var InvalidChallengeError = function (_Error) {
|
|
10613
|
-
function InvalidChallengeError(
|
|
10614
|
-
var _this;
|
|
10677
|
+
function InvalidChallengeError() {
|
|
10615
10678
|
_classCallCheck(this, InvalidChallengeError);
|
|
10616
|
-
|
|
10617
|
-
_this = _callSuper(this, InvalidChallengeError, [message]);
|
|
10618
|
-
_this.__proto__ = trueProto;
|
|
10619
|
-
_this.constructor = InvalidChallengeError;
|
|
10620
|
-
_this.name = "InvalidChallengeError";
|
|
10621
|
-
return _this;
|
|
10679
|
+
return _callSuper(this, InvalidChallengeError, arguments);
|
|
10622
10680
|
}
|
|
10623
10681
|
_inherits(InvalidChallengeError, _Error);
|
|
10624
10682
|
return _createClass(InvalidChallengeError);
|
|
@@ -15511,10 +15569,7 @@ var NetworkError = function (_Error) {
|
|
|
15511
15569
|
function NetworkError(message, response) {
|
|
15512
15570
|
var _this;
|
|
15513
15571
|
_classCallCheck(this, NetworkError);
|
|
15514
|
-
var trueProto = (this instanceof NetworkError ? this.constructor : void 0).prototype;
|
|
15515
15572
|
_this = _callSuper(this, NetworkError, [message]);
|
|
15516
|
-
_this.__proto__ = trueProto;
|
|
15517
|
-
_this.constructor = NetworkError;
|
|
15518
15573
|
_this.response = response;
|
|
15519
15574
|
return _this;
|
|
15520
15575
|
}
|
|
@@ -15542,15 +15597,9 @@ function not_found_inherits(t, e) { if ("function" != typeof e && null !== e) th
|
|
|
15542
15597
|
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); }
|
|
15543
15598
|
|
|
15544
15599
|
var NotFoundError = function (_NetworkError) {
|
|
15545
|
-
function NotFoundError(
|
|
15546
|
-
var _this;
|
|
15600
|
+
function NotFoundError() {
|
|
15547
15601
|
not_found_classCallCheck(this, NotFoundError);
|
|
15548
|
-
|
|
15549
|
-
_this = not_found_callSuper(this, NotFoundError, [message, response]);
|
|
15550
|
-
_this.__proto__ = trueProto;
|
|
15551
|
-
_this.constructor = NotFoundError;
|
|
15552
|
-
_this.name = "NotFoundError";
|
|
15553
|
-
return _this;
|
|
15602
|
+
return not_found_callSuper(this, NotFoundError, arguments);
|
|
15554
15603
|
}
|
|
15555
15604
|
not_found_inherits(NotFoundError, _NetworkError);
|
|
15556
15605
|
return not_found_createClass(NotFoundError);
|
|
@@ -15571,15 +15620,9 @@ function bad_request_inherits(t, e) { if ("function" != typeof e && null !== e)
|
|
|
15571
15620
|
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); }
|
|
15572
15621
|
|
|
15573
15622
|
var BadRequestError = function (_NetworkError) {
|
|
15574
|
-
function BadRequestError(
|
|
15575
|
-
var _this;
|
|
15623
|
+
function BadRequestError() {
|
|
15576
15624
|
bad_request_classCallCheck(this, BadRequestError);
|
|
15577
|
-
|
|
15578
|
-
_this = bad_request_callSuper(this, BadRequestError, [message, response]);
|
|
15579
|
-
_this.__proto__ = trueProto;
|
|
15580
|
-
_this.constructor = BadRequestError;
|
|
15581
|
-
_this.name = "BadRequestError";
|
|
15582
|
-
return _this;
|
|
15625
|
+
return bad_request_callSuper(this, BadRequestError, arguments);
|
|
15583
15626
|
}
|
|
15584
15627
|
bad_request_inherits(BadRequestError, _NetworkError);
|
|
15585
15628
|
return bad_request_createClass(BadRequestError);
|
|
@@ -15600,15 +15643,9 @@ function bad_response_inherits(t, e) { if ("function" != typeof e && null !== e)
|
|
|
15600
15643
|
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); }
|
|
15601
15644
|
|
|
15602
15645
|
var BadResponseError = function (_NetworkError) {
|
|
15603
|
-
function BadResponseError(
|
|
15604
|
-
var _this;
|
|
15646
|
+
function BadResponseError() {
|
|
15605
15647
|
bad_response_classCallCheck(this, BadResponseError);
|
|
15606
|
-
|
|
15607
|
-
_this = bad_response_callSuper(this, BadResponseError, [message, response]);
|
|
15608
|
-
_this.__proto__ = trueProto;
|
|
15609
|
-
_this.constructor = BadResponseError;
|
|
15610
|
-
_this.name = "BadResponseError";
|
|
15611
|
-
return _this;
|
|
15648
|
+
return bad_response_callSuper(this, BadResponseError, arguments);
|
|
15612
15649
|
}
|
|
15613
15650
|
bad_response_inherits(BadResponseError, _NetworkError);
|
|
15614
15651
|
return bad_response_createClass(BadResponseError);
|
|
@@ -15634,11 +15671,7 @@ var AccountRequiresMemoError = function (_Error) {
|
|
|
15634
15671
|
function AccountRequiresMemoError(message, accountId, operationIndex) {
|
|
15635
15672
|
var _this;
|
|
15636
15673
|
account_requires_memo_classCallCheck(this, AccountRequiresMemoError);
|
|
15637
|
-
var trueProto = (this instanceof AccountRequiresMemoError ? this.constructor : void 0).prototype;
|
|
15638
15674
|
_this = account_requires_memo_callSuper(this, AccountRequiresMemoError, [message]);
|
|
15639
|
-
_this.__proto__ = trueProto;
|
|
15640
|
-
_this.constructor = AccountRequiresMemoError;
|
|
15641
|
-
_this.name = "AccountRequiresMemoError";
|
|
15642
15675
|
_this.accountId = accountId;
|
|
15643
15676
|
_this.operationIndex = operationIndex;
|
|
15644
15677
|
return _this;
|
|
@@ -16215,8 +16248,7 @@ function sent_transaction_toPrimitive(t, r) { if ("object" != sent_transaction_t
|
|
|
16215
16248
|
|
|
16216
16249
|
var SentTransaction = function () {
|
|
16217
16250
|
function SentTransaction(assembled) {
|
|
16218
|
-
var _this = this
|
|
16219
|
-
_this$assembled$optio2;
|
|
16251
|
+
var _this = this;
|
|
16220
16252
|
sent_transaction_classCallCheck(this, SentTransaction);
|
|
16221
16253
|
_defineProperty(this, "send", function () {
|
|
16222
16254
|
var _ref = sent_transaction_asyncToGenerator(sent_transaction_regenerator().m(function _callee2(watcher) {
|
|
@@ -16273,8 +16305,14 @@ var SentTransaction = function () {
|
|
|
16273
16305
|
};
|
|
16274
16306
|
}());
|
|
16275
16307
|
this.assembled = assembled;
|
|
16276
|
-
|
|
16277
|
-
|
|
16308
|
+
var _this$assembled$optio2 = this.assembled.options,
|
|
16309
|
+
server = _this$assembled$optio2.server,
|
|
16310
|
+
allowHttp = _this$assembled$optio2.allowHttp,
|
|
16311
|
+
headers = _this$assembled$optio2.headers,
|
|
16312
|
+
rpcUrl = _this$assembled$optio2.rpcUrl;
|
|
16313
|
+
this.server = server !== null && server !== void 0 ? server : new rpc.Server(rpcUrl, {
|
|
16314
|
+
allowHttp: allowHttp,
|
|
16315
|
+
headers: headers
|
|
16278
16316
|
});
|
|
16279
16317
|
}
|
|
16280
16318
|
return sent_transaction_createClass(SentTransaction, [{
|
|
@@ -16395,8 +16433,7 @@ function assembled_transaction_toPrimitive(t, r) { if ("object" != assembled_tra
|
|
|
16395
16433
|
var AssembledTransaction = function () {
|
|
16396
16434
|
function AssembledTransaction(options) {
|
|
16397
16435
|
var _this = this,
|
|
16398
|
-
_this$options$simulat
|
|
16399
|
-
_this$options$allowHt;
|
|
16436
|
+
_this$options$simulat;
|
|
16400
16437
|
assembled_transaction_classCallCheck(this, AssembledTransaction);
|
|
16401
16438
|
assembled_transaction_defineProperty(this, "simulate", assembled_transaction_asyncToGenerator(assembled_transaction_regenerator().m(function _callee() {
|
|
16402
16439
|
var _ref2,
|
|
@@ -16752,8 +16789,14 @@ var AssembledTransaction = function () {
|
|
|
16752
16789
|
})));
|
|
16753
16790
|
this.options = options;
|
|
16754
16791
|
this.options.simulate = (_this$options$simulat = this.options.simulate) !== null && _this$options$simulat !== void 0 ? _this$options$simulat : true;
|
|
16755
|
-
|
|
16756
|
-
|
|
16792
|
+
var _this$options = this.options,
|
|
16793
|
+
server = _this$options.server,
|
|
16794
|
+
allowHttp = _this$options.allowHttp,
|
|
16795
|
+
headers = _this$options.headers,
|
|
16796
|
+
rpcUrl = _this$options.rpcUrl;
|
|
16797
|
+
this.server = server !== null && server !== void 0 ? server : new rpc.Server(rpcUrl, {
|
|
16798
|
+
allowHttp: allowHttp,
|
|
16799
|
+
headers: headers
|
|
16757
16800
|
});
|
|
16758
16801
|
}
|
|
16759
16802
|
return assembled_transaction_createClass(AssembledTransaction, [{
|
|
@@ -17769,7 +17812,7 @@ var Spec = function () {
|
|
|
17769
17812
|
}
|
|
17770
17813
|
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeOption().value) {
|
|
17771
17814
|
var opt = ty.option();
|
|
17772
|
-
if (val === undefined) {
|
|
17815
|
+
if (val === null || val === undefined) {
|
|
17773
17816
|
return stellar_base_min.xdr.ScVal.scvVoid();
|
|
17774
17817
|
}
|
|
17775
17818
|
return this.nativeToScVal(val, opt.valueType());
|
|
@@ -18033,12 +18076,20 @@ var Spec = function () {
|
|
|
18033
18076
|
var _this5 = this;
|
|
18034
18077
|
var t = typeDef.switch();
|
|
18035
18078
|
var value = t.value;
|
|
18079
|
+
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeOption().value) {
|
|
18080
|
+
switch (scv.switch().value) {
|
|
18081
|
+
case stellar_base_min.xdr.ScValType.scvVoid().value:
|
|
18082
|
+
return null;
|
|
18083
|
+
default:
|
|
18084
|
+
return this.scValToNative(scv, typeDef.option().valueType());
|
|
18085
|
+
}
|
|
18086
|
+
}
|
|
18036
18087
|
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeUdt().value) {
|
|
18037
18088
|
return this.scValUdtToNative(scv, typeDef.udt());
|
|
18038
18089
|
}
|
|
18039
18090
|
switch (scv.switch().value) {
|
|
18040
18091
|
case stellar_base_min.xdr.ScValType.scvVoid().value:
|
|
18041
|
-
return
|
|
18092
|
+
return null;
|
|
18042
18093
|
case stellar_base_min.xdr.ScValType.scvU64().value:
|
|
18043
18094
|
case stellar_base_min.xdr.ScValType.scvI64().value:
|
|
18044
18095
|
case stellar_base_min.xdr.ScValType.scvU128().value:
|
|
@@ -18289,6 +18340,7 @@ function _specFromWasmHash() {
|
|
|
18289
18340
|
var format,
|
|
18290
18341
|
rpcUrl,
|
|
18291
18342
|
allowHttp,
|
|
18343
|
+
headers,
|
|
18292
18344
|
serverOpts,
|
|
18293
18345
|
server,
|
|
18294
18346
|
wasm,
|
|
@@ -18303,9 +18355,10 @@ function _specFromWasmHash() {
|
|
|
18303
18355
|
}
|
|
18304
18356
|
throw new TypeError("options must contain rpcUrl");
|
|
18305
18357
|
case 1:
|
|
18306
|
-
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
|
|
18358
|
+
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp, headers = options.headers;
|
|
18307
18359
|
serverOpts = {
|
|
18308
|
-
allowHttp: allowHttp
|
|
18360
|
+
allowHttp: allowHttp,
|
|
18361
|
+
headers: headers
|
|
18309
18362
|
};
|
|
18310
18363
|
server = new rpc.Server(rpcUrl, serverOpts);
|
|
18311
18364
|
_context5.n = 2;
|
|
@@ -18338,6 +18391,14 @@ var Client = function () {
|
|
|
18338
18391
|
});
|
|
18339
18392
|
this.spec = spec;
|
|
18340
18393
|
this.options = options;
|
|
18394
|
+
if (options.server === undefined) {
|
|
18395
|
+
var allowHttp = options.allowHttp,
|
|
18396
|
+
headers = options.headers;
|
|
18397
|
+
options.server = new rpc.Server(options.rpcUrl, {
|
|
18398
|
+
allowHttp: allowHttp,
|
|
18399
|
+
headers: headers
|
|
18400
|
+
});
|
|
18401
|
+
}
|
|
18341
18402
|
this.spec.funcs().forEach(function (xdrFn) {
|
|
18342
18403
|
var method = xdrFn.name().toString();
|
|
18343
18404
|
if (method === CONSTRUCTOR_FUNC) {
|
|
@@ -18407,10 +18468,11 @@ var Client = function () {
|
|
|
18407
18468
|
key: "fromWasmHash",
|
|
18408
18469
|
value: (function () {
|
|
18409
18470
|
var _fromWasmHash = client_asyncToGenerator(client_regenerator().m(function _callee2(wasmHash, options) {
|
|
18471
|
+
var _options$server;
|
|
18410
18472
|
var format,
|
|
18411
18473
|
rpcUrl,
|
|
18412
18474
|
allowHttp,
|
|
18413
|
-
|
|
18475
|
+
headers,
|
|
18414
18476
|
server,
|
|
18415
18477
|
wasm,
|
|
18416
18478
|
_args2 = arguments;
|
|
@@ -18424,11 +18486,11 @@ var Client = function () {
|
|
|
18424
18486
|
}
|
|
18425
18487
|
throw new TypeError("options must contain rpcUrl");
|
|
18426
18488
|
case 1:
|
|
18427
|
-
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
|
|
18428
|
-
|
|
18429
|
-
allowHttp: allowHttp
|
|
18430
|
-
|
|
18431
|
-
|
|
18489
|
+
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp, headers = options.headers;
|
|
18490
|
+
server = (_options$server = options.server) !== null && _options$server !== void 0 ? _options$server : new rpc.Server(rpcUrl, {
|
|
18491
|
+
allowHttp: allowHttp,
|
|
18492
|
+
headers: headers
|
|
18493
|
+
});
|
|
18432
18494
|
_context2.n = 2;
|
|
18433
18495
|
return server.getContractWasmByHash(wasmHash, format);
|
|
18434
18496
|
case 2:
|
|
@@ -18467,7 +18529,7 @@ var Client = function () {
|
|
|
18467
18529
|
key: "from",
|
|
18468
18530
|
value: (function () {
|
|
18469
18531
|
var _from = client_asyncToGenerator(client_regenerator().m(function _callee4(options) {
|
|
18470
|
-
var rpcUrl, contractId, allowHttp,
|
|
18532
|
+
var rpcUrl, contractId, allowHttp, headers, server, wasm;
|
|
18471
18533
|
return client_regenerator().w(function (_context4) {
|
|
18472
18534
|
while (1) switch (_context4.n) {
|
|
18473
18535
|
case 0:
|
|
@@ -18477,11 +18539,11 @@ var Client = function () {
|
|
|
18477
18539
|
}
|
|
18478
18540
|
throw new TypeError("options must contain rpcUrl and contractId");
|
|
18479
18541
|
case 1:
|
|
18480
|
-
rpcUrl = options.rpcUrl, contractId = options.contractId, allowHttp = options.allowHttp;
|
|
18481
|
-
|
|
18482
|
-
allowHttp: allowHttp
|
|
18483
|
-
|
|
18484
|
-
|
|
18542
|
+
rpcUrl = options.rpcUrl, contractId = options.contractId, allowHttp = options.allowHttp, headers = options.headers;
|
|
18543
|
+
server = new rpc.Server(rpcUrl, {
|
|
18544
|
+
allowHttp: allowHttp,
|
|
18545
|
+
headers: headers
|
|
18546
|
+
});
|
|
18485
18547
|
_context4.n = 2;
|
|
18486
18548
|
return server.getContractWasmByContractId(contractId);
|
|
18487
18549
|
case 2:
|
|
@@ -23843,7 +23905,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
23843
23905
|
// EXPORTS
|
|
23844
23906
|
__webpack_require__.d(__webpack_exports__, {
|
|
23845
23907
|
AccountResponse: () => (/* reexport */ AccountResponse),
|
|
23846
|
-
AxiosClient: () => (/* reexport */ horizon_axios_client),
|
|
23847
23908
|
HorizonApi: () => (/* reexport */ HorizonApi),
|
|
23848
23909
|
SERVER_TIME_MAP: () => (/* reexport */ SERVER_TIME_MAP),
|
|
23849
23910
|
Server: () => (/* reexport */ HorizonServer),
|
|
@@ -26982,43 +27043,50 @@ var errors = __webpack_require__(5976);
|
|
|
26982
27043
|
var http_client = __webpack_require__(6371);
|
|
26983
27044
|
;// ./src/horizon/horizon_axios_client.ts
|
|
26984
27045
|
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); }
|
|
27046
|
+
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; }
|
|
27047
|
+
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; }
|
|
27048
|
+
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; }
|
|
27049
|
+
function horizon_axios_client_toPropertyKey(t) { var i = horizon_axios_client_toPrimitive(t, "string"); return "symbol" == horizon_axios_client_typeof(i) ? i : i + ""; }
|
|
27050
|
+
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); }
|
|
26985
27051
|
|
|
26986
27052
|
|
|
26987
|
-
var version = "14.
|
|
27053
|
+
var version = "14.3.1";
|
|
26988
27054
|
var SERVER_TIME_MAP = {};
|
|
26989
|
-
var AxiosClient = (0,http_client/* create */.vt)({
|
|
26990
|
-
headers: {
|
|
26991
|
-
"X-Client-Name": "js-stellar-sdk",
|
|
26992
|
-
"X-Client-Version": version
|
|
26993
|
-
}
|
|
26994
|
-
});
|
|
26995
27055
|
function toSeconds(ms) {
|
|
26996
27056
|
return Math.floor(ms / 1000);
|
|
26997
27057
|
}
|
|
26998
|
-
|
|
26999
|
-
var
|
|
27000
|
-
|
|
27001
|
-
|
|
27002
|
-
|
|
27003
|
-
|
|
27004
|
-
|
|
27005
|
-
|
|
27006
|
-
|
|
27007
|
-
var
|
|
27008
|
-
if (
|
|
27009
|
-
|
|
27010
|
-
|
|
27011
|
-
|
|
27012
|
-
|
|
27013
|
-
|
|
27014
|
-
|
|
27015
|
-
|
|
27016
|
-
|
|
27017
|
-
|
|
27018
|
-
|
|
27019
|
-
|
|
27020
|
-
|
|
27021
|
-
|
|
27058
|
+
function createHttpClient(headers) {
|
|
27059
|
+
var httpClient = (0,http_client/* create */.vt)({
|
|
27060
|
+
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
27061
|
+
"X-Client-Name": "js-stellar-sdk",
|
|
27062
|
+
"X-Client-Version": version
|
|
27063
|
+
})
|
|
27064
|
+
});
|
|
27065
|
+
httpClient.interceptors.response.use(function (response) {
|
|
27066
|
+
var hostname = URI_default()(response.config.url).hostname();
|
|
27067
|
+
var serverTime = 0;
|
|
27068
|
+
if (response.headers instanceof Headers) {
|
|
27069
|
+
var dateHeader = response.headers.get("date");
|
|
27070
|
+
if (dateHeader) {
|
|
27071
|
+
serverTime = toSeconds(Date.parse(dateHeader));
|
|
27072
|
+
}
|
|
27073
|
+
} else if (horizon_axios_client_typeof(response.headers) === "object" && "date" in response.headers) {
|
|
27074
|
+
var responseHeader = response.headers;
|
|
27075
|
+
if (typeof responseHeader.date === "string") {
|
|
27076
|
+
serverTime = toSeconds(Date.parse(responseHeader.date));
|
|
27077
|
+
}
|
|
27078
|
+
}
|
|
27079
|
+
var localTimeRecorded = toSeconds(new Date().getTime());
|
|
27080
|
+
if (!Number.isNaN(serverTime)) {
|
|
27081
|
+
SERVER_TIME_MAP[hostname] = {
|
|
27082
|
+
serverTime: serverTime,
|
|
27083
|
+
localTimeRecorded: localTimeRecorded
|
|
27084
|
+
};
|
|
27085
|
+
}
|
|
27086
|
+
return response;
|
|
27087
|
+
});
|
|
27088
|
+
return httpClient;
|
|
27089
|
+
}
|
|
27022
27090
|
function getCurrentServerTime(hostname) {
|
|
27023
27091
|
var entry = SERVER_TIME_MAP[hostname];
|
|
27024
27092
|
if (!entry || !entry.localTimeRecorded || !entry.serverTime) {
|
|
@@ -27055,13 +27123,14 @@ if (true) {
|
|
|
27055
27123
|
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 : __webpack_require__(1731);
|
|
27056
27124
|
}
|
|
27057
27125
|
var CallBuilder = function () {
|
|
27058
|
-
function CallBuilder(serverUrl) {
|
|
27059
|
-
var neighborRoot = arguments.length >
|
|
27126
|
+
function CallBuilder(serverUrl, httpClient) {
|
|
27127
|
+
var neighborRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
27060
27128
|
call_builder_classCallCheck(this, CallBuilder);
|
|
27061
27129
|
this.url = serverUrl.clone();
|
|
27062
27130
|
this.filter = [];
|
|
27063
27131
|
this.originalSegments = this.url.segment() || [];
|
|
27064
27132
|
this.neighborRoot = neighborRoot;
|
|
27133
|
+
this.httpClient = httpClient;
|
|
27065
27134
|
}
|
|
27066
27135
|
return call_builder_createClass(CallBuilder, [{
|
|
27067
27136
|
key: "call",
|
|
@@ -27269,7 +27338,7 @@ var CallBuilder = function () {
|
|
|
27269
27338
|
if (url.protocol() === "") {
|
|
27270
27339
|
url = url.protocol(this.url.protocol());
|
|
27271
27340
|
}
|
|
27272
|
-
return _context3.a(2,
|
|
27341
|
+
return _context3.a(2, this.httpClient.get(url.toString()).then(function (response) {
|
|
27273
27342
|
return response.data;
|
|
27274
27343
|
}).catch(this._handleNetworkError));
|
|
27275
27344
|
}
|
|
@@ -27392,10 +27461,10 @@ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new T
|
|
|
27392
27461
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
27393
27462
|
|
|
27394
27463
|
var AccountCallBuilder = function (_CallBuilder) {
|
|
27395
|
-
function AccountCallBuilder(serverUrl) {
|
|
27464
|
+
function AccountCallBuilder(serverUrl, httpClient) {
|
|
27396
27465
|
var _this;
|
|
27397
27466
|
account_call_builder_classCallCheck(this, AccountCallBuilder);
|
|
27398
|
-
_this = _callSuper(this, AccountCallBuilder, [serverUrl]);
|
|
27467
|
+
_this = _callSuper(this, AccountCallBuilder, [serverUrl, httpClient]);
|
|
27399
27468
|
_this.url.segment("accounts");
|
|
27400
27469
|
return _this;
|
|
27401
27470
|
}
|
|
@@ -27403,7 +27472,7 @@ var AccountCallBuilder = function (_CallBuilder) {
|
|
|
27403
27472
|
return account_call_builder_createClass(AccountCallBuilder, [{
|
|
27404
27473
|
key: "accountId",
|
|
27405
27474
|
value: function accountId(id) {
|
|
27406
|
-
var builder = new CallBuilder(this.url.clone());
|
|
27475
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
27407
27476
|
builder.filter.push([id]);
|
|
27408
27477
|
return builder;
|
|
27409
27478
|
}
|
|
@@ -27449,10 +27518,10 @@ function assets_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
27449
27518
|
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); }
|
|
27450
27519
|
|
|
27451
27520
|
var AssetsCallBuilder = function (_CallBuilder) {
|
|
27452
|
-
function AssetsCallBuilder(serverUrl) {
|
|
27521
|
+
function AssetsCallBuilder(serverUrl, httpClient) {
|
|
27453
27522
|
var _this;
|
|
27454
27523
|
assets_call_builder_classCallCheck(this, AssetsCallBuilder);
|
|
27455
|
-
_this = assets_call_builder_callSuper(this, AssetsCallBuilder, [serverUrl]);
|
|
27524
|
+
_this = assets_call_builder_callSuper(this, AssetsCallBuilder, [serverUrl, httpClient]);
|
|
27456
27525
|
_this.url.segment("assets");
|
|
27457
27526
|
return _this;
|
|
27458
27527
|
}
|
|
@@ -27487,10 +27556,10 @@ function claimable_balances_call_builder_inherits(t, e) { if ("function" != type
|
|
|
27487
27556
|
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); }
|
|
27488
27557
|
|
|
27489
27558
|
var ClaimableBalanceCallBuilder = function (_CallBuilder) {
|
|
27490
|
-
function ClaimableBalanceCallBuilder(serverUrl) {
|
|
27559
|
+
function ClaimableBalanceCallBuilder(serverUrl, httpClient) {
|
|
27491
27560
|
var _this;
|
|
27492
27561
|
claimable_balances_call_builder_classCallCheck(this, ClaimableBalanceCallBuilder);
|
|
27493
|
-
_this = claimable_balances_call_builder_callSuper(this, ClaimableBalanceCallBuilder, [serverUrl]);
|
|
27562
|
+
_this = claimable_balances_call_builder_callSuper(this, ClaimableBalanceCallBuilder, [serverUrl, httpClient]);
|
|
27494
27563
|
_this.url.segment("claimable_balances");
|
|
27495
27564
|
return _this;
|
|
27496
27565
|
}
|
|
@@ -27498,7 +27567,7 @@ var ClaimableBalanceCallBuilder = function (_CallBuilder) {
|
|
|
27498
27567
|
return claimable_balances_call_builder_createClass(ClaimableBalanceCallBuilder, [{
|
|
27499
27568
|
key: "claimableBalance",
|
|
27500
27569
|
value: function claimableBalance(claimableBalanceId) {
|
|
27501
|
-
var builder = new CallBuilder(this.url.clone());
|
|
27570
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
27502
27571
|
builder.filter.push([claimableBalanceId]);
|
|
27503
27572
|
return builder;
|
|
27504
27573
|
}
|
|
@@ -27538,10 +27607,10 @@ function effect_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
27538
27607
|
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); }
|
|
27539
27608
|
|
|
27540
27609
|
var EffectCallBuilder = function (_CallBuilder) {
|
|
27541
|
-
function EffectCallBuilder(serverUrl) {
|
|
27610
|
+
function EffectCallBuilder(serverUrl, httpClient) {
|
|
27542
27611
|
var _this;
|
|
27543
27612
|
effect_call_builder_classCallCheck(this, EffectCallBuilder);
|
|
27544
|
-
_this = effect_call_builder_callSuper(this, EffectCallBuilder, [serverUrl, "effects"]);
|
|
27613
|
+
_this = effect_call_builder_callSuper(this, EffectCallBuilder, [serverUrl, httpClient, "effects"]);
|
|
27545
27614
|
_this.url.segment("effects");
|
|
27546
27615
|
return _this;
|
|
27547
27616
|
}
|
|
@@ -27589,10 +27658,10 @@ function friendbot_builder_inherits(t, e) { if ("function" != typeof e && null !
|
|
|
27589
27658
|
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); }
|
|
27590
27659
|
|
|
27591
27660
|
var FriendbotBuilder = function (_CallBuilder) {
|
|
27592
|
-
function FriendbotBuilder(serverUrl, address) {
|
|
27661
|
+
function FriendbotBuilder(serverUrl, httpClient, address) {
|
|
27593
27662
|
var _this;
|
|
27594
27663
|
friendbot_builder_classCallCheck(this, FriendbotBuilder);
|
|
27595
|
-
_this = friendbot_builder_callSuper(this, FriendbotBuilder, [serverUrl]);
|
|
27664
|
+
_this = friendbot_builder_callSuper(this, FriendbotBuilder, [serverUrl, httpClient]);
|
|
27596
27665
|
_this.url.segment("friendbot");
|
|
27597
27666
|
_this.url.setQuery("addr", address);
|
|
27598
27667
|
return _this;
|
|
@@ -27616,10 +27685,10 @@ function ledger_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
27616
27685
|
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); }
|
|
27617
27686
|
|
|
27618
27687
|
var LedgerCallBuilder = function (_CallBuilder) {
|
|
27619
|
-
function LedgerCallBuilder(serverUrl) {
|
|
27688
|
+
function LedgerCallBuilder(serverUrl, httpClient) {
|
|
27620
27689
|
var _this;
|
|
27621
27690
|
ledger_call_builder_classCallCheck(this, LedgerCallBuilder);
|
|
27622
|
-
_this = ledger_call_builder_callSuper(this, LedgerCallBuilder, [serverUrl]);
|
|
27691
|
+
_this = ledger_call_builder_callSuper(this, LedgerCallBuilder, [serverUrl, httpClient]);
|
|
27623
27692
|
_this.url.segment("ledgers");
|
|
27624
27693
|
return _this;
|
|
27625
27694
|
}
|
|
@@ -27648,10 +27717,10 @@ function liquidity_pool_call_builder_inherits(t, e) { if ("function" != typeof e
|
|
|
27648
27717
|
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); }
|
|
27649
27718
|
|
|
27650
27719
|
var LiquidityPoolCallBuilder = function (_CallBuilder) {
|
|
27651
|
-
function LiquidityPoolCallBuilder(serverUrl) {
|
|
27720
|
+
function LiquidityPoolCallBuilder(serverUrl, httpClient) {
|
|
27652
27721
|
var _this;
|
|
27653
27722
|
liquidity_pool_call_builder_classCallCheck(this, LiquidityPoolCallBuilder);
|
|
27654
|
-
_this = liquidity_pool_call_builder_callSuper(this, LiquidityPoolCallBuilder, [serverUrl]);
|
|
27723
|
+
_this = liquidity_pool_call_builder_callSuper(this, LiquidityPoolCallBuilder, [serverUrl, httpClient]);
|
|
27655
27724
|
_this.url.segment("liquidity_pools");
|
|
27656
27725
|
return _this;
|
|
27657
27726
|
}
|
|
@@ -27680,7 +27749,7 @@ var LiquidityPoolCallBuilder = function (_CallBuilder) {
|
|
|
27680
27749
|
if (!id.match(/[a-fA-F0-9]{64}/)) {
|
|
27681
27750
|
throw new TypeError("".concat(id, " does not look like a liquidity pool ID"));
|
|
27682
27751
|
}
|
|
27683
|
-
var builder = new CallBuilder(this.url.clone());
|
|
27752
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
27684
27753
|
builder.filter.push([id.toLowerCase()]);
|
|
27685
27754
|
return builder;
|
|
27686
27755
|
}
|
|
@@ -27702,10 +27771,10 @@ function offer_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
27702
27771
|
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); }
|
|
27703
27772
|
|
|
27704
27773
|
var OfferCallBuilder = function (_CallBuilder) {
|
|
27705
|
-
function OfferCallBuilder(serverUrl) {
|
|
27774
|
+
function OfferCallBuilder(serverUrl, httpClient) {
|
|
27706
27775
|
var _this;
|
|
27707
27776
|
offer_call_builder_classCallCheck(this, OfferCallBuilder);
|
|
27708
|
-
_this = offer_call_builder_callSuper(this, OfferCallBuilder, [serverUrl, "offers"]);
|
|
27777
|
+
_this = offer_call_builder_callSuper(this, OfferCallBuilder, [serverUrl, httpClient, "offers"]);
|
|
27709
27778
|
_this.url.segment("offers");
|
|
27710
27779
|
return _this;
|
|
27711
27780
|
}
|
|
@@ -27713,7 +27782,7 @@ var OfferCallBuilder = function (_CallBuilder) {
|
|
|
27713
27782
|
return offer_call_builder_createClass(OfferCallBuilder, [{
|
|
27714
27783
|
key: "offer",
|
|
27715
27784
|
value: function offer(offerId) {
|
|
27716
|
-
var builder = new CallBuilder(this.url.clone());
|
|
27785
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
27717
27786
|
builder.filter.push([offerId]);
|
|
27718
27787
|
return builder;
|
|
27719
27788
|
}
|
|
@@ -27776,10 +27845,10 @@ function operation_call_builder_inherits(t, e) { if ("function" != typeof e && n
|
|
|
27776
27845
|
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); }
|
|
27777
27846
|
|
|
27778
27847
|
var OperationCallBuilder = function (_CallBuilder) {
|
|
27779
|
-
function OperationCallBuilder(serverUrl) {
|
|
27848
|
+
function OperationCallBuilder(serverUrl, httpClient) {
|
|
27780
27849
|
var _this;
|
|
27781
27850
|
operation_call_builder_classCallCheck(this, OperationCallBuilder);
|
|
27782
|
-
_this = operation_call_builder_callSuper(this, OperationCallBuilder, [serverUrl, "operations"]);
|
|
27851
|
+
_this = operation_call_builder_callSuper(this, OperationCallBuilder, [serverUrl, httpClient, "operations"]);
|
|
27783
27852
|
_this.url.segment("operations");
|
|
27784
27853
|
return _this;
|
|
27785
27854
|
}
|
|
@@ -27787,7 +27856,7 @@ var OperationCallBuilder = function (_CallBuilder) {
|
|
|
27787
27856
|
return operation_call_builder_createClass(OperationCallBuilder, [{
|
|
27788
27857
|
key: "operation",
|
|
27789
27858
|
value: function operation(operationId) {
|
|
27790
|
-
var builder = new CallBuilder(this.url.clone());
|
|
27859
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
27791
27860
|
builder.filter.push([operationId]);
|
|
27792
27861
|
return builder;
|
|
27793
27862
|
}
|
|
@@ -27840,10 +27909,10 @@ function orderbook_call_builder_inherits(t, e) { if ("function" != typeof e && n
|
|
|
27840
27909
|
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); }
|
|
27841
27910
|
|
|
27842
27911
|
var OrderbookCallBuilder = function (_CallBuilder) {
|
|
27843
|
-
function OrderbookCallBuilder(serverUrl, selling, buying) {
|
|
27912
|
+
function OrderbookCallBuilder(serverUrl, httpClient, selling, buying) {
|
|
27844
27913
|
var _this;
|
|
27845
27914
|
orderbook_call_builder_classCallCheck(this, OrderbookCallBuilder);
|
|
27846
|
-
_this = orderbook_call_builder_callSuper(this, OrderbookCallBuilder, [serverUrl]);
|
|
27915
|
+
_this = orderbook_call_builder_callSuper(this, OrderbookCallBuilder, [serverUrl, httpClient]);
|
|
27847
27916
|
_this.url.segment("order_book");
|
|
27848
27917
|
if (!selling.isNative()) {
|
|
27849
27918
|
_this.url.setQuery("selling_asset_type", selling.getAssetType());
|
|
@@ -27880,10 +27949,10 @@ function payment_call_builder_inherits(t, e) { if ("function" != typeof e && nul
|
|
|
27880
27949
|
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); }
|
|
27881
27950
|
|
|
27882
27951
|
var PaymentCallBuilder = function (_CallBuilder) {
|
|
27883
|
-
function PaymentCallBuilder(serverUrl) {
|
|
27952
|
+
function PaymentCallBuilder(serverUrl, httpClient) {
|
|
27884
27953
|
var _this;
|
|
27885
27954
|
payment_call_builder_classCallCheck(this, PaymentCallBuilder);
|
|
27886
|
-
_this = payment_call_builder_callSuper(this, PaymentCallBuilder, [serverUrl, "payments"]);
|
|
27955
|
+
_this = payment_call_builder_callSuper(this, PaymentCallBuilder, [serverUrl, httpClient, "payments"]);
|
|
27887
27956
|
_this.url.segment("payments");
|
|
27888
27957
|
return _this;
|
|
27889
27958
|
}
|
|
@@ -27927,10 +27996,10 @@ function strict_receive_path_call_builder_inherits(t, e) { if ("function" != typ
|
|
|
27927
27996
|
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); }
|
|
27928
27997
|
|
|
27929
27998
|
var StrictReceivePathCallBuilder = function (_CallBuilder) {
|
|
27930
|
-
function StrictReceivePathCallBuilder(serverUrl, source, destinationAsset, destinationAmount) {
|
|
27999
|
+
function StrictReceivePathCallBuilder(serverUrl, httpClient, source, destinationAsset, destinationAmount) {
|
|
27931
28000
|
var _this;
|
|
27932
28001
|
strict_receive_path_call_builder_classCallCheck(this, StrictReceivePathCallBuilder);
|
|
27933
|
-
_this = strict_receive_path_call_builder_callSuper(this, StrictReceivePathCallBuilder, [serverUrl]);
|
|
28002
|
+
_this = strict_receive_path_call_builder_callSuper(this, StrictReceivePathCallBuilder, [serverUrl, httpClient]);
|
|
27934
28003
|
_this.url.segment("paths/strict-receive");
|
|
27935
28004
|
if (typeof source === "string") {
|
|
27936
28005
|
_this.url.setQuery("source_account", source);
|
|
@@ -27972,10 +28041,10 @@ function strict_send_path_call_builder_inherits(t, e) { if ("function" != typeof
|
|
|
27972
28041
|
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); }
|
|
27973
28042
|
|
|
27974
28043
|
var StrictSendPathCallBuilder = function (_CallBuilder) {
|
|
27975
|
-
function StrictSendPathCallBuilder(serverUrl, sourceAsset, sourceAmount, destination) {
|
|
28044
|
+
function StrictSendPathCallBuilder(serverUrl, httpClient, sourceAsset, sourceAmount, destination) {
|
|
27976
28045
|
var _this;
|
|
27977
28046
|
strict_send_path_call_builder_classCallCheck(this, StrictSendPathCallBuilder);
|
|
27978
|
-
_this = strict_send_path_call_builder_callSuper(this, StrictSendPathCallBuilder, [serverUrl]);
|
|
28047
|
+
_this = strict_send_path_call_builder_callSuper(this, StrictSendPathCallBuilder, [serverUrl, httpClient]);
|
|
27979
28048
|
_this.url.segment("paths/strict-send");
|
|
27980
28049
|
if (sourceAsset.isNative()) {
|
|
27981
28050
|
_this.url.setQuery("source_asset_type", "native");
|
|
@@ -28019,10 +28088,10 @@ function trade_aggregation_call_builder_setPrototypeOf(t, e) { return trade_aggr
|
|
|
28019
28088
|
|
|
28020
28089
|
var allowedResolutions = [60000, 300000, 900000, 3600000, 86400000, 604800000];
|
|
28021
28090
|
var TradeAggregationCallBuilder = function (_CallBuilder) {
|
|
28022
|
-
function TradeAggregationCallBuilder(serverUrl, base, counter, start_time, end_time, resolution, offset) {
|
|
28091
|
+
function TradeAggregationCallBuilder(serverUrl, httpClient, base, counter, start_time, end_time, resolution, offset) {
|
|
28023
28092
|
var _this;
|
|
28024
28093
|
trade_aggregation_call_builder_classCallCheck(this, TradeAggregationCallBuilder);
|
|
28025
|
-
_this = trade_aggregation_call_builder_callSuper(this, TradeAggregationCallBuilder, [serverUrl]);
|
|
28094
|
+
_this = trade_aggregation_call_builder_callSuper(this, TradeAggregationCallBuilder, [serverUrl, httpClient]);
|
|
28026
28095
|
_this.url.segment("trade_aggregations");
|
|
28027
28096
|
if (!base.isNative()) {
|
|
28028
28097
|
_this.url.setQuery("base_asset_type", base.getAssetType());
|
|
@@ -28088,10 +28157,10 @@ function trades_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
28088
28157
|
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); }
|
|
28089
28158
|
|
|
28090
28159
|
var TradesCallBuilder = function (_CallBuilder) {
|
|
28091
|
-
function TradesCallBuilder(serverUrl) {
|
|
28160
|
+
function TradesCallBuilder(serverUrl, httpClient) {
|
|
28092
28161
|
var _this;
|
|
28093
28162
|
trades_call_builder_classCallCheck(this, TradesCallBuilder);
|
|
28094
|
-
_this = trades_call_builder_callSuper(this, TradesCallBuilder, [serverUrl, "trades"]);
|
|
28163
|
+
_this = trades_call_builder_callSuper(this, TradesCallBuilder, [serverUrl, httpClient, "trades"]);
|
|
28095
28164
|
_this.url.segment("trades");
|
|
28096
28165
|
return _this;
|
|
28097
28166
|
}
|
|
@@ -28155,10 +28224,10 @@ function transaction_call_builder_inherits(t, e) { if ("function" != typeof e &&
|
|
|
28155
28224
|
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); }
|
|
28156
28225
|
|
|
28157
28226
|
var TransactionCallBuilder = function (_CallBuilder) {
|
|
28158
|
-
function TransactionCallBuilder(serverUrl) {
|
|
28227
|
+
function TransactionCallBuilder(serverUrl, httpClient) {
|
|
28159
28228
|
var _this;
|
|
28160
28229
|
transaction_call_builder_classCallCheck(this, TransactionCallBuilder);
|
|
28161
|
-
_this = transaction_call_builder_callSuper(this, TransactionCallBuilder, [serverUrl, "transactions"]);
|
|
28230
|
+
_this = transaction_call_builder_callSuper(this, TransactionCallBuilder, [serverUrl, httpClient, "transactions"]);
|
|
28162
28231
|
_this.url.segment("transactions");
|
|
28163
28232
|
return _this;
|
|
28164
28233
|
}
|
|
@@ -28166,7 +28235,7 @@ var TransactionCallBuilder = function (_CallBuilder) {
|
|
|
28166
28235
|
return transaction_call_builder_createClass(TransactionCallBuilder, [{
|
|
28167
28236
|
key: "transaction",
|
|
28168
28237
|
value: function transaction(transactionId) {
|
|
28169
|
-
var builder = new CallBuilder(this.url.clone());
|
|
28238
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
28170
28239
|
builder.filter.push([transactionId]);
|
|
28171
28240
|
return builder;
|
|
28172
28241
|
}
|
|
@@ -28200,9 +28269,9 @@ var TransactionCallBuilder = function (_CallBuilder) {
|
|
|
28200
28269
|
}(CallBuilder);
|
|
28201
28270
|
;// ./src/horizon/server.ts
|
|
28202
28271
|
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); }
|
|
28203
|
-
function
|
|
28204
|
-
function
|
|
28205
|
-
function
|
|
28272
|
+
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; }
|
|
28273
|
+
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; }
|
|
28274
|
+
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; }
|
|
28206
28275
|
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 }; })(); }
|
|
28207
28276
|
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); }
|
|
28208
28277
|
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); }
|
|
@@ -28261,13 +28330,7 @@ var HorizonServer = function () {
|
|
|
28261
28330
|
if (opts.headers) {
|
|
28262
28331
|
Object.assign(customHeaders, opts.headers);
|
|
28263
28332
|
}
|
|
28264
|
-
|
|
28265
|
-
horizon_axios_client.interceptors.request.use(function (config) {
|
|
28266
|
-
config.headers = config.headers || {};
|
|
28267
|
-
config.headers = Object.assign(config.headers, customHeaders);
|
|
28268
|
-
return config;
|
|
28269
|
-
});
|
|
28270
|
-
}
|
|
28333
|
+
this.httpClient = createHttpClient(customHeaders);
|
|
28271
28334
|
if (this.serverURL.protocol() !== "https" && !allowHttp) {
|
|
28272
28335
|
throw new Error("Cannot connect to insecure horizon server");
|
|
28273
28336
|
}
|
|
@@ -28303,7 +28366,7 @@ var HorizonServer = function () {
|
|
|
28303
28366
|
});
|
|
28304
28367
|
case 2:
|
|
28305
28368
|
_context.n = 3;
|
|
28306
|
-
return
|
|
28369
|
+
return this.httpClient.get(this.serverURL.toString());
|
|
28307
28370
|
case 3:
|
|
28308
28371
|
return _context.a(2, this.fetchTimebounds(seconds, true));
|
|
28309
28372
|
}
|
|
@@ -28343,7 +28406,7 @@ var HorizonServer = function () {
|
|
|
28343
28406
|
return server_regenerator().w(function (_context3) {
|
|
28344
28407
|
while (1) switch (_context3.n) {
|
|
28345
28408
|
case 0:
|
|
28346
|
-
cb = new CallBuilder(
|
|
28409
|
+
cb = new CallBuilder(this.serverURL, this.httpClient);
|
|
28347
28410
|
cb.filter.push(["fee_stats"]);
|
|
28348
28411
|
return _context3.a(2, cb.call());
|
|
28349
28412
|
}
|
|
@@ -28362,7 +28425,7 @@ var HorizonServer = function () {
|
|
|
28362
28425
|
return server_regenerator().w(function (_context4) {
|
|
28363
28426
|
while (1) switch (_context4.n) {
|
|
28364
28427
|
case 0:
|
|
28365
|
-
cb = new CallBuilder(
|
|
28428
|
+
cb = new CallBuilder(this.serverURL, this.httpClient);
|
|
28366
28429
|
return _context4.a(2, cb.call());
|
|
28367
28430
|
}
|
|
28368
28431
|
}, _callee4, this);
|
|
@@ -28393,7 +28456,7 @@ var HorizonServer = function () {
|
|
|
28393
28456
|
return this.checkMemoRequired(transaction);
|
|
28394
28457
|
case 1:
|
|
28395
28458
|
tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
|
|
28396
|
-
return _context5.a(2,
|
|
28459
|
+
return _context5.a(2, this.httpClient.post(this.serverURL.segment("transactions").toString(), "tx=".concat(tx), {
|
|
28397
28460
|
timeout: SUBMIT_TRANSACTION_TIMEOUT,
|
|
28398
28461
|
headers: {
|
|
28399
28462
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -28496,7 +28559,7 @@ var HorizonServer = function () {
|
|
|
28496
28559
|
return !!result;
|
|
28497
28560
|
});
|
|
28498
28561
|
}
|
|
28499
|
-
return
|
|
28562
|
+
return server_objectSpread(server_objectSpread({}, response.data), {}, {
|
|
28500
28563
|
offerResults: hasManageOffer ? offerResults : undefined
|
|
28501
28564
|
});
|
|
28502
28565
|
}).catch(function (response) {
|
|
@@ -28534,7 +28597,7 @@ var HorizonServer = function () {
|
|
|
28534
28597
|
return this.checkMemoRequired(transaction);
|
|
28535
28598
|
case 1:
|
|
28536
28599
|
tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
|
|
28537
|
-
return _context6.a(2,
|
|
28600
|
+
return _context6.a(2, this.httpClient.post(this.serverURL.segment("transactions_async").toString(), "tx=".concat(tx), {
|
|
28538
28601
|
headers: {
|
|
28539
28602
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
28540
28603
|
}
|
|
@@ -28557,77 +28620,77 @@ var HorizonServer = function () {
|
|
|
28557
28620
|
}, {
|
|
28558
28621
|
key: "accounts",
|
|
28559
28622
|
value: function accounts() {
|
|
28560
|
-
return new AccountCallBuilder(
|
|
28623
|
+
return new AccountCallBuilder(this.serverURL, this.httpClient);
|
|
28561
28624
|
}
|
|
28562
28625
|
}, {
|
|
28563
28626
|
key: "claimableBalances",
|
|
28564
28627
|
value: function claimableBalances() {
|
|
28565
|
-
return new ClaimableBalanceCallBuilder(
|
|
28628
|
+
return new ClaimableBalanceCallBuilder(this.serverURL, this.httpClient);
|
|
28566
28629
|
}
|
|
28567
28630
|
}, {
|
|
28568
28631
|
key: "ledgers",
|
|
28569
28632
|
value: function ledgers() {
|
|
28570
|
-
return new LedgerCallBuilder(
|
|
28633
|
+
return new LedgerCallBuilder(this.serverURL, this.httpClient);
|
|
28571
28634
|
}
|
|
28572
28635
|
}, {
|
|
28573
28636
|
key: "transactions",
|
|
28574
28637
|
value: function transactions() {
|
|
28575
|
-
return new TransactionCallBuilder(
|
|
28638
|
+
return new TransactionCallBuilder(this.serverURL, this.httpClient);
|
|
28576
28639
|
}
|
|
28577
28640
|
}, {
|
|
28578
28641
|
key: "offers",
|
|
28579
28642
|
value: function offers() {
|
|
28580
|
-
return new OfferCallBuilder(
|
|
28643
|
+
return new OfferCallBuilder(this.serverURL, this.httpClient);
|
|
28581
28644
|
}
|
|
28582
28645
|
}, {
|
|
28583
28646
|
key: "orderbook",
|
|
28584
28647
|
value: function orderbook(selling, buying) {
|
|
28585
|
-
return new OrderbookCallBuilder(
|
|
28648
|
+
return new OrderbookCallBuilder(this.serverURL, this.httpClient, selling, buying);
|
|
28586
28649
|
}
|
|
28587
28650
|
}, {
|
|
28588
28651
|
key: "trades",
|
|
28589
28652
|
value: function trades() {
|
|
28590
|
-
return new TradesCallBuilder(
|
|
28653
|
+
return new TradesCallBuilder(this.serverURL, this.httpClient);
|
|
28591
28654
|
}
|
|
28592
28655
|
}, {
|
|
28593
28656
|
key: "operations",
|
|
28594
28657
|
value: function operations() {
|
|
28595
|
-
return new OperationCallBuilder(
|
|
28658
|
+
return new OperationCallBuilder(this.serverURL, this.httpClient);
|
|
28596
28659
|
}
|
|
28597
28660
|
}, {
|
|
28598
28661
|
key: "liquidityPools",
|
|
28599
28662
|
value: function liquidityPools() {
|
|
28600
|
-
return new LiquidityPoolCallBuilder(
|
|
28663
|
+
return new LiquidityPoolCallBuilder(this.serverURL, this.httpClient);
|
|
28601
28664
|
}
|
|
28602
28665
|
}, {
|
|
28603
28666
|
key: "strictReceivePaths",
|
|
28604
28667
|
value: function strictReceivePaths(source, destinationAsset, destinationAmount) {
|
|
28605
|
-
return new StrictReceivePathCallBuilder(
|
|
28668
|
+
return new StrictReceivePathCallBuilder(this.serverURL, this.httpClient, source, destinationAsset, destinationAmount);
|
|
28606
28669
|
}
|
|
28607
28670
|
}, {
|
|
28608
28671
|
key: "strictSendPaths",
|
|
28609
28672
|
value: function strictSendPaths(sourceAsset, sourceAmount, destination) {
|
|
28610
|
-
return new StrictSendPathCallBuilder(
|
|
28673
|
+
return new StrictSendPathCallBuilder(this.serverURL, this.httpClient, sourceAsset, sourceAmount, destination);
|
|
28611
28674
|
}
|
|
28612
28675
|
}, {
|
|
28613
28676
|
key: "payments",
|
|
28614
28677
|
value: function payments() {
|
|
28615
|
-
return new PaymentCallBuilder(
|
|
28678
|
+
return new PaymentCallBuilder(this.serverURL, this.httpClient);
|
|
28616
28679
|
}
|
|
28617
28680
|
}, {
|
|
28618
28681
|
key: "effects",
|
|
28619
28682
|
value: function effects() {
|
|
28620
|
-
return new EffectCallBuilder(
|
|
28683
|
+
return new EffectCallBuilder(this.serverURL, this.httpClient);
|
|
28621
28684
|
}
|
|
28622
28685
|
}, {
|
|
28623
28686
|
key: "friendbot",
|
|
28624
28687
|
value: function friendbot(address) {
|
|
28625
|
-
return new FriendbotBuilder(
|
|
28688
|
+
return new FriendbotBuilder(this.serverURL, this.httpClient, address);
|
|
28626
28689
|
}
|
|
28627
28690
|
}, {
|
|
28628
28691
|
key: "assets",
|
|
28629
28692
|
value: function assets() {
|
|
28630
|
-
return new AssetsCallBuilder(
|
|
28693
|
+
return new AssetsCallBuilder(this.serverURL, this.httpClient);
|
|
28631
28694
|
}
|
|
28632
28695
|
}, {
|
|
28633
28696
|
key: "loadAccount",
|
|
@@ -28653,7 +28716,7 @@ var HorizonServer = function () {
|
|
|
28653
28716
|
}, {
|
|
28654
28717
|
key: "tradeAggregation",
|
|
28655
28718
|
value: function tradeAggregation(base, counter, start_time, end_time, resolution, offset) {
|
|
28656
|
-
return new TradeAggregationCallBuilder(
|
|
28719
|
+
return new TradeAggregationCallBuilder(this.serverURL, this.httpClient, base, counter, start_time, end_time, resolution, offset);
|
|
28657
28720
|
}
|
|
28658
28721
|
}, {
|
|
28659
28722
|
key: "checkMemoRequired",
|