@lydianpay/lydianconnect 1.1.3 → 1.2.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/README.md +2 -6
- package/dist/index.cjs +308 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +308 -11
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -42,9 +42,5 @@ lc.on((event) => {
|
|
|
42
42
|
|
|
43
43
|
## Supported wallets
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
**WalletConnect:** Rainbow, Trust Wallet, OKX Wallet, Crypto.com, Phantom, Zerion,
|
|
48
|
-
Argent, Ledger, 1inch, SafePal, imToken, TokenPocket, Blockchain.com, Exodus,
|
|
49
|
-
Ronin Wallet, Coin98, Bitget Wallet, Infinity Wallet, Atomic Wallet, AlphaWallet,
|
|
50
|
-
MathWallet, BitPay — each with native deep-linking.
|
|
45
|
+
The canonical list of supported wallets lives in
|
|
46
|
+
[`@lydianpay/lydianconnect-catalog`](https://www.npmjs.com/package/@lydianpay/lydianconnect-catalog).
|
package/dist/index.cjs
CHANGED
|
@@ -36,18 +36,23 @@ var ConnectManager = class {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* WalletConnect for a non-EVM chain
|
|
39
|
+
* The connector claiming this walletId if it serves the requested namespace
|
|
40
|
+
* AND is currently available, else the fallback. So an EVM-only SDK connector
|
|
41
|
+
* is bypassed to WalletConnect for a non-EVM chain, and the injected connector
|
|
42
|
+
* is bypassed when the wallet's extension hasn't announced a provider. The host
|
|
43
|
+
* app is oblivious. SDK connectors report `isAvailable` synchronously as `true`,
|
|
44
|
+
* so this only awaits for connectors that actually probe (e.g. injected).
|
|
42
45
|
*/
|
|
43
|
-
resolve(walletId, namespaceName) {
|
|
46
|
+
async resolve(walletId, namespaceName) {
|
|
44
47
|
const claimed = this.byWallet.get(walletId);
|
|
45
|
-
if (claimed && claimed.servesNamespace(namespaceName)
|
|
48
|
+
if (claimed && claimed.servesNamespace(namespaceName) && await claimed.isAvailable(walletId))
|
|
49
|
+
return claimed;
|
|
46
50
|
return this.fallback;
|
|
47
51
|
}
|
|
48
52
|
async connect(req) {
|
|
49
53
|
if (!this.started) await this.init();
|
|
50
|
-
const
|
|
54
|
+
const connector = await this.resolve(req.walletId, req.namespace.name);
|
|
55
|
+
const connection = await connector.connect(req);
|
|
51
56
|
this.connections.set(req.walletId, connection);
|
|
52
57
|
this.emit({ type: "connect", walletId: req.walletId, connection });
|
|
53
58
|
return connection;
|
|
@@ -132,6 +137,100 @@ function buildNamespace(chainId) {
|
|
|
132
137
|
};
|
|
133
138
|
}
|
|
134
139
|
|
|
140
|
+
// node_modules/@lydianpay/lydianconnect-catalog/dist/index.js
|
|
141
|
+
var ICON_BASE = "https://wallet-assets.lydian.com/wallets";
|
|
142
|
+
var WALLETS = [
|
|
143
|
+
{ id: "metamask", name: "MetaMask", namespaces: ["eip155"] },
|
|
144
|
+
{ id: "trust", name: "Trust", namespaces: ["eip155", "solana"] },
|
|
145
|
+
{ id: "rainbow", name: "Rainbow", namespaces: ["eip155"] },
|
|
146
|
+
{ id: "coinbase", name: "Coinbase", namespaces: ["eip155", "solana"] },
|
|
147
|
+
{ id: "zerion", name: "Zerion", namespaces: ["eip155"] },
|
|
148
|
+
{ id: "tokenpocket", name: "Token Pocket", namespaces: ["eip155", "solana"] },
|
|
149
|
+
{ id: "blockchaincom", name: "Blockchain.com", namespaces: ["bip122", "eip155", "solana"] },
|
|
150
|
+
{ id: "exodus", name: "Exodus", namespaces: ["eip155", "solana"] },
|
|
151
|
+
{ id: "phantom", name: "Phantom", namespaces: ["bip122", "eip155", "solana"] },
|
|
152
|
+
{ id: "okx", name: "OKX", namespaces: ["bip122", "eip155", "solana"] },
|
|
153
|
+
{ id: "cryptocom", name: "Crypto.com", namespaces: ["bip122", "eip155", "solana"] },
|
|
154
|
+
{ id: "argent", name: "Argent", namespaces: ["eip155"] },
|
|
155
|
+
{ id: "safepal", name: "SafePal", namespaces: ["eip155", "solana", "ton"] },
|
|
156
|
+
{ id: "imtoken", name: "imToken", namespaces: ["eip155"] },
|
|
157
|
+
{ id: "ronin", name: "Ronin", namespaces: ["eip155"] },
|
|
158
|
+
{ id: "coin98", name: "Coin98", namespaces: ["eip155", "solana"] },
|
|
159
|
+
{ id: "bitkeep", name: "Bitget Wallet", namespaces: ["eip155", "solana"] },
|
|
160
|
+
{ id: "1inch", name: "1inch", namespaces: ["eip155", "solana"] },
|
|
161
|
+
{ id: "ledgerlive", name: "Ledger Live", namespaces: ["bip122", "eip155", "solana"] },
|
|
162
|
+
{ id: "atomic", name: "Atomic", namespaces: ["bip122", "eip155", "solana"] },
|
|
163
|
+
{ id: "alpha", name: "Alpha", namespaces: ["eip155"] },
|
|
164
|
+
{ id: "math", name: "Math", namespaces: ["eip155", "solana"] },
|
|
165
|
+
{ id: "bitpay", name: "BitPay", namespaces: ["eip155"] },
|
|
166
|
+
{ id: "rabby", name: "Rabby", namespaces: ["eip155"] },
|
|
167
|
+
{ id: "bybit", name: "Bybit", namespaces: ["eip155", "solana"] },
|
|
168
|
+
{ id: "binance", name: "Binance", namespaces: ["eip155", "solana"] },
|
|
169
|
+
{ id: "gate", name: "Gate Wallet", namespaces: ["eip155"] },
|
|
170
|
+
{ id: "core", name: "Core", namespaces: ["eip155", "solana"] },
|
|
171
|
+
{ id: "backpack", name: "Backpack", namespaces: ["eip155", "solana"] },
|
|
172
|
+
{ id: "frontier", name: "Frontier", namespaces: ["eip155"] },
|
|
173
|
+
{ id: "onekey", name: "OneKey", namespaces: ["eip155"] },
|
|
174
|
+
{ id: "kraken", name: "Kraken", namespaces: ["eip155", "solana"] },
|
|
175
|
+
{ id: "uniswap", name: "Uniswap Wallet", namespaces: ["eip155"] },
|
|
176
|
+
{ id: "omni", name: "Omni", namespaces: ["eip155"] },
|
|
177
|
+
{ id: "mew", name: "MEW Wallet", namespaces: ["eip155"] },
|
|
178
|
+
{ id: "foxwallet", name: "FoxWallet", namespaces: ["eip155"] },
|
|
179
|
+
{ id: "nova", name: "Nova Wallet", namespaces: ["eip155"] },
|
|
180
|
+
{ id: "subwallet", name: "SubWallet", namespaces: ["eip155"] },
|
|
181
|
+
{ id: "safe", name: "Safe", namespaces: ["eip155"] },
|
|
182
|
+
{ id: "robinhood", name: "Robinhood Wallet", namespaces: ["eip155"] },
|
|
183
|
+
{ id: "tangem", name: "Tangem", namespaces: ["eip155", "solana"] },
|
|
184
|
+
{ id: "trezor", name: "Trezor", namespaces: ["bip122", "eip155", "solana"] },
|
|
185
|
+
{ id: "kucoin", name: "KuCoin", namespaces: ["eip155", "solana"] },
|
|
186
|
+
{ id: "jupiter", name: "Jupiter", namespaces: ["solana"] },
|
|
187
|
+
{ id: "zengo", name: "Zengo", namespaces: ["eip155"] },
|
|
188
|
+
{ id: "bitcoincom", name: "Bitcoin.com", namespaces: ["eip155"] },
|
|
189
|
+
{ id: "keplr", name: "Keplr", namespaces: ["eip155"] },
|
|
190
|
+
{ id: "cake", name: "Cake Wallet", namespaces: ["eip155", "solana"] },
|
|
191
|
+
{ id: "unstoppable", name: "Unstoppable", namespaces: ["eip155"] },
|
|
192
|
+
{ id: "bifrost", name: "Bifrost", namespaces: ["bip122", "eip155"] },
|
|
193
|
+
{ id: "pintu", name: "Pintu", namespaces: ["eip155"] },
|
|
194
|
+
{ id: "hot", name: "HOT Wallet", namespaces: ["eip155", "solana"] },
|
|
195
|
+
{ id: "arculus", name: "Arculus", namespaces: ["bip122", "eip155", "solana"] }
|
|
196
|
+
];
|
|
197
|
+
var EXTENSIONS = {
|
|
198
|
+
metamask: {
|
|
199
|
+
rdns: "io.metamask",
|
|
200
|
+
extensionUrl: "https://chromewebstore.google.com/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn"
|
|
201
|
+
},
|
|
202
|
+
trust: {
|
|
203
|
+
rdns: "com.trustwallet.app",
|
|
204
|
+
extensionUrl: "https://chromewebstore.google.com/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph"
|
|
205
|
+
},
|
|
206
|
+
rabby: {
|
|
207
|
+
rdns: "io.rabby",
|
|
208
|
+
extensionUrl: "https://chromewebstore.google.com/detail/rabby-wallet/acmacodkjbdgmoleebolmdjonilkdbch"
|
|
209
|
+
},
|
|
210
|
+
okx: {
|
|
211
|
+
// Legacy "okex" brand retained in the extension's rdns after the 2022 rebrand.
|
|
212
|
+
rdns: "com.okex.wallet",
|
|
213
|
+
extensionUrl: "https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge"
|
|
214
|
+
},
|
|
215
|
+
phantom: {
|
|
216
|
+
rdns: "app.phantom",
|
|
217
|
+
extensionUrl: "https://chromewebstore.google.com/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa"
|
|
218
|
+
},
|
|
219
|
+
zerion: {
|
|
220
|
+
rdns: "io.zerion",
|
|
221
|
+
extensionUrl: "https://chromewebstore.google.com/detail/zerion-wallet-crypto-defi/klghhnkeealcohjjanjjdaeeggmfmlpl"
|
|
222
|
+
},
|
|
223
|
+
rainbow: {
|
|
224
|
+
rdns: "me.rainbow",
|
|
225
|
+
extensionUrl: "https://chromewebstore.google.com/detail/rainbow/opfgelmcmbiajamepnmloijbpoleiama"
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
var WALLET_CATALOG = WALLETS.map((w) => ({
|
|
229
|
+
...w,
|
|
230
|
+
iconUrl: `${ICON_BASE}/${w.id}.png`,
|
|
231
|
+
...EXTENSIONS[w.id] ?? {}
|
|
232
|
+
}));
|
|
233
|
+
|
|
135
234
|
// src/core/connector.ts
|
|
136
235
|
var BaseConnector = class {
|
|
137
236
|
constructor() {
|
|
@@ -388,6 +487,159 @@ function evmChainIds(req) {
|
|
|
388
487
|
return Number.isFinite(n) && n > 0 ? [n] : void 0;
|
|
389
488
|
}
|
|
390
489
|
|
|
490
|
+
// src/connectors/injected/connector.ts
|
|
491
|
+
var DISCOVERY_WAIT_MS = 100;
|
|
492
|
+
var InjectedConnector = class extends BaseConnector {
|
|
493
|
+
constructor(rdnsByWallet) {
|
|
494
|
+
super();
|
|
495
|
+
this.rdnsByWallet = rdnsByWallet;
|
|
496
|
+
this.type = "injected";
|
|
497
|
+
/** rdns -> the provider it announced. Populated by EIP-6963 discovery. */
|
|
498
|
+
this.discovered = /* @__PURE__ */ new Map();
|
|
499
|
+
/**
|
|
500
|
+
* Providers we've already attached listeners to. Bind once and keep for the
|
|
501
|
+
* page's life (never remove) so a reconnect doesn't stack duplicate listeners.
|
|
502
|
+
* EIP-6963 announces exactly one provider per rdns, so a given provider maps to
|
|
503
|
+
* a single walletId — closing over walletId in bindEvents is safe.
|
|
504
|
+
*/
|
|
505
|
+
this.bound = /* @__PURE__ */ new WeakSet();
|
|
506
|
+
this.listening = false;
|
|
507
|
+
this.walletIds = Object.keys(rdnsByWallet);
|
|
508
|
+
this.startDiscovery();
|
|
509
|
+
}
|
|
510
|
+
/** Listen for provider announcements, then ask installed extensions to announce. */
|
|
511
|
+
startDiscovery() {
|
|
512
|
+
if (this.listening || typeof window === "undefined") return;
|
|
513
|
+
this.listening = true;
|
|
514
|
+
window.addEventListener("eip6963:announceProvider", (event) => {
|
|
515
|
+
const detail = event.detail;
|
|
516
|
+
if (detail?.info?.rdns && detail.provider) this.discovered.set(detail.info.rdns, detail);
|
|
517
|
+
});
|
|
518
|
+
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
519
|
+
}
|
|
520
|
+
servesNamespace(name) {
|
|
521
|
+
return name === "eip155";
|
|
522
|
+
}
|
|
523
|
+
/** Available iff the wallet's extension has announced an injected provider. */
|
|
524
|
+
async isAvailable(walletId) {
|
|
525
|
+
if (typeof window === "undefined") return false;
|
|
526
|
+
const rdns = this.rdnsByWallet[walletId];
|
|
527
|
+
if (!rdns) return false;
|
|
528
|
+
if (this.discovered.has(rdns)) return true;
|
|
529
|
+
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
530
|
+
await new Promise((resolve) => setTimeout(resolve, DISCOVERY_WAIT_MS));
|
|
531
|
+
return this.discovered.has(rdns);
|
|
532
|
+
}
|
|
533
|
+
async connect(req) {
|
|
534
|
+
const provider = this.providerFor(req.walletId);
|
|
535
|
+
if (!provider) throw new Error(`No injected provider announced for "${req.walletId}"`);
|
|
536
|
+
const accounts = await withSignal(
|
|
537
|
+
provider.request({ method: "eth_requestAccounts" }),
|
|
538
|
+
// triggers the extension popup
|
|
539
|
+
req.signal
|
|
540
|
+
);
|
|
541
|
+
const account = accounts?.[0];
|
|
542
|
+
if (!account) throw new Error(`${req.walletId} extension returned no account`);
|
|
543
|
+
await this.ensureChain(provider, req);
|
|
544
|
+
const chainId = toCaip3(await provider.request({ method: "eth_chainId" }));
|
|
545
|
+
this.bindEvents(provider, req.walletId);
|
|
546
|
+
return this.toConnection(provider, req.walletId, account, chainId);
|
|
547
|
+
}
|
|
548
|
+
async restore() {
|
|
549
|
+
if (typeof window === "undefined") return [];
|
|
550
|
+
if (this.discovered.size === 0) {
|
|
551
|
+
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
552
|
+
await new Promise((resolve) => setTimeout(resolve, DISCOVERY_WAIT_MS));
|
|
553
|
+
}
|
|
554
|
+
const out = [];
|
|
555
|
+
for (const walletId of this.walletIds) {
|
|
556
|
+
const provider = this.providerFor(walletId);
|
|
557
|
+
if (!provider) continue;
|
|
558
|
+
const accounts = await provider.request({ method: "eth_accounts" }).catch(() => []);
|
|
559
|
+
const account = accounts?.[0];
|
|
560
|
+
if (!account) continue;
|
|
561
|
+
const chainId = toCaip3(
|
|
562
|
+
await provider.request({ method: "eth_chainId" }).catch(() => "0x1")
|
|
563
|
+
);
|
|
564
|
+
this.bindEvents(provider, walletId);
|
|
565
|
+
out.push(this.toConnection(provider, walletId, account, chainId));
|
|
566
|
+
}
|
|
567
|
+
return out;
|
|
568
|
+
}
|
|
569
|
+
providerFor(walletId) {
|
|
570
|
+
const rdns = this.rdnsByWallet[walletId];
|
|
571
|
+
return rdns ? this.discovered.get(rdns)?.provider : void 0;
|
|
572
|
+
}
|
|
573
|
+
bindEvents(provider, walletId) {
|
|
574
|
+
if (this.bound.has(provider)) return;
|
|
575
|
+
this.bound.add(provider);
|
|
576
|
+
provider.on("chainChanged", (hex) => {
|
|
577
|
+
this.emit({ type: "chainChanged", walletId, chainId: toCaip3(String(hex)) });
|
|
578
|
+
});
|
|
579
|
+
provider.on("accountsChanged", (accounts) => {
|
|
580
|
+
const account = Array.isArray(accounts) ? accounts[0] : void 0;
|
|
581
|
+
if (account) this.emit({ type: "accountsChanged", walletId, account });
|
|
582
|
+
else this.emit({ type: "disconnect", walletId });
|
|
583
|
+
});
|
|
584
|
+
provider.on("disconnect", () => this.emit({ type: "disconnect", walletId }));
|
|
585
|
+
}
|
|
586
|
+
/** Best-effort switch to the requested chain; leaves the wallet as-is if it's unknown to it. */
|
|
587
|
+
async ensureChain(provider, req) {
|
|
588
|
+
const wanted = req.namespace.value.chains?.[0];
|
|
589
|
+
const wantedNum = wanted ? Number(wanted.split(":")[1]) : NaN;
|
|
590
|
+
if (!Number.isFinite(wantedNum) || wantedNum <= 0) return;
|
|
591
|
+
const current = parseInt(
|
|
592
|
+
await provider.request({ method: "eth_chainId" }).catch(() => "0x0") ?? "0x0",
|
|
593
|
+
16
|
|
594
|
+
);
|
|
595
|
+
if (current === wantedNum) return;
|
|
596
|
+
await provider.request({
|
|
597
|
+
method: "wallet_switchEthereumChain",
|
|
598
|
+
params: [{ chainId: `0x${wantedNum.toString(16)}` }]
|
|
599
|
+
}).catch(() => {
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
toConnection(provider, walletId, account, chainId) {
|
|
603
|
+
return {
|
|
604
|
+
walletId,
|
|
605
|
+
account,
|
|
606
|
+
chainId,
|
|
607
|
+
request: async (args) => await provider.request({ method: args.method, params: args.params }),
|
|
608
|
+
openWallet: () => {
|
|
609
|
+
},
|
|
610
|
+
// the extension foregrounds its own popup on request
|
|
611
|
+
disconnect: async () => {
|
|
612
|
+
await provider.request({ method: "wallet_revokePermissions", params: [{ eth_accounts: {} }] }).catch(() => {
|
|
613
|
+
});
|
|
614
|
+
this.emit({ type: "disconnect", walletId });
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
function toCaip3(hexChainId) {
|
|
620
|
+
if (!hexChainId) return "eip155:1";
|
|
621
|
+
const num = hexChainId.startsWith("0x") ? parseInt(hexChainId, 16) : Number(hexChainId);
|
|
622
|
+
return `eip155:${Number.isFinite(num) ? num : 1}`;
|
|
623
|
+
}
|
|
624
|
+
function withSignal(promise, signal) {
|
|
625
|
+
if (!signal) return promise;
|
|
626
|
+
if (signal.aborted) return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
627
|
+
return new Promise((resolve, reject) => {
|
|
628
|
+
const onAbort = () => reject(new DOMException("Aborted", "AbortError"));
|
|
629
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
630
|
+
promise.then(
|
|
631
|
+
(value) => {
|
|
632
|
+
signal.removeEventListener("abort", onAbort);
|
|
633
|
+
resolve(value);
|
|
634
|
+
},
|
|
635
|
+
(error) => {
|
|
636
|
+
signal.removeEventListener("abort", onAbort);
|
|
637
|
+
reject(error);
|
|
638
|
+
}
|
|
639
|
+
);
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
|
|
391
643
|
// src/connectors/walletconnect/wallet-links.ts
|
|
392
644
|
var WALLET_LINKS = {
|
|
393
645
|
metamask: { "native": "metamask://", "scheme": "metamask://wc", "universal": "https://metamask.app.link/wc", "store": { "ios": "https://apps.apple.com/us/app/metamask/id1438144202", "android": "https://play.google.com/store/apps/details?id=io.metamask" } },
|
|
@@ -412,7 +664,43 @@ var WALLET_LINKS = {
|
|
|
412
664
|
atomic: { "native": "atomicwallet://", "scheme": "atomicwallet://wc", "store": { "ios": "https://apps.apple.com/us/app/atomic-wallet/id1478257827", "android": "https://play.google.com/store/apps/details?id=io.atomicwallet" } },
|
|
413
665
|
alpha: { "native": "awallet://", "scheme": "awallet://wc", "universal": "https://aw.app/wc", "store": { "ios": "https://apps.apple.com/us/app/alphawallet-eth-wallet/id1358230430", "android": "https://play.google.com/store/apps/details?id=io.stormbird.wallet" } },
|
|
414
666
|
math: { "native": "mathwallet://", "scheme": "mathwallet://wc", "universal": "https://www.mathwallet.org/wc", "store": { "ios": "https://apps.apple.com/us/app/mathwallet5/id1582612388", "android": "https://play.google.com/store/apps/details?id=com.mathwallet.android" } },
|
|
415
|
-
bitpay: { "native": "bitpay://", "scheme": "bitpay://wc", "universal": "https://link.bitpay.com/wc", "store": { "ios": "https://bitpay.onelink.me/Cenw/ejjaw7bs", "android": "https://bitpay.onelink.me/Cenw/ejjaw7bs" } }
|
|
667
|
+
bitpay: { "native": "bitpay://", "scheme": "bitpay://wc", "universal": "https://link.bitpay.com/wc", "store": { "ios": "https://bitpay.onelink.me/Cenw/ejjaw7bs", "android": "https://bitpay.onelink.me/Cenw/ejjaw7bs" } },
|
|
668
|
+
rabby: { "native": "rabby://", "scheme": "rabby://wc", "store": { "ios": "https://apps.apple.com/us/app/rabby-wallet-crypto-evm/id6474381673", "android": "https://play.google.com/store/apps/details?id=com.debank.rabbymobile" } },
|
|
669
|
+
// Bybit's WC deep link nests the uri inside a targetUrl wrapper (bybitapp://open/route?targetUrl=by://web3/walletconnect/wc?uri=...), which the `${scheme}?uri=` builder can't express — QR/scan connect only.
|
|
670
|
+
bybit: { "store": { "ios": "https://apps.apple.com/us/app/bybit-buy-trade-crypto/id1488296980", "android": "https://play.google.com/store/apps/details?id=com.bybit.app" } },
|
|
671
|
+
binance: { "native": "bnc://app.binance.com/cedefi/", "scheme": "bnc://app.binance.com/cedefi/wc", "store": { "ios": "https://apps.apple.com/us/app/id1436799971", "android": "https://play.google.com/store/apps/details?id=com.binance.dev" } },
|
|
672
|
+
gate: { "native": "gtweb3wallet://", "scheme": "gtweb3wallet://wc", "store": { "ios": "https://apps.apple.com/us/app/gate-io-buy-bitcoin-crypto/id1294998195", "android": "https://play.google.com/store/apps/details?id=com.gateio.gateio" } },
|
|
673
|
+
// Core: `core://` scheme not corroborated to 2 sources — QR/scan connect only.
|
|
674
|
+
core: { "store": { "ios": "https://apps.apple.com/us/app/core-wallet/id6443685999", "android": "https://play.google.com/store/apps/details?id=com.avaxwallet" } },
|
|
675
|
+
// Backpack: `backpack://` scheme not corroborated to 2 sources — QR/scan connect only.
|
|
676
|
+
backpack: { "store": { "ios": "https://apps.apple.com/us/app/backpack-wallet-exchange/id6445964121", "android": "https://play.google.com/store/apps/details?id=app.backpack.mobile" } },
|
|
677
|
+
frontier: { "native": "frontier://", "scheme": "frontier://wc", "store": { "ios": "https://apps.apple.com/us/app/frontier-crypto-defi-wallet/id1482380988", "android": "https://play.google.com/store/apps/details?id=com.frontierwallet" } },
|
|
678
|
+
onekey: { "native": "onekey-wallet://", "scheme": "onekey-wallet://wc", "store": { "ios": "https://apps.apple.com/us/app/onekey-open-source-wallet/id1609559473", "android": "https://play.google.com/store/apps/details?id=so.onekey.app.wallet" } },
|
|
679
|
+
kraken: { "native": "krakenwallet://", "scheme": "krakenwallet://wc", "store": { "ios": "https://apps.apple.com/us/app/kraken-wallet/id1626327149", "android": "https://play.google.com/store/apps/details?id=com.kraken.superwallet" } },
|
|
680
|
+
uniswap: { "native": "uniswap://", "scheme": "uniswap://wc", "store": { "ios": "https://apps.apple.com/us/app/uniswap-crypto-nft-wallet/id6443944476", "android": "https://play.google.com/store/apps/details?id=com.uniswap.mobile" } },
|
|
681
|
+
omni: { "native": "omni://", "scheme": "omni://wc", "store": { "ios": "https://apps.apple.com/us/app/omni-web3-wallet/id1569375204", "android": "https://play.google.com/store/apps/details?id=fi.steakwallet.app" } },
|
|
682
|
+
mew: { "universal": "https://mewwallet.com/wc", "store": { "ios": "https://apps.apple.com/app/id1464614025", "android": "https://play.google.com/store/apps/details?id=com.myetherwallet.mewwallet" } },
|
|
683
|
+
foxwallet: { "native": "foxwallet://", "scheme": "foxwallet://wc", "universal": "https://link.foxwallet.com/wc", "store": { "ios": "https://apps.apple.com/app/foxwallet-crypto-web3/id1590983231", "android": "https://play.google.com/store/apps/details?id=com.foxwallet.play" } },
|
|
684
|
+
nova: { "native": "novawallet://", "scheme": "novawallet://wc", "store": { "ios": "https://apps.apple.com/us/app/nova-polkadot-wallet/id1597119355", "android": "https://play.google.com/store/apps/details?id=io.novafoundation.nova.market" } },
|
|
685
|
+
subwallet: { "native": "subwallet://", "scheme": "subwallet://wc", "store": { "ios": "https://apps.apple.com/us/app/subwallet-polkadot-wallet/id1633050285", "android": "https://play.google.com/store/apps/details?id=app.subwallet.mobile" } },
|
|
686
|
+
safe: { "native": "safe://", "scheme": "safe://wc", "store": { "ios": "https://apps.apple.com/us/app/safe-mobile/id6748754793", "android": "https://play.google.com/store/apps/details?id=global.safe.mobileapp" } },
|
|
687
|
+
robinhood: { "native": "robinhood-wallet://", "scheme": "robinhood-wallet://wc", "store": { "ios": "https://apps.apple.com/us/app/robinhood-wallet-swap-crypto/id1634080733", "android": "https://play.google.com/store/apps/details?id=com.robinhood.gateway" } },
|
|
688
|
+
tangem: { "native": "tangem://", "scheme": "tangem://wc", "store": { "ios": "https://apps.apple.com/app/tangem/id1354868448", "android": "https://play.google.com/store/apps/details?id=com.tangem.wallet" } },
|
|
689
|
+
// Trezor Suite: WalletConnect pairing is QR/paste-into-Suite (no corroborated custom scheme) — QR connect only.
|
|
690
|
+
trezor: { "store": { "ios": "https://apps.apple.com/us/app/trezor-suite/id1631884497", "android": "https://play.google.com/store/apps/details?id=io.trezor.suite" } },
|
|
691
|
+
kucoin: { "native": "kucoin://", "scheme": "kucoin:///wallet/walletConnect", "store": { "ios": "https://apps.apple.com/app/kucoin-buy-bitcoin-crypto/id1378956601", "android": "https://play.google.com/store/apps/details?id=com.kubi.kucoin" } },
|
|
692
|
+
// Jupiter (Solana): no corroborated WC deep-link scheme — QR connect only.
|
|
693
|
+
jupiter: { "store": { "ios": "https://apps.apple.com/us/app/jupiter-solana-swap-wallet/id6484069059", "android": "https://play.google.com/store/apps/details?id=ag.jup.jupiter.android" } },
|
|
694
|
+
zengo: { "native": "zengo://get.zengo.com/", "scheme": "zengo://get.zengo.com/wc", "store": { "ios": "https://apps.apple.com/us/app/zengo-crypto-bitcoin-wallet/id1440147115", "android": "https://play.google.com/store/apps/details?id=com.zengo.wallet" } },
|
|
695
|
+
// Bitcoin.com Wallet: no corroborated WC deep-link scheme — QR connect only.
|
|
696
|
+
bitcoincom: { "store": { "ios": "https://apps.apple.com/us/app/bitcoin-wallet-by-bitcoin-com/id1252903728", "android": "https://play.google.com/store/apps/details?id=com.bitcoin.mwallet" } },
|
|
697
|
+
keplr: { "native": "keplrwallet://", "scheme": "keplrwallet://wcV2", "store": { "ios": "https://apps.apple.com/us/app/keplr-wallet/id1567851089", "android": "https://play.google.com/store/apps/details?id=com.chainapsis.keplr" } },
|
|
698
|
+
cake: { "native": "cakewallet://", "scheme": "cakewallet://wc", "store": { "ios": "https://apps.apple.com/us/app/cake-wallet/id1334702542", "android": "https://play.google.com/store/apps/details?id=com.cakewallet.cake_wallet" } },
|
|
699
|
+
unstoppable: { "native": "unstoppable.money://", "scheme": "unstoppable.money://wc", "store": { "ios": "https://apps.apple.com/us/app/unstoppable-crypto-wallet/id1447619907", "android": "https://play.google.com/store/apps/details?id=io.horizontalsystems.bankwallet" } },
|
|
700
|
+
bifrost: { "native": "bifrostwallet://", "scheme": "bifrostwallet://wc", "store": { "ios": "https://apps.apple.com/us/app/bifrost-wallet/id1577198351", "android": "https://play.google.com/store/apps/details?id=com.bifrostwallet.app" } },
|
|
701
|
+
pintu: { "native": "pintu://web3wallet", "scheme": "pintu://web3wallet/wc", "store": { "ios": "https://apps.apple.com/id/app/pintu-buy-invest-crypto/id1494119678", "android": "https://play.google.com/store/apps/details?id=com.valar.pintu" } },
|
|
702
|
+
hot: { "native": "hotwallet://", "scheme": "hotwallet://wc", "store": { "ios": "https://apps.apple.com/us/app/hot-wallet/id6740916148", "android": "https://play.google.com/store/apps/details?id=app.herewallet.hot" } },
|
|
703
|
+
arculus: { "native": "arculuswc://", "scheme": "arculuswc://wc", "universal": "https://gw.arculus.co/app/wc", "store": { "ios": "https://apps.apple.com/us/app/arculus-wallet/id1575425801", "android": "https://play.google.com/store/apps/details?id=co.arculus.wallet.android" } }
|
|
416
704
|
};
|
|
417
705
|
|
|
418
706
|
// src/connectors/walletconnect/registry.ts
|
|
@@ -550,7 +838,7 @@ var WalletConnectConnector = class extends BaseConnector {
|
|
|
550
838
|
}
|
|
551
839
|
}
|
|
552
840
|
const pairingTopic = utils.parseUri(uri).topic;
|
|
553
|
-
const session = await
|
|
841
|
+
const session = await withSignal2(approval(), req.signal, () => {
|
|
554
842
|
void client.core.pairing.disconnect({ topic: pairingTopic }).catch(() => {
|
|
555
843
|
});
|
|
556
844
|
});
|
|
@@ -658,7 +946,7 @@ function firstNamespace(session) {
|
|
|
658
946
|
if (!v) return null;
|
|
659
947
|
return { name, value: { chains: v.chains, methods: v.methods, events: v.events } };
|
|
660
948
|
}
|
|
661
|
-
function
|
|
949
|
+
function withSignal2(promise, signal, onAbort) {
|
|
662
950
|
if (!signal) return promise;
|
|
663
951
|
if (signal.aborted) {
|
|
664
952
|
onAbort();
|
|
@@ -684,15 +972,24 @@ function withSignal(promise, signal, onAbort) {
|
|
|
684
972
|
}
|
|
685
973
|
|
|
686
974
|
// src/core/lydian-connect.ts
|
|
975
|
+
function injectedRdnsMap(sdkServed) {
|
|
976
|
+
const map = {};
|
|
977
|
+
for (const w of WALLET_CATALOG) {
|
|
978
|
+
if (w.rdns && w.namespaces.includes("eip155") && !sdkServed.has(w.id)) map[w.id] = w.rdns;
|
|
979
|
+
}
|
|
980
|
+
return map;
|
|
981
|
+
}
|
|
687
982
|
function createConnectors(config) {
|
|
688
983
|
const app = {
|
|
689
984
|
appName: config.appName,
|
|
690
985
|
icon: config.icon,
|
|
691
986
|
description: config.description
|
|
692
987
|
};
|
|
988
|
+
const sdk = [new MetaMaskConnector(app), new CoinbaseConnector(app)];
|
|
989
|
+
const sdkServed = new Set(sdk.flatMap((c) => c.walletIds));
|
|
693
990
|
return [
|
|
694
|
-
|
|
695
|
-
new
|
|
991
|
+
...sdk,
|
|
992
|
+
new InjectedConnector(injectedRdnsMap(sdkServed)),
|
|
696
993
|
new WalletConnectConnector(app, { projectId: config.walletConnectProjectId })
|
|
697
994
|
];
|
|
698
995
|
}
|