@stellar/stellar-sdk 14.3.3 → 14.4.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 +22 -1
- package/dist/stellar-sdk-minimal.js +7220 -7111
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +3454 -3345
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +7471 -7362
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +7972 -7863
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/config.d.ts +2 -6
- package/lib/contract/assembled_transaction.d.ts +16 -132
- package/lib/contract/assembled_transaction.js +14 -114
- package/lib/contract/errors.d.ts +26 -0
- package/lib/contract/errors.js +126 -0
- package/lib/contract/sent_transaction.d.ts +1 -1
- package/lib/contract/spec.d.ts +2 -2
- package/lib/contract/spec.js +31 -28
- package/lib/contract/types.d.ts +47 -8
- package/lib/contract/utils.d.ts +1 -1
- package/lib/contract/utils.js +18 -53
- package/lib/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/contract/wasm_spec_parser.js +15 -0
- package/lib/errors/network.d.ts +1 -1
- package/lib/federation/server.d.ts +7 -7
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server.d.ts +1 -1
- package/lib/horizon/server.js +2 -2
- package/lib/index.d.ts +0 -3
- package/lib/minimal/config.d.ts +2 -6
- package/lib/minimal/contract/assembled_transaction.d.ts +16 -132
- package/lib/minimal/contract/assembled_transaction.js +14 -114
- package/lib/minimal/contract/errors.d.ts +26 -0
- package/lib/minimal/contract/errors.js +126 -0
- package/lib/minimal/contract/sent_transaction.d.ts +1 -1
- package/lib/minimal/contract/spec.d.ts +2 -2
- package/lib/minimal/contract/spec.js +31 -28
- package/lib/minimal/contract/types.d.ts +47 -8
- package/lib/minimal/contract/utils.d.ts +1 -1
- package/lib/minimal/contract/utils.js +18 -53
- package/lib/minimal/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/minimal/contract/wasm_spec_parser.js +15 -0
- package/lib/minimal/errors/network.d.ts +1 -1
- package/lib/minimal/federation/server.d.ts +7 -7
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server.d.ts +1 -1
- package/lib/minimal/horizon/server.js +2 -2
- package/lib/minimal/index.d.ts +0 -3
- package/lib/minimal/rpc/api.d.ts +28 -4
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/rpc/jsonrpc.d.ts +2 -1
- package/lib/minimal/rpc/jsonrpc.js +1 -1
- package/lib/minimal/rpc/parsers.js +8 -5
- package/lib/minimal/rpc/server.d.ts +46 -7
- package/lib/minimal/rpc/server.js +290 -211
- package/lib/minimal/rpc/utils.js +1 -1
- package/lib/minimal/webauth/challenge_transaction.d.ts +235 -0
- package/lib/minimal/webauth/challenge_transaction.js +307 -0
- package/lib/minimal/webauth/index.d.ts +1 -0
- package/lib/minimal/webauth/index.js +13 -1
- package/lib/minimal/webauth/utils.d.ts +28 -273
- package/lib/minimal/webauth/utils.js +12 -288
- package/lib/no-axios/config.d.ts +2 -6
- package/lib/no-axios/contract/assembled_transaction.d.ts +16 -132
- package/lib/no-axios/contract/assembled_transaction.js +14 -114
- package/lib/no-axios/contract/errors.d.ts +26 -0
- package/lib/no-axios/contract/errors.js +126 -0
- package/lib/no-axios/contract/sent_transaction.d.ts +1 -1
- package/lib/no-axios/contract/spec.d.ts +2 -2
- package/lib/no-axios/contract/spec.js +31 -28
- package/lib/no-axios/contract/types.d.ts +47 -8
- package/lib/no-axios/contract/utils.d.ts +1 -1
- package/lib/no-axios/contract/utils.js +18 -53
- package/lib/no-axios/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/no-axios/contract/wasm_spec_parser.js +15 -0
- package/lib/no-axios/errors/network.d.ts +1 -1
- package/lib/no-axios/federation/server.d.ts +7 -7
- package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server.d.ts +1 -1
- package/lib/no-axios/horizon/server.js +2 -2
- package/lib/no-axios/index.d.ts +0 -3
- package/lib/no-axios/rpc/api.d.ts +28 -4
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/rpc/jsonrpc.d.ts +2 -1
- package/lib/no-axios/rpc/jsonrpc.js +1 -1
- package/lib/no-axios/rpc/parsers.js +8 -5
- package/lib/no-axios/rpc/server.d.ts +46 -7
- package/lib/no-axios/rpc/server.js +290 -211
- package/lib/no-axios/rpc/utils.js +1 -1
- package/lib/no-axios/webauth/challenge_transaction.d.ts +235 -0
- package/lib/no-axios/webauth/challenge_transaction.js +307 -0
- package/lib/no-axios/webauth/index.d.ts +1 -0
- package/lib/no-axios/webauth/index.js +13 -1
- package/lib/no-axios/webauth/utils.d.ts +28 -273
- package/lib/no-axios/webauth/utils.js +12 -288
- package/lib/no-eventsource/config.d.ts +2 -6
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +16 -132
- package/lib/no-eventsource/contract/assembled_transaction.js +14 -114
- package/lib/no-eventsource/contract/errors.d.ts +26 -0
- package/lib/no-eventsource/contract/errors.js +126 -0
- package/lib/no-eventsource/contract/sent_transaction.d.ts +1 -1
- package/lib/no-eventsource/contract/spec.d.ts +2 -2
- package/lib/no-eventsource/contract/spec.js +31 -28
- package/lib/no-eventsource/contract/types.d.ts +47 -8
- package/lib/no-eventsource/contract/utils.d.ts +1 -1
- package/lib/no-eventsource/contract/utils.js +18 -53
- package/lib/no-eventsource/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/no-eventsource/contract/wasm_spec_parser.js +15 -0
- package/lib/no-eventsource/errors/network.d.ts +1 -1
- package/lib/no-eventsource/federation/server.d.ts +7 -7
- package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server.d.ts +1 -1
- package/lib/no-eventsource/horizon/server.js +2 -2
- package/lib/no-eventsource/index.d.ts +0 -3
- package/lib/no-eventsource/rpc/api.d.ts +28 -4
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/rpc/jsonrpc.d.ts +2 -1
- package/lib/no-eventsource/rpc/jsonrpc.js +1 -1
- package/lib/no-eventsource/rpc/parsers.js +8 -5
- package/lib/no-eventsource/rpc/server.d.ts +46 -7
- package/lib/no-eventsource/rpc/server.js +290 -211
- package/lib/no-eventsource/rpc/utils.js +1 -1
- package/lib/no-eventsource/webauth/challenge_transaction.d.ts +235 -0
- package/lib/no-eventsource/webauth/challenge_transaction.js +307 -0
- package/lib/no-eventsource/webauth/index.d.ts +1 -0
- package/lib/no-eventsource/webauth/index.js +13 -1
- package/lib/no-eventsource/webauth/utils.d.ts +28 -273
- package/lib/no-eventsource/webauth/utils.js +12 -288
- package/lib/rpc/api.d.ts +28 -4
- package/lib/rpc/axios.js +1 -1
- package/lib/rpc/jsonrpc.d.ts +2 -1
- package/lib/rpc/jsonrpc.js +1 -1
- package/lib/rpc/parsers.js +8 -5
- package/lib/rpc/server.d.ts +46 -7
- package/lib/rpc/server.js +290 -211
- package/lib/rpc/utils.js +1 -1
- package/lib/webauth/challenge_transaction.d.ts +235 -0
- package/lib/webauth/challenge_transaction.js +307 -0
- package/lib/webauth/index.d.ts +1 -0
- package/lib/webauth/index.js +13 -1
- package/lib/webauth/utils.d.ts +28 -273
- package/lib/webauth/utils.js +12 -288
- package/package.json +14 -14
- package/types/dom-monkeypatch.d.ts +1 -1
package/lib/rpc/api.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Contract, SorobanDataBuilder, xdr } from "@stellar/stellar-base";
|
|
2
2
|
export declare namespace Api {
|
|
3
3
|
export interface GetHealthResponse {
|
|
4
|
+
latestLedger: number;
|
|
5
|
+
ledgerRetentionWindow: number;
|
|
6
|
+
oldestLedger: number;
|
|
4
7
|
status: "healthy";
|
|
5
8
|
}
|
|
6
9
|
export interface LedgerEntryResult {
|
|
@@ -218,7 +221,7 @@ export declare namespace Api {
|
|
|
218
221
|
export type GetEventsRequest = {
|
|
219
222
|
filters: Api.EventFilter[];
|
|
220
223
|
startLedger: number;
|
|
221
|
-
endLedger
|
|
224
|
+
endLedger?: number;
|
|
222
225
|
cursor?: never;
|
|
223
226
|
limit?: number;
|
|
224
227
|
} | {
|
|
@@ -253,7 +256,7 @@ export declare namespace Api {
|
|
|
253
256
|
}
|
|
254
257
|
export interface RawEventResponse extends BaseEventResponse {
|
|
255
258
|
contractId: string;
|
|
256
|
-
topic
|
|
259
|
+
topic?: string[];
|
|
257
260
|
value: string;
|
|
258
261
|
}
|
|
259
262
|
interface RawLedgerEntryChange {
|
|
@@ -303,7 +306,7 @@ export declare namespace Api {
|
|
|
303
306
|
}
|
|
304
307
|
export type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot";
|
|
305
308
|
/**
|
|
306
|
-
* Simplifies {@link
|
|
309
|
+
* Simplifies {@link RawSimulateTransactionResponse} into separate interfaces
|
|
307
310
|
* based on status:
|
|
308
311
|
* - on success, this includes all fields, though `result` is only present
|
|
309
312
|
* if an invocation was simulated (since otherwise there's nothing to
|
|
@@ -358,9 +361,29 @@ export declare namespace Api {
|
|
|
358
361
|
transactionData: SorobanDataBuilder;
|
|
359
362
|
};
|
|
360
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* Checks if a simulation response indicates an error.
|
|
366
|
+
* @param sim The simulation response to check.
|
|
367
|
+
* @returns True if the response indicates an error, false otherwise.
|
|
368
|
+
*/
|
|
361
369
|
export function isSimulationError(sim: SimulateTransactionResponse): sim is SimulateTransactionErrorResponse;
|
|
370
|
+
/**
|
|
371
|
+
* Checks if a simulation response indicates success.
|
|
372
|
+
* @param sim The simulation response to check.
|
|
373
|
+
* @returns True if the response indicates success, false otherwise.
|
|
374
|
+
*/
|
|
362
375
|
export function isSimulationSuccess(sim: SimulateTransactionResponse): sim is SimulateTransactionSuccessResponse;
|
|
376
|
+
/**
|
|
377
|
+
* Checks if a simulation response indicates that a restoration is needed.
|
|
378
|
+
* @param sim The simulation response to check.
|
|
379
|
+
* @returns True if the response indicates a restoration is needed, false otherwise.
|
|
380
|
+
*/
|
|
363
381
|
export function isSimulationRestore(sim: SimulateTransactionResponse): sim is SimulateTransactionRestoreResponse;
|
|
382
|
+
/**
|
|
383
|
+
* Checks if a simulation response is in raw (unparsed) form.
|
|
384
|
+
* @param sim The simulation response to check.
|
|
385
|
+
* @returns True if the response is raw, false otherwise.
|
|
386
|
+
*/
|
|
364
387
|
export function isSimulationRaw(sim: Api.SimulateTransactionResponse | Api.RawSimulateTransactionResponse): sim is Api.RawSimulateTransactionResponse;
|
|
365
388
|
interface RawSimulateHostFunctionResult {
|
|
366
389
|
auth?: string[];
|
|
@@ -427,10 +450,11 @@ export declare namespace Api {
|
|
|
427
450
|
latestLedger: number;
|
|
428
451
|
/** present only on success, otherwise request malformed or no balance */
|
|
429
452
|
balanceEntry?: {
|
|
430
|
-
/** a 64-bit integer */
|
|
453
|
+
/** a 64-bit integer for trustlines, 128-bit value for contracts */
|
|
431
454
|
amount: string;
|
|
432
455
|
authorized: boolean;
|
|
433
456
|
clawback: boolean;
|
|
457
|
+
revocable?: boolean;
|
|
434
458
|
lastModifiedLedgerSeq?: number;
|
|
435
459
|
liveUntilLedgerSeq?: number;
|
|
436
460
|
};
|
package/lib/rpc/axios.js
CHANGED
|
@@ -12,7 +12,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
12
|
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; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
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); }
|
|
15
|
-
var version = exports.version = "14.
|
|
15
|
+
var version = exports.version = "14.4.1";
|
|
16
16
|
function createHttpClient(headers) {
|
|
17
17
|
return (0, _httpClient.create)({
|
|
18
18
|
headers: _objectSpread(_objectSpread({}, headers), {}, {
|
package/lib/rpc/jsonrpc.d.ts
CHANGED
|
@@ -27,10 +27,11 @@ export interface Error<E = any> {
|
|
|
27
27
|
/**
|
|
28
28
|
* Sends the jsonrpc 'params' as a single 'param' object (no array support).
|
|
29
29
|
*
|
|
30
|
+
* @param {HttpClient} client HttpClient instance to use for the request
|
|
30
31
|
* @param {string} url URL to the RPC instance
|
|
31
32
|
* @param {string} method RPC method name that should be called
|
|
32
33
|
* @param {(any | null)} [param=null] params that should be supplied to the method
|
|
33
|
-
* @returns {Promise
|
|
34
|
+
* @returns {Promise} Promise that resolves to the result of type T
|
|
34
35
|
* @private
|
|
35
36
|
*/
|
|
36
37
|
export declare function postObject<T>(client: HttpClient, url: string, method: string, param?: any): Promise<T>;
|
package/lib/rpc/jsonrpc.js
CHANGED
|
@@ -9,7 +9,7 @@ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try {
|
|
|
9
9
|
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); }
|
|
10
10
|
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); }); }; }
|
|
11
11
|
function hasOwnProperty(obj, prop) {
|
|
12
|
-
return
|
|
12
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
13
|
}
|
|
14
14
|
function postObject(_x, _x2, _x3) {
|
|
15
15
|
return _postObject.apply(this, arguments);
|
package/lib/rpc/parsers.js
CHANGED
|
@@ -59,10 +59,12 @@ function parseTransactionInfo(raw) {
|
|
|
59
59
|
switch (meta.switch()) {
|
|
60
60
|
case 3:
|
|
61
61
|
case 4:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
{
|
|
63
|
+
var metaV = meta.value();
|
|
64
|
+
if (metaV.sorobanMeta() !== null) {
|
|
65
|
+
var _metaV$sorobanMeta$re, _metaV$sorobanMeta;
|
|
66
|
+
info.returnValue = (_metaV$sorobanMeta$re = (_metaV$sorobanMeta = metaV.sorobanMeta()) === null || _metaV$sorobanMeta === void 0 ? void 0 : _metaV$sorobanMeta.returnValue()) !== null && _metaV$sorobanMeta$re !== void 0 ? _metaV$sorobanMeta$re : undefined;
|
|
67
|
+
}
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
if (raw.diagnosticEventsXdr) {
|
|
@@ -87,12 +89,13 @@ function parseRawEvents(raw) {
|
|
|
87
89
|
oldestLedgerCloseTime: raw.oldestLedgerCloseTime,
|
|
88
90
|
cursor: raw.cursor,
|
|
89
91
|
events: ((_raw$events3 = raw.events) !== null && _raw$events3 !== void 0 ? _raw$events3 : []).map(function (evt) {
|
|
92
|
+
var _evt$topic;
|
|
90
93
|
var clone = _objectSpread({}, evt);
|
|
91
94
|
delete clone.contractId;
|
|
92
95
|
return _objectSpread(_objectSpread(_objectSpread({}, clone), evt.contractId !== "" && {
|
|
93
96
|
contractId: new _stellarBase.Contract(evt.contractId)
|
|
94
97
|
}), {}, {
|
|
95
|
-
topic: evt.topic.map(function (topic) {
|
|
98
|
+
topic: ((_evt$topic = evt.topic) !== null && _evt$topic !== void 0 ? _evt$topic : []).map(function (topic) {
|
|
96
99
|
return _stellarBase.xdr.ScVal.fromXDR(topic, "base64");
|
|
97
100
|
}),
|
|
98
101
|
value: _stellarBase.xdr.ScVal.fromXDR(evt.value, "base64")
|
package/lib/rpc/server.d.ts
CHANGED
|
@@ -155,6 +155,7 @@ export declare class RpcServer {
|
|
|
155
155
|
* @see
|
|
156
156
|
* {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
|
|
157
157
|
*
|
|
158
|
+
* @deprecated Use {@link getAssetBalance}, instead
|
|
158
159
|
* @example
|
|
159
160
|
* const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";
|
|
160
161
|
* const asset = new Asset(
|
|
@@ -187,6 +188,36 @@ export declare class RpcServer {
|
|
|
187
188
|
* });
|
|
188
189
|
*/
|
|
189
190
|
getClaimableBalance(id: string): Promise<xdr.ClaimableBalanceEntry>;
|
|
191
|
+
/**
|
|
192
|
+
* Fetch the balance of an asset held by an account or contract.
|
|
193
|
+
*
|
|
194
|
+
* The `address` argument may be provided as a string (as a {@link StrKey}),
|
|
195
|
+
* {@link Address}, or {@link Contract}.
|
|
196
|
+
*
|
|
197
|
+
* @param {string|Address|Contract} address The account or contract whose
|
|
198
|
+
* balance should be fetched.
|
|
199
|
+
* @param {Asset} asset The asset whose balance you want to inspect.
|
|
200
|
+
* @param {string} [networkPassphrase] optionally, when requesting the
|
|
201
|
+
* balance of a contract, the network passphrase to which this token
|
|
202
|
+
* applies. If omitted and necessary, a request about network information
|
|
203
|
+
* will be made (see {@link getNetwork}), since contract IDs for assets are
|
|
204
|
+
* specific to a network. You can refer to {@link Networks} for a list of
|
|
205
|
+
* built-in passphrases, e.g., `Networks.TESTNET`.
|
|
206
|
+
* @returns {Promise<Api.BalanceResponse>} Resolves with balance entry details
|
|
207
|
+
* when available.
|
|
208
|
+
*
|
|
209
|
+
* @throws {Error} If the supplied `address` is not a valid account or
|
|
210
|
+
* contract strkey.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* const usdc = new Asset(
|
|
214
|
+
* "USDC",
|
|
215
|
+
* "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
|
|
216
|
+
* );
|
|
217
|
+
* const balance = await server.getAssetBalance("GD...", usdc);
|
|
218
|
+
* console.log(balance.balanceEntry?.amount);
|
|
219
|
+
*/
|
|
220
|
+
getAssetBalance(address: string | Address | Contract, asset: Asset, networkPassphrase?: string): Promise<Api.BalanceResponse>;
|
|
190
221
|
/**
|
|
191
222
|
* General node health check.
|
|
192
223
|
*
|
|
@@ -320,6 +351,7 @@ export declare class RpcServer {
|
|
|
320
351
|
* transaction completion and return a definitive state of success or failure.
|
|
321
352
|
*
|
|
322
353
|
* @param {string} hash the transaction you're polling for
|
|
354
|
+
* @param {[RpcServer.PollingOptions]} [opts] polling options
|
|
323
355
|
* @param {number} [opts.attempts] (optional) the number of attempts to make
|
|
324
356
|
* before returning the last-seen status. By default or on invalid inputs,
|
|
325
357
|
* try 5 times.
|
|
@@ -644,7 +676,7 @@ export declare class RpcServer {
|
|
|
644
676
|
* account, or the existing account if it's already funded with the
|
|
645
677
|
* populated sequence number (note that the account will not be "topped
|
|
646
678
|
* off" if it already exists)
|
|
647
|
-
* @throws If Friendbot is not configured on this network or request failure
|
|
679
|
+
* @throws {Error} If Friendbot is not configured on this network or request failure
|
|
648
680
|
*
|
|
649
681
|
* @see {@link https://developers.stellar.org/docs/learn/fundamentals/networks#friendbot | Friendbot docs}
|
|
650
682
|
* @see {@link module:Friendbot.Api.Response}
|
|
@@ -679,8 +711,8 @@ export declare class RpcServer {
|
|
|
679
711
|
*
|
|
680
712
|
* This is a convenience wrapper around {@link Server.getLedgerEntries}.
|
|
681
713
|
*
|
|
682
|
-
* @param {string} address the contract (string `C...`)
|
|
683
|
-
*
|
|
714
|
+
* @param {string} address the contract (string `C...`) whose balance of
|
|
715
|
+
* `sac` you want to know
|
|
684
716
|
* @param {Asset} sac the built-in SAC token (e.g. `USDC:GABC...`) that
|
|
685
717
|
* you are querying from the given `contract`.
|
|
686
718
|
* @param {string} [networkPassphrase] optionally, the network passphrase to
|
|
@@ -698,6 +730,7 @@ export declare class RpcServer {
|
|
|
698
730
|
* @see getLedgerEntries
|
|
699
731
|
* @see https://developers.stellar.org/docs/tokens/stellar-asset-contract
|
|
700
732
|
*
|
|
733
|
+
* @deprecated Use {@link getAssetBalance}, instead
|
|
701
734
|
* @example
|
|
702
735
|
* // assume `address` is some contract or account with an XLM balance
|
|
703
736
|
* // assume server is an instantiated `Server` instance.
|
|
@@ -733,7 +766,9 @@ export declare class RpcServer {
|
|
|
733
766
|
* // Fetch ledgers starting from a specific sequence number
|
|
734
767
|
* server.getLedgers({
|
|
735
768
|
* startLedger: 36233,
|
|
736
|
-
*
|
|
769
|
+
* pagination: {
|
|
770
|
+
* limit: 10
|
|
771
|
+
* }
|
|
737
772
|
* }).then((response) => {
|
|
738
773
|
* console.log("Ledgers:", response.ledgers);
|
|
739
774
|
* console.log("Latest Ledger:", response.latestLedger);
|
|
@@ -744,12 +779,16 @@ export declare class RpcServer {
|
|
|
744
779
|
* // Paginate through ledgers using cursor
|
|
745
780
|
* const firstPage = await server.getLedgers({
|
|
746
781
|
* startLedger: 36233,
|
|
747
|
-
*
|
|
782
|
+
* pagination: {
|
|
783
|
+
* limit: 5
|
|
784
|
+
* }
|
|
748
785
|
* });
|
|
749
786
|
*
|
|
750
787
|
* const nextPage = await server.getLedgers({
|
|
751
|
-
*
|
|
752
|
-
*
|
|
788
|
+
* pagination: {
|
|
789
|
+
* cursor: firstPage.cursor,
|
|
790
|
+
* limit: 5
|
|
791
|
+
* }
|
|
753
792
|
* });
|
|
754
793
|
*/
|
|
755
794
|
getLedgers(request: Api.GetLedgersRequest): Promise<Api.GetLedgersResponse>;
|