@talken/talkenkit 2.7.5-beta.4 → 2.7.5-beta.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.
Files changed (33) hide show
  1. package/dist/abcWallet-K5P64SSG.js +184 -0
  2. package/dist/abcWallet-WR2MVEWD.js +184 -0
  3. package/dist/chunk-5LXELITG.js +7875 -0
  4. package/dist/chunk-K6IE26XL.js +7875 -0
  5. package/dist/components/RainbowKitProvider/RainbowKitProvider.d.ts +1 -1
  6. package/dist/index.js +90 -36
  7. package/dist/wallets/walletConnectors/abcWallet/AbcEvmAutoConnector.js +2 -2
  8. package/dist/wallets/walletConnectors/abcWallet/abcBitcoinConnector.js +2 -2
  9. package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +9 -9
  10. package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +4 -4
  11. package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +7 -7
  12. package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +10 -10
  13. package/dist/wallets/walletConnectors/abcWallet/abcXrplProvider.js +1 -1
  14. package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.js +7 -7
  15. package/dist/wallets/walletConnectors/abcWallet/api/index.js +7 -7
  16. package/dist/wallets/walletConnectors/abcWallet/api/modules/auth.js +2 -2
  17. package/dist/wallets/walletConnectors/abcWallet/api/modules/xrp.d.ts +2 -2
  18. package/dist/wallets/walletConnectors/abcWallet/index.js +14 -14
  19. package/dist/wallets/walletConnectors/abcWallet/types.js +2 -2
  20. package/dist/wallets/walletConnectors/abcWallet/utils.js +2 -2
  21. package/dist/wallets/walletConnectors/abcWallet/walletGeneration.js +4 -4
  22. package/dist/wallets/walletConnectors/chunk-4FX5V2AC.js +370 -0
  23. package/dist/wallets/walletConnectors/chunk-AD7KOG6O.js +341 -0
  24. package/dist/wallets/walletConnectors/chunk-AK7AES7Q.js +58 -0
  25. package/dist/wallets/walletConnectors/chunk-BMZA3PJI.js +345 -0
  26. package/dist/wallets/walletConnectors/chunk-GBARK6FR.js +341 -0
  27. package/dist/wallets/walletConnectors/chunk-NTZTRAVC.js +3053 -0
  28. package/dist/wallets/walletConnectors/chunk-R55PD75T.js +58 -0
  29. package/dist/wallets/walletConnectors/chunk-UDOKYIOD.js +370 -0
  30. package/dist/wallets/walletConnectors/chunk-UHDUPAHC.js +3053 -0
  31. package/dist/wallets/walletConnectors/chunk-URPZVVA2.js +218 -0
  32. package/dist/wallets/walletConnectors/index.js +76 -76
  33. package/package.json +1 -1
@@ -0,0 +1,218 @@
1
+ "use client";
2
+ import {
3
+ getBitcoinNetwork,
4
+ getEvmNetwork,
5
+ getSolanaNetwork,
6
+ getTronNetwork,
7
+ getXrplNetwork
8
+ } from "./chunk-KXPCOVNY.js";
9
+ import {
10
+ createLogger
11
+ } from "./chunk-762I67R6.js";
12
+ import {
13
+ AbcError
14
+ } from "./chunk-BUAWEYGV.js";
15
+ import {
16
+ getCredentialManager
17
+ } from "./chunk-YNE2UX2Z.js";
18
+
19
+ // src/wallets/walletConnectors/abcWallet/walletGeneration.ts
20
+ import { getTalkenApiClient } from "@talken/talkenkit";
21
+ var logger = createLogger("WalletGeneration");
22
+ async function mapApiResponseToWallets(genResponse, infoResponse, email) {
23
+ const accounts = infoResponse?.accounts || [];
24
+ const evmAccount = accounts[0] || infoResponse || {};
25
+ const uid = String(genResponse.uid || evmAccount.uid || "");
26
+ const wid = String(genResponse.wid || evmAccount.wid || "");
27
+ const sid = String(
28
+ evmAccount.sid || evmAccount.ethAddress || genResponse.evmAddress || ""
29
+ );
30
+ const pubkey = String(evmAccount.pubkey || genResponse.pubkey || "");
31
+ const solMaterial = genResponse.solana || {};
32
+ let btcAddress = genResponse.btcAddress || "";
33
+ let trxAddress = genResponse.trxAddress || "";
34
+ let xrpAddress = genResponse.xrpAddress || "";
35
+ if ((!btcAddress || !trxAddress || !xrpAddress) && pubkey) {
36
+ try {
37
+ const api = getTalkenApiClient();
38
+ if (api) {
39
+ const addrResponse = await api.wallet.getAddressForChain("all");
40
+ if (!btcAddress)
41
+ btcAddress = addrResponse?.btc || addrResponse?.btcAddress || "";
42
+ if (!trxAddress)
43
+ trxAddress = addrResponse?.trx || addrResponse?.trxAddress || "";
44
+ if (!xrpAddress)
45
+ xrpAddress = addrResponse?.xrp || addrResponse?.xrpAddress || "";
46
+ }
47
+ } catch (err) {
48
+ logger.warn("Failed to derive BTC/TRX/XRP addresses:", err);
49
+ }
50
+ }
51
+ const pvencstr = String(evmAccount.pvencstr || "");
52
+ const edp = String(evmAccount.encryptDevicePassword || "");
53
+ if (uid && wid && sid && pvencstr && edp) {
54
+ getCredentialManager().setEvmSigningCredentials({
55
+ uid,
56
+ wid,
57
+ sid,
58
+ pvencstr,
59
+ encryptDevicePassword: edp
60
+ });
61
+ }
62
+ const evmWallet = {
63
+ uid,
64
+ sessionId: sid,
65
+ keyId: wid,
66
+ encryptedShare: pvencstr,
67
+ secretStore: edp,
68
+ address: genResponse.evmAddress || sid,
69
+ chainId: getEvmNetwork(),
70
+ sid,
71
+ type: "evm",
72
+ email,
73
+ pubkey
74
+ };
75
+ const solanaWallet = {
76
+ uid,
77
+ sessionId: String(solMaterial.shareId || ""),
78
+ keyId: String(solMaterial.keyId || ""),
79
+ encryptedShare: String(solMaterial.encryptedShare || ""),
80
+ secretStore: String(solMaterial.secretStore || ""),
81
+ shareId: String(solMaterial.shareId || ""),
82
+ publicKey: String(solMaterial.publicKey || ""),
83
+ address: genResponse.solAddress || solMaterial.address || "",
84
+ network: getSolanaNetwork()
85
+ };
86
+ const bitcoinWallet = {
87
+ uid,
88
+ sessionId: sid,
89
+ keyId: wid,
90
+ encryptedShare: String(evmAccount.pvencstr || ""),
91
+ shareId: sid,
92
+ publicKey: pubkey,
93
+ address: btcAddress,
94
+ addressType: "bech32",
95
+ network: getBitcoinNetwork()
96
+ };
97
+ const tronWallet = {
98
+ uid,
99
+ sessionId: sid,
100
+ keyId: wid,
101
+ encryptedShare: String(evmAccount.pvencstr || ""),
102
+ shareId: sid,
103
+ publicKey: pubkey,
104
+ address: trxAddress,
105
+ network: getTronNetwork()
106
+ };
107
+ const xrplWallet = {
108
+ uid,
109
+ sessionId: sid,
110
+ keyId: wid,
111
+ encryptedShare: String(evmAccount.pvencstr || ""),
112
+ shareId: sid,
113
+ publicKey: pubkey,
114
+ address: xrpAddress,
115
+ network: getXrplNetwork()
116
+ };
117
+ return { evmWallet, solanaWallet, bitcoinWallet, tronWallet, xrplWallet };
118
+ }
119
+ async function generateMpcWallets(hashedPin, email) {
120
+ const api = getTalkenApiClient();
121
+ if (!api) {
122
+ throw new AbcError(
123
+ "WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
124
+ "TalkenApiClient not initialized"
125
+ );
126
+ }
127
+ try {
128
+ const genResponse = await api.wallet.generate(hashedPin, email);
129
+ const infoResponse = await api.wallet.getInfo().catch(() => ({}));
130
+ return await mapApiResponseToWallets(
131
+ genResponse,
132
+ infoResponse,
133
+ email || ""
134
+ );
135
+ } catch (error) {
136
+ throw new AbcError(
137
+ "WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
138
+ `Failed to generate MPC wallets: ${error.message}`,
139
+ { originalError: error }
140
+ );
141
+ }
142
+ }
143
+ async function recoverMpcWallets(hashedPin, email) {
144
+ const api = getTalkenApiClient();
145
+ if (!api) {
146
+ throw new AbcError(
147
+ "WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
148
+ "TalkenApiClient not initialized"
149
+ );
150
+ }
151
+ try {
152
+ const genResponse = await api.wallet.recover(hashedPin, email);
153
+ const infoResponse = await api.wallet.getInfo().catch(() => ({}));
154
+ return await mapApiResponseToWallets(
155
+ genResponse,
156
+ infoResponse,
157
+ email || ""
158
+ );
159
+ } catch (error) {
160
+ throw new AbcError(
161
+ "WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
162
+ `Failed to recover MPC wallets: ${error.message}`,
163
+ { originalError: error }
164
+ );
165
+ }
166
+ }
167
+ function validateMpcWallets(result) {
168
+ const errors = [];
169
+ if (!result.evmWallet) {
170
+ errors.push("EVM wallet is missing");
171
+ } else {
172
+ if (!result.evmWallet.address || !result.evmWallet.address.startsWith("0x")) {
173
+ errors.push("Invalid EVM wallet address");
174
+ }
175
+ }
176
+ if (!result.solanaWallet) {
177
+ errors.push("Solana wallet is missing");
178
+ } else {
179
+ if (!result.solanaWallet.address) {
180
+ errors.push("Invalid Solana wallet address");
181
+ }
182
+ }
183
+ if (!result.bitcoinWallet) {
184
+ errors.push("Bitcoin wallet is missing");
185
+ } else {
186
+ if (!result.bitcoinWallet.address) {
187
+ errors.push("Invalid Bitcoin wallet address");
188
+ }
189
+ }
190
+ if (!result.tronWallet) {
191
+ errors.push("TRON wallet is missing");
192
+ } else {
193
+ if (!result.tronWallet.address) {
194
+ errors.push("Invalid TRON wallet address");
195
+ } else if (!result.tronWallet.address.startsWith("T")) {
196
+ errors.push("Invalid TRON address format (expected T prefix)");
197
+ }
198
+ }
199
+ if (!result.xrplWallet) {
200
+ errors.push("XRPL wallet is missing");
201
+ } else {
202
+ if (!result.xrplWallet.address) {
203
+ errors.push("Invalid XRPL wallet address");
204
+ } else if (!result.xrplWallet.address.startsWith("r")) {
205
+ errors.push("Invalid XRPL address format (expected r prefix)");
206
+ }
207
+ }
208
+ return {
209
+ valid: errors.length === 0,
210
+ errors
211
+ };
212
+ }
213
+
214
+ export {
215
+ generateMpcWallets,
216
+ recoverMpcWallets,
217
+ validateMpcWallets
218
+ };
@@ -1,62 +1,65 @@
1
1
  "use client";
2
2
  import {
3
3
  abcWallet
4
- } from "./chunk-6NCKGQS2.js";
4
+ } from "./chunk-R55PD75T.js";
5
5
  import {
6
- zerionWallet
7
- } from "./chunk-55PYSSYF.js";
8
- import "./chunk-FNGIOKCY.js";
6
+ wigwamWallet
7
+ } from "./chunk-HDXO2VO3.js";
8
+ import "./chunk-AD7KOG6O.js";
9
9
  import "./chunk-GFWUFYT2.js";
10
10
  import "./chunk-KXPCOVNY.js";
11
- import "./chunk-EVRAPZ3L.js";
11
+ import "./chunk-UHDUPAHC.js";
12
12
  import "./chunk-VVXSRRXI.js";
13
- import "./chunk-3F5K7F23.js";
13
+ import "./chunk-4FX5V2AC.js";
14
14
  import "./chunk-XDNFWX2X.js";
15
+ import "./chunk-TYJR3KGY.js";
15
16
  import "./chunk-4Y7YP4IR.js";
16
17
  import "./chunk-ICGK5DGY.js";
17
- import "./chunk-TYJR3KGY.js";
18
- import "./chunk-2LOET2LX.js";
19
- import "./chunk-2LH53QET.js";
20
18
  import "./chunk-3NWM24MH.js";
19
+ import "./chunk-2LH53QET.js";
20
+ import "./chunk-2LOET2LX.js";
21
21
  import "./chunk-ZOBSRU6L.js";
22
22
  import "./chunk-TLRR3FFT.js";
23
23
  import "./chunk-YXWHHI4S.js";
24
24
  import "./chunk-R6ZE7JAZ.js";
25
25
  import "./chunk-CBKU2ERC.js";
26
26
  import "./chunk-762I67R6.js";
27
- import "./chunk-YNE2UX2Z.js";
28
27
  import "./chunk-3IYXGND5.js";
29
28
  import "./chunk-YTIJR6EJ.js";
30
- import "./chunk-PR5O3NNO.js";
29
+ import "./chunk-RKQS3OQG.js";
31
30
  import "./chunk-JU6AJBYS.js";
32
31
  import "./chunk-BUAWEYGV.js";
33
- import "./chunk-RKQS3OQG.js";
32
+ import "./chunk-PR5O3NNO.js";
33
+ import "./chunk-YNE2UX2Z.js";
34
34
  import "./chunk-NEMEHJ72.js";
35
35
  import "./chunk-3Z5DO42M.js";
36
+ import {
37
+ tokenaryWallet
38
+ } from "./chunk-AGYNSAGV.js";
36
39
  import {
37
40
  trustWallet
38
41
  } from "./chunk-PS6VC6X2.js";
39
42
  import {
40
- tokenPocketWallet
41
- } from "./chunk-D24ZTR45.js";
43
+ valoraWallet
44
+ } from "./chunk-CVUEWUDI.js";
42
45
  import {
43
46
  uniswapWallet
44
47
  } from "./chunk-DLDZUVTB.js";
45
48
  import {
46
- valoraWallet
47
- } from "./chunk-CVUEWUDI.js";
49
+ xdefiWallet
50
+ } from "./chunk-LAXV47ZW.js";
51
+ import {
52
+ zerionWallet
53
+ } from "./chunk-55PYSSYF.js";
48
54
  import {
49
55
  walletConnectWallet
50
56
  } from "./chunk-QE5JINVZ.js";
51
- import {
52
- wigwamWallet
53
- } from "./chunk-HDXO2VO3.js";
54
- import {
55
- xdefiWallet
56
- } from "./chunk-LAXV47ZW.js";
57
57
  import {
58
58
  zealWallet
59
59
  } from "./chunk-NPZ2IXNP.js";
60
+ import {
61
+ seifWallet
62
+ } from "./chunk-7W4Q633H.js";
60
63
  import {
61
64
  safeheronWallet
62
65
  } from "./chunk-GFZKT4IO.js";
@@ -67,29 +70,23 @@ import {
67
70
  safeWallet
68
71
  } from "./chunk-MOGBMZDG.js";
69
72
  import {
70
- seifWallet
71
- } from "./chunk-7W4Q633H.js";
73
+ subWallet
74
+ } from "./chunk-BVYGUONL.js";
72
75
  import {
73
76
  tahoWallet
74
77
  } from "./chunk-ETH7KTEX.js";
75
- import {
76
- subWallet
77
- } from "./chunk-BVYGUONL.js";
78
78
  import {
79
79
  talismanWallet
80
80
  } from "./chunk-CV5HJWQX.js";
81
81
  import {
82
- tokenaryWallet
83
- } from "./chunk-AGYNSAGV.js";
82
+ tokenPocketWallet
83
+ } from "./chunk-D24ZTR45.js";
84
84
  import {
85
85
  oneKeyWallet
86
86
  } from "./chunk-WQX4JNSR.js";
87
87
  import {
88
- okxWallet
89
- } from "./chunk-N4US77B2.js";
90
- import {
91
- paraSwapWallet
92
- } from "./chunk-FF7ZXD5C.js";
88
+ oktoWallet
89
+ } from "./chunk-7SSXG35M.js";
93
90
  import {
94
91
  phantomWallet
95
92
  } from "./chunk-M3L6IDTW.js";
@@ -99,6 +96,9 @@ import {
99
96
  import {
100
97
  rainbowWallet
101
98
  } from "./chunk-7KK6YQOT.js";
99
+ import {
100
+ paraSwapWallet
101
+ } from "./chunk-FF7ZXD5C.js";
102
102
  import {
103
103
  ramperWallet
104
104
  } from "./chunk-U7GM25HG.js";
@@ -109,29 +109,29 @@ import {
109
109
  magicEdenWallet
110
110
  } from "./chunk-6MKGDGZC.js";
111
111
  import {
112
- metaMaskWallet
113
- } from "./chunk-DB7MZG7R.js";
114
- import {
115
- kaikasWallet
116
- } from "./chunk-PWGB7WJS.js";
112
+ kresusWallet
113
+ } from "./chunk-YEPLVWRU.js";
117
114
  import {
118
115
  mewWallet
119
116
  } from "./chunk-SNL7AQZC.js";
117
+ import {
118
+ metaMaskWallet
119
+ } from "./chunk-DB7MZG7R.js";
120
120
  import {
121
121
  nestWallet
122
122
  } from "./chunk-V4DYVGON.js";
123
123
  import {
124
- oneInchWallet
125
- } from "./chunk-OJT577AY.js";
126
- import {
127
- oktoWallet
128
- } from "./chunk-7SSXG35M.js";
124
+ okxWallet
125
+ } from "./chunk-N4US77B2.js";
129
126
  import {
130
127
  omniWallet
131
128
  } from "./chunk-5DLRROWS.js";
132
129
  import {
133
- gateWallet
134
- } from "./chunk-S25DFPKE.js";
130
+ oneInchWallet
131
+ } from "./chunk-OJT577AY.js";
132
+ import {
133
+ imTokenWallet
134
+ } from "./chunk-GASVLJPX.js";
135
135
  import {
136
136
  injectedWallet
137
137
  } from "./chunk-DWN4FQRW.js";
@@ -144,82 +144,82 @@ import {
144
144
  import {
145
145
  klipWallet
146
146
  } from "./chunk-Y3ITXHBE.js";
147
+ import {
148
+ kaikasWallet
149
+ } from "./chunk-PWGB7WJS.js";
150
+ import {
151
+ ledgerWallet
152
+ } from "./chunk-BF3VSNPL.js";
147
153
  import {
148
154
  krakenWallet
149
155
  } from "./chunk-CYOZFCR6.js";
150
156
  import {
151
- kresusWallet
152
- } from "./chunk-YEPLVWRU.js";
157
+ foxWallet
158
+ } from "./chunk-IVLX2RF5.js";
153
159
  import {
154
- ledgerWallet
155
- } from "./chunk-BF3VSNPL.js";
160
+ coinbaseWallet
161
+ } from "./chunk-UENRQ4DQ.js";
156
162
  import {
157
163
  dawnWallet
158
164
  } from "./chunk-P7L4LLUH.js";
159
165
  import {
160
166
  desigWallet
161
167
  } from "./chunk-5DEGWPQO.js";
162
- import {
163
- foxWallet
164
- } from "./chunk-IVLX2RF5.js";
165
168
  import {
166
169
  enkryptWallet
167
170
  } from "./chunk-PD4VAFOJ.js";
171
+ import {
172
+ gateWallet
173
+ } from "./chunk-S25DFPKE.js";
168
174
  import {
169
175
  frameWallet
170
176
  } from "./chunk-37QSOQFN.js";
171
- import {
172
- clvWallet
173
- } from "./chunk-QHXBBEB2.js";
174
177
  import {
175
178
  frontierWallet
176
179
  } from "./chunk-KJYEUYDB.js";
177
180
  import {
178
- imTokenWallet
179
- } from "./chunk-GASVLJPX.js";
181
+ braveWallet
182
+ } from "./chunk-7AOQK5GH.js";
180
183
  import {
181
- bitgetWallet
182
- } from "./chunk-DKEP5NZT.js";
184
+ bitverseWallet
185
+ } from "./chunk-6HCSSBZY.js";
183
186
  import {
184
187
  bloomWallet
185
188
  } from "./chunk-3KPCADAF.js";
186
189
  import {
187
- braveWallet
188
- } from "./chunk-7AOQK5GH.js";
190
+ clvWallet
191
+ } from "./chunk-QHXBBEB2.js";
189
192
  import {
190
193
  bybitWallet
191
194
  } from "./chunk-2AJYFWBT.js";
192
195
  import {
193
196
  coin98Wallet
194
197
  } from "./chunk-RN23EOYO.js";
195
- import {
196
- coinbaseWallet
197
- } from "./chunk-UENRQ4DQ.js";
198
- import {
199
- compassWallet
200
- } from "./chunk-DK4AJRIP.js";
201
198
  import {
202
199
  coreWallet
203
200
  } from "./chunk-EV4S6LIH.js";
204
201
  import {
205
- berasigWallet
206
- } from "./chunk-6WB5NVHI.js";
202
+ compassWallet
203
+ } from "./chunk-DK4AJRIP.js";
207
204
  import {
208
205
  argentWallet
209
206
  } from "./chunk-5QDAPSZZ.js";
210
207
  import {
211
208
  bifrostWallet
212
209
  } from "./chunk-TAOBQCBQ.js";
213
- import {
214
- binanceWallet
215
- } from "./chunk-LGGIEH7O.js";
216
- import "./chunk-RETKWSKD.js";
217
210
  import {
218
211
  bestWallet
219
212
  } from "./chunk-U7C4Y4UW.js";
220
213
  import {
221
- bitverseWallet
222
- } from "./chunk-6HCSSBZY.js";
214
+ berasigWallet
215
+ } from "./chunk-6WB5NVHI.js";
216
+ import {
217
+ binanceWallet
218
+ } from "./chunk-LGGIEH7O.js";
219
+ import {
220
+ bitgetWallet
221
+ } from "./chunk-DKEP5NZT.js";
222
+ import "./chunk-RETKWSKD.js";
223
223
  import "./chunk-PODFK4OS.js";
224
224
  import {
225
225
  bitskiWallet
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talken/talkenkit",
3
- "version": "2.7.5-beta.4",
3
+ "version": "2.7.5-beta.6",
4
4
  "description": "The best way to connect a wallet 🌈 🧰",
5
5
  "files": [
6
6
  "dist",