@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/dist/index.js
CHANGED
|
@@ -30,18 +30,23 @@ var ConnectManager = class {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* WalletConnect for a non-EVM chain
|
|
33
|
+
* The connector claiming this walletId if it serves the requested namespace
|
|
34
|
+
* AND is currently available, else the fallback. So an EVM-only SDK connector
|
|
35
|
+
* is bypassed to WalletConnect for a non-EVM chain, and the injected connector
|
|
36
|
+
* is bypassed when the wallet's extension hasn't announced a provider. The host
|
|
37
|
+
* app is oblivious. SDK connectors report `isAvailable` synchronously as `true`,
|
|
38
|
+
* so this only awaits for connectors that actually probe (e.g. injected).
|
|
36
39
|
*/
|
|
37
|
-
resolve(walletId, namespaceName) {
|
|
40
|
+
async resolve(walletId, namespaceName) {
|
|
38
41
|
const claimed = this.byWallet.get(walletId);
|
|
39
|
-
if (claimed && claimed.servesNamespace(namespaceName)
|
|
42
|
+
if (claimed && claimed.servesNamespace(namespaceName) && await claimed.isAvailable(walletId))
|
|
43
|
+
return claimed;
|
|
40
44
|
return this.fallback;
|
|
41
45
|
}
|
|
42
46
|
async connect(req) {
|
|
43
47
|
if (!this.started) await this.init();
|
|
44
|
-
const
|
|
48
|
+
const connector = await this.resolve(req.walletId, req.namespace.name);
|
|
49
|
+
const connection = await connector.connect(req);
|
|
45
50
|
this.connections.set(req.walletId, connection);
|
|
46
51
|
this.emit({ type: "connect", walletId: req.walletId, connection });
|
|
47
52
|
return connection;
|
|
@@ -126,6 +131,100 @@ function buildNamespace(chainId) {
|
|
|
126
131
|
};
|
|
127
132
|
}
|
|
128
133
|
|
|
134
|
+
// node_modules/@lydianpay/lydianconnect-catalog/dist/index.js
|
|
135
|
+
var ICON_BASE = "https://wallet-assets.lydian.com/wallets";
|
|
136
|
+
var WALLETS = [
|
|
137
|
+
{ id: "metamask", name: "MetaMask", namespaces: ["eip155"] },
|
|
138
|
+
{ id: "trust", name: "Trust", namespaces: ["eip155", "solana"] },
|
|
139
|
+
{ id: "rainbow", name: "Rainbow", namespaces: ["eip155"] },
|
|
140
|
+
{ id: "coinbase", name: "Coinbase", namespaces: ["eip155", "solana"] },
|
|
141
|
+
{ id: "zerion", name: "Zerion", namespaces: ["eip155"] },
|
|
142
|
+
{ id: "tokenpocket", name: "Token Pocket", namespaces: ["eip155", "solana"] },
|
|
143
|
+
{ id: "blockchaincom", name: "Blockchain.com", namespaces: ["bip122", "eip155", "solana"] },
|
|
144
|
+
{ id: "exodus", name: "Exodus", namespaces: ["eip155", "solana"] },
|
|
145
|
+
{ id: "phantom", name: "Phantom", namespaces: ["bip122", "eip155", "solana"] },
|
|
146
|
+
{ id: "okx", name: "OKX", namespaces: ["bip122", "eip155", "solana"] },
|
|
147
|
+
{ id: "cryptocom", name: "Crypto.com", namespaces: ["bip122", "eip155", "solana"] },
|
|
148
|
+
{ id: "argent", name: "Argent", namespaces: ["eip155"] },
|
|
149
|
+
{ id: "safepal", name: "SafePal", namespaces: ["eip155", "solana", "ton"] },
|
|
150
|
+
{ id: "imtoken", name: "imToken", namespaces: ["eip155"] },
|
|
151
|
+
{ id: "ronin", name: "Ronin", namespaces: ["eip155"] },
|
|
152
|
+
{ id: "coin98", name: "Coin98", namespaces: ["eip155", "solana"] },
|
|
153
|
+
{ id: "bitkeep", name: "Bitget Wallet", namespaces: ["eip155", "solana"] },
|
|
154
|
+
{ id: "1inch", name: "1inch", namespaces: ["eip155", "solana"] },
|
|
155
|
+
{ id: "ledgerlive", name: "Ledger Live", namespaces: ["bip122", "eip155", "solana"] },
|
|
156
|
+
{ id: "atomic", name: "Atomic", namespaces: ["bip122", "eip155", "solana"] },
|
|
157
|
+
{ id: "alpha", name: "Alpha", namespaces: ["eip155"] },
|
|
158
|
+
{ id: "math", name: "Math", namespaces: ["eip155", "solana"] },
|
|
159
|
+
{ id: "bitpay", name: "BitPay", namespaces: ["eip155"] },
|
|
160
|
+
{ id: "rabby", name: "Rabby", namespaces: ["eip155"] },
|
|
161
|
+
{ id: "bybit", name: "Bybit", namespaces: ["eip155", "solana"] },
|
|
162
|
+
{ id: "binance", name: "Binance", namespaces: ["eip155", "solana"] },
|
|
163
|
+
{ id: "gate", name: "Gate Wallet", namespaces: ["eip155"] },
|
|
164
|
+
{ id: "core", name: "Core", namespaces: ["eip155", "solana"] },
|
|
165
|
+
{ id: "backpack", name: "Backpack", namespaces: ["eip155", "solana"] },
|
|
166
|
+
{ id: "frontier", name: "Frontier", namespaces: ["eip155"] },
|
|
167
|
+
{ id: "onekey", name: "OneKey", namespaces: ["eip155"] },
|
|
168
|
+
{ id: "kraken", name: "Kraken", namespaces: ["eip155", "solana"] },
|
|
169
|
+
{ id: "uniswap", name: "Uniswap Wallet", namespaces: ["eip155"] },
|
|
170
|
+
{ id: "omni", name: "Omni", namespaces: ["eip155"] },
|
|
171
|
+
{ id: "mew", name: "MEW Wallet", namespaces: ["eip155"] },
|
|
172
|
+
{ id: "foxwallet", name: "FoxWallet", namespaces: ["eip155"] },
|
|
173
|
+
{ id: "nova", name: "Nova Wallet", namespaces: ["eip155"] },
|
|
174
|
+
{ id: "subwallet", name: "SubWallet", namespaces: ["eip155"] },
|
|
175
|
+
{ id: "safe", name: "Safe", namespaces: ["eip155"] },
|
|
176
|
+
{ id: "robinhood", name: "Robinhood Wallet", namespaces: ["eip155"] },
|
|
177
|
+
{ id: "tangem", name: "Tangem", namespaces: ["eip155", "solana"] },
|
|
178
|
+
{ id: "trezor", name: "Trezor", namespaces: ["bip122", "eip155", "solana"] },
|
|
179
|
+
{ id: "kucoin", name: "KuCoin", namespaces: ["eip155", "solana"] },
|
|
180
|
+
{ id: "jupiter", name: "Jupiter", namespaces: ["solana"] },
|
|
181
|
+
{ id: "zengo", name: "Zengo", namespaces: ["eip155"] },
|
|
182
|
+
{ id: "bitcoincom", name: "Bitcoin.com", namespaces: ["eip155"] },
|
|
183
|
+
{ id: "keplr", name: "Keplr", namespaces: ["eip155"] },
|
|
184
|
+
{ id: "cake", name: "Cake Wallet", namespaces: ["eip155", "solana"] },
|
|
185
|
+
{ id: "unstoppable", name: "Unstoppable", namespaces: ["eip155"] },
|
|
186
|
+
{ id: "bifrost", name: "Bifrost", namespaces: ["bip122", "eip155"] },
|
|
187
|
+
{ id: "pintu", name: "Pintu", namespaces: ["eip155"] },
|
|
188
|
+
{ id: "hot", name: "HOT Wallet", namespaces: ["eip155", "solana"] },
|
|
189
|
+
{ id: "arculus", name: "Arculus", namespaces: ["bip122", "eip155", "solana"] }
|
|
190
|
+
];
|
|
191
|
+
var EXTENSIONS = {
|
|
192
|
+
metamask: {
|
|
193
|
+
rdns: "io.metamask",
|
|
194
|
+
extensionUrl: "https://chromewebstore.google.com/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn"
|
|
195
|
+
},
|
|
196
|
+
trust: {
|
|
197
|
+
rdns: "com.trustwallet.app",
|
|
198
|
+
extensionUrl: "https://chromewebstore.google.com/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph"
|
|
199
|
+
},
|
|
200
|
+
rabby: {
|
|
201
|
+
rdns: "io.rabby",
|
|
202
|
+
extensionUrl: "https://chromewebstore.google.com/detail/rabby-wallet/acmacodkjbdgmoleebolmdjonilkdbch"
|
|
203
|
+
},
|
|
204
|
+
okx: {
|
|
205
|
+
// Legacy "okex" brand retained in the extension's rdns after the 2022 rebrand.
|
|
206
|
+
rdns: "com.okex.wallet",
|
|
207
|
+
extensionUrl: "https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge"
|
|
208
|
+
},
|
|
209
|
+
phantom: {
|
|
210
|
+
rdns: "app.phantom",
|
|
211
|
+
extensionUrl: "https://chromewebstore.google.com/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa"
|
|
212
|
+
},
|
|
213
|
+
zerion: {
|
|
214
|
+
rdns: "io.zerion",
|
|
215
|
+
extensionUrl: "https://chromewebstore.google.com/detail/zerion-wallet-crypto-defi/klghhnkeealcohjjanjjdaeeggmfmlpl"
|
|
216
|
+
},
|
|
217
|
+
rainbow: {
|
|
218
|
+
rdns: "me.rainbow",
|
|
219
|
+
extensionUrl: "https://chromewebstore.google.com/detail/rainbow/opfgelmcmbiajamepnmloijbpoleiama"
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
var WALLET_CATALOG = WALLETS.map((w) => ({
|
|
223
|
+
...w,
|
|
224
|
+
iconUrl: `${ICON_BASE}/${w.id}.png`,
|
|
225
|
+
...EXTENSIONS[w.id] ?? {}
|
|
226
|
+
}));
|
|
227
|
+
|
|
129
228
|
// src/core/connector.ts
|
|
130
229
|
var BaseConnector = class {
|
|
131
230
|
constructor() {
|
|
@@ -382,6 +481,159 @@ function evmChainIds(req) {
|
|
|
382
481
|
return Number.isFinite(n) && n > 0 ? [n] : void 0;
|
|
383
482
|
}
|
|
384
483
|
|
|
484
|
+
// src/connectors/injected/connector.ts
|
|
485
|
+
var DISCOVERY_WAIT_MS = 100;
|
|
486
|
+
var InjectedConnector = class extends BaseConnector {
|
|
487
|
+
constructor(rdnsByWallet) {
|
|
488
|
+
super();
|
|
489
|
+
this.rdnsByWallet = rdnsByWallet;
|
|
490
|
+
this.type = "injected";
|
|
491
|
+
/** rdns -> the provider it announced. Populated by EIP-6963 discovery. */
|
|
492
|
+
this.discovered = /* @__PURE__ */ new Map();
|
|
493
|
+
/**
|
|
494
|
+
* Providers we've already attached listeners to. Bind once and keep for the
|
|
495
|
+
* page's life (never remove) so a reconnect doesn't stack duplicate listeners.
|
|
496
|
+
* EIP-6963 announces exactly one provider per rdns, so a given provider maps to
|
|
497
|
+
* a single walletId — closing over walletId in bindEvents is safe.
|
|
498
|
+
*/
|
|
499
|
+
this.bound = /* @__PURE__ */ new WeakSet();
|
|
500
|
+
this.listening = false;
|
|
501
|
+
this.walletIds = Object.keys(rdnsByWallet);
|
|
502
|
+
this.startDiscovery();
|
|
503
|
+
}
|
|
504
|
+
/** Listen for provider announcements, then ask installed extensions to announce. */
|
|
505
|
+
startDiscovery() {
|
|
506
|
+
if (this.listening || typeof window === "undefined") return;
|
|
507
|
+
this.listening = true;
|
|
508
|
+
window.addEventListener("eip6963:announceProvider", (event) => {
|
|
509
|
+
const detail = event.detail;
|
|
510
|
+
if (detail?.info?.rdns && detail.provider) this.discovered.set(detail.info.rdns, detail);
|
|
511
|
+
});
|
|
512
|
+
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
513
|
+
}
|
|
514
|
+
servesNamespace(name) {
|
|
515
|
+
return name === "eip155";
|
|
516
|
+
}
|
|
517
|
+
/** Available iff the wallet's extension has announced an injected provider. */
|
|
518
|
+
async isAvailable(walletId) {
|
|
519
|
+
if (typeof window === "undefined") return false;
|
|
520
|
+
const rdns = this.rdnsByWallet[walletId];
|
|
521
|
+
if (!rdns) return false;
|
|
522
|
+
if (this.discovered.has(rdns)) return true;
|
|
523
|
+
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
524
|
+
await new Promise((resolve) => setTimeout(resolve, DISCOVERY_WAIT_MS));
|
|
525
|
+
return this.discovered.has(rdns);
|
|
526
|
+
}
|
|
527
|
+
async connect(req) {
|
|
528
|
+
const provider = this.providerFor(req.walletId);
|
|
529
|
+
if (!provider) throw new Error(`No injected provider announced for "${req.walletId}"`);
|
|
530
|
+
const accounts = await withSignal(
|
|
531
|
+
provider.request({ method: "eth_requestAccounts" }),
|
|
532
|
+
// triggers the extension popup
|
|
533
|
+
req.signal
|
|
534
|
+
);
|
|
535
|
+
const account = accounts?.[0];
|
|
536
|
+
if (!account) throw new Error(`${req.walletId} extension returned no account`);
|
|
537
|
+
await this.ensureChain(provider, req);
|
|
538
|
+
const chainId = toCaip3(await provider.request({ method: "eth_chainId" }));
|
|
539
|
+
this.bindEvents(provider, req.walletId);
|
|
540
|
+
return this.toConnection(provider, req.walletId, account, chainId);
|
|
541
|
+
}
|
|
542
|
+
async restore() {
|
|
543
|
+
if (typeof window === "undefined") return [];
|
|
544
|
+
if (this.discovered.size === 0) {
|
|
545
|
+
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
546
|
+
await new Promise((resolve) => setTimeout(resolve, DISCOVERY_WAIT_MS));
|
|
547
|
+
}
|
|
548
|
+
const out = [];
|
|
549
|
+
for (const walletId of this.walletIds) {
|
|
550
|
+
const provider = this.providerFor(walletId);
|
|
551
|
+
if (!provider) continue;
|
|
552
|
+
const accounts = await provider.request({ method: "eth_accounts" }).catch(() => []);
|
|
553
|
+
const account = accounts?.[0];
|
|
554
|
+
if (!account) continue;
|
|
555
|
+
const chainId = toCaip3(
|
|
556
|
+
await provider.request({ method: "eth_chainId" }).catch(() => "0x1")
|
|
557
|
+
);
|
|
558
|
+
this.bindEvents(provider, walletId);
|
|
559
|
+
out.push(this.toConnection(provider, walletId, account, chainId));
|
|
560
|
+
}
|
|
561
|
+
return out;
|
|
562
|
+
}
|
|
563
|
+
providerFor(walletId) {
|
|
564
|
+
const rdns = this.rdnsByWallet[walletId];
|
|
565
|
+
return rdns ? this.discovered.get(rdns)?.provider : void 0;
|
|
566
|
+
}
|
|
567
|
+
bindEvents(provider, walletId) {
|
|
568
|
+
if (this.bound.has(provider)) return;
|
|
569
|
+
this.bound.add(provider);
|
|
570
|
+
provider.on("chainChanged", (hex) => {
|
|
571
|
+
this.emit({ type: "chainChanged", walletId, chainId: toCaip3(String(hex)) });
|
|
572
|
+
});
|
|
573
|
+
provider.on("accountsChanged", (accounts) => {
|
|
574
|
+
const account = Array.isArray(accounts) ? accounts[0] : void 0;
|
|
575
|
+
if (account) this.emit({ type: "accountsChanged", walletId, account });
|
|
576
|
+
else this.emit({ type: "disconnect", walletId });
|
|
577
|
+
});
|
|
578
|
+
provider.on("disconnect", () => this.emit({ type: "disconnect", walletId }));
|
|
579
|
+
}
|
|
580
|
+
/** Best-effort switch to the requested chain; leaves the wallet as-is if it's unknown to it. */
|
|
581
|
+
async ensureChain(provider, req) {
|
|
582
|
+
const wanted = req.namespace.value.chains?.[0];
|
|
583
|
+
const wantedNum = wanted ? Number(wanted.split(":")[1]) : NaN;
|
|
584
|
+
if (!Number.isFinite(wantedNum) || wantedNum <= 0) return;
|
|
585
|
+
const current = parseInt(
|
|
586
|
+
await provider.request({ method: "eth_chainId" }).catch(() => "0x0") ?? "0x0",
|
|
587
|
+
16
|
|
588
|
+
);
|
|
589
|
+
if (current === wantedNum) return;
|
|
590
|
+
await provider.request({
|
|
591
|
+
method: "wallet_switchEthereumChain",
|
|
592
|
+
params: [{ chainId: `0x${wantedNum.toString(16)}` }]
|
|
593
|
+
}).catch(() => {
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
toConnection(provider, walletId, account, chainId) {
|
|
597
|
+
return {
|
|
598
|
+
walletId,
|
|
599
|
+
account,
|
|
600
|
+
chainId,
|
|
601
|
+
request: async (args) => await provider.request({ method: args.method, params: args.params }),
|
|
602
|
+
openWallet: () => {
|
|
603
|
+
},
|
|
604
|
+
// the extension foregrounds its own popup on request
|
|
605
|
+
disconnect: async () => {
|
|
606
|
+
await provider.request({ method: "wallet_revokePermissions", params: [{ eth_accounts: {} }] }).catch(() => {
|
|
607
|
+
});
|
|
608
|
+
this.emit({ type: "disconnect", walletId });
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
function toCaip3(hexChainId) {
|
|
614
|
+
if (!hexChainId) return "eip155:1";
|
|
615
|
+
const num = hexChainId.startsWith("0x") ? parseInt(hexChainId, 16) : Number(hexChainId);
|
|
616
|
+
return `eip155:${Number.isFinite(num) ? num : 1}`;
|
|
617
|
+
}
|
|
618
|
+
function withSignal(promise, signal) {
|
|
619
|
+
if (!signal) return promise;
|
|
620
|
+
if (signal.aborted) return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
621
|
+
return new Promise((resolve, reject) => {
|
|
622
|
+
const onAbort = () => reject(new DOMException("Aborted", "AbortError"));
|
|
623
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
624
|
+
promise.then(
|
|
625
|
+
(value) => {
|
|
626
|
+
signal.removeEventListener("abort", onAbort);
|
|
627
|
+
resolve(value);
|
|
628
|
+
},
|
|
629
|
+
(error) => {
|
|
630
|
+
signal.removeEventListener("abort", onAbort);
|
|
631
|
+
reject(error);
|
|
632
|
+
}
|
|
633
|
+
);
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
|
|
385
637
|
// src/connectors/walletconnect/wallet-links.ts
|
|
386
638
|
var WALLET_LINKS = {
|
|
387
639
|
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" } },
|
|
@@ -406,7 +658,43 @@ var WALLET_LINKS = {
|
|
|
406
658
|
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" } },
|
|
407
659
|
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" } },
|
|
408
660
|
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" } },
|
|
409
|
-
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" } }
|
|
661
|
+
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" } },
|
|
662
|
+
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" } },
|
|
663
|
+
// 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.
|
|
664
|
+
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" } },
|
|
665
|
+
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" } },
|
|
666
|
+
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" } },
|
|
667
|
+
// Core: `core://` scheme not corroborated to 2 sources — QR/scan connect only.
|
|
668
|
+
core: { "store": { "ios": "https://apps.apple.com/us/app/core-wallet/id6443685999", "android": "https://play.google.com/store/apps/details?id=com.avaxwallet" } },
|
|
669
|
+
// Backpack: `backpack://` scheme not corroborated to 2 sources — QR/scan connect only.
|
|
670
|
+
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" } },
|
|
671
|
+
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" } },
|
|
672
|
+
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" } },
|
|
673
|
+
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" } },
|
|
674
|
+
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" } },
|
|
675
|
+
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" } },
|
|
676
|
+
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" } },
|
|
677
|
+
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" } },
|
|
678
|
+
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" } },
|
|
679
|
+
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" } },
|
|
680
|
+
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" } },
|
|
681
|
+
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" } },
|
|
682
|
+
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" } },
|
|
683
|
+
// Trezor Suite: WalletConnect pairing is QR/paste-into-Suite (no corroborated custom scheme) — QR connect only.
|
|
684
|
+
trezor: { "store": { "ios": "https://apps.apple.com/us/app/trezor-suite/id1631884497", "android": "https://play.google.com/store/apps/details?id=io.trezor.suite" } },
|
|
685
|
+
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" } },
|
|
686
|
+
// Jupiter (Solana): no corroborated WC deep-link scheme — QR connect only.
|
|
687
|
+
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" } },
|
|
688
|
+
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" } },
|
|
689
|
+
// Bitcoin.com Wallet: no corroborated WC deep-link scheme — QR connect only.
|
|
690
|
+
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" } },
|
|
691
|
+
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" } },
|
|
692
|
+
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" } },
|
|
693
|
+
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" } },
|
|
694
|
+
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" } },
|
|
695
|
+
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" } },
|
|
696
|
+
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" } },
|
|
697
|
+
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" } }
|
|
410
698
|
};
|
|
411
699
|
|
|
412
700
|
// src/connectors/walletconnect/registry.ts
|
|
@@ -544,7 +832,7 @@ var WalletConnectConnector = class extends BaseConnector {
|
|
|
544
832
|
}
|
|
545
833
|
}
|
|
546
834
|
const pairingTopic = parseUri(uri).topic;
|
|
547
|
-
const session = await
|
|
835
|
+
const session = await withSignal2(approval(), req.signal, () => {
|
|
548
836
|
void client.core.pairing.disconnect({ topic: pairingTopic }).catch(() => {
|
|
549
837
|
});
|
|
550
838
|
});
|
|
@@ -652,7 +940,7 @@ function firstNamespace(session) {
|
|
|
652
940
|
if (!v) return null;
|
|
653
941
|
return { name, value: { chains: v.chains, methods: v.methods, events: v.events } };
|
|
654
942
|
}
|
|
655
|
-
function
|
|
943
|
+
function withSignal2(promise, signal, onAbort) {
|
|
656
944
|
if (!signal) return promise;
|
|
657
945
|
if (signal.aborted) {
|
|
658
946
|
onAbort();
|
|
@@ -678,15 +966,24 @@ function withSignal(promise, signal, onAbort) {
|
|
|
678
966
|
}
|
|
679
967
|
|
|
680
968
|
// src/core/lydian-connect.ts
|
|
969
|
+
function injectedRdnsMap(sdkServed) {
|
|
970
|
+
const map = {};
|
|
971
|
+
for (const w of WALLET_CATALOG) {
|
|
972
|
+
if (w.rdns && w.namespaces.includes("eip155") && !sdkServed.has(w.id)) map[w.id] = w.rdns;
|
|
973
|
+
}
|
|
974
|
+
return map;
|
|
975
|
+
}
|
|
681
976
|
function createConnectors(config) {
|
|
682
977
|
const app = {
|
|
683
978
|
appName: config.appName,
|
|
684
979
|
icon: config.icon,
|
|
685
980
|
description: config.description
|
|
686
981
|
};
|
|
982
|
+
const sdk = [new MetaMaskConnector(app), new CoinbaseConnector(app)];
|
|
983
|
+
const sdkServed = new Set(sdk.flatMap((c) => c.walletIds));
|
|
687
984
|
return [
|
|
688
|
-
|
|
689
|
-
new
|
|
985
|
+
...sdk,
|
|
986
|
+
new InjectedConnector(injectedRdnsMap(sdkServed)),
|
|
690
987
|
new WalletConnectConnector(app, { projectId: config.walletConnectProjectId })
|
|
691
988
|
];
|
|
692
989
|
}
|