@partylayer/sdk 0.17.1 → 0.18.1
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/index.d.mts +20 -8
- package/dist/index.d.ts +20 -8
- package/dist/index.js +21 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -401,14 +401,26 @@ declare class PartyLayerClient {
|
|
|
401
401
|
*/
|
|
402
402
|
listWallets(filter?: WalletFilter): Promise<WalletInfo[]>;
|
|
403
403
|
/**
|
|
404
|
-
* Hide
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
|
|
411
|
-
|
|
404
|
+
* Hide registry entries whose wallet needs an app-registered adapter that is
|
|
405
|
+
* NOT registered. This is the library default (RainbowKit-style): never show a
|
|
406
|
+
* wallet the app cannot actually connect.
|
|
407
|
+
*
|
|
408
|
+
* A wallet is connectable with NO app adapter only when it is driven by the
|
|
409
|
+
* generic announce path (`adapter.transport: 'announce'`, e.g. Console, Send):
|
|
410
|
+
* there the SDK builds a generic announce adapter from the registry entry on
|
|
411
|
+
* demand, so installing the extension is enough and the entry stays visible.
|
|
412
|
+
* Every other transport can only connect through an adapter the app registered:
|
|
413
|
+
* a `discovery-adapter` popup/remote wallet whose official ProviderAdapter
|
|
414
|
+
* the app supplies (bridged under `toWalletId(providerId)`), or a wallet that
|
|
415
|
+
* ships a PartyLayer adapter package (Loop, Cantor8, Nightly, Bron,
|
|
416
|
+
* WalletConnect). Without that adapter, clicking the entry can only fail
|
|
417
|
+
* (connect throws), so it surfaces only when the adapter is present.
|
|
418
|
+
*
|
|
419
|
+
* The decision reads each entry's DECLARED transport, never a hardcoded wallet
|
|
420
|
+
* list. No-op when the registry is unavailable (the list is already
|
|
421
|
+
* adapters-only) or every non-announce entry is registered.
|
|
422
|
+
*/
|
|
423
|
+
private gateUnconnectableEntries;
|
|
412
424
|
/**
|
|
413
425
|
* If `walletId` maps to a registry entry with `transport: 'discovery-adapter'`,
|
|
414
426
|
* return the bits to build an actionable "register its adapter" error; else
|
package/dist/index.d.ts
CHANGED
|
@@ -401,14 +401,26 @@ declare class PartyLayerClient {
|
|
|
401
401
|
*/
|
|
402
402
|
listWallets(filter?: WalletFilter): Promise<WalletInfo[]>;
|
|
403
403
|
/**
|
|
404
|
-
* Hide
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
|
|
411
|
-
|
|
404
|
+
* Hide registry entries whose wallet needs an app-registered adapter that is
|
|
405
|
+
* NOT registered. This is the library default (RainbowKit-style): never show a
|
|
406
|
+
* wallet the app cannot actually connect.
|
|
407
|
+
*
|
|
408
|
+
* A wallet is connectable with NO app adapter only when it is driven by the
|
|
409
|
+
* generic announce path (`adapter.transport: 'announce'`, e.g. Console, Send):
|
|
410
|
+
* there the SDK builds a generic announce adapter from the registry entry on
|
|
411
|
+
* demand, so installing the extension is enough and the entry stays visible.
|
|
412
|
+
* Every other transport can only connect through an adapter the app registered:
|
|
413
|
+
* a `discovery-adapter` popup/remote wallet whose official ProviderAdapter
|
|
414
|
+
* the app supplies (bridged under `toWalletId(providerId)`), or a wallet that
|
|
415
|
+
* ships a PartyLayer adapter package (Loop, Cantor8, Nightly, Bron,
|
|
416
|
+
* WalletConnect). Without that adapter, clicking the entry can only fail
|
|
417
|
+
* (connect throws), so it surfaces only when the adapter is present.
|
|
418
|
+
*
|
|
419
|
+
* The decision reads each entry's DECLARED transport, never a hardcoded wallet
|
|
420
|
+
* list. No-op when the registry is unavailable (the list is already
|
|
421
|
+
* adapters-only) or every non-announce entry is registered.
|
|
422
|
+
*/
|
|
423
|
+
private gateUnconnectableEntries;
|
|
412
424
|
/**
|
|
413
425
|
* If `walletId` maps to a registry entry with `transport: 'discovery-adapter'`,
|
|
414
426
|
* return the bits to build an actionable "register its adapter" error; else
|
package/dist/index.js
CHANGED
|
@@ -1011,7 +1011,7 @@ var PartyLayerClient = class {
|
|
|
1011
1011
|
channel: "stable"
|
|
1012
1012
|
});
|
|
1013
1013
|
}
|
|
1014
|
-
registryWallets = await this.
|
|
1014
|
+
registryWallets = await this.gateUnconnectableEntries(registryWallets);
|
|
1015
1015
|
registryWallets = await this.aggregateAnnouncedWallets(registryWallets);
|
|
1016
1016
|
void this.warmDiscoveryPlans(registryWallets);
|
|
1017
1017
|
if (filter?.requiredCapabilities) {
|
|
@@ -1027,19 +1027,31 @@ var PartyLayerClient = class {
|
|
|
1027
1027
|
return registryWallets;
|
|
1028
1028
|
}
|
|
1029
1029
|
/**
|
|
1030
|
-
* Hide
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
*
|
|
1030
|
+
* Hide registry entries whose wallet needs an app-registered adapter that is
|
|
1031
|
+
* NOT registered. This is the library default (RainbowKit-style): never show a
|
|
1032
|
+
* wallet the app cannot actually connect.
|
|
1033
|
+
*
|
|
1034
|
+
* A wallet is connectable with NO app adapter only when it is driven by the
|
|
1035
|
+
* generic announce path (`adapter.transport: 'announce'`, e.g. Console, Send):
|
|
1036
|
+
* there the SDK builds a generic announce adapter from the registry entry on
|
|
1037
|
+
* demand, so installing the extension is enough and the entry stays visible.
|
|
1038
|
+
* Every other transport can only connect through an adapter the app registered:
|
|
1039
|
+
* a `discovery-adapter` popup/remote wallet whose official ProviderAdapter
|
|
1040
|
+
* the app supplies (bridged under `toWalletId(providerId)`), or a wallet that
|
|
1041
|
+
* ships a PartyLayer adapter package (Loop, Cantor8, Nightly, Bron,
|
|
1042
|
+
* WalletConnect). Without that adapter, clicking the entry can only fail
|
|
1043
|
+
* (connect throws), so it surfaces only when the adapter is present.
|
|
1044
|
+
*
|
|
1045
|
+
* The decision reads each entry's DECLARED transport, never a hardcoded wallet
|
|
1046
|
+
* list. No-op when the registry is unavailable (the list is already
|
|
1047
|
+
* adapters-only) or every non-announce entry is registered.
|
|
1036
1048
|
*/
|
|
1037
|
-
async
|
|
1049
|
+
async gateUnconnectableEntries(wallets) {
|
|
1038
1050
|
let hidden = null;
|
|
1039
1051
|
try {
|
|
1040
1052
|
const registry = await this.registryClient.getRegistry();
|
|
1041
1053
|
for (const entry of registry.wallets) {
|
|
1042
|
-
if (entry.adapter?.transport
|
|
1054
|
+
if (entry.adapter?.transport === "announce") continue;
|
|
1043
1055
|
const walletId = core.toWalletId(entry.id);
|
|
1044
1056
|
if (!this.adapters.has(walletId)) {
|
|
1045
1057
|
(hidden ??= /* @__PURE__ */ new Set()).add(String(walletId));
|