@lydianpay/lydianconnect 1.2.0 → 1.2.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/README.md +16 -13
- package/dist/index.cjs +550 -98
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +550 -98
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/dist/index.cjs
CHANGED
|
@@ -79,7 +79,9 @@ var ConnectManager = class {
|
|
|
79
79
|
this.connections.delete(walletId);
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
await Promise.allSettled(
|
|
82
|
+
await Promise.allSettled(
|
|
83
|
+
[...this.connections.values()].map((c) => c.disconnect())
|
|
84
|
+
);
|
|
83
85
|
this.connections.clear();
|
|
84
86
|
}
|
|
85
87
|
async reset() {
|
|
@@ -111,7 +113,11 @@ var NAMESPACE_DEFAULTS = {
|
|
|
111
113
|
events: ["chainChanged", "accountsChanged"]
|
|
112
114
|
},
|
|
113
115
|
solana: {
|
|
114
|
-
methods: [
|
|
116
|
+
methods: [
|
|
117
|
+
"solana_signTransaction",
|
|
118
|
+
"solana_signMessage",
|
|
119
|
+
"solana_signAndSendTransaction"
|
|
120
|
+
],
|
|
115
121
|
events: []
|
|
116
122
|
},
|
|
117
123
|
bip122: {
|
|
@@ -129,11 +135,17 @@ function buildNamespace(chainId) {
|
|
|
129
135
|
);
|
|
130
136
|
}
|
|
131
137
|
if (name === "eip155" && !(/^\d+$/.test(reference) && Number(reference) > 0)) {
|
|
132
|
-
throw new Error(
|
|
138
|
+
throw new Error(
|
|
139
|
+
`Invalid eip155 chain "${caip}" \u2014 the reference must be a positive integer.`
|
|
140
|
+
);
|
|
133
141
|
}
|
|
134
142
|
return {
|
|
135
143
|
name,
|
|
136
|
-
value: {
|
|
144
|
+
value: {
|
|
145
|
+
chains: [caip],
|
|
146
|
+
methods: defaults.methods,
|
|
147
|
+
events: defaults.events
|
|
148
|
+
}
|
|
137
149
|
};
|
|
138
150
|
}
|
|
139
151
|
|
|
@@ -298,22 +310,34 @@ var MetaMaskConnector = class extends BaseConnector {
|
|
|
298
310
|
if (this.listenersBound) return;
|
|
299
311
|
this.listenersBound = true;
|
|
300
312
|
provider.on("chainChanged", (hex) => {
|
|
301
|
-
this.emit({
|
|
313
|
+
this.emit({
|
|
314
|
+
type: "chainChanged",
|
|
315
|
+
walletId: WALLET_ID,
|
|
316
|
+
chainId: toCaip(String(hex))
|
|
317
|
+
});
|
|
302
318
|
});
|
|
303
319
|
provider.on("accountsChanged", (accounts) => {
|
|
304
320
|
const account = Array.isArray(accounts) ? accounts[0] : void 0;
|
|
305
|
-
if (account)
|
|
321
|
+
if (account)
|
|
322
|
+
this.emit({ type: "accountsChanged", walletId: WALLET_ID, account });
|
|
306
323
|
else this.emit({ type: "disconnect", walletId: WALLET_ID });
|
|
307
324
|
});
|
|
308
|
-
provider.on(
|
|
325
|
+
provider.on(
|
|
326
|
+
"disconnect",
|
|
327
|
+
() => this.emit({ type: "disconnect", walletId: WALLET_ID })
|
|
328
|
+
);
|
|
309
329
|
}
|
|
310
330
|
async connect(req) {
|
|
311
331
|
const provider = await this.getProvider();
|
|
312
|
-
const accounts = await provider.request({
|
|
332
|
+
const accounts = await provider.request({
|
|
333
|
+
method: "eth_requestAccounts"
|
|
334
|
+
});
|
|
313
335
|
const account = accounts?.[0];
|
|
314
336
|
if (!account) throw new Error("MetaMask returned no account");
|
|
315
337
|
await this.ensureChain(provider, req);
|
|
316
|
-
const chainId = toCaip(
|
|
338
|
+
const chainId = toCaip(
|
|
339
|
+
await provider.request({ method: "eth_chainId" })
|
|
340
|
+
);
|
|
317
341
|
return this.toConnection(provider, account, chainId);
|
|
318
342
|
}
|
|
319
343
|
async restore() {
|
|
@@ -353,7 +377,10 @@ var MetaMaskConnector = class extends BaseConnector {
|
|
|
353
377
|
walletId: WALLET_ID,
|
|
354
378
|
account,
|
|
355
379
|
chainId,
|
|
356
|
-
request: async (args) => await provider.request({
|
|
380
|
+
request: async (args) => await provider.request({
|
|
381
|
+
method: args.method,
|
|
382
|
+
params: args.params
|
|
383
|
+
}),
|
|
357
384
|
openWallet: () => {
|
|
358
385
|
},
|
|
359
386
|
// MetaMask SDK foregrounds the wallet on request
|
|
@@ -374,7 +401,10 @@ function toCaip(hexChainId) {
|
|
|
374
401
|
|
|
375
402
|
// src/connectors/coinbase/connector.ts
|
|
376
403
|
function rpc(provider, method, params) {
|
|
377
|
-
return provider.request({
|
|
404
|
+
return provider.request({
|
|
405
|
+
method,
|
|
406
|
+
params
|
|
407
|
+
});
|
|
378
408
|
}
|
|
379
409
|
var WALLET_ID2 = "coinbase";
|
|
380
410
|
var CoinbaseConnector = class extends BaseConnector {
|
|
@@ -410,14 +440,22 @@ var CoinbaseConnector = class extends BaseConnector {
|
|
|
410
440
|
if (this.listenersBound) return;
|
|
411
441
|
this.listenersBound = true;
|
|
412
442
|
provider.on("chainChanged", (hex) => {
|
|
413
|
-
this.emit({
|
|
443
|
+
this.emit({
|
|
444
|
+
type: "chainChanged",
|
|
445
|
+
walletId: WALLET_ID2,
|
|
446
|
+
chainId: toCaip2(String(hex))
|
|
447
|
+
});
|
|
414
448
|
});
|
|
415
449
|
provider.on("accountsChanged", (accounts) => {
|
|
416
450
|
const account = Array.isArray(accounts) ? accounts[0] : void 0;
|
|
417
|
-
if (account)
|
|
451
|
+
if (account)
|
|
452
|
+
this.emit({ type: "accountsChanged", walletId: WALLET_ID2, account });
|
|
418
453
|
else this.emit({ type: "disconnect", walletId: WALLET_ID2 });
|
|
419
454
|
});
|
|
420
|
-
provider.on(
|
|
455
|
+
provider.on(
|
|
456
|
+
"disconnect",
|
|
457
|
+
() => this.emit({ type: "disconnect", walletId: WALLET_ID2 })
|
|
458
|
+
);
|
|
421
459
|
}
|
|
422
460
|
async connect(req) {
|
|
423
461
|
const provider = await this.getProvider(evmChainIds(req));
|
|
@@ -431,10 +469,14 @@ var CoinbaseConnector = class extends BaseConnector {
|
|
|
431
469
|
async restore() {
|
|
432
470
|
const provider = await this.getProvider().catch(() => null);
|
|
433
471
|
if (!provider) return [];
|
|
434
|
-
const accounts = await rpc(provider, "eth_accounts").catch(
|
|
472
|
+
const accounts = await rpc(provider, "eth_accounts").catch(
|
|
473
|
+
() => []
|
|
474
|
+
);
|
|
435
475
|
const account = accounts?.[0];
|
|
436
476
|
if (!account) return [];
|
|
437
|
-
const chainId = toCaip2(
|
|
477
|
+
const chainId = toCaip2(
|
|
478
|
+
await rpc(provider, "eth_chainId").catch(() => "0x1")
|
|
479
|
+
);
|
|
438
480
|
return [this.toConnection(provider, account, chainId)];
|
|
439
481
|
}
|
|
440
482
|
async reset() {
|
|
@@ -452,10 +494,10 @@ var CoinbaseConnector = class extends BaseConnector {
|
|
|
452
494
|
16
|
|
453
495
|
);
|
|
454
496
|
if (current === wantedNum) return;
|
|
455
|
-
await rpc(provider, "wallet_switchEthereumChain", [
|
|
456
|
-
()
|
|
457
|
-
|
|
458
|
-
);
|
|
497
|
+
await rpc(provider, "wallet_switchEthereumChain", [
|
|
498
|
+
{ chainId: `0x${wantedNum.toString(16)}` }
|
|
499
|
+
]).catch(() => {
|
|
500
|
+
});
|
|
459
501
|
}
|
|
460
502
|
toConnection(provider, account, chainId) {
|
|
461
503
|
return {
|
|
@@ -513,7 +555,8 @@ var InjectedConnector = class extends BaseConnector {
|
|
|
513
555
|
this.listening = true;
|
|
514
556
|
window.addEventListener("eip6963:announceProvider", (event) => {
|
|
515
557
|
const detail = event.detail;
|
|
516
|
-
if (detail?.info?.rdns && detail.provider)
|
|
558
|
+
if (detail?.info?.rdns && detail.provider)
|
|
559
|
+
this.discovered.set(detail.info.rdns, detail);
|
|
517
560
|
});
|
|
518
561
|
window.dispatchEvent(new Event("eip6963:requestProvider"));
|
|
519
562
|
}
|
|
@@ -532,16 +575,20 @@ var InjectedConnector = class extends BaseConnector {
|
|
|
532
575
|
}
|
|
533
576
|
async connect(req) {
|
|
534
577
|
const provider = this.providerFor(req.walletId);
|
|
535
|
-
if (!provider)
|
|
578
|
+
if (!provider)
|
|
579
|
+
throw new Error(`No injected provider announced for "${req.walletId}"`);
|
|
536
580
|
const accounts = await withSignal(
|
|
537
581
|
provider.request({ method: "eth_requestAccounts" }),
|
|
538
582
|
// triggers the extension popup
|
|
539
583
|
req.signal
|
|
540
584
|
);
|
|
541
585
|
const account = accounts?.[0];
|
|
542
|
-
if (!account)
|
|
586
|
+
if (!account)
|
|
587
|
+
throw new Error(`${req.walletId} extension returned no account`);
|
|
543
588
|
await this.ensureChain(provider, req);
|
|
544
|
-
const chainId = toCaip3(
|
|
589
|
+
const chainId = toCaip3(
|
|
590
|
+
await provider.request({ method: "eth_chainId" })
|
|
591
|
+
);
|
|
545
592
|
this.bindEvents(provider, req.walletId);
|
|
546
593
|
return this.toConnection(provider, req.walletId, account, chainId);
|
|
547
594
|
}
|
|
@@ -574,14 +621,21 @@ var InjectedConnector = class extends BaseConnector {
|
|
|
574
621
|
if (this.bound.has(provider)) return;
|
|
575
622
|
this.bound.add(provider);
|
|
576
623
|
provider.on("chainChanged", (hex) => {
|
|
577
|
-
this.emit({
|
|
624
|
+
this.emit({
|
|
625
|
+
type: "chainChanged",
|
|
626
|
+
walletId,
|
|
627
|
+
chainId: toCaip3(String(hex))
|
|
628
|
+
});
|
|
578
629
|
});
|
|
579
630
|
provider.on("accountsChanged", (accounts) => {
|
|
580
631
|
const account = Array.isArray(accounts) ? accounts[0] : void 0;
|
|
581
632
|
if (account) this.emit({ type: "accountsChanged", walletId, account });
|
|
582
633
|
else this.emit({ type: "disconnect", walletId });
|
|
583
634
|
});
|
|
584
|
-
provider.on(
|
|
635
|
+
provider.on(
|
|
636
|
+
"disconnect",
|
|
637
|
+
() => this.emit({ type: "disconnect", walletId })
|
|
638
|
+
);
|
|
585
639
|
}
|
|
586
640
|
/** Best-effort switch to the requested chain; leaves the wallet as-is if it's unknown to it. */
|
|
587
641
|
async ensureChain(provider, req) {
|
|
@@ -604,12 +658,18 @@ var InjectedConnector = class extends BaseConnector {
|
|
|
604
658
|
walletId,
|
|
605
659
|
account,
|
|
606
660
|
chainId,
|
|
607
|
-
request: async (args) => await provider.request({
|
|
661
|
+
request: async (args) => await provider.request({
|
|
662
|
+
method: args.method,
|
|
663
|
+
params: args.params
|
|
664
|
+
}),
|
|
608
665
|
openWallet: () => {
|
|
609
666
|
},
|
|
610
667
|
// the extension foregrounds its own popup on request
|
|
611
668
|
disconnect: async () => {
|
|
612
|
-
await provider.request({
|
|
669
|
+
await provider.request({
|
|
670
|
+
method: "wallet_revokePermissions",
|
|
671
|
+
params: [{ eth_accounts: {} }]
|
|
672
|
+
}).catch(() => {
|
|
613
673
|
});
|
|
614
674
|
this.emit({ type: "disconnect", walletId });
|
|
615
675
|
}
|
|
@@ -623,7 +683,8 @@ function toCaip3(hexChainId) {
|
|
|
623
683
|
}
|
|
624
684
|
function withSignal(promise, signal) {
|
|
625
685
|
if (!signal) return promise;
|
|
626
|
-
if (signal.aborted)
|
|
686
|
+
if (signal.aborted)
|
|
687
|
+
return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
627
688
|
return new Promise((resolve, reject) => {
|
|
628
689
|
const onAbort = () => reject(new DOMException("Aborted", "AbortError"));
|
|
629
690
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -642,65 +703,435 @@ function withSignal(promise, signal) {
|
|
|
642
703
|
|
|
643
704
|
// src/connectors/walletconnect/wallet-links.ts
|
|
644
705
|
var WALLET_LINKS = {
|
|
645
|
-
metamask: {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
706
|
+
metamask: {
|
|
707
|
+
native: "metamask://",
|
|
708
|
+
scheme: "metamask://wc",
|
|
709
|
+
universal: "https://metamask.app.link/wc",
|
|
710
|
+
store: {
|
|
711
|
+
ios: "https://apps.apple.com/us/app/metamask/id1438144202",
|
|
712
|
+
android: "https://play.google.com/store/apps/details?id=io.metamask"
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
trust: {
|
|
716
|
+
native: "trust://",
|
|
717
|
+
scheme: "trust://wc",
|
|
718
|
+
universal: "https://link.trustwallet.com/wc",
|
|
719
|
+
store: {
|
|
720
|
+
ios: "https://apps.apple.com/app/apple-store/id1288339409",
|
|
721
|
+
android: "https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp"
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
rainbow: {
|
|
725
|
+
native: "rainbow://",
|
|
726
|
+
scheme: "rainbow://wc",
|
|
727
|
+
universal: "https://rnbwapp.com/wc",
|
|
728
|
+
store: {
|
|
729
|
+
ios: "https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=wc&mt=8",
|
|
730
|
+
android: "https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Dwc%26utm_medium%3Dconnector%26utm_campaign%3Dwc"
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
coinbase: {
|
|
734
|
+
store: {
|
|
735
|
+
ios: "https://apps.apple.com/us/app/base-formerly-coinbase-wallet/id1278383455"
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
zerion: {
|
|
739
|
+
native: "zerion://",
|
|
740
|
+
scheme: "zerion://wc",
|
|
741
|
+
universal: "https://wallet.zerion.io/wc/wc",
|
|
742
|
+
store: {
|
|
743
|
+
ios: "https://apps.apple.com/app/id1456732565",
|
|
744
|
+
android: "https://play.google.com/store/apps/details?id=io.zerion.android&hl=en&gl=US"
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
tokenpocket: {
|
|
748
|
+
native: "tpoutside://",
|
|
749
|
+
scheme: "tpoutside://wc",
|
|
750
|
+
store: {
|
|
751
|
+
ios: "https://apps.apple.com/us/app/tp-wallet/id6444625622?l=en",
|
|
752
|
+
android: "https://play.google.com/store/apps/details?id=vip.mytokenpocket"
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
blockchaincom: {
|
|
756
|
+
native: "blockchain-wallet://",
|
|
757
|
+
scheme: "blockchain-wallet://wc",
|
|
758
|
+
universal: "https://login.blockchain.com/app/wc",
|
|
759
|
+
store: {
|
|
760
|
+
ios: "https://apps.apple.com/us/app/blockchain-bitcoin-wallet/id493253309",
|
|
761
|
+
android: "https://play.google.com/store/apps/details?id=piuk.blockchain.android"
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
exodus: {
|
|
765
|
+
native: "exodus://",
|
|
766
|
+
scheme: "exodus://wc",
|
|
767
|
+
universal: "https://exodus.com/m/wc",
|
|
768
|
+
store: {
|
|
769
|
+
ios: "https://apps.apple.com/us/app/exodus-crypto-bitcoin-wallet/id1414384820",
|
|
770
|
+
android: "https://play.google.com/store/apps/details?id=exodusmovement.exodus&hl=en&gl=US"
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
phantom: {
|
|
774
|
+
store: {
|
|
775
|
+
ios: "https://apps.apple.com/us/app/phantom-crypto-wallet/id1598432977",
|
|
776
|
+
android: "https://play.google.com/store/apps/details?id=app.phantom&hl=en"
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
okx: {
|
|
780
|
+
native: "okxwallet://main",
|
|
781
|
+
scheme: "okxwallet://main/wc",
|
|
782
|
+
store: {
|
|
783
|
+
ios: "https://apps.apple.com/us/app/okx-buy-bitcoin-eth-crypto/id1327268470",
|
|
784
|
+
android: "https://play.google.com/store/apps/details?id=com.okinc.okex.gp"
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
cryptocom: {
|
|
788
|
+
native: "cryptowallet://",
|
|
789
|
+
scheme: "cryptowallet://wc",
|
|
790
|
+
store: {
|
|
791
|
+
ios: "https://apps.apple.com/US/app/id1512048310?mt=8",
|
|
792
|
+
android: "https://play.google.com/store/apps/details?id=com.defi.wallet"
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
argent: {
|
|
796
|
+
native: "argent://app/",
|
|
797
|
+
scheme: "argent://app/wc",
|
|
798
|
+
universal: "https://www.argent.xyz/app/wc",
|
|
799
|
+
store: {
|
|
800
|
+
ios: "https://apps.apple.com/us/app/argent-defi-in-a-tap/id1358741926",
|
|
801
|
+
android: "https://play.google.com/store/apps/details?id=im.argent.contractwalletclient&hl=en&gl=US&pli=1"
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
safepal: {
|
|
805
|
+
native: "safepalwallet://",
|
|
806
|
+
scheme: "safepalwallet://wc",
|
|
807
|
+
universal: "https://link.safepal.io/wc",
|
|
808
|
+
store: {
|
|
809
|
+
ios: "https://apps.apple.com/app/safepal-wallet/id1548297139",
|
|
810
|
+
android: "https://play.google.com/store/apps/details?id=io.safepal.wallet"
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
imtoken: {
|
|
814
|
+
native: "imtokenv2://",
|
|
815
|
+
scheme: "imtokenv2://wc",
|
|
816
|
+
store: {
|
|
817
|
+
ios: "https://apps.apple.com/us/app/imtoken2/id1384798940",
|
|
818
|
+
android: "https://play.google.com/store/apps/details?id=im.token.app"
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
ronin: {
|
|
822
|
+
native: "roninwallet://",
|
|
823
|
+
scheme: "roninwallet://wc",
|
|
824
|
+
universal: "https://wallet.roninchain.com/wc",
|
|
825
|
+
store: {
|
|
826
|
+
ios: "https://apps.apple.com/us/app/ronin-wallet/id1592675001",
|
|
827
|
+
android: "https://play.google.com/store/apps/details?id=com.skymavis.genesis"
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
coin98: {
|
|
831
|
+
native: "coin98://",
|
|
832
|
+
scheme: "coin98://wc",
|
|
833
|
+
universal: "https://coin98.com/wc",
|
|
834
|
+
store: {
|
|
835
|
+
ios: "https://apps.apple.com/vn/app/coin98-wallet/id1561969966",
|
|
836
|
+
android: "https://play.google.com/store/apps/details?id=coin98.crypto.finance.media&hl=vi&gl=US"
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
bitkeep: {
|
|
840
|
+
native: "bitkeep://",
|
|
841
|
+
scheme: "bitkeep://wc",
|
|
842
|
+
universal: "https://bkapp.vip/wc",
|
|
843
|
+
store: {
|
|
844
|
+
ios: "https://web3.bitget.com/en/wallet-download?type=0",
|
|
845
|
+
android: "https://web3.bitget.com/en/wallet-download?type=0"
|
|
846
|
+
}
|
|
847
|
+
},
|
|
848
|
+
"1inch": {
|
|
849
|
+
native: "oneinch://open/nobodywilleveruseit",
|
|
850
|
+
scheme: "oneinch://open/nobodywilleveruseit/wc",
|
|
851
|
+
universal: "https://wallet.1inch.io/app/nobodywilleveruseit/wc",
|
|
852
|
+
store: {
|
|
853
|
+
ios: "https://apps.apple.com/us/app/1inch-defi-wallet/id1546049391",
|
|
854
|
+
android: "https://play.google.com/store/apps/details?id=io.oneinch.android"
|
|
855
|
+
}
|
|
856
|
+
},
|
|
857
|
+
ledgerlive: {
|
|
858
|
+
native: "ledgerlive://",
|
|
859
|
+
scheme: "ledgerlive://wc",
|
|
860
|
+
store: {
|
|
861
|
+
ios: "https://itunes.apple.com/app/id1361671700",
|
|
862
|
+
android: "https://play.google.com/store/apps/details?id=com.ledger.live"
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
atomic: {
|
|
866
|
+
native: "atomicwallet://",
|
|
867
|
+
scheme: "atomicwallet://wc",
|
|
868
|
+
store: {
|
|
869
|
+
ios: "https://apps.apple.com/us/app/atomic-wallet/id1478257827",
|
|
870
|
+
android: "https://play.google.com/store/apps/details?id=io.atomicwallet"
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
alpha: {
|
|
874
|
+
native: "awallet://",
|
|
875
|
+
scheme: "awallet://wc",
|
|
876
|
+
universal: "https://aw.app/wc",
|
|
877
|
+
store: {
|
|
878
|
+
ios: "https://apps.apple.com/us/app/alphawallet-eth-wallet/id1358230430",
|
|
879
|
+
android: "https://play.google.com/store/apps/details?id=io.stormbird.wallet"
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
math: {
|
|
883
|
+
native: "mathwallet://",
|
|
884
|
+
scheme: "mathwallet://wc",
|
|
885
|
+
universal: "https://www.mathwallet.org/wc",
|
|
886
|
+
store: {
|
|
887
|
+
ios: "https://apps.apple.com/us/app/mathwallet5/id1582612388",
|
|
888
|
+
android: "https://play.google.com/store/apps/details?id=com.mathwallet.android"
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
bitpay: {
|
|
892
|
+
native: "bitpay://",
|
|
893
|
+
scheme: "bitpay://wc",
|
|
894
|
+
universal: "https://link.bitpay.com/wc",
|
|
895
|
+
store: {
|
|
896
|
+
ios: "https://bitpay.onelink.me/Cenw/ejjaw7bs",
|
|
897
|
+
android: "https://bitpay.onelink.me/Cenw/ejjaw7bs"
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
rabby: {
|
|
901
|
+
native: "rabby://",
|
|
902
|
+
scheme: "rabby://wc",
|
|
903
|
+
store: {
|
|
904
|
+
ios: "https://apps.apple.com/us/app/rabby-wallet-crypto-evm/id6474381673",
|
|
905
|
+
android: "https://play.google.com/store/apps/details?id=com.debank.rabbymobile"
|
|
906
|
+
}
|
|
907
|
+
},
|
|
669
908
|
// 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: {
|
|
671
|
-
|
|
672
|
-
|
|
909
|
+
bybit: {
|
|
910
|
+
store: {
|
|
911
|
+
ios: "https://apps.apple.com/us/app/bybit-buy-trade-crypto/id1488296980",
|
|
912
|
+
android: "https://play.google.com/store/apps/details?id=com.bybit.app"
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
binance: {
|
|
916
|
+
native: "bnc://app.binance.com/cedefi/",
|
|
917
|
+
scheme: "bnc://app.binance.com/cedefi/wc",
|
|
918
|
+
store: {
|
|
919
|
+
ios: "https://apps.apple.com/us/app/id1436799971",
|
|
920
|
+
android: "https://play.google.com/store/apps/details?id=com.binance.dev"
|
|
921
|
+
}
|
|
922
|
+
},
|
|
923
|
+
gate: {
|
|
924
|
+
native: "gtweb3wallet://",
|
|
925
|
+
scheme: "gtweb3wallet://wc",
|
|
926
|
+
store: {
|
|
927
|
+
ios: "https://apps.apple.com/us/app/gate-io-buy-bitcoin-crypto/id1294998195",
|
|
928
|
+
android: "https://play.google.com/store/apps/details?id=com.gateio.gateio"
|
|
929
|
+
}
|
|
930
|
+
},
|
|
673
931
|
// Core: `core://` scheme not corroborated to 2 sources — QR/scan connect only.
|
|
674
|
-
core: {
|
|
932
|
+
core: {
|
|
933
|
+
store: {
|
|
934
|
+
ios: "https://apps.apple.com/us/app/core-wallet/id6443685999",
|
|
935
|
+
android: "https://play.google.com/store/apps/details?id=com.avaxwallet"
|
|
936
|
+
}
|
|
937
|
+
},
|
|
675
938
|
// Backpack: `backpack://` scheme not corroborated to 2 sources — QR/scan connect only.
|
|
676
|
-
backpack: {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
939
|
+
backpack: {
|
|
940
|
+
store: {
|
|
941
|
+
ios: "https://apps.apple.com/us/app/backpack-wallet-exchange/id6445964121",
|
|
942
|
+
android: "https://play.google.com/store/apps/details?id=app.backpack.mobile"
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
frontier: {
|
|
946
|
+
native: "frontier://",
|
|
947
|
+
scheme: "frontier://wc",
|
|
948
|
+
store: {
|
|
949
|
+
ios: "https://apps.apple.com/us/app/frontier-crypto-defi-wallet/id1482380988",
|
|
950
|
+
android: "https://play.google.com/store/apps/details?id=com.frontierwallet"
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
onekey: {
|
|
954
|
+
native: "onekey-wallet://",
|
|
955
|
+
scheme: "onekey-wallet://wc",
|
|
956
|
+
store: {
|
|
957
|
+
ios: "https://apps.apple.com/us/app/onekey-open-source-wallet/id1609559473",
|
|
958
|
+
android: "https://play.google.com/store/apps/details?id=so.onekey.app.wallet"
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
kraken: {
|
|
962
|
+
native: "krakenwallet://",
|
|
963
|
+
scheme: "krakenwallet://wc",
|
|
964
|
+
store: {
|
|
965
|
+
ios: "https://apps.apple.com/us/app/kraken-wallet/id1626327149",
|
|
966
|
+
android: "https://play.google.com/store/apps/details?id=com.kraken.superwallet"
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
uniswap: {
|
|
970
|
+
native: "uniswap://",
|
|
971
|
+
scheme: "uniswap://wc",
|
|
972
|
+
store: {
|
|
973
|
+
ios: "https://apps.apple.com/us/app/uniswap-crypto-nft-wallet/id6443944476",
|
|
974
|
+
android: "https://play.google.com/store/apps/details?id=com.uniswap.mobile"
|
|
975
|
+
}
|
|
976
|
+
},
|
|
977
|
+
omni: {
|
|
978
|
+
native: "omni://",
|
|
979
|
+
scheme: "omni://wc",
|
|
980
|
+
store: {
|
|
981
|
+
ios: "https://apps.apple.com/us/app/omni-web3-wallet/id1569375204",
|
|
982
|
+
android: "https://play.google.com/store/apps/details?id=fi.steakwallet.app"
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
mew: {
|
|
986
|
+
universal: "https://mewwallet.com/wc",
|
|
987
|
+
store: {
|
|
988
|
+
ios: "https://apps.apple.com/app/id1464614025",
|
|
989
|
+
android: "https://play.google.com/store/apps/details?id=com.myetherwallet.mewwallet"
|
|
990
|
+
}
|
|
991
|
+
},
|
|
992
|
+
foxwallet: {
|
|
993
|
+
native: "foxwallet://",
|
|
994
|
+
scheme: "foxwallet://wc",
|
|
995
|
+
universal: "https://link.foxwallet.com/wc",
|
|
996
|
+
store: {
|
|
997
|
+
ios: "https://apps.apple.com/app/foxwallet-crypto-web3/id1590983231",
|
|
998
|
+
android: "https://play.google.com/store/apps/details?id=com.foxwallet.play"
|
|
999
|
+
}
|
|
1000
|
+
},
|
|
1001
|
+
nova: {
|
|
1002
|
+
native: "novawallet://",
|
|
1003
|
+
scheme: "novawallet://wc",
|
|
1004
|
+
store: {
|
|
1005
|
+
ios: "https://apps.apple.com/us/app/nova-polkadot-wallet/id1597119355",
|
|
1006
|
+
android: "https://play.google.com/store/apps/details?id=io.novafoundation.nova.market"
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
subwallet: {
|
|
1010
|
+
native: "subwallet://",
|
|
1011
|
+
scheme: "subwallet://wc",
|
|
1012
|
+
store: {
|
|
1013
|
+
ios: "https://apps.apple.com/us/app/subwallet-polkadot-wallet/id1633050285",
|
|
1014
|
+
android: "https://play.google.com/store/apps/details?id=app.subwallet.mobile"
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
safe: {
|
|
1018
|
+
native: "safe://",
|
|
1019
|
+
scheme: "safe://wc",
|
|
1020
|
+
store: {
|
|
1021
|
+
ios: "https://apps.apple.com/us/app/safe-mobile/id6748754793",
|
|
1022
|
+
android: "https://play.google.com/store/apps/details?id=global.safe.mobileapp"
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
robinhood: {
|
|
1026
|
+
native: "robinhood-wallet://",
|
|
1027
|
+
scheme: "robinhood-wallet://wc",
|
|
1028
|
+
store: {
|
|
1029
|
+
ios: "https://apps.apple.com/us/app/robinhood-wallet-swap-crypto/id1634080733",
|
|
1030
|
+
android: "https://play.google.com/store/apps/details?id=com.robinhood.gateway"
|
|
1031
|
+
}
|
|
1032
|
+
},
|
|
1033
|
+
tangem: {
|
|
1034
|
+
native: "tangem://",
|
|
1035
|
+
scheme: "tangem://wc",
|
|
1036
|
+
store: {
|
|
1037
|
+
ios: "https://apps.apple.com/app/tangem/id1354868448",
|
|
1038
|
+
android: "https://play.google.com/store/apps/details?id=com.tangem.wallet"
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
689
1041
|
// Trezor Suite: WalletConnect pairing is QR/paste-into-Suite (no corroborated custom scheme) — QR connect only.
|
|
690
|
-
trezor: {
|
|
691
|
-
|
|
1042
|
+
trezor: {
|
|
1043
|
+
store: {
|
|
1044
|
+
ios: "https://apps.apple.com/us/app/trezor-suite/id1631884497",
|
|
1045
|
+
android: "https://play.google.com/store/apps/details?id=io.trezor.suite"
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
kucoin: {
|
|
1049
|
+
native: "kucoin://",
|
|
1050
|
+
scheme: "kucoin:///wallet/walletConnect",
|
|
1051
|
+
store: {
|
|
1052
|
+
ios: "https://apps.apple.com/app/kucoin-buy-bitcoin-crypto/id1378956601",
|
|
1053
|
+
android: "https://play.google.com/store/apps/details?id=com.kubi.kucoin"
|
|
1054
|
+
}
|
|
1055
|
+
},
|
|
692
1056
|
// Jupiter (Solana): no corroborated WC deep-link scheme — QR connect only.
|
|
693
|
-
jupiter: {
|
|
694
|
-
|
|
1057
|
+
jupiter: {
|
|
1058
|
+
store: {
|
|
1059
|
+
ios: "https://apps.apple.com/us/app/jupiter-solana-swap-wallet/id6484069059",
|
|
1060
|
+
android: "https://play.google.com/store/apps/details?id=ag.jup.jupiter.android"
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
zengo: {
|
|
1064
|
+
native: "zengo://get.zengo.com/",
|
|
1065
|
+
scheme: "zengo://get.zengo.com/wc",
|
|
1066
|
+
store: {
|
|
1067
|
+
ios: "https://apps.apple.com/us/app/zengo-crypto-bitcoin-wallet/id1440147115",
|
|
1068
|
+
android: "https://play.google.com/store/apps/details?id=com.zengo.wallet"
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
695
1071
|
// Bitcoin.com Wallet: no corroborated WC deep-link scheme — QR connect only.
|
|
696
|
-
bitcoincom: {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
1072
|
+
bitcoincom: {
|
|
1073
|
+
store: {
|
|
1074
|
+
ios: "https://apps.apple.com/us/app/bitcoin-wallet-by-bitcoin-com/id1252903728",
|
|
1075
|
+
android: "https://play.google.com/store/apps/details?id=com.bitcoin.mwallet"
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
keplr: {
|
|
1079
|
+
native: "keplrwallet://",
|
|
1080
|
+
scheme: "keplrwallet://wcV2",
|
|
1081
|
+
store: {
|
|
1082
|
+
ios: "https://apps.apple.com/us/app/keplr-wallet/id1567851089",
|
|
1083
|
+
android: "https://play.google.com/store/apps/details?id=com.chainapsis.keplr"
|
|
1084
|
+
}
|
|
1085
|
+
},
|
|
1086
|
+
cake: {
|
|
1087
|
+
native: "cakewallet://",
|
|
1088
|
+
scheme: "cakewallet://wc",
|
|
1089
|
+
store: {
|
|
1090
|
+
ios: "https://apps.apple.com/us/app/cake-wallet/id1334702542",
|
|
1091
|
+
android: "https://play.google.com/store/apps/details?id=com.cakewallet.cake_wallet"
|
|
1092
|
+
}
|
|
1093
|
+
},
|
|
1094
|
+
unstoppable: {
|
|
1095
|
+
native: "unstoppable.money://",
|
|
1096
|
+
scheme: "unstoppable.money://wc",
|
|
1097
|
+
store: {
|
|
1098
|
+
ios: "https://apps.apple.com/us/app/unstoppable-crypto-wallet/id1447619907",
|
|
1099
|
+
android: "https://play.google.com/store/apps/details?id=io.horizontalsystems.bankwallet"
|
|
1100
|
+
}
|
|
1101
|
+
},
|
|
1102
|
+
bifrost: {
|
|
1103
|
+
native: "bifrostwallet://",
|
|
1104
|
+
scheme: "bifrostwallet://wc",
|
|
1105
|
+
store: {
|
|
1106
|
+
ios: "https://apps.apple.com/us/app/bifrost-wallet/id1577198351",
|
|
1107
|
+
android: "https://play.google.com/store/apps/details?id=com.bifrostwallet.app"
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
1110
|
+
pintu: {
|
|
1111
|
+
native: "pintu://web3wallet",
|
|
1112
|
+
scheme: "pintu://web3wallet/wc",
|
|
1113
|
+
store: {
|
|
1114
|
+
ios: "https://apps.apple.com/id/app/pintu-buy-invest-crypto/id1494119678",
|
|
1115
|
+
android: "https://play.google.com/store/apps/details?id=com.valar.pintu"
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
hot: {
|
|
1119
|
+
native: "hotwallet://",
|
|
1120
|
+
scheme: "hotwallet://wc",
|
|
1121
|
+
store: {
|
|
1122
|
+
ios: "https://apps.apple.com/us/app/hot-wallet/id6740916148",
|
|
1123
|
+
android: "https://play.google.com/store/apps/details?id=app.herewallet.hot"
|
|
1124
|
+
}
|
|
1125
|
+
},
|
|
1126
|
+
arculus: {
|
|
1127
|
+
native: "arculuswc://",
|
|
1128
|
+
scheme: "arculuswc://wc",
|
|
1129
|
+
universal: "https://gw.arculus.co/app/wc",
|
|
1130
|
+
store: {
|
|
1131
|
+
ios: "https://apps.apple.com/us/app/arculus-wallet/id1575425801",
|
|
1132
|
+
android: "https://play.google.com/store/apps/details?id=co.arculus.wallet.android"
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
704
1135
|
};
|
|
705
1136
|
|
|
706
1137
|
// src/connectors/walletconnect/registry.ts
|
|
@@ -826,15 +1257,17 @@ var WalletConnectConnector = class extends BaseConnector {
|
|
|
826
1257
|
const link = this.links[req.walletId];
|
|
827
1258
|
if (link) {
|
|
828
1259
|
openWallet(link, uri);
|
|
829
|
-
void detectAppOpen(this.options.openTimeoutMs ?? 2e3).then(
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
1260
|
+
void detectAppOpen(this.options.openTimeoutMs ?? 2e3).then(
|
|
1261
|
+
(opened) => {
|
|
1262
|
+
if (!opened)
|
|
1263
|
+
this.emit({
|
|
1264
|
+
type: "wallet_open_failed",
|
|
1265
|
+
walletId: req.walletId,
|
|
1266
|
+
uri,
|
|
1267
|
+
store: link.store
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
);
|
|
838
1271
|
}
|
|
839
1272
|
}
|
|
840
1273
|
const pairingTopic = utils.parseUri(uri).topic;
|
|
@@ -842,7 +1275,12 @@ var WalletConnectConnector = class extends BaseConnector {
|
|
|
842
1275
|
void client.core.pairing.disconnect({ topic: pairingTopic }).catch(() => {
|
|
843
1276
|
});
|
|
844
1277
|
});
|
|
845
|
-
const connection = this.toConnection(
|
|
1278
|
+
const connection = this.toConnection(
|
|
1279
|
+
client,
|
|
1280
|
+
req.walletId,
|
|
1281
|
+
session,
|
|
1282
|
+
req.namespace
|
|
1283
|
+
);
|
|
846
1284
|
this.topics.set(req.walletId, session.topic);
|
|
847
1285
|
this.persist();
|
|
848
1286
|
return connection;
|
|
@@ -866,7 +1304,12 @@ var WalletConnectConnector = class extends BaseConnector {
|
|
|
866
1304
|
const client = this.client;
|
|
867
1305
|
if (client) {
|
|
868
1306
|
await Promise.allSettled(
|
|
869
|
-
client.session.getAll().map(
|
|
1307
|
+
client.session.getAll().map(
|
|
1308
|
+
(s) => client.disconnect({
|
|
1309
|
+
topic: s.topic,
|
|
1310
|
+
reason: utils.getSdkError("USER_DISCONNECTED")
|
|
1311
|
+
})
|
|
1312
|
+
)
|
|
870
1313
|
);
|
|
871
1314
|
}
|
|
872
1315
|
this.topics.clear();
|
|
@@ -934,7 +1377,8 @@ var WalletConnectConnector = class extends BaseConnector {
|
|
|
934
1377
|
load() {
|
|
935
1378
|
try {
|
|
936
1379
|
const raw = localStorage.getItem(STORAGE_KEY);
|
|
937
|
-
if (raw)
|
|
1380
|
+
if (raw)
|
|
1381
|
+
this.topics = new Map(JSON.parse(raw));
|
|
938
1382
|
} catch {
|
|
939
1383
|
}
|
|
940
1384
|
}
|
|
@@ -944,7 +1388,10 @@ function firstNamespace(session) {
|
|
|
944
1388
|
if (!name) return null;
|
|
945
1389
|
const v = session.namespaces[name];
|
|
946
1390
|
if (!v) return null;
|
|
947
|
-
return {
|
|
1391
|
+
return {
|
|
1392
|
+
name,
|
|
1393
|
+
value: { chains: v.chains, methods: v.methods, events: v.events }
|
|
1394
|
+
};
|
|
948
1395
|
}
|
|
949
1396
|
function withSignal2(promise, signal, onAbort) {
|
|
950
1397
|
if (!signal) return promise;
|
|
@@ -975,7 +1422,8 @@ function withSignal2(promise, signal, onAbort) {
|
|
|
975
1422
|
function injectedRdnsMap(sdkServed) {
|
|
976
1423
|
const map = {};
|
|
977
1424
|
for (const w of WALLET_CATALOG) {
|
|
978
|
-
if (w.rdns && w.namespaces.includes("eip155") && !sdkServed.has(w.id))
|
|
1425
|
+
if (w.rdns && w.namespaces.includes("eip155") && !sdkServed.has(w.id))
|
|
1426
|
+
map[w.id] = w.rdns;
|
|
979
1427
|
}
|
|
980
1428
|
return map;
|
|
981
1429
|
}
|
|
@@ -990,7 +1438,9 @@ function createConnectors(config) {
|
|
|
990
1438
|
return [
|
|
991
1439
|
...sdk,
|
|
992
1440
|
new InjectedConnector(injectedRdnsMap(sdkServed)),
|
|
993
|
-
new WalletConnectConnector(app, {
|
|
1441
|
+
new WalletConnectConnector(app, {
|
|
1442
|
+
projectId: config.walletConnectProjectId
|
|
1443
|
+
})
|
|
994
1444
|
];
|
|
995
1445
|
}
|
|
996
1446
|
var LydianConnect = class {
|
|
@@ -1002,7 +1452,9 @@ var LydianConnect = class {
|
|
|
1002
1452
|
}
|
|
1003
1453
|
async connect(input) {
|
|
1004
1454
|
if (input.chainId === void 0 || input.chainId === null) {
|
|
1005
|
-
throw new Error(
|
|
1455
|
+
throw new Error(
|
|
1456
|
+
'connect() requires a chainId (a number like 137 or an "eip155:<id>" string)'
|
|
1457
|
+
);
|
|
1006
1458
|
}
|
|
1007
1459
|
return this.manager.connect({
|
|
1008
1460
|
walletId: input.walletId,
|