@stellar/stellar-sdk 14.1.0 → 14.2.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +14 -20
  3. package/dist/stellar-sdk-minimal.js +449 -334
  4. package/dist/stellar-sdk-minimal.min.js +1 -1
  5. package/dist/stellar-sdk-no-axios.js +449 -334
  6. package/dist/stellar-sdk-no-axios.min.js +1 -1
  7. package/dist/stellar-sdk-no-eventsource.js +698 -510
  8. package/dist/stellar-sdk-no-eventsource.min.js +1 -1
  9. package/dist/stellar-sdk.js +698 -510
  10. package/dist/stellar-sdk.min.js +1 -1
  11. package/lib/contract/client.js +2 -2
  12. package/lib/contract/utils.js +7 -7
  13. package/lib/federation/index.d.ts +2 -2
  14. package/lib/horizon/call_builder.js +1 -1
  15. package/lib/horizon/horizon_api.js +0 -1
  16. package/lib/horizon/horizon_axios_client.js +4 -4
  17. package/lib/horizon/index.d.ts +1 -1
  18. package/lib/horizon/types/effects.d.ts +41 -41
  19. package/lib/horizon/types/trade.d.ts +1 -1
  20. package/lib/http-client/fetch-client.d.ts +2 -2
  21. package/lib/http-client/fetch-client.js +16 -16
  22. package/lib/http-client/index.js +2 -2
  23. package/lib/http-client/types.d.ts +2 -2
  24. package/lib/index.d.ts +11 -11
  25. package/lib/index.js +2 -2
  26. package/lib/minimal/contract/client.js +2 -2
  27. package/lib/minimal/contract/utils.js +7 -7
  28. package/lib/minimal/federation/index.d.ts +2 -2
  29. package/lib/minimal/horizon/call_builder.js +1 -1
  30. package/lib/minimal/horizon/horizon_api.js +0 -1
  31. package/lib/minimal/horizon/horizon_axios_client.js +4 -4
  32. package/lib/minimal/horizon/index.d.ts +1 -1
  33. package/lib/minimal/horizon/types/effects.d.ts +41 -41
  34. package/lib/minimal/horizon/types/trade.d.ts +1 -1
  35. package/lib/minimal/http-client/fetch-client.d.ts +2 -2
  36. package/lib/minimal/http-client/fetch-client.js +16 -16
  37. package/lib/minimal/http-client/index.js +2 -2
  38. package/lib/minimal/http-client/types.d.ts +2 -2
  39. package/lib/minimal/index.d.ts +11 -11
  40. package/lib/minimal/index.js +2 -2
  41. package/lib/minimal/rpc/api.d.ts +18 -9
  42. package/lib/minimal/rpc/api.js +3 -3
  43. package/lib/minimal/rpc/axios.js +3 -3
  44. package/lib/minimal/rpc/browser.d.ts +2 -2
  45. package/lib/minimal/rpc/index.d.ts +1 -1
  46. package/lib/minimal/rpc/parsers.d.ts +2 -2
  47. package/lib/minimal/rpc/parsers.js +19 -19
  48. package/lib/minimal/rpc/server.d.ts +72 -11
  49. package/lib/minimal/rpc/server.js +383 -267
  50. package/lib/minimal/rpc/transaction.d.ts +2 -2
  51. package/lib/minimal/rpc/transaction.js +6 -6
  52. package/lib/minimal/webauth/index.d.ts +2 -2
  53. package/lib/no-axios/contract/client.js +2 -2
  54. package/lib/no-axios/contract/utils.js +7 -7
  55. package/lib/no-axios/federation/index.d.ts +2 -2
  56. package/lib/no-axios/horizon/call_builder.js +1 -1
  57. package/lib/no-axios/horizon/horizon_api.js +0 -1
  58. package/lib/no-axios/horizon/horizon_axios_client.js +4 -4
  59. package/lib/no-axios/horizon/index.d.ts +1 -1
  60. package/lib/no-axios/horizon/types/effects.d.ts +41 -41
  61. package/lib/no-axios/horizon/types/trade.d.ts +1 -1
  62. package/lib/no-axios/http-client/fetch-client.d.ts +2 -2
  63. package/lib/no-axios/http-client/fetch-client.js +16 -16
  64. package/lib/no-axios/http-client/index.js +2 -2
  65. package/lib/no-axios/http-client/types.d.ts +2 -2
  66. package/lib/no-axios/index.d.ts +11 -11
  67. package/lib/no-axios/index.js +2 -2
  68. package/lib/no-axios/rpc/api.d.ts +18 -9
  69. package/lib/no-axios/rpc/api.js +3 -3
  70. package/lib/no-axios/rpc/axios.js +3 -3
  71. package/lib/no-axios/rpc/browser.d.ts +2 -2
  72. package/lib/no-axios/rpc/index.d.ts +1 -1
  73. package/lib/no-axios/rpc/parsers.d.ts +2 -2
  74. package/lib/no-axios/rpc/parsers.js +19 -19
  75. package/lib/no-axios/rpc/server.d.ts +72 -11
  76. package/lib/no-axios/rpc/server.js +383 -267
  77. package/lib/no-axios/rpc/transaction.d.ts +2 -2
  78. package/lib/no-axios/rpc/transaction.js +6 -6
  79. package/lib/no-axios/webauth/index.d.ts +2 -2
  80. package/lib/no-eventsource/contract/client.js +2 -2
  81. package/lib/no-eventsource/contract/utils.js +7 -7
  82. package/lib/no-eventsource/federation/index.d.ts +2 -2
  83. package/lib/no-eventsource/horizon/call_builder.js +1 -1
  84. package/lib/no-eventsource/horizon/horizon_api.js +0 -1
  85. package/lib/no-eventsource/horizon/horizon_axios_client.js +4 -4
  86. package/lib/no-eventsource/horizon/index.d.ts +1 -1
  87. package/lib/no-eventsource/horizon/types/effects.d.ts +41 -41
  88. package/lib/no-eventsource/horizon/types/trade.d.ts +1 -1
  89. package/lib/no-eventsource/http-client/fetch-client.d.ts +2 -2
  90. package/lib/no-eventsource/http-client/fetch-client.js +16 -16
  91. package/lib/no-eventsource/http-client/index.js +2 -2
  92. package/lib/no-eventsource/http-client/types.d.ts +2 -2
  93. package/lib/no-eventsource/index.d.ts +11 -11
  94. package/lib/no-eventsource/index.js +2 -2
  95. package/lib/no-eventsource/rpc/api.d.ts +18 -9
  96. package/lib/no-eventsource/rpc/api.js +3 -3
  97. package/lib/no-eventsource/rpc/axios.js +3 -3
  98. package/lib/no-eventsource/rpc/browser.d.ts +2 -2
  99. package/lib/no-eventsource/rpc/index.d.ts +1 -1
  100. package/lib/no-eventsource/rpc/parsers.d.ts +2 -2
  101. package/lib/no-eventsource/rpc/parsers.js +19 -19
  102. package/lib/no-eventsource/rpc/server.d.ts +72 -11
  103. package/lib/no-eventsource/rpc/server.js +383 -267
  104. package/lib/no-eventsource/rpc/transaction.d.ts +2 -2
  105. package/lib/no-eventsource/rpc/transaction.js +6 -6
  106. package/lib/no-eventsource/webauth/index.d.ts +2 -2
  107. package/lib/rpc/api.d.ts +18 -9
  108. package/lib/rpc/api.js +3 -3
  109. package/lib/rpc/axios.js +3 -3
  110. package/lib/rpc/browser.d.ts +2 -2
  111. package/lib/rpc/index.d.ts +1 -1
  112. package/lib/rpc/parsers.d.ts +2 -2
  113. package/lib/rpc/parsers.js +19 -19
  114. package/lib/rpc/server.d.ts +72 -11
  115. package/lib/rpc/server.js +383 -267
  116. package/lib/rpc/transaction.d.ts +2 -2
  117. package/lib/rpc/transaction.js +6 -6
  118. package/lib/webauth/index.d.ts +2 -2
  119. package/package.json +17 -9
@@ -71,9 +71,9 @@ Object.keys(_stellarBase).forEach(function (key) {
71
71
  });
72
72
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
73
73
  var _default = exports.default = module.exports;
74
- if (typeof global.__USE_AXIOS__ === 'undefined') {
74
+ if (typeof global.__USE_AXIOS__ === "undefined") {
75
75
  global.__USE_AXIOS__ = true;
76
76
  }
77
- if (typeof global.__USE_EVENTSOURCE__ === 'undefined') {
77
+ if (typeof global.__USE_EVENTSOURCE__ === "undefined") {
78
78
  global.__USE_EVENTSOURCE__ = false;
79
79
  }
@@ -1,7 +1,7 @@
1
- import { Contract, SorobanDataBuilder, xdr } from '@stellar/stellar-base';
1
+ import { Contract, SorobanDataBuilder, xdr } from "@stellar/stellar-base";
2
2
  export declare namespace Api {
3
3
  export interface GetHealthResponse {
4
- status: 'healthy';
4
+ status: "healthy";
5
5
  }
6
6
  export interface LedgerEntryResult {
7
7
  lastModifiedLedgerSeq?: number;
@@ -103,11 +103,19 @@ export declare namespace Api {
103
103
  diagnosticEventsXdr?: string[];
104
104
  events?: RawTransactionEvents;
105
105
  }
106
- export interface GetTransactionsRequest {
106
+ export type GetTransactionsRequest = {
107
107
  startLedger: number;
108
- cursor?: string;
109
- limit?: number;
110
- }
108
+ pagination?: {
109
+ cursor?: never;
110
+ limit?: number;
111
+ };
112
+ } | {
113
+ startLedger?: never;
114
+ pagination: {
115
+ cursor: string;
116
+ limit?: number;
117
+ };
118
+ };
111
119
  export interface RawTransactionEvents {
112
120
  transactionEventsXdr?: string[];
113
121
  contractEventsXdr?: string[][];
@@ -159,7 +167,7 @@ export declare namespace Api {
159
167
  oldestLedgerCloseTimestamp: number;
160
168
  cursor: string;
161
169
  }
162
- export type EventType = 'contract' | 'system';
170
+ export type EventType = "contract" | "system";
163
171
  export interface EventFilter {
164
172
  type?: EventType;
165
173
  contractIds?: string[];
@@ -189,7 +197,8 @@ export declare namespace Api {
189
197
  type: EventType;
190
198
  ledger: number;
191
199
  ledgerClosedAt: string;
192
- pagingToken: string;
200
+ transactionIndex: number;
201
+ operationIndex: number;
193
202
  inSuccessfulContractCall: boolean;
194
203
  txHash: string;
195
204
  }
@@ -213,7 +222,7 @@ export declare namespace Api {
213
222
  before: xdr.LedgerEntry | null;
214
223
  after: xdr.LedgerEntry | null;
215
224
  }
216
- export type SendTransactionStatus = 'PENDING' | 'DUPLICATE' | 'TRY_AGAIN_LATER' | 'ERROR';
225
+ export type SendTransactionStatus = "PENDING" | "DUPLICATE" | "TRY_AGAIN_LATER" | "ERROR";
217
226
  export interface SendTransactionResponse extends BaseSendTransactionResponse {
218
227
  errorResult?: xdr.TransactionResult;
219
228
  diagnosticEvents?: xdr.DiagnosticEvent[];
@@ -14,15 +14,15 @@ var Api;
14
14
  }({});
15
15
  _Api.GetTransactionStatus = GetTransactionStatus;
16
16
  function isSimulationError(sim) {
17
- return 'error' in sim;
17
+ return "error" in sim;
18
18
  }
19
19
  _Api.isSimulationError = isSimulationError;
20
20
  function isSimulationSuccess(sim) {
21
- return 'transactionData' in sim;
21
+ return "transactionData" in sim;
22
22
  }
23
23
  _Api.isSimulationSuccess = isSimulationSuccess;
24
24
  function isSimulationRestore(sim) {
25
- return isSimulationSuccess(sim) && 'restorePreamble' in sim && !!sim.restorePreamble.transactionData;
25
+ return isSimulationSuccess(sim) && "restorePreamble" in sim && !!sim.restorePreamble.transactionData;
26
26
  }
27
27
  _Api.isSimulationRestore = isSimulationRestore;
28
28
  function isSimulationRaw(sim) {
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.default = exports.AxiosClient = void 0;
7
7
  var _httpClient = require("../http-client");
8
- var version = exports.version = "14.1.0";
8
+ var version = exports.version = "14.2.0";
9
9
  var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
10
10
  headers: {
11
- 'X-Client-Name': 'js-soroban-client',
12
- 'X-Client-Version': version
11
+ "X-Client-Name": "js-soroban-client",
12
+ "X-Client-Version": version
13
13
  }
14
14
  });
15
15
  var _default = exports.default = AxiosClient;
@@ -1,4 +1,4 @@
1
- export * from './index';
2
- export * as StellarBase from '@stellar/stellar-base';
1
+ export * from "./index";
2
+ export * as StellarBase from "@stellar/stellar-base";
3
3
  declare const _default: any;
4
4
  export default _default;
@@ -1,6 +1,6 @@
1
1
  /** @module rpc */
2
2
  export * from "./api";
3
- export { RpcServer as Server, BasicSleepStrategy, LinearSleepStrategy, Durability } from "./server";
3
+ export { RpcServer as Server, BasicSleepStrategy, LinearSleepStrategy, Durability, } from "./server";
4
4
  export { default as AxiosClient } from "./axios";
5
5
  export { parseRawSimulation, parseRawEvents } from "./parsers";
6
6
  export * from "./transaction";
@@ -1,4 +1,4 @@
1
- import { Api } from './api';
1
+ import { Api } from "./api";
2
2
  /**
3
3
  * Parse the response from invoking the `submitTransaction` method of a RPC server.
4
4
  * @memberof module:rpc
@@ -8,7 +8,7 @@ import { Api } from './api';
8
8
  * @returns {Api.SendTransactionResponse} transaction response parsed from the RPC server's response
9
9
  */
10
10
  export declare function parseRawSendTransaction(raw: Api.RawSendTransactionResponse): Api.SendTransactionResponse;
11
- export declare function parseTransactionInfo(raw: Api.RawTransactionInfo | Api.RawGetTransactionResponse): Omit<Api.TransactionInfo, 'status' | 'txHash'>;
11
+ export declare function parseTransactionInfo(raw: Api.RawTransactionInfo | Api.RawGetTransactionResponse): Omit<Api.TransactionInfo, "status" | "txHash">;
12
12
  export declare function parseRawTransactions(r: Api.RawTransactionInfo): Api.TransactionInfo;
13
13
  /**
14
14
  * Parse and return the retrieved events, if any, from a raw response from a
@@ -25,24 +25,24 @@ function parseRawSendTransaction(raw) {
25
25
  if (errorResultXdr) {
26
26
  return _objectSpread(_objectSpread(_objectSpread({}, raw), diagnosticEventsXdr !== undefined && diagnosticEventsXdr.length > 0 && {
27
27
  diagnosticEvents: diagnosticEventsXdr.map(function (evt) {
28
- return _stellarBase.xdr.DiagnosticEvent.fromXDR(evt, 'base64');
28
+ return _stellarBase.xdr.DiagnosticEvent.fromXDR(evt, "base64");
29
29
  })
30
30
  }), {}, {
31
- errorResult: _stellarBase.xdr.TransactionResult.fromXDR(errorResultXdr, 'base64')
31
+ errorResult: _stellarBase.xdr.TransactionResult.fromXDR(errorResultXdr, "base64")
32
32
  });
33
33
  }
34
34
  return _objectSpread({}, raw);
35
35
  }
36
36
  function parseTransactionInfo(raw) {
37
37
  var _raw$events$contractE, _raw$events, _raw$events$transacti, _raw$events2;
38
- var meta = _stellarBase.xdr.TransactionMeta.fromXDR(raw.resultMetaXdr, 'base64');
38
+ var meta = _stellarBase.xdr.TransactionMeta.fromXDR(raw.resultMetaXdr, "base64");
39
39
  var info = {
40
40
  ledger: raw.ledger,
41
41
  createdAt: raw.createdAt,
42
42
  applicationOrder: raw.applicationOrder,
43
43
  feeBump: raw.feeBump,
44
- envelopeXdr: _stellarBase.xdr.TransactionEnvelope.fromXDR(raw.envelopeXdr, 'base64'),
45
- resultXdr: _stellarBase.xdr.TransactionResult.fromXDR(raw.resultXdr, 'base64'),
44
+ envelopeXdr: _stellarBase.xdr.TransactionEnvelope.fromXDR(raw.envelopeXdr, "base64"),
45
+ resultXdr: _stellarBase.xdr.TransactionResult.fromXDR(raw.resultXdr, "base64"),
46
46
  resultMetaXdr: meta,
47
47
  events: {
48
48
  contractEventsXdr: ((_raw$events$contractE = (_raw$events = raw.events) === null || _raw$events === void 0 ? void 0 : _raw$events.contractEventsXdr) !== null && _raw$events$contractE !== void 0 ? _raw$events$contractE : []).map(function (lst) {
@@ -66,7 +66,7 @@ function parseTransactionInfo(raw) {
66
66
  }
67
67
  if (raw.diagnosticEventsXdr) {
68
68
  info.diagnosticEventsXdr = raw.diagnosticEventsXdr.map(function (e) {
69
- return _stellarBase.xdr.DiagnosticEvent.fromXDR(e, 'base64');
69
+ return _stellarBase.xdr.DiagnosticEvent.fromXDR(e, "base64");
70
70
  });
71
71
  }
72
72
  return info;
@@ -88,13 +88,13 @@ function parseRawEvents(raw) {
88
88
  events: ((_raw$events3 = raw.events) !== null && _raw$events3 !== void 0 ? _raw$events3 : []).map(function (evt) {
89
89
  var clone = _objectSpread({}, evt);
90
90
  delete clone.contractId;
91
- return _objectSpread(_objectSpread(_objectSpread({}, clone), evt.contractId !== '' && {
91
+ return _objectSpread(_objectSpread(_objectSpread({}, clone), evt.contractId !== "" && {
92
92
  contractId: new _stellarBase.Contract(evt.contractId)
93
93
  }), {}, {
94
94
  topic: evt.topic.map(function (topic) {
95
- return _stellarBase.xdr.ScVal.fromXDR(topic, 'base64');
95
+ return _stellarBase.xdr.ScVal.fromXDR(topic, "base64");
96
96
  }),
97
- value: _stellarBase.xdr.ScVal.fromXDR(evt.value, 'base64')
97
+ value: _stellarBase.xdr.ScVal.fromXDR(evt.value, "base64")
98
98
  });
99
99
  })
100
100
  };
@@ -109,8 +109,8 @@ function parseRawLedgerEntries(raw) {
109
109
  }
110
110
  return _objectSpread({
111
111
  lastModifiedLedgerSeq: rawEntry.lastModifiedLedgerSeq,
112
- key: _stellarBase.xdr.LedgerKey.fromXDR(rawEntry.key, 'base64'),
113
- val: _stellarBase.xdr.LedgerEntryData.fromXDR(rawEntry.xdr, 'base64')
112
+ key: _stellarBase.xdr.LedgerKey.fromXDR(rawEntry.key, "base64"),
113
+ val: _stellarBase.xdr.LedgerEntryData.fromXDR(rawEntry.xdr, "base64")
114
114
  }, rawEntry.liveUntilLedgerSeq !== undefined && {
115
115
  liveUntilLedgerSeq: rawEntry.liveUntilLedgerSeq
116
116
  });
@@ -127,22 +127,22 @@ function parseSuccessful(sim, partial) {
127
127
  var _row$auth;
128
128
  return {
129
129
  auth: ((_row$auth = row.auth) !== null && _row$auth !== void 0 ? _row$auth : []).map(function (entry) {
130
- return _stellarBase.xdr.SorobanAuthorizationEntry.fromXDR(entry, 'base64');
130
+ return _stellarBase.xdr.SorobanAuthorizationEntry.fromXDR(entry, "base64");
131
131
  }),
132
- retval: row.xdr ? _stellarBase.xdr.ScVal.fromXDR(row.xdr, 'base64') : _stellarBase.xdr.ScVal.scvVoid()
132
+ retval: row.xdr ? _stellarBase.xdr.ScVal.fromXDR(row.xdr, "base64") : _stellarBase.xdr.ScVal.scvVoid()
133
133
  };
134
134
  })[0]
135
135
  }), ((_sim$stateChanges$len = (_sim$stateChanges = sim.stateChanges) === null || _sim$stateChanges === void 0 ? void 0 : _sim$stateChanges.length) !== null && _sim$stateChanges$len !== void 0 ? _sim$stateChanges$len : 0 > 0) && {
136
136
  stateChanges: (_sim$stateChanges2 = sim.stateChanges) === null || _sim$stateChanges2 === void 0 ? void 0 : _sim$stateChanges2.map(function (entryChange) {
137
137
  return {
138
138
  type: entryChange.type,
139
- key: _stellarBase.xdr.LedgerKey.fromXDR(entryChange.key, 'base64'),
140
- before: entryChange.before ? _stellarBase.xdr.LedgerEntry.fromXDR(entryChange.before, 'base64') : null,
141
- after: entryChange.after ? _stellarBase.xdr.LedgerEntry.fromXDR(entryChange.after, 'base64') : null
139
+ key: _stellarBase.xdr.LedgerKey.fromXDR(entryChange.key, "base64"),
140
+ before: entryChange.before ? _stellarBase.xdr.LedgerEntry.fromXDR(entryChange.before, "base64") : null,
141
+ after: entryChange.after ? _stellarBase.xdr.LedgerEntry.fromXDR(entryChange.after, "base64") : null
142
142
  };
143
143
  })
144
144
  });
145
- if (!sim.restorePreamble || sim.restorePreamble.transactionData === '') {
145
+ if (!sim.restorePreamble || sim.restorePreamble.transactionData === "") {
146
146
  return success;
147
147
  }
148
148
  return _objectSpread(_objectSpread({}, success), {}, {
@@ -163,10 +163,10 @@ function parseRawSimulation(sim) {
163
163
  id: sim.id,
164
164
  latestLedger: sim.latestLedger,
165
165
  events: (_sim$events$map = (_sim$events = sim.events) === null || _sim$events === void 0 ? void 0 : _sim$events.map(function (evt) {
166
- return _stellarBase.xdr.DiagnosticEvent.fromXDR(evt, 'base64');
166
+ return _stellarBase.xdr.DiagnosticEvent.fromXDR(evt, "base64");
167
167
  })) !== null && _sim$events$map !== void 0 ? _sim$events$map : []
168
168
  };
169
- if (typeof sim.error === 'string') {
169
+ if (typeof sim.error === "string") {
170
170
  return _objectSpread(_objectSpread({}, base), {}, {
171
171
  error: sim.error
172
172
  });
@@ -1,6 +1,6 @@
1
- import URI from 'urijs';
2
- import { Account, Address, Asset, Contract, FeeBumpTransaction, Transaction, xdr } from '@stellar/stellar-base';
3
- import { Api } from './api';
1
+ import URI from "urijs";
2
+ import { Account, Address, Asset, Contract, FeeBumpTransaction, Transaction, xdr } from "@stellar/stellar-base";
3
+ import { Api } from "./api";
4
4
  /**
5
5
  * Default transaction submission timeout for RPC requests, in milliseconds
6
6
  * @constant {number}
@@ -106,6 +106,66 @@ export declare class RpcServer {
106
106
  * });
107
107
  */
108
108
  getAccount(address: string): Promise<Account>;
109
+ /**
110
+ * Fetch the full account entry for a Stellar account.
111
+ *
112
+ * @param {string} address The public address of the account to load.
113
+ * @returns {Promise<xdr.AccountEntry>} Resolves to the full on-chain account
114
+ * entry
115
+ *
116
+ * @see
117
+ * {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
118
+ *
119
+ * @example
120
+ * const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";
121
+ * server.getAccountEntry(accountId).then((account) => {
122
+ * console.log("sequence:", account.balance().toString());
123
+ * });
124
+ */
125
+ getAccountEntry(address: string): Promise<xdr.AccountEntry>;
126
+ /**
127
+ * Fetch the full trustline entry for a Stellar account.
128
+ *
129
+ * @param {string} account The public address of the account whose trustline it is
130
+ * @param {string} asset The trustline's asset
131
+ * @returns {Promise<xdr.TrustLineEntry>} Resolves to the full on-chain trustline
132
+ * entry
133
+ *
134
+ * @see
135
+ * {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
136
+ *
137
+ * @example
138
+ * const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";
139
+ * const asset = new Asset(
140
+ * "USDC",
141
+ * "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
142
+ * );
143
+ * server.getTrustline(accountId, asset).then((entry) => {
144
+ * console.log(`{asset.toString()} balance for ${accountId}:", entry.balance().toString());
145
+ * });
146
+ */
147
+ getTrustline(account: string, asset: Asset): Promise<xdr.TrustLineEntry>;
148
+ /**
149
+ * Fetch the full claimable balance entry for a Stellar account.
150
+ *
151
+ * @param {string} id The strkey (`B...`) or hex (`00000000abcde...`) (both
152
+ * IDs with and without the 000... version prefix are accepted) of the
153
+ * claimable balance to load
154
+ * @returns {Promise<xdr.ClaimableBalanceEntry>} Resolves to the full on-chain
155
+ * claimable balance entry
156
+ *
157
+ * @see
158
+ * {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
159
+ *
160
+ * @example
161
+ * const id = "00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9";
162
+ * server.getClaimableBalance(id).then((entry) => {
163
+ * console.log(`Claimable balance {id.substr(0, 12)} has:`);
164
+ * console.log(` asset: ${Asset.fromXDRObject(entry.asset()).toString()}`;
165
+ * console.log(` amount: ${entry.amount().toString()}`;
166
+ * });
167
+ */
168
+ getClaimableBalance(id: string): Promise<xdr.ClaimableBalanceEntry>;
109
169
  /**
110
170
  * General node health check.
111
171
  *
@@ -231,6 +291,7 @@ export declare class RpcServer {
231
291
  */
232
292
  getLedgerEntries(...keys: xdr.LedgerKey[]): Promise<Api.GetLedgerEntriesResponse>;
233
293
  _getLedgerEntries(...keys: xdr.LedgerKey[]): Promise<Api.RawGetLedgerEntriesResponse>;
294
+ getLedgerEntry(key: xdr.LedgerKey): Promise<Api.LedgerEntryResult>;
234
295
  /**
235
296
  * Poll for a particular transaction with certain parameters.
236
297
  *
@@ -575,7 +636,7 @@ export declare class RpcServer {
575
636
  * console.error("error:", error);
576
637
  * });
577
638
  */
578
- requestAirdrop(address: string | Pick<Account, 'accountId'>, friendbotUrl?: string): Promise<Account>;
639
+ requestAirdrop(address: string | Pick<Account, "accountId">, friendbotUrl?: string): Promise<Account>;
579
640
  /**
580
641
  * Provides an analysis of the recent fee stats for regular and smart
581
642
  * contract operations.
@@ -596,8 +657,8 @@ export declare class RpcServer {
596
657
  *
597
658
  * This is a convenience wrapper around {@link Server.getLedgerEntries}.
598
659
  *
599
- * @param {string} contractId the contract ID (string `C...`) whose
600
- * balance of `sac` you want to know
660
+ * @param {string} address the contract (string `C...`) or account ID
661
+ * (`G...`) whose balance of `sac` you want to know
601
662
  * @param {Asset} sac the built-in SAC token (e.g. `USDC:GABC...`) that
602
663
  * you are querying from the given `contract`.
603
664
  * @param {string} [networkPassphrase] optionally, the network passphrase to
@@ -610,16 +671,16 @@ export declare class RpcServer {
610
671
  * entry details if and only if the request returned a valid balance ledger
611
672
  * entry. If it doesn't, the `balanceEntry` field will not exist.
612
673
  *
613
- * @throws {TypeError} If `contractId` is not a valid contract strkey (C...).
674
+ * @throws {TypeError} If `address` is not a valid contract ID (C...).
614
675
  *
615
676
  * @see getLedgerEntries
616
677
  * @see https://developers.stellar.org/docs/tokens/stellar-asset-contract
617
678
  *
618
679
  * @example
619
- * // assume `contractId` is some contract with an XLM balance
680
+ * // assume `address` is some contract or account with an XLM balance
620
681
  * // assume server is an instantiated `Server` instance.
621
682
  * const entry = (await server.getSACBalance(
622
- * new Address(contractId),
683
+ * new Address(address),
623
684
  * Asset.native(),
624
685
  * Networks.PUBLIC
625
686
  * ));
@@ -628,7 +689,7 @@ export declare class RpcServer {
628
689
  * console.log(
629
690
  * entry.balanceEntry ?
630
691
  * BigInt(entry.balanceEntry.amount) :
631
- * "Contract has no XLM");
692
+ * "Address has no XLM");
632
693
  */
633
- getSACBalance(contractId: string, sac: Asset, networkPassphrase?: string): Promise<Api.BalanceResponse>;
694
+ getSACBalance(address: string | Address, sac: Asset, networkPassphrase?: string): Promise<Api.BalanceResponse>;
634
695
  }