@talken/talkenkit 2.3.4 → 2.3.6
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.js +21 -27
- package/dist/wallets/walletConnectors/abcWallet/abcApi.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWallet.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/api/index.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/index.js +6 -6
- package/dist/wallets/walletConnectors/chunk-2J66VMY5.js +152 -0
- package/dist/wallets/walletConnectors/chunk-2J6LHJAF.js +228 -0
- package/dist/wallets/walletConnectors/chunk-2W6UBYKX.js +66 -0
- package/dist/wallets/walletConnectors/chunk-2ZPGPZCP.js +228 -0
- package/dist/wallets/walletConnectors/chunk-3DPCIDW6.js +1730 -0
- package/dist/wallets/walletConnectors/chunk-3IVTKZ7V.js +87 -0
- package/dist/wallets/walletConnectors/chunk-47TQ23J4.js +63 -0
- package/dist/wallets/walletConnectors/chunk-4HKJ53H3.js +1742 -0
- package/dist/wallets/walletConnectors/chunk-4T3UOJYR.js +76 -0
- package/dist/wallets/walletConnectors/chunk-53IBFGVW.js +102 -0
- package/dist/wallets/walletConnectors/chunk-5EARL7FN.js +39 -0
- package/dist/wallets/walletConnectors/chunk-5NM2LK2G.js +95 -0
- package/dist/wallets/walletConnectors/chunk-66SCJ77O.js +63 -0
- package/dist/wallets/walletConnectors/chunk-6JKWIEGA.js +228 -0
- package/dist/wallets/walletConnectors/chunk-7L33BY4P.js +44 -0
- package/dist/wallets/walletConnectors/chunk-7SXCH5TL.js +1752 -0
- package/dist/wallets/walletConnectors/chunk-7UZBDZZZ.js +599 -0
- package/dist/wallets/walletConnectors/chunk-AKLKCDXT.js +186 -0
- package/dist/wallets/walletConnectors/chunk-ATQWOE4J.js +110 -0
- package/dist/wallets/walletConnectors/chunk-B6DM7J4N.js +71 -0
- package/dist/wallets/walletConnectors/chunk-BHMMHU7Y.js +228 -0
- package/dist/wallets/walletConnectors/chunk-BJYSWRV6.js +93 -0
- package/dist/wallets/walletConnectors/chunk-BRM4ZVXZ.js +44 -0
- package/dist/wallets/walletConnectors/chunk-BUDWZAL7.js +44 -0
- package/dist/wallets/walletConnectors/chunk-C7S72VGD.js +93 -0
- package/dist/wallets/walletConnectors/chunk-CSWWNAYR.js +44 -0
- package/dist/wallets/walletConnectors/chunk-CULIWWLV.js +101 -0
- package/dist/wallets/walletConnectors/chunk-D7U5WEH2.js +96 -0
- package/dist/wallets/walletConnectors/chunk-E4N7SPPU.js +39 -0
- package/dist/wallets/walletConnectors/chunk-ENU7XLF5.js +44 -0
- package/dist/wallets/walletConnectors/chunk-ESRU5KCF.js +151 -0
- package/dist/wallets/walletConnectors/chunk-FBI7UGNO.js +95 -0
- package/dist/wallets/walletConnectors/chunk-FF7ZIXKD.js +39 -0
- package/dist/wallets/walletConnectors/chunk-FJCL2YPU.js +1737 -0
- package/dist/wallets/walletConnectors/chunk-FSU3WBH3.js +63 -0
- package/dist/wallets/walletConnectors/chunk-G2IHR6PW.js +63 -0
- package/dist/wallets/walletConnectors/chunk-GILMNC3J.js +96 -0
- package/dist/wallets/walletConnectors/chunk-HDYBRMYW.js +194 -0
- package/dist/wallets/walletConnectors/chunk-HIZCIW5L.js +228 -0
- package/dist/wallets/walletConnectors/chunk-JBVBQUCS.js +73 -0
- package/dist/wallets/walletConnectors/chunk-JCMXNOQ5.js +63 -0
- package/dist/wallets/walletConnectors/chunk-JWO4ZQLK.js +98 -0
- package/dist/wallets/walletConnectors/chunk-K6GEK4JB.js +66 -0
- package/dist/wallets/walletConnectors/chunk-K6UZPSBG.js +94 -0
- package/dist/wallets/walletConnectors/chunk-KIQDE4N6.js +39 -0
- package/dist/wallets/walletConnectors/chunk-KM55XFBI.js +65 -0
- package/dist/wallets/walletConnectors/chunk-KOT7JYJR.js +39 -0
- package/dist/wallets/walletConnectors/chunk-KRAIITU7.js +39 -0
- package/dist/wallets/walletConnectors/chunk-KZOSE2PI.js +228 -0
- package/dist/wallets/walletConnectors/chunk-L7I5I4CZ.js +44 -0
- package/dist/wallets/walletConnectors/chunk-LNZJLKFB.js +39 -0
- package/dist/wallets/walletConnectors/chunk-LTBQU2GW.js +63 -0
- package/dist/wallets/walletConnectors/chunk-LV765WZL.js +1748 -0
- package/dist/wallets/walletConnectors/chunk-MSI2BPP5.js +1722 -0
- package/dist/wallets/walletConnectors/chunk-MX2IY5CD.js +44 -0
- package/dist/wallets/walletConnectors/chunk-NLX2EV7O.js +44 -0
- package/dist/wallets/walletConnectors/chunk-NVAZ3B3V.js +228 -0
- package/dist/wallets/walletConnectors/chunk-OEB7MRS5.js +39 -0
- package/dist/wallets/walletConnectors/chunk-OEWU3ZMN.js +39 -0
- package/dist/wallets/walletConnectors/chunk-P2E4LSYH.js +1678 -0
- package/dist/wallets/walletConnectors/chunk-P2MTINFI.js +280 -0
- package/dist/wallets/walletConnectors/chunk-PNMSIVVT.js +44 -0
- package/dist/wallets/walletConnectors/chunk-PZNYT2HC.js +1722 -0
- package/dist/wallets/walletConnectors/chunk-QZRNNI3E.js +39 -0
- package/dist/wallets/walletConnectors/chunk-R4UYVU5X.js +1721 -0
- package/dist/wallets/walletConnectors/chunk-R6JCHV55.js +39 -0
- package/dist/wallets/walletConnectors/chunk-RLBGBBIO.js +309 -0
- package/dist/wallets/walletConnectors/chunk-RSZS2RMC.js +44 -0
- package/dist/wallets/walletConnectors/chunk-S2PY4MDO.js +108 -0
- package/dist/wallets/walletConnectors/chunk-SCOX5RF4.js +91 -0
- package/dist/wallets/walletConnectors/chunk-TUUNSVKZ.js +345 -0
- package/dist/wallets/walletConnectors/chunk-U2CUEL35.js +240 -0
- package/dist/wallets/walletConnectors/chunk-V6NRLREB.js +44 -0
- package/dist/wallets/walletConnectors/chunk-V7E5KRXJ.js +103 -0
- package/dist/wallets/walletConnectors/chunk-VCBVYFLJ.js +63 -0
- package/dist/wallets/walletConnectors/chunk-VM7AEC7H.js +39 -0
- package/dist/wallets/walletConnectors/chunk-VPNKJ7PB.js +1674 -0
- package/dist/wallets/walletConnectors/chunk-W2VDZD74.js +478 -0
- package/dist/wallets/walletConnectors/chunk-WAO3KL5U.js +285 -0
- package/dist/wallets/walletConnectors/chunk-WPHTIILX.js +228 -0
- package/dist/wallets/walletConnectors/chunk-WR7HSVMH.js +228 -0
- package/dist/wallets/walletConnectors/chunk-WSCJY2QD.js +228 -0
- package/dist/wallets/walletConnectors/chunk-WSLFMQIG.js +98 -0
- package/dist/wallets/walletConnectors/chunk-X3JQB5QL.js +44 -0
- package/dist/wallets/walletConnectors/chunk-X4CDP7L7.js +228 -0
- package/dist/wallets/walletConnectors/chunk-XETOVXYM.js +228 -0
- package/dist/wallets/walletConnectors/chunk-XYPR4BAF.js +436 -0
- package/dist/wallets/walletConnectors/chunk-YZBFKVTX.js +1675 -0
- package/dist/wallets/walletConnectors/chunk-Z2E65XSS.js +96 -0
- package/dist/wallets/walletConnectors/chunk-Z2ZRPTPX.js +1726 -0
- package/dist/wallets/walletConnectors/index.js +13 -13
- package/package.json +1 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
isAndroid,
|
|
4
|
+
isIOS
|
|
5
|
+
} from "./chunk-RETKWSKD.js";
|
|
6
|
+
import {
|
|
7
|
+
getInjectedConnector,
|
|
8
|
+
hasInjectedProvider
|
|
9
|
+
} from "./chunk-MBBGZGXF.js";
|
|
10
|
+
import {
|
|
11
|
+
getWalletConnectConnector
|
|
12
|
+
} from "./chunk-PODFK4OS.js";
|
|
13
|
+
|
|
14
|
+
// src/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.ts
|
|
15
|
+
function isMetaMask(ethereum) {
|
|
16
|
+
if (!ethereum?.isMetaMask)
|
|
17
|
+
return false;
|
|
18
|
+
if (ethereum.isBraveWallet && !ethereum._events && !ethereum._state)
|
|
19
|
+
return false;
|
|
20
|
+
if (ethereum.isApexWallet)
|
|
21
|
+
return false;
|
|
22
|
+
if (ethereum.isAvalanche)
|
|
23
|
+
return false;
|
|
24
|
+
if (ethereum.isBackpack)
|
|
25
|
+
return false;
|
|
26
|
+
if (ethereum.isBifrost)
|
|
27
|
+
return false;
|
|
28
|
+
if (ethereum.isBitKeep)
|
|
29
|
+
return false;
|
|
30
|
+
if (ethereum.isBitski)
|
|
31
|
+
return false;
|
|
32
|
+
if (ethereum.isBlockWallet)
|
|
33
|
+
return false;
|
|
34
|
+
if (ethereum.isCoinbaseWallet)
|
|
35
|
+
return false;
|
|
36
|
+
if (ethereum.isDawn)
|
|
37
|
+
return false;
|
|
38
|
+
if (ethereum.isEnkrypt)
|
|
39
|
+
return false;
|
|
40
|
+
if (ethereum.isExodus)
|
|
41
|
+
return false;
|
|
42
|
+
if (ethereum.isFrame)
|
|
43
|
+
return false;
|
|
44
|
+
if (ethereum.isFrontier)
|
|
45
|
+
return false;
|
|
46
|
+
if (ethereum.isGamestop)
|
|
47
|
+
return false;
|
|
48
|
+
if (ethereum.isHyperPay)
|
|
49
|
+
return false;
|
|
50
|
+
if (ethereum.isImToken)
|
|
51
|
+
return false;
|
|
52
|
+
if (ethereum.isKuCoinWallet)
|
|
53
|
+
return false;
|
|
54
|
+
if (ethereum.isMathWallet)
|
|
55
|
+
return false;
|
|
56
|
+
if (ethereum.isNestWallet)
|
|
57
|
+
return false;
|
|
58
|
+
if (ethereum.isOkxWallet || ethereum.isOKExWallet)
|
|
59
|
+
return false;
|
|
60
|
+
if (ethereum.isOneInchIOSWallet || ethereum.isOneInchAndroidWallet)
|
|
61
|
+
return false;
|
|
62
|
+
if (ethereum.isOpera)
|
|
63
|
+
return false;
|
|
64
|
+
if (ethereum.isPhantom)
|
|
65
|
+
return false;
|
|
66
|
+
if (ethereum.isPortal)
|
|
67
|
+
return false;
|
|
68
|
+
if (ethereum.isRabby)
|
|
69
|
+
return false;
|
|
70
|
+
if (ethereum.isRainbow)
|
|
71
|
+
return false;
|
|
72
|
+
if (ethereum.isStatus)
|
|
73
|
+
return false;
|
|
74
|
+
if (ethereum.isTalisman)
|
|
75
|
+
return false;
|
|
76
|
+
if (ethereum.isTally)
|
|
77
|
+
return false;
|
|
78
|
+
if (ethereum.isTokenPocket)
|
|
79
|
+
return false;
|
|
80
|
+
if (ethereum.isTokenary)
|
|
81
|
+
return false;
|
|
82
|
+
if (ethereum.isTrust || ethereum.isTrustWallet)
|
|
83
|
+
return false;
|
|
84
|
+
if (ethereum.isXDEFI)
|
|
85
|
+
return false;
|
|
86
|
+
if (ethereum.isZeal)
|
|
87
|
+
return false;
|
|
88
|
+
if (ethereum.isZerion)
|
|
89
|
+
return false;
|
|
90
|
+
if (ethereum.__seif)
|
|
91
|
+
return false;
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
var metaMaskWallet = ({
|
|
95
|
+
projectId,
|
|
96
|
+
walletConnectParameters
|
|
97
|
+
}) => {
|
|
98
|
+
const isMetaMaskInjected = hasInjectedProvider({ flag: "isMetaMask" });
|
|
99
|
+
const shouldUseWalletConnect = !isMetaMaskInjected;
|
|
100
|
+
const getUri = (uri) => {
|
|
101
|
+
return isAndroid() ? uri : isIOS() ? (
|
|
102
|
+
// currently broken in MetaMask v6.5.0 https://github.com/MetaMask/metamask-mobile/issues/6457
|
|
103
|
+
`metamask://wc?uri=${encodeURIComponent(uri)}`
|
|
104
|
+
) : `https://metamask.app.link/wc?uri=${encodeURIComponent(uri)}`;
|
|
105
|
+
};
|
|
106
|
+
return {
|
|
107
|
+
id: "metaMask",
|
|
108
|
+
name: "MetaMask",
|
|
109
|
+
rdns: "io.metamask",
|
|
110
|
+
iconUrl: async () => (await import("./metaMaskWallet-YFHEHW7V.js")).default,
|
|
111
|
+
iconAccent: "#f6851a",
|
|
112
|
+
iconBackground: "#fff",
|
|
113
|
+
installed: !shouldUseWalletConnect ? isMetaMaskInjected : void 0,
|
|
114
|
+
downloadUrls: {
|
|
115
|
+
android: "https://play.google.com/store/apps/details?id=io.metamask",
|
|
116
|
+
ios: "https://apps.apple.com/us/app/metamask/id1438144202",
|
|
117
|
+
mobile: "https://metamask.io/download",
|
|
118
|
+
qrCode: "https://metamask.io/download",
|
|
119
|
+
chrome: "https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",
|
|
120
|
+
edge: "https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",
|
|
121
|
+
firefox: "https://addons.mozilla.org/firefox/addon/ether-metamask",
|
|
122
|
+
opera: "https://addons.opera.com/extensions/details/metamask-10",
|
|
123
|
+
browserExtension: "https://metamask.io/download"
|
|
124
|
+
},
|
|
125
|
+
mobile: {
|
|
126
|
+
getUri: shouldUseWalletConnect ? getUri : void 0
|
|
127
|
+
},
|
|
128
|
+
qrCode: shouldUseWalletConnect ? {
|
|
129
|
+
getUri,
|
|
130
|
+
instructions: {
|
|
131
|
+
learnMoreUrl: "https://metamask.io/faqs/",
|
|
132
|
+
steps: [
|
|
133
|
+
{
|
|
134
|
+
description: "wallet_connectors.metamask.qr_code.step1.description",
|
|
135
|
+
step: "install",
|
|
136
|
+
title: "wallet_connectors.metamask.qr_code.step1.title"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
description: "wallet_connectors.metamask.qr_code.step2.description",
|
|
140
|
+
step: "create",
|
|
141
|
+
title: "wallet_connectors.metamask.qr_code.step2.title"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
description: "wallet_connectors.metamask.qr_code.step3.description",
|
|
145
|
+
step: "refresh",
|
|
146
|
+
title: "wallet_connectors.metamask.qr_code.step3.title"
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
} : void 0,
|
|
151
|
+
extension: {
|
|
152
|
+
instructions: {
|
|
153
|
+
learnMoreUrl: "https://metamask.io/faqs/",
|
|
154
|
+
steps: [
|
|
155
|
+
{
|
|
156
|
+
description: "wallet_connectors.metamask.extension.step1.description",
|
|
157
|
+
step: "install",
|
|
158
|
+
title: "wallet_connectors.metamask.extension.step1.title"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
description: "wallet_connectors.metamask.extension.step2.description",
|
|
162
|
+
step: "create",
|
|
163
|
+
title: "wallet_connectors.metamask.extension.step2.title"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
description: "wallet_connectors.metamask.extension.step3.description",
|
|
167
|
+
step: "refresh",
|
|
168
|
+
title: "wallet_connectors.metamask.extension.step3.title"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
174
|
+
projectId,
|
|
175
|
+
walletConnectParameters
|
|
176
|
+
}) : getInjectedConnector({
|
|
177
|
+
target: typeof window !== "undefined" ? window.ethereum?.providers?.find(
|
|
178
|
+
isMetaMask
|
|
179
|
+
) ?? window.ethereum : void 0
|
|
180
|
+
})
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export {
|
|
185
|
+
metaMaskWallet
|
|
186
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getInjectedConnector,
|
|
4
|
+
hasInjectedProvider
|
|
5
|
+
} from "./chunk-MBBGZGXF.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-PODFK4OS.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/safepalWallet/safepalWallet.ts
|
|
11
|
+
var safepalWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isSafePalWalletInjected = hasInjectedProvider({
|
|
16
|
+
namespace: "safepalProvider",
|
|
17
|
+
flag: "isSafePal"
|
|
18
|
+
});
|
|
19
|
+
const shouldUseWalletConnect = !isSafePalWalletInjected;
|
|
20
|
+
const getUriMobile = (uri) => {
|
|
21
|
+
return `safepalwallet://wc?uri=${encodeURIComponent(uri)}`;
|
|
22
|
+
};
|
|
23
|
+
const getUriQR = async (uri) => {
|
|
24
|
+
return uri;
|
|
25
|
+
};
|
|
26
|
+
const mobileConnector = {
|
|
27
|
+
getUri: shouldUseWalletConnect ? getUriMobile : void 0
|
|
28
|
+
};
|
|
29
|
+
let qrConnector = void 0;
|
|
30
|
+
if (shouldUseWalletConnect) {
|
|
31
|
+
qrConnector = {
|
|
32
|
+
getUri: getUriQR,
|
|
33
|
+
instructions: {
|
|
34
|
+
learnMoreUrl: "https://safepal.com/",
|
|
35
|
+
steps: [
|
|
36
|
+
{
|
|
37
|
+
description: "wallet_connectors.safepal.qr_code.step1.description",
|
|
38
|
+
step: "install",
|
|
39
|
+
title: "wallet_connectors.safepal.qr_code.step1.title"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
description: "wallet_connectors.safepal.qr_code.step2.description",
|
|
43
|
+
step: "create",
|
|
44
|
+
title: "wallet_connectors.safepal.qr_code.step2.title"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
description: "wallet_connectors.safepal.qr_code.step3.description",
|
|
48
|
+
step: "scan",
|
|
49
|
+
title: "wallet_connectors.safepal.qr_code.step3.title"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const extensionConnector = {
|
|
56
|
+
instructions: {
|
|
57
|
+
learnMoreUrl: "https://www.safepal.com/download?product=2",
|
|
58
|
+
steps: [
|
|
59
|
+
{
|
|
60
|
+
description: "wallet_connectors.safepal.extension.step1.description",
|
|
61
|
+
step: "install",
|
|
62
|
+
title: "wallet_connectors.safepal.extension.step1.title"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
description: "wallet_connectors.safepal.extension.step2.description",
|
|
66
|
+
step: "create",
|
|
67
|
+
title: "wallet_connectors.safepal.extension.step2.title"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
description: "wallet_connectors.safepal.extension.step3.description",
|
|
71
|
+
step: "refresh",
|
|
72
|
+
title: "wallet_connectors.safepal.extension.step3.title"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
id: "safepal",
|
|
79
|
+
name: "SafePal Wallet",
|
|
80
|
+
iconUrl: async () => (await import("./safepalWallet-KQJ4OCNH.js")).default,
|
|
81
|
+
// Note that we never resolve `installed` to `false` because the
|
|
82
|
+
// SafePal Wallet provider falls back to other connection methods if
|
|
83
|
+
// the injected connector isn't available
|
|
84
|
+
installed: isSafePalWalletInjected,
|
|
85
|
+
iconAccent: "#3375BB",
|
|
86
|
+
iconBackground: "#fff",
|
|
87
|
+
downloadUrls: {
|
|
88
|
+
android: "https://play.google.com/store/apps/details?id=io.safepal.wallet&referrer=utm_source%3Drainbowkit%26utm_medium%3Ddisplay%26utm_campaign%3Ddownload",
|
|
89
|
+
ios: "https://apps.apple.com/app/apple-store/id1548297139?pt=122504219&ct=rainbowkit&mt=8",
|
|
90
|
+
mobile: "https://www.safepal.com/en/download",
|
|
91
|
+
qrCode: "https://www.safepal.com/en/download",
|
|
92
|
+
chrome: "https://chrome.google.com/webstore/detail/safepal-extension-wallet/lgmpcpglpngdoalbgeoldeajfclnhafa",
|
|
93
|
+
browserExtension: "https://www.safepal.com/download?product=2"
|
|
94
|
+
},
|
|
95
|
+
mobile: mobileConnector,
|
|
96
|
+
...qrConnector ? qrConnector : {},
|
|
97
|
+
extension: extensionConnector,
|
|
98
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
99
|
+
projectId,
|
|
100
|
+
walletConnectParameters
|
|
101
|
+
}) : getInjectedConnector({
|
|
102
|
+
namespace: "safepalProvider",
|
|
103
|
+
flag: "isSafePal"
|
|
104
|
+
})
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
safepalWallet
|
|
110
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
isAndroid
|
|
4
|
+
} from "./chunk-RETKWSKD.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-MBBGZGXF.js";
|
|
9
|
+
import {
|
|
10
|
+
getWalletConnectConnector
|
|
11
|
+
} from "./chunk-PODFK4OS.js";
|
|
12
|
+
|
|
13
|
+
// src/wallets/walletConnectors/bifrostWallet/bifrostWallet.ts
|
|
14
|
+
var bifrostWallet = ({
|
|
15
|
+
projectId,
|
|
16
|
+
walletConnectParameters
|
|
17
|
+
}) => {
|
|
18
|
+
const isBifrostInjected = hasInjectedProvider({ flag: "isBifrost" });
|
|
19
|
+
const shouldUseWalletConnect = !isBifrostInjected;
|
|
20
|
+
const getUri = (uri) => {
|
|
21
|
+
return isAndroid() ? uri : `https://app.bifrostwallet.com/wc?uri=${encodeURIComponent(uri)}`;
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
id: "bifrostWallet",
|
|
25
|
+
name: "Bifrost Wallet",
|
|
26
|
+
iconUrl: async () => (await import("./bifrostWallet-ORF3DABG.js")).default,
|
|
27
|
+
iconBackground: "#fff",
|
|
28
|
+
installed: !shouldUseWalletConnect ? isBifrostInjected : void 0,
|
|
29
|
+
downloadUrls: {
|
|
30
|
+
android: "https://play.google.com/store/apps/details?id=com.bifrostwallet.app",
|
|
31
|
+
ios: "https://apps.apple.com/us/app/bifrost-wallet/id1577198351",
|
|
32
|
+
qrCode: "https://bifrostwallet.com/#download-app"
|
|
33
|
+
},
|
|
34
|
+
mobile: {
|
|
35
|
+
getUri: shouldUseWalletConnect ? getUri : void 0
|
|
36
|
+
},
|
|
37
|
+
qrCode: shouldUseWalletConnect ? {
|
|
38
|
+
getUri: (uri) => uri,
|
|
39
|
+
instructions: {
|
|
40
|
+
learnMoreUrl: "https://support.bifrostwallet.com/en/articles/6886814-how-to-use-walletconnect",
|
|
41
|
+
steps: [
|
|
42
|
+
{
|
|
43
|
+
description: "wallet_connectors.bifrost.qr_code.step1.description",
|
|
44
|
+
step: "install",
|
|
45
|
+
title: "wallet_connectors.bifrost.qr_code.step1.title"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
description: "wallet_connectors.bifrost.qr_code.step2.description",
|
|
49
|
+
step: "create",
|
|
50
|
+
title: "wallet_connectors.bifrost.qr_code.step2.title"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
description: "wallet_connectors.bifrost.qr_code.step3.description",
|
|
54
|
+
step: "scan",
|
|
55
|
+
title: "wallet_connectors.bifrost.qr_code.step3.title"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
} : void 0,
|
|
60
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
61
|
+
projectId,
|
|
62
|
+
walletConnectParameters
|
|
63
|
+
}) : getInjectedConnector({
|
|
64
|
+
flag: "isBifrost"
|
|
65
|
+
})
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
bifrostWallet
|
|
71
|
+
};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
createAbcWaasClient
|
|
4
|
+
} from "./chunk-P2E4LSYH.js";
|
|
5
|
+
import {
|
|
6
|
+
createAbcEvmProvider
|
|
7
|
+
} from "./chunk-73B7HWCT.js";
|
|
8
|
+
import {
|
|
9
|
+
clearAuthState,
|
|
10
|
+
clearEncryptedTokens,
|
|
11
|
+
loadAuthState,
|
|
12
|
+
saveAuthState
|
|
13
|
+
} from "./chunk-W23N7VC4.js";
|
|
14
|
+
|
|
15
|
+
// src/wallets/walletConnectors/abcWallet/abcConnector.ts
|
|
16
|
+
import { createConnector } from "wagmi";
|
|
17
|
+
function abcConnector(options) {
|
|
18
|
+
const { config } = options;
|
|
19
|
+
return createConnector((wagmiConfig) => {
|
|
20
|
+
const client = createAbcWaasClient(config);
|
|
21
|
+
const provider = createAbcEvmProvider(client);
|
|
22
|
+
let accountsChangedHandler;
|
|
23
|
+
let chainChangedHandler;
|
|
24
|
+
let disconnectHandler;
|
|
25
|
+
return {
|
|
26
|
+
id: "abc",
|
|
27
|
+
name: "ABC Wallet",
|
|
28
|
+
type: "abc",
|
|
29
|
+
/**
|
|
30
|
+
* Connect wallet
|
|
31
|
+
*/
|
|
32
|
+
async connect() {
|
|
33
|
+
try {
|
|
34
|
+
const authState = loadAuthState();
|
|
35
|
+
console.log("\u{1F527} ABC Connector connect() called:", {
|
|
36
|
+
hasAuthState: !!authState,
|
|
37
|
+
isAuthenticated: authState?.isAuthenticated,
|
|
38
|
+
hasWallet: !!authState?.wallet,
|
|
39
|
+
walletAddress: authState?.wallet?.address
|
|
40
|
+
});
|
|
41
|
+
if (!authState || !authState.isAuthenticated || !authState.wallet) {
|
|
42
|
+
throw new Error("ABC_LOGIN_REQUIRED");
|
|
43
|
+
}
|
|
44
|
+
provider.setWallet(authState.wallet);
|
|
45
|
+
console.log("\u2705 Provider wallet set:", {
|
|
46
|
+
address: authState.wallet.address,
|
|
47
|
+
hasPIN: !!authState.pin
|
|
48
|
+
});
|
|
49
|
+
const accounts = await provider.request({
|
|
50
|
+
method: "eth_requestAccounts"
|
|
51
|
+
});
|
|
52
|
+
const currentChainId = await provider.request({
|
|
53
|
+
method: "eth_chainId"
|
|
54
|
+
});
|
|
55
|
+
if (accountsChangedHandler) {
|
|
56
|
+
provider.removeListener("accountsChanged", accountsChangedHandler);
|
|
57
|
+
}
|
|
58
|
+
accountsChangedHandler = (accounts2) => {
|
|
59
|
+
wagmiConfig.emitter.emit("change", {
|
|
60
|
+
accounts: accounts2
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
provider.on("accountsChanged", accountsChangedHandler);
|
|
64
|
+
if (chainChangedHandler) {
|
|
65
|
+
provider.removeListener("chainChanged", chainChangedHandler);
|
|
66
|
+
}
|
|
67
|
+
chainChangedHandler = (chainId) => {
|
|
68
|
+
wagmiConfig.emitter.emit("change", {
|
|
69
|
+
chainId: Number(chainId)
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
provider.on("chainChanged", chainChangedHandler);
|
|
73
|
+
if (disconnectHandler) {
|
|
74
|
+
provider.removeListener("disconnect", disconnectHandler);
|
|
75
|
+
}
|
|
76
|
+
disconnectHandler = () => {
|
|
77
|
+
wagmiConfig.emitter.emit("disconnect");
|
|
78
|
+
this.onDisconnect();
|
|
79
|
+
};
|
|
80
|
+
provider.on("disconnect", disconnectHandler);
|
|
81
|
+
return {
|
|
82
|
+
accounts,
|
|
83
|
+
chainId: Number(currentChainId)
|
|
84
|
+
};
|
|
85
|
+
} catch (error) {
|
|
86
|
+
if (error.message === "ABC_LOGIN_REQUIRED") {
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Disconnect wallet
|
|
94
|
+
*/
|
|
95
|
+
async disconnect() {
|
|
96
|
+
if (accountsChangedHandler) {
|
|
97
|
+
provider.removeListener("accountsChanged", accountsChangedHandler);
|
|
98
|
+
accountsChangedHandler = void 0;
|
|
99
|
+
}
|
|
100
|
+
if (chainChangedHandler) {
|
|
101
|
+
provider.removeListener("chainChanged", chainChangedHandler);
|
|
102
|
+
chainChangedHandler = void 0;
|
|
103
|
+
}
|
|
104
|
+
if (disconnectHandler) {
|
|
105
|
+
provider.removeListener("disconnect", disconnectHandler);
|
|
106
|
+
disconnectHandler = void 0;
|
|
107
|
+
}
|
|
108
|
+
provider.clearWallet();
|
|
109
|
+
await client.logout();
|
|
110
|
+
let savedPinHash = null;
|
|
111
|
+
let savedEmail = null;
|
|
112
|
+
if (typeof window !== "undefined") {
|
|
113
|
+
savedPinHash = localStorage.getItem("talkenkit_abc_pin_hash");
|
|
114
|
+
savedEmail = localStorage.getItem("talkenkit_abc_saved_email");
|
|
115
|
+
}
|
|
116
|
+
clearAuthState();
|
|
117
|
+
clearEncryptedTokens();
|
|
118
|
+
if (typeof window !== "undefined") {
|
|
119
|
+
localStorage.removeItem("talkenkit_abc_enc_salt");
|
|
120
|
+
localStorage.removeItem("talkenkit_abc_enc_tokens");
|
|
121
|
+
if (savedPinHash) {
|
|
122
|
+
localStorage.setItem("talkenkit_abc_pin_hash", savedPinHash);
|
|
123
|
+
}
|
|
124
|
+
if (savedEmail) {
|
|
125
|
+
localStorage.setItem("talkenkit_abc_saved_email", savedEmail);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
console.log("\u2705 ABC Wallet disconnected (PIN preserved)");
|
|
129
|
+
},
|
|
130
|
+
/**
|
|
131
|
+
* Get accounts
|
|
132
|
+
*/
|
|
133
|
+
async getAccounts() {
|
|
134
|
+
const accounts = await provider.request({
|
|
135
|
+
method: "eth_accounts"
|
|
136
|
+
});
|
|
137
|
+
return accounts.map((account) => account);
|
|
138
|
+
},
|
|
139
|
+
/**
|
|
140
|
+
* Get chain ID
|
|
141
|
+
*/
|
|
142
|
+
async getChainId() {
|
|
143
|
+
const chainId = await provider.request({
|
|
144
|
+
method: "eth_chainId"
|
|
145
|
+
});
|
|
146
|
+
return Number(chainId);
|
|
147
|
+
},
|
|
148
|
+
/**
|
|
149
|
+
* Get provider
|
|
150
|
+
*/
|
|
151
|
+
async getProvider() {
|
|
152
|
+
return provider;
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Check if authorized (has valid session)
|
|
156
|
+
*/
|
|
157
|
+
async isAuthorized() {
|
|
158
|
+
try {
|
|
159
|
+
const authState = loadAuthState();
|
|
160
|
+
if (!authState || !authState.isAuthenticated) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
return client.isAuthenticated();
|
|
164
|
+
} catch {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
/**
|
|
169
|
+
* Switch chain
|
|
170
|
+
*/
|
|
171
|
+
async switchChain({ chainId }) {
|
|
172
|
+
await provider.request({
|
|
173
|
+
method: "wallet_switchEthereumChain",
|
|
174
|
+
params: [{ chainId: `0x${chainId.toString(16)}` }]
|
|
175
|
+
});
|
|
176
|
+
const newChainId = await this.getChainId();
|
|
177
|
+
const authState = loadAuthState();
|
|
178
|
+
if (authState?.wallet) {
|
|
179
|
+
authState.wallet.chainId = newChainId;
|
|
180
|
+
saveAuthState(authState);
|
|
181
|
+
}
|
|
182
|
+
return wagmiConfig.chains.find((x) => x.id === chainId) ?? {
|
|
183
|
+
id: chainId,
|
|
184
|
+
name: `Chain ${chainId}`,
|
|
185
|
+
nativeCurrency: {
|
|
186
|
+
name: "Ether",
|
|
187
|
+
decimals: 18,
|
|
188
|
+
symbol: "ETH"
|
|
189
|
+
},
|
|
190
|
+
rpcUrls: {
|
|
191
|
+
default: { http: [""] }
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
/**
|
|
196
|
+
* Handle accounts changed
|
|
197
|
+
*/
|
|
198
|
+
onAccountsChanged(accounts) {
|
|
199
|
+
if (accounts.length === 0) {
|
|
200
|
+
this.onDisconnect();
|
|
201
|
+
} else {
|
|
202
|
+
wagmiConfig.emitter.emit("change", {
|
|
203
|
+
accounts
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
/**
|
|
208
|
+
* Handle chain changed
|
|
209
|
+
*/
|
|
210
|
+
onChainChanged(chain) {
|
|
211
|
+
const chainId = Number(chain);
|
|
212
|
+
wagmiConfig.emitter.emit("change", { chainId });
|
|
213
|
+
},
|
|
214
|
+
/**
|
|
215
|
+
* Handle disconnect
|
|
216
|
+
*/
|
|
217
|
+
onDisconnect(_error) {
|
|
218
|
+
provider.clearWallet();
|
|
219
|
+
clearAuthState();
|
|
220
|
+
wagmiConfig.emitter.emit("disconnect");
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export {
|
|
227
|
+
abcConnector
|
|
228
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getInjectedConnector,
|
|
4
|
+
hasInjectedProvider
|
|
5
|
+
} from "./chunk-MBBGZGXF.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-PODFK4OS.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/kaikasWallet/kaikasWallet.ts
|
|
11
|
+
var kaikasWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isKaikasWalletInjected = hasInjectedProvider({
|
|
16
|
+
namespace: "klaytn"
|
|
17
|
+
});
|
|
18
|
+
const shouldUseWalletConnect = !isKaikasWalletInjected;
|
|
19
|
+
const getUri = (uri) => {
|
|
20
|
+
return `kaikas://walletconnect?uri=${encodeURIComponent(uri)}`;
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
id: "kaikas",
|
|
24
|
+
name: "Kaikas Wallet",
|
|
25
|
+
iconUrl: async () => (await import("./kaikasWallet-F6Z6IPWN.js")).default,
|
|
26
|
+
installed: isKaikasWalletInjected || void 0,
|
|
27
|
+
iconBackground: "#fff",
|
|
28
|
+
downloadUrls: {
|
|
29
|
+
chrome: "https://chromewebstore.google.com/detail/kaikas/jblndlipeogpafnldhgmapagcccfchpi",
|
|
30
|
+
browserExtension: "https://app.kaikas.io",
|
|
31
|
+
qrCode: "https://app.kaikas.io",
|
|
32
|
+
ios: "https://apps.apple.com/us/app/kaikas-mobile-crypto-wallet/id1626107061",
|
|
33
|
+
android: "https://play.google.com/store/apps/details?id=io.klutch.wallet",
|
|
34
|
+
mobile: "https://app.kaikas.io"
|
|
35
|
+
},
|
|
36
|
+
mobile: { getUri: shouldUseWalletConnect ? getUri : void 0 },
|
|
37
|
+
qrCode: shouldUseWalletConnect ? {
|
|
38
|
+
getUri: (uri) => uri,
|
|
39
|
+
instructions: {
|
|
40
|
+
learnMoreUrl: "https://kaikas.io",
|
|
41
|
+
steps: [
|
|
42
|
+
{
|
|
43
|
+
description: "wallet_connectors.kaikas.qr_code.step1.description",
|
|
44
|
+
step: "install",
|
|
45
|
+
title: "wallet_connectors.kaikas.qr_code.step1.title"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
description: "wallet_connectors.kaikas.qr_code.step2.description",
|
|
49
|
+
step: "create",
|
|
50
|
+
title: "wallet_connectors.kaikas.qr_code.step2.title"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
description: "wallet_connectors.kaikas.qr_code.step3.description",
|
|
54
|
+
step: "refresh",
|
|
55
|
+
title: "wallet_connectors.kaikas.qr_code.step3.title"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
} : void 0,
|
|
60
|
+
extension: {
|
|
61
|
+
instructions: {
|
|
62
|
+
learnMoreUrl: "https://kaikas.io",
|
|
63
|
+
steps: [
|
|
64
|
+
{
|
|
65
|
+
description: "wallet_connectors.kaikas.extension.step1.description",
|
|
66
|
+
step: "install",
|
|
67
|
+
title: "wallet_connectors.kaikas.extension.step1.title"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
description: "wallet_connectors.kaikas.extension.step2.description",
|
|
71
|
+
step: "create",
|
|
72
|
+
title: "wallet_connectors.kaikas.extension.step2.title"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
description: "wallet_connectors.kaikas.extension.step3.description",
|
|
76
|
+
step: "refresh",
|
|
77
|
+
title: "wallet_connectors.kaikas.extension.step3.title"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
83
|
+
projectId,
|
|
84
|
+
walletConnectParameters
|
|
85
|
+
}) : getInjectedConnector({
|
|
86
|
+
namespace: "klaytn"
|
|
87
|
+
})
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
kaikasWallet
|
|
93
|
+
};
|