@talken/talkenkit 2.4.24 → 2.4.26
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/AbcCredentialManager-DDHLW2IH.js +7 -0
- package/dist/abcWallet-GFKDYN2Z.js +161 -0
- package/dist/abcWallet-MWUFO3JQ.js +161 -0
- package/dist/abcWallet-OL47MLVO.js +161 -0
- package/dist/abcWallet-VYU3TEGJ.js +161 -0
- package/dist/abcWallet-WZGXGXUA.js +161 -0
- package/dist/chunk-2OHX4KTB.js +5382 -0
- package/dist/chunk-ALBABQ53.js +354 -0
- package/dist/chunk-NQCUKFAV.js +5381 -0
- package/dist/chunk-RIEG3EJO.js +5385 -0
- package/dist/chunk-RKEFBYBO.js +5402 -0
- package/dist/chunk-UKIPSWEV.js +5386 -0
- package/dist/hooks/useProfile.d.ts +13 -6
- package/dist/hooks/useSolanaWallet.d.ts +9 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +276 -181
- package/dist/providers/SignConfirmationProvider/useApiClient.d.ts +3 -0
- package/dist/solana/ConfiguredWalletProvider.d.ts +10 -0
- package/dist/solana/LegacySolflareWalletAdapter.d.ts +32 -0
- package/dist/solana/connectExternalWallet.d.ts +9 -0
- package/dist/solana/isWalletReady.d.ts +2 -0
- package/dist/transactions/transactionStore.d.ts +2 -5
- package/dist/utils/apiClientFactory.d.ts +16 -1
- package/dist/wallets/capabilities/detectCapabilities.d.ts +1 -0
- package/dist/wallets/walletConnectors/abcWallet/AbcCredentialManager.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/AbcEvmAutoConnector.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinConnector.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinProvider.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +6 -6
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.d.ts +0 -4
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +11 -3
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWalletAdapter.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +7 -7
- package/dist/wallets/walletConnectors/abcWallet/api/ConfigApi.d.ts +21 -0
- package/dist/wallets/walletConnectors/abcWallet/api/ConfigApi.js +8 -0
- package/dist/wallets/walletConnectors/abcWallet/api/SolanaApi.d.ts +28 -115
- package/dist/wallets/walletConnectors/abcWallet/api/SolanaApi.js +1 -6
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.d.ts +23 -1
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/api/TokenApi.d.ts +14 -0
- package/dist/wallets/walletConnectors/abcWallet/api/TokenApi.js +8 -0
- package/dist/wallets/walletConnectors/abcWallet/api/WalletscanApi.d.ts +20 -0
- package/dist/wallets/walletConnectors/abcWallet/api/WalletscanApi.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/api/index.d.ts +3 -0
- package/dist/wallets/walletConnectors/abcWallet/api/index.js +17 -5
- package/dist/wallets/walletConnectors/abcWallet/constants.d.ts +4 -0
- package/dist/wallets/walletConnectors/abcWallet/constants.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/index.d.ts +1 -1
- package/dist/wallets/walletConnectors/abcWallet/index.js +33 -21
- package/dist/wallets/walletConnectors/abcWallet/sessionUtils.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/types.d.ts +4 -0
- package/dist/wallets/walletConnectors/abcWallet/utils.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/walletGeneration.js +3 -3
- package/dist/wallets/walletConnectors/chunk-6WF4SXLB.js +156 -0
- package/dist/wallets/walletConnectors/chunk-7DM6H5BJ.js +54 -0
- package/dist/wallets/walletConnectors/chunk-7F5DVU5U.js +300 -0
- package/dist/wallets/walletConnectors/chunk-7ORDZ6EQ.js +1479 -0
- package/dist/wallets/walletConnectors/chunk-A66MTFML.js +223 -0
- package/dist/wallets/walletConnectors/chunk-ACLPF2UW.js +96 -0
- package/dist/wallets/walletConnectors/chunk-BXH3GDX5.js +273 -0
- package/dist/wallets/walletConnectors/chunk-CABLJOMU.js +194 -0
- package/dist/wallets/walletConnectors/chunk-CE37VZAR.js +300 -0
- package/dist/wallets/walletConnectors/chunk-DPTDOCWL.js +205 -0
- package/dist/wallets/walletConnectors/chunk-E7TDM6P6.js +205 -0
- package/dist/wallets/walletConnectors/chunk-GBMOX5JN.js +54 -0
- package/dist/wallets/walletConnectors/chunk-GWYZ2IPP.js +1479 -0
- package/dist/wallets/walletConnectors/chunk-HF6GFAE5.js +54 -0
- package/dist/wallets/walletConnectors/chunk-IM7DEERX.js +585 -0
- package/dist/wallets/walletConnectors/chunk-INFMRNND.js +300 -0
- package/dist/wallets/walletConnectors/chunk-JADQLTFW.js +194 -0
- package/dist/wallets/walletConnectors/chunk-JGXJY3SB.js +1 -0
- package/dist/wallets/walletConnectors/chunk-K3VHBOXQ.js +32 -0
- package/dist/wallets/walletConnectors/chunk-KZS2C73S.js +814 -0
- package/dist/wallets/walletConnectors/chunk-L6EUMSX2.js +54 -0
- package/dist/wallets/walletConnectors/chunk-LJNUFDGO.js +205 -0
- package/dist/wallets/walletConnectors/chunk-MO2AXXLI.js +30 -0
- package/dist/wallets/walletConnectors/chunk-NYDDRNUI.js +445 -0
- package/dist/wallets/walletConnectors/chunk-O4DNG6JJ.js +54 -0
- package/dist/wallets/walletConnectors/chunk-OMOYFHBT.js +1485 -0
- package/dist/wallets/walletConnectors/chunk-OTLZVWY7.js +39 -0
- package/dist/wallets/walletConnectors/chunk-PDXO6AOG.js +300 -0
- package/dist/wallets/walletConnectors/chunk-VDWJ3NQ5.js +52 -0
- package/dist/wallets/walletConnectors/chunk-VKOPUEQG.js +445 -0
- package/dist/wallets/walletConnectors/chunk-VTOD7PXP.js +817 -0
- package/dist/wallets/walletConnectors/chunk-WC7BGU5Z.js +814 -0
- package/dist/wallets/walletConnectors/chunk-YDSBY7NO.js +54 -0
- package/dist/wallets/walletConnectors/chunk-YV6IZWGE.js +393 -0
- package/dist/wallets/walletConnectors/chunk-Z5SBGIWT.js +300 -0
- package/dist/wallets/walletConnectors/chunk-ZKCUYHBK.js +300 -0
- package/dist/wallets/walletConnectors/index.js +90 -90
- package/package.json +1 -1
|
@@ -6,3 +6,6 @@
|
|
|
6
6
|
export { TalkenApiClient, createTalkenApiClient } from './TalkenApiClient';
|
|
7
7
|
export { WalletscanApi } from './WalletscanApi';
|
|
8
8
|
export { GasApi } from './GasApi';
|
|
9
|
+
export { ConfigApi } from './ConfigApi';
|
|
10
|
+
export { TokenApi } from './TokenApi';
|
|
11
|
+
export { SolanaApi } from './SolanaApi';
|
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "../../chunk-
|
|
2
|
+
import "../../chunk-JGXJY3SB.js";
|
|
3
|
+
import {
|
|
4
|
+
TokenApi
|
|
5
|
+
} from "../../chunk-MO2AXXLI.js";
|
|
3
6
|
import {
|
|
4
7
|
WalletscanApi
|
|
5
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-E7TDM6P6.js";
|
|
9
|
+
import {
|
|
10
|
+
ConfigApi
|
|
11
|
+
} from "../../chunk-VDWJ3NQ5.js";
|
|
6
12
|
import {
|
|
7
13
|
GasApi
|
|
8
14
|
} from "../../chunk-YPM7FC4M.js";
|
|
15
|
+
import {
|
|
16
|
+
SolanaApi
|
|
17
|
+
} from "../../chunk-OTLZVWY7.js";
|
|
9
18
|
import {
|
|
10
19
|
TalkenApiClient,
|
|
11
20
|
createTalkenApiClient
|
|
12
|
-
} from "../../chunk-
|
|
21
|
+
} from "../../chunk-VTOD7PXP.js";
|
|
13
22
|
import "../../chunk-4P3SPC44.js";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-6WF4SXLB.js";
|
|
24
|
+
import "../../chunk-DPTDOCWL.js";
|
|
16
25
|
export {
|
|
26
|
+
ConfigApi,
|
|
17
27
|
GasApi,
|
|
28
|
+
SolanaApi,
|
|
18
29
|
TalkenApiClient,
|
|
30
|
+
TokenApi,
|
|
19
31
|
WalletscanApi,
|
|
20
32
|
createTalkenApiClient
|
|
21
33
|
};
|
|
@@ -214,6 +214,8 @@ export declare const TALKEN_API_ENDPOINTS: {
|
|
|
214
214
|
readonly TX_RAW: "/wallet/tx/raw";
|
|
215
215
|
readonly TX_EVM: "/wallet/tx/evm";
|
|
216
216
|
readonly TX_SOL: "/wallet/tx/sol";
|
|
217
|
+
readonly SOLANA_LATEST_BLOCKHASH: "/wallet/solana/latest-blockhash";
|
|
218
|
+
readonly SOLANA_TX_STATUS: "/wallet/solana/tx-status";
|
|
217
219
|
readonly TX_BTC: "/wallet/tx/btc";
|
|
218
220
|
readonly TX_TVM: "/wallet/tx/tvm";
|
|
219
221
|
readonly GAS_PRICE: "/wallet/gas/price";
|
|
@@ -221,4 +223,6 @@ export declare const TALKEN_API_ENDPOINTS: {
|
|
|
221
223
|
readonly GAS_ESTIMATE: "/wallet/gas/estimate";
|
|
222
224
|
readonly NONCE: "/wallet/nonce";
|
|
223
225
|
readonly RELAYER_FEE_ESTIMATE: "/relayer/estimate-fee";
|
|
226
|
+
readonly CONFIG_TX_STATUS: "/config/tx-status";
|
|
227
|
+
readonly TOKENS_BALANCES: "/tokens/balances";
|
|
224
228
|
};
|
|
@@ -11,7 +11,7 @@ export type { AbcWalletSpecificOptions } from './abcWallet';
|
|
|
11
11
|
export type { AbcWalletConfig, AbcAuthProvider, AbcUser, AbcWallet, AbcEvmWallet, AbcSolanaWallet, AbcBitcoinWallet, AbcTronWallet, AbcAuthState, AbcLoginParams, AbcWalletParams, AbcSignParams, AbcSignSolanaTransactionParams, AbcSignSolanaMessageParams, AbcSendSolanaTransactionParams, AbcSignBitcoinTransactionParams, AbcSignBitcoinMessageParams, AbcSendBitcoinTransactionParams, AbcSignMessageParams, AbcApiResponse, AbcLoginResponse, AbcWalletResponse, AbcSignatureResponse, AbcOtpResponse, AbcRefreshTokenResponse, AbcPinConfig, AbcChainConfig, AbcConnectorOptions, AbcModalState, AbcEventType, AbcEventListener, BitcoinUtxo, } from './types';
|
|
12
12
|
export { AbcStorageKey, AbcErrorCode, AbcError } from './types';
|
|
13
13
|
export { TalkenApiClient, createTalkenApiClient } from './api';
|
|
14
|
-
export { WalletscanApi, GasApi } from './api';
|
|
14
|
+
export { WalletscanApi, GasApi, ConfigApi, TokenApi, SolanaApi } from './api';
|
|
15
15
|
export { AbcEvmProvider, createAbcEvmProvider, createAbcProvider, } from './abcProvider';
|
|
16
16
|
export type { AbcProvider } from './abcProvider';
|
|
17
17
|
export { abcConnector } from './abcConnector';
|
|
@@ -1,47 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "../chunk-35RTM3PL.js";
|
|
3
|
-
import {
|
|
4
|
-
WalletscanApi
|
|
5
|
-
} from "../chunk-CC6GTQBN.js";
|
|
6
2
|
import {
|
|
7
3
|
SessionExpiredError,
|
|
8
4
|
dispatchSessionExpired,
|
|
9
5
|
fetchWithSessionCheck,
|
|
10
6
|
handleUnauthorizedResponse,
|
|
11
7
|
refreshAccessToken
|
|
12
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-ACLPF2UW.js";
|
|
13
9
|
import {
|
|
14
10
|
generateMpcWallets,
|
|
15
11
|
recoverMpcWallets,
|
|
16
12
|
validateMpcWallets
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import {
|
|
19
|
-
GasApi
|
|
20
|
-
} from "../chunk-YPM7FC4M.js";
|
|
13
|
+
} from "../chunk-JADQLTFW.js";
|
|
21
14
|
import {
|
|
22
15
|
AbcTronProvider,
|
|
23
16
|
TRON_NETWORKS,
|
|
24
17
|
TronProviderError
|
|
25
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-YV6IZWGE.js";
|
|
26
19
|
import {
|
|
27
20
|
AbcBitcoinConnector,
|
|
28
21
|
createAbcBitcoinConnector
|
|
29
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-BXH3GDX5.js";
|
|
30
23
|
import {
|
|
31
24
|
AbcBitcoinProvider,
|
|
32
25
|
BITCOIN_NETWORKS,
|
|
33
26
|
BitcoinProviderError
|
|
34
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-IM7DEERX.js";
|
|
35
28
|
import {
|
|
36
29
|
AbcSolanaProvider,
|
|
37
30
|
SolanaProviderError
|
|
38
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-NYDDRNUI.js";
|
|
32
|
+
import "../chunk-JGXJY3SB.js";
|
|
33
|
+
import {
|
|
34
|
+
TokenApi
|
|
35
|
+
} from "../chunk-MO2AXXLI.js";
|
|
36
|
+
import {
|
|
37
|
+
WalletscanApi
|
|
38
|
+
} from "../chunk-E7TDM6P6.js";
|
|
39
|
+
import {
|
|
40
|
+
ConfigApi
|
|
41
|
+
} from "../chunk-VDWJ3NQ5.js";
|
|
42
|
+
import {
|
|
43
|
+
GasApi
|
|
44
|
+
} from "../chunk-YPM7FC4M.js";
|
|
45
|
+
import {
|
|
46
|
+
SolanaApi
|
|
47
|
+
} from "../chunk-OTLZVWY7.js";
|
|
39
48
|
import {
|
|
40
49
|
abcWallet
|
|
41
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-L6EUMSX2.js";
|
|
42
51
|
import {
|
|
43
52
|
abcConnector
|
|
44
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-7F5DVU5U.js";
|
|
45
54
|
import "../chunk-R6ZE7JAZ.js";
|
|
46
55
|
import {
|
|
47
56
|
BitcoinNetwork,
|
|
@@ -56,7 +65,7 @@ import {
|
|
|
56
65
|
AbcEvmProvider,
|
|
57
66
|
createAbcEvmProvider,
|
|
58
67
|
createAbcProvider
|
|
59
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-OMOYFHBT.js";
|
|
60
69
|
import {
|
|
61
70
|
calculateExpiryTimestamp,
|
|
62
71
|
clearAuthState,
|
|
@@ -74,12 +83,12 @@ import {
|
|
|
74
83
|
saveToStorage,
|
|
75
84
|
validateEmail,
|
|
76
85
|
validatePin
|
|
77
|
-
} from "../chunk-
|
|
86
|
+
} from "../chunk-A66MTFML.js";
|
|
87
|
+
import "../chunk-GFWUFYT2.js";
|
|
78
88
|
import {
|
|
79
89
|
TalkenApiClient,
|
|
80
90
|
createTalkenApiClient
|
|
81
|
-
} from "../chunk-
|
|
82
|
-
import "../chunk-GFWUFYT2.js";
|
|
91
|
+
} from "../chunk-VTOD7PXP.js";
|
|
83
92
|
import {
|
|
84
93
|
AbcError,
|
|
85
94
|
AbcErrorCode,
|
|
@@ -87,7 +96,7 @@ import {
|
|
|
87
96
|
} from "../chunk-4P3SPC44.js";
|
|
88
97
|
import {
|
|
89
98
|
getCredentialManager
|
|
90
|
-
} from "../chunk-
|
|
99
|
+
} from "../chunk-6WF4SXLB.js";
|
|
91
100
|
import {
|
|
92
101
|
ABC_EVENTS,
|
|
93
102
|
ABC_FEATURES,
|
|
@@ -109,7 +118,7 @@ import {
|
|
|
109
118
|
STORAGE_VERSION,
|
|
110
119
|
SUCCESS_MESSAGES,
|
|
111
120
|
TOKEN_EXPIRY
|
|
112
|
-
} from "../chunk-
|
|
121
|
+
} from "../chunk-DPTDOCWL.js";
|
|
113
122
|
export {
|
|
114
123
|
ABC_EVENTS,
|
|
115
124
|
ABC_FEATURES,
|
|
@@ -130,6 +139,7 @@ export {
|
|
|
130
139
|
BITCOIN_NETWORKS,
|
|
131
140
|
BitcoinProviderError,
|
|
132
141
|
CHAIN_TYPES,
|
|
142
|
+
ConfigApi,
|
|
133
143
|
DEBUG_MODE,
|
|
134
144
|
DEFAULT_ABC_CONFIG,
|
|
135
145
|
ERROR_MESSAGES,
|
|
@@ -145,10 +155,12 @@ export {
|
|
|
145
155
|
STORAGE_VERSION,
|
|
146
156
|
SUCCESS_MESSAGES,
|
|
147
157
|
SessionExpiredError,
|
|
158
|
+
SolanaApi,
|
|
148
159
|
SolanaProviderError,
|
|
149
160
|
TOKEN_EXPIRY,
|
|
150
161
|
TRON_NETWORKS,
|
|
151
162
|
TalkenApiClient,
|
|
163
|
+
TokenApi,
|
|
152
164
|
TronProviderError,
|
|
153
165
|
WalletscanApi,
|
|
154
166
|
abcConnector,
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
fetchWithSessionCheck,
|
|
6
6
|
handleUnauthorizedResponse,
|
|
7
7
|
refreshAccessToken
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-ACLPF2UW.js";
|
|
9
|
+
import "../chunk-DPTDOCWL.js";
|
|
10
10
|
export {
|
|
11
11
|
SessionExpiredError,
|
|
12
12
|
dispatchSessionExpired,
|
|
@@ -971,6 +971,10 @@ export interface TalkenWalletscanTokenRequest {
|
|
|
971
971
|
chainKeys: string;
|
|
972
972
|
contractAddress: string;
|
|
973
973
|
}
|
|
974
|
+
export interface TalkenWalletscanTokensRequest {
|
|
975
|
+
chainKeys: string;
|
|
976
|
+
walletAddress: string;
|
|
977
|
+
}
|
|
974
978
|
export interface TalkenWalletscanNativesRequest {
|
|
975
979
|
chainKeys: string;
|
|
976
980
|
walletAddress: string;
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
saveToStorage,
|
|
17
17
|
validateEmail,
|
|
18
18
|
validatePin
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-A66MTFML.js";
|
|
20
20
|
import "../chunk-4P3SPC44.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-DPTDOCWL.js";
|
|
22
22
|
export {
|
|
23
23
|
calculateExpiryTimestamp,
|
|
24
24
|
clearAuthState,
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
generateMpcWallets,
|
|
4
4
|
recoverMpcWallets,
|
|
5
5
|
validateMpcWallets
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-JADQLTFW.js";
|
|
7
7
|
import "../chunk-O4AU63LK.js";
|
|
8
8
|
import "../chunk-4P3SPC44.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-6WF4SXLB.js";
|
|
10
|
+
import "../chunk-DPTDOCWL.js";
|
|
11
11
|
export {
|
|
12
12
|
generateMpcWallets,
|
|
13
13
|
recoverMpcWallets,
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
STORAGE_PREFIX
|
|
4
|
+
} from "./chunk-DPTDOCWL.js";
|
|
5
|
+
|
|
6
|
+
// src/wallets/walletConnectors/abcWallet/AbcCredentialManager.ts
|
|
7
|
+
var EMAIL_STORAGE_KEY = `${STORAGE_PREFIX}saved_email`;
|
|
8
|
+
var AUTH_STATE_KEY = `${STORAGE_PREFIX}auth_state`;
|
|
9
|
+
var EVM_CREDS_SESSION_KEY = `${STORAGE_PREFIX}evm_signing_creds`;
|
|
10
|
+
var PIN_HASH_SESSION_KEY = `${STORAGE_PREFIX}pin_hash`;
|
|
11
|
+
var AbcCredentialManager = class _AbcCredentialManager {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.pinHash = null;
|
|
14
|
+
this.email_ = null;
|
|
15
|
+
this.restoreEmailFromStorage();
|
|
16
|
+
}
|
|
17
|
+
static getInstance() {
|
|
18
|
+
if (!_AbcCredentialManager.instance) {
|
|
19
|
+
_AbcCredentialManager.instance = new _AbcCredentialManager();
|
|
20
|
+
}
|
|
21
|
+
return _AbcCredentialManager.instance;
|
|
22
|
+
}
|
|
23
|
+
// ── PIN Hash (memory + sessionStorage) ───────────────────────────
|
|
24
|
+
setPinHash(hash) {
|
|
25
|
+
this.pinHash = hash;
|
|
26
|
+
if (typeof window !== "undefined") {
|
|
27
|
+
try {
|
|
28
|
+
sessionStorage.setItem(PIN_HASH_SESSION_KEY, hash);
|
|
29
|
+
} catch {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
getPinHash() {
|
|
34
|
+
if (this.pinHash)
|
|
35
|
+
return this.pinHash;
|
|
36
|
+
if (typeof window !== "undefined") {
|
|
37
|
+
try {
|
|
38
|
+
const cached = sessionStorage.getItem(PIN_HASH_SESSION_KEY);
|
|
39
|
+
if (cached) {
|
|
40
|
+
this.pinHash = cached;
|
|
41
|
+
return cached;
|
|
42
|
+
}
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
clearPinHash() {
|
|
49
|
+
this.pinHash = null;
|
|
50
|
+
if (typeof window !== "undefined") {
|
|
51
|
+
try {
|
|
52
|
+
sessionStorage.removeItem(PIN_HASH_SESSION_KEY);
|
|
53
|
+
} catch {
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// ── Email ─────────────────────────────────────────────────────────
|
|
58
|
+
setEmail(email) {
|
|
59
|
+
this.email_ = email;
|
|
60
|
+
if (typeof window !== "undefined") {
|
|
61
|
+
try {
|
|
62
|
+
localStorage.setItem(EMAIL_STORAGE_KEY, email);
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get recovery email.
|
|
69
|
+
* Priority: in-memory → auth_state JSON → saved_email localStorage
|
|
70
|
+
*/
|
|
71
|
+
getEmail() {
|
|
72
|
+
if (this.email_)
|
|
73
|
+
return this.email_;
|
|
74
|
+
if (typeof window === "undefined")
|
|
75
|
+
return null;
|
|
76
|
+
try {
|
|
77
|
+
const authState = localStorage.getItem(AUTH_STATE_KEY);
|
|
78
|
+
if (authState) {
|
|
79
|
+
const data = JSON.parse(authState);
|
|
80
|
+
const email = data?.user?.email || data?.wallet?.email;
|
|
81
|
+
if (typeof email === "string" && email.trim()) {
|
|
82
|
+
this.email_ = email.trim();
|
|
83
|
+
return this.email_;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const saved = localStorage.getItem(EMAIL_STORAGE_KEY);
|
|
90
|
+
if (saved?.trim()) {
|
|
91
|
+
this.email_ = saved.trim();
|
|
92
|
+
return this.email_;
|
|
93
|
+
}
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
// ── EVM Signing Credentials (sessionStorage — tab-scoped) ────────
|
|
99
|
+
setEvmSigningCredentials(creds) {
|
|
100
|
+
if (typeof window === "undefined")
|
|
101
|
+
return;
|
|
102
|
+
try {
|
|
103
|
+
sessionStorage.setItem(EVM_CREDS_SESSION_KEY, JSON.stringify(creds));
|
|
104
|
+
} catch {
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
getEvmSigningCredentials() {
|
|
108
|
+
if (typeof window === "undefined")
|
|
109
|
+
return null;
|
|
110
|
+
try {
|
|
111
|
+
const raw = sessionStorage.getItem(EVM_CREDS_SESSION_KEY);
|
|
112
|
+
if (!raw)
|
|
113
|
+
return null;
|
|
114
|
+
const parsed = JSON.parse(raw);
|
|
115
|
+
if (parsed?.uid && parsed?.wid && parsed?.sid && parsed?.pvencstr && parsed?.encryptDevicePassword) {
|
|
116
|
+
return parsed;
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
} catch {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
clearEvmSigningCredentials() {
|
|
124
|
+
if (typeof window === "undefined")
|
|
125
|
+
return;
|
|
126
|
+
try {
|
|
127
|
+
sessionStorage.removeItem(EVM_CREDS_SESSION_KEY);
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// ── Lifecycle ─────────────────────────────────────────────────────
|
|
132
|
+
/**
|
|
133
|
+
* Restore email from localStorage on initialization.
|
|
134
|
+
* PIN hash is intentionally NOT restored (memory-only).
|
|
135
|
+
*/
|
|
136
|
+
restoreEmailFromStorage() {
|
|
137
|
+
if (typeof window === "undefined")
|
|
138
|
+
return;
|
|
139
|
+
this.getEmail();
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Clear all credentials (logout).
|
|
143
|
+
*/
|
|
144
|
+
clear() {
|
|
145
|
+
this.pinHash = null;
|
|
146
|
+
this.email_ = null;
|
|
147
|
+
this.clearEvmSigningCredentials();
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
function getCredentialManager() {
|
|
151
|
+
return AbcCredentialManager.getInstance();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
getCredentialManager
|
|
156
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
abcConnector
|
|
4
|
+
} from "./chunk-CE37VZAR.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveTalkenApiUrl
|
|
7
|
+
} from "./chunk-GFWUFYT2.js";
|
|
8
|
+
import {
|
|
9
|
+
createTalkenApiClient
|
|
10
|
+
} from "./chunk-KZS2C73S.js";
|
|
11
|
+
import {
|
|
12
|
+
ABC_WALLET_METADATA
|
|
13
|
+
} from "./chunk-DPTDOCWL.js";
|
|
14
|
+
|
|
15
|
+
// src/wallets/walletConnectors/abcWallet/abcWallet.ts
|
|
16
|
+
import { setTalkenApiClient } from "@talken/talkenkit";
|
|
17
|
+
var abcWallet = (specificOptions) => ({ projectId }) => {
|
|
18
|
+
const talkenApiUrl = resolveTalkenApiUrl(specificOptions?.talkenApiUrl);
|
|
19
|
+
const talkenApi = createTalkenApiClient({
|
|
20
|
+
baseUrl: talkenApiUrl,
|
|
21
|
+
debug: specificOptions?.environment === "development"
|
|
22
|
+
});
|
|
23
|
+
setTalkenApiClient(talkenApi);
|
|
24
|
+
const config = {
|
|
25
|
+
talkenApiUrl,
|
|
26
|
+
apiKey: specificOptions?.apiKey,
|
|
27
|
+
plain: specificOptions?.plain || "",
|
|
28
|
+
// Deprecated - not used (secure.ts uses random generation)
|
|
29
|
+
environment: specificOptions?.environment || "development",
|
|
30
|
+
defaultChainId: specificOptions?.defaultChainId,
|
|
31
|
+
defaultSolanaNetwork: specificOptions?.defaultSolanaNetwork,
|
|
32
|
+
defaultBitcoinNetwork: specificOptions?.defaultBitcoinNetwork,
|
|
33
|
+
projectId
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
id: ABC_WALLET_METADATA.id,
|
|
37
|
+
name: ABC_WALLET_METADATA.name,
|
|
38
|
+
rdns: ABC_WALLET_METADATA.rdns,
|
|
39
|
+
iconUrl: async () => (await import("./abcWallet-AYWSIGAG.js")).default,
|
|
40
|
+
iconBackground: ABC_WALLET_METADATA.iconBackground,
|
|
41
|
+
// Embedded wallet - no installation required
|
|
42
|
+
installed: void 0,
|
|
43
|
+
// No download URLs for embedded wallet
|
|
44
|
+
downloadUrls: void 0,
|
|
45
|
+
// Create connector - wrapper function required by Wallet type
|
|
46
|
+
createConnector: (_walletDetails) => abcConnector({ config }),
|
|
47
|
+
// Embedded wallet always available
|
|
48
|
+
hidden: () => false
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
abcWallet
|
|
54
|
+
};
|