@beam-network/sdk 0.5.7 → 0.5.8

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.
@@ -113,6 +113,8 @@ export class BeamTransferControl {
113
113
  callback: (_error, message) => {
114
114
  if (!active)
115
115
  return;
116
+ if (_error || !isRouteRecoveryRequestMessage(message))
117
+ return;
116
118
  void (async () => {
117
119
  let request = null;
118
120
  try {
@@ -725,6 +727,13 @@ export function isRetryableLifecycleError(error) {
725
727
  "network"
726
728
  ].some((token) => combined.includes(token));
727
729
  }
730
+ function isRouteRecoveryRequestMessage(message) {
731
+ return Boolean(message
732
+ && typeof message === "object"
733
+ && "data" in message
734
+ && message.data instanceof Uint8Array
735
+ && typeof message.respond === "function");
736
+ }
728
737
  export function isRecoverableRouteStreamError(error) {
729
738
  if (isRetryableLifecycleError(error))
730
739
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beam-network/sdk",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "TypeScript SDK for BEAM transfer creation and management.",
5
5
  "type": "module",
6
6
  "license": "MIT",