@talken/talkenkit 2.7.5-beta.3 → 2.7.5-beta.4

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 (43) hide show
  1. package/README.md +287 -0
  2. package/dist/abcWallet-LKCI4CKL.js +184 -0
  3. package/dist/chunk-AUHDS56C.js +7852 -0
  4. package/dist/hooks/useMultiChainBalances.d.ts +1 -1
  5. package/dist/hooks/useXrplWallet.d.ts +2 -0
  6. package/dist/index.css +1338 -1338
  7. package/dist/index.js +717 -701
  8. package/dist/wallets/walletConnectors/abcWallet/AbcEvmAutoConnector.js +1 -1
  9. package/dist/wallets/walletConnectors/abcWallet/AbstractChainProvider.js +2 -2
  10. package/dist/wallets/walletConnectors/abcWallet/abcBitcoinConnector.js +3 -3
  11. package/dist/wallets/walletConnectors/abcWallet/abcBitcoinProvider.js +3 -3
  12. package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +14 -14
  13. package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +7 -7
  14. package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +11 -11
  15. package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.js +3 -3
  16. package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +15 -15
  17. package/dist/wallets/walletConnectors/abcWallet/abcXrplProvider.d.ts +4 -0
  18. package/dist/wallets/walletConnectors/abcWallet/abcXrplProvider.js +3 -3
  19. package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.js +7 -7
  20. package/dist/wallets/walletConnectors/abcWallet/api/index.js +10 -10
  21. package/dist/wallets/walletConnectors/abcWallet/api/modules/auth.js +1 -1
  22. package/dist/wallets/walletConnectors/abcWallet/api/modules/wallet.d.ts +1 -1
  23. package/dist/wallets/walletConnectors/abcWallet/api/modules/xrp.d.ts +5 -0
  24. package/dist/wallets/walletConnectors/abcWallet/api/modules/xrp.js +1 -1
  25. package/dist/wallets/walletConnectors/abcWallet/index.js +55 -55
  26. package/dist/wallets/walletConnectors/abcWallet/networkConfig.js +1 -1
  27. package/dist/wallets/walletConnectors/abcWallet/types/api.types.d.ts +13 -0
  28. package/dist/wallets/walletConnectors/abcWallet/types.js +1 -1
  29. package/dist/wallets/walletConnectors/abcWallet/utils.js +1 -1
  30. package/dist/wallets/walletConnectors/abcWallet/walletGeneration.js +5 -5
  31. package/dist/wallets/walletConnectors/chunk-3F5K7F23.js +370 -0
  32. package/dist/wallets/walletConnectors/chunk-6NCKGQS2.js +58 -0
  33. package/dist/wallets/walletConnectors/chunk-C3HMOBQJ.js +370 -0
  34. package/dist/wallets/walletConnectors/chunk-DPQKYZHU.js +341 -0
  35. package/dist/wallets/walletConnectors/chunk-EVRAPZ3L.js +3030 -0
  36. package/dist/wallets/walletConnectors/chunk-FNGIOKCY.js +341 -0
  37. package/dist/wallets/walletConnectors/chunk-KXPCOVNY.js +215 -0
  38. package/dist/wallets/walletConnectors/chunk-ND2EIWHQ.js +345 -0
  39. package/dist/wallets/walletConnectors/chunk-SFDW4JEL.js +218 -0
  40. package/dist/wallets/walletConnectors/chunk-Y27URHIQ.js +58 -0
  41. package/dist/wallets/walletConnectors/chunk-ZOBSRU6L.js +137 -0
  42. package/dist/wallets/walletConnectors/index.js +77 -77
  43. package/package.json +2 -2
@@ -0,0 +1,345 @@
1
+ "use client";
2
+ import {
3
+ AbstractChainProvider
4
+ } from "./chunk-TLRR3FFT.js";
5
+ import {
6
+ ProviderErrorCode,
7
+ XrplProviderError
8
+ } from "./chunk-YXWHHI4S.js";
9
+ import {
10
+ createLogger
11
+ } from "./chunk-762I67R6.js";
12
+ import {
13
+ getCredentialManager
14
+ } from "./chunk-YNE2UX2Z.js";
15
+
16
+ // src/wallets/walletConnectors/abcWallet/abcXrplProvider.ts
17
+ var logger = createLogger("XrplProvider");
18
+ function isTalkenApiClient(client) {
19
+ return typeof client?.xrp?.transferXrp === "function";
20
+ }
21
+ var XRP_DECIMALS = 6;
22
+ var XRP_DROPS_PER_UNIT = 10 ** XRP_DECIMALS;
23
+ var XRPL_NETWORKS = {
24
+ mainnet: {
25
+ name: "XRP",
26
+ type: "xrpl",
27
+ explorer: "https://xrpscan.com"
28
+ },
29
+ testnet: {
30
+ name: "XRP Testnet",
31
+ type: "xrpl_testnet",
32
+ explorer: "https://testnet.xrpscan.com"
33
+ }
34
+ };
35
+ var AbcXrplProvider = class extends AbstractChainProvider {
36
+ constructor(client) {
37
+ super(isTalkenApiClient(client) ? client : void 0);
38
+ this.network = XRPL_NETWORKS.mainnet;
39
+ }
40
+ async callInterceptor(request) {
41
+ if (this.requestInterceptor) {
42
+ await this.requestInterceptor(request);
43
+ }
44
+ }
45
+ onWalletSet(wallet) {
46
+ if (wallet.network === "xrpl") {
47
+ this.network = XRPL_NETWORKS.mainnet;
48
+ } else {
49
+ this.network = XRPL_NETWORKS.testnet;
50
+ }
51
+ this.emit("connect", {
52
+ address: wallet.address,
53
+ network: this.network.type
54
+ });
55
+ logger.info(
56
+ "Wallet connected:",
57
+ `${wallet.address.substring(0, 6)}...${wallet.address.substring(wallet.address.length - 6)}`
58
+ );
59
+ }
60
+ clearWallet() {
61
+ super.clearWallet();
62
+ logger.info("Wallet disconnected");
63
+ }
64
+ async getAddress() {
65
+ if (!this.wallet) {
66
+ throw new XrplProviderError(
67
+ ProviderErrorCode.DISCONNECTED,
68
+ "Wallet not connected"
69
+ );
70
+ }
71
+ return this.wallet.address;
72
+ }
73
+ async getPublicKey() {
74
+ if (!this.wallet) {
75
+ throw new XrplProviderError(
76
+ ProviderErrorCode.DISCONNECTED,
77
+ "Wallet not connected"
78
+ );
79
+ }
80
+ return this.wallet.publicKey;
81
+ }
82
+ getNetwork() {
83
+ return this.network;
84
+ }
85
+ /**
86
+ * Send XRP/token transaction
87
+ * Complete flow: show confirmation → get PIN → call talken-api (create+sign+broadcast)
88
+ */
89
+ async sendTransaction(params) {
90
+ if (!this.wallet) {
91
+ throw new XrplProviderError(
92
+ ProviderErrorCode.DISCONNECTED,
93
+ "Wallet not connected"
94
+ );
95
+ }
96
+ try {
97
+ const isNative = !params.currency;
98
+ const symbol = isNative ? "XRP" : params.currency;
99
+ await this.callInterceptor({
100
+ chain: "xrpl",
101
+ method: "sendTransaction",
102
+ fromAddress: this.wallet.address,
103
+ toAddress: params.toAddress,
104
+ amount: params.amount,
105
+ symbol,
106
+ network: this.network.type,
107
+ isNativeToken: isNative,
108
+ feeSymbol: "XRP"
109
+ });
110
+ logger.info("Starting XRPL transaction...");
111
+ const pinHash = getCredentialManager().getPinHash();
112
+ if (!pinHash) {
113
+ throw new XrplProviderError(
114
+ ProviderErrorCode.INTERNAL_ERROR,
115
+ "PIN hash not found. Please login again."
116
+ );
117
+ }
118
+ const email = getCredentialManager().getEmail() || void 0;
119
+ const api = this.getTalkenApiClientOrThrow();
120
+ let amountRaw;
121
+ if (isNative) {
122
+ amountRaw = Math.floor(
123
+ Number.parseFloat(params.amount) * XRP_DROPS_PER_UNIT
124
+ ).toString();
125
+ logger.debug(`Converting ${params.amount} XRP -> ${amountRaw} drops`);
126
+ } else {
127
+ amountRaw = params.amount;
128
+ }
129
+ const request = {
130
+ kind: isNative ? "native" : "fungible",
131
+ network: this.network.type,
132
+ destination: params.toAddress,
133
+ amount: amountRaw,
134
+ pin: pinHash,
135
+ fee: params.fee,
136
+ destinationTag: params.destinationTag,
137
+ ...params.currency && { currency: params.currency },
138
+ ...params.issuer && { issuer: params.issuer },
139
+ waitForConfirmation: true,
140
+ ...email && { email }
141
+ };
142
+ this.showPendingTx({ network: this.network.type, chain: "xrpl" });
143
+ const result = await api.xrp.transferXrp(request);
144
+ const txHash = result.txHash;
145
+ const engineResult = result.engineResult;
146
+ const isSuccess = !engineResult || engineResult === "tesSUCCESS";
147
+ this.updateTxResult({
148
+ txHash,
149
+ network: this.network.type,
150
+ chain: "xrpl",
151
+ receipt: {
152
+ status: isSuccess ? 1 : 0,
153
+ blockNumber: null,
154
+ gasUsed: null
155
+ },
156
+ explorerUrl: `${this.network.explorer}/tx/${txHash}`
157
+ });
158
+ if (!isSuccess) {
159
+ logger.error(`XRPL transaction failed on-ledger: ${engineResult}`);
160
+ throw new XrplProviderError(
161
+ ProviderErrorCode.INTERNAL_ERROR,
162
+ `Transaction failed: ${engineResult}`
163
+ );
164
+ }
165
+ logger.info(
166
+ `${isNative ? "XRP" : "Token"} transaction complete:`,
167
+ txHash
168
+ );
169
+ this.emit("transactionBroadcasted", {
170
+ txHash,
171
+ explorerUrl: `${this.network.explorer}/tx/${txHash}`
172
+ });
173
+ return txHash;
174
+ } catch (error) {
175
+ if (error.message?.includes("cancelled") || error.message?.includes("rejected")) {
176
+ logger.info("User cancelled transaction");
177
+ throw new XrplProviderError(
178
+ ProviderErrorCode.USER_REJECTED,
179
+ "User rejected transaction",
180
+ error
181
+ );
182
+ }
183
+ logger.error("Transaction failed:", error.message);
184
+ this.failTxResult({
185
+ network: this.network.type,
186
+ chain: "xrpl",
187
+ errorMessage: error.message
188
+ });
189
+ this.emit("error", error);
190
+ throw new XrplProviderError(
191
+ ProviderErrorCode.INTERNAL_ERROR,
192
+ error.message || "Failed to send XRPL transaction",
193
+ error
194
+ );
195
+ }
196
+ }
197
+ /**
198
+ * Get XRP balance
199
+ */
200
+ async getBalance() {
201
+ if (!this.wallet) {
202
+ throw new XrplProviderError(
203
+ ProviderErrorCode.DISCONNECTED,
204
+ "Wallet not connected"
205
+ );
206
+ }
207
+ const api = this.getTalkenApiClientOrThrow();
208
+ const result = await api.xrp.getBalance(
209
+ this.network.type,
210
+ this.wallet.address
211
+ );
212
+ const data = result?.data ?? result;
213
+ return {
214
+ balance: data?.balance ?? "0",
215
+ balanceXrp: data?.balance_xrp ?? "0",
216
+ activated: data?.activated ?? false
217
+ };
218
+ }
219
+ /**
220
+ * Get fungible token balances
221
+ */
222
+ async getFtBalances(issuer) {
223
+ if (!this.wallet) {
224
+ throw new XrplProviderError(
225
+ ProviderErrorCode.DISCONNECTED,
226
+ "Wallet not connected"
227
+ );
228
+ }
229
+ const api = this.getTalkenApiClientOrThrow();
230
+ const result = await api.xrp.getFtBalances(
231
+ this.network.type,
232
+ this.wallet.address,
233
+ issuer
234
+ );
235
+ const data = result?.data ?? result;
236
+ return data?.tokens ?? [];
237
+ }
238
+ /**
239
+ * Estimate native XRP transfer fee
240
+ */
241
+ async estimateFee(destination, amount) {
242
+ const api = this.getTalkenApiClientOrThrow();
243
+ return api.xrp.getNativeFee(this.network.type, destination, amount);
244
+ }
245
+ /**
246
+ * Calculate maximum sendable XRP amount
247
+ */
248
+ async prepareMax(fee) {
249
+ if (!this.wallet) {
250
+ throw new XrplProviderError(
251
+ ProviderErrorCode.DISCONNECTED,
252
+ "Wallet not connected"
253
+ );
254
+ }
255
+ const api = this.getTalkenApiClientOrThrow();
256
+ return api.xrp.getPrepareMax(this.network.type, this.wallet.address, fee);
257
+ }
258
+ /**
259
+ * Check trustline status for a token
260
+ */
261
+ async getTrustlineStatus(issuer, currency) {
262
+ if (!this.wallet) {
263
+ throw new XrplProviderError(
264
+ ProviderErrorCode.DISCONNECTED,
265
+ "Wallet not connected"
266
+ );
267
+ }
268
+ const api = this.getTalkenApiClientOrThrow();
269
+ return api.xrp.getTrustlineStatus(
270
+ this.network.type,
271
+ this.wallet.address,
272
+ issuer,
273
+ currency
274
+ );
275
+ }
276
+ /**
277
+ * Create trustline for receiving fungible tokens
278
+ */
279
+ async createTrustline(issuer, currency, limit) {
280
+ if (!this.wallet) {
281
+ throw new XrplProviderError(
282
+ ProviderErrorCode.DISCONNECTED,
283
+ "Wallet not connected"
284
+ );
285
+ }
286
+ const pinHash = getCredentialManager().getPinHash();
287
+ if (!pinHash) {
288
+ throw new XrplProviderError(
289
+ ProviderErrorCode.INTERNAL_ERROR,
290
+ "PIN hash not found. Please login again."
291
+ );
292
+ }
293
+ const email = getCredentialManager().getEmail() || void 0;
294
+ const api = this.getTalkenApiClientOrThrow();
295
+ const result = await api.xrp.createTrustline({
296
+ issuer,
297
+ currency,
298
+ pin: pinHash,
299
+ network: this.network.type,
300
+ limit,
301
+ ...email && { email }
302
+ });
303
+ if (result.engineResult && result.engineResult !== "tesSUCCESS") {
304
+ throw new XrplProviderError(
305
+ ProviderErrorCode.INTERNAL_ERROR,
306
+ `Trustline failed: ${result.engineResult}`
307
+ );
308
+ }
309
+ return result.txHash;
310
+ }
311
+ /**
312
+ * Validate XRP address
313
+ */
314
+ async validateAddress(address) {
315
+ const api = this.getTalkenApiClientOrThrow();
316
+ const result = await api.xrp.validateAddress(this.network.type, address);
317
+ const data = result?.data ?? result;
318
+ return data?.valid === true;
319
+ }
320
+ /**
321
+ * Get XRP server info (reserve, fee, ledger state)
322
+ */
323
+ async getServerInfo() {
324
+ const api = this.getTalkenApiClientOrThrow();
325
+ return api.xrp.getServerInfo(this.network.type);
326
+ }
327
+ /**
328
+ * Get wallet info
329
+ */
330
+ getWalletInfo() {
331
+ if (!this.wallet)
332
+ return null;
333
+ return {
334
+ address: this.wallet.address,
335
+ publicKey: this.wallet.publicKey,
336
+ network: this.network.type
337
+ };
338
+ }
339
+ };
340
+
341
+ export {
342
+ XRP_DECIMALS,
343
+ XRPL_NETWORKS,
344
+ AbcXrplProvider
345
+ };
@@ -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
+ getCredentialManager
14
+ } from "./chunk-YNE2UX2Z.js";
15
+ import {
16
+ AbcError
17
+ } from "./chunk-BUAWEYGV.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
+ };
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import {
3
+ abcConnector
4
+ } from "./chunk-DPQKYZHU.js";
5
+ import {
6
+ resolveTalkenApiUrl
7
+ } from "./chunk-GFWUFYT2.js";
8
+ import {
9
+ createTalkenApiClient
10
+ } from "./chunk-C3HMOBQJ.js";
11
+ import {
12
+ ABC_WALLET_METADATA,
13
+ loadTgAccessKey
14
+ } from "./chunk-3Z5DO42M.js";
15
+
16
+ // src/wallets/walletConnectors/abcWallet/abcWallet.ts
17
+ import { setTalkenApiClient } from "@talken/talkenkit";
18
+ var abcWallet = (specificOptions) => ({ projectId }) => {
19
+ const talkenApiUrl = resolveTalkenApiUrl(specificOptions?.talkenApiUrl);
20
+ const talkenApi = createTalkenApiClient({
21
+ baseUrl: talkenApiUrl,
22
+ debug: specificOptions?.environment === "development"
23
+ });
24
+ setTalkenApiClient(talkenApi);
25
+ const accessKey = specificOptions?.accessKey || loadTgAccessKey() || null;
26
+ const config = {
27
+ talkenApiUrl,
28
+ apiKey: specificOptions?.apiKey,
29
+ plain: specificOptions?.plain || "",
30
+ // Deprecated - not used (secure.ts uses random generation)
31
+ environment: specificOptions?.environment || "development",
32
+ defaultChainId: specificOptions?.defaultChainId,
33
+ defaultSolanaNetwork: specificOptions?.defaultSolanaNetwork,
34
+ defaultBitcoinNetwork: specificOptions?.defaultBitcoinNetwork,
35
+ projectId,
36
+ ...accessKey && { accessKey }
37
+ };
38
+ return {
39
+ id: ABC_WALLET_METADATA.id,
40
+ name: ABC_WALLET_METADATA.name,
41
+ rdns: ABC_WALLET_METADATA.rdns,
42
+ iconUrl: async () => (await import("./abcWallet-4PXRQO5T.js")).default,
43
+ iconBackground: ABC_WALLET_METADATA.iconBackground,
44
+ // Embedded wallet - no installation required
45
+ installed: void 0,
46
+ // No download URLs for embedded wallet
47
+ downloadUrls: void 0,
48
+ // Create connector - wrapper function required by Wallet type
49
+ // If accessKey exists, abcConnector will use AbcAccessKeyProvider internally
50
+ createConnector: (_walletDetails) => abcConnector({ config }),
51
+ // Embedded wallet always available
52
+ hidden: () => false
53
+ };
54
+ };
55
+
56
+ export {
57
+ abcWallet
58
+ };