@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
package/dist/stellar-sdk.js
CHANGED
|
@@ -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 + 1 modules
|
|
4889
4911
|
var http_client = __webpack_require__(9983);
|
|
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);
|
|
@@ -15473,10 +15531,7 @@ var NetworkError = function (_Error) {
|
|
|
15473
15531
|
function NetworkError(message, response) {
|
|
15474
15532
|
var _this;
|
|
15475
15533
|
_classCallCheck(this, NetworkError);
|
|
15476
|
-
var trueProto = (this instanceof NetworkError ? this.constructor : void 0).prototype;
|
|
15477
15534
|
_this = _callSuper(this, NetworkError, [message]);
|
|
15478
|
-
_this.__proto__ = trueProto;
|
|
15479
|
-
_this.constructor = NetworkError;
|
|
15480
15535
|
_this.response = response;
|
|
15481
15536
|
return _this;
|
|
15482
15537
|
}
|
|
@@ -15504,15 +15559,9 @@ function not_found_inherits(t, e) { if ("function" != typeof e && null !== e) th
|
|
|
15504
15559
|
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); }
|
|
15505
15560
|
|
|
15506
15561
|
var NotFoundError = function (_NetworkError) {
|
|
15507
|
-
function NotFoundError(
|
|
15508
|
-
var _this;
|
|
15562
|
+
function NotFoundError() {
|
|
15509
15563
|
not_found_classCallCheck(this, NotFoundError);
|
|
15510
|
-
|
|
15511
|
-
_this = not_found_callSuper(this, NotFoundError, [message, response]);
|
|
15512
|
-
_this.__proto__ = trueProto;
|
|
15513
|
-
_this.constructor = NotFoundError;
|
|
15514
|
-
_this.name = "NotFoundError";
|
|
15515
|
-
return _this;
|
|
15564
|
+
return not_found_callSuper(this, NotFoundError, arguments);
|
|
15516
15565
|
}
|
|
15517
15566
|
not_found_inherits(NotFoundError, _NetworkError);
|
|
15518
15567
|
return not_found_createClass(NotFoundError);
|
|
@@ -15533,15 +15582,9 @@ function bad_request_inherits(t, e) { if ("function" != typeof e && null !== e)
|
|
|
15533
15582
|
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); }
|
|
15534
15583
|
|
|
15535
15584
|
var BadRequestError = function (_NetworkError) {
|
|
15536
|
-
function BadRequestError(
|
|
15537
|
-
var _this;
|
|
15585
|
+
function BadRequestError() {
|
|
15538
15586
|
bad_request_classCallCheck(this, BadRequestError);
|
|
15539
|
-
|
|
15540
|
-
_this = bad_request_callSuper(this, BadRequestError, [message, response]);
|
|
15541
|
-
_this.__proto__ = trueProto;
|
|
15542
|
-
_this.constructor = BadRequestError;
|
|
15543
|
-
_this.name = "BadRequestError";
|
|
15544
|
-
return _this;
|
|
15587
|
+
return bad_request_callSuper(this, BadRequestError, arguments);
|
|
15545
15588
|
}
|
|
15546
15589
|
bad_request_inherits(BadRequestError, _NetworkError);
|
|
15547
15590
|
return bad_request_createClass(BadRequestError);
|
|
@@ -15562,15 +15605,9 @@ function bad_response_inherits(t, e) { if ("function" != typeof e && null !== e)
|
|
|
15562
15605
|
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); }
|
|
15563
15606
|
|
|
15564
15607
|
var BadResponseError = function (_NetworkError) {
|
|
15565
|
-
function BadResponseError(
|
|
15566
|
-
var _this;
|
|
15608
|
+
function BadResponseError() {
|
|
15567
15609
|
bad_response_classCallCheck(this, BadResponseError);
|
|
15568
|
-
|
|
15569
|
-
_this = bad_response_callSuper(this, BadResponseError, [message, response]);
|
|
15570
|
-
_this.__proto__ = trueProto;
|
|
15571
|
-
_this.constructor = BadResponseError;
|
|
15572
|
-
_this.name = "BadResponseError";
|
|
15573
|
-
return _this;
|
|
15610
|
+
return bad_response_callSuper(this, BadResponseError, arguments);
|
|
15574
15611
|
}
|
|
15575
15612
|
bad_response_inherits(BadResponseError, _NetworkError);
|
|
15576
15613
|
return bad_response_createClass(BadResponseError);
|
|
@@ -15596,11 +15633,7 @@ var AccountRequiresMemoError = function (_Error) {
|
|
|
15596
15633
|
function AccountRequiresMemoError(message, accountId, operationIndex) {
|
|
15597
15634
|
var _this;
|
|
15598
15635
|
account_requires_memo_classCallCheck(this, AccountRequiresMemoError);
|
|
15599
|
-
var trueProto = (this instanceof AccountRequiresMemoError ? this.constructor : void 0).prototype;
|
|
15600
15636
|
_this = account_requires_memo_callSuper(this, AccountRequiresMemoError, [message]);
|
|
15601
|
-
_this.__proto__ = trueProto;
|
|
15602
|
-
_this.constructor = AccountRequiresMemoError;
|
|
15603
|
-
_this.name = "AccountRequiresMemoError";
|
|
15604
15637
|
_this.accountId = accountId;
|
|
15605
15638
|
_this.operationIndex = operationIndex;
|
|
15606
15639
|
return _this;
|
|
@@ -20323,8 +20356,7 @@ function sent_transaction_toPrimitive(t, r) { if ("object" != sent_transaction_t
|
|
|
20323
20356
|
|
|
20324
20357
|
var SentTransaction = function () {
|
|
20325
20358
|
function SentTransaction(assembled) {
|
|
20326
|
-
var _this = this
|
|
20327
|
-
_this$assembled$optio2;
|
|
20359
|
+
var _this = this;
|
|
20328
20360
|
sent_transaction_classCallCheck(this, SentTransaction);
|
|
20329
20361
|
_defineProperty(this, "send", function () {
|
|
20330
20362
|
var _ref = sent_transaction_asyncToGenerator(sent_transaction_regenerator().m(function _callee2(watcher) {
|
|
@@ -20381,8 +20413,14 @@ var SentTransaction = function () {
|
|
|
20381
20413
|
};
|
|
20382
20414
|
}());
|
|
20383
20415
|
this.assembled = assembled;
|
|
20384
|
-
|
|
20385
|
-
|
|
20416
|
+
var _this$assembled$optio2 = this.assembled.options,
|
|
20417
|
+
server = _this$assembled$optio2.server,
|
|
20418
|
+
allowHttp = _this$assembled$optio2.allowHttp,
|
|
20419
|
+
headers = _this$assembled$optio2.headers,
|
|
20420
|
+
rpcUrl = _this$assembled$optio2.rpcUrl;
|
|
20421
|
+
this.server = server !== null && server !== void 0 ? server : new rpc.Server(rpcUrl, {
|
|
20422
|
+
allowHttp: allowHttp,
|
|
20423
|
+
headers: headers
|
|
20386
20424
|
});
|
|
20387
20425
|
}
|
|
20388
20426
|
return sent_transaction_createClass(SentTransaction, [{
|
|
@@ -20503,8 +20541,7 @@ function assembled_transaction_toPrimitive(t, r) { if ("object" != assembled_tra
|
|
|
20503
20541
|
var AssembledTransaction = function () {
|
|
20504
20542
|
function AssembledTransaction(options) {
|
|
20505
20543
|
var _this = this,
|
|
20506
|
-
_this$options$simulat
|
|
20507
|
-
_this$options$allowHt;
|
|
20544
|
+
_this$options$simulat;
|
|
20508
20545
|
assembled_transaction_classCallCheck(this, AssembledTransaction);
|
|
20509
20546
|
assembled_transaction_defineProperty(this, "simulate", assembled_transaction_asyncToGenerator(assembled_transaction_regenerator().m(function _callee() {
|
|
20510
20547
|
var _ref2,
|
|
@@ -20860,8 +20897,14 @@ var AssembledTransaction = function () {
|
|
|
20860
20897
|
})));
|
|
20861
20898
|
this.options = options;
|
|
20862
20899
|
this.options.simulate = (_this$options$simulat = this.options.simulate) !== null && _this$options$simulat !== void 0 ? _this$options$simulat : true;
|
|
20863
|
-
|
|
20864
|
-
|
|
20900
|
+
var _this$options = this.options,
|
|
20901
|
+
server = _this$options.server,
|
|
20902
|
+
allowHttp = _this$options.allowHttp,
|
|
20903
|
+
headers = _this$options.headers,
|
|
20904
|
+
rpcUrl = _this$options.rpcUrl;
|
|
20905
|
+
this.server = server !== null && server !== void 0 ? server : new rpc.Server(rpcUrl, {
|
|
20906
|
+
allowHttp: allowHttp,
|
|
20907
|
+
headers: headers
|
|
20865
20908
|
});
|
|
20866
20909
|
}
|
|
20867
20910
|
return assembled_transaction_createClass(AssembledTransaction, [{
|
|
@@ -21877,7 +21920,7 @@ var Spec = function () {
|
|
|
21877
21920
|
}
|
|
21878
21921
|
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeOption().value) {
|
|
21879
21922
|
var opt = ty.option();
|
|
21880
|
-
if (val === undefined) {
|
|
21923
|
+
if (val === null || val === undefined) {
|
|
21881
21924
|
return stellar_base_min.xdr.ScVal.scvVoid();
|
|
21882
21925
|
}
|
|
21883
21926
|
return this.nativeToScVal(val, opt.valueType());
|
|
@@ -22141,12 +22184,20 @@ var Spec = function () {
|
|
|
22141
22184
|
var _this5 = this;
|
|
22142
22185
|
var t = typeDef.switch();
|
|
22143
22186
|
var value = t.value;
|
|
22187
|
+
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeOption().value) {
|
|
22188
|
+
switch (scv.switch().value) {
|
|
22189
|
+
case stellar_base_min.xdr.ScValType.scvVoid().value:
|
|
22190
|
+
return null;
|
|
22191
|
+
default:
|
|
22192
|
+
return this.scValToNative(scv, typeDef.option().valueType());
|
|
22193
|
+
}
|
|
22194
|
+
}
|
|
22144
22195
|
if (value === stellar_base_min.xdr.ScSpecType.scSpecTypeUdt().value) {
|
|
22145
22196
|
return this.scValUdtToNative(scv, typeDef.udt());
|
|
22146
22197
|
}
|
|
22147
22198
|
switch (scv.switch().value) {
|
|
22148
22199
|
case stellar_base_min.xdr.ScValType.scvVoid().value:
|
|
22149
|
-
return
|
|
22200
|
+
return null;
|
|
22150
22201
|
case stellar_base_min.xdr.ScValType.scvU64().value:
|
|
22151
22202
|
case stellar_base_min.xdr.ScValType.scvI64().value:
|
|
22152
22203
|
case stellar_base_min.xdr.ScValType.scvU128().value:
|
|
@@ -22397,6 +22448,7 @@ function _specFromWasmHash() {
|
|
|
22397
22448
|
var format,
|
|
22398
22449
|
rpcUrl,
|
|
22399
22450
|
allowHttp,
|
|
22451
|
+
headers,
|
|
22400
22452
|
serverOpts,
|
|
22401
22453
|
server,
|
|
22402
22454
|
wasm,
|
|
@@ -22411,9 +22463,10 @@ function _specFromWasmHash() {
|
|
|
22411
22463
|
}
|
|
22412
22464
|
throw new TypeError("options must contain rpcUrl");
|
|
22413
22465
|
case 1:
|
|
22414
|
-
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
|
|
22466
|
+
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp, headers = options.headers;
|
|
22415
22467
|
serverOpts = {
|
|
22416
|
-
allowHttp: allowHttp
|
|
22468
|
+
allowHttp: allowHttp,
|
|
22469
|
+
headers: headers
|
|
22417
22470
|
};
|
|
22418
22471
|
server = new rpc.Server(rpcUrl, serverOpts);
|
|
22419
22472
|
_context5.n = 2;
|
|
@@ -22446,6 +22499,14 @@ var Client = function () {
|
|
|
22446
22499
|
});
|
|
22447
22500
|
this.spec = spec;
|
|
22448
22501
|
this.options = options;
|
|
22502
|
+
if (options.server === undefined) {
|
|
22503
|
+
var allowHttp = options.allowHttp,
|
|
22504
|
+
headers = options.headers;
|
|
22505
|
+
options.server = new rpc.Server(options.rpcUrl, {
|
|
22506
|
+
allowHttp: allowHttp,
|
|
22507
|
+
headers: headers
|
|
22508
|
+
});
|
|
22509
|
+
}
|
|
22449
22510
|
this.spec.funcs().forEach(function (xdrFn) {
|
|
22450
22511
|
var method = xdrFn.name().toString();
|
|
22451
22512
|
if (method === CONSTRUCTOR_FUNC) {
|
|
@@ -22515,10 +22576,11 @@ var Client = function () {
|
|
|
22515
22576
|
key: "fromWasmHash",
|
|
22516
22577
|
value: (function () {
|
|
22517
22578
|
var _fromWasmHash = client_asyncToGenerator(client_regenerator().m(function _callee2(wasmHash, options) {
|
|
22579
|
+
var _options$server;
|
|
22518
22580
|
var format,
|
|
22519
22581
|
rpcUrl,
|
|
22520
22582
|
allowHttp,
|
|
22521
|
-
|
|
22583
|
+
headers,
|
|
22522
22584
|
server,
|
|
22523
22585
|
wasm,
|
|
22524
22586
|
_args2 = arguments;
|
|
@@ -22532,11 +22594,11 @@ var Client = function () {
|
|
|
22532
22594
|
}
|
|
22533
22595
|
throw new TypeError("options must contain rpcUrl");
|
|
22534
22596
|
case 1:
|
|
22535
|
-
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
|
|
22536
|
-
|
|
22537
|
-
allowHttp: allowHttp
|
|
22538
|
-
|
|
22539
|
-
|
|
22597
|
+
rpcUrl = options.rpcUrl, allowHttp = options.allowHttp, headers = options.headers;
|
|
22598
|
+
server = (_options$server = options.server) !== null && _options$server !== void 0 ? _options$server : new rpc.Server(rpcUrl, {
|
|
22599
|
+
allowHttp: allowHttp,
|
|
22600
|
+
headers: headers
|
|
22601
|
+
});
|
|
22540
22602
|
_context2.n = 2;
|
|
22541
22603
|
return server.getContractWasmByHash(wasmHash, format);
|
|
22542
22604
|
case 2:
|
|
@@ -22575,7 +22637,7 @@ var Client = function () {
|
|
|
22575
22637
|
key: "from",
|
|
22576
22638
|
value: (function () {
|
|
22577
22639
|
var _from = client_asyncToGenerator(client_regenerator().m(function _callee4(options) {
|
|
22578
|
-
var rpcUrl, contractId, allowHttp,
|
|
22640
|
+
var rpcUrl, contractId, allowHttp, headers, server, wasm;
|
|
22579
22641
|
return client_regenerator().w(function (_context4) {
|
|
22580
22642
|
while (1) switch (_context4.n) {
|
|
22581
22643
|
case 0:
|
|
@@ -22585,11 +22647,11 @@ var Client = function () {
|
|
|
22585
22647
|
}
|
|
22586
22648
|
throw new TypeError("options must contain rpcUrl and contractId");
|
|
22587
22649
|
case 1:
|
|
22588
|
-
rpcUrl = options.rpcUrl, contractId = options.contractId, allowHttp = options.allowHttp;
|
|
22589
|
-
|
|
22590
|
-
allowHttp: allowHttp
|
|
22591
|
-
|
|
22592
|
-
|
|
22650
|
+
rpcUrl = options.rpcUrl, contractId = options.contractId, allowHttp = options.allowHttp, headers = options.headers;
|
|
22651
|
+
server = new rpc.Server(rpcUrl, {
|
|
22652
|
+
allowHttp: allowHttp,
|
|
22653
|
+
headers: headers
|
|
22654
|
+
});
|
|
22593
22655
|
_context4.n = 2;
|
|
22594
22656
|
return server.getContractWasmByContractId(contractId);
|
|
22595
22657
|
case 2:
|
|
@@ -27929,7 +27991,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
27929
27991
|
// EXPORTS
|
|
27930
27992
|
__webpack_require__.d(__webpack_exports__, {
|
|
27931
27993
|
AccountResponse: () => (/* reexport */ AccountResponse),
|
|
27932
|
-
AxiosClient: () => (/* reexport */ horizon_axios_client),
|
|
27933
27994
|
HorizonApi: () => (/* reexport */ HorizonApi),
|
|
27934
27995
|
SERVER_TIME_MAP: () => (/* reexport */ SERVER_TIME_MAP),
|
|
27935
27996
|
Server: () => (/* reexport */ HorizonServer),
|
|
@@ -31068,43 +31129,50 @@ var errors = __webpack_require__(5976);
|
|
|
31068
31129
|
var http_client = __webpack_require__(9983);
|
|
31069
31130
|
;// ./src/horizon/horizon_axios_client.ts
|
|
31070
31131
|
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); }
|
|
31132
|
+
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; }
|
|
31133
|
+
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; }
|
|
31134
|
+
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; }
|
|
31135
|
+
function horizon_axios_client_toPropertyKey(t) { var i = horizon_axios_client_toPrimitive(t, "string"); return "symbol" == horizon_axios_client_typeof(i) ? i : i + ""; }
|
|
31136
|
+
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); }
|
|
31071
31137
|
|
|
31072
31138
|
|
|
31073
|
-
var version = "14.
|
|
31139
|
+
var version = "14.3.1";
|
|
31074
31140
|
var SERVER_TIME_MAP = {};
|
|
31075
|
-
var AxiosClient = (0,http_client/* create */.vt)({
|
|
31076
|
-
headers: {
|
|
31077
|
-
"X-Client-Name": "js-stellar-sdk",
|
|
31078
|
-
"X-Client-Version": version
|
|
31079
|
-
}
|
|
31080
|
-
});
|
|
31081
31141
|
function toSeconds(ms) {
|
|
31082
31142
|
return Math.floor(ms / 1000);
|
|
31083
31143
|
}
|
|
31084
|
-
|
|
31085
|
-
var
|
|
31086
|
-
|
|
31087
|
-
|
|
31088
|
-
|
|
31089
|
-
|
|
31090
|
-
|
|
31091
|
-
|
|
31092
|
-
|
|
31093
|
-
var
|
|
31094
|
-
if (
|
|
31095
|
-
|
|
31096
|
-
|
|
31097
|
-
|
|
31098
|
-
|
|
31099
|
-
|
|
31100
|
-
|
|
31101
|
-
|
|
31102
|
-
|
|
31103
|
-
|
|
31104
|
-
|
|
31105
|
-
|
|
31106
|
-
|
|
31107
|
-
|
|
31144
|
+
function createHttpClient(headers) {
|
|
31145
|
+
var httpClient = (0,http_client/* create */.vt)({
|
|
31146
|
+
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
|
31147
|
+
"X-Client-Name": "js-stellar-sdk",
|
|
31148
|
+
"X-Client-Version": version
|
|
31149
|
+
})
|
|
31150
|
+
});
|
|
31151
|
+
httpClient.interceptors.response.use(function (response) {
|
|
31152
|
+
var hostname = URI_default()(response.config.url).hostname();
|
|
31153
|
+
var serverTime = 0;
|
|
31154
|
+
if (response.headers instanceof Headers) {
|
|
31155
|
+
var dateHeader = response.headers.get("date");
|
|
31156
|
+
if (dateHeader) {
|
|
31157
|
+
serverTime = toSeconds(Date.parse(dateHeader));
|
|
31158
|
+
}
|
|
31159
|
+
} else if (horizon_axios_client_typeof(response.headers) === "object" && "date" in response.headers) {
|
|
31160
|
+
var responseHeader = response.headers;
|
|
31161
|
+
if (typeof responseHeader.date === "string") {
|
|
31162
|
+
serverTime = toSeconds(Date.parse(responseHeader.date));
|
|
31163
|
+
}
|
|
31164
|
+
}
|
|
31165
|
+
var localTimeRecorded = toSeconds(new Date().getTime());
|
|
31166
|
+
if (!Number.isNaN(serverTime)) {
|
|
31167
|
+
SERVER_TIME_MAP[hostname] = {
|
|
31168
|
+
serverTime: serverTime,
|
|
31169
|
+
localTimeRecorded: localTimeRecorded
|
|
31170
|
+
};
|
|
31171
|
+
}
|
|
31172
|
+
return response;
|
|
31173
|
+
});
|
|
31174
|
+
return httpClient;
|
|
31175
|
+
}
|
|
31108
31176
|
function getCurrentServerTime(hostname) {
|
|
31109
31177
|
var entry = SERVER_TIME_MAP[hostname];
|
|
31110
31178
|
if (!entry || !entry.localTimeRecorded || !entry.serverTime) {
|
|
@@ -31141,13 +31209,14 @@ if (true) {
|
|
|
31141
31209
|
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);
|
|
31142
31210
|
}
|
|
31143
31211
|
var CallBuilder = function () {
|
|
31144
|
-
function CallBuilder(serverUrl) {
|
|
31145
|
-
var neighborRoot = arguments.length >
|
|
31212
|
+
function CallBuilder(serverUrl, httpClient) {
|
|
31213
|
+
var neighborRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
31146
31214
|
call_builder_classCallCheck(this, CallBuilder);
|
|
31147
31215
|
this.url = serverUrl.clone();
|
|
31148
31216
|
this.filter = [];
|
|
31149
31217
|
this.originalSegments = this.url.segment() || [];
|
|
31150
31218
|
this.neighborRoot = neighborRoot;
|
|
31219
|
+
this.httpClient = httpClient;
|
|
31151
31220
|
}
|
|
31152
31221
|
return call_builder_createClass(CallBuilder, [{
|
|
31153
31222
|
key: "call",
|
|
@@ -31355,7 +31424,7 @@ var CallBuilder = function () {
|
|
|
31355
31424
|
if (url.protocol() === "") {
|
|
31356
31425
|
url = url.protocol(this.url.protocol());
|
|
31357
31426
|
}
|
|
31358
|
-
return _context3.a(2,
|
|
31427
|
+
return _context3.a(2, this.httpClient.get(url.toString()).then(function (response) {
|
|
31359
31428
|
return response.data;
|
|
31360
31429
|
}).catch(this._handleNetworkError));
|
|
31361
31430
|
}
|
|
@@ -31478,10 +31547,10 @@ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new T
|
|
|
31478
31547
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
31479
31548
|
|
|
31480
31549
|
var AccountCallBuilder = function (_CallBuilder) {
|
|
31481
|
-
function AccountCallBuilder(serverUrl) {
|
|
31550
|
+
function AccountCallBuilder(serverUrl, httpClient) {
|
|
31482
31551
|
var _this;
|
|
31483
31552
|
account_call_builder_classCallCheck(this, AccountCallBuilder);
|
|
31484
|
-
_this = _callSuper(this, AccountCallBuilder, [serverUrl]);
|
|
31553
|
+
_this = _callSuper(this, AccountCallBuilder, [serverUrl, httpClient]);
|
|
31485
31554
|
_this.url.segment("accounts");
|
|
31486
31555
|
return _this;
|
|
31487
31556
|
}
|
|
@@ -31489,7 +31558,7 @@ var AccountCallBuilder = function (_CallBuilder) {
|
|
|
31489
31558
|
return account_call_builder_createClass(AccountCallBuilder, [{
|
|
31490
31559
|
key: "accountId",
|
|
31491
31560
|
value: function accountId(id) {
|
|
31492
|
-
var builder = new CallBuilder(this.url.clone());
|
|
31561
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
31493
31562
|
builder.filter.push([id]);
|
|
31494
31563
|
return builder;
|
|
31495
31564
|
}
|
|
@@ -31535,10 +31604,10 @@ function assets_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
31535
31604
|
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); }
|
|
31536
31605
|
|
|
31537
31606
|
var AssetsCallBuilder = function (_CallBuilder) {
|
|
31538
|
-
function AssetsCallBuilder(serverUrl) {
|
|
31607
|
+
function AssetsCallBuilder(serverUrl, httpClient) {
|
|
31539
31608
|
var _this;
|
|
31540
31609
|
assets_call_builder_classCallCheck(this, AssetsCallBuilder);
|
|
31541
|
-
_this = assets_call_builder_callSuper(this, AssetsCallBuilder, [serverUrl]);
|
|
31610
|
+
_this = assets_call_builder_callSuper(this, AssetsCallBuilder, [serverUrl, httpClient]);
|
|
31542
31611
|
_this.url.segment("assets");
|
|
31543
31612
|
return _this;
|
|
31544
31613
|
}
|
|
@@ -31573,10 +31642,10 @@ function claimable_balances_call_builder_inherits(t, e) { if ("function" != type
|
|
|
31573
31642
|
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); }
|
|
31574
31643
|
|
|
31575
31644
|
var ClaimableBalanceCallBuilder = function (_CallBuilder) {
|
|
31576
|
-
function ClaimableBalanceCallBuilder(serverUrl) {
|
|
31645
|
+
function ClaimableBalanceCallBuilder(serverUrl, httpClient) {
|
|
31577
31646
|
var _this;
|
|
31578
31647
|
claimable_balances_call_builder_classCallCheck(this, ClaimableBalanceCallBuilder);
|
|
31579
|
-
_this = claimable_balances_call_builder_callSuper(this, ClaimableBalanceCallBuilder, [serverUrl]);
|
|
31648
|
+
_this = claimable_balances_call_builder_callSuper(this, ClaimableBalanceCallBuilder, [serverUrl, httpClient]);
|
|
31580
31649
|
_this.url.segment("claimable_balances");
|
|
31581
31650
|
return _this;
|
|
31582
31651
|
}
|
|
@@ -31584,7 +31653,7 @@ var ClaimableBalanceCallBuilder = function (_CallBuilder) {
|
|
|
31584
31653
|
return claimable_balances_call_builder_createClass(ClaimableBalanceCallBuilder, [{
|
|
31585
31654
|
key: "claimableBalance",
|
|
31586
31655
|
value: function claimableBalance(claimableBalanceId) {
|
|
31587
|
-
var builder = new CallBuilder(this.url.clone());
|
|
31656
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
31588
31657
|
builder.filter.push([claimableBalanceId]);
|
|
31589
31658
|
return builder;
|
|
31590
31659
|
}
|
|
@@ -31624,10 +31693,10 @@ function effect_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
31624
31693
|
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); }
|
|
31625
31694
|
|
|
31626
31695
|
var EffectCallBuilder = function (_CallBuilder) {
|
|
31627
|
-
function EffectCallBuilder(serverUrl) {
|
|
31696
|
+
function EffectCallBuilder(serverUrl, httpClient) {
|
|
31628
31697
|
var _this;
|
|
31629
31698
|
effect_call_builder_classCallCheck(this, EffectCallBuilder);
|
|
31630
|
-
_this = effect_call_builder_callSuper(this, EffectCallBuilder, [serverUrl, "effects"]);
|
|
31699
|
+
_this = effect_call_builder_callSuper(this, EffectCallBuilder, [serverUrl, httpClient, "effects"]);
|
|
31631
31700
|
_this.url.segment("effects");
|
|
31632
31701
|
return _this;
|
|
31633
31702
|
}
|
|
@@ -31675,10 +31744,10 @@ function friendbot_builder_inherits(t, e) { if ("function" != typeof e && null !
|
|
|
31675
31744
|
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); }
|
|
31676
31745
|
|
|
31677
31746
|
var FriendbotBuilder = function (_CallBuilder) {
|
|
31678
|
-
function FriendbotBuilder(serverUrl, address) {
|
|
31747
|
+
function FriendbotBuilder(serverUrl, httpClient, address) {
|
|
31679
31748
|
var _this;
|
|
31680
31749
|
friendbot_builder_classCallCheck(this, FriendbotBuilder);
|
|
31681
|
-
_this = friendbot_builder_callSuper(this, FriendbotBuilder, [serverUrl]);
|
|
31750
|
+
_this = friendbot_builder_callSuper(this, FriendbotBuilder, [serverUrl, httpClient]);
|
|
31682
31751
|
_this.url.segment("friendbot");
|
|
31683
31752
|
_this.url.setQuery("addr", address);
|
|
31684
31753
|
return _this;
|
|
@@ -31702,10 +31771,10 @@ function ledger_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
31702
31771
|
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); }
|
|
31703
31772
|
|
|
31704
31773
|
var LedgerCallBuilder = function (_CallBuilder) {
|
|
31705
|
-
function LedgerCallBuilder(serverUrl) {
|
|
31774
|
+
function LedgerCallBuilder(serverUrl, httpClient) {
|
|
31706
31775
|
var _this;
|
|
31707
31776
|
ledger_call_builder_classCallCheck(this, LedgerCallBuilder);
|
|
31708
|
-
_this = ledger_call_builder_callSuper(this, LedgerCallBuilder, [serverUrl]);
|
|
31777
|
+
_this = ledger_call_builder_callSuper(this, LedgerCallBuilder, [serverUrl, httpClient]);
|
|
31709
31778
|
_this.url.segment("ledgers");
|
|
31710
31779
|
return _this;
|
|
31711
31780
|
}
|
|
@@ -31734,10 +31803,10 @@ function liquidity_pool_call_builder_inherits(t, e) { if ("function" != typeof e
|
|
|
31734
31803
|
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); }
|
|
31735
31804
|
|
|
31736
31805
|
var LiquidityPoolCallBuilder = function (_CallBuilder) {
|
|
31737
|
-
function LiquidityPoolCallBuilder(serverUrl) {
|
|
31806
|
+
function LiquidityPoolCallBuilder(serverUrl, httpClient) {
|
|
31738
31807
|
var _this;
|
|
31739
31808
|
liquidity_pool_call_builder_classCallCheck(this, LiquidityPoolCallBuilder);
|
|
31740
|
-
_this = liquidity_pool_call_builder_callSuper(this, LiquidityPoolCallBuilder, [serverUrl]);
|
|
31809
|
+
_this = liquidity_pool_call_builder_callSuper(this, LiquidityPoolCallBuilder, [serverUrl, httpClient]);
|
|
31741
31810
|
_this.url.segment("liquidity_pools");
|
|
31742
31811
|
return _this;
|
|
31743
31812
|
}
|
|
@@ -31766,7 +31835,7 @@ var LiquidityPoolCallBuilder = function (_CallBuilder) {
|
|
|
31766
31835
|
if (!id.match(/[a-fA-F0-9]{64}/)) {
|
|
31767
31836
|
throw new TypeError("".concat(id, " does not look like a liquidity pool ID"));
|
|
31768
31837
|
}
|
|
31769
|
-
var builder = new CallBuilder(this.url.clone());
|
|
31838
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
31770
31839
|
builder.filter.push([id.toLowerCase()]);
|
|
31771
31840
|
return builder;
|
|
31772
31841
|
}
|
|
@@ -31788,10 +31857,10 @@ function offer_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
31788
31857
|
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); }
|
|
31789
31858
|
|
|
31790
31859
|
var OfferCallBuilder = function (_CallBuilder) {
|
|
31791
|
-
function OfferCallBuilder(serverUrl) {
|
|
31860
|
+
function OfferCallBuilder(serverUrl, httpClient) {
|
|
31792
31861
|
var _this;
|
|
31793
31862
|
offer_call_builder_classCallCheck(this, OfferCallBuilder);
|
|
31794
|
-
_this = offer_call_builder_callSuper(this, OfferCallBuilder, [serverUrl, "offers"]);
|
|
31863
|
+
_this = offer_call_builder_callSuper(this, OfferCallBuilder, [serverUrl, httpClient, "offers"]);
|
|
31795
31864
|
_this.url.segment("offers");
|
|
31796
31865
|
return _this;
|
|
31797
31866
|
}
|
|
@@ -31799,7 +31868,7 @@ var OfferCallBuilder = function (_CallBuilder) {
|
|
|
31799
31868
|
return offer_call_builder_createClass(OfferCallBuilder, [{
|
|
31800
31869
|
key: "offer",
|
|
31801
31870
|
value: function offer(offerId) {
|
|
31802
|
-
var builder = new CallBuilder(this.url.clone());
|
|
31871
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
31803
31872
|
builder.filter.push([offerId]);
|
|
31804
31873
|
return builder;
|
|
31805
31874
|
}
|
|
@@ -31862,10 +31931,10 @@ function operation_call_builder_inherits(t, e) { if ("function" != typeof e && n
|
|
|
31862
31931
|
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); }
|
|
31863
31932
|
|
|
31864
31933
|
var OperationCallBuilder = function (_CallBuilder) {
|
|
31865
|
-
function OperationCallBuilder(serverUrl) {
|
|
31934
|
+
function OperationCallBuilder(serverUrl, httpClient) {
|
|
31866
31935
|
var _this;
|
|
31867
31936
|
operation_call_builder_classCallCheck(this, OperationCallBuilder);
|
|
31868
|
-
_this = operation_call_builder_callSuper(this, OperationCallBuilder, [serverUrl, "operations"]);
|
|
31937
|
+
_this = operation_call_builder_callSuper(this, OperationCallBuilder, [serverUrl, httpClient, "operations"]);
|
|
31869
31938
|
_this.url.segment("operations");
|
|
31870
31939
|
return _this;
|
|
31871
31940
|
}
|
|
@@ -31873,7 +31942,7 @@ var OperationCallBuilder = function (_CallBuilder) {
|
|
|
31873
31942
|
return operation_call_builder_createClass(OperationCallBuilder, [{
|
|
31874
31943
|
key: "operation",
|
|
31875
31944
|
value: function operation(operationId) {
|
|
31876
|
-
var builder = new CallBuilder(this.url.clone());
|
|
31945
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
31877
31946
|
builder.filter.push([operationId]);
|
|
31878
31947
|
return builder;
|
|
31879
31948
|
}
|
|
@@ -31926,10 +31995,10 @@ function orderbook_call_builder_inherits(t, e) { if ("function" != typeof e && n
|
|
|
31926
31995
|
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); }
|
|
31927
31996
|
|
|
31928
31997
|
var OrderbookCallBuilder = function (_CallBuilder) {
|
|
31929
|
-
function OrderbookCallBuilder(serverUrl, selling, buying) {
|
|
31998
|
+
function OrderbookCallBuilder(serverUrl, httpClient, selling, buying) {
|
|
31930
31999
|
var _this;
|
|
31931
32000
|
orderbook_call_builder_classCallCheck(this, OrderbookCallBuilder);
|
|
31932
|
-
_this = orderbook_call_builder_callSuper(this, OrderbookCallBuilder, [serverUrl]);
|
|
32001
|
+
_this = orderbook_call_builder_callSuper(this, OrderbookCallBuilder, [serverUrl, httpClient]);
|
|
31933
32002
|
_this.url.segment("order_book");
|
|
31934
32003
|
if (!selling.isNative()) {
|
|
31935
32004
|
_this.url.setQuery("selling_asset_type", selling.getAssetType());
|
|
@@ -31966,10 +32035,10 @@ function payment_call_builder_inherits(t, e) { if ("function" != typeof e && nul
|
|
|
31966
32035
|
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); }
|
|
31967
32036
|
|
|
31968
32037
|
var PaymentCallBuilder = function (_CallBuilder) {
|
|
31969
|
-
function PaymentCallBuilder(serverUrl) {
|
|
32038
|
+
function PaymentCallBuilder(serverUrl, httpClient) {
|
|
31970
32039
|
var _this;
|
|
31971
32040
|
payment_call_builder_classCallCheck(this, PaymentCallBuilder);
|
|
31972
|
-
_this = payment_call_builder_callSuper(this, PaymentCallBuilder, [serverUrl, "payments"]);
|
|
32041
|
+
_this = payment_call_builder_callSuper(this, PaymentCallBuilder, [serverUrl, httpClient, "payments"]);
|
|
31973
32042
|
_this.url.segment("payments");
|
|
31974
32043
|
return _this;
|
|
31975
32044
|
}
|
|
@@ -32013,10 +32082,10 @@ function strict_receive_path_call_builder_inherits(t, e) { if ("function" != typ
|
|
|
32013
32082
|
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); }
|
|
32014
32083
|
|
|
32015
32084
|
var StrictReceivePathCallBuilder = function (_CallBuilder) {
|
|
32016
|
-
function StrictReceivePathCallBuilder(serverUrl, source, destinationAsset, destinationAmount) {
|
|
32085
|
+
function StrictReceivePathCallBuilder(serverUrl, httpClient, source, destinationAsset, destinationAmount) {
|
|
32017
32086
|
var _this;
|
|
32018
32087
|
strict_receive_path_call_builder_classCallCheck(this, StrictReceivePathCallBuilder);
|
|
32019
|
-
_this = strict_receive_path_call_builder_callSuper(this, StrictReceivePathCallBuilder, [serverUrl]);
|
|
32088
|
+
_this = strict_receive_path_call_builder_callSuper(this, StrictReceivePathCallBuilder, [serverUrl, httpClient]);
|
|
32020
32089
|
_this.url.segment("paths/strict-receive");
|
|
32021
32090
|
if (typeof source === "string") {
|
|
32022
32091
|
_this.url.setQuery("source_account", source);
|
|
@@ -32058,10 +32127,10 @@ function strict_send_path_call_builder_inherits(t, e) { if ("function" != typeof
|
|
|
32058
32127
|
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); }
|
|
32059
32128
|
|
|
32060
32129
|
var StrictSendPathCallBuilder = function (_CallBuilder) {
|
|
32061
|
-
function StrictSendPathCallBuilder(serverUrl, sourceAsset, sourceAmount, destination) {
|
|
32130
|
+
function StrictSendPathCallBuilder(serverUrl, httpClient, sourceAsset, sourceAmount, destination) {
|
|
32062
32131
|
var _this;
|
|
32063
32132
|
strict_send_path_call_builder_classCallCheck(this, StrictSendPathCallBuilder);
|
|
32064
|
-
_this = strict_send_path_call_builder_callSuper(this, StrictSendPathCallBuilder, [serverUrl]);
|
|
32133
|
+
_this = strict_send_path_call_builder_callSuper(this, StrictSendPathCallBuilder, [serverUrl, httpClient]);
|
|
32065
32134
|
_this.url.segment("paths/strict-send");
|
|
32066
32135
|
if (sourceAsset.isNative()) {
|
|
32067
32136
|
_this.url.setQuery("source_asset_type", "native");
|
|
@@ -32105,10 +32174,10 @@ function trade_aggregation_call_builder_setPrototypeOf(t, e) { return trade_aggr
|
|
|
32105
32174
|
|
|
32106
32175
|
var allowedResolutions = [60000, 300000, 900000, 3600000, 86400000, 604800000];
|
|
32107
32176
|
var TradeAggregationCallBuilder = function (_CallBuilder) {
|
|
32108
|
-
function TradeAggregationCallBuilder(serverUrl, base, counter, start_time, end_time, resolution, offset) {
|
|
32177
|
+
function TradeAggregationCallBuilder(serverUrl, httpClient, base, counter, start_time, end_time, resolution, offset) {
|
|
32109
32178
|
var _this;
|
|
32110
32179
|
trade_aggregation_call_builder_classCallCheck(this, TradeAggregationCallBuilder);
|
|
32111
|
-
_this = trade_aggregation_call_builder_callSuper(this, TradeAggregationCallBuilder, [serverUrl]);
|
|
32180
|
+
_this = trade_aggregation_call_builder_callSuper(this, TradeAggregationCallBuilder, [serverUrl, httpClient]);
|
|
32112
32181
|
_this.url.segment("trade_aggregations");
|
|
32113
32182
|
if (!base.isNative()) {
|
|
32114
32183
|
_this.url.setQuery("base_asset_type", base.getAssetType());
|
|
@@ -32174,10 +32243,10 @@ function trades_call_builder_inherits(t, e) { if ("function" != typeof e && null
|
|
|
32174
32243
|
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); }
|
|
32175
32244
|
|
|
32176
32245
|
var TradesCallBuilder = function (_CallBuilder) {
|
|
32177
|
-
function TradesCallBuilder(serverUrl) {
|
|
32246
|
+
function TradesCallBuilder(serverUrl, httpClient) {
|
|
32178
32247
|
var _this;
|
|
32179
32248
|
trades_call_builder_classCallCheck(this, TradesCallBuilder);
|
|
32180
|
-
_this = trades_call_builder_callSuper(this, TradesCallBuilder, [serverUrl, "trades"]);
|
|
32249
|
+
_this = trades_call_builder_callSuper(this, TradesCallBuilder, [serverUrl, httpClient, "trades"]);
|
|
32181
32250
|
_this.url.segment("trades");
|
|
32182
32251
|
return _this;
|
|
32183
32252
|
}
|
|
@@ -32241,10 +32310,10 @@ function transaction_call_builder_inherits(t, e) { if ("function" != typeof e &&
|
|
|
32241
32310
|
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); }
|
|
32242
32311
|
|
|
32243
32312
|
var TransactionCallBuilder = function (_CallBuilder) {
|
|
32244
|
-
function TransactionCallBuilder(serverUrl) {
|
|
32313
|
+
function TransactionCallBuilder(serverUrl, httpClient) {
|
|
32245
32314
|
var _this;
|
|
32246
32315
|
transaction_call_builder_classCallCheck(this, TransactionCallBuilder);
|
|
32247
|
-
_this = transaction_call_builder_callSuper(this, TransactionCallBuilder, [serverUrl, "transactions"]);
|
|
32316
|
+
_this = transaction_call_builder_callSuper(this, TransactionCallBuilder, [serverUrl, httpClient, "transactions"]);
|
|
32248
32317
|
_this.url.segment("transactions");
|
|
32249
32318
|
return _this;
|
|
32250
32319
|
}
|
|
@@ -32252,7 +32321,7 @@ var TransactionCallBuilder = function (_CallBuilder) {
|
|
|
32252
32321
|
return transaction_call_builder_createClass(TransactionCallBuilder, [{
|
|
32253
32322
|
key: "transaction",
|
|
32254
32323
|
value: function transaction(transactionId) {
|
|
32255
|
-
var builder = new CallBuilder(this.url.clone());
|
|
32324
|
+
var builder = new CallBuilder(this.url.clone(), this.httpClient);
|
|
32256
32325
|
builder.filter.push([transactionId]);
|
|
32257
32326
|
return builder;
|
|
32258
32327
|
}
|
|
@@ -32286,9 +32355,9 @@ var TransactionCallBuilder = function (_CallBuilder) {
|
|
|
32286
32355
|
}(CallBuilder);
|
|
32287
32356
|
;// ./src/horizon/server.ts
|
|
32288
32357
|
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); }
|
|
32289
|
-
function
|
|
32290
|
-
function
|
|
32291
|
-
function
|
|
32358
|
+
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; }
|
|
32359
|
+
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; }
|
|
32360
|
+
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; }
|
|
32292
32361
|
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 }; })(); }
|
|
32293
32362
|
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); }
|
|
32294
32363
|
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); }
|
|
@@ -32347,13 +32416,7 @@ var HorizonServer = function () {
|
|
|
32347
32416
|
if (opts.headers) {
|
|
32348
32417
|
Object.assign(customHeaders, opts.headers);
|
|
32349
32418
|
}
|
|
32350
|
-
|
|
32351
|
-
horizon_axios_client.interceptors.request.use(function (config) {
|
|
32352
|
-
config.headers = config.headers || {};
|
|
32353
|
-
config.headers = Object.assign(config.headers, customHeaders);
|
|
32354
|
-
return config;
|
|
32355
|
-
});
|
|
32356
|
-
}
|
|
32419
|
+
this.httpClient = createHttpClient(customHeaders);
|
|
32357
32420
|
if (this.serverURL.protocol() !== "https" && !allowHttp) {
|
|
32358
32421
|
throw new Error("Cannot connect to insecure horizon server");
|
|
32359
32422
|
}
|
|
@@ -32389,7 +32452,7 @@ var HorizonServer = function () {
|
|
|
32389
32452
|
});
|
|
32390
32453
|
case 2:
|
|
32391
32454
|
_context.n = 3;
|
|
32392
|
-
return
|
|
32455
|
+
return this.httpClient.get(this.serverURL.toString());
|
|
32393
32456
|
case 3:
|
|
32394
32457
|
return _context.a(2, this.fetchTimebounds(seconds, true));
|
|
32395
32458
|
}
|
|
@@ -32429,7 +32492,7 @@ var HorizonServer = function () {
|
|
|
32429
32492
|
return server_regenerator().w(function (_context3) {
|
|
32430
32493
|
while (1) switch (_context3.n) {
|
|
32431
32494
|
case 0:
|
|
32432
|
-
cb = new CallBuilder(
|
|
32495
|
+
cb = new CallBuilder(this.serverURL, this.httpClient);
|
|
32433
32496
|
cb.filter.push(["fee_stats"]);
|
|
32434
32497
|
return _context3.a(2, cb.call());
|
|
32435
32498
|
}
|
|
@@ -32448,7 +32511,7 @@ var HorizonServer = function () {
|
|
|
32448
32511
|
return server_regenerator().w(function (_context4) {
|
|
32449
32512
|
while (1) switch (_context4.n) {
|
|
32450
32513
|
case 0:
|
|
32451
|
-
cb = new CallBuilder(
|
|
32514
|
+
cb = new CallBuilder(this.serverURL, this.httpClient);
|
|
32452
32515
|
return _context4.a(2, cb.call());
|
|
32453
32516
|
}
|
|
32454
32517
|
}, _callee4, this);
|
|
@@ -32479,7 +32542,7 @@ var HorizonServer = function () {
|
|
|
32479
32542
|
return this.checkMemoRequired(transaction);
|
|
32480
32543
|
case 1:
|
|
32481
32544
|
tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
|
|
32482
|
-
return _context5.a(2,
|
|
32545
|
+
return _context5.a(2, this.httpClient.post(this.serverURL.segment("transactions").toString(), "tx=".concat(tx), {
|
|
32483
32546
|
timeout: SUBMIT_TRANSACTION_TIMEOUT,
|
|
32484
32547
|
headers: {
|
|
32485
32548
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -32582,7 +32645,7 @@ var HorizonServer = function () {
|
|
|
32582
32645
|
return !!result;
|
|
32583
32646
|
});
|
|
32584
32647
|
}
|
|
32585
|
-
return
|
|
32648
|
+
return server_objectSpread(server_objectSpread({}, response.data), {}, {
|
|
32586
32649
|
offerResults: hasManageOffer ? offerResults : undefined
|
|
32587
32650
|
});
|
|
32588
32651
|
}).catch(function (response) {
|
|
@@ -32620,7 +32683,7 @@ var HorizonServer = function () {
|
|
|
32620
32683
|
return this.checkMemoRequired(transaction);
|
|
32621
32684
|
case 1:
|
|
32622
32685
|
tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
|
|
32623
|
-
return _context6.a(2,
|
|
32686
|
+
return _context6.a(2, this.httpClient.post(this.serverURL.segment("transactions_async").toString(), "tx=".concat(tx), {
|
|
32624
32687
|
headers: {
|
|
32625
32688
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
32626
32689
|
}
|
|
@@ -32643,77 +32706,77 @@ var HorizonServer = function () {
|
|
|
32643
32706
|
}, {
|
|
32644
32707
|
key: "accounts",
|
|
32645
32708
|
value: function accounts() {
|
|
32646
|
-
return new AccountCallBuilder(
|
|
32709
|
+
return new AccountCallBuilder(this.serverURL, this.httpClient);
|
|
32647
32710
|
}
|
|
32648
32711
|
}, {
|
|
32649
32712
|
key: "claimableBalances",
|
|
32650
32713
|
value: function claimableBalances() {
|
|
32651
|
-
return new ClaimableBalanceCallBuilder(
|
|
32714
|
+
return new ClaimableBalanceCallBuilder(this.serverURL, this.httpClient);
|
|
32652
32715
|
}
|
|
32653
32716
|
}, {
|
|
32654
32717
|
key: "ledgers",
|
|
32655
32718
|
value: function ledgers() {
|
|
32656
|
-
return new LedgerCallBuilder(
|
|
32719
|
+
return new LedgerCallBuilder(this.serverURL, this.httpClient);
|
|
32657
32720
|
}
|
|
32658
32721
|
}, {
|
|
32659
32722
|
key: "transactions",
|
|
32660
32723
|
value: function transactions() {
|
|
32661
|
-
return new TransactionCallBuilder(
|
|
32724
|
+
return new TransactionCallBuilder(this.serverURL, this.httpClient);
|
|
32662
32725
|
}
|
|
32663
32726
|
}, {
|
|
32664
32727
|
key: "offers",
|
|
32665
32728
|
value: function offers() {
|
|
32666
|
-
return new OfferCallBuilder(
|
|
32729
|
+
return new OfferCallBuilder(this.serverURL, this.httpClient);
|
|
32667
32730
|
}
|
|
32668
32731
|
}, {
|
|
32669
32732
|
key: "orderbook",
|
|
32670
32733
|
value: function orderbook(selling, buying) {
|
|
32671
|
-
return new OrderbookCallBuilder(
|
|
32734
|
+
return new OrderbookCallBuilder(this.serverURL, this.httpClient, selling, buying);
|
|
32672
32735
|
}
|
|
32673
32736
|
}, {
|
|
32674
32737
|
key: "trades",
|
|
32675
32738
|
value: function trades() {
|
|
32676
|
-
return new TradesCallBuilder(
|
|
32739
|
+
return new TradesCallBuilder(this.serverURL, this.httpClient);
|
|
32677
32740
|
}
|
|
32678
32741
|
}, {
|
|
32679
32742
|
key: "operations",
|
|
32680
32743
|
value: function operations() {
|
|
32681
|
-
return new OperationCallBuilder(
|
|
32744
|
+
return new OperationCallBuilder(this.serverURL, this.httpClient);
|
|
32682
32745
|
}
|
|
32683
32746
|
}, {
|
|
32684
32747
|
key: "liquidityPools",
|
|
32685
32748
|
value: function liquidityPools() {
|
|
32686
|
-
return new LiquidityPoolCallBuilder(
|
|
32749
|
+
return new LiquidityPoolCallBuilder(this.serverURL, this.httpClient);
|
|
32687
32750
|
}
|
|
32688
32751
|
}, {
|
|
32689
32752
|
key: "strictReceivePaths",
|
|
32690
32753
|
value: function strictReceivePaths(source, destinationAsset, destinationAmount) {
|
|
32691
|
-
return new StrictReceivePathCallBuilder(
|
|
32754
|
+
return new StrictReceivePathCallBuilder(this.serverURL, this.httpClient, source, destinationAsset, destinationAmount);
|
|
32692
32755
|
}
|
|
32693
32756
|
}, {
|
|
32694
32757
|
key: "strictSendPaths",
|
|
32695
32758
|
value: function strictSendPaths(sourceAsset, sourceAmount, destination) {
|
|
32696
|
-
return new StrictSendPathCallBuilder(
|
|
32759
|
+
return new StrictSendPathCallBuilder(this.serverURL, this.httpClient, sourceAsset, sourceAmount, destination);
|
|
32697
32760
|
}
|
|
32698
32761
|
}, {
|
|
32699
32762
|
key: "payments",
|
|
32700
32763
|
value: function payments() {
|
|
32701
|
-
return new PaymentCallBuilder(
|
|
32764
|
+
return new PaymentCallBuilder(this.serverURL, this.httpClient);
|
|
32702
32765
|
}
|
|
32703
32766
|
}, {
|
|
32704
32767
|
key: "effects",
|
|
32705
32768
|
value: function effects() {
|
|
32706
|
-
return new EffectCallBuilder(
|
|
32769
|
+
return new EffectCallBuilder(this.serverURL, this.httpClient);
|
|
32707
32770
|
}
|
|
32708
32771
|
}, {
|
|
32709
32772
|
key: "friendbot",
|
|
32710
32773
|
value: function friendbot(address) {
|
|
32711
|
-
return new FriendbotBuilder(
|
|
32774
|
+
return new FriendbotBuilder(this.serverURL, this.httpClient, address);
|
|
32712
32775
|
}
|
|
32713
32776
|
}, {
|
|
32714
32777
|
key: "assets",
|
|
32715
32778
|
value: function assets() {
|
|
32716
|
-
return new AssetsCallBuilder(
|
|
32779
|
+
return new AssetsCallBuilder(this.serverURL, this.httpClient);
|
|
32717
32780
|
}
|
|
32718
32781
|
}, {
|
|
32719
32782
|
key: "loadAccount",
|
|
@@ -32739,7 +32802,7 @@ var HorizonServer = function () {
|
|
|
32739
32802
|
}, {
|
|
32740
32803
|
key: "tradeAggregation",
|
|
32741
32804
|
value: function tradeAggregation(base, counter, start_time, end_time, resolution, offset) {
|
|
32742
|
-
return new TradeAggregationCallBuilder(
|
|
32805
|
+
return new TradeAggregationCallBuilder(this.serverURL, this.httpClient, base, counter, start_time, end_time, resolution, offset);
|
|
32743
32806
|
}
|
|
32744
32807
|
}, {
|
|
32745
32808
|
key: "checkMemoRequired",
|