@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
|
@@ -4133,15 +4133,25 @@ function parseAmount(raw) {
|
|
|
4133
4133
|
function supportsDeterministicMint(engine) {
|
|
4134
4134
|
return engine.deterministicMint === true;
|
|
4135
4135
|
}
|
|
4136
|
-
function
|
|
4136
|
+
function makeCoalescedRefresh(refresh) {
|
|
4137
4137
|
let inFlight = false;
|
|
4138
|
-
|
|
4139
|
-
|
|
4138
|
+
let queued = false;
|
|
4139
|
+
const run = () => {
|
|
4140
4140
|
inFlight = true;
|
|
4141
4141
|
void refresh().catch(() => void 0).finally(() => {
|
|
4142
4142
|
inFlight = false;
|
|
4143
|
+
if (!queued) return;
|
|
4144
|
+
queued = false;
|
|
4145
|
+
run();
|
|
4143
4146
|
});
|
|
4144
4147
|
};
|
|
4148
|
+
return () => {
|
|
4149
|
+
if (inFlight) {
|
|
4150
|
+
queued = true;
|
|
4151
|
+
return;
|
|
4152
|
+
}
|
|
4153
|
+
run();
|
|
4154
|
+
};
|
|
4145
4155
|
}
|
|
4146
4156
|
function composeFacadeParts(deps, hooks) {
|
|
4147
4157
|
const ownPubkeyBytes = hexToBytes(deps.ownPubkey);
|
|
@@ -4264,10 +4274,8 @@ function buildReceive(deps, hooks, historyStore, heldStates, view) {
|
|
|
4264
4274
|
registry: deps.registry,
|
|
4265
4275
|
recordReceived: (record) => recordReceived(historyStore, record),
|
|
4266
4276
|
emit: (event, transfer) => deps.emit(event, transfer),
|
|
4267
|
-
//
|
|
4268
|
-
|
|
4269
|
-
// drains in a burst at the END — a slower version of the bug being fixed.
|
|
4270
|
-
refreshView: makeSingleFlightRefresh(() => view.delta()),
|
|
4277
|
+
// Coalesced — see makeCoalescedRefresh.
|
|
4278
|
+
refreshView: makeCoalescedRefresh(() => view.delta()),
|
|
4271
4279
|
attention: (transferId, code, detail) => {
|
|
4272
4280
|
deps.emit(
|
|
4273
4281
|
"transfer:attention",
|
|
@@ -4319,6 +4327,7 @@ var PaymentsFacade = class {
|
|
|
4319
4327
|
isActiveOp: (id) => this.activeMoneyOps.has(id)
|
|
4320
4328
|
});
|
|
4321
4329
|
this.view = parts.view;
|
|
4330
|
+
this.wakeRefresh = makeCoalescedRefresh(() => this.view.delta());
|
|
4322
4331
|
this.ledger = parts.ledger;
|
|
4323
4332
|
this.queue = parts.queue;
|
|
4324
4333
|
this.machine = parts.machine;
|
|
@@ -4348,6 +4357,7 @@ var PaymentsFacade = class {
|
|
|
4348
4357
|
now: () => this.nowMs()
|
|
4349
4358
|
});
|
|
4350
4359
|
}
|
|
4360
|
+
wakeRefresh;
|
|
4351
4361
|
prewarmed = new PrewarmCache();
|
|
4352
4362
|
view;
|
|
4353
4363
|
ledger;
|
|
@@ -4386,9 +4396,7 @@ var PaymentsFacade = class {
|
|
|
4386
4396
|
this.deps.session.subscribeStream("mailbox", () => {
|
|
4387
4397
|
this.trackTail(this.receiveLoop.drainOnce());
|
|
4388
4398
|
}),
|
|
4389
|
-
this.deps.session.subscribeStream("inventory",
|
|
4390
|
-
this.trackTail(this.view.delta());
|
|
4391
|
-
}),
|
|
4399
|
+
this.deps.session.subscribeStream("inventory", this.wakeRefresh),
|
|
4392
4400
|
this.deps.session.subscribeStream("payment_requests", () => {
|
|
4393
4401
|
this.trackTail(this.requests.drainIncoming());
|
|
4394
4402
|
})
|