@unicitylabs/sphere-sdk 0.14.11-dev.5 → 0.14.11-dev.6
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 +1 -1
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +1 -1
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +18 -10
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +18 -10
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/connect/index.cjs +1 -1
- package/dist/impl/browser/connect/index.cjs.map +1 -1
- package/dist/impl/browser/connect/index.js +1 -1
- package/dist/impl/browser/connect/index.js.map +1 -1
- package/dist/index.cjs +18 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -10
- package/dist/index.js.map +1 -1
- package/dist/modules/payments-v2/index.cjs +18 -10
- package/dist/modules/payments-v2/index.cjs.map +1 -1
- package/dist/modules/payments-v2/index.d.cts +1 -0
- package/dist/modules/payments-v2/index.d.ts +1 -0
- package/dist/modules/payments-v2/index.js +18 -10
- package/dist/modules/payments-v2/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.cjs
CHANGED
|
@@ -13905,15 +13905,25 @@ function parseAmount(raw) {
|
|
|
13905
13905
|
function supportsDeterministicMint(engine) {
|
|
13906
13906
|
return engine.deterministicMint === true;
|
|
13907
13907
|
}
|
|
13908
|
-
function
|
|
13908
|
+
function makeCoalescedRefresh(refresh) {
|
|
13909
13909
|
let inFlight = false;
|
|
13910
|
-
|
|
13911
|
-
|
|
13910
|
+
let queued = false;
|
|
13911
|
+
const run = () => {
|
|
13912
13912
|
inFlight = true;
|
|
13913
13913
|
void refresh().catch(() => void 0).finally(() => {
|
|
13914
13914
|
inFlight = false;
|
|
13915
|
+
if (!queued) return;
|
|
13916
|
+
queued = false;
|
|
13917
|
+
run();
|
|
13915
13918
|
});
|
|
13916
13919
|
};
|
|
13920
|
+
return () => {
|
|
13921
|
+
if (inFlight) {
|
|
13922
|
+
queued = true;
|
|
13923
|
+
return;
|
|
13924
|
+
}
|
|
13925
|
+
run();
|
|
13926
|
+
};
|
|
13917
13927
|
}
|
|
13918
13928
|
function composeFacadeParts(deps, hooks) {
|
|
13919
13929
|
const ownPubkeyBytes = hexToBytes4(deps.ownPubkey);
|
|
@@ -14036,10 +14046,8 @@ function buildReceive(deps, hooks, historyStore, heldStates, view) {
|
|
|
14036
14046
|
registry: deps.registry,
|
|
14037
14047
|
recordReceived: (record) => recordReceived(historyStore, record),
|
|
14038
14048
|
emit: (event, transfer) => deps.emit(event, transfer),
|
|
14039
|
-
//
|
|
14040
|
-
|
|
14041
|
-
// drains in a burst at the END — a slower version of the bug being fixed.
|
|
14042
|
-
refreshView: makeSingleFlightRefresh(() => view.delta()),
|
|
14049
|
+
// Coalesced — see makeCoalescedRefresh.
|
|
14050
|
+
refreshView: makeCoalescedRefresh(() => view.delta()),
|
|
14043
14051
|
attention: (transferId, code, detail) => {
|
|
14044
14052
|
deps.emit(
|
|
14045
14053
|
"transfer:attention",
|
|
@@ -14091,6 +14099,7 @@ var PaymentsFacade = class {
|
|
|
14091
14099
|
isActiveOp: (id) => this.activeMoneyOps.has(id)
|
|
14092
14100
|
});
|
|
14093
14101
|
this.view = parts.view;
|
|
14102
|
+
this.wakeRefresh = makeCoalescedRefresh(() => this.view.delta());
|
|
14094
14103
|
this.ledger = parts.ledger;
|
|
14095
14104
|
this.queue = parts.queue;
|
|
14096
14105
|
this.machine = parts.machine;
|
|
@@ -14120,6 +14129,7 @@ var PaymentsFacade = class {
|
|
|
14120
14129
|
now: () => this.nowMs()
|
|
14121
14130
|
});
|
|
14122
14131
|
}
|
|
14132
|
+
wakeRefresh;
|
|
14123
14133
|
prewarmed = new PrewarmCache();
|
|
14124
14134
|
view;
|
|
14125
14135
|
ledger;
|
|
@@ -14158,9 +14168,7 @@ var PaymentsFacade = class {
|
|
|
14158
14168
|
this.deps.session.subscribeStream("mailbox", () => {
|
|
14159
14169
|
this.trackTail(this.receiveLoop.drainOnce());
|
|
14160
14170
|
}),
|
|
14161
|
-
this.deps.session.subscribeStream("inventory",
|
|
14162
|
-
this.trackTail(this.view.delta());
|
|
14163
|
-
}),
|
|
14171
|
+
this.deps.session.subscribeStream("inventory", this.wakeRefresh),
|
|
14164
14172
|
this.deps.session.subscribeStream("payment_requests", () => {
|
|
14165
14173
|
this.trackTail(this.requests.drainIncoming());
|
|
14166
14174
|
})
|