@talken/talkenkit 2.4.24 → 2.4.25
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-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-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 +267 -176
- 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/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/berasigWallet/berasigWallet.js +2 -2
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/binanceWallet/binanceWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/chunk-6WF4SXLB.js +156 -0
- package/dist/wallets/walletConnectors/chunk-7DM6H5BJ.js +54 -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-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-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/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +99 -99
- package/dist/wallets/walletConnectors/iopayWallet/iopayWallet.js +2 -2
- package/dist/wallets/walletConnectors/kaiaWallet/kaiaWallet.js +2 -2
- package/dist/wallets/walletConnectors/kaikasWallet/kaikasWallet.js +2 -2
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zealWallet/zealWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,18 +14,27 @@ import {
|
|
|
14
14
|
import "./chunk-DQLAW7KN.js";
|
|
15
15
|
import {
|
|
16
16
|
BitcoinNetwork,
|
|
17
|
+
ConfigApi,
|
|
17
18
|
GasApi,
|
|
18
19
|
NETWORK_BY_PARAM,
|
|
19
20
|
NETWORK_CONFIGS,
|
|
20
21
|
NetworkType,
|
|
21
22
|
SessionExpiredError,
|
|
23
|
+
SolanaApi,
|
|
22
24
|
SolanaNetwork,
|
|
23
25
|
TalkenApiClient,
|
|
26
|
+
TokenApi,
|
|
24
27
|
TronNetwork,
|
|
25
28
|
WalletscanApi,
|
|
26
29
|
chainIdToNetwork,
|
|
30
|
+
createConfigApi,
|
|
31
|
+
createGasApi,
|
|
32
|
+
createSolanaApi,
|
|
27
33
|
createTalkenApiClient,
|
|
34
|
+
createTokenApi,
|
|
35
|
+
createWalletscanApi,
|
|
28
36
|
getBitcoinNetwork,
|
|
37
|
+
getChainKey,
|
|
29
38
|
getEvmNetwork,
|
|
30
39
|
getExplorerAddressUrl,
|
|
31
40
|
getExplorerTxUrl,
|
|
@@ -44,11 +53,11 @@ import {
|
|
|
44
53
|
networkToChainId,
|
|
45
54
|
resolveTalkenApiUrl,
|
|
46
55
|
setTalkenApiClient
|
|
47
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-UKIPSWEV.js";
|
|
48
57
|
import {
|
|
49
58
|
STORAGE_PREFIX,
|
|
50
59
|
getCredentialManager
|
|
51
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-ALBABQ53.js";
|
|
52
61
|
|
|
53
62
|
// src/components/ConnectButton/ConnectButton.tsx
|
|
54
63
|
import React100, { useContext as useContext29, useEffect as useEffect32, useState as useState39 } from "react";
|
|
@@ -149,7 +158,7 @@ function useBitcoinWallet() {
|
|
|
149
158
|
wallet: bitcoinWallet,
|
|
150
159
|
emptyState: emptyWalletState,
|
|
151
160
|
requestInterceptor,
|
|
152
|
-
importProvider: async () => (await import("./abcWallet-
|
|
161
|
+
importProvider: async () => (await import("./abcWallet-MWUFO3JQ.js")).AbcBitcoinProvider,
|
|
153
162
|
mapState: (nextWallet, provider) => ({
|
|
154
163
|
address: nextWallet.address,
|
|
155
164
|
publicKey: nextWallet.publicKey,
|
|
@@ -1222,9 +1231,78 @@ import React11, {
|
|
|
1222
1231
|
import { useAccount as useAccount5, useDisconnect as useWagmiDisconnect } from "wagmi";
|
|
1223
1232
|
|
|
1224
1233
|
// src/hooks/useSolanaWallet.ts
|
|
1225
|
-
import { useWallet } from "@solana/wallet-adapter-react";
|
|
1234
|
+
import { useConnection, useWallet } from "@solana/wallet-adapter-react";
|
|
1226
1235
|
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
1227
1236
|
import { useAccount as useAccount4 } from "wagmi";
|
|
1237
|
+
|
|
1238
|
+
// src/solana/connectExternalWallet.ts
|
|
1239
|
+
async function connectExternalSolanaWallet({
|
|
1240
|
+
walletName: walletName2,
|
|
1241
|
+
wallets,
|
|
1242
|
+
selectedWalletName,
|
|
1243
|
+
selectWallet
|
|
1244
|
+
}) {
|
|
1245
|
+
const wallet = wallets.find(
|
|
1246
|
+
(candidate) => candidate.adapter.name === walletName2
|
|
1247
|
+
);
|
|
1248
|
+
if (!wallet) {
|
|
1249
|
+
throw new Error(`Solana wallet adapter not found: ${walletName2}`);
|
|
1250
|
+
}
|
|
1251
|
+
if (wallet.adapter.connected) {
|
|
1252
|
+
return wallet;
|
|
1253
|
+
}
|
|
1254
|
+
if (selectedWalletName !== wallet.adapter.name) {
|
|
1255
|
+
selectWallet(wallet.adapter.name);
|
|
1256
|
+
}
|
|
1257
|
+
await wallet.adapter.connect();
|
|
1258
|
+
return wallet;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
// src/hooks/useSolanaWallet.ts
|
|
1262
|
+
async function sendExternalSolanaTransaction(params) {
|
|
1263
|
+
const { transaction, connection, externalWallet, options } = params;
|
|
1264
|
+
if (externalWallet.sendTransaction) {
|
|
1265
|
+
const rawSignature = await externalWallet.sendTransaction(
|
|
1266
|
+
transaction,
|
|
1267
|
+
connection,
|
|
1268
|
+
options
|
|
1269
|
+
);
|
|
1270
|
+
return await normalizeSolanaSignature(rawSignature);
|
|
1271
|
+
}
|
|
1272
|
+
if (!externalWallet.signTransaction) {
|
|
1273
|
+
throw new Error("Wallet does not support transactions");
|
|
1274
|
+
}
|
|
1275
|
+
const signedTransaction = await externalWallet.signTransaction(transaction);
|
|
1276
|
+
const rawTransaction = signedTransaction.serialize();
|
|
1277
|
+
return await connection.sendRawTransaction(rawTransaction, options);
|
|
1278
|
+
}
|
|
1279
|
+
async function normalizeSolanaSignature(signature) {
|
|
1280
|
+
if (typeof signature === "string") {
|
|
1281
|
+
return signature;
|
|
1282
|
+
}
|
|
1283
|
+
if (signature && typeof signature === "object" && "signature" in signature) {
|
|
1284
|
+
return normalizeSolanaSignature(signature.signature);
|
|
1285
|
+
}
|
|
1286
|
+
const bs58 = (await import("bs58")).default;
|
|
1287
|
+
if (signature instanceof Uint8Array) {
|
|
1288
|
+
return bs58.encode(signature);
|
|
1289
|
+
}
|
|
1290
|
+
if (ArrayBuffer.isView(signature)) {
|
|
1291
|
+
return bs58.encode(
|
|
1292
|
+
new Uint8Array(
|
|
1293
|
+
signature.buffer,
|
|
1294
|
+
signature.byteOffset,
|
|
1295
|
+
signature.byteLength
|
|
1296
|
+
)
|
|
1297
|
+
);
|
|
1298
|
+
}
|
|
1299
|
+
if (Array.isArray(signature) && signature.every((value) => typeof value === "number")) {
|
|
1300
|
+
return bs58.encode(Uint8Array.from(signature));
|
|
1301
|
+
}
|
|
1302
|
+
throw new Error(
|
|
1303
|
+
`Unsupported Solana transaction signature shape: ${Object.prototype.toString.call(signature)}`
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1228
1306
|
function useSolanaWallet() {
|
|
1229
1307
|
const { isConnected: evmConnected, connector } = useAccount4();
|
|
1230
1308
|
const { requestInterceptor } = useNonEvmConfirmation();
|
|
@@ -1235,6 +1313,8 @@ function useSolanaWallet() {
|
|
|
1235
1313
|
isConnected: false,
|
|
1236
1314
|
provider: null
|
|
1237
1315
|
};
|
|
1316
|
+
const { connection } = useConnection();
|
|
1317
|
+
const solanaApiNetwork = process.env.NEXT_PUBLIC_ENVIRONMENT === "production" ? "solana" : "solana_devnet";
|
|
1238
1318
|
const externalWallet = useWallet();
|
|
1239
1319
|
const [abcWallet, setAbcWallet] = useState6(emptyWalletState);
|
|
1240
1320
|
const [isLoading, setIsLoading] = useState6(false);
|
|
@@ -1249,7 +1329,7 @@ function useSolanaWallet() {
|
|
|
1249
1329
|
wallet: solanaWallet,
|
|
1250
1330
|
emptyState: emptyWalletState,
|
|
1251
1331
|
requestInterceptor,
|
|
1252
|
-
importProvider: async () => (await import("./abcWallet-
|
|
1332
|
+
importProvider: async () => (await import("./abcWallet-MWUFO3JQ.js")).AbcSolanaProvider,
|
|
1253
1333
|
mapState: (nextWallet, provider) => ({
|
|
1254
1334
|
address: nextWallet.address,
|
|
1255
1335
|
publicKey: nextWallet.publicKey,
|
|
@@ -1267,6 +1347,7 @@ function useSolanaWallet() {
|
|
|
1267
1347
|
}
|
|
1268
1348
|
};
|
|
1269
1349
|
const refresh = refreshAbcWallet;
|
|
1350
|
+
const getWalletscanNetwork = () => process.env.NEXT_PUBLIC_ENVIRONMENT === "production" ? "solana" : "solana_devnet";
|
|
1270
1351
|
useEffect6(() => {
|
|
1271
1352
|
void refreshAbcWallet();
|
|
1272
1353
|
return subscribeToAbcStorageUpdates(refreshAbcWallet);
|
|
@@ -1301,17 +1382,12 @@ function useSolanaWallet() {
|
|
|
1301
1382
|
if (activeWallet.isConnected && activeWallet.walletName === walletName2) {
|
|
1302
1383
|
return;
|
|
1303
1384
|
}
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
}
|
|
1310
|
-
if (externalWallet.wallet?.adapter.name !== walletName2) {
|
|
1311
|
-
externalWallet.select(targetWallet.adapter.name);
|
|
1312
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
1313
|
-
}
|
|
1314
|
-
await targetWallet.adapter.connect();
|
|
1385
|
+
await connectExternalSolanaWallet({
|
|
1386
|
+
walletName: walletName2,
|
|
1387
|
+
wallets: externalWallet.wallets,
|
|
1388
|
+
selectedWalletName: externalWallet.wallet?.adapter.name,
|
|
1389
|
+
selectWallet: externalWallet.select
|
|
1390
|
+
});
|
|
1315
1391
|
};
|
|
1316
1392
|
const signMessage = async (params) => {
|
|
1317
1393
|
if (activeWallet.type === "abc") {
|
|
@@ -1349,22 +1425,25 @@ function useSolanaWallet() {
|
|
|
1349
1425
|
if (!externalWallet.publicKey || !externalWallet.sendTransaction) {
|
|
1350
1426
|
throw new Error("Wallet does not support transactions");
|
|
1351
1427
|
}
|
|
1352
|
-
const
|
|
1353
|
-
const
|
|
1428
|
+
const solanaApi = createSolanaApi();
|
|
1429
|
+
const { blockhash } = await solanaApi.getLatestBlockhash(solanaApiNetwork);
|
|
1354
1430
|
if (params.mintAddress) {
|
|
1355
|
-
const {
|
|
1431
|
+
const { PublicKey: PublicKey3, Transaction: Transaction3 } = await import("@solana/web3.js");
|
|
1356
1432
|
const {
|
|
1357
1433
|
getAssociatedTokenAddress,
|
|
1358
|
-
|
|
1434
|
+
createAssociatedTokenAccountIdempotentInstruction,
|
|
1359
1435
|
createTransferInstruction,
|
|
1360
1436
|
TOKEN_PROGRAM_ID
|
|
1361
1437
|
} = await import("@solana/spl-token");
|
|
1362
|
-
const connection2 = new Connection3(rpcUrl, "confirmed");
|
|
1363
1438
|
const mintPubkey = new PublicKey3(params.mintAddress);
|
|
1364
1439
|
const fromPubkey2 = externalWallet.publicKey;
|
|
1365
1440
|
const toPubkey2 = new PublicKey3(params.toAddress);
|
|
1366
|
-
const
|
|
1367
|
-
const
|
|
1441
|
+
const walletscanApi = createWalletscanApi();
|
|
1442
|
+
const tokenInfo = await walletscanApi.getContractTokenWithTimeout({
|
|
1443
|
+
contractAddress: params.mintAddress,
|
|
1444
|
+
networks: solanaApiNetwork
|
|
1445
|
+
});
|
|
1446
|
+
const decimals = tokenInfo?.decimals ?? 0;
|
|
1368
1447
|
const fromTokenAccount = await getAssociatedTokenAddress(
|
|
1369
1448
|
mintPubkey,
|
|
1370
1449
|
fromPubkey2,
|
|
@@ -1378,18 +1457,15 @@ function useSolanaWallet() {
|
|
|
1378
1457
|
TOKEN_PROGRAM_ID
|
|
1379
1458
|
);
|
|
1380
1459
|
const transaction2 = new Transaction3();
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
)
|
|
1391
|
-
);
|
|
1392
|
-
}
|
|
1460
|
+
transaction2.add(
|
|
1461
|
+
createAssociatedTokenAccountIdempotentInstruction(
|
|
1462
|
+
fromPubkey2,
|
|
1463
|
+
toTokenAccount,
|
|
1464
|
+
toPubkey2,
|
|
1465
|
+
mintPubkey,
|
|
1466
|
+
TOKEN_PROGRAM_ID
|
|
1467
|
+
)
|
|
1468
|
+
);
|
|
1393
1469
|
const rawAmount = Math.floor(params.amount * 10 ** decimals);
|
|
1394
1470
|
transaction2.add(
|
|
1395
1471
|
createTransferInstruction(
|
|
@@ -1401,28 +1477,20 @@ function useSolanaWallet() {
|
|
|
1401
1477
|
TOKEN_PROGRAM_ID
|
|
1402
1478
|
)
|
|
1403
1479
|
);
|
|
1404
|
-
|
|
1405
|
-
transaction2.recentBlockhash = blockhash2;
|
|
1480
|
+
transaction2.recentBlockhash = blockhash;
|
|
1406
1481
|
transaction2.feePayer = fromPubkey2;
|
|
1407
|
-
const signature2 = await
|
|
1408
|
-
transaction2,
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1482
|
+
const signature2 = await sendExternalSolanaTransaction({
|
|
1483
|
+
transaction: transaction2,
|
|
1484
|
+
connection,
|
|
1485
|
+
externalWallet
|
|
1486
|
+
});
|
|
1487
|
+
await solanaApi.waitForTransactionStatus({
|
|
1488
|
+
network: solanaApiNetwork,
|
|
1489
|
+
signature: signature2
|
|
1415
1490
|
});
|
|
1416
1491
|
return { signature: signature2 };
|
|
1417
1492
|
}
|
|
1418
|
-
const {
|
|
1419
|
-
Connection: Connection2,
|
|
1420
|
-
PublicKey: PublicKey2,
|
|
1421
|
-
SystemProgram,
|
|
1422
|
-
Transaction: Transaction2,
|
|
1423
|
-
LAMPORTS_PER_SOL
|
|
1424
|
-
} = await import("@solana/web3.js");
|
|
1425
|
-
const connection = new Connection2(rpcUrl, "confirmed");
|
|
1493
|
+
const { PublicKey: PublicKey2, SystemProgram, Transaction: Transaction2, LAMPORTS_PER_SOL } = await import("@solana/web3.js");
|
|
1426
1494
|
const fromPubkey = externalWallet.publicKey;
|
|
1427
1495
|
const toPubkey = new PublicKey2(params.toAddress);
|
|
1428
1496
|
const transaction = new Transaction2().add(
|
|
@@ -1432,17 +1500,16 @@ function useSolanaWallet() {
|
|
|
1432
1500
|
lamports: params.amount * LAMPORTS_PER_SOL
|
|
1433
1501
|
})
|
|
1434
1502
|
);
|
|
1435
|
-
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();
|
|
1436
1503
|
transaction.recentBlockhash = blockhash;
|
|
1437
1504
|
transaction.feePayer = fromPubkey;
|
|
1438
|
-
const signature = await
|
|
1505
|
+
const signature = await sendExternalSolanaTransaction({
|
|
1439
1506
|
transaction,
|
|
1440
|
-
connection
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1507
|
+
connection,
|
|
1508
|
+
externalWallet
|
|
1509
|
+
});
|
|
1510
|
+
await solanaApi.waitForTransactionStatus({
|
|
1511
|
+
network: solanaApiNetwork,
|
|
1512
|
+
signature
|
|
1446
1513
|
});
|
|
1447
1514
|
return { signature };
|
|
1448
1515
|
}
|
|
@@ -1459,23 +1526,23 @@ function useSolanaWallet() {
|
|
|
1459
1526
|
if (!externalWallet.publicKey) {
|
|
1460
1527
|
throw new Error("Wallet not connected");
|
|
1461
1528
|
}
|
|
1462
|
-
const
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1529
|
+
const walletscanApi = createWalletscanApi();
|
|
1530
|
+
const balance = await walletscanApi.getWalletTokenBalanceWithTimeout({
|
|
1531
|
+
walletAddress: externalWallet.publicKey.toBase58(),
|
|
1532
|
+
networks: getWalletscanNetwork(),
|
|
1533
|
+
contractAddress: mintAddress
|
|
1534
|
+
});
|
|
1535
|
+
if (!balance) {
|
|
1536
|
+
return {
|
|
1537
|
+
amount: "0",
|
|
1538
|
+
decimals: 0,
|
|
1539
|
+
uiAmount: 0
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1475
1542
|
return {
|
|
1476
|
-
amount: balance.
|
|
1477
|
-
decimals: balance.
|
|
1478
|
-
uiAmount: balance.
|
|
1543
|
+
amount: String(balance.balance ?? 0),
|
|
1544
|
+
decimals: balance.decimals ?? 0,
|
|
1545
|
+
uiAmount: balance.hrBalance ?? 0
|
|
1479
1546
|
};
|
|
1480
1547
|
}
|
|
1481
1548
|
throw new Error("No Solana wallet connected");
|
|
@@ -1510,21 +1577,22 @@ function useSolanaWallet() {
|
|
|
1510
1577
|
}
|
|
1511
1578
|
throw new Error("No Solana wallet connected");
|
|
1512
1579
|
};
|
|
1513
|
-
const sendTransactionUniversal = async (transaction,
|
|
1580
|
+
const sendTransactionUniversal = async (transaction, options) => {
|
|
1514
1581
|
if (activeWallet.type === "abc") {
|
|
1515
1582
|
throw new Error(
|
|
1516
1583
|
"sendTransactionUniversal for ABC Wallet not yet implemented. Use sendTransaction for SOL transfers."
|
|
1517
1584
|
);
|
|
1518
1585
|
}
|
|
1519
1586
|
if (activeWallet.type === "external") {
|
|
1520
|
-
if (!externalWallet.sendTransaction) {
|
|
1587
|
+
if (!externalWallet.sendTransaction && !externalWallet.signTransaction) {
|
|
1521
1588
|
throw new Error("Wallet does not support transactions");
|
|
1522
1589
|
}
|
|
1523
|
-
return await
|
|
1590
|
+
return await sendExternalSolanaTransaction({
|
|
1524
1591
|
transaction,
|
|
1525
1592
|
connection,
|
|
1593
|
+
externalWallet,
|
|
1526
1594
|
options
|
|
1527
|
-
);
|
|
1595
|
+
});
|
|
1528
1596
|
}
|
|
1529
1597
|
throw new Error("No Solana wallet connected");
|
|
1530
1598
|
};
|
|
@@ -1624,7 +1692,20 @@ function useIsMounted() {
|
|
|
1624
1692
|
}
|
|
1625
1693
|
|
|
1626
1694
|
// src/hooks/useProfile.ts
|
|
1627
|
-
import {
|
|
1695
|
+
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
1696
|
+
import { formatUnits } from "viem";
|
|
1697
|
+
|
|
1698
|
+
// src/core/react-query/createQuery.ts
|
|
1699
|
+
function createQueryKey(key, args, config2 = {}) {
|
|
1700
|
+
return [key, args, config2];
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
// src/hooks/useChainId.ts
|
|
1704
|
+
import { useAccount as useAccount6 } from "wagmi";
|
|
1705
|
+
function useChainId() {
|
|
1706
|
+
const { chain: activeChain } = useAccount6();
|
|
1707
|
+
return activeChain?.id ?? null;
|
|
1708
|
+
}
|
|
1628
1709
|
|
|
1629
1710
|
// src/hooks/useMainnetEnsAvatar.ts
|
|
1630
1711
|
import { normalize } from "viem/ens";
|
|
@@ -1830,11 +1911,6 @@ var enhancedProviderHttp = createHttpClient({
|
|
|
1830
1911
|
}
|
|
1831
1912
|
});
|
|
1832
1913
|
|
|
1833
|
-
// src/core/react-query/createQuery.ts
|
|
1834
|
-
function createQueryKey(key, args, config2 = {}) {
|
|
1835
|
-
return [key, args, config2];
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
1914
|
// src/utils/ens.ts
|
|
1839
1915
|
import { isAddress } from "viem";
|
|
1840
1916
|
function getStorageEnsNameKey(address) {
|
|
@@ -1914,11 +1990,42 @@ function useMainnetEnsName(address) {
|
|
|
1914
1990
|
}
|
|
1915
1991
|
|
|
1916
1992
|
// src/hooks/useProfile.ts
|
|
1993
|
+
var createNativeBalanceQueryKey = (address, chainId) => createQueryKey("nativeBalance", {
|
|
1994
|
+
address,
|
|
1995
|
+
chainId: chainId ?? void 0
|
|
1996
|
+
});
|
|
1917
1997
|
function useProfile({ address, includeBalance }) {
|
|
1998
|
+
const chainId = useChainId();
|
|
1918
1999
|
const ensName = useMainnetEnsName(address);
|
|
1919
2000
|
const ensAvatar = useMainnetEnsAvatar(ensName);
|
|
1920
|
-
const { data: balance } =
|
|
1921
|
-
|
|
2001
|
+
const { data: balance } = useQuery2({
|
|
2002
|
+
queryKey: createNativeBalanceQueryKey(address, chainId),
|
|
2003
|
+
queryFn: async () => {
|
|
2004
|
+
if (!address || !chainId)
|
|
2005
|
+
return void 0;
|
|
2006
|
+
const walletscanApi = createWalletscanApi();
|
|
2007
|
+
const nativeToken = await walletscanApi.getNativeTokenWithTimeout(
|
|
2008
|
+
{
|
|
2009
|
+
walletAddress: address,
|
|
2010
|
+
networks: getNetworkName(chainId),
|
|
2011
|
+
minimalInfo: false
|
|
2012
|
+
},
|
|
2013
|
+
3e3
|
|
2014
|
+
);
|
|
2015
|
+
if (!nativeToken)
|
|
2016
|
+
return void 0;
|
|
2017
|
+
const decimals = nativeToken.decimals ?? 18;
|
|
2018
|
+
const rawBalance = nativeToken.balance ?? 0;
|
|
2019
|
+
const value = BigInt(String(rawBalance));
|
|
2020
|
+
return {
|
|
2021
|
+
decimals,
|
|
2022
|
+
formatted: formatUnits(value, decimals),
|
|
2023
|
+
symbol: nativeToken.symbol,
|
|
2024
|
+
value
|
|
2025
|
+
};
|
|
2026
|
+
},
|
|
2027
|
+
enabled: Boolean(includeBalance && address && chainId),
|
|
2028
|
+
staleTime: 3e4
|
|
1922
2029
|
});
|
|
1923
2030
|
return { ensName, ensAvatar, balance };
|
|
1924
2031
|
}
|
|
@@ -1927,16 +2034,10 @@ function useProfile({ address, includeBalance }) {
|
|
|
1927
2034
|
import { useEffect as useEffect9, useState as useState9 } from "react";
|
|
1928
2035
|
import { useAccount as useAccount8 } from "wagmi";
|
|
1929
2036
|
|
|
1930
|
-
// src/hooks/useChainId.ts
|
|
1931
|
-
import { useAccount as useAccount6 } from "wagmi";
|
|
1932
|
-
function useChainId() {
|
|
1933
|
-
const { chain: activeChain } = useAccount6();
|
|
1934
|
-
return activeChain?.id ?? null;
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
2037
|
// src/transactions/TransactionStoreContext.tsx
|
|
2038
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
1938
2039
|
import React12 from "react";
|
|
1939
|
-
import { useAccount as useAccount7
|
|
2040
|
+
import { useAccount as useAccount7 } from "wagmi";
|
|
1940
2041
|
|
|
1941
2042
|
// src/transactions/transactionStore.ts
|
|
1942
2043
|
var storageKey = "rk-transactions";
|
|
@@ -1967,17 +2068,11 @@ function validateTransaction(transaction) {
|
|
|
1967
2068
|
}
|
|
1968
2069
|
return errors;
|
|
1969
2070
|
}
|
|
1970
|
-
function createTransactionStore({
|
|
1971
|
-
provider: initialProvider
|
|
1972
|
-
}) {
|
|
2071
|
+
function createTransactionStore() {
|
|
1973
2072
|
let data = loadData();
|
|
1974
|
-
let provider = initialProvider;
|
|
1975
2073
|
const listeners = /* @__PURE__ */ new Set();
|
|
1976
2074
|
const transactionListeners = /* @__PURE__ */ new Set();
|
|
1977
2075
|
const transactionRequestCache = /* @__PURE__ */ new Map();
|
|
1978
|
-
function setProvider(newProvider) {
|
|
1979
|
-
provider = newProvider;
|
|
1980
|
-
}
|
|
1981
2076
|
function getTransactions(account, chainId) {
|
|
1982
2077
|
return data[account]?.[chainId] ?? [];
|
|
1983
2078
|
}
|
|
@@ -2010,34 +2105,31 @@ function createTransactionStore({
|
|
|
2010
2105
|
async function waitForPendingTransactions(account, chainId) {
|
|
2011
2106
|
await Promise.all(
|
|
2012
2107
|
getTransactions(account, chainId).filter((transaction) => transaction.status === "pending").map(async (transaction) => {
|
|
2013
|
-
const {
|
|
2108
|
+
const { hash } = transaction;
|
|
2014
2109
|
const existingRequest = transactionRequestCache.get(hash);
|
|
2015
2110
|
if (existingRequest) {
|
|
2016
2111
|
return await existingRequest;
|
|
2017
2112
|
}
|
|
2018
|
-
const
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2113
|
+
const requestResult = (async () => {
|
|
2114
|
+
try {
|
|
2115
|
+
const chainKey = getChainKey(chainId);
|
|
2116
|
+
const configApi = createConfigApi();
|
|
2117
|
+
const status = await configApi.waitForTxStatus(chainKey, hash, {
|
|
2118
|
+
timeoutMs: 3e5,
|
|
2119
|
+
pollIntervalMs: 3e3
|
|
2120
|
+
});
|
|
2121
|
+
transactionRequestCache.delete(hash);
|
|
2122
|
+
setTransactionStatus(account, chainId, hash, "confirmed");
|
|
2123
|
+
notifyTransactionListeners(
|
|
2124
|
+
status.status === "success" ? "success" : 1
|
|
2125
|
+
);
|
|
2126
|
+
} catch {
|
|
2127
|
+
transactionRequestCache.delete(hash);
|
|
2128
|
+
setTransactionStatus(account, chainId, hash, "failed");
|
|
2027
2129
|
}
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
hash,
|
|
2032
|
-
// @ts-ignore - types changed with viem@1.1.0
|
|
2033
|
-
status === 0 || status === "reverted" ? "failed" : "confirmed"
|
|
2034
|
-
);
|
|
2035
|
-
notifyTransactionListeners(status);
|
|
2036
|
-
}).catch(() => {
|
|
2037
|
-
setTransactionStatus(account, chainId, hash, "failed");
|
|
2038
|
-
});
|
|
2039
|
-
transactionRequestCache.set(hash, requestPromise);
|
|
2040
|
-
return await requestPromise;
|
|
2130
|
+
})();
|
|
2131
|
+
transactionRequestCache.set(hash, requestResult);
|
|
2132
|
+
return await requestResult;
|
|
2041
2133
|
})
|
|
2042
2134
|
);
|
|
2043
2135
|
}
|
|
@@ -2085,7 +2177,6 @@ function createTransactionStore({
|
|
|
2085
2177
|
getTransactions,
|
|
2086
2178
|
onTransactionStatus,
|
|
2087
2179
|
onChange,
|
|
2088
|
-
setProvider,
|
|
2089
2180
|
waitForPendingTransactions
|
|
2090
2181
|
};
|
|
2091
2182
|
}
|
|
@@ -2098,28 +2189,22 @@ var TransactionStoreContext = React12.createContext(
|
|
|
2098
2189
|
function TransactionStoreProvider({
|
|
2099
2190
|
children
|
|
2100
2191
|
}) {
|
|
2101
|
-
const provider = usePublicClient();
|
|
2102
2192
|
const { address } = useAccount7();
|
|
2103
2193
|
const chainId = useChainId();
|
|
2104
|
-
const
|
|
2105
|
-
address,
|
|
2106
|
-
query: {
|
|
2107
|
-
enabled: false
|
|
2108
|
-
}
|
|
2109
|
-
});
|
|
2194
|
+
const queryClient = useQueryClient();
|
|
2110
2195
|
const [store] = React12.useState(
|
|
2111
|
-
() => storeSingleton ?? (storeSingleton = createTransactionStore(
|
|
2196
|
+
() => storeSingleton ?? (storeSingleton = createTransactionStore())
|
|
2112
2197
|
);
|
|
2113
2198
|
const onTransactionStatus = React12.useCallback(
|
|
2114
2199
|
(txStatus) => {
|
|
2115
|
-
if (txStatus === "success")
|
|
2116
|
-
|
|
2200
|
+
if (txStatus === "success" && address && chainId) {
|
|
2201
|
+
queryClient.invalidateQueries({
|
|
2202
|
+
queryKey: createNativeBalanceQueryKey(address, chainId)
|
|
2203
|
+
});
|
|
2204
|
+
}
|
|
2117
2205
|
},
|
|
2118
|
-
[
|
|
2206
|
+
[address, chainId, queryClient]
|
|
2119
2207
|
);
|
|
2120
|
-
React12.useEffect(() => {
|
|
2121
|
-
store.setProvider(provider);
|
|
2122
|
-
}, [store, provider]);
|
|
2123
2208
|
React12.useEffect(() => {
|
|
2124
2209
|
if (address && chainId) {
|
|
2125
2210
|
store.waitForPendingTransactions(address, chainId);
|
|
@@ -6000,22 +6085,10 @@ function parseTransactionParams(params) {
|
|
|
6000
6085
|
|
|
6001
6086
|
// src/providers/SignConfirmationProvider/useTransactionResolver.ts
|
|
6002
6087
|
import { useCallback as useCallback12 } from "react";
|
|
6003
|
-
import { erc20Abi as erc20Abi2 } from "viem";
|
|
6004
|
-
import { usePublicClient as usePublicClient2 } from "wagmi";
|
|
6005
6088
|
|
|
6006
6089
|
// src/providers/SignConfirmationProvider/useApiClient.ts
|
|
6007
6090
|
import { useCallback as useCallback11 } from "react";
|
|
6008
6091
|
import { toHex } from "viem";
|
|
6009
|
-
|
|
6010
|
-
// src/utils/apiClientFactory.ts
|
|
6011
|
-
function createWalletscanApi() {
|
|
6012
|
-
return new WalletscanApi();
|
|
6013
|
-
}
|
|
6014
|
-
function createGasApi() {
|
|
6015
|
-
return new GasApi();
|
|
6016
|
-
}
|
|
6017
|
-
|
|
6018
|
-
// src/providers/SignConfirmationProvider/useApiClient.ts
|
|
6019
6092
|
function useApiClient() {
|
|
6020
6093
|
const fetchGasFees = useCallback11(
|
|
6021
6094
|
async (chainId) => {
|
|
@@ -6106,6 +6179,22 @@ function useApiClient() {
|
|
|
6106
6179
|
},
|
|
6107
6180
|
[]
|
|
6108
6181
|
);
|
|
6182
|
+
const fetchTokenBalance = useCallback11(
|
|
6183
|
+
async (ownerAddress, tokenAddress, chainId) => {
|
|
6184
|
+
try {
|
|
6185
|
+
const tokenApi = createTokenApi();
|
|
6186
|
+
return await tokenApi.getTokenBalance(
|
|
6187
|
+
ownerAddress,
|
|
6188
|
+
getChainKey(chainId),
|
|
6189
|
+
tokenAddress
|
|
6190
|
+
);
|
|
6191
|
+
} catch (error2) {
|
|
6192
|
+
console.warn("[useApiClient] Failed to fetch token balance:", error2);
|
|
6193
|
+
return null;
|
|
6194
|
+
}
|
|
6195
|
+
},
|
|
6196
|
+
[]
|
|
6197
|
+
);
|
|
6109
6198
|
const fetchNFTMetadata = useCallback11(
|
|
6110
6199
|
async (contractAddress, walletAddress, chainId) => {
|
|
6111
6200
|
try {
|
|
@@ -6129,9 +6218,11 @@ function useApiClient() {
|
|
|
6129
6218
|
[]
|
|
6130
6219
|
);
|
|
6131
6220
|
return {
|
|
6221
|
+
createConfigApi,
|
|
6132
6222
|
fetchGasFees,
|
|
6133
6223
|
fetchGasLimit,
|
|
6134
6224
|
fetchNativeTokenMetadata,
|
|
6225
|
+
fetchTokenBalance,
|
|
6135
6226
|
fetchTokenMetadata,
|
|
6136
6227
|
fetchNFTMetadata
|
|
6137
6228
|
};
|
|
@@ -6139,12 +6230,12 @@ function useApiClient() {
|
|
|
6139
6230
|
|
|
6140
6231
|
// src/providers/SignConfirmationProvider/useTransactionResolver.ts
|
|
6141
6232
|
function useTransactionResolver() {
|
|
6142
|
-
const publicClient = usePublicClient2();
|
|
6143
6233
|
const rainbowKitChainsById = useRainbowKitChainsById();
|
|
6144
6234
|
const {
|
|
6145
6235
|
fetchGasFees,
|
|
6146
6236
|
fetchGasLimit,
|
|
6147
6237
|
fetchNativeTokenMetadata,
|
|
6238
|
+
fetchTokenBalance,
|
|
6148
6239
|
fetchTokenMetadata,
|
|
6149
6240
|
fetchNFTMetadata
|
|
6150
6241
|
} = useApiClient();
|
|
@@ -6371,20 +6462,17 @@ function useTransactionResolver() {
|
|
|
6371
6462
|
const metadata = await fetchTokenMetadata(parsed.to, request.chainId);
|
|
6372
6463
|
const token = metadata ? { ...toFungibleToken(metadata), contractAddress: parsed.to } : createFallbackFungibleToken(parsed.to);
|
|
6373
6464
|
let balance;
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
balanceError
|
|
6386
|
-
);
|
|
6387
|
-
}
|
|
6465
|
+
try {
|
|
6466
|
+
balance = await fetchTokenBalance(
|
|
6467
|
+
request.address,
|
|
6468
|
+
parsed.to,
|
|
6469
|
+
request.chainId
|
|
6470
|
+
) ?? void 0;
|
|
6471
|
+
} catch (balanceError) {
|
|
6472
|
+
console.warn(
|
|
6473
|
+
"[useTransactionResolver] Failed to fetch token balance:",
|
|
6474
|
+
balanceError
|
|
6475
|
+
);
|
|
6388
6476
|
}
|
|
6389
6477
|
parsed.approveInfo = {
|
|
6390
6478
|
spender: decoded.spender,
|
|
@@ -6417,7 +6505,7 @@ function useTransactionResolver() {
|
|
|
6417
6505
|
}
|
|
6418
6506
|
}
|
|
6419
6507
|
},
|
|
6420
|
-
[
|
|
6508
|
+
[fetchTokenBalance, fetchTokenMetadata]
|
|
6421
6509
|
);
|
|
6422
6510
|
const resolveSwapInfo = useCallback12(
|
|
6423
6511
|
async (parsed, request) => {
|
|
@@ -7945,7 +8033,7 @@ function setRainbowKitVersion({ version }) {
|
|
|
7945
8033
|
}
|
|
7946
8034
|
function useFingerprint() {
|
|
7947
8035
|
const fingerprint = useCallback14(() => {
|
|
7948
|
-
setRainbowKitVersion({ version: "2.4.
|
|
8036
|
+
setRainbowKitVersion({ version: "2.4.25" });
|
|
7949
8037
|
}, []);
|
|
7950
8038
|
useEffect19(() => {
|
|
7951
8039
|
fingerprint();
|
|
@@ -11622,7 +11710,7 @@ function AbcWaasAuthFlow({
|
|
|
11622
11710
|
console.log(
|
|
11623
11711
|
"[AbcWaasAuthFlow] \u2705 PIN verification possible - routing to verify modal"
|
|
11624
11712
|
);
|
|
11625
|
-
const { getCredentialManager: getCredentialManager2 } = await import("./AbcCredentialManager-
|
|
11713
|
+
const { getCredentialManager: getCredentialManager2 } = await import("./AbcCredentialManager-DDHLW2IH.js");
|
|
11626
11714
|
getCredentialManager2().setEmail(abcAuth.email);
|
|
11627
11715
|
onPinVerifyRequired(loginData);
|
|
11628
11716
|
} else {
|
|
@@ -14235,7 +14323,7 @@ var PinAuthFlow = forwardRef(
|
|
|
14235
14323
|
const authState = authStateStr ? JSON.parse(authStateStr) : null;
|
|
14236
14324
|
const needsWalletGeneration = authState && (!authState.wallet || !authState.solanaWallet || !authState.bitcoinWallet || !authState.tronWallet);
|
|
14237
14325
|
if (needsWalletGeneration) {
|
|
14238
|
-
const { getCredentialManager: getCredentialManager2 } = await import("./AbcCredentialManager-
|
|
14326
|
+
const { getCredentialManager: getCredentialManager2 } = await import("./AbcCredentialManager-DDHLW2IH.js");
|
|
14239
14327
|
const pinHash = getCredentialManager2().getPinHash();
|
|
14240
14328
|
if (pinHash) {
|
|
14241
14329
|
await walletGeneration.generateWallets({
|
|
@@ -17644,7 +17732,7 @@ function AbcAuthProvider({ children }) {
|
|
|
17644
17732
|
`${STORAGE_PREFIX2}enc_tokens`
|
|
17645
17733
|
);
|
|
17646
17734
|
const saltHex = localStorage.getItem(`${STORAGE_PREFIX2}enc_salt`);
|
|
17647
|
-
const { getCredentialManager: getCredentialManager2 } = await import("./AbcCredentialManager-
|
|
17735
|
+
const { getCredentialManager: getCredentialManager2 } = await import("./AbcCredentialManager-DDHLW2IH.js");
|
|
17648
17736
|
const storedPinHash = getCredentialManager2().getPinHash();
|
|
17649
17737
|
if (!encryptedTokens || !saltHex || !storedPinHash) {
|
|
17650
17738
|
throw new Error("No encrypted data found");
|
|
@@ -17823,7 +17911,7 @@ function PinProvider({ children }) {
|
|
|
17823
17911
|
if (!pinResolver) {
|
|
17824
17912
|
return;
|
|
17825
17913
|
}
|
|
17826
|
-
const { getCredentialManager: getCredentialManager2 } = await import("./AbcCredentialManager-
|
|
17914
|
+
const { getCredentialManager: getCredentialManager2 } = await import("./AbcCredentialManager-DDHLW2IH.js");
|
|
17827
17915
|
const storedPinHash = getCredentialManager2().getPinHash();
|
|
17828
17916
|
if (!storedPinHash) {
|
|
17829
17917
|
throw new Error("PIN not set. Please login again.");
|
|
@@ -17909,7 +17997,7 @@ function useTronWallet() {
|
|
|
17909
17997
|
wallet: tronWallet,
|
|
17910
17998
|
emptyState: emptyWalletState,
|
|
17911
17999
|
requestInterceptor,
|
|
17912
|
-
importProvider: async () => (await import("./abcWallet-
|
|
18000
|
+
importProvider: async () => (await import("./abcWallet-MWUFO3JQ.js")).AbcTronProvider,
|
|
17913
18001
|
mapState: (nextWallet, provider) => ({
|
|
17914
18002
|
address: nextWallet.address,
|
|
17915
18003
|
publicKey: nextWallet.publicKey,
|
|
@@ -18142,6 +18230,7 @@ export {
|
|
|
18142
18230
|
AbcWalletName,
|
|
18143
18231
|
ChainIndicator,
|
|
18144
18232
|
ChainSelector,
|
|
18233
|
+
ConfigApi,
|
|
18145
18234
|
ConnectButton,
|
|
18146
18235
|
GasApi,
|
|
18147
18236
|
Logger,
|
|
@@ -18156,9 +18245,11 @@ export {
|
|
|
18156
18245
|
RainbowKitProvider,
|
|
18157
18246
|
SessionExpiredError,
|
|
18158
18247
|
SignConfirmationProvider,
|
|
18248
|
+
SolanaApi,
|
|
18159
18249
|
SolanaWalletList2 as SolanaWalletList,
|
|
18160
18250
|
TalkenApiClient,
|
|
18161
18251
|
RainbowKitProvider as TalkenKitProvider,
|
|
18252
|
+
TokenApi,
|
|
18162
18253
|
WalletButton2 as WalletButton,
|
|
18163
18254
|
WalletscanApi,
|
|
18164
18255
|
__private__,
|