@stellar/stellar-sdk 14.3.0 → 14.3.2
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 +12 -0
- package/dist/stellar-sdk-minimal.js +203 -176
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +203 -176
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +203 -176
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +203 -176
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.js +20 -9
- 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/types.d.ts +9 -1
- 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 +20 -9
- 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/types.d.ts +9 -1
- 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/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/server.d.ts +31 -0
- package/lib/minimal/rpc/server.js +15 -20
- package/lib/no-axios/contract/assembled_transaction.js +20 -9
- 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/types.d.ts +9 -1
- 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/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/server.d.ts +31 -0
- package/lib/no-axios/rpc/server.js +15 -20
- package/lib/no-eventsource/contract/assembled_transaction.js +20 -9
- 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/types.d.ts +9 -1
- 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/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/server.d.ts +31 -0
- package/lib/no-eventsource/rpc/server.js +15 -20
- 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/server.d.ts +31 -0
- package/lib/rpc/server.js +15 -20
- package/package.json +17 -42
package/lib/rpc/server.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import URI from "urijs";
|
|
2
2
|
import { Account, Address, Asset, Contract, FeeBumpTransaction, Transaction, xdr } from "@stellar/stellar-base";
|
|
3
3
|
import { Api } from "./api";
|
|
4
|
+
import { HttpClient } from "../http-client";
|
|
4
5
|
/**
|
|
5
6
|
* Default transaction submission timeout for RPC requests, in milliseconds
|
|
6
7
|
* @constant {number}
|
|
@@ -42,9 +43,24 @@ export declare namespace RpcServer {
|
|
|
42
43
|
attempts?: number;
|
|
43
44
|
sleepStrategy?: SleepStrategy;
|
|
44
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Describes additional resource leeways for transaction simulation.
|
|
48
|
+
* @property {number} cpuInstructions Simulate the transaction with more CPU instructions available.
|
|
49
|
+
* @memberof module:rpc.Server
|
|
50
|
+
*/
|
|
45
51
|
interface ResourceLeeway {
|
|
46
52
|
cpuInstructions: number;
|
|
47
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Options for configuring connections to RPC servers.
|
|
56
|
+
*
|
|
57
|
+
* @property {boolean} allowHttp - Allow connecting to http servers, default: `false`. This must be set to false in production deployments!
|
|
58
|
+
* @property {number} timeout - Allow a timeout, default: 0. Allows user to avoid nasty lag.
|
|
59
|
+
* @property {Record<string, string>} headers - Additional headers that should be added to any requests to the RPC server.
|
|
60
|
+
*
|
|
61
|
+
* @alias module:rpc.Server.Options
|
|
62
|
+
* @memberof module:rpc.Server
|
|
63
|
+
*/
|
|
48
64
|
interface Options {
|
|
49
65
|
allowHttp?: boolean;
|
|
50
66
|
timeout?: number;
|
|
@@ -76,6 +92,21 @@ export type SleepStrategy = (iter: number) => number;
|
|
|
76
92
|
*/
|
|
77
93
|
export declare class RpcServer {
|
|
78
94
|
readonly serverURL: URI;
|
|
95
|
+
/**
|
|
96
|
+
* HTTP client instance for making requests to Horizon.
|
|
97
|
+
* Exposes interceptors, defaults, and other configuration options.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* // Add authentication header
|
|
101
|
+
* server.httpClient.defaults.headers['Authorization'] = 'Bearer token';
|
|
102
|
+
*
|
|
103
|
+
* // Add request interceptor
|
|
104
|
+
* server.httpClient.interceptors.request.use((config) => {
|
|
105
|
+
* console.log('Request:', config.url);
|
|
106
|
+
* return config;
|
|
107
|
+
* });
|
|
108
|
+
*/
|
|
109
|
+
readonly httpClient: HttpClient;
|
|
79
110
|
constructor(serverURL: string, opts?: RpcServer.Options);
|
|
80
111
|
/**
|
|
81
112
|
* Fetch a minimal set of current info about a Stellar account.
|
package/lib/rpc/server.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.SUBMIT_TRANSACTION_TIMEOUT = exports.RpcServer = exports.LinearSleepStrategy = exports.Durability = exports.BasicSleepStrategy = void 0;
|
|
7
7
|
var _urijs = _interopRequireDefault(require("urijs"));
|
|
8
8
|
var _stellarBase = require("@stellar/stellar-base");
|
|
9
|
-
var _axios =
|
|
9
|
+
var _axios = require("./axios");
|
|
10
10
|
var jsonrpc = _interopRequireWildcard(require("./jsonrpc"));
|
|
11
11
|
var _api = require("./api");
|
|
12
12
|
var _transaction = require("./transaction");
|
|
@@ -71,12 +71,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
71
71
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
72
72
|
_classCallCheck(this, RpcServer);
|
|
73
73
|
this.serverURL = (0, _urijs.default)(serverURL);
|
|
74
|
-
|
|
75
|
-
_axios.default.interceptors.request.use(function (config) {
|
|
76
|
-
config.headers = Object.assign(config.headers, opts.headers);
|
|
77
|
-
return config;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
74
|
+
this.httpClient = (0, _axios.createHttpClient)(opts.headers);
|
|
80
75
|
if (this.serverURL.protocol() !== "https" && !opts.allowHttp) {
|
|
81
76
|
throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set");
|
|
82
77
|
}
|
|
@@ -231,7 +226,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
231
226
|
return _regenerator().w(function (_context5) {
|
|
232
227
|
while (1) switch (_context5.n) {
|
|
233
228
|
case 0:
|
|
234
|
-
return _context5.a(2, jsonrpc.postObject(this.serverURL.toString(), "getHealth"));
|
|
229
|
+
return _context5.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getHealth"));
|
|
235
230
|
}
|
|
236
231
|
}, _callee5, this);
|
|
237
232
|
}));
|
|
@@ -406,7 +401,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
406
401
|
for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
407
402
|
keys[_key] = arguments[_key];
|
|
408
403
|
}
|
|
409
|
-
return jsonrpc.postObject(this.serverURL.toString(), "getLedgerEntries", {
|
|
404
|
+
return jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getLedgerEntries", {
|
|
410
405
|
keys: keys.map(function (k) {
|
|
411
406
|
return k.toXDR("base64");
|
|
412
407
|
})
|
|
@@ -518,7 +513,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
518
513
|
return _regenerator().w(function (_context10) {
|
|
519
514
|
while (1) switch (_context10.n) {
|
|
520
515
|
case 0:
|
|
521
|
-
return _context10.a(2, jsonrpc.postObject(this.serverURL.toString(), "getTransaction", {
|
|
516
|
+
return _context10.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getTransaction", {
|
|
522
517
|
hash: hash
|
|
523
518
|
}));
|
|
524
519
|
}
|
|
@@ -562,7 +557,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
562
557
|
return _regenerator().w(function (_context12) {
|
|
563
558
|
while (1) switch (_context12.n) {
|
|
564
559
|
case 0:
|
|
565
|
-
return _context12.a(2, jsonrpc.postObject(this.serverURL.toString(), "getTransactions", request));
|
|
560
|
+
return _context12.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getTransactions", request));
|
|
566
561
|
}
|
|
567
562
|
}, _callee12, this);
|
|
568
563
|
}));
|
|
@@ -595,7 +590,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
595
590
|
return _regenerator().w(function (_context14) {
|
|
596
591
|
while (1) switch (_context14.n) {
|
|
597
592
|
case 0:
|
|
598
|
-
return _context14.a(2, jsonrpc.postObject(this.serverURL.toString(), "getEvents", _objectSpread(_objectSpread({
|
|
593
|
+
return _context14.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getEvents", _objectSpread(_objectSpread({
|
|
599
594
|
filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [],
|
|
600
595
|
pagination: _objectSpread(_objectSpread({}, request.cursor && {
|
|
601
596
|
cursor: request.cursor
|
|
@@ -622,7 +617,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
622
617
|
return _regenerator().w(function (_context15) {
|
|
623
618
|
while (1) switch (_context15.n) {
|
|
624
619
|
case 0:
|
|
625
|
-
return _context15.a(2, jsonrpc.postObject(this.serverURL.toString(), "getNetwork"));
|
|
620
|
+
return _context15.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getNetwork"));
|
|
626
621
|
}
|
|
627
622
|
}, _callee15, this);
|
|
628
623
|
}));
|
|
@@ -638,7 +633,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
638
633
|
return _regenerator().w(function (_context16) {
|
|
639
634
|
while (1) switch (_context16.n) {
|
|
640
635
|
case 0:
|
|
641
|
-
return _context16.a(2, jsonrpc.postObject(this.serverURL.toString(), "getLatestLedger"));
|
|
636
|
+
return _context16.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getLatestLedger"));
|
|
642
637
|
}
|
|
643
638
|
}, _callee16, this);
|
|
644
639
|
}));
|
|
@@ -670,7 +665,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
670
665
|
return _regenerator().w(function (_context18) {
|
|
671
666
|
while (1) switch (_context18.n) {
|
|
672
667
|
case 0:
|
|
673
|
-
return _context18.a(2, jsonrpc.postObject(this.serverURL.toString(), "simulateTransaction", _objectSpread({
|
|
668
|
+
return _context18.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "simulateTransaction", _objectSpread({
|
|
674
669
|
transaction: transaction.toXDR(),
|
|
675
670
|
authMode: authMode
|
|
676
671
|
}, addlResources !== undefined && {
|
|
@@ -736,7 +731,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
736
731
|
return _regenerator().w(function (_context21) {
|
|
737
732
|
while (1) switch (_context21.n) {
|
|
738
733
|
case 0:
|
|
739
|
-
return _context21.a(2, jsonrpc.postObject(this.serverURL.toString(), "sendTransaction", {
|
|
734
|
+
return _context21.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "sendTransaction", {
|
|
740
735
|
transaction: transaction.toXDR()
|
|
741
736
|
}));
|
|
742
737
|
}
|
|
@@ -775,7 +770,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
775
770
|
case 3:
|
|
776
771
|
_context22.p = 3;
|
|
777
772
|
_context22.n = 4;
|
|
778
|
-
return
|
|
773
|
+
return this.httpClient.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
|
|
779
774
|
case 4:
|
|
780
775
|
response = _context22.v;
|
|
781
776
|
if (response.data.result_meta_xdr) {
|
|
@@ -831,7 +826,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
831
826
|
return _regenerator().w(function (_context23) {
|
|
832
827
|
while (1) switch (_context23.n) {
|
|
833
828
|
case 0:
|
|
834
|
-
return _context23.a(2, jsonrpc.postObject(this.serverURL.toString(), "getFeeStats"));
|
|
829
|
+
return _context23.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getFeeStats"));
|
|
835
830
|
}
|
|
836
831
|
}, _callee23, this);
|
|
837
832
|
}));
|
|
@@ -847,7 +842,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
847
842
|
return _regenerator().w(function (_context24) {
|
|
848
843
|
while (1) switch (_context24.n) {
|
|
849
844
|
case 0:
|
|
850
|
-
return _context24.a(2, jsonrpc.postObject(this.serverURL.toString(), "getVersionInfo"));
|
|
845
|
+
return _context24.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getVersionInfo"));
|
|
851
846
|
}
|
|
852
847
|
}, _callee24, this);
|
|
853
848
|
}));
|
|
@@ -969,7 +964,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
969
964
|
return _regenerator().w(function (_context27) {
|
|
970
965
|
while (1) switch (_context27.n) {
|
|
971
966
|
case 0:
|
|
972
|
-
return _context27.a(2, jsonrpc.postObject(this.serverURL.toString(), "getLedgers", request));
|
|
967
|
+
return _context27.a(2, jsonrpc.postObject(this.httpClient, this.serverURL.toString(), "getLedgers", request));
|
|
973
968
|
}
|
|
974
969
|
}, _callee27, this);
|
|
975
970
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stellar/stellar-sdk",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.2",
|
|
4
4
|
"description": "A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stellar"
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
"build:node:all": "yarn build:node && yarn build:node:no-axios && yarn build:node:no-eventsource && yarn build:node:minimal",
|
|
90
90
|
"clean:temp": "rm -f ./config/tsconfig.tmp.json",
|
|
91
91
|
"build:ts": "node config/set-output-dir.js && tsc -p ./config/tsconfig.tmp.json && yarn clean:temp",
|
|
92
|
-
"build:test": "tsc -p ./test/unit/tsconfig.json",
|
|
93
92
|
"build:browser": "webpack -c config/webpack.config.browser.js",
|
|
94
93
|
"build:browser:no-axios": "cross-env USE_AXIOS=false webpack -c config/webpack.config.browser.js",
|
|
95
94
|
"build:browser:no-eventsource": "cross-env USE_EVENTSOURCE=false webpack -c config/webpack.config.browser.js",
|
|
@@ -98,17 +97,18 @@
|
|
|
98
97
|
"build:docs": "cross-env NODE_ENV=docs yarn _babel",
|
|
99
98
|
"clean": "rm -rf lib/ dist/ coverage/ .nyc_output/ jsdoc/ test/e2e/.soroban",
|
|
100
99
|
"docs": "yarn build:docs && jsdoc -c ./config/.jsdoc.json",
|
|
101
|
-
"test": "yarn
|
|
102
|
-
"test:
|
|
103
|
-
"test:
|
|
100
|
+
"test": "yarn test:node && yarn test:integration && yarn test:browser",
|
|
101
|
+
"test:all": "yarn test:node && yarn test:integration && yarn test:browser && yarn test:e2e",
|
|
102
|
+
"test:e2e": "./test/e2e/initialize.sh && vitest run --config config/vitest.config.e2e.ts --coverage",
|
|
103
|
+
"test:node": "vitest run test/unit --config config/vitest.config.ts --coverage",
|
|
104
104
|
"test:e2e:noeval": "NODE_OPTIONS=--disallow-code-generation-from-strings yarn test:e2e",
|
|
105
|
-
"test:integration": "
|
|
106
|
-
"test:browser": "
|
|
107
|
-
"test:browser:no-axios": "cross-env USE_AXIOS=false yarn build:browser && cross-env USE_AXIOS=false
|
|
105
|
+
"test:integration": "vitest run test/integration --config config/vitest.config.ts --coverage",
|
|
106
|
+
"test:browser": "yarn build:browser && vitest run --config config/vitest.config.browser.ts test/unit --coverage",
|
|
107
|
+
"test:browser:no-axios": "cross-env USE_AXIOS=false yarn build:browser && cross-env USE_AXIOS=false vitest run --config config/vitest.config.browser.ts test/unit",
|
|
108
108
|
"fmt": "yarn _prettier && yarn eslint -c .eslintrc.js src/ --fix",
|
|
109
109
|
"preversion": "yarn clean && yarn _prettier && yarn build:prod && yarn test",
|
|
110
110
|
"prepare": "yarn build:prod",
|
|
111
|
-
"_build": "yarn build:node:all && yarn build:
|
|
111
|
+
"_build": "yarn build:node:all && yarn build:browser:all",
|
|
112
112
|
"_babel": "babel --extensions '.ts' --out-dir ${OUTPUT_DIR:-lib} src/",
|
|
113
113
|
"_nyc": "node node_modules/.bin/nyc --nycrc-path config/.nycrc",
|
|
114
114
|
"_prettier": "prettier --config config/prettier.config.js --ignore-path config/.prettierignore --write './src/**/*.ts' './test/**/*.{js,ts}'"
|
|
@@ -126,20 +126,6 @@
|
|
|
126
126
|
"engines": {
|
|
127
127
|
"node": ">=20.0.0"
|
|
128
128
|
},
|
|
129
|
-
"mocha": {
|
|
130
|
-
"reporter": "spec",
|
|
131
|
-
"require": [
|
|
132
|
-
"@babel/register",
|
|
133
|
-
"test/test-nodejs.js",
|
|
134
|
-
"dotenv/config"
|
|
135
|
-
],
|
|
136
|
-
"exclude": [
|
|
137
|
-
"test/test-browser.js"
|
|
138
|
-
],
|
|
139
|
-
"sort": true,
|
|
140
|
-
"recursive": true,
|
|
141
|
-
"timeout": 120000
|
|
142
|
-
},
|
|
143
129
|
"nyc": {
|
|
144
130
|
"instrument": false,
|
|
145
131
|
"sourceMap": false,
|
|
@@ -157,26 +143,24 @@
|
|
|
157
143
|
"@definitelytyped/dtslint": "^0.2.29",
|
|
158
144
|
"@istanbuljs/nyc-config-babel": "3.0.0",
|
|
159
145
|
"@stellar/tsconfig": "^1.0.2",
|
|
160
|
-
"@types/chai": "^4.3.19",
|
|
161
146
|
"@types/detect-node": "^2.0.0",
|
|
162
147
|
"@types/eventsource": "^1.1.12",
|
|
163
148
|
"@types/json-schema": "^7.0.15",
|
|
164
149
|
"@types/lodash": "^4.17.20",
|
|
165
|
-
"@types/mocha": "^10.0.9",
|
|
166
150
|
"@types/node": "^20.14.11",
|
|
167
151
|
"@types/randombytes": "^2.0.1",
|
|
168
|
-
"@types/sinon": "^17.0.4",
|
|
169
152
|
"@types/urijs": "^1.19.20",
|
|
170
153
|
"@typescript-eslint/parser": "^7.16.1",
|
|
154
|
+
"@vitest/browser": "^3.2.4",
|
|
155
|
+
"@vitest/coverage-istanbul": "3.2.4",
|
|
156
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
157
|
+
"@vitest/ui": "^3.2.4",
|
|
171
158
|
"axios-mock-adapter": "^1.22.0",
|
|
172
159
|
"babel-loader": "^9.1.3",
|
|
173
160
|
"babel-plugin-istanbul": "^7.0.1",
|
|
174
161
|
"babel-plugin-transform-define": "^2.1.4",
|
|
175
162
|
"better-docs": "^2.7.3",
|
|
176
163
|
"buffer": "^6.0.3",
|
|
177
|
-
"chai": "^4.3.10",
|
|
178
|
-
"chai-as-promised": "^7.1.1",
|
|
179
|
-
"chai-http": "^4.3.0",
|
|
180
164
|
"cross-env": "^7.0.3",
|
|
181
165
|
"dotenv": "^16.6.0",
|
|
182
166
|
"eslint": "^8.57.0",
|
|
@@ -192,34 +176,25 @@
|
|
|
192
176
|
"ghooks": "^2.0.4",
|
|
193
177
|
"husky": "^9.1.6",
|
|
194
178
|
"jsdoc": "^4.0.4",
|
|
195
|
-
"
|
|
196
|
-
"karma": "^6.4.3",
|
|
197
|
-
"karma-chai": "^0.1.0",
|
|
198
|
-
"karma-chrome-launcher": "^3.1.0",
|
|
199
|
-
"karma-coverage": "^2.2.1",
|
|
200
|
-
"karma-firefox-launcher": "^2.1.3",
|
|
201
|
-
"karma-mocha": "^2.0.0",
|
|
202
|
-
"karma-sinon-chai": "^2.0.2",
|
|
203
|
-
"karma-webpack": "^5.0.1",
|
|
179
|
+
"jsdom": "^27.0.0",
|
|
204
180
|
"lint-staged": "^15.5.1",
|
|
205
181
|
"lodash": "^4.17.21",
|
|
206
|
-
"mocha": "^10.8.2",
|
|
207
182
|
"node-polyfill-webpack-plugin": "^3.0.0",
|
|
208
183
|
"null-loader": "^4.0.1",
|
|
209
184
|
"nyc": "^17.0.0",
|
|
185
|
+
"playwright": "^1.56.0",
|
|
210
186
|
"prettier": "^3.6.2",
|
|
211
187
|
"randombytes": "^2.1.0",
|
|
212
|
-
"sinon": "^17.0.1",
|
|
213
|
-
"sinon-chai": "^3.7.0",
|
|
214
188
|
"taffydb": "^2.7.3",
|
|
215
189
|
"terser-webpack-plugin": "^5.3.14",
|
|
216
190
|
"ts-node": "^10.9.2",
|
|
217
191
|
"typescript": "5.6.3",
|
|
192
|
+
"vitest": "^3.2.4",
|
|
218
193
|
"webpack": "^5.102.1",
|
|
219
194
|
"webpack-cli": "^5.0.1"
|
|
220
195
|
},
|
|
221
196
|
"dependencies": {
|
|
222
|
-
"@stellar/stellar-base": "^14.0.
|
|
197
|
+
"@stellar/stellar-base": "^14.0.2",
|
|
223
198
|
"axios": "^1.12.2",
|
|
224
199
|
"bignumber.js": "^9.3.1",
|
|
225
200
|
"eventsource": "^2.0.2",
|