@stellar/typescript-wallet-sdk 3.0.0-beta.1779920488639 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3108,16 +3108,27 @@ var Stellar = /** @class */ (function () {
3108
3108
  return stellar_sdk_1.TransactionBuilder.buildFeeBumpTransaction(feeAddress.keypair, (baseFee || this.cfg.stellar.baseFee).toString(), transaction, transaction.networkPassphrase);
3109
3109
  };
3110
3110
  /**
3111
- * Submits a signed transaction to the server. If the submission fails with status
3112
- * 504 indicating a timeout error, it will automatically retry.
3111
+ * Submits a signed transaction to Horizon.
3112
+ *
3113
+ * On HTTP 504 (timeout), retries with exponential backoff up to
3114
+ * {@link SUBMIT_504_MAX_RETRIES} times. Any non-504 error is rethrown
3115
+ * immediately without retrying.
3116
+ *
3113
3117
  * @param {Transaction|FeeBumpTransaction} signedTransaction - The signed transaction to submit.
3114
- * @returns {boolean} `true` if the transaction was successfully submitted.
3115
- * @throws {TransactionSubmitFailedError} If the transaction submission fails.
3118
+ * @returns {boolean} `true` if Horizon confirmed the submission as successful.
3119
+ * @throws {TransactionSubmitFailedError} If Horizon responded with a non-successful
3120
+ * submission result (the transaction reached Horizon but was rejected).
3121
+ * @throws The underlying 504 error if every retry attempt timed out. In this
3122
+ * case the transaction's on-chain status is **indeterminate** — Horizon may
3123
+ * have ingested it on the final attempt without responding in time. Callers
3124
+ * should poll the transaction hash to determine the actual outcome rather
3125
+ * than resubmit blindly; resubmitting a signed transaction with the same
3126
+ * sequence number will fail with `tx_bad_seq` once the original lands.
3116
3127
  */
3117
3128
  Stellar.prototype.submitTransaction = function (signedTransaction) {
3118
3129
  var _a;
3119
3130
  return __awaiter(this, void 0, void 0, function () {
3120
- var lastError, attempt, response, e_2, cappedDelay, jitter;
3131
+ var lastError, attempt, response, e_2, cappedDelay, half;
3121
3132
  return __generator(this, function (_b) {
3122
3133
  switch (_b.label) {
3123
3134
  case 0:
@@ -3145,8 +3156,8 @@ var Stellar = /** @class */ (function () {
3145
3156
  return [3 /*break*/, 7];
3146
3157
  }
3147
3158
  cappedDelay = Math.min(SUBMIT_504_BASE_DELAY_MS * Math.pow(2, attempt), SUBMIT_504_MAX_DELAY_MS);
3148
- jitter = Math.random() * (cappedDelay / 2);
3149
- return [4 /*yield*/, sleep(cappedDelay + jitter)];
3159
+ half = cappedDelay / 2;
3160
+ return [4 /*yield*/, sleep(half + Math.random() * half)];
3150
3161
  case 5:
3151
3162
  _b.sent();
3152
3163
  return [3 /*break*/, 6];
@@ -3214,7 +3225,7 @@ var Stellar = /** @class */ (function () {
3214
3225
  resultCode = (0, getResultCode_1.getResultCode)(e_3);
3215
3226
  if (resultCode === "tx_too_late") {
3216
3227
  newFee = parseInt(transaction.fee) + baseFeeIncrease;
3217
- if (maxFee !== undefined && newFee > maxFee) {
3228
+ if (maxFee && newFee > maxFee) {
3218
3229
  throw new Exceptions_1.TransactionSubmitWithFeeIncreaseFailedError(maxFee, e_3);
3219
3230
  }
3220
3231
  return [2 /*return*/, this.submitWithFeeIncrease({
@@ -56498,7 +56509,7 @@ function decode(arr) {
56498
56509
  /***/ ((module) => {
56499
56510
 
56500
56511
  "use strict";
56501
- module.exports = JSON.parse('{"name":"@stellar/typescript-wallet-sdk","version":"3.0.0","engines":{"node":">=20"},"browser":"./lib/bundle_browser.js","main":"./lib/bundle.js","types":"./lib/index.d.ts","license":"Apache-2.0","private":false,"devDependencies":{"@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.23.3","@stellar/prettier-config":"^1.0.1","@stellar/tsconfig":"^1.0.2","@types/jest":"^29.4.0","@types/lodash":"^4.14.194","@types/sinon":"^10.0.15","@typescript-eslint/eslint-plugin":"^6.7.5","@typescript-eslint/parser":"^6.7.5","babel-jest":"^29.4.1","crypto-browserify":"^3.12.0","dotenv":"^16.3.1","eslint":"^8.51.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jsdoc":"^46.8.2","express":"^4.19.2","husky":"^8.0.0","jest":"^29.4.1","lint-staged":"^14.0.1","npm-run-all":"^4.1.5","playwright":"^1.43.1","prettier":"^2.0.5","pretty-quick":"^2.0.1","process":"^0.11.10","sinon":"^15.1.0","stream-browserify":"^3.0.0","ts-jest":"^29.0.5","ts-loader":"^9.4.2","ts-node":"^10.9.1","tslib":"^2.5.0","typescript":"^5.0.4","webpack":"^5.83.1","webpack-cli":"^5.1.1"},"dependencies":{"@stablelib/base64":"^2.0.0","@stablelib/utf8":"^2.0.0","@stellar/stellar-sdk":"15.0.1","axios":"^1.4.0","base64url":"^3.0.1","https-browserify":"^1.0.0","jws":"^4.0.0","lodash":"^4.17.21","query-string":"^7.1.3","stream-http":"^3.2.0","tweetnacl":"^1.0.3","url":"^0.11.0","util":"^0.12.5","utility-types":"^3.10.0","vm-browserify":"^1.1.2"},"scripts":{"test":"jest --watchAll","test:ci":"jest --ci","test:e2e:ci":"jest --config jest.e2e.config.js --ci","test:recovery:ci":"jest --config jest.integration.config.js recovery.test.ts --ci","test:anchorplatform:ci":"yarn jest --config jest.integration.config.js anchorplatform.test.ts --ci","build:web":"webpack --config webpack.config.js","build:node":"webpack --env NODE=true --config webpack.config.js","build":"run-p build:web build:node","example:sep10Server":"ts-node examples/sep10/sep10Server.ts","example:sep10Wallet":"ts-node examples/sep10/sep10Wallet.ts","example:sep24":"ts-node examples/sep24/sep24.ts","example:sep12":"ts-node examples/sep12/sep12.ts"}}');
56512
+ module.exports = JSON.parse('{"name":"@stellar/typescript-wallet-sdk","version":"3.0.1","engines":{"node":">=20"},"browser":"./lib/bundle_browser.js","main":"./lib/bundle.js","types":"./lib/index.d.ts","license":"Apache-2.0","private":false,"devDependencies":{"@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.23.3","@stellar/prettier-config":"^1.0.1","@stellar/tsconfig":"^1.0.2","@types/jest":"^29.4.0","@types/lodash":"^4.14.194","@types/sinon":"^10.0.15","@typescript-eslint/eslint-plugin":"^6.7.5","@typescript-eslint/parser":"^6.7.5","babel-jest":"^29.4.1","crypto-browserify":"^3.12.0","dotenv":"^16.3.1","eslint":"^8.51.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jsdoc":"^46.8.2","express":"^4.19.2","husky":"^8.0.0","jest":"^29.4.1","lint-staged":"^14.0.1","npm-run-all":"^4.1.5","playwright":"^1.43.1","prettier":"^2.0.5","pretty-quick":"^2.0.1","process":"^0.11.10","sinon":"^15.1.0","stream-browserify":"^3.0.0","ts-jest":"^29.0.5","ts-loader":"^9.4.2","ts-node":"^10.9.1","tslib":"^2.5.0","typescript":"^5.0.4","webpack":"^5.83.1","webpack-cli":"^5.1.1"},"dependencies":{"@stablelib/base64":"^2.0.0","@stablelib/utf8":"^2.0.0","@stellar/stellar-sdk":"15.0.1","axios":"^1.4.0","base64url":"^3.0.1","https-browserify":"^1.0.0","jws":"^4.0.0","lodash":"^4.17.21","query-string":"^7.1.3","stream-http":"^3.2.0","tweetnacl":"^1.0.3","url":"^0.11.0","util":"^0.12.5","utility-types":"^3.10.0","vm-browserify":"^1.1.2"},"scripts":{"test":"jest --watchAll","test:ci":"jest --ci","test:e2e:ci":"jest --config jest.e2e.config.js --ci","test:recovery:ci":"jest --config jest.integration.config.js recovery.test.ts --ci","test:anchorplatform:ci":"yarn jest --config jest.integration.config.js anchorplatform.test.ts --ci","build:web":"webpack --config webpack.config.js","build:node":"webpack --env NODE=true --config webpack.config.js","build":"run-p build:web build:node","example:sep10Server":"ts-node examples/sep10/sep10Server.ts","example:sep10Wallet":"ts-node examples/sep10/sep10Wallet.ts","example:sep24":"ts-node examples/sep24/sep24.ts","example:sep12":"ts-node examples/sep12/sep12.ts"}}');
56502
56513
 
56503
56514
  /***/ }),
56504
56515