@stellar/typescript-wallet-sdk 5.0.0-beta.1788566740000 → 5.0.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 CHANGED
@@ -20,6 +20,7 @@
20
20
  ### Fixed
21
21
  * SEP-7 signatures and transaction URIs are correctly base64-encoded. Under stellar-sdk v17 the previous `Buffer`-era code produced comma-joined decimals, which made a signed `Sep7Tx` URI unparseable
22
22
  * The SEP-10 `client_domain` integrity check compares transaction hashes correctly again — it used `Buffer#equals`, which does not exist on `Uint8Array`
23
+ * `Watcher` treats `on_hold` as a transient status. `TransactionStatus.on_hold` documents itself as a temporary state — an anchor holding a transfer for review, after which "transaction should follow the regular flow" — but neither watcher recognised it as in progress. `watchOneTransaction` fell through to its terminal branch and invoked `onError` before stopping its poll, so a transfer merely awaiting a compliance check was reported to the caller as a failure and then abandoned; `watchAllTransactions` filed it in the ignored registry and omitted it from the first poll entirely. Both now treat it like `incomplete` and the `pending_*` statuses, so the transaction keeps being watched and surfaces through `onMessage` until it reaches a genuinely final status (#251)
23
24
 
24
25
  ### Known limitations
25
26
  * SEP-12 binary upload (`Customer.add`/`update` with `sep9BinaryInfo`) is not usable on React Native. axios's `toFormData` takes a `Buffer.from(value)` path for typed-array values whenever `FormData` is not spec-compliant, which is the case on React Native. That path was already non-functional there — React Native's `FormData.append` cannot consume a `Buffer` part — so this is a change of failure mode, not of capability: with the polyfill removed it now raises `ReferenceError` instead of producing silent garbage. Browsers and Node.js are unaffected
package/lib/bundle.js CHANGED
@@ -6573,7 +6573,8 @@ var Watcher = /** @class */ (function () {
6573
6573
  try {
6574
6574
  var newTransactions = transactions.filter(function (transaction) {
6575
6575
  var isInProgress = transaction.status.indexOf("pending") === 0 ||
6576
- transaction.status === Types_1.TransactionStatus.incomplete;
6576
+ transaction.status === Types_1.TransactionStatus.incomplete ||
6577
+ transaction.status === Types_1.TransactionStatus.on_hold;
6577
6578
  var registeredTransaction = _this._transactionsRegistry[assetCode][transaction.id];
6578
6579
  // if this is the first watch, only keep the pending ones
6579
6580
  if (!isRetry) {
@@ -6659,7 +6660,7 @@ var Watcher = /** @class */ (function () {
6659
6660
  };
6660
6661
  /**
6661
6662
  * Watch a transaction until it stops pending. Takes three callbacks:
6662
- * * onMessage - When the transaction comes back as pending_ or incomplete.
6663
+ * * onMessage - When the transaction comes back as pending_, incomplete, or on_hold.
6663
6664
  * * onSuccess - When the transaction comes back as completed / refunded / expired.
6664
6665
  * * onError - When there's a runtime error, or the transaction comes back as
6665
6666
  * no_market / too_small / too_large / error.
@@ -6731,7 +6732,8 @@ var Watcher = /** @class */ (function () {
6731
6732
  }
6732
6733
  _this._transactionsRegistry[assetCode][transaction.id] = transaction;
6733
6734
  if (transaction.status.indexOf("pending") === 0 ||
6734
- transaction.status === Types_1.TransactionStatus.incomplete) {
6735
+ transaction.status === Types_1.TransactionStatus.incomplete ||
6736
+ transaction.status === Types_1.TransactionStatus.on_hold) {
6735
6737
  if (_this._oneTransactionWatcher[assetCode][id]) {
6736
6738
  clearTimeout(_this._oneTransactionWatcher[assetCode][id]);
6737
6739
  }