@stellar/stellar-sdk 14.1.1 → 14.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.
Files changed (171) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +14 -20
  3. package/dist/stellar-sdk-minimal.js +532 -375
  4. package/dist/stellar-sdk-minimal.min.js +1 -1
  5. package/dist/stellar-sdk-no-axios.js +532 -375
  6. package/dist/stellar-sdk-no-axios.min.js +1 -1
  7. package/dist/stellar-sdk-no-eventsource.js +781 -551
  8. package/dist/stellar-sdk-no-eventsource.min.js +1 -1
  9. package/dist/stellar-sdk.js +781 -551
  10. package/dist/stellar-sdk.min.js +1 -1
  11. package/lib/contract/client.js +2 -2
  12. package/lib/contract/spec.js +10 -2
  13. package/lib/contract/utils.js +7 -7
  14. package/lib/errors/account_requires_memo.d.ts +0 -1
  15. package/lib/errors/account_requires_memo.js +0 -4
  16. package/lib/errors/bad_request.d.ts +0 -1
  17. package/lib/errors/bad_request.js +2 -8
  18. package/lib/errors/bad_response.d.ts +0 -1
  19. package/lib/errors/bad_response.js +2 -8
  20. package/lib/errors/network.d.ts +0 -1
  21. package/lib/errors/network.js +0 -3
  22. package/lib/errors/not_found.d.ts +0 -1
  23. package/lib/errors/not_found.js +2 -8
  24. package/lib/federation/index.d.ts +2 -2
  25. package/lib/horizon/call_builder.js +1 -1
  26. package/lib/horizon/horizon_api.js +0 -1
  27. package/lib/horizon/horizon_axios_client.js +4 -4
  28. package/lib/horizon/index.d.ts +1 -1
  29. package/lib/horizon/types/effects.d.ts +41 -41
  30. package/lib/horizon/types/trade.d.ts +1 -1
  31. package/lib/http-client/fetch-client.d.ts +2 -2
  32. package/lib/http-client/fetch-client.js +16 -16
  33. package/lib/http-client/index.js +2 -2
  34. package/lib/http-client/types.d.ts +2 -2
  35. package/lib/index.d.ts +11 -11
  36. package/lib/index.js +2 -2
  37. package/lib/minimal/contract/client.js +2 -2
  38. package/lib/minimal/contract/spec.js +10 -2
  39. package/lib/minimal/contract/utils.js +7 -7
  40. package/lib/minimal/errors/account_requires_memo.d.ts +0 -1
  41. package/lib/minimal/errors/account_requires_memo.js +0 -4
  42. package/lib/minimal/errors/bad_request.d.ts +0 -1
  43. package/lib/minimal/errors/bad_request.js +2 -8
  44. package/lib/minimal/errors/bad_response.d.ts +0 -1
  45. package/lib/minimal/errors/bad_response.js +2 -8
  46. package/lib/minimal/errors/network.d.ts +0 -1
  47. package/lib/minimal/errors/network.js +0 -3
  48. package/lib/minimal/errors/not_found.d.ts +0 -1
  49. package/lib/minimal/errors/not_found.js +2 -8
  50. package/lib/minimal/federation/index.d.ts +2 -2
  51. package/lib/minimal/horizon/call_builder.js +1 -1
  52. package/lib/minimal/horizon/horizon_api.js +0 -1
  53. package/lib/minimal/horizon/horizon_axios_client.js +4 -4
  54. package/lib/minimal/horizon/index.d.ts +1 -1
  55. package/lib/minimal/horizon/types/effects.d.ts +41 -41
  56. package/lib/minimal/horizon/types/trade.d.ts +1 -1
  57. package/lib/minimal/http-client/fetch-client.d.ts +2 -2
  58. package/lib/minimal/http-client/fetch-client.js +16 -16
  59. package/lib/minimal/http-client/index.js +2 -2
  60. package/lib/minimal/http-client/types.d.ts +2 -2
  61. package/lib/minimal/index.d.ts +11 -11
  62. package/lib/minimal/index.js +2 -2
  63. package/lib/minimal/rpc/api.d.ts +148 -8
  64. package/lib/minimal/rpc/api.js +3 -3
  65. package/lib/minimal/rpc/axios.js +3 -3
  66. package/lib/minimal/rpc/browser.d.ts +2 -2
  67. package/lib/minimal/rpc/index.d.ts +1 -1
  68. package/lib/minimal/rpc/parsers.d.ts +3 -2
  69. package/lib/minimal/rpc/parsers.js +42 -19
  70. package/lib/minimal/rpc/server.d.ts +123 -31
  71. package/lib/minimal/rpc/server.js +425 -267
  72. package/lib/minimal/rpc/transaction.d.ts +2 -2
  73. package/lib/minimal/rpc/transaction.js +6 -6
  74. package/lib/minimal/webauth/errors.d.ts +0 -2
  75. package/lib/minimal/webauth/errors.js +2 -8
  76. package/lib/minimal/webauth/index.d.ts +2 -2
  77. package/lib/no-axios/contract/client.js +2 -2
  78. package/lib/no-axios/contract/spec.js +10 -2
  79. package/lib/no-axios/contract/utils.js +7 -7
  80. package/lib/no-axios/errors/account_requires_memo.d.ts +0 -1
  81. package/lib/no-axios/errors/account_requires_memo.js +0 -4
  82. package/lib/no-axios/errors/bad_request.d.ts +0 -1
  83. package/lib/no-axios/errors/bad_request.js +2 -8
  84. package/lib/no-axios/errors/bad_response.d.ts +0 -1
  85. package/lib/no-axios/errors/bad_response.js +2 -8
  86. package/lib/no-axios/errors/network.d.ts +0 -1
  87. package/lib/no-axios/errors/network.js +0 -3
  88. package/lib/no-axios/errors/not_found.d.ts +0 -1
  89. package/lib/no-axios/errors/not_found.js +2 -8
  90. package/lib/no-axios/federation/index.d.ts +2 -2
  91. package/lib/no-axios/horizon/call_builder.js +1 -1
  92. package/lib/no-axios/horizon/horizon_api.js +0 -1
  93. package/lib/no-axios/horizon/horizon_axios_client.js +4 -4
  94. package/lib/no-axios/horizon/index.d.ts +1 -1
  95. package/lib/no-axios/horizon/types/effects.d.ts +41 -41
  96. package/lib/no-axios/horizon/types/trade.d.ts +1 -1
  97. package/lib/no-axios/http-client/fetch-client.d.ts +2 -2
  98. package/lib/no-axios/http-client/fetch-client.js +16 -16
  99. package/lib/no-axios/http-client/index.js +2 -2
  100. package/lib/no-axios/http-client/types.d.ts +2 -2
  101. package/lib/no-axios/index.d.ts +11 -11
  102. package/lib/no-axios/index.js +2 -2
  103. package/lib/no-axios/rpc/api.d.ts +148 -8
  104. package/lib/no-axios/rpc/api.js +3 -3
  105. package/lib/no-axios/rpc/axios.js +3 -3
  106. package/lib/no-axios/rpc/browser.d.ts +2 -2
  107. package/lib/no-axios/rpc/index.d.ts +1 -1
  108. package/lib/no-axios/rpc/parsers.d.ts +3 -2
  109. package/lib/no-axios/rpc/parsers.js +42 -19
  110. package/lib/no-axios/rpc/server.d.ts +123 -31
  111. package/lib/no-axios/rpc/server.js +425 -267
  112. package/lib/no-axios/rpc/transaction.d.ts +2 -2
  113. package/lib/no-axios/rpc/transaction.js +6 -6
  114. package/lib/no-axios/webauth/errors.d.ts +0 -2
  115. package/lib/no-axios/webauth/errors.js +2 -8
  116. package/lib/no-axios/webauth/index.d.ts +2 -2
  117. package/lib/no-eventsource/contract/client.js +2 -2
  118. package/lib/no-eventsource/contract/spec.js +10 -2
  119. package/lib/no-eventsource/contract/utils.js +7 -7
  120. package/lib/no-eventsource/errors/account_requires_memo.d.ts +0 -1
  121. package/lib/no-eventsource/errors/account_requires_memo.js +0 -4
  122. package/lib/no-eventsource/errors/bad_request.d.ts +0 -1
  123. package/lib/no-eventsource/errors/bad_request.js +2 -8
  124. package/lib/no-eventsource/errors/bad_response.d.ts +0 -1
  125. package/lib/no-eventsource/errors/bad_response.js +2 -8
  126. package/lib/no-eventsource/errors/network.d.ts +0 -1
  127. package/lib/no-eventsource/errors/network.js +0 -3
  128. package/lib/no-eventsource/errors/not_found.d.ts +0 -1
  129. package/lib/no-eventsource/errors/not_found.js +2 -8
  130. package/lib/no-eventsource/federation/index.d.ts +2 -2
  131. package/lib/no-eventsource/horizon/call_builder.js +1 -1
  132. package/lib/no-eventsource/horizon/horizon_api.js +0 -1
  133. package/lib/no-eventsource/horizon/horizon_axios_client.js +4 -4
  134. package/lib/no-eventsource/horizon/index.d.ts +1 -1
  135. package/lib/no-eventsource/horizon/types/effects.d.ts +41 -41
  136. package/lib/no-eventsource/horizon/types/trade.d.ts +1 -1
  137. package/lib/no-eventsource/http-client/fetch-client.d.ts +2 -2
  138. package/lib/no-eventsource/http-client/fetch-client.js +16 -16
  139. package/lib/no-eventsource/http-client/index.js +2 -2
  140. package/lib/no-eventsource/http-client/types.d.ts +2 -2
  141. package/lib/no-eventsource/index.d.ts +11 -11
  142. package/lib/no-eventsource/index.js +2 -2
  143. package/lib/no-eventsource/rpc/api.d.ts +148 -8
  144. package/lib/no-eventsource/rpc/api.js +3 -3
  145. package/lib/no-eventsource/rpc/axios.js +3 -3
  146. package/lib/no-eventsource/rpc/browser.d.ts +2 -2
  147. package/lib/no-eventsource/rpc/index.d.ts +1 -1
  148. package/lib/no-eventsource/rpc/parsers.d.ts +3 -2
  149. package/lib/no-eventsource/rpc/parsers.js +42 -19
  150. package/lib/no-eventsource/rpc/server.d.ts +123 -31
  151. package/lib/no-eventsource/rpc/server.js +425 -267
  152. package/lib/no-eventsource/rpc/transaction.d.ts +2 -2
  153. package/lib/no-eventsource/rpc/transaction.js +6 -6
  154. package/lib/no-eventsource/webauth/errors.d.ts +0 -2
  155. package/lib/no-eventsource/webauth/errors.js +2 -8
  156. package/lib/no-eventsource/webauth/index.d.ts +2 -2
  157. package/lib/rpc/api.d.ts +148 -8
  158. package/lib/rpc/api.js +3 -3
  159. package/lib/rpc/axios.js +3 -3
  160. package/lib/rpc/browser.d.ts +2 -2
  161. package/lib/rpc/index.d.ts +1 -1
  162. package/lib/rpc/parsers.d.ts +3 -2
  163. package/lib/rpc/parsers.js +42 -19
  164. package/lib/rpc/server.d.ts +123 -31
  165. package/lib/rpc/server.js +425 -267
  166. package/lib/rpc/transaction.d.ts +2 -2
  167. package/lib/rpc/transaction.js +6 -6
  168. package/lib/webauth/errors.d.ts +0 -2
  169. package/lib/webauth/errors.js +2 -8
  170. package/lib/webauth/index.d.ts +2 -2
  171. 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];
@@ -8,6 +8,4 @@
8
8
  * @param {string} message Human-readable error message.
9
9
  */
10
10
  export declare class InvalidChallengeError extends Error {
11
- __proto__: InvalidChallengeError;
12
- constructor(message: string);
13
11
  }
@@ -21,15 +21,9 @@ function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).in
21
21
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
22
22
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
23
23
  var InvalidChallengeError = exports.InvalidChallengeError = function (_Error) {
24
- function InvalidChallengeError(message) {
25
- var _this;
24
+ function InvalidChallengeError() {
26
25
  _classCallCheck(this, InvalidChallengeError);
27
- var trueProto = (this instanceof InvalidChallengeError ? this.constructor : void 0).prototype;
28
- _this = _callSuper(this, InvalidChallengeError, [message]);
29
- _this.__proto__ = trueProto;
30
- _this.constructor = InvalidChallengeError;
31
- _this.name = "InvalidChallengeError";
32
- return _this;
26
+ return _callSuper(this, InvalidChallengeError, arguments);
33
27
  }
34
28
  _inherits(InvalidChallengeError, _Error);
35
29
  return _createClass(InvalidChallengeError);
@@ -1,2 +1,2 @@
1
- export * from './utils';
2
- export { InvalidChallengeError } from './errors';
1
+ export * from "./utils";
2
+ export { InvalidChallengeError } from "./errors";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stellar/stellar-sdk",
3
- "version": "14.1.1",
3
+ "version": "14.3.0",
4
4
  "description": "A library for working with the Stellar network, including communication with the Horizon and Soroban RPC servers.",
5
5
  "keywords": [
6
6
  "stellar"
@@ -78,6 +78,8 @@
78
78
  }
79
79
  },
80
80
  "scripts": {
81
+ "setup": "git config blame.ignoreRevsFile .git-blame-ignore-revs",
82
+ "postinstall": "yarn setup || true",
81
83
  "build": "cross-env NODE_ENV=development yarn _build",
82
84
  "build:prod": "cross-env NODE_ENV=production yarn _build",
83
85
  "build:node": "yarn _babel && yarn build:ts",
@@ -99,7 +101,7 @@
99
101
  "test": "yarn build:test && yarn test:node && yarn test:integration && yarn test:browser",
100
102
  "test:e2e": "./test/e2e/initialize.sh && yarn _nyc mocha --recursive 'test/e2e/src/test-*.js'",
101
103
  "test:node": "NODE_OPTIONS=--no-experimental-detect-module yarn _nyc mocha --recursive 'test/unit/**/*.js'",
102
- "test:e2e:noeval": "NODE_ARGS='--disable-eval' yarn test:e2e",
104
+ "test:e2e:noeval": "NODE_OPTIONS=--disallow-code-generation-from-strings yarn test:e2e",
103
105
  "test:integration": "yarn _nyc mocha --recursive 'test/integration/**/*.js'",
104
106
  "test:browser": "karma start config/karma.conf.js",
105
107
  "test:browser:no-axios": "cross-env USE_AXIOS=false yarn build:browser && cross-env USE_AXIOS=false karma start config/karma.conf.js",
@@ -108,8 +110,8 @@
108
110
  "prepare": "yarn build:prod",
109
111
  "_build": "yarn build:node:all && yarn build:test && yarn build:browser:all",
110
112
  "_babel": "babel --extensions '.ts' --out-dir ${OUTPUT_DIR:-lib} src/",
111
- "_nyc": "node $(NODE_ARGS) node_modules/.bin/nyc --nycrc-path config/.nycrc",
112
- "_prettier": "prettier --ignore-path config/.prettierignore --write './test/**/*.js'"
113
+ "_nyc": "node node_modules/.bin/nyc --nycrc-path config/.nycrc",
114
+ "_prettier": "prettier --config config/prettier.config.js --ignore-path config/.prettierignore --write './src/**/*.ts' './test/**/*.{js,ts}'"
113
115
  },
114
116
  "husky": {
115
117
  "hooks": {
@@ -147,7 +149,7 @@
147
149
  },
148
150
  "devDependencies": {
149
151
  "@babel/cli": "^7.28.0",
150
- "@babel/core": "^7.28.0",
152
+ "@babel/core": "^7.28.4",
151
153
  "@babel/eslint-plugin": "^7.26.10",
152
154
  "@babel/preset-env": "^7.28.0",
153
155
  "@babel/preset-typescript": "^7.26.0",
@@ -168,7 +170,7 @@
168
170
  "@typescript-eslint/parser": "^7.16.1",
169
171
  "axios-mock-adapter": "^1.22.0",
170
172
  "babel-loader": "^9.1.3",
171
- "babel-plugin-istanbul": "^7.0.0",
173
+ "babel-plugin-istanbul": "^7.0.1",
172
174
  "babel-plugin-transform-define": "^2.1.4",
173
175
  "better-docs": "^2.7.3",
174
176
  "buffer": "^6.0.3",
@@ -213,17 +215,23 @@
213
215
  "terser-webpack-plugin": "^5.3.14",
214
216
  "ts-node": "^10.9.2",
215
217
  "typescript": "5.6.3",
216
- "webpack": "^5.100.1",
218
+ "webpack": "^5.102.1",
217
219
  "webpack-cli": "^5.0.1"
218
220
  },
219
221
  "dependencies": {
220
- "@stellar/stellar-base": "^14.0.0",
221
- "axios": "^1.8.4",
222
+ "@stellar/stellar-base": "^14.0.1",
223
+ "axios": "^1.12.2",
222
224
  "bignumber.js": "^9.3.1",
223
225
  "eventsource": "^2.0.2",
224
226
  "feaxios": "^0.0.23",
225
227
  "randombytes": "^2.1.0",
226
228
  "toml": "^3.0.0",
227
229
  "urijs": "^1.19.1"
230
+ },
231
+ "overrides": {
232
+ "chalk": "5.3.0",
233
+ "strip-ansi": "7.1.0",
234
+ "color-convert": "2.0.1",
235
+ "color-name": "1.1.4"
228
236
  }
229
237
  }