@swype-org/deposit 0.3.22 → 0.3.23
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/{chunk-NZ7DOPZ5.js → chunk-JD7GTL6D.js} +11 -4
- package/dist/chunk-JD7GTL6D.js.map +1 -0
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +9 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-NZ7DOPZ5.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ALLOWED_RPC_METHODS, BRIDGE_PROTOCOL_VERSION, Checkout, CheckoutError, DEFAULT_WEBVIEW_BASE_URL, Deposit, DepositError, SANDBOX_WEBVIEW_BASE_URL, attachRpcHost, createWalletDiscoverer, getDisplayMessage, parseBridgeMessage } from './chunk-
|
|
1
|
+
export { ALLOWED_RPC_METHODS, BRIDGE_PROTOCOL_VERSION, Checkout, CheckoutError, DEFAULT_WEBVIEW_BASE_URL, Deposit, DepositError, SANDBOX_WEBVIEW_BASE_URL, attachRpcHost, createWalletDiscoverer, getDisplayMessage, parseBridgeMessage } from './chunk-JD7GTL6D.js';
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
var VERSION = "0.3.0";
|
package/dist/react.cjs
CHANGED
|
@@ -337,13 +337,20 @@ function attachRpcHost(options) {
|
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
|
|
340
|
+
let lastAdvertisedKey = null;
|
|
341
|
+
function advertiseWallets(snapshot, opts) {
|
|
341
342
|
const wallets = snapshot.map((entry) => ({
|
|
342
343
|
uuid: entry.info.uuid,
|
|
343
344
|
rdns: entry.info.rdns,
|
|
344
345
|
name: entry.info.name,
|
|
345
346
|
icon: entry.info.icon
|
|
346
347
|
}));
|
|
348
|
+
const key = JSON.stringify(wallets.map((w) => [w.uuid, w.rdns, w.name, w.icon]));
|
|
349
|
+
if (!opts?.force && key === lastAdvertisedKey) {
|
|
350
|
+
log("skipping identical re-advertisement", { count: wallets.length });
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
lastAdvertisedKey = key;
|
|
347
354
|
console.info("[blink-bridge:parent] advertising wallets", wallets.map((w) => ({
|
|
348
355
|
rdns: w.rdns,
|
|
349
356
|
name: w.name
|
|
@@ -424,7 +431,7 @@ function attachRpcHost(options) {
|
|
|
424
431
|
if (!message) return;
|
|
425
432
|
switch (message.type) {
|
|
426
433
|
case "blink:bridge-hello": {
|
|
427
|
-
advertiseWallets(discoverer.list());
|
|
434
|
+
advertiseWallets(discoverer.list(), { force: true });
|
|
428
435
|
discoverer.requestProviders();
|
|
429
436
|
return;
|
|
430
437
|
}
|