@partylayer/sdk 0.17.1 → 0.18.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/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 +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1015,7 +1015,7 @@ var PartyLayerClient = class {
|
|
|
1015
1015
|
channel: "stable"
|
|
1016
1016
|
});
|
|
1017
1017
|
}
|
|
1018
|
-
registryWallets = await this.
|
|
1018
|
+
registryWallets = await this.gateUnconnectableEntries(registryWallets);
|
|
1019
1019
|
registryWallets = await this.aggregateAnnouncedWallets(registryWallets);
|
|
1020
1020
|
void this.warmDiscoveryPlans(registryWallets);
|
|
1021
1021
|
if (filter?.requiredCapabilities) {
|
|
@@ -1031,19 +1031,31 @@ var PartyLayerClient = class {
|
|
|
1031
1031
|
return registryWallets;
|
|
1032
1032
|
}
|
|
1033
1033
|
/**
|
|
1034
|
-
* Hide
|
|
1035
|
-
*
|
|
1036
|
-
*
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1039
|
-
*
|
|
1034
|
+
* Hide registry entries whose wallet needs an app-registered adapter that is
|
|
1035
|
+
* NOT registered. This is the library default (RainbowKit-style): never show a
|
|
1036
|
+
* wallet the app cannot actually connect.
|
|
1037
|
+
*
|
|
1038
|
+
* A wallet is connectable with NO app adapter only when it is driven by the
|
|
1039
|
+
* generic announce path (`adapter.transport: 'announce'`, e.g. Console, Send):
|
|
1040
|
+
* there the SDK builds a generic announce adapter from the registry entry on
|
|
1041
|
+
* demand, so installing the extension is enough and the entry stays visible.
|
|
1042
|
+
* Every other transport can only connect through an adapter the app registered:
|
|
1043
|
+
* a `discovery-adapter` popup/remote wallet whose official ProviderAdapter
|
|
1044
|
+
* the app supplies (bridged under `toWalletId(providerId)`), or a wallet that
|
|
1045
|
+
* ships a PartyLayer adapter package (Loop, Cantor8, Nightly, Bron,
|
|
1046
|
+
* WalletConnect). Without that adapter, clicking the entry can only fail
|
|
1047
|
+
* (connect throws), so it surfaces only when the adapter is present.
|
|
1048
|
+
*
|
|
1049
|
+
* The decision reads each entry's DECLARED transport, never a hardcoded wallet
|
|
1050
|
+
* list. No-op when the registry is unavailable (the list is already
|
|
1051
|
+
* adapters-only) or every non-announce entry is registered.
|
|
1040
1052
|
*/
|
|
1041
|
-
async
|
|
1053
|
+
async gateUnconnectableEntries(wallets) {
|
|
1042
1054
|
let hidden = null;
|
|
1043
1055
|
try {
|
|
1044
1056
|
const registry = await this.registryClient.getRegistry();
|
|
1045
1057
|
for (const entry of registry.wallets) {
|
|
1046
|
-
if (entry.adapter?.transport
|
|
1058
|
+
if (entry.adapter?.transport === "announce") continue;
|
|
1047
1059
|
const walletId = toWalletId(entry.id);
|
|
1048
1060
|
if (!this.adapters.has(walletId)) {
|
|
1049
1061
|
(hidden ??= /* @__PURE__ */ new Set()).add(String(walletId));
|