@stellar/stellar-sdk 14.1.1 → 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 +10 -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 +16 -8
  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 +16 -8
  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 +16 -8
  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 +16 -8
  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
@@ -1,5 +1,5 @@
1
- import { FeeBumpTransaction, Transaction, TransactionBuilder } from '@stellar/stellar-base';
2
- import { Api } from './api';
1
+ import { FeeBumpTransaction, Transaction, TransactionBuilder } from "@stellar/stellar-base";
2
+ import { Api } from "./api";
3
3
  /**
4
4
  * Combines the given raw transaction alongside the simulation results.
5
5
  * If the given transaction already has authorization entries in a host
@@ -12,20 +12,20 @@ function isSorobanTransaction(tx) {
12
12
  return false;
13
13
  }
14
14
  switch (tx.operations[0].type) {
15
- case 'invokeHostFunction':
16
- case 'extendFootprintTtl':
17
- case 'restoreFootprint':
15
+ case "invokeHostFunction":
16
+ case "extendFootprintTtl":
17
+ case "restoreFootprint":
18
18
  return true;
19
19
  default:
20
20
  return false;
21
21
  }
22
22
  }
23
23
  function assembleTransaction(raw, simulation) {
24
- if ('innerTransaction' in raw) {
24
+ if ("innerTransaction" in raw) {
25
25
  return assembleTransaction(raw.innerTransaction, simulation);
26
26
  }
27
27
  if (!isSorobanTransaction(raw)) {
28
- throw new TypeError('unsupported transaction: must contain exactly one ' + 'invokeHostFunction, extendFootprintTtl, or restoreFootprint ' + 'operation');
28
+ throw new TypeError("unsupported transaction: must contain exactly one " + "invokeHostFunction, extendFootprintTtl, or restoreFootprint " + "operation");
29
29
  }
30
30
  var success = (0, _parsers.parseRawSimulation)(simulation);
31
31
  if (!_api.Api.isSimulationSuccess(success)) {
@@ -38,7 +38,7 @@ function assembleTransaction(raw, simulation) {
38
38
  sorobanData: success.transactionData.build(),
39
39
  networkPassphrase: raw.networkPassphrase
40
40
  });
41
- if (raw.operations[0].type === 'invokeHostFunction') {
41
+ if (raw.operations[0].type === "invokeHostFunction") {
42
42
  var _invokeOp$auth;
43
43
  txnBuilder.clearOperations();
44
44
  var invokeOp = raw.operations[0];
@@ -1,2 +1,2 @@
1
- export * from './utils';
2
- export { InvalidChallengeError } from './errors';
1
+ export * from "./utils";
2
+ export { InvalidChallengeError } from "./errors";
@@ -167,7 +167,7 @@ var Client = exports.Client = function () {
167
167
  _context2.n = 1;
168
168
  break;
169
169
  }
170
- throw new TypeError('options must contain rpcUrl');
170
+ throw new TypeError("options must contain rpcUrl");
171
171
  case 1:
172
172
  rpcUrl = options.rpcUrl, allowHttp = options.allowHttp;
173
173
  serverOpts = {
@@ -220,7 +220,7 @@ var Client = exports.Client = function () {
220
220
  _context4.n = 1;
221
221
  break;
222
222
  }
223
- throw new TypeError('options must contain rpcUrl and contractId');
223
+ throw new TypeError("options must contain rpcUrl and contractId");
224
224
  case 1:
225
225
  rpcUrl = options.rpcUrl, contractId = options.contractId, allowHttp = options.allowHttp;
226
226
  serverOpts = {
@@ -122,7 +122,7 @@ function _specFromWasm() {
122
122
  _context2.p = 2;
123
123
  _t3 = _context2.v;
124
124
  customData = parseWasmCustomSections(wasm);
125
- xdrSections = customData.get('contractspecv0');
125
+ xdrSections = customData.get("contractspecv0");
126
126
  case 3:
127
127
  if (!(!xdrSections || xdrSections.length === 0)) {
128
128
  _context2.n = 4;
@@ -141,13 +141,13 @@ function parseWasmCustomSections(buffer) {
141
141
  var arrayBuffer = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
142
142
  var offset = 0;
143
143
  var read = function read(length) {
144
- if (offset + length > buffer.byteLength) throw new Error('Buffer overflow');
144
+ if (offset + length > buffer.byteLength) throw new Error("Buffer overflow");
145
145
  var bytes = new Uint8Array(arrayBuffer, offset, length);
146
146
  offset += length;
147
147
  return bytes;
148
148
  };
149
- if (_toConsumableArray(read(4)).join() !== '0,97,115,109') throw new Error('Invalid WASM magic');
150
- if (_toConsumableArray(read(4)).join() !== '1,0,0,0') throw new Error('Invalid WASM version');
149
+ if (_toConsumableArray(read(4)).join() !== "0,97,115,109") throw new Error("Invalid WASM magic");
150
+ if (_toConsumableArray(read(4)).join() !== "1,0,0,0") throw new Error("Invalid WASM version");
151
151
  while (offset < buffer.byteLength) {
152
152
  var sectionId = read(1)[0];
153
153
  var sectionLength = readVarUint32();
@@ -158,7 +158,7 @@ function parseWasmCustomSections(buffer) {
158
158
  var nameBytes = read(nameLen);
159
159
  var payload = read(sectionLength - (offset - start));
160
160
  try {
161
- var name = new TextDecoder('utf-8', {
161
+ var name = new TextDecoder("utf-8", {
162
162
  fatal: true
163
163
  }).decode(nameBytes);
164
164
  if (payload.length > 0) {
@@ -174,9 +174,9 @@ function parseWasmCustomSections(buffer) {
174
174
  shift = 0;
175
175
  while (true) {
176
176
  var byte = read(1)[0];
177
- value |= (byte & 0x7F) << shift;
177
+ value |= (byte & 0x7f) << shift;
178
178
  if ((byte & 0x80) === 0) break;
179
- if ((shift += 7) >= 32) throw new Error('Invalid WASM value');
179
+ if ((shift += 7) >= 32) throw new Error("Invalid WASM value");
180
180
  }
181
181
  return value >>> 0;
182
182
  }
@@ -1,2 +1,2 @@
1
- export { FederationServer as Server, FEDERATION_RESPONSE_MAX_SIZE } from './server';
2
- export * from './api';
1
+ export { FederationServer as Server, FEDERATION_RESPONSE_MAX_SIZE, } from "./server";
2
+ export * from "./api";
@@ -22,7 +22,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
22
22
  var JOINABLE = ["transaction"];
23
23
  var anyGlobal = global;
24
24
  var EventSource;
25
- if (typeof false !== 'undefined' && false) {
25
+ if (typeof false !== "undefined" && false) {
26
26
  var _ref, _anyGlobal$EventSourc, _anyGlobal$window;
27
27
  EventSource = (_ref = (_anyGlobal$EventSourc = anyGlobal.EventSource) !== null && _anyGlobal$EventSourc !== void 0 ? _anyGlobal$EventSourc : (_anyGlobal$window = anyGlobal.window) === null || _anyGlobal$window === void 0 ? void 0 : _anyGlobal$window.EventSource) !== null && _ref !== void 0 ? _ref : require("eventsource");
28
28
  }
@@ -73,7 +73,6 @@ var HorizonApi;
73
73
  return OperationResponseTypeI;
74
74
  }({});
75
75
  _HorizonApi.OperationResponseTypeI = OperationResponseTypeI;
76
- ;
77
76
  var TransactionFailedResultCodes = function (TransactionFailedResultCodes) {
78
77
  TransactionFailedResultCodes["TX_FAILED"] = "tx_failed";
79
78
  TransactionFailedResultCodes["TX_BAD_SEQ"] = "tx_bad_seq";
@@ -10,7 +10,7 @@ var _urijs = _interopRequireDefault(require("urijs"));
10
10
  var _httpClient = require("../http-client");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  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); }
13
- var version = exports.version = "14.1.1";
13
+ var version = exports.version = "14.2.0";
14
14
  var SERVER_TIME_MAP = exports.SERVER_TIME_MAP = {};
15
15
  var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
16
16
  headers: {
@@ -25,13 +25,13 @@ AxiosClient.interceptors.response.use(function (response) {
25
25
  var hostname = (0, _urijs.default)(response.config.url).hostname();
26
26
  var serverTime = 0;
27
27
  if (response.headers instanceof Headers) {
28
- var dateHeader = response.headers.get('date');
28
+ var dateHeader = response.headers.get("date");
29
29
  if (dateHeader) {
30
30
  serverTime = toSeconds(Date.parse(dateHeader));
31
31
  }
32
- } else if (_typeof(response.headers) === 'object' && 'date' in response.headers) {
32
+ } else if (_typeof(response.headers) === "object" && "date" in response.headers) {
33
33
  var headers = response.headers;
34
- if (typeof headers.date === 'string') {
34
+ if (typeof headers.date === "string") {
35
35
  serverTime = toSeconds(Date.parse(headers.date));
36
36
  }
37
37
  }
@@ -3,6 +3,6 @@ export * from "./horizon_api";
3
3
  export * from "./server_api";
4
4
  export * from "./account_response";
5
5
  export { HorizonServer as Server } from "./server";
6
- export { default as AxiosClient, SERVER_TIME_MAP, getCurrentServerTime } from "./horizon_axios_client";
6
+ export { default as AxiosClient, SERVER_TIME_MAP, getCurrentServerTime, } from "./horizon_axios_client";
7
7
  declare const _default: any;
8
8
  export default _default;
@@ -63,29 +63,29 @@ export interface BaseEffectRecord<T extends string = string> extends HorizonApi.
63
63
  type: T;
64
64
  created_at: string;
65
65
  }
66
- export interface AccountCreated extends BaseEffectRecord<'account_created'> {
66
+ export interface AccountCreated extends BaseEffectRecord<"account_created"> {
67
67
  type_i: EffectType.account_created;
68
68
  starting_balance: string;
69
69
  }
70
- export interface AccountCredited extends BaseEffectRecord<'account_credited'>, OfferAsset {
70
+ export interface AccountCredited extends BaseEffectRecord<"account_credited">, OfferAsset {
71
71
  type_i: EffectType.account_credited;
72
72
  amount: string;
73
73
  }
74
- export interface AccountDebited extends BaseEffectRecord<'account_debited'>, OfferAsset {
74
+ export interface AccountDebited extends BaseEffectRecord<"account_debited">, OfferAsset {
75
75
  type_i: EffectType.account_debited;
76
76
  amount: string;
77
77
  }
78
- export interface AccountThresholdsUpdated extends BaseEffectRecord<'account_thresholds_updated'> {
78
+ export interface AccountThresholdsUpdated extends BaseEffectRecord<"account_thresholds_updated"> {
79
79
  type_i: EffectType.account_thresholds_updated;
80
80
  low_threshold: number;
81
81
  med_threshold: number;
82
82
  high_threshold: number;
83
83
  }
84
- export interface AccountHomeDomainUpdated extends BaseEffectRecord<'account_home_domain_updated'> {
84
+ export interface AccountHomeDomainUpdated extends BaseEffectRecord<"account_home_domain_updated"> {
85
85
  type_i: EffectType.account_home_domain_updated;
86
86
  home_domain: string;
87
87
  }
88
- export interface AccountFlagsUpdated extends BaseEffectRecord<'account_flags_updated'> {
88
+ export interface AccountFlagsUpdated extends BaseEffectRecord<"account_flags_updated"> {
89
89
  type_i: EffectType.account_flags_updated;
90
90
  auth_required_flag: boolean;
91
91
  auth_revokable_flag: boolean;
@@ -94,16 +94,16 @@ interface DataEvents<T extends string> extends BaseEffectRecord<T> {
94
94
  name: boolean;
95
95
  value: boolean;
96
96
  }
97
- export interface DataCreated extends DataEvents<'data_created'> {
97
+ export interface DataCreated extends DataEvents<"data_created"> {
98
98
  type_i: EffectType.data_created;
99
99
  }
100
- export interface DataUpdated extends DataEvents<'data_updated'> {
100
+ export interface DataUpdated extends DataEvents<"data_updated"> {
101
101
  type_i: EffectType.data_updated;
102
102
  }
103
- export interface DataRemoved extends DataEvents<'data_removed'> {
103
+ export interface DataRemoved extends DataEvents<"data_removed"> {
104
104
  type_i: EffectType.data_removed;
105
105
  }
106
- export interface SequenceBumped extends BaseEffectRecord<'sequence_bumped'> {
106
+ export interface SequenceBumped extends BaseEffectRecord<"sequence_bumped"> {
107
107
  type_i: EffectType.sequence_bumped;
108
108
  new_seq: number | string;
109
109
  }
@@ -112,29 +112,29 @@ interface SignerEvents<T extends string> extends BaseEffectRecord<T> {
112
112
  key: string;
113
113
  public_key: string;
114
114
  }
115
- export interface SignerCreated extends SignerEvents<'signer_created'> {
115
+ export interface SignerCreated extends SignerEvents<"signer_created"> {
116
116
  type_i: EffectType.signer_created;
117
117
  }
118
- export interface SignerRemoved extends SignerEvents<'signer_removed'> {
118
+ export interface SignerRemoved extends SignerEvents<"signer_removed"> {
119
119
  type_i: EffectType.signer_removed;
120
120
  }
121
- export interface SignerUpdated extends SignerEvents<'signer_updated'> {
121
+ export interface SignerUpdated extends SignerEvents<"signer_updated"> {
122
122
  type_i: EffectType.signer_updated;
123
123
  }
124
124
  interface TrustlineEvents<T extends string> extends BaseEffectRecord<T>, OfferAsset {
125
125
  limit: string;
126
126
  liquidity_pool_id?: string;
127
127
  }
128
- export interface TrustlineCreated extends TrustlineEvents<'trustline_created'> {
128
+ export interface TrustlineCreated extends TrustlineEvents<"trustline_created"> {
129
129
  type_i: EffectType.trustline_created;
130
130
  }
131
- export interface TrustlineRemoved extends TrustlineEvents<'trustline_removed'> {
131
+ export interface TrustlineRemoved extends TrustlineEvents<"trustline_removed"> {
132
132
  type_i: EffectType.trustline_removed;
133
133
  }
134
- export interface TrustlineUpdated extends TrustlineEvents<'trustline_updated'> {
134
+ export interface TrustlineUpdated extends TrustlineEvents<"trustline_updated"> {
135
135
  type_i: EffectType.trustline_updated;
136
136
  }
137
- export interface TrustlineAuthorized extends BaseEffectRecord<'trustline_authorized'> {
137
+ export interface TrustlineAuthorized extends BaseEffectRecord<"trustline_authorized"> {
138
138
  type_i: EffectType.trustline_authorized;
139
139
  asset_type: OfferAsset["asset_type"];
140
140
  asset_code: OfferAsset["asset_code"];
@@ -146,7 +146,7 @@ export interface TrustlineDeauthorized extends Omit<TrustlineAuthorized, "type_i
146
146
  export interface TrustlineAuthorizedToMaintainLiabilities extends Omit<TrustlineAuthorized, "type_i"> {
147
147
  type_i: EffectType.trustline_authorized_to_maintain_liabilities;
148
148
  }
149
- export interface ClaimableBalanceCreated extends BaseEffectRecord<'claimable_balance_created'> {
149
+ export interface ClaimableBalanceCreated extends BaseEffectRecord<"claimable_balance_created"> {
150
150
  type_i: EffectType.claimable_balance_created;
151
151
  amount: string;
152
152
  balance_type_i: string;
@@ -165,62 +165,62 @@ interface SponsorshipFields {
165
165
  }
166
166
  interface AccountSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsorshipFields {
167
167
  }
168
- export type AccountSponsorshipCreated = Omit<AccountSponsorshipEvents<'account_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
168
+ export type AccountSponsorshipCreated = Omit<AccountSponsorshipEvents<"account_sponsorship_created">, "new_sponsor" | "former_sponsor"> & {
169
169
  type_i: EffectType.account_sponsorship_created;
170
170
  };
171
- export type AccountSponsorshipUpdated = Omit<AccountSponsorshipEvents<'account_sponsorship_updated'>, "sponsor"> & {
171
+ export type AccountSponsorshipUpdated = Omit<AccountSponsorshipEvents<"account_sponsorship_updated">, "sponsor"> & {
172
172
  type_i: EffectType.account_sponsorship_updated;
173
173
  };
174
- export type AccountSponsorshipRemoved = Omit<AccountSponsorshipEvents<'account_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
174
+ export type AccountSponsorshipRemoved = Omit<AccountSponsorshipEvents<"account_sponsorship_removed">, "new_sponsor" | "sponsor"> & {
175
175
  type_i: EffectType.account_sponsorship_removed;
176
176
  };
177
177
  interface TrustlineSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsorshipFields {
178
178
  asset?: string;
179
179
  liquidity_pool_id?: string;
180
180
  }
181
- export type TrustlineSponsorshipCreated = Omit<TrustlineSponsorshipEvents<'trustline_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
181
+ export type TrustlineSponsorshipCreated = Omit<TrustlineSponsorshipEvents<"trustline_sponsorship_created">, "new_sponsor" | "former_sponsor"> & {
182
182
  type_i: EffectType.trustline_sponsorship_created;
183
183
  };
184
- export type TrustlineSponsorshipUpdated = Omit<TrustlineSponsorshipEvents<'trustline_sponsorship_updated'>, "sponsor"> & {
184
+ export type TrustlineSponsorshipUpdated = Omit<TrustlineSponsorshipEvents<"trustline_sponsorship_updated">, "sponsor"> & {
185
185
  type_i: EffectType.trustline_sponsorship_updated;
186
186
  };
187
- export type TrustlineSponsorshipRemoved = Omit<TrustlineSponsorshipEvents<'trustline_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
187
+ export type TrustlineSponsorshipRemoved = Omit<TrustlineSponsorshipEvents<"trustline_sponsorship_removed">, "new_sponsor" | "sponsor"> & {
188
188
  type_i: EffectType.trustline_sponsorship_removed;
189
189
  };
190
190
  interface DataSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsorshipFields {
191
191
  data_name: string;
192
192
  }
193
- export type DateSponsorshipCreated = Omit<DataSponsorshipEvents<'data_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
193
+ export type DateSponsorshipCreated = Omit<DataSponsorshipEvents<"data_sponsorship_created">, "new_sponsor" | "former_sponsor"> & {
194
194
  type_i: EffectType.data_sponsorship_created;
195
195
  };
196
- export type DateSponsorshipUpdated = Omit<DataSponsorshipEvents<'data_sponsorship_updated'>, "sponsor"> & {
196
+ export type DateSponsorshipUpdated = Omit<DataSponsorshipEvents<"data_sponsorship_updated">, "sponsor"> & {
197
197
  type_i: EffectType.data_sponsorship_updated;
198
198
  };
199
- export type DateSponsorshipRemoved = Omit<DataSponsorshipEvents<'data_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
199
+ export type DateSponsorshipRemoved = Omit<DataSponsorshipEvents<"data_sponsorship_removed">, "new_sponsor" | "sponsor"> & {
200
200
  type_i: EffectType.data_sponsorship_removed;
201
201
  };
202
202
  interface ClaimableBalanceSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsorshipFields {
203
203
  balance_type_i: string;
204
204
  }
205
- export type ClaimableBalanceSponsorshipCreated = Omit<ClaimableBalanceSponsorshipEvents<'claimable_balance_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
205
+ export type ClaimableBalanceSponsorshipCreated = Omit<ClaimableBalanceSponsorshipEvents<"claimable_balance_sponsorship_created">, "new_sponsor" | "former_sponsor"> & {
206
206
  type_i: EffectType.claimable_balance_sponsorship_created;
207
207
  };
208
- export type ClaimableBalanceSponsorshipUpdated = Omit<ClaimableBalanceSponsorshipEvents<'claimable_balance_sponsorship_updated'>, "sponsor"> & {
208
+ export type ClaimableBalanceSponsorshipUpdated = Omit<ClaimableBalanceSponsorshipEvents<"claimable_balance_sponsorship_updated">, "sponsor"> & {
209
209
  type_i: EffectType.claimable_balance_sponsorship_updated;
210
210
  };
211
- export type ClaimableBalanceSponsorshipRemoved = Omit<ClaimableBalanceSponsorshipEvents<'claimable_balance_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
211
+ export type ClaimableBalanceSponsorshipRemoved = Omit<ClaimableBalanceSponsorshipEvents<"claimable_balance_sponsorship_removed">, "new_sponsor" | "sponsor"> & {
212
212
  type_i: EffectType.claimable_balance_sponsorship_removed;
213
213
  };
214
214
  interface SignerSponsorshipEvents<T extends string> extends BaseEffectRecord<T>, SponsorshipFields {
215
215
  signer: string;
216
216
  }
217
- export type SignerSponsorshipCreated = Omit<SignerSponsorshipEvents<'signer_sponsorship_created'>, "new_sponsor" | "former_sponsor"> & {
217
+ export type SignerSponsorshipCreated = Omit<SignerSponsorshipEvents<"signer_sponsorship_created">, "new_sponsor" | "former_sponsor"> & {
218
218
  type_i: EffectType.signer_sponsorship_created;
219
219
  };
220
- export type SignerSponsorshipUpdated = Omit<SignerSponsorshipEvents<'signer_sponsorship_updated'>, "sponsor"> & {
220
+ export type SignerSponsorshipUpdated = Omit<SignerSponsorshipEvents<"signer_sponsorship_updated">, "sponsor"> & {
221
221
  type_i: EffectType.signer_sponsorship_updated;
222
222
  };
223
- export type SignerSponsorshipRemoved = Omit<SignerSponsorshipEvents<'signer_sponsorship_removed'>, "new_sponsor" | "sponsor"> & {
223
+ export type SignerSponsorshipRemoved = Omit<SignerSponsorshipEvents<"signer_sponsorship_removed">, "new_sponsor" | "sponsor"> & {
224
224
  type_i: EffectType.signer_sponsorship_removed;
225
225
  };
226
226
  export interface ClaimableBalanceClawedBack extends HorizonApi.BaseResponse {
@@ -234,33 +234,33 @@ export interface LiquidityPoolEffectRecord extends HorizonApi.BaseResponse {
234
234
  total_shares: string;
235
235
  reserves: HorizonApi.Reserve[];
236
236
  }
237
- export interface LiquidityPoolDeposited extends BaseEffectRecord<'liquidity_pool_deposited'> {
237
+ export interface LiquidityPoolDeposited extends BaseEffectRecord<"liquidity_pool_deposited"> {
238
238
  type_i: EffectType.liquidity_pool_deposited;
239
239
  liquidity_pool: LiquidityPoolEffectRecord;
240
240
  reserves_deposited: HorizonApi.Reserve[];
241
241
  shares_received: string;
242
242
  }
243
- export interface LiquidityPoolWithdrew extends BaseEffectRecord<'liquidity_pool_withdrew'> {
243
+ export interface LiquidityPoolWithdrew extends BaseEffectRecord<"liquidity_pool_withdrew"> {
244
244
  type_i: EffectType.liquidity_pool_withdrew;
245
245
  liquidity_pool: LiquidityPoolEffectRecord;
246
246
  reserves_received: HorizonApi.Reserve[];
247
247
  shares_redeemed: string;
248
248
  }
249
- export interface LiquidityPoolTrade extends BaseEffectRecord<'liquidity_pool_trade'> {
249
+ export interface LiquidityPoolTrade extends BaseEffectRecord<"liquidity_pool_trade"> {
250
250
  type_i: EffectType.liquidity_pool_trade;
251
251
  liquidity_pool: LiquidityPoolEffectRecord;
252
252
  sold: HorizonApi.Reserve;
253
253
  bought: HorizonApi.Reserve;
254
254
  }
255
- export interface LiquidityPoolCreated extends BaseEffectRecord<'liquidity_pool_created'> {
255
+ export interface LiquidityPoolCreated extends BaseEffectRecord<"liquidity_pool_created"> {
256
256
  type_i: EffectType.liquidity_pool_created;
257
257
  liquidity_pool: LiquidityPoolEffectRecord;
258
258
  }
259
- export interface LiquidityPoolRemoved extends BaseEffectRecord<'liquidity_pool_removed'> {
259
+ export interface LiquidityPoolRemoved extends BaseEffectRecord<"liquidity_pool_removed"> {
260
260
  type_i: EffectType.liquidity_pool_removed;
261
261
  liquidity_pool_id: string;
262
262
  }
263
- export interface LiquidityPoolRevoked extends BaseEffectRecord<'liquidity_pool_revoked'> {
263
+ export interface LiquidityPoolRevoked extends BaseEffectRecord<"liquidity_pool_revoked"> {
264
264
  type_i: EffectType.liquidity_pool_revoked;
265
265
  liquidity_pool: LiquidityPoolEffectRecord;
266
266
  reserves_revoked: [
@@ -272,12 +272,12 @@ export interface LiquidityPoolRevoked extends BaseEffectRecord<'liquidity_pool_r
272
272
  ];
273
273
  shares_revoked: string;
274
274
  }
275
- export interface ContractCredited extends BaseEffectRecord<'contract_credited'>, OfferAsset {
275
+ export interface ContractCredited extends BaseEffectRecord<"contract_credited">, OfferAsset {
276
276
  type_i: EffectType.contract_credited;
277
277
  contract: string;
278
278
  amount: string;
279
279
  }
280
- export interface ContractDebited extends BaseEffectRecord<'contract_debited'>, OfferAsset {
280
+ export interface ContractDebited extends BaseEffectRecord<"contract_debited">, OfferAsset {
281
281
  type_i: EffectType.contract_debited;
282
282
  contract: string;
283
283
  amount: string;
@@ -1,5 +1,5 @@
1
1
  import { BaseEffectRecord, EffectType } from "./effects";
2
- export interface Trade extends BaseEffectRecord<'trade'> {
2
+ export interface Trade extends BaseEffectRecord<"trade"> {
3
3
  type_i: EffectType.trade;
4
4
  seller: string;
5
5
  offer_id: number | string;
@@ -1,5 +1,5 @@
1
- import { AxiosRequestConfig, AxiosResponse } from 'feaxios';
2
- import { CancelToken, HttpClient, HttpClientRequestConfig, HttpClientResponse } from './types';
1
+ import { AxiosRequestConfig, AxiosResponse } from "feaxios";
2
+ import { CancelToken, HttpClient, HttpClientRequestConfig, HttpClientResponse } from "./types";
3
3
  export interface HttpResponse<T = any> extends AxiosResponse<T> {
4
4
  }
5
5
  export interface FetchClientConfig<T = any> extends AxiosRequestConfig {
@@ -52,7 +52,7 @@ var InterceptorManager = function () {
52
52
  function getFormConfig(config) {
53
53
  var formConfig = config || {};
54
54
  formConfig.headers = new Headers(formConfig.headers || {});
55
- formConfig.headers.set('Content-Type', 'application/x-www-form-urlencoded');
55
+ formConfig.headers.set("Content-Type", "application/x-www-form-urlencoded");
56
56
  return formConfig;
57
57
  }
58
58
  function createFetchClient() {
@@ -84,7 +84,7 @@ function createFetchClient() {
84
84
  if (config.cancelToken) {
85
85
  config.cancelToken.promise.then(function () {
86
86
  abortController.abort();
87
- reject(new Error('Request canceled'));
87
+ reject(new Error("Request canceled"));
88
88
  });
89
89
  }
90
90
  var modifiedConfig = config;
@@ -108,7 +108,7 @@ function createFetchClient() {
108
108
  }
109
109
  var adapter = modifiedConfig.adapter || _this.defaults.adapter;
110
110
  if (!adapter) {
111
- throw new Error('No adapter available');
111
+ throw new Error("No adapter available");
112
112
  }
113
113
  var responsePromise = adapter(modifiedConfig).then(function (axiosResponse) {
114
114
  var httpClientResponse = {
@@ -129,13 +129,13 @@ function createFetchClient() {
129
129
  var _loop = function _loop(_i) {
130
130
  responsePromise = responsePromise.then(function (response) {
131
131
  var fulfilledInterceptor = _chain[_i];
132
- if (typeof fulfilledInterceptor === 'function') {
132
+ if (typeof fulfilledInterceptor === "function") {
133
133
  return fulfilledInterceptor(response);
134
134
  }
135
135
  return response;
136
136
  }, function (error) {
137
137
  var rejectedInterceptor = _chain[_i + 1];
138
- if (typeof rejectedInterceptor === 'function') {
138
+ if (typeof rejectedInterceptor === "function") {
139
139
  return rejectedInterceptor(error);
140
140
  }
141
141
  throw error;
@@ -153,45 +153,45 @@ function createFetchClient() {
153
153
  get: function get(url, config) {
154
154
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
155
155
  url: url,
156
- method: 'get'
156
+ method: "get"
157
157
  }));
158
158
  },
159
159
  delete: function _delete(url, config) {
160
160
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
161
161
  url: url,
162
- method: 'delete'
162
+ method: "delete"
163
163
  }));
164
164
  },
165
165
  head: function head(url, config) {
166
166
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
167
167
  url: url,
168
- method: 'head'
168
+ method: "head"
169
169
  }));
170
170
  },
171
171
  options: function options(url, config) {
172
172
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
173
173
  url: url,
174
- method: 'options'
174
+ method: "options"
175
175
  }));
176
176
  },
177
177
  post: function post(url, data, config) {
178
178
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
179
179
  url: url,
180
- method: 'post',
180
+ method: "post",
181
181
  data: data
182
182
  }));
183
183
  },
184
184
  put: function put(url, data, config) {
185
185
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
186
186
  url: url,
187
- method: 'put',
187
+ method: "put",
188
188
  data: data
189
189
  }));
190
190
  },
191
191
  patch: function patch(url, data, config) {
192
192
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), config), {}, {
193
193
  url: url,
194
- method: 'patch',
194
+ method: "patch",
195
195
  data: data
196
196
  }));
197
197
  },
@@ -199,7 +199,7 @@ function createFetchClient() {
199
199
  var formConfig = getFormConfig(config);
200
200
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
201
201
  url: url,
202
- method: 'post',
202
+ method: "post",
203
203
  data: data
204
204
  }));
205
205
  },
@@ -207,7 +207,7 @@ function createFetchClient() {
207
207
  var formConfig = getFormConfig(config);
208
208
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
209
209
  url: url,
210
- method: 'put',
210
+ method: "put",
211
211
  data: data
212
212
  }));
213
213
  },
@@ -215,13 +215,13 @@ function createFetchClient() {
215
215
  var formConfig = getFormConfig(config);
216
216
  return this.makeRequest(_objectSpread(_objectSpread(_objectSpread({}, this.defaults), formConfig), {}, {
217
217
  url: url,
218
- method: 'patch',
218
+ method: "patch",
219
219
  data: data
220
220
  }));
221
221
  },
222
222
  CancelToken: _types.CancelToken,
223
223
  isCancel: function isCancel(value) {
224
- return value instanceof Error && value.message === 'Request canceled';
224
+ return value instanceof Error && value.message === "Request canceled";
225
225
  }
226
226
  };
227
227
  return httpClient;
@@ -23,11 +23,11 @@ Object.keys(_types).forEach(function (key) {
23
23
  var httpClient;
24
24
  var create;
25
25
  if (true) {
26
- var axiosModule = require('./axios-client');
26
+ var axiosModule = require("./axios-client");
27
27
  exports.httpClient = httpClient = axiosModule.axiosClient;
28
28
  exports.create = create = axiosModule.create;
29
29
  } else {
30
- var fetchModule = require('./fetch-client');
30
+ var fetchModule = require("./fetch-client");
31
31
  exports.httpClient = httpClient = fetchModule.fetchClient;
32
32
  exports.create = create = fetchModule.create;
33
33
  }
@@ -1,7 +1,7 @@
1
1
  export type HttpResponseHeaders = Record<string, string | boolean | undefined> & {
2
- 'set-cookie'?: string[];
2
+ "set-cookie"?: string[];
3
3
  };
4
- export interface HttpClientDefaults extends Omit<HttpClientRequestConfig, 'headers'> {
4
+ export interface HttpClientDefaults extends Omit<HttpClientRequestConfig, "headers"> {
5
5
  headers?: [string, string][] | Record<string, string> | Headers | undefined;
6
6
  }
7
7
  export interface HttpClientResponse<T = any> {
@@ -1,11 +1,11 @@
1
- export * from './errors';
2
- export { Config } from './config';
3
- export { Utils } from './utils';
4
- export * as StellarToml from './stellartoml';
5
- export * as Federation from './federation';
6
- export * as WebAuth from './webauth';
7
- export * as Friendbot from './friendbot';
8
- export * as Horizon from './horizon';
1
+ export * from "./errors";
2
+ export { Config } from "./config";
3
+ export { Utils } from "./utils";
4
+ export * as StellarToml from "./stellartoml";
5
+ export * as Federation from "./federation";
6
+ export * as WebAuth from "./webauth";
7
+ export * as Friendbot from "./friendbot";
8
+ export * as Horizon from "./horizon";
9
9
  /**
10
10
  * Tools for interacting with the Soroban RPC server, such as `Server`,
11
11
  * `assembleTransaction`, and the `Api` types. You can import these from the
@@ -15,7 +15,7 @@ export * as Horizon from './horizon';
15
15
  * @example
16
16
  * import { Server } from '@stellar/stellar-sdk/rpc';
17
17
  */
18
- export * as rpc from './rpc';
18
+ export * as rpc from "./rpc";
19
19
  /**
20
20
  * Tools for interacting with smart contracts, such as `Client`, `Spec`, and
21
21
  * `AssembledTransaction`. You can import these from the `/contract`
@@ -26,7 +26,7 @@ export * as rpc from './rpc';
26
26
  * import { Client } from '@stellar/stellar-sdk/contract';
27
27
  * @private
28
28
  */
29
- export * as contract from './contract';
30
- export * from '@stellar/stellar-base';
29
+ export * as contract from "./contract";
30
+ export * from "@stellar/stellar-base";
31
31
  declare const _default: any;
32
32
  export default _default;