@stellar/stellar-sdk 12.2.0 → 12.3.0
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 -0
- package/README.md +1 -1
- package/dist/stellar-sdk.js +497 -295
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.d.ts +1 -3
- package/lib/contract/assembled_transaction.js +22 -30
- package/lib/horizon/call_builder.js +8 -7
- package/lib/rpc/api.d.ts +60 -6
- package/lib/rpc/parsers.d.ts +2 -0
- package/lib/rpc/parsers.js +29 -0
- package/lib/rpc/server.d.ts +39 -12
- package/lib/rpc/server.js +160 -105
- package/package.json +16 -16
|
@@ -445,7 +445,6 @@ export declare class AssembledTransaction<T> {
|
|
|
445
445
|
*/
|
|
446
446
|
signTransaction?: ClientOptions["signTransaction"];
|
|
447
447
|
}) => Promise<SentTransaction<T>>;
|
|
448
|
-
private getStorageExpiration;
|
|
449
448
|
/**
|
|
450
449
|
* Get a list of accounts, other than the invoker of the simulation, that
|
|
451
450
|
* need to sign auth entries in this transaction.
|
|
@@ -492,8 +491,7 @@ export declare class AssembledTransaction<T> {
|
|
|
492
491
|
/**
|
|
493
492
|
* When to set each auth entry to expire. Could be any number of blocks in
|
|
494
493
|
* the future. Can be supplied as a promise or a raw number. Default:
|
|
495
|
-
*
|
|
496
|
-
* number/block.
|
|
494
|
+
* about 8.3 minutes from now.
|
|
497
495
|
*/
|
|
498
496
|
expiration?: number | Promise<number>;
|
|
499
497
|
/**
|
|
@@ -208,33 +208,11 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
208
208
|
}
|
|
209
209
|
}, _callee3);
|
|
210
210
|
})));
|
|
211
|
-
_defineProperty(this, "getStorageExpiration", _asyncToGenerator(_regeneratorRuntime().mark(function _callee4() {
|
|
212
|
-
var entryRes;
|
|
213
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
214
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
215
|
-
case 0:
|
|
216
|
-
_context4.next = 2;
|
|
217
|
-
return _this.server.getLedgerEntries(new _stellarBase.Contract(_this.options.contractId).getFootprint());
|
|
218
|
-
case 2:
|
|
219
|
-
entryRes = _context4.sent;
|
|
220
|
-
if (!(!entryRes.entries || !entryRes.entries.length || !entryRes.entries[0].liveUntilLedgerSeq)) {
|
|
221
|
-
_context4.next = 5;
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
throw new Error("failed to get ledger entry");
|
|
225
|
-
case 5:
|
|
226
|
-
return _context4.abrupt("return", entryRes.entries[0].liveUntilLedgerSeq);
|
|
227
|
-
case 6:
|
|
228
|
-
case "end":
|
|
229
|
-
return _context4.stop();
|
|
230
|
-
}
|
|
231
|
-
}, _callee4);
|
|
232
|
-
})));
|
|
233
211
|
_defineProperty(this, "needsNonInvokerSigningBy", function () {
|
|
234
212
|
var _rawInvokeHostFunctio;
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
includeAlreadySigned =
|
|
213
|
+
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
214
|
+
_ref7$includeAlreadyS = _ref7.includeAlreadySigned,
|
|
215
|
+
includeAlreadySigned = _ref7$includeAlreadyS === void 0 ? false : _ref7$includeAlreadyS;
|
|
238
216
|
if (!_this.built) {
|
|
239
217
|
throw new Error("Transaction has not yet been simulated");
|
|
240
218
|
}
|
|
@@ -250,12 +228,12 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
250
228
|
});
|
|
251
229
|
_defineProperty(this, "signAuthEntries", _asyncToGenerator(_regeneratorRuntime().mark(function _callee6() {
|
|
252
230
|
var _rawInvokeHostFunctio2;
|
|
253
|
-
var
|
|
254
|
-
|
|
231
|
+
var _ref9,
|
|
232
|
+
_ref9$expiration,
|
|
255
233
|
expiration,
|
|
256
|
-
|
|
234
|
+
_ref9$signAuthEntry,
|
|
257
235
|
signAuthEntry,
|
|
258
|
-
|
|
236
|
+
_ref9$publicKey,
|
|
259
237
|
publicKey,
|
|
260
238
|
needsNonInvokerSigningBy,
|
|
261
239
|
rawInvokeHostFunctionOp,
|
|
@@ -270,7 +248,21 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
270
248
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
271
249
|
while (1) switch (_context6.prev = _context6.next) {
|
|
272
250
|
case 0:
|
|
273
|
-
|
|
251
|
+
_ref9 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref9$expiration = _ref9.expiration, expiration = _ref9$expiration === void 0 ? _asyncToGenerator(_regeneratorRuntime().mark(function _callee4() {
|
|
252
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
253
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
254
|
+
case 0:
|
|
255
|
+
_context4.next = 2;
|
|
256
|
+
return _this.server.getLatestLedger();
|
|
257
|
+
case 2:
|
|
258
|
+
_context4.t0 = _context4.sent.sequence;
|
|
259
|
+
return _context4.abrupt("return", _context4.t0 + 100);
|
|
260
|
+
case 4:
|
|
261
|
+
case "end":
|
|
262
|
+
return _context4.stop();
|
|
263
|
+
}
|
|
264
|
+
}, _callee4);
|
|
265
|
+
}))() : _ref9$expiration, _ref9$signAuthEntry = _ref9.signAuthEntry, signAuthEntry = _ref9$signAuthEntry === void 0 ? _this.options.signAuthEntry : _ref9$signAuthEntry, _ref9$publicKey = _ref9.publicKey, publicKey = _ref9$publicKey === void 0 ? _this.options.publicKey : _ref9$publicKey;
|
|
274
266
|
if (_this.built) {
|
|
275
267
|
_context6.next = 3;
|
|
276
268
|
break;
|
|
@@ -54,10 +54,10 @@ var CallBuilder = exports.CallBuilder = function () {
|
|
|
54
54
|
timeout = setTimeout(function () {
|
|
55
55
|
var _es;
|
|
56
56
|
(_es = es) === null || _es === void 0 || _es.close();
|
|
57
|
-
es =
|
|
57
|
+
es = _createEventSource();
|
|
58
58
|
}, options.reconnectTimeout || 15 * 1000);
|
|
59
59
|
};
|
|
60
|
-
var
|
|
60
|
+
var _createEventSource = function createEventSource() {
|
|
61
61
|
try {
|
|
62
62
|
es = new EventSource(_this2.url.toString());
|
|
63
63
|
} catch (err) {
|
|
@@ -76,7 +76,7 @@ var CallBuilder = exports.CallBuilder = function () {
|
|
|
76
76
|
}
|
|
77
77
|
clearTimeout(timeout);
|
|
78
78
|
es.close();
|
|
79
|
-
|
|
79
|
+
_createEventSource();
|
|
80
80
|
closed = true;
|
|
81
81
|
};
|
|
82
82
|
var onMessage = function onMessage(message) {
|
|
@@ -109,7 +109,7 @@ var CallBuilder = exports.CallBuilder = function () {
|
|
|
109
109
|
}
|
|
110
110
|
return es;
|
|
111
111
|
};
|
|
112
|
-
|
|
112
|
+
_createEventSource();
|
|
113
113
|
return function () {
|
|
114
114
|
var _es2;
|
|
115
115
|
clearTimeout(timeout);
|
|
@@ -321,10 +321,11 @@ var CallBuilder = exports.CallBuilder = function () {
|
|
|
321
321
|
key: "_handleNetworkError",
|
|
322
322
|
value: (function () {
|
|
323
323
|
var _handleNetworkError2 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee6(error) {
|
|
324
|
+
var _error$response$statu, _error$response$statu2;
|
|
324
325
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
325
326
|
while (1) switch (_context6.prev = _context6.next) {
|
|
326
327
|
case 0:
|
|
327
|
-
if (!(error.response && error.response.status
|
|
328
|
+
if (!(error.response && error.response.status)) {
|
|
328
329
|
_context6.next = 8;
|
|
329
330
|
break;
|
|
330
331
|
}
|
|
@@ -332,9 +333,9 @@ var CallBuilder = exports.CallBuilder = function () {
|
|
|
332
333
|
_context6.next = _context6.t0 === 404 ? 4 : 5;
|
|
333
334
|
break;
|
|
334
335
|
case 4:
|
|
335
|
-
return _context6.abrupt("return", Promise.reject(new _errors.NotFoundError(error.response.statusText, error.response.data)));
|
|
336
|
+
return _context6.abrupt("return", Promise.reject(new _errors.NotFoundError((_error$response$statu = error.response.statusText) !== null && _error$response$statu !== void 0 ? _error$response$statu : "Not Found", error.response.data)));
|
|
336
337
|
case 5:
|
|
337
|
-
return _context6.abrupt("return", Promise.reject(new _errors.NetworkError(error.response.statusText, error.response.data)));
|
|
338
|
+
return _context6.abrupt("return", Promise.reject(new _errors.NetworkError((_error$response$statu2 = error.response.statusText) !== null && _error$response$statu2 !== void 0 ? _error$response$statu2 : "Unknown", error.response.data)));
|
|
338
339
|
case 6:
|
|
339
340
|
_context6.next = 9;
|
|
340
341
|
break;
|
package/lib/rpc/api.d.ts
CHANGED
|
@@ -31,18 +31,18 @@ export declare namespace Api {
|
|
|
31
31
|
entries: LedgerEntryResult[];
|
|
32
32
|
latestLedger: number;
|
|
33
33
|
}
|
|
34
|
-
/** @see https://
|
|
34
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries */
|
|
35
35
|
export interface RawGetLedgerEntriesResponse {
|
|
36
36
|
entries?: RawLedgerEntryResult[];
|
|
37
37
|
latestLedger: number;
|
|
38
38
|
}
|
|
39
|
-
/** @see https://
|
|
39
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getNetwork */
|
|
40
40
|
export interface GetNetworkResponse {
|
|
41
41
|
friendbotUrl?: string;
|
|
42
42
|
passphrase: string;
|
|
43
43
|
protocolVersion: string;
|
|
44
44
|
}
|
|
45
|
-
/** @see https://
|
|
45
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLatestLedger */
|
|
46
46
|
export interface GetLatestLedgerResponse {
|
|
47
47
|
id: string;
|
|
48
48
|
sequence: number;
|
|
@@ -53,7 +53,7 @@ export declare namespace Api {
|
|
|
53
53
|
NOT_FOUND = "NOT_FOUND",
|
|
54
54
|
FAILED = "FAILED"
|
|
55
55
|
}
|
|
56
|
-
/** @see https://
|
|
56
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction */
|
|
57
57
|
export type GetTransactionResponse = GetSuccessfulTransactionResponse | GetFailedTransactionResponse | GetMissingTransactionResponse;
|
|
58
58
|
interface GetAnyTransactionResponse {
|
|
59
59
|
status: GetTransactionStatus;
|
|
@@ -74,6 +74,7 @@ export declare namespace Api {
|
|
|
74
74
|
envelopeXdr: xdr.TransactionEnvelope;
|
|
75
75
|
resultXdr: xdr.TransactionResult;
|
|
76
76
|
resultMetaXdr: xdr.TransactionMeta;
|
|
77
|
+
diagnosticEventsXdr?: xdr.DiagnosticEvent[];
|
|
77
78
|
}
|
|
78
79
|
export interface GetSuccessfulTransactionResponse extends GetAnyTransactionResponse {
|
|
79
80
|
status: GetTransactionStatus.SUCCESS;
|
|
@@ -84,6 +85,7 @@ export declare namespace Api {
|
|
|
84
85
|
envelopeXdr: xdr.TransactionEnvelope;
|
|
85
86
|
resultXdr: xdr.TransactionResult;
|
|
86
87
|
resultMetaXdr: xdr.TransactionMeta;
|
|
88
|
+
diagnosticEventsXdr?: xdr.DiagnosticEvent[];
|
|
87
89
|
returnValue?: xdr.ScVal;
|
|
88
90
|
}
|
|
89
91
|
export interface RawGetTransactionResponse {
|
|
@@ -99,6 +101,51 @@ export declare namespace Api {
|
|
|
99
101
|
resultMetaXdr?: string;
|
|
100
102
|
ledger?: number;
|
|
101
103
|
createdAt?: number;
|
|
104
|
+
diagnosticEventsXdr?: string[];
|
|
105
|
+
}
|
|
106
|
+
export interface GetTransactionsRequest {
|
|
107
|
+
startLedger: number;
|
|
108
|
+
cursor?: string;
|
|
109
|
+
limit?: number;
|
|
110
|
+
}
|
|
111
|
+
export interface RawTransactionInfo {
|
|
112
|
+
status: GetTransactionStatus;
|
|
113
|
+
ledger: number;
|
|
114
|
+
createdAt: number;
|
|
115
|
+
applicationOrder: number;
|
|
116
|
+
feeBump: boolean;
|
|
117
|
+
envelopeXdr?: string;
|
|
118
|
+
resultXdr?: string;
|
|
119
|
+
resultMetaXdr?: string;
|
|
120
|
+
diagnosticEventsXdr?: string[];
|
|
121
|
+
}
|
|
122
|
+
export interface TransactionInfo {
|
|
123
|
+
status: GetTransactionStatus;
|
|
124
|
+
ledger: number;
|
|
125
|
+
createdAt: number;
|
|
126
|
+
applicationOrder: number;
|
|
127
|
+
feeBump: boolean;
|
|
128
|
+
envelopeXdr: xdr.TransactionEnvelope;
|
|
129
|
+
resultXdr: xdr.TransactionResult;
|
|
130
|
+
resultMetaXdr: xdr.TransactionMeta;
|
|
131
|
+
returnValue?: xdr.ScVal;
|
|
132
|
+
diagnosticEventsXdr?: xdr.DiagnosticEvent[];
|
|
133
|
+
}
|
|
134
|
+
export interface GetTransactionsResponse {
|
|
135
|
+
transactions: TransactionInfo[];
|
|
136
|
+
latestLedger: number;
|
|
137
|
+
latestLedgerCloseTimestamp: number;
|
|
138
|
+
oldestLedger: number;
|
|
139
|
+
oldestLedgerCloseTimestamp: number;
|
|
140
|
+
cursor: string;
|
|
141
|
+
}
|
|
142
|
+
export interface RawGetTransactionsResponse {
|
|
143
|
+
transactions: RawTransactionInfo[];
|
|
144
|
+
latestLedger: number;
|
|
145
|
+
latestLedgerCloseTimestamp: number;
|
|
146
|
+
oldestLedger: number;
|
|
147
|
+
oldestLedgerCloseTimestamp: number;
|
|
148
|
+
cursor: string;
|
|
102
149
|
}
|
|
103
150
|
export type EventType = 'contract' | 'system' | 'diagnostic';
|
|
104
151
|
export interface EventFilter {
|
|
@@ -188,7 +235,7 @@ export declare namespace Api {
|
|
|
188
235
|
* fields
|
|
189
236
|
* - for all other errors, this only includes error fields
|
|
190
237
|
*
|
|
191
|
-
* @see https://
|
|
238
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction
|
|
192
239
|
*/
|
|
193
240
|
export type SimulateTransactionResponse = SimulateTransactionSuccessResponse | SimulateTransactionRestoreResponse | SimulateTransactionErrorResponse;
|
|
194
241
|
export interface BaseSimulateTransactionResponse {
|
|
@@ -243,7 +290,7 @@ export declare namespace Api {
|
|
|
243
290
|
auth?: string[];
|
|
244
291
|
xdr: string;
|
|
245
292
|
}
|
|
246
|
-
/** @see https://
|
|
293
|
+
/** @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction */
|
|
247
294
|
export interface RawSimulateTransactionResponse {
|
|
248
295
|
id: string;
|
|
249
296
|
latestLedger: number;
|
|
@@ -267,6 +314,13 @@ export declare namespace Api {
|
|
|
267
314
|
/** State Difference information */
|
|
268
315
|
stateChanges?: RawLedgerEntryChange[];
|
|
269
316
|
}
|
|
317
|
+
export interface GetVersionInfoResponse {
|
|
318
|
+
version: string;
|
|
319
|
+
commit_hash: string;
|
|
320
|
+
build_time_stamp: string;
|
|
321
|
+
captive_core_version: string;
|
|
322
|
+
protocol_version: number;
|
|
323
|
+
}
|
|
270
324
|
export interface GetFeeStatsResponse {
|
|
271
325
|
sorobanInclusionFee: FeeDistribution;
|
|
272
326
|
inclusionFee: FeeDistribution;
|
package/lib/rpc/parsers.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Api } from './api';
|
|
2
2
|
export declare function parseRawSendTransaction(r: Api.RawSendTransactionResponse): Api.SendTransactionResponse;
|
|
3
|
+
export declare function parseTransactionInfo(raw: Api.RawTransactionInfo | Api.RawGetTransactionResponse): Omit<Api.TransactionInfo, 'status'>;
|
|
4
|
+
export declare function parseRawTransactions(r: Api.RawTransactionInfo): Api.TransactionInfo;
|
|
3
5
|
export declare function parseRawEvents(r: Api.RawGetEventsResponse): Api.GetEventsResponse;
|
|
4
6
|
export declare function parseRawLedgerEntries(raw: Api.RawGetLedgerEntriesResponse): Api.GetLedgerEntriesResponse;
|
|
5
7
|
/**
|
package/lib/rpc/parsers.js
CHANGED
|
@@ -7,6 +7,8 @@ exports.parseRawEvents = parseRawEvents;
|
|
|
7
7
|
exports.parseRawLedgerEntries = parseRawLedgerEntries;
|
|
8
8
|
exports.parseRawSendTransaction = parseRawSendTransaction;
|
|
9
9
|
exports.parseRawSimulation = parseRawSimulation;
|
|
10
|
+
exports.parseRawTransactions = parseRawTransactions;
|
|
11
|
+
exports.parseTransactionInfo = parseTransactionInfo;
|
|
10
12
|
var _stellarBase = require("@stellar/stellar-base");
|
|
11
13
|
var _api = require("./api");
|
|
12
14
|
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); }
|
|
@@ -31,6 +33,33 @@ function parseRawSendTransaction(r) {
|
|
|
31
33
|
}
|
|
32
34
|
return _objectSpread({}, r);
|
|
33
35
|
}
|
|
36
|
+
function parseTransactionInfo(raw) {
|
|
37
|
+
var meta = _stellarBase.xdr.TransactionMeta.fromXDR(raw.resultMetaXdr, 'base64');
|
|
38
|
+
var info = {
|
|
39
|
+
ledger: raw.ledger,
|
|
40
|
+
createdAt: raw.createdAt,
|
|
41
|
+
applicationOrder: raw.applicationOrder,
|
|
42
|
+
feeBump: raw.feeBump,
|
|
43
|
+
envelopeXdr: _stellarBase.xdr.TransactionEnvelope.fromXDR(raw.envelopeXdr, 'base64'),
|
|
44
|
+
resultXdr: _stellarBase.xdr.TransactionResult.fromXDR(raw.resultXdr, 'base64'),
|
|
45
|
+
resultMetaXdr: meta
|
|
46
|
+
};
|
|
47
|
+
if (meta.switch() === 3 && meta.v3().sorobanMeta() !== null) {
|
|
48
|
+
var _meta$v3$sorobanMeta;
|
|
49
|
+
info.returnValue = (_meta$v3$sorobanMeta = meta.v3().sorobanMeta()) === null || _meta$v3$sorobanMeta === void 0 ? void 0 : _meta$v3$sorobanMeta.returnValue();
|
|
50
|
+
}
|
|
51
|
+
if ('diagnosticEventsXdr' in raw && raw.diagnosticEventsXdr) {
|
|
52
|
+
info.diagnosticEventsXdr = raw.diagnosticEventsXdr.map(function (diagnosticEvent) {
|
|
53
|
+
return _stellarBase.xdr.DiagnosticEvent.fromXDR(diagnosticEvent, 'base64');
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return info;
|
|
57
|
+
}
|
|
58
|
+
function parseRawTransactions(r) {
|
|
59
|
+
return _objectSpread({
|
|
60
|
+
status: r.status
|
|
61
|
+
}, parseTransactionInfo(r));
|
|
62
|
+
}
|
|
34
63
|
function parseRawEvents(r) {
|
|
35
64
|
var _r$events;
|
|
36
65
|
return {
|
package/lib/rpc/server.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare class Server {
|
|
|
56
56
|
* @returns {Promise<Account>} a promise to the {@link Account} object with
|
|
57
57
|
* a populated sequence number
|
|
58
58
|
*
|
|
59
|
-
* @see https://
|
|
59
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries
|
|
60
60
|
* @example
|
|
61
61
|
* const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";
|
|
62
62
|
* server.getAccount(accountId).then((account) => {
|
|
@@ -71,7 +71,7 @@ export declare class Server {
|
|
|
71
71
|
* {@link Api.GetHealthResponse} object with the status of the
|
|
72
72
|
* server (e.g. "healthy").
|
|
73
73
|
*
|
|
74
|
-
* @see https://
|
|
74
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getHealth
|
|
75
75
|
* @example
|
|
76
76
|
* server.getHealth().then((health) => {
|
|
77
77
|
* console.log("status:", health.status);
|
|
@@ -97,7 +97,7 @@ export declare class Server {
|
|
|
97
97
|
*
|
|
98
98
|
* @returns {Promise<Api.LedgerEntryResult>} the current data value
|
|
99
99
|
*
|
|
100
|
-
* @see https://
|
|
100
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries
|
|
101
101
|
* @example
|
|
102
102
|
* const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
|
|
103
103
|
* const key = xdr.ScVal.scvSymbol("counter");
|
|
@@ -174,7 +174,7 @@ export declare class Server {
|
|
|
174
174
|
* on-chain values for the given ledger keys
|
|
175
175
|
*
|
|
176
176
|
* @see Server._getLedgerEntries
|
|
177
|
-
* @see https://
|
|
177
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries
|
|
178
178
|
* @example
|
|
179
179
|
* const contractId = "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM";
|
|
180
180
|
* const key = xdr.LedgerKey.contractData(new xdr.LedgerKeyContractData({
|
|
@@ -204,7 +204,7 @@ export declare class Server {
|
|
|
204
204
|
* @returns {Promise<Api.GetTransactionResponse>} the status,
|
|
205
205
|
* result, and other details about the transaction
|
|
206
206
|
*
|
|
207
|
-
* @see https://
|
|
207
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction
|
|
208
208
|
* @example
|
|
209
209
|
* const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";
|
|
210
210
|
* server.getTransaction(transactionHash).then((tx) => {
|
|
@@ -216,6 +216,26 @@ export declare class Server {
|
|
|
216
216
|
*/
|
|
217
217
|
getTransaction(hash: string): Promise<Api.GetTransactionResponse>;
|
|
218
218
|
_getTransaction(hash: string): Promise<Api.RawGetTransactionResponse>;
|
|
219
|
+
/**
|
|
220
|
+
* Fetch transactions starting from a given start ledger or a cursor. The end ledger is the latest ledger
|
|
221
|
+
* in that RPC instance.
|
|
222
|
+
*
|
|
223
|
+
* @param {Api.GetTransactionsRequest} request - The request parameters.
|
|
224
|
+
* @returns {Promise<Api.GetTransactionsResponse>} - A promise that resolves to the transactions response.
|
|
225
|
+
*
|
|
226
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransactions
|
|
227
|
+
* @example
|
|
228
|
+
* server.getTransactions({
|
|
229
|
+
* startLedger: 10000,
|
|
230
|
+
* limit: 10,
|
|
231
|
+
* }).then((response) => {
|
|
232
|
+
* console.log("Transactions:", response.transactions);
|
|
233
|
+
* console.log("Latest Ledger:", response.latestLedger);
|
|
234
|
+
* console.log("Cursor:", response.cursor);
|
|
235
|
+
* });
|
|
236
|
+
*/
|
|
237
|
+
getTransactions(request: Api.GetTransactionsRequest): Promise<Api.GetTransactionsResponse>;
|
|
238
|
+
private _getTransactions;
|
|
219
239
|
/**
|
|
220
240
|
* Fetch all events that match a given set of filters.
|
|
221
241
|
*
|
|
@@ -230,7 +250,7 @@ export declare class Server {
|
|
|
230
250
|
* @returns {Promise<Api.GetEventsResponse>} a paginatable set of the
|
|
231
251
|
* events matching the given event filters
|
|
232
252
|
*
|
|
233
|
-
* @see https://
|
|
253
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getEvents
|
|
234
254
|
* @example
|
|
235
255
|
* server.getEvents({
|
|
236
256
|
* startLedger: 1000,
|
|
@@ -262,7 +282,7 @@ export declare class Server {
|
|
|
262
282
|
* @returns {Promise<Api.GetNetworkResponse>} metadata about the
|
|
263
283
|
* current network this RPC server is connected to
|
|
264
284
|
*
|
|
265
|
-
* @see https://
|
|
285
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getNetwork
|
|
266
286
|
* @example
|
|
267
287
|
* server.getNetwork().then((network) => {
|
|
268
288
|
* console.log("friendbotUrl:", network.friendbotUrl);
|
|
@@ -278,7 +298,7 @@ export declare class Server {
|
|
|
278
298
|
* @returns {Promise<Api.GetLatestLedgerResponse>} metadata about the
|
|
279
299
|
* latest ledger on the network that this RPC server is connected to
|
|
280
300
|
*
|
|
281
|
-
* @see https://
|
|
301
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLatestLedger
|
|
282
302
|
* @example
|
|
283
303
|
* server.getLatestLedger().then((response) => {
|
|
284
304
|
* console.log("hash:", response.id);
|
|
@@ -302,7 +322,7 @@ export declare class Server {
|
|
|
302
322
|
* the transaction
|
|
303
323
|
*
|
|
304
324
|
* @see https://developers.stellar.org/docs/glossary/transactions/
|
|
305
|
-
* @see https://
|
|
325
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction
|
|
306
326
|
* @see Server.prepareTransaction
|
|
307
327
|
* @see assembleTransaction
|
|
308
328
|
*
|
|
@@ -366,7 +386,7 @@ export declare class Server {
|
|
|
366
386
|
* fees discovered from the simulation.
|
|
367
387
|
*
|
|
368
388
|
* @see assembleTransaction
|
|
369
|
-
* @see https://
|
|
389
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction
|
|
370
390
|
* @throws {jsonrpc.Error<any>|Error|Api.SimulateTransactionErrorResponse}
|
|
371
391
|
* if simulation fails
|
|
372
392
|
* @example
|
|
@@ -414,7 +434,7 @@ export declare class Server {
|
|
|
414
434
|
* transaction id, status, and any error if available
|
|
415
435
|
*
|
|
416
436
|
* @see https://developers.stellar.org/docs/glossary/transactions/
|
|
417
|
-
* @see https://
|
|
437
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/sendTransaction
|
|
418
438
|
* @example
|
|
419
439
|
* const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
|
|
420
440
|
* const contract = new StellarSdk.Contract(contractId);
|
|
@@ -481,7 +501,14 @@ export declare class Server {
|
|
|
481
501
|
* contract operations.
|
|
482
502
|
*
|
|
483
503
|
* @returns {Promise<Api.GetFeeStatsResponse>} the fee stats
|
|
484
|
-
* @see https://
|
|
504
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getFeeStats
|
|
485
505
|
*/
|
|
486
506
|
getFeeStats(): Promise<Api.GetFeeStatsResponse>;
|
|
507
|
+
/**
|
|
508
|
+
* Provides information about the current version details of the Soroban RPC and captive-core
|
|
509
|
+
*
|
|
510
|
+
* @returns {Promise<Api.GetVersionInfoResponse>} the version info
|
|
511
|
+
* @see https://developers.stellar.org/docs/data/rpc/api-reference/methods/getVersionInfo
|
|
512
|
+
*/
|
|
513
|
+
getVersionInfo(): Promise<Api.GetVersionInfoResponse>;
|
|
487
514
|
}
|