@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
|
@@ -309,7 +309,7 @@ function createRequestId() {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
// connect/version.ts
|
|
312
|
-
var SDK_VERSION = "0.15.0
|
|
312
|
+
var SDK_VERSION = "0.15.0";
|
|
313
313
|
|
|
314
314
|
// connect/permissions.ts
|
|
315
315
|
var PERMISSION_SCOPES = {
|
|
@@ -369,8 +369,15 @@ var REALTIME_STATUS = {
|
|
|
369
369
|
function toLegacyRequest(view, status) {
|
|
370
370
|
return { ...view, symbol: view.symbol ?? "", status };
|
|
371
371
|
}
|
|
372
|
+
function paymentsOrNull(sphere) {
|
|
373
|
+
try {
|
|
374
|
+
return sphere.payments;
|
|
375
|
+
} catch {
|
|
376
|
+
return null;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
372
379
|
function legacyRequestPayload(sphere, update) {
|
|
373
|
-
const view = sphere
|
|
380
|
+
const view = paymentsOrNull(sphere)?.requests.list().find((request) => request.id === update.id);
|
|
374
381
|
if (!view) {
|
|
375
382
|
return {
|
|
376
383
|
id: update.id,
|
|
@@ -449,7 +456,7 @@ var COMPAT_ATTACHERS = /* @__PURE__ */ new Map([
|
|
|
449
456
|
forward({ providerId: "wallet-api", error: "wallet-api connection degraded" });
|
|
450
457
|
})],
|
|
451
458
|
["sync:completed", (sphere, forward) => sphere.on("inventory:updated", () => {
|
|
452
|
-
forward({ source: "payments", count: sphere
|
|
459
|
+
forward({ source: "payments", count: paymentsOrNull(sphere)?.tokens().length ?? 0 });
|
|
453
460
|
})],
|
|
454
461
|
["sync:remote-update", remoteUpdateAttacher]
|
|
455
462
|
]);
|