@unicitylabs/sphere-sdk 0.14.11 → 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/README.md +55 -17
- package/dist/connect/index.cjs +17 -17
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +17 -17
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +69 -84
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +5 -14
- package/dist/core/index.d.ts +5 -14
- package/dist/core/index.js +69 -84
- package/dist/core/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/browser/index.cjs.map +1 -1
- package/dist/impl/browser/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/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/impl/wallet-api-v2/index.cjs +92 -92
- package/dist/impl/wallet-api-v2/index.cjs.map +1 -1
- package/dist/impl/wallet-api-v2/index.js +92 -92
- package/dist/impl/wallet-api-v2/index.js.map +1 -1
- package/dist/index.cjs +69 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -11
- package/dist/index.d.ts +6 -11
- package/dist/index.js +69 -84
- package/dist/index.js.map +1 -1
- package/dist/modules/payments-v2/index.cjs +116 -174
- package/dist/modules/payments-v2/index.cjs.map +1 -1
- package/dist/modules/payments-v2/index.d.cts +3 -5
- package/dist/modules/payments-v2/index.d.ts +3 -5
- package/dist/modules/payments-v2/index.js +114 -173
- package/dist/modules/payments-v2/index.js.map +1 -1
- package/dist/token-engine/index.cjs +43 -57
- package/dist/token-engine/index.cjs.map +1 -1
- package/dist/token-engine/index.d.cts +0 -4
- package/dist/token-engine/index.d.ts +0 -4
- package/dist/token-engine/index.js +43 -57
- package/dist/token-engine/index.js.map +1 -1
- package/package.json +3 -2
|
@@ -393,8 +393,15 @@ var REALTIME_STATUS = {
|
|
|
393
393
|
function toLegacyRequest(view, status) {
|
|
394
394
|
return { ...view, symbol: view.symbol ?? "", status };
|
|
395
395
|
}
|
|
396
|
+
function paymentsOrNull(sphere) {
|
|
397
|
+
try {
|
|
398
|
+
return sphere.payments;
|
|
399
|
+
} catch {
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
396
403
|
function legacyRequestPayload(sphere, update) {
|
|
397
|
-
const view = sphere
|
|
404
|
+
const view = paymentsOrNull(sphere)?.requests.list().find((request) => request.id === update.id);
|
|
398
405
|
if (!view) {
|
|
399
406
|
return {
|
|
400
407
|
id: update.id,
|
|
@@ -473,7 +480,7 @@ var COMPAT_ATTACHERS = /* @__PURE__ */ new Map([
|
|
|
473
480
|
forward({ providerId: "wallet-api", error: "wallet-api connection degraded" });
|
|
474
481
|
})],
|
|
475
482
|
["sync:completed", (sphere, forward) => sphere.on("inventory:updated", () => {
|
|
476
|
-
forward({ source: "payments", count: sphere
|
|
483
|
+
forward({ source: "payments", count: paymentsOrNull(sphere)?.tokens().length ?? 0 });
|
|
477
484
|
})],
|
|
478
485
|
["sync:remote-update", remoteUpdateAttacher]
|
|
479
486
|
]);
|