@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.
- package/dist/connect/index.cjs +10 -3
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +10 -3
- package/dist/connect/index.js.map +1 -1
- package/dist/impl/browser/connect/index.cjs +10 -3
- package/dist/impl/browser/connect/index.cjs.map +1 -1
- package/dist/impl/browser/connect/index.js +10 -3
- package/dist/impl/browser/connect/index.js.map +1 -1
- package/dist/impl/nodejs/connect/index.cjs +9 -2
- package/dist/impl/nodejs/connect/index.cjs.map +1 -1
- package/dist/impl/nodejs/connect/index.js +9 -2
- package/dist/impl/nodejs/connect/index.js.map +1 -1
- package/package.json +2 -1
package/dist/connect/index.cjs
CHANGED
|
@@ -455,7 +455,7 @@ function checkCompatibility(input) {
|
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
// connect/version.ts
|
|
458
|
-
var SDK_VERSION = "0.15.0
|
|
458
|
+
var SDK_VERSION = "0.15.0";
|
|
459
459
|
|
|
460
460
|
// connect/permissions.ts
|
|
461
461
|
var PERMISSION_SCOPES = {
|
|
@@ -540,8 +540,15 @@ var REALTIME_STATUS = {
|
|
|
540
540
|
function toLegacyRequest(view, status) {
|
|
541
541
|
return { ...view, symbol: view.symbol ?? "", status };
|
|
542
542
|
}
|
|
543
|
+
function paymentsOrNull(sphere) {
|
|
544
|
+
try {
|
|
545
|
+
return sphere.payments;
|
|
546
|
+
} catch {
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
543
550
|
function legacyRequestPayload(sphere, update) {
|
|
544
|
-
const view = sphere
|
|
551
|
+
const view = paymentsOrNull(sphere)?.requests.list().find((request) => request.id === update.id);
|
|
545
552
|
if (!view) {
|
|
546
553
|
return {
|
|
547
554
|
id: update.id,
|
|
@@ -620,7 +627,7 @@ var COMPAT_ATTACHERS = /* @__PURE__ */ new Map([
|
|
|
620
627
|
forward({ providerId: "wallet-api", error: "wallet-api connection degraded" });
|
|
621
628
|
})],
|
|
622
629
|
["sync:completed", (sphere, forward) => sphere.on("inventory:updated", () => {
|
|
623
|
-
forward({ source: "payments", count: sphere
|
|
630
|
+
forward({ source: "payments", count: paymentsOrNull(sphere)?.tokens().length ?? 0 });
|
|
624
631
|
})],
|
|
625
632
|
["sync:remote-update", remoteUpdateAttacher]
|
|
626
633
|
]);
|