@unicitylabs/sphere-sdk 0.15.0-dev.1 → 0.15.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.
@@ -406,7 +406,7 @@ function checkCompatibility(input) {
406
406
  }
407
407
 
408
408
  // connect/version.ts
409
- var SDK_VERSION = "0.15.0-dev.1";
409
+ var SDK_VERSION = "0.15.0";
410
410
 
411
411
  // connect/permissions.ts
412
412
  var PERMISSION_SCOPES = {
@@ -491,8 +491,15 @@ var REALTIME_STATUS = {
491
491
  function toLegacyRequest(view, status) {
492
492
  return { ...view, symbol: view.symbol ?? "", status };
493
493
  }
494
+ function paymentsOrNull(sphere) {
495
+ try {
496
+ return sphere.payments;
497
+ } catch {
498
+ return null;
499
+ }
500
+ }
494
501
  function legacyRequestPayload(sphere, update) {
495
- const view = sphere.payments.requests.list().find((request) => request.id === update.id);
502
+ const view = paymentsOrNull(sphere)?.requests.list().find((request) => request.id === update.id);
496
503
  if (!view) {
497
504
  return {
498
505
  id: update.id,
@@ -571,7 +578,7 @@ var COMPAT_ATTACHERS = /* @__PURE__ */ new Map([
571
578
  forward({ providerId: "wallet-api", error: "wallet-api connection degraded" });
572
579
  })],
573
580
  ["sync:completed", (sphere, forward) => sphere.on("inventory:updated", () => {
574
- forward({ source: "payments", count: sphere.payments.tokens().length });
581
+ forward({ source: "payments", count: paymentsOrNull(sphere)?.tokens().length ?? 0 });
575
582
  })],
576
583
  ["sync:remote-update", remoteUpdateAttacher]
577
584
  ]);