@talken/talkenkit 2.4.30 → 2.5.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/dist/{abcWallet-TLGPQAMU.js → abcWallet-5GTT47V6.js} +1 -1
- package/dist/{chunk-MI7TNBED.js → chunk-REVMSQIO.js} +287 -71
- package/dist/index.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/abcAccessKeyProvider.d.ts +43 -0
- package/dist/wallets/walletConnectors/abcWallet/abcAccessKeyProvider.js +11 -0
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +4 -2
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +2 -1
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.d.ts +7 -0
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +5 -3
- package/dist/wallets/walletConnectors/abcWallet/api/index.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/index.js +8 -6
- package/dist/wallets/walletConnectors/abcWallet/types.d.ts +2 -0
- package/dist/wallets/walletConnectors/{chunk-HHZ3JZRH.js → chunk-HWXOTEC3.js} +12 -2
- package/dist/wallets/walletConnectors/chunk-K66HU6GX.js +732 -0
- package/dist/wallets/walletConnectors/{chunk-XNA5NIFE.js → chunk-QSP2A4LA.js} +5 -2
- package/dist/wallets/walletConnectors/chunk-S2SQYPGR.js +220 -0
- package/dist/wallets/walletConnectors/{chunk-NU3ITJNK.js → chunk-TQHS6APN.js} +7 -731
- package/dist/wallets/walletConnectors/index.js +31 -29
- package/package.json +1 -1
- package/dist/wallets/walletConnectors/chunk-CABLJOMU.js +0 -194
- package/dist/wallets/walletConnectors/chunk-J3YPHDHM.js +0 -827
- package/dist/wallets/walletConnectors/chunk-J566FC7T.js +0 -54
- package/dist/wallets/walletConnectors/chunk-OHQXPSR6.js +0 -300
- package/dist/wallets/walletConnectors/chunk-OMOYFHBT.js +0 -1485
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
bestWallet
|
|
4
|
+
} from "./chunk-OPAPBEA5.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
abcWallet
|
|
7
|
+
} from "./chunk-QSP2A4LA.js";
|
|
8
|
+
import "./chunk-HWXOTEC3.js";
|
|
9
9
|
import "./chunk-R6ZE7JAZ.js";
|
|
10
10
|
import "./chunk-GFWUFYT2.js";
|
|
11
|
+
import "./chunk-S2SQYPGR.js";
|
|
11
12
|
import "./chunk-O4AU63LK.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-TQHS6APN.js";
|
|
14
|
+
import "./chunk-K66HU6GX.js";
|
|
13
15
|
import "./chunk-A66MTFML.js";
|
|
14
16
|
import "./chunk-BHEVY4QY.js";
|
|
15
17
|
import "./chunk-4P3SPC44.js";
|
|
16
18
|
import "./chunk-6WF4SXLB.js";
|
|
17
19
|
import "./chunk-DPTDOCWL.js";
|
|
18
|
-
import {
|
|
19
|
-
tokenaryWallet
|
|
20
|
-
} from "./chunk-U24COF36.js";
|
|
21
|
-
import {
|
|
22
|
-
trustWallet
|
|
23
|
-
} from "./chunk-S2PY4MDO.js";
|
|
24
20
|
import {
|
|
25
21
|
uniswapWallet
|
|
26
22
|
} from "./chunk-DLDZUVTB.js";
|
|
@@ -39,12 +35,12 @@ import {
|
|
|
39
35
|
import {
|
|
40
36
|
zealWallet
|
|
41
37
|
} from "./chunk-SCOX5RF4.js";
|
|
38
|
+
import {
|
|
39
|
+
zerionWallet
|
|
40
|
+
} from "./chunk-53IBFGVW.js";
|
|
42
41
|
import {
|
|
43
42
|
safeWallet
|
|
44
43
|
} from "./chunk-Z2QCE6O6.js";
|
|
45
|
-
import {
|
|
46
|
-
safeheronWallet
|
|
47
|
-
} from "./chunk-PHF4VWKP.js";
|
|
48
44
|
import {
|
|
49
45
|
safepalWallet
|
|
50
46
|
} from "./chunk-ATQWOE4J.js";
|
|
@@ -64,8 +60,11 @@ import {
|
|
|
64
60
|
tokenPocketWallet
|
|
65
61
|
} from "./chunk-5NM2LK2G.js";
|
|
66
62
|
import {
|
|
67
|
-
|
|
68
|
-
} from "./chunk-
|
|
63
|
+
tokenaryWallet
|
|
64
|
+
} from "./chunk-U24COF36.js";
|
|
65
|
+
import {
|
|
66
|
+
trustWallet
|
|
67
|
+
} from "./chunk-S2PY4MDO.js";
|
|
69
68
|
import {
|
|
70
69
|
oneKeyWallet
|
|
71
70
|
} from "./chunk-6UGYPEQE.js";
|
|
@@ -88,8 +87,8 @@ import {
|
|
|
88
87
|
roninWallet
|
|
89
88
|
} from "./chunk-D7U5WEH2.js";
|
|
90
89
|
import {
|
|
91
|
-
|
|
92
|
-
} from "./chunk-
|
|
90
|
+
safeheronWallet
|
|
91
|
+
} from "./chunk-PHF4VWKP.js";
|
|
93
92
|
import {
|
|
94
93
|
magicEdenWallet
|
|
95
94
|
} from "./chunk-WB7EEKPS.js";
|
|
@@ -111,6 +110,9 @@ import {
|
|
|
111
110
|
import {
|
|
112
111
|
omniWallet
|
|
113
112
|
} from "./chunk-RGPO7AY3.js";
|
|
113
|
+
import {
|
|
114
|
+
oneInchWallet
|
|
115
|
+
} from "./chunk-OJT577AY.js";
|
|
114
116
|
import {
|
|
115
117
|
injectedWallet
|
|
116
118
|
} from "./chunk-GDGRUMZB.js";
|
|
@@ -118,35 +120,35 @@ import {
|
|
|
118
120
|
iopayWallet
|
|
119
121
|
} from "./chunk-2W6UBYKX.js";
|
|
120
122
|
import {
|
|
121
|
-
|
|
122
|
-
} from "./chunk-
|
|
123
|
+
kaiaWallet
|
|
124
|
+
} from "./chunk-C7S72VGD.js";
|
|
123
125
|
import {
|
|
124
126
|
kaikasWallet
|
|
125
127
|
} from "./chunk-BJYSWRV6.js";
|
|
126
|
-
import {
|
|
127
|
-
kaiaWallet
|
|
128
|
-
} from "./chunk-C7S72VGD.js";
|
|
129
128
|
import {
|
|
130
129
|
krakenWallet
|
|
131
130
|
} from "./chunk-CYOZFCR6.js";
|
|
132
131
|
import {
|
|
133
132
|
kresusWallet
|
|
134
133
|
} from "./chunk-CM3VR7OM.js";
|
|
134
|
+
import {
|
|
135
|
+
ledgerWallet
|
|
136
|
+
} from "./chunk-BF3VSNPL.js";
|
|
135
137
|
import {
|
|
136
138
|
dawnWallet
|
|
137
139
|
} from "./chunk-YMP3W2MO.js";
|
|
138
140
|
import {
|
|
139
141
|
desigWallet
|
|
140
142
|
} from "./chunk-DVXPOWEC.js";
|
|
143
|
+
import {
|
|
144
|
+
enkryptWallet
|
|
145
|
+
} from "./chunk-5QHPQU7J.js";
|
|
141
146
|
import {
|
|
142
147
|
foxWallet
|
|
143
148
|
} from "./chunk-K6GEK4JB.js";
|
|
144
149
|
import {
|
|
145
150
|
frameWallet
|
|
146
151
|
} from "./chunk-CP45RGL4.js";
|
|
147
|
-
import {
|
|
148
|
-
enkryptWallet
|
|
149
|
-
} from "./chunk-5QHPQU7J.js";
|
|
150
152
|
import {
|
|
151
153
|
gateWallet
|
|
152
154
|
} from "./chunk-K6UZPSBG.js";
|
|
@@ -184,8 +186,8 @@ import {
|
|
|
184
186
|
argentWallet
|
|
185
187
|
} from "./chunk-XT2WYPN5.js";
|
|
186
188
|
import {
|
|
187
|
-
|
|
188
|
-
} from "./chunk-
|
|
189
|
+
berasigWallet
|
|
190
|
+
} from "./chunk-KM55XFBI.js";
|
|
189
191
|
import {
|
|
190
192
|
bifrostWallet
|
|
191
193
|
} from "./chunk-B6DM7J4N.js";
|
package/package.json
CHANGED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
getBitcoinNetwork,
|
|
4
|
-
getEvmNetwork,
|
|
5
|
-
getSolanaNetwork,
|
|
6
|
-
getTronNetwork
|
|
7
|
-
} from "./chunk-O4AU63LK.js";
|
|
8
|
-
import {
|
|
9
|
-
getCredentialManager
|
|
10
|
-
} from "./chunk-6WF4SXLB.js";
|
|
11
|
-
import {
|
|
12
|
-
AbcError
|
|
13
|
-
} from "./chunk-4P3SPC44.js";
|
|
14
|
-
|
|
15
|
-
// src/wallets/walletConnectors/abcWallet/walletGeneration.ts
|
|
16
|
-
import { getTalkenApiClient } from "@talken/talkenkit";
|
|
17
|
-
async function mapApiResponseToWallets(genResponse, infoResponse, email) {
|
|
18
|
-
const accounts = infoResponse?.accounts || [];
|
|
19
|
-
const evmAccount = accounts[0] || infoResponse || {};
|
|
20
|
-
const uid = String(genResponse.uid || evmAccount.uid || "");
|
|
21
|
-
const wid = String(genResponse.wid || evmAccount.wid || "");
|
|
22
|
-
const sid = String(
|
|
23
|
-
evmAccount.sid || evmAccount.ethAddress || genResponse.evmAddress || ""
|
|
24
|
-
);
|
|
25
|
-
const pubkey = String(evmAccount.pubkey || genResponse.pubkey || "");
|
|
26
|
-
const solMaterial = genResponse.solana || {};
|
|
27
|
-
let btcAddress = genResponse.btcAddress || "";
|
|
28
|
-
let trxAddress = genResponse.trxAddress || "";
|
|
29
|
-
if ((!btcAddress || !trxAddress) && pubkey) {
|
|
30
|
-
try {
|
|
31
|
-
const api = getTalkenApiClient();
|
|
32
|
-
if (api) {
|
|
33
|
-
const addrResponse = await api.wallet.getAddressForChain("all");
|
|
34
|
-
if (!btcAddress)
|
|
35
|
-
btcAddress = addrResponse?.btc || addrResponse?.btcAddress || "";
|
|
36
|
-
if (!trxAddress)
|
|
37
|
-
trxAddress = addrResponse?.trx || addrResponse?.trxAddress || "";
|
|
38
|
-
}
|
|
39
|
-
} catch (err) {
|
|
40
|
-
console.warn(
|
|
41
|
-
"[walletGeneration] Failed to derive BTC/TRX addresses:",
|
|
42
|
-
err
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const pvencstr = String(evmAccount.pvencstr || "");
|
|
47
|
-
const edp = String(evmAccount.encryptDevicePassword || "");
|
|
48
|
-
if (uid && wid && sid && pvencstr && edp) {
|
|
49
|
-
getCredentialManager().setEvmSigningCredentials({
|
|
50
|
-
uid,
|
|
51
|
-
wid,
|
|
52
|
-
sid,
|
|
53
|
-
pvencstr,
|
|
54
|
-
encryptDevicePassword: edp
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
const evmWallet = {
|
|
58
|
-
uid,
|
|
59
|
-
sessionId: sid,
|
|
60
|
-
keyId: wid,
|
|
61
|
-
encryptedShare: pvencstr,
|
|
62
|
-
secretStore: edp,
|
|
63
|
-
address: genResponse.evmAddress || sid,
|
|
64
|
-
chainId: getEvmNetwork(),
|
|
65
|
-
sid,
|
|
66
|
-
type: "evm",
|
|
67
|
-
email,
|
|
68
|
-
pubkey
|
|
69
|
-
};
|
|
70
|
-
const solanaWallet = {
|
|
71
|
-
uid,
|
|
72
|
-
sessionId: String(solMaterial.shareId || ""),
|
|
73
|
-
keyId: String(solMaterial.keyId || ""),
|
|
74
|
-
encryptedShare: String(solMaterial.encryptedShare || ""),
|
|
75
|
-
secretStore: String(solMaterial.secretStore || ""),
|
|
76
|
-
shareId: String(solMaterial.shareId || ""),
|
|
77
|
-
publicKey: String(solMaterial.publicKey || ""),
|
|
78
|
-
address: genResponse.solAddress || solMaterial.address || "",
|
|
79
|
-
network: getSolanaNetwork()
|
|
80
|
-
};
|
|
81
|
-
const bitcoinWallet = {
|
|
82
|
-
uid,
|
|
83
|
-
sessionId: sid,
|
|
84
|
-
keyId: wid,
|
|
85
|
-
encryptedShare: String(evmAccount.pvencstr || ""),
|
|
86
|
-
shareId: sid,
|
|
87
|
-
publicKey: pubkey,
|
|
88
|
-
address: btcAddress,
|
|
89
|
-
addressType: "bech32",
|
|
90
|
-
network: getBitcoinNetwork()
|
|
91
|
-
};
|
|
92
|
-
const tronWallet = {
|
|
93
|
-
uid,
|
|
94
|
-
sessionId: sid,
|
|
95
|
-
keyId: wid,
|
|
96
|
-
encryptedShare: String(evmAccount.pvencstr || ""),
|
|
97
|
-
shareId: sid,
|
|
98
|
-
publicKey: pubkey,
|
|
99
|
-
address: trxAddress,
|
|
100
|
-
network: getTronNetwork()
|
|
101
|
-
};
|
|
102
|
-
return { evmWallet, solanaWallet, bitcoinWallet, tronWallet };
|
|
103
|
-
}
|
|
104
|
-
async function generateMpcWallets(hashedPin, email) {
|
|
105
|
-
const api = getTalkenApiClient();
|
|
106
|
-
if (!api) {
|
|
107
|
-
throw new AbcError(
|
|
108
|
-
"WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
|
|
109
|
-
"TalkenApiClient not initialized"
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
const genResponse = await api.wallet.generate(hashedPin, email);
|
|
114
|
-
const infoResponse = await api.wallet.getInfo().catch(() => ({}));
|
|
115
|
-
return await mapApiResponseToWallets(
|
|
116
|
-
genResponse,
|
|
117
|
-
infoResponse,
|
|
118
|
-
email || ""
|
|
119
|
-
);
|
|
120
|
-
} catch (error) {
|
|
121
|
-
throw new AbcError(
|
|
122
|
-
"WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
|
|
123
|
-
`Failed to generate MPC wallets: ${error.message}`,
|
|
124
|
-
{ originalError: error }
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
async function recoverMpcWallets(hashedPin, email) {
|
|
129
|
-
const api = getTalkenApiClient();
|
|
130
|
-
if (!api) {
|
|
131
|
-
throw new AbcError(
|
|
132
|
-
"WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
|
|
133
|
-
"TalkenApiClient not initialized"
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
try {
|
|
137
|
-
const genResponse = await api.wallet.recover(hashedPin, email);
|
|
138
|
-
const infoResponse = await api.wallet.getInfo().catch(() => ({}));
|
|
139
|
-
return await mapApiResponseToWallets(
|
|
140
|
-
genResponse,
|
|
141
|
-
infoResponse,
|
|
142
|
-
email || ""
|
|
143
|
-
);
|
|
144
|
-
} catch (error) {
|
|
145
|
-
throw new AbcError(
|
|
146
|
-
"WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
|
|
147
|
-
`Failed to recover MPC wallets: ${error.message}`,
|
|
148
|
-
{ originalError: error }
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function validateMpcWallets(result) {
|
|
153
|
-
const errors = [];
|
|
154
|
-
if (!result.evmWallet) {
|
|
155
|
-
errors.push("EVM wallet is missing");
|
|
156
|
-
} else {
|
|
157
|
-
if (!result.evmWallet.address || !result.evmWallet.address.startsWith("0x")) {
|
|
158
|
-
errors.push("Invalid EVM wallet address");
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (!result.solanaWallet) {
|
|
162
|
-
errors.push("Solana wallet is missing");
|
|
163
|
-
} else {
|
|
164
|
-
if (!result.solanaWallet.address) {
|
|
165
|
-
errors.push("Invalid Solana wallet address");
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
if (!result.bitcoinWallet) {
|
|
169
|
-
errors.push("Bitcoin wallet is missing");
|
|
170
|
-
} else {
|
|
171
|
-
if (!result.bitcoinWallet.address) {
|
|
172
|
-
errors.push("Invalid Bitcoin wallet address");
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
if (!result.tronWallet) {
|
|
176
|
-
errors.push("TRON wallet is missing");
|
|
177
|
-
} else {
|
|
178
|
-
if (!result.tronWallet.address) {
|
|
179
|
-
errors.push("Invalid TRON wallet address");
|
|
180
|
-
} else if (!result.tronWallet.address.startsWith("T")) {
|
|
181
|
-
errors.push("Invalid TRON address format (expected T prefix)");
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return {
|
|
185
|
-
valid: errors.length === 0,
|
|
186
|
-
errors
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export {
|
|
191
|
-
generateMpcWallets,
|
|
192
|
-
recoverMpcWallets,
|
|
193
|
-
validateMpcWallets
|
|
194
|
-
};
|