@vechain/vechain-kit 1.5.0 → 1.5.2
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/{Constants-k3w4-s6C.d.cts → Constants-CUrs_fy0.d.cts} +2 -1
- package/dist/{Constants-k3w4-s6C.d.ts → Constants-CUrs_fy0.d.ts} +2 -1
- package/dist/assets/index.cjs +59 -11
- package/dist/assets/index.d.cts +53 -13
- package/dist/assets/index.d.ts +53 -13
- package/dist/assets/index.js +1 -1
- package/dist/{chunk-RZI2FBKR.js → chunk-DYI6ON4O.js} +333 -21
- package/dist/chunk-DYI6ON4O.js.map +1 -0
- package/dist/{chunk-YKPB3KXP.js → chunk-EUQRNI5E.js} +33 -4
- package/dist/chunk-EUQRNI5E.js.map +1 -0
- package/dist/{chunk-AJYTKYSZ.cjs → chunk-FID67WC3.cjs} +344 -20
- package/dist/chunk-FID67WC3.cjs.map +1 -0
- package/dist/{chunk-CPG25VOQ.cjs → chunk-RUIC653T.cjs} +33 -3
- package/dist/chunk-RUIC653T.cjs.map +1 -0
- package/dist/index.cjs +665 -581
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +279 -195
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/utils/index.cjs +34 -29
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +2 -1
- package/package.json +1 -1
- package/dist/chunk-AJYTKYSZ.cjs.map +0 -1
- package/dist/chunk-CPG25VOQ.cjs.map +0 -1
- package/dist/chunk-RZI2FBKR.js.map +0 -1
- package/dist/chunk-YKPB3KXP.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk5GZ7N47F_cjs = require('./chunk-5GZ7N47F.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkRUIC653T_cjs = require('./chunk-RUIC653T.cjs');
|
|
5
|
+
var chunkFID67WC3_cjs = require('./chunk-FID67WC3.cjs');
|
|
6
6
|
require('./chunk-Q7SFCCGT.cjs');
|
|
7
|
-
var
|
|
7
|
+
var React10 = require('react');
|
|
8
8
|
var reactAuth = require('@privy-io/react-auth');
|
|
9
9
|
var dappKitReact = require('@vechain/dapp-kit-react');
|
|
10
10
|
var viem = require('viem');
|
|
@@ -51,7 +51,7 @@ var anatomy = require('@chakra-ui/anatomy');
|
|
|
51
51
|
|
|
52
52
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var React10__default = /*#__PURE__*/_interopDefault(React10);
|
|
55
55
|
var imageCompression__default = /*#__PURE__*/_interopDefault(imageCompression);
|
|
56
56
|
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
57
57
|
|
|
@@ -92,7 +92,7 @@ var PRICE_FEED_IDS = {
|
|
|
92
92
|
};
|
|
93
93
|
var getTokenUsdPrice = async (thor, token, network) => {
|
|
94
94
|
const functionFragment2 = OracleInterface.getFunction("getLatestValue").format("json");
|
|
95
|
-
const res = await thor.account(
|
|
95
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(network).oracleContractAddress).method(JSON.parse(functionFragment2)).call(PRICE_FEED_IDS[token]);
|
|
96
96
|
if (res.reverted) throw new Error("Reverted");
|
|
97
97
|
return new bignumber_js.BigNumber(res.decoded[0]).div(1e12).toNumber();
|
|
98
98
|
};
|
|
@@ -111,11 +111,11 @@ var useGetTokenUsdPrice = (token) => {
|
|
|
111
111
|
var B3TRInterface = chunk5GZ7N47F_cjs.IB3TR__factory.createInterface();
|
|
112
112
|
var getB3trBalance = async (thor, network, address) => {
|
|
113
113
|
const functionFragment2 = B3TRInterface.getFunction("balanceOf").format("json");
|
|
114
|
-
const res = await thor.account(
|
|
114
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(network).b3trContractAddress).method(JSON.parse(functionFragment2)).call(address);
|
|
115
115
|
if (res.reverted) throw new Error("Reverted");
|
|
116
116
|
const original = res.decoded[0];
|
|
117
117
|
const scaled = viem.formatEther(original);
|
|
118
|
-
const formatted = scaled === "0" ? "0" :
|
|
118
|
+
const formatted = scaled === "0" ? "0" : chunkRUIC653T_cjs.humanNumber(scaled);
|
|
119
119
|
return {
|
|
120
120
|
original,
|
|
121
121
|
scaled,
|
|
@@ -138,11 +138,11 @@ var useGetB3trBalance = (address) => {
|
|
|
138
138
|
var VOT3Interface = chunk5GZ7N47F_cjs.IVOT3__factory.createInterface();
|
|
139
139
|
var getVot3Balance = async (thor, network, address) => {
|
|
140
140
|
const functionFragment2 = VOT3Interface.getFunction("balanceOf").format("json");
|
|
141
|
-
const res = await thor.account(
|
|
141
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(network).vot3ContractAddress).method(JSON.parse(functionFragment2)).call(address);
|
|
142
142
|
if (res.reverted) throw new Error("Reverted");
|
|
143
143
|
const original = res.decoded[0];
|
|
144
144
|
const scaled = viem.formatEther(original);
|
|
145
|
-
const formatted = scaled === "0" ? "0" :
|
|
145
|
+
const formatted = scaled === "0" ? "0" : chunkRUIC653T_cjs.humanNumber(scaled);
|
|
146
146
|
return {
|
|
147
147
|
original,
|
|
148
148
|
scaled,
|
|
@@ -168,7 +168,7 @@ var contractInterface = chunk5GZ7N47F_cjs.GalaxyMember__factory.createInterface(
|
|
|
168
168
|
var method = "getIdAttachedToNode";
|
|
169
169
|
var useGetTokenIdAttachedToNode = (nodeId, enabled = true) => {
|
|
170
170
|
const { network } = useVeChainKitConfig();
|
|
171
|
-
const contractAddress =
|
|
171
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
172
172
|
return useCall({
|
|
173
173
|
contractInterface,
|
|
174
174
|
contractAddress,
|
|
@@ -184,7 +184,7 @@ var method2 = "getUserNodes";
|
|
|
184
184
|
var getUserNodesQueryKey = (user) => getCallKey({ method: method2, keyArgs: [user] });
|
|
185
185
|
var useGetUserNodes = (user) => {
|
|
186
186
|
const { network } = useVeChainKitConfig();
|
|
187
|
-
const contractAddress =
|
|
187
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(
|
|
188
188
|
network.type
|
|
189
189
|
).nodeManagementContractAddress;
|
|
190
190
|
return useCall({
|
|
@@ -215,7 +215,7 @@ var method3 = "checkCooldown";
|
|
|
215
215
|
var getNodeCheckCooldownQueryKey = (nodeId) => getCallKey({ method: method3, keyArgs: [nodeId] });
|
|
216
216
|
var useXNodeCheckCooldown = (nodeId) => {
|
|
217
217
|
const { network } = useVeChainKitConfig();
|
|
218
|
-
const contractAddress =
|
|
218
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(
|
|
219
219
|
network.type
|
|
220
220
|
).nodeManagementContractAddress;
|
|
221
221
|
return useCall({
|
|
@@ -236,11 +236,11 @@ var useXNode = (address) => {
|
|
|
236
236
|
const xNode = firstNode ? {
|
|
237
237
|
id: firstNode.nodeId,
|
|
238
238
|
level: Number(firstNode.nodeLevel),
|
|
239
|
-
image:
|
|
240
|
-
name:
|
|
239
|
+
image: chunkRUIC653T_cjs.NodeStrengthLevelToImage[Number(firstNode.nodeLevel)],
|
|
240
|
+
name: chunkRUIC653T_cjs.allNodeStrengthLevelToName[Number(firstNode.nodeLevel)]
|
|
241
241
|
} : void 0;
|
|
242
242
|
const xNodeName = xNode?.name ?? t("Not available");
|
|
243
|
-
const xNodeImage = xNode?.image ??
|
|
243
|
+
const xNodeImage = xNode?.image ?? chunkRUIC653T_cjs.notFoundImage;
|
|
244
244
|
const xNodeLevel = xNode?.level ?? 0;
|
|
245
245
|
const nodeType = Number(xNodeLevel) >= 4 ? "XNODE" : "ECONOMIC NODE";
|
|
246
246
|
const {
|
|
@@ -281,7 +281,7 @@ var getNodeIdsAbi = new thorDevkit.abi.Function(JSON.parse(getNodeIdsFragment));
|
|
|
281
281
|
var getNodeLevelsAbi = new thorDevkit.abi.Function(JSON.parse(getNodeLevelsFragment));
|
|
282
282
|
var getUserXNodes = async (thor, networkType, user) => {
|
|
283
283
|
if (!user) throw new Error("User address is required");
|
|
284
|
-
const contractAddress =
|
|
284
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(networkType).nodeManagementContractAddress;
|
|
285
285
|
const clauses = [
|
|
286
286
|
{
|
|
287
287
|
to: contractAddress,
|
|
@@ -307,8 +307,8 @@ var getUserXNodes = async (thor, networkType, user) => {
|
|
|
307
307
|
return {
|
|
308
308
|
id,
|
|
309
309
|
level: Number(levels[index]),
|
|
310
|
-
image:
|
|
311
|
-
name:
|
|
310
|
+
image: chunkRUIC653T_cjs.NodeStrengthLevelToImage[Number(levels[index])],
|
|
311
|
+
name: chunkRUIC653T_cjs.allNodeStrengthLevelToName[Number(levels[index])]
|
|
312
312
|
};
|
|
313
313
|
});
|
|
314
314
|
};
|
|
@@ -335,7 +335,7 @@ var getIsNodeHolderQueryKey = (address) => [
|
|
|
335
335
|
];
|
|
336
336
|
var getIsNodeHolder = async (thor, networkType, address) => {
|
|
337
337
|
if (!address) return Promise.reject(new Error("Address not provided"));
|
|
338
|
-
const contractAddress =
|
|
338
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(networkType).nodeManagementContractAddress;
|
|
339
339
|
const functionAbi2 = contractInterface4.getFunction(method4);
|
|
340
340
|
const res = await thor.account(contractAddress).method(functionAbi2).call(address);
|
|
341
341
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -351,7 +351,7 @@ var useIsNodeHolder = (address) => {
|
|
|
351
351
|
});
|
|
352
352
|
};
|
|
353
353
|
var getAppAdmin = async (thor, appId, networkType) => {
|
|
354
|
-
const X2EARNAPPS_CONTRACT =
|
|
354
|
+
const X2EARNAPPS_CONTRACT = chunkRUIC653T_cjs.getConfig(networkType).x2EarnAppsContractAddress;
|
|
355
355
|
const functionFragment2 = chunk5GZ7N47F_cjs.X2EarnApps__factory.createInterface().getFunction("appAdmin").format("json");
|
|
356
356
|
const res = await thor.account(X2EARNAPPS_CONTRACT).method(JSON.parse(functionFragment2)).call(appId);
|
|
357
357
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -379,7 +379,7 @@ var method5 = "appExists";
|
|
|
379
379
|
var getAppExistsQueryKey = (appId) => getCallKey({ method: method5, keyArgs: [appId] });
|
|
380
380
|
var useAppExists = (appId) => {
|
|
381
381
|
const { network } = useVeChainKitConfig();
|
|
382
|
-
const contractAddress =
|
|
382
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).x2EarnAppsContractAddress;
|
|
383
383
|
return useCall({
|
|
384
384
|
contractInterface: contractInterface5,
|
|
385
385
|
contractAddress,
|
|
@@ -389,7 +389,7 @@ var useAppExists = (appId) => {
|
|
|
389
389
|
});
|
|
390
390
|
};
|
|
391
391
|
var getAppsEligibleInNextRound = async (thor, networkType) => {
|
|
392
|
-
const X2EARNAPPS_CONTRACT =
|
|
392
|
+
const X2EARNAPPS_CONTRACT = chunkRUIC653T_cjs.getConfig(networkType).x2EarnAppsContractAddress;
|
|
393
393
|
const functionFragment2 = chunk5GZ7N47F_cjs.X2EarnApps__factory.createInterface().getFunction("allEligibleApps").format("json");
|
|
394
394
|
const res = await thor.account(X2EARNAPPS_CONTRACT).method(JSON.parse(functionFragment2)).call();
|
|
395
395
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -410,7 +410,7 @@ var useAppsEligibleInNextRound = () => {
|
|
|
410
410
|
};
|
|
411
411
|
var getRoundXApps = async (thor, networkType, roundId) => {
|
|
412
412
|
if (!roundId) return [];
|
|
413
|
-
const xAllocationVotingContract =
|
|
413
|
+
const xAllocationVotingContract = chunkRUIC653T_cjs.getConfig(networkType).xAllocationVotingContractAddress;
|
|
414
414
|
const functionFragment2 = chunk5GZ7N47F_cjs.XAllocationVoting__factory.createInterface().getFunction("getAppsOfRound").format("json");
|
|
415
415
|
const res = await thor.account(xAllocationVotingContract).method(JSON.parse(functionFragment2)).call(roundId);
|
|
416
416
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -441,7 +441,7 @@ var useRoundXApps = (roundId) => {
|
|
|
441
441
|
var currentBlockQueryKey = () => ["VECHAIN_KIT", "CURRENT_BLOCK"];
|
|
442
442
|
var useCurrentBlock = () => {
|
|
443
443
|
const { network } = useVeChainKitConfig();
|
|
444
|
-
const nodeUrl = network.nodeUrl ??
|
|
444
|
+
const nodeUrl = network.nodeUrl ?? chunkRUIC653T_cjs.getConfig(network.type).nodeUrl;
|
|
445
445
|
return reactQuery.useQuery({
|
|
446
446
|
queryKey: currentBlockQueryKey(),
|
|
447
447
|
queryFn: async () => {
|
|
@@ -538,10 +538,10 @@ var pollForReceipt = async (thor, id, blocksTimeout = 5) => {
|
|
|
538
538
|
};
|
|
539
539
|
var useTxReceipt = (txId, blockTimeout) => {
|
|
540
540
|
const { thor } = dappKitReact.useConnex();
|
|
541
|
-
const [receipt, setReceipt] =
|
|
542
|
-
const [error, setError] =
|
|
543
|
-
const [isLoading, setIsLoading] =
|
|
544
|
-
|
|
541
|
+
const [receipt, setReceipt] = React10.useState();
|
|
542
|
+
const [error, setError] = React10.useState(null);
|
|
543
|
+
const [isLoading, setIsLoading] = React10.useState(false);
|
|
544
|
+
React10.useEffect(() => {
|
|
545
545
|
const fetchReceipt = async () => {
|
|
546
546
|
if (!txId) {
|
|
547
547
|
setReceipt(null);
|
|
@@ -569,7 +569,7 @@ var useTxReceipt = (txId, blockTimeout) => {
|
|
|
569
569
|
// src/hooks/api/vebetterdao/xApps/hooks/useUserVotesInRound.ts
|
|
570
570
|
var XAllocationVotingInterface = chunk5GZ7N47F_cjs.XAllocationVoting__factory.createInterface();
|
|
571
571
|
var getUserVotesInRound = async (thor, network, roundId, address) => {
|
|
572
|
-
const xAllocationVotingContract =
|
|
572
|
+
const xAllocationVotingContract = chunkRUIC653T_cjs.getConfig(network).xAllocationVotingContractAddress;
|
|
573
573
|
const eventFragment = XAllocationVotingInterface.getEvent("AllocationVoteCast").format(
|
|
574
574
|
"json"
|
|
575
575
|
);
|
|
@@ -593,7 +593,7 @@ var getUserVotesInRound = async (thor, network, roundId, address) => {
|
|
|
593
593
|
const events = await getAllEvents({
|
|
594
594
|
thor,
|
|
595
595
|
filterCriteria,
|
|
596
|
-
nodeUrl:
|
|
596
|
+
nodeUrl: chunkRUIC653T_cjs.getConfig(network).nodeUrl
|
|
597
597
|
});
|
|
598
598
|
const decodedAllocatedVoteEvents = [];
|
|
599
599
|
events.forEach((event) => {
|
|
@@ -664,7 +664,7 @@ var unendorsedAppsAbi = new thorDevkit.abi.Function(JSON.parse(unendorsedAppsFra
|
|
|
664
664
|
var allAppsFragment = chunk5GZ7N47F_cjs.X2EarnApps__factory.createInterface().getFunction("apps").format("json");
|
|
665
665
|
var allAppsAbi = new thorDevkit.abi.Function(JSON.parse(allAppsFragment));
|
|
666
666
|
var getXApps = async (thor, networkType) => {
|
|
667
|
-
const x2EarnAppsContract =
|
|
667
|
+
const x2EarnAppsContract = chunkRUIC653T_cjs.getConfig(networkType).x2EarnAppsContractAddress;
|
|
668
668
|
const clauses = [
|
|
669
669
|
{
|
|
670
670
|
to: x2EarnAppsContract,
|
|
@@ -737,7 +737,7 @@ var useXApps = () => {
|
|
|
737
737
|
// src/hooks/api/vebetterdao/xApps/hooks/useXApp.ts
|
|
738
738
|
var useXApp = (appId) => {
|
|
739
739
|
const { data: xApps, ...props } = useXApps();
|
|
740
|
-
const allApps =
|
|
740
|
+
const allApps = React10.useMemo(() => [...xApps?.active ?? [], ...xApps?.unendorsed ?? []], [xApps]);
|
|
741
741
|
const app = allApps.find((xa) => xa.id === appId);
|
|
742
742
|
return {
|
|
743
743
|
data: app,
|
|
@@ -747,7 +747,7 @@ var useXApp = (appId) => {
|
|
|
747
747
|
|
|
748
748
|
// src/hooks/api/vebetterdao/xApps/getXAppsMetadataBaseUri.ts
|
|
749
749
|
var getXAppsMetadataBaseUri = async (thor, networkType) => {
|
|
750
|
-
const X2EARNAPPS_CONTRACT =
|
|
750
|
+
const X2EARNAPPS_CONTRACT = chunkRUIC653T_cjs.getConfig(networkType).x2EarnAppsContractAddress;
|
|
751
751
|
const functionFragment2 = chunk5GZ7N47F_cjs.X2EarnApps__factory.createInterface().getFunction("baseURI").format("json");
|
|
752
752
|
const res = await thor.account(X2EARNAPPS_CONTRACT).method(JSON.parse(functionFragment2)).call();
|
|
753
753
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -775,7 +775,7 @@ var useXAppsMetadataBaseUri = () => {
|
|
|
775
775
|
|
|
776
776
|
// src/hooks/api/vebetterdao/xApps/getXAppMetadata.ts
|
|
777
777
|
var getXAppMetadata = async (uri, networkType) => {
|
|
778
|
-
const url =
|
|
778
|
+
const url = chunkRUIC653T_cjs.convertUriToUrl(uri, networkType);
|
|
779
779
|
if (!url) return void 0;
|
|
780
780
|
const response = await fetch(url);
|
|
781
781
|
if (!response.ok) {
|
|
@@ -807,7 +807,7 @@ var useXAppMetadata = (xAppId) => {
|
|
|
807
807
|
var allocationVotingInterface = chunk5GZ7N47F_cjs.XAllocationVotingGovernor__factory.createInterface();
|
|
808
808
|
var method6 = "getAppVotes";
|
|
809
809
|
var getXAppVotes = async (thor, networkType, roundId, xAppId) => {
|
|
810
|
-
const ALLOCATION_VOTING_CONTRACT =
|
|
810
|
+
const ALLOCATION_VOTING_CONTRACT = chunkRUIC653T_cjs.getConfig(networkType).xAllocationVotingContractAddress;
|
|
811
811
|
const functionFragment2 = allocationVotingInterface.getFunction(method6).format("json");
|
|
812
812
|
const res = await thor.account(ALLOCATION_VOTING_CONTRACT).method(JSON.parse(functionFragment2)).call(roundId, xAppId);
|
|
813
813
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -818,7 +818,7 @@ var useXAppVotes = (roundId, appId) => {
|
|
|
818
818
|
const { network } = useVeChainKitConfig();
|
|
819
819
|
return useCall({
|
|
820
820
|
contractInterface: allocationVotingInterface,
|
|
821
|
-
contractAddress:
|
|
821
|
+
contractAddress: chunkRUIC653T_cjs.getConfig(network.type).xAllocationVotingContractAddress,
|
|
822
822
|
method: method6,
|
|
823
823
|
args: [roundId, appId],
|
|
824
824
|
enabled: !!roundId && !!appId && !!network.type
|
|
@@ -829,7 +829,7 @@ var useXAppVotes = (roundId, appId) => {
|
|
|
829
829
|
// src/hooks/api/vebetterdao/xApps/hooks/useXAppVotesQf.ts
|
|
830
830
|
var allocationVotingInterface2 = chunk5GZ7N47F_cjs.XAllocationVotingGovernor__factory.createInterface();
|
|
831
831
|
var getXAppVotesQf = async (thor, networkType, roundId, xAppId) => {
|
|
832
|
-
const ALLOCATION_VOTING_CONTRACT =
|
|
832
|
+
const ALLOCATION_VOTING_CONTRACT = chunkRUIC653T_cjs.getConfig(networkType).xAllocationVotingContractAddress;
|
|
833
833
|
const functionFragment2 = allocationVotingInterface2.getFunction("getAppVotesQF").format("json");
|
|
834
834
|
const res = await thor.account(ALLOCATION_VOTING_CONTRACT).method(JSON.parse(functionFragment2)).call(roundId, xAppId);
|
|
835
835
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -843,7 +843,7 @@ var useXAppVotesQf = (roundId, appId) => {
|
|
|
843
843
|
const { network } = useVeChainKitConfig();
|
|
844
844
|
return useCall({
|
|
845
845
|
contractInterface: allocationVotingInterface2,
|
|
846
|
-
contractAddress:
|
|
846
|
+
contractAddress: chunkRUIC653T_cjs.getConfig(network.type).xAllocationVotingContractAddress,
|
|
847
847
|
method: "getAppVotesQF",
|
|
848
848
|
args: [roundId, appId],
|
|
849
849
|
enabled: !!roundId && !!appId && !!network.type
|
|
@@ -883,7 +883,7 @@ var useUserVotesInAllRounds = (address) => {
|
|
|
883
883
|
var useUserTopVotedApps = (user) => {
|
|
884
884
|
const userRoundVotes = useUserVotesInAllRounds(user);
|
|
885
885
|
const { data: xApps } = useXApps();
|
|
886
|
-
const topVotedAppIds =
|
|
886
|
+
const topVotedAppIds = React10.useMemo(() => {
|
|
887
887
|
const appIdToVotes = {};
|
|
888
888
|
userRoundVotes.data?.forEach((voteEvent) => {
|
|
889
889
|
const appIds = voteEvent.appsIds;
|
|
@@ -899,7 +899,7 @@ var useUserTopVotedApps = (user) => {
|
|
|
899
899
|
});
|
|
900
900
|
return Object.entries(appIdToVotes).sort(([, aVotes], [, bVotes]) => Number(bVotes) - Number(aVotes)).map(([appId, votes]) => ({ appId, votes }));
|
|
901
901
|
}, [userRoundVotes]);
|
|
902
|
-
const topVotedApps =
|
|
902
|
+
const topVotedApps = React10.useMemo(() => {
|
|
903
903
|
return topVotedAppIds.map((app) => {
|
|
904
904
|
const appFound = xApps?.allApps.find(
|
|
905
905
|
(xApp) => xApp.id === app.appId
|
|
@@ -917,7 +917,7 @@ var method7 = "getAppShares";
|
|
|
917
917
|
var functionFragment = allocationPoolInterface.getFunction(method7).format("json");
|
|
918
918
|
var functionAbi = new thorDevkit.abi.Function(JSON.parse(functionFragment));
|
|
919
919
|
var getAppsShareClauses = (networkType, apps, roundId) => {
|
|
920
|
-
const allocationPoolContract =
|
|
920
|
+
const allocationPoolContract = chunkRUIC653T_cjs.getConfig(networkType).xAllocationPoolContractAddress;
|
|
921
921
|
const clauses = apps.map((app) => ({
|
|
922
922
|
to: allocationPoolContract,
|
|
923
923
|
value: 0,
|
|
@@ -959,7 +959,7 @@ var useMostVotedAppsInRound = (roundId) => {
|
|
|
959
959
|
apps?.map((app) => app.id) ?? [],
|
|
960
960
|
roundId
|
|
961
961
|
);
|
|
962
|
-
const mostVotedApps =
|
|
962
|
+
const mostVotedApps = React10.useMemo(
|
|
963
963
|
() => xAppsShares.data?.map((appShares) => ({
|
|
964
964
|
percentage: appShares.share + appShares.unallocatedShare,
|
|
965
965
|
id: apps?.find((xa) => xa.id === appShares.app)?.id ?? "",
|
|
@@ -974,7 +974,7 @@ var useMostVotedAppsInRound = (roundId) => {
|
|
|
974
974
|
};
|
|
975
975
|
var getParticipatedInGovernance = async (networkType, thor, address) => {
|
|
976
976
|
if (!address) return Promise.reject(new Error("Address not provided"));
|
|
977
|
-
const galaxyMemberContract =
|
|
977
|
+
const galaxyMemberContract = chunkRUIC653T_cjs.getConfig(networkType).galaxyMemberContractAddress;
|
|
978
978
|
const functionFragment2 = chunk5GZ7N47F_cjs.GalaxyMember__factory.createInterface().getFunction("participatedInGovernance").format("json");
|
|
979
979
|
const res = await thor.account(galaxyMemberContract).method(JSON.parse(functionFragment2)).call(address);
|
|
980
980
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -997,7 +997,7 @@ var useParticipatedInGovernance = (address) => {
|
|
|
997
997
|
};
|
|
998
998
|
var getBalanceOf = async (thor, network, address) => {
|
|
999
999
|
if (!address) return Promise.reject(new Error("Address not provided"));
|
|
1000
|
-
const contractAddress =
|
|
1000
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network).galaxyMemberContractAddress;
|
|
1001
1001
|
const functionFragment2 = chunk5GZ7N47F_cjs.GalaxyMember__factory.createInterface().getFunction("balanceOf").format("json");
|
|
1002
1002
|
const res = await thor.account(contractAddress).method(JSON.parse(functionFragment2)).call(address);
|
|
1003
1003
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -1029,7 +1029,7 @@ var useIsGMclaimable = (address) => {
|
|
|
1029
1029
|
};
|
|
1030
1030
|
var getTokenIdByAccount = async (thor, networkType, address, index) => {
|
|
1031
1031
|
if (!address) return Promise.reject(new Error("Address not provided"));
|
|
1032
|
-
const contractAddress =
|
|
1032
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(networkType).galaxyMemberContractAddress;
|
|
1033
1033
|
const functionFragment2 = chunk5GZ7N47F_cjs.GalaxyMember__factory.createInterface().getFunction("tokenOfOwnerByIndex").format("json");
|
|
1034
1034
|
const res = await thor.account(contractAddress).method(JSON.parse(functionFragment2)).call(address, index);
|
|
1035
1035
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -1056,7 +1056,7 @@ var contractInterface6 = chunk5GZ7N47F_cjs.GalaxyMember__factory.createInterface
|
|
|
1056
1056
|
var method8 = "getSelectedTokenId";
|
|
1057
1057
|
var useSelectedTokenId = (address, enabled = true) => {
|
|
1058
1058
|
const { network } = useVeChainKitConfig();
|
|
1059
|
-
const contractAddress =
|
|
1059
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
1060
1060
|
return useCall({
|
|
1061
1061
|
contractInterface: contractInterface6,
|
|
1062
1062
|
contractAddress,
|
|
@@ -1067,7 +1067,7 @@ var useSelectedTokenId = (address, enabled = true) => {
|
|
|
1067
1067
|
};
|
|
1068
1068
|
var getIpfsMetadata = async (networkType, uri, parseJson = false) => {
|
|
1069
1069
|
if (!uri) throw new Error("No URI provided");
|
|
1070
|
-
const newUri =
|
|
1070
|
+
const newUri = chunkRUIC653T_cjs.convertUriToUrl(uri, networkType);
|
|
1071
1071
|
if (!newUri) throw new Error("Invalid URI");
|
|
1072
1072
|
const response = await fetch(newUri, {
|
|
1073
1073
|
headers: {
|
|
@@ -1091,7 +1091,7 @@ var useIpfsMetadata = (ipfsUri, parseJson = false) => {
|
|
|
1091
1091
|
var MAX_IMAGE_SIZE = 1024 * 1024 * 10;
|
|
1092
1092
|
var getIpfsImage = async (networkType, uri) => {
|
|
1093
1093
|
if (!uri) throw new Error("IPFS URI is required");
|
|
1094
|
-
const response = await fetch(
|
|
1094
|
+
const response = await fetch(chunkRUIC653T_cjs.convertUriToUrl(uri, networkType) ?? "", {
|
|
1095
1095
|
headers: {
|
|
1096
1096
|
"X-Project-Id": "vechain-kit"
|
|
1097
1097
|
}
|
|
@@ -1123,7 +1123,7 @@ var getIpfsImage = async (networkType, uri) => {
|
|
|
1123
1123
|
resolve({
|
|
1124
1124
|
image: reader.result,
|
|
1125
1125
|
mime: blob.type,
|
|
1126
|
-
mediaType:
|
|
1126
|
+
mediaType: chunkRUIC653T_cjs.resolveMediaTypeFromMimeType(blob.type)
|
|
1127
1127
|
});
|
|
1128
1128
|
};
|
|
1129
1129
|
reader.onerror = () => {
|
|
@@ -1186,20 +1186,20 @@ var compressImages = async (images) => {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
};
|
|
1188
1188
|
var useUploadImages = ({ compressImages: compressImages2, defaultImages }) => {
|
|
1189
|
-
const [uploadedImages, setUploadedImages] =
|
|
1189
|
+
const [uploadedImages, setUploadedImages] = React10.useState(
|
|
1190
1190
|
defaultImages ?? []
|
|
1191
1191
|
);
|
|
1192
|
-
|
|
1192
|
+
React10.useEffect(() => {
|
|
1193
1193
|
if (defaultImages) {
|
|
1194
1194
|
setUploadedImages(defaultImages);
|
|
1195
1195
|
}
|
|
1196
1196
|
}, [defaultImages]);
|
|
1197
|
-
const [invalidDateError, setInvalidDateError] =
|
|
1198
|
-
const onRemove =
|
|
1197
|
+
const [invalidDateError, setInvalidDateError] = React10.useState([]);
|
|
1198
|
+
const onRemove = React10.useCallback(
|
|
1199
1199
|
(index) => setUploadedImages((s) => s.filter((_, i) => i !== index)),
|
|
1200
1200
|
[]
|
|
1201
1201
|
);
|
|
1202
|
-
const onUpload =
|
|
1202
|
+
const onUpload = React10.useCallback(
|
|
1203
1203
|
async (acceptedFiles, keepCurrent = true) => {
|
|
1204
1204
|
setInvalidDateError([]);
|
|
1205
1205
|
const parsedUploads = [];
|
|
@@ -1240,14 +1240,14 @@ var useSingleImageUpload = ({
|
|
|
1240
1240
|
compressImage,
|
|
1241
1241
|
defaultImage
|
|
1242
1242
|
}) => {
|
|
1243
|
-
const [uploadedImage, setUploadedImage] =
|
|
1244
|
-
|
|
1243
|
+
const [uploadedImage, setUploadedImage] = React10.useState(defaultImage);
|
|
1244
|
+
React10.useEffect(() => {
|
|
1245
1245
|
if (defaultImage) {
|
|
1246
1246
|
setUploadedImage(defaultImage);
|
|
1247
1247
|
}
|
|
1248
1248
|
}, [defaultImage]);
|
|
1249
|
-
const onRemove =
|
|
1250
|
-
const onUpload =
|
|
1249
|
+
const onRemove = React10.useCallback(() => setUploadedImage(void 0), []);
|
|
1250
|
+
const onUpload = React10.useCallback(
|
|
1251
1251
|
async (acceptedFile) => {
|
|
1252
1252
|
let parsedFile = acceptedFile;
|
|
1253
1253
|
if (compressImage) {
|
|
@@ -1279,7 +1279,7 @@ var method9 = "levelOf";
|
|
|
1279
1279
|
var getLevelOfTokenQueryKey = (tokenId) => getCallKey({ method: method9, keyArgs: [tokenId] });
|
|
1280
1280
|
var useLevelOfToken = (tokenId, enabled = true) => {
|
|
1281
1281
|
const { network } = useVeChainKitConfig();
|
|
1282
|
-
const contractAddress =
|
|
1282
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
1283
1283
|
return useCall({
|
|
1284
1284
|
contractInterface: contractInterface7,
|
|
1285
1285
|
contractAddress,
|
|
@@ -1296,7 +1296,7 @@ var getLevelMultiplierQueryKey = (level) => getCallKey({ method: method10, keyAr
|
|
|
1296
1296
|
var percentageToMultiplier = (percentage) => 1 + percentage / 100;
|
|
1297
1297
|
var useLevelMultiplier = (level, enabled = true) => {
|
|
1298
1298
|
const { network } = useVeChainKitConfig();
|
|
1299
|
-
const contractAddress =
|
|
1299
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).voterRewardsContractAddress;
|
|
1300
1300
|
return useCall({
|
|
1301
1301
|
contractInterface: contractInterface8,
|
|
1302
1302
|
contractAddress,
|
|
@@ -1312,7 +1312,7 @@ var contractInterface9 = chunk5GZ7N47F_cjs.GalaxyMember__factory.createInterface
|
|
|
1312
1312
|
var method11 = "getNodeIdAttached";
|
|
1313
1313
|
var useGetNodeIdAttached = (tokenId) => {
|
|
1314
1314
|
const { network } = useVeChainKitConfig();
|
|
1315
|
-
const contractAddress =
|
|
1315
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
1316
1316
|
return useCall({
|
|
1317
1317
|
contractInterface: contractInterface9,
|
|
1318
1318
|
contractAddress,
|
|
@@ -1327,7 +1327,7 @@ var contractInterface10 = chunk5GZ7N47F_cjs.GalaxyMember__factory.createInterfac
|
|
|
1327
1327
|
var method12 = "MAX_LEVEL";
|
|
1328
1328
|
var useGMMaxLevel = (enabled = true) => {
|
|
1329
1329
|
const { network } = useVeChainKitConfig();
|
|
1330
|
-
const contractAddress =
|
|
1330
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
1331
1331
|
return useCall({
|
|
1332
1332
|
contractInterface: contractInterface10,
|
|
1333
1333
|
contractAddress,
|
|
@@ -1411,8 +1411,8 @@ var useSelectedGmNft = (userAddress) => {
|
|
|
1411
1411
|
const { xNodeId } = useXNode(userAddress);
|
|
1412
1412
|
const isXNodeAttachedToGM = attachedNodeId === xNodeId;
|
|
1413
1413
|
const isMaxGmLevelReached = !!maxGmLevel && !!gmLevel && Number(gmLevel) === Number(maxGmLevel);
|
|
1414
|
-
const gmImage = gmNftImage?.image || imageData?.image ||
|
|
1415
|
-
const nftName = nftMetadata?.name ||
|
|
1414
|
+
const gmImage = gmNftImage?.image || imageData?.image || chunkRUIC653T_cjs.gmNfts[Number(gmLevel) - 1]?.image || chunkRUIC653T_cjs.notFoundImage;
|
|
1415
|
+
const nftName = nftMetadata?.name || chunkRUIC653T_cjs.gmNfts[Number(gmLevel) - 1]?.name;
|
|
1416
1416
|
const gmName = `${nftName} #${tokenID}`;
|
|
1417
1417
|
return {
|
|
1418
1418
|
gmId: selectedTokenId,
|
|
@@ -1440,7 +1440,7 @@ var method13 = "getB3TRtoUpgrade";
|
|
|
1440
1440
|
var getB3trToUpgradeQueryKey = (tokenId) => getCallKey({ method: method13, keyArgs: [tokenId] });
|
|
1441
1441
|
var useB3trToUpgrade = (tokenId, enabled = true) => {
|
|
1442
1442
|
const { network } = useVeChainKitConfig();
|
|
1443
|
-
const contractAddress =
|
|
1443
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
1444
1444
|
return useCall({
|
|
1445
1445
|
contractInterface: contractInterface11,
|
|
1446
1446
|
contractAddress,
|
|
@@ -1455,7 +1455,7 @@ var method14 = "getTokensInfoByOwner";
|
|
|
1455
1455
|
var getTokensInfoByOwnerQueryKey = (owner) => getCallKey({ method: method14, keyArgs: [owner] });
|
|
1456
1456
|
var useGetTokensInfoByOwner = (owner, size = 10) => {
|
|
1457
1457
|
const { network } = useVeChainKitConfig();
|
|
1458
|
-
const contractAddress =
|
|
1458
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
1459
1459
|
const { thor } = dappKitReact.useConnex();
|
|
1460
1460
|
const fetchTokens = async ({ pageParam = 0 }) => {
|
|
1461
1461
|
const functionFragment2 = contractInterface12.getFunction(method14)?.format("json");
|
|
@@ -1487,7 +1487,7 @@ var method15 = "getB3TRdonated";
|
|
|
1487
1487
|
var getB3trDonatedQueryKey = (tokenId) => getCallKey({ method: method15, keyArgs: [tokenId] });
|
|
1488
1488
|
var useB3trDonated = (tokenId, enabled = true) => {
|
|
1489
1489
|
const { network } = useVeChainKitConfig();
|
|
1490
|
-
const contractAddress =
|
|
1490
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
1491
1491
|
return useCall({
|
|
1492
1492
|
contractInterface: contractInterface13,
|
|
1493
1493
|
contractAddress,
|
|
@@ -1504,7 +1504,7 @@ var method16 = "baseURI";
|
|
|
1504
1504
|
var getGMBaseUriQueryKey = () => getCallKey({ method: "getGMBaseUri", keyArgs: [] });
|
|
1505
1505
|
var useGMBaseUri = () => {
|
|
1506
1506
|
const { network } = useVeChainKitConfig();
|
|
1507
|
-
const contractAddress =
|
|
1507
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).galaxyMemberContractAddress;
|
|
1508
1508
|
return useCall({
|
|
1509
1509
|
contractInterface: contractInterface14,
|
|
1510
1510
|
contractAddress,
|
|
@@ -1536,7 +1536,7 @@ var getGMLevel = (startingLevel, b3trDonated) => {
|
|
|
1536
1536
|
if (!Number.isInteger(startingLevel) || startingLevel <= 0) {
|
|
1537
1537
|
throw new Error("Starting level must be a positive integer");
|
|
1538
1538
|
}
|
|
1539
|
-
const gmLevelMap = new Map(
|
|
1539
|
+
const gmLevelMap = new Map(chunkRUIC653T_cjs.gmNfts.map((gm) => [Number(gm.level), gm]));
|
|
1540
1540
|
const startingGM = gmLevelMap.get(startingLevel);
|
|
1541
1541
|
if (!startingGM) return null;
|
|
1542
1542
|
let finalLevel = startingLevel;
|
|
@@ -1557,7 +1557,7 @@ var xAllocationVotingInterface = chunk5GZ7N47F_cjs.XAllocationVoting__factory.cr
|
|
|
1557
1557
|
var getCurrentAllocationsRoundId = async (thor, networkType) => {
|
|
1558
1558
|
const currentRoundAbi = xAllocationVotingInterface.getFunction("currentRoundId");
|
|
1559
1559
|
if (!currentRoundAbi) throw new Error("currentRoundId function not found");
|
|
1560
|
-
const res = await thor.account(
|
|
1560
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).xAllocationVotingContractAddress).method(currentRoundAbi).call();
|
|
1561
1561
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
1562
1562
|
return res.decoded[0];
|
|
1563
1563
|
};
|
|
@@ -1575,7 +1575,7 @@ var useCurrentAllocationsRoundId = () => {
|
|
|
1575
1575
|
});
|
|
1576
1576
|
};
|
|
1577
1577
|
var getAllocationAmount = async (thor, networkType, roundId) => {
|
|
1578
|
-
const emissionsContract =
|
|
1578
|
+
const emissionsContract = chunkRUIC653T_cjs.getConfig(networkType).emissionsContractAddress;
|
|
1579
1579
|
const emissionsInterface = chunk5GZ7N47F_cjs.Emissions__factory.createInterface();
|
|
1580
1580
|
const functionFragmentTreasuryAmount = emissionsInterface.getFunction("getTreasuryAmount").format("json");
|
|
1581
1581
|
const functionFragmentVoteX2EarnAmount = emissionsInterface.getFunction("getVote2EarnAmount").format("json");
|
|
@@ -1613,7 +1613,7 @@ var useAllocationAmount = (roundId) => {
|
|
|
1613
1613
|
});
|
|
1614
1614
|
};
|
|
1615
1615
|
var getHasVotedInRound = async (thor, networkType, roundId, address) => {
|
|
1616
|
-
const xAllocationVotingContract =
|
|
1616
|
+
const xAllocationVotingContract = chunkRUIC653T_cjs.getConfig(networkType).xAllocationVotingContractAddress;
|
|
1617
1617
|
const functionFragment2 = chunk5GZ7N47F_cjs.XAllocationVoting__factory.createInterface().getFunction("hasVoted").format("json");
|
|
1618
1618
|
const res = await thor.account(xAllocationVotingContract).method(JSON.parse(functionFragment2)).call(roundId, address);
|
|
1619
1619
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -1637,7 +1637,7 @@ var RoundState = {
|
|
|
1637
1637
|
};
|
|
1638
1638
|
var getAllocationsRoundState = async (thor, networkType, roundId) => {
|
|
1639
1639
|
if (!roundId) return Promise.reject(new Error("roundId is required"));
|
|
1640
|
-
const xAllocationVotingContract =
|
|
1640
|
+
const xAllocationVotingContract = chunkRUIC653T_cjs.getConfig(networkType).xAllocationVotingContractAddress;
|
|
1641
1641
|
const functionFragment2 = xAllocationVotingInterface2.getFunction("state").format("json");
|
|
1642
1642
|
const res = await thor.account(xAllocationVotingContract).method(JSON.parse(functionFragment2)).call(roundId);
|
|
1643
1643
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -1658,7 +1658,7 @@ var useAllocationsRoundState = (roundId) => {
|
|
|
1658
1658
|
});
|
|
1659
1659
|
};
|
|
1660
1660
|
var getAllocationsRoundsEvents = async (thor, networkType) => {
|
|
1661
|
-
const xAllocationVotingContract =
|
|
1661
|
+
const xAllocationVotingContract = chunkRUIC653T_cjs.getConfig(networkType).xAllocationVotingContractAddress;
|
|
1662
1662
|
const allocationCreatedAbi = chunk5GZ7N47F_cjs.XAllocationVoting__factory.createInterface().getEvent("RoundCreated");
|
|
1663
1663
|
if (!allocationCreatedAbi) throw new Error("RoundCreated event not found");
|
|
1664
1664
|
const allocationCreatedEvent = new thorDevkit.abi.Event(
|
|
@@ -1673,7 +1673,7 @@ var getAllocationsRoundsEvents = async (thor, networkType) => {
|
|
|
1673
1673
|
const events = await getAllEvents({
|
|
1674
1674
|
thor,
|
|
1675
1675
|
filterCriteria,
|
|
1676
|
-
nodeUrl:
|
|
1676
|
+
nodeUrl: chunkRUIC653T_cjs.getConfig(networkType).nodeUrl
|
|
1677
1677
|
});
|
|
1678
1678
|
const decodedCreatedAllocationEvents = [];
|
|
1679
1679
|
events.forEach((event) => {
|
|
@@ -1722,7 +1722,7 @@ var useAllocationsRound = (roundId) => {
|
|
|
1722
1722
|
const currentAllocationState = useAllocationsRoundState(roundId);
|
|
1723
1723
|
const allocationRoundsEvents = useAllocationsRoundsEvents();
|
|
1724
1724
|
const { network } = useVeChainKitConfig();
|
|
1725
|
-
const currentAllocationRound =
|
|
1725
|
+
const currentAllocationRound = React10.useMemo(() => {
|
|
1726
1726
|
if (!currentAllocationId.data || !allocationRoundsEvents.data)
|
|
1727
1727
|
return;
|
|
1728
1728
|
const roundInfo = allocationRoundsEvents.data.created.find(
|
|
@@ -1743,8 +1743,8 @@ var useAllocationsRound = (roundId) => {
|
|
|
1743
1743
|
const isLoading = currentAllocationId.isLoading || allocationRoundsEvents.isLoading || currentAllocationState.isLoading;
|
|
1744
1744
|
const isError = currentAllocationId.isError || allocationRoundsEvents.isError || currentAllocationState.isError;
|
|
1745
1745
|
const error = currentAllocationId.error || allocationRoundsEvents.error || currentAllocationState.error;
|
|
1746
|
-
const blockTime =
|
|
1747
|
-
const estimatedEndTime =
|
|
1746
|
+
const blockTime = chunkRUIC653T_cjs.getConfig(network.type).network.blockTime;
|
|
1747
|
+
const estimatedEndTime = React10.useMemo(() => {
|
|
1748
1748
|
if (!currentAllocationRound) return null;
|
|
1749
1749
|
const endBlock = Number(currentAllocationRound.voteEnd);
|
|
1750
1750
|
if (!endBlock || !currentBlock) return null;
|
|
@@ -1752,7 +1752,7 @@ var useAllocationsRound = (roundId) => {
|
|
|
1752
1752
|
const durationLeftTimestamp = endBlockFromNow * blockTime;
|
|
1753
1753
|
return Date.now() + durationLeftTimestamp;
|
|
1754
1754
|
}, [currentBlock, currentAllocationRound, blockTime]);
|
|
1755
|
-
const estimatedStartTime =
|
|
1755
|
+
const estimatedStartTime = React10.useMemo(() => {
|
|
1756
1756
|
if (!currentAllocationRound) return null;
|
|
1757
1757
|
const startBlock = Number(currentAllocationRound.voteStart);
|
|
1758
1758
|
if (!startBlock || !currentBlock) return null;
|
|
@@ -1809,7 +1809,7 @@ function getOrCreateQueryClient() {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
var EnsureQueryClient = ({ children }) => {
|
|
1811
1811
|
try {
|
|
1812
|
-
const existingQueryClient =
|
|
1812
|
+
const existingQueryClient = React10__default.default.useContext(reactQuery.QueryClientContext);
|
|
1813
1813
|
if (existingQueryClient) {
|
|
1814
1814
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
1815
1815
|
}
|
|
@@ -1822,7 +1822,7 @@ var EnsureQueryClient = ({ children }) => {
|
|
|
1822
1822
|
var roundEarningsFragment = chunk5GZ7N47F_cjs.XAllocationPool__factory.createInterface().getFunction("roundEarnings").format("json");
|
|
1823
1823
|
var roundEarningsAbi = new thorDevkit.abi.Function(JSON.parse(roundEarningsFragment));
|
|
1824
1824
|
var getXAppRoundEarnings = async (thor, roundId, xAppId, networkType) => {
|
|
1825
|
-
const xAllocationPoolContract =
|
|
1825
|
+
const xAllocationPoolContract = chunkRUIC653T_cjs.getConfig(networkType).xAllocationPoolContractAddress;
|
|
1826
1826
|
const functionFragment2 = chunk5GZ7N47F_cjs.XAllocationPool__factory.createInterface().getFunction("roundEarnings").format("json");
|
|
1827
1827
|
const res = await thor.account(xAllocationPoolContract).method(JSON.parse(functionFragment2)).call(roundId, xAppId);
|
|
1828
1828
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -1870,7 +1870,7 @@ var useMultipleXAppRoundEarnings = (roundId, xAppIds) => {
|
|
|
1870
1870
|
queryFn: () => getRoundXApps(thor, network.type, roundId),
|
|
1871
1871
|
queryKey: getRoundXAppsQueryKey(roundId)
|
|
1872
1872
|
});
|
|
1873
|
-
const xAllocationPoolContract =
|
|
1873
|
+
const xAllocationPoolContract = chunkRUIC653T_cjs.getConfig(
|
|
1874
1874
|
network.type
|
|
1875
1875
|
).xAllocationPoolContractAddress;
|
|
1876
1876
|
const xAppsInRound = data.filter((app) => xAppIds.includes(app.id));
|
|
@@ -1906,7 +1906,7 @@ var roundEarningsFragment2 = chunk5GZ7N47F_cjs.XAllocationPool__factory.createIn
|
|
|
1906
1906
|
var roundEarningsAbi2 = new thorDevkit.abi.Function(JSON.parse(roundEarningsFragment2));
|
|
1907
1907
|
var getXAppTotalEarningsClauses = (roundIds, app, networkType) => {
|
|
1908
1908
|
const clauses = roundIds.map((roundId) => ({
|
|
1909
|
-
to:
|
|
1909
|
+
to: chunkRUIC653T_cjs.getConfig(networkType).xAllocationPoolContractAddress,
|
|
1910
1910
|
value: 0,
|
|
1911
1911
|
data: roundEarningsAbi2.encode(roundId, app)
|
|
1912
1912
|
}));
|
|
@@ -1977,7 +1977,7 @@ var getAppBalance = async (thor, xAppId, x2EarnRewardsPoolContract) => {
|
|
|
1977
1977
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
1978
1978
|
const original = res.decoded[0];
|
|
1979
1979
|
const scaled = viem.formatEther(original);
|
|
1980
|
-
const formatted = scaled === "0" ? "0" :
|
|
1980
|
+
const formatted = scaled === "0" ? "0" : chunkRUIC653T_cjs.humanNumber(scaled);
|
|
1981
1981
|
return {
|
|
1982
1982
|
original,
|
|
1983
1983
|
scaled,
|
|
@@ -1993,7 +1993,7 @@ var getAppBalanceQueryKey = (xAppId) => [
|
|
|
1993
1993
|
var useAppBalance = (xAppId) => {
|
|
1994
1994
|
const { thor } = dappKitReact.useConnex();
|
|
1995
1995
|
const { network } = useVeChainKitConfig();
|
|
1996
|
-
const x2EarnRewardsPoolContract =
|
|
1996
|
+
const x2EarnRewardsPoolContract = chunkRUIC653T_cjs.getConfig(
|
|
1997
1997
|
network.type
|
|
1998
1998
|
).x2EarnRewardsPoolContractAddress;
|
|
1999
1999
|
return reactQuery.useQuery({
|
|
@@ -2010,7 +2010,7 @@ var getIsPersonQueryKey = (user) => {
|
|
|
2010
2010
|
};
|
|
2011
2011
|
var useIsPerson = (user) => {
|
|
2012
2012
|
const { network } = useVeChainKitConfig();
|
|
2013
|
-
const veBetterPassportContractAddress =
|
|
2013
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2014
2014
|
network.type
|
|
2015
2015
|
).veBetterPassportContractAddress;
|
|
2016
2016
|
return useCall({
|
|
@@ -2032,7 +2032,7 @@ var getUserRoundScoreQueryKey = (user, round) => {
|
|
|
2032
2032
|
};
|
|
2033
2033
|
var useUserRoundScore = (address, round) => {
|
|
2034
2034
|
const { network } = useVeChainKitConfig();
|
|
2035
|
-
const veBetterPassportContractAddress =
|
|
2035
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2036
2036
|
network.type
|
|
2037
2037
|
).veBetterPassportContractAddress;
|
|
2038
2038
|
return useCall({
|
|
@@ -2052,7 +2052,7 @@ var getThresholdParticipationScoreQueryKey = () => {
|
|
|
2052
2052
|
};
|
|
2053
2053
|
var useThresholdParticipationScore = () => {
|
|
2054
2054
|
const { network } = useVeChainKitConfig();
|
|
2055
|
-
const veBetterPassportContractAddress =
|
|
2055
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2056
2056
|
network.type
|
|
2057
2057
|
).veBetterPassportContractAddress;
|
|
2058
2058
|
return useCall({
|
|
@@ -2072,7 +2072,7 @@ var getPassportToggleQueryKey = (checkName) => {
|
|
|
2072
2072
|
};
|
|
2073
2073
|
var useIsPassportCheckEnabled = (checkName) => {
|
|
2074
2074
|
const { network } = useVeChainKitConfig();
|
|
2075
|
-
const veBetterPassportContractAddress =
|
|
2075
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2076
2076
|
network.type
|
|
2077
2077
|
).veBetterPassportContractAddress;
|
|
2078
2078
|
return useCall({
|
|
@@ -2092,7 +2092,7 @@ var getParticipationScoreThresholdQueryKey = () => {
|
|
|
2092
2092
|
};
|
|
2093
2093
|
var useParticipationScoreThreshold = () => {
|
|
2094
2094
|
const { network } = useVeChainKitConfig();
|
|
2095
|
-
const veBetterPassportContractAddress =
|
|
2095
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2096
2096
|
network.type
|
|
2097
2097
|
).veBetterPassportContractAddress;
|
|
2098
2098
|
return useCall({
|
|
@@ -2113,7 +2113,7 @@ var getAppSecurityLevelQueryKey = (appId) => {
|
|
|
2113
2113
|
};
|
|
2114
2114
|
var useAppSecurityLevel = (appId) => {
|
|
2115
2115
|
const { network } = useVeChainKitConfig();
|
|
2116
|
-
const contractAddress =
|
|
2116
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2117
2117
|
network.type
|
|
2118
2118
|
).veBetterPassportContractAddress;
|
|
2119
2119
|
return useCall({
|
|
@@ -2157,7 +2157,7 @@ var getIsBlacklistedQueryKey = (address) => {
|
|
|
2157
2157
|
};
|
|
2158
2158
|
var useIsBlacklisted = (address) => {
|
|
2159
2159
|
const { network } = useVeChainKitConfig();
|
|
2160
|
-
const veBetterPassportContractAddress =
|
|
2160
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2161
2161
|
network.type
|
|
2162
2162
|
).veBetterPassportContractAddress;
|
|
2163
2163
|
return useCall({
|
|
@@ -2177,7 +2177,7 @@ var getIsWhitelistedQueryKey = (address) => {
|
|
|
2177
2177
|
};
|
|
2178
2178
|
var useIsWhitelisted = (address) => {
|
|
2179
2179
|
const { network } = useVeChainKitConfig();
|
|
2180
|
-
const veBetterPassportContractAddress =
|
|
2180
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2181
2181
|
network.type
|
|
2182
2182
|
).veBetterPassportContractAddress;
|
|
2183
2183
|
return useCall({
|
|
@@ -2191,7 +2191,7 @@ var useIsWhitelisted = (address) => {
|
|
|
2191
2191
|
var useUserStatus = (address) => {
|
|
2192
2192
|
const { data: isBlacklisted } = useIsBlacklisted(address);
|
|
2193
2193
|
const { data: isWhitelisted } = useIsWhitelisted(address);
|
|
2194
|
-
const userStatus =
|
|
2194
|
+
const userStatus = React10.useMemo(() => {
|
|
2195
2195
|
if (!isBlacklisted && !isWhitelisted) {
|
|
2196
2196
|
return "NONE" /* NONE */;
|
|
2197
2197
|
}
|
|
@@ -2214,7 +2214,7 @@ var getUserBotSignalsQueryKey = (address) => {
|
|
|
2214
2214
|
};
|
|
2215
2215
|
var useUserBotSignals = (address) => {
|
|
2216
2216
|
const { network } = useVeChainKitConfig();
|
|
2217
|
-
const veBetterPassportContractAddress =
|
|
2217
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2218
2218
|
network.type
|
|
2219
2219
|
).veBetterPassportContractAddress;
|
|
2220
2220
|
return useCall({
|
|
@@ -2236,7 +2236,7 @@ var getGetCumulativeScoreWithDecayQueryKey = (user, round) => {
|
|
|
2236
2236
|
};
|
|
2237
2237
|
var useGetCumulativeScoreWithDecay = (user, round) => {
|
|
2238
2238
|
const { network } = useVeChainKitConfig();
|
|
2239
|
-
const veBetterPassportContractAddress =
|
|
2239
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2240
2240
|
network.type
|
|
2241
2241
|
).veBetterPassportContractAddress;
|
|
2242
2242
|
return useCall({
|
|
@@ -2263,7 +2263,7 @@ var getSecurityMultiplierQueryKey = (securityLevel) => {
|
|
|
2263
2263
|
};
|
|
2264
2264
|
var useSecurityMultiplier = (securityLevel) => {
|
|
2265
2265
|
const { network } = useVeChainKitConfig();
|
|
2266
|
-
const veBetterPassportContractAddress =
|
|
2266
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2267
2267
|
network.type
|
|
2268
2268
|
).veBetterPassportContractAddress;
|
|
2269
2269
|
return useCall({
|
|
@@ -2280,7 +2280,7 @@ var getDelegateeQueryKey = (delegator) => {
|
|
|
2280
2280
|
};
|
|
2281
2281
|
var useGetDelegatee = (delegator) => {
|
|
2282
2282
|
const { network } = useVeChainKitConfig();
|
|
2283
|
-
const veBetterPassportContractAddress =
|
|
2283
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2284
2284
|
network.type
|
|
2285
2285
|
).veBetterPassportContractAddress;
|
|
2286
2286
|
return useCall({
|
|
@@ -2302,7 +2302,7 @@ var getDelegatorQueryKey = (delegator) => {
|
|
|
2302
2302
|
};
|
|
2303
2303
|
var useGetDelegator = (delegator) => {
|
|
2304
2304
|
const { network } = useVeChainKitConfig();
|
|
2305
|
-
const veBetterPassportContractAddress =
|
|
2305
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2306
2306
|
network.type
|
|
2307
2307
|
).veBetterPassportContractAddress;
|
|
2308
2308
|
return useCall({
|
|
@@ -2312,7 +2312,7 @@ var useGetDelegator = (delegator) => {
|
|
|
2312
2312
|
args: [delegator],
|
|
2313
2313
|
mapResponse: (response) => {
|
|
2314
2314
|
const delegator2 = response.decoded[0];
|
|
2315
|
-
if (
|
|
2315
|
+
if (chunkRUIC653T_cjs.compareAddresses(delegator2, viem.zeroAddress)) return null;
|
|
2316
2316
|
return delegator2;
|
|
2317
2317
|
},
|
|
2318
2318
|
enabled: !!delegator
|
|
@@ -2327,7 +2327,7 @@ var getPendingDelegationsQueryKeyDelegateePOV = (delegatee) => {
|
|
|
2327
2327
|
};
|
|
2328
2328
|
var useGetPendingDelegationsDelegateePOV = (delegatee) => {
|
|
2329
2329
|
const { network } = useVeChainKitConfig();
|
|
2330
|
-
const veBetterPassportContractAddress =
|
|
2330
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2331
2331
|
network.type
|
|
2332
2332
|
).veBetterPassportContractAddress;
|
|
2333
2333
|
return useCall({
|
|
@@ -2349,7 +2349,7 @@ var getPendingDelegationsQueryKeyDelegatorPOV = (delegator) => {
|
|
|
2349
2349
|
};
|
|
2350
2350
|
var useGetPendingDelegationsDelegatorPOV = (delegator) => {
|
|
2351
2351
|
const { network } = useVeChainKitConfig();
|
|
2352
|
-
const veBetterPassportContractAddress =
|
|
2352
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2353
2353
|
network.type
|
|
2354
2354
|
).veBetterPassportContractAddress;
|
|
2355
2355
|
return useCall({
|
|
@@ -2371,7 +2371,7 @@ var getPendingLinkingsQueryKey = (user) => {
|
|
|
2371
2371
|
};
|
|
2372
2372
|
var useGetPendingLinkings = (user) => {
|
|
2373
2373
|
const { network } = useVeChainKitConfig();
|
|
2374
|
-
const veBetterPassportContractAddress =
|
|
2374
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2375
2375
|
network.type
|
|
2376
2376
|
).veBetterPassportContractAddress;
|
|
2377
2377
|
return useCall({
|
|
@@ -2398,7 +2398,7 @@ var getEntitiesLinkedToPassportQueryKey = (passport) => {
|
|
|
2398
2398
|
};
|
|
2399
2399
|
var useGetEntitiesLinkedToPassport = (passport) => {
|
|
2400
2400
|
const { network } = useVeChainKitConfig();
|
|
2401
|
-
const veBetterPassportContractAddress =
|
|
2401
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2402
2402
|
network.type
|
|
2403
2403
|
).veBetterPassportContractAddress;
|
|
2404
2404
|
return useCall({
|
|
@@ -2421,7 +2421,7 @@ var getPassportForEntityQueryKey = (entity) => {
|
|
|
2421
2421
|
};
|
|
2422
2422
|
var useGetPassportForEntity = (entity) => {
|
|
2423
2423
|
const { network } = useVeChainKitConfig();
|
|
2424
|
-
const veBetterPassportContractAddress =
|
|
2424
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2425
2425
|
network.type
|
|
2426
2426
|
).veBetterPassportContractAddress;
|
|
2427
2427
|
return useCall({
|
|
@@ -2445,7 +2445,7 @@ var getIsEntityQueryKey = (address) => {
|
|
|
2445
2445
|
};
|
|
2446
2446
|
var useIsEntity = (address) => {
|
|
2447
2447
|
const { network } = useVeChainKitConfig();
|
|
2448
|
-
const veBetterPassportContractAddress =
|
|
2448
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2449
2449
|
network.type
|
|
2450
2450
|
).veBetterPassportContractAddress;
|
|
2451
2451
|
return useCall({
|
|
@@ -2465,7 +2465,7 @@ var useAccountLinking = (user) => {
|
|
|
2465
2465
|
const isPassport = !isEntity && userLinkedEntities?.length > 0;
|
|
2466
2466
|
const { data: entityPassport, isLoading: isEntityPassportLoading } = useGetPassportForEntity(!!isEntity ? user : void 0);
|
|
2467
2467
|
const isLinked = !!isPassport || !!isEntity;
|
|
2468
|
-
const passport =
|
|
2468
|
+
const passport = React10.useMemo(() => {
|
|
2469
2469
|
if (isEntity) return entityPassport ?? void 0;
|
|
2470
2470
|
if (isPassport) return user;
|
|
2471
2471
|
return void 0;
|
|
@@ -2498,7 +2498,7 @@ var getIsPassportQueryKey = (address) => {
|
|
|
2498
2498
|
};
|
|
2499
2499
|
var useIsPassport = (address) => {
|
|
2500
2500
|
const { network } = useVeChainKitConfig();
|
|
2501
|
-
const veBetterPassportContractAddress =
|
|
2501
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2502
2502
|
network.type
|
|
2503
2503
|
).veBetterPassportContractAddress;
|
|
2504
2504
|
return useCall({
|
|
@@ -2534,7 +2534,7 @@ var getThresholdParticipationScoreAtTimepointQueryKey = (blockNumber) => {
|
|
|
2534
2534
|
};
|
|
2535
2535
|
var useThresholdParticipationScoreAtTimepoint = (blockNumber) => {
|
|
2536
2536
|
const { network } = useVeChainKitConfig();
|
|
2537
|
-
const veBetterPassportContractAddress =
|
|
2537
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2538
2538
|
network.type
|
|
2539
2539
|
).veBetterPassportContractAddress;
|
|
2540
2540
|
return useCall({
|
|
@@ -2556,7 +2556,7 @@ var getIsPersonAtTimepointQueryKey = (user, blockNumber) => {
|
|
|
2556
2556
|
};
|
|
2557
2557
|
var useIsPersonAtTimepoint = (user, blockNumber) => {
|
|
2558
2558
|
const { network } = useVeChainKitConfig();
|
|
2559
|
-
const veBetterPassportContractAddress =
|
|
2559
|
+
const veBetterPassportContractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2560
2560
|
network.type
|
|
2561
2561
|
).veBetterPassportContractAddress;
|
|
2562
2562
|
return useCall({
|
|
@@ -2569,7 +2569,7 @@ var useIsPersonAtTimepoint = (user, blockNumber) => {
|
|
|
2569
2569
|
};
|
|
2570
2570
|
var getRoundReward = async (thor, networkType, address, roundId) => {
|
|
2571
2571
|
const functionFragment2 = chunk5GZ7N47F_cjs.VoterRewards__factory.createInterface().getFunction("getReward").format("json");
|
|
2572
|
-
const contractAddress =
|
|
2572
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(networkType).voterRewardsContractAddress;
|
|
2573
2573
|
const res = await thor.account(contractAddress).method(JSON.parse(functionFragment2)).call(roundId, address);
|
|
2574
2574
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
2575
2575
|
const reward = viem.formatEther(res.decoded[0]);
|
|
@@ -2601,8 +2601,8 @@ var useVotingRewards = (currentRoundId, voter) => {
|
|
|
2601
2601
|
const { thor } = dappKitReact.useConnex();
|
|
2602
2602
|
const queryClient = reactQuery.useQueryClient();
|
|
2603
2603
|
const { network } = useVeChainKitConfig();
|
|
2604
|
-
const contractAddress =
|
|
2605
|
-
const rounds =
|
|
2604
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(network.type).voterRewardsContractAddress;
|
|
2605
|
+
const rounds = React10.useMemo(() => {
|
|
2606
2606
|
return Array.from(
|
|
2607
2607
|
{ length: parseInt(currentRoundId ?? "0") - 1 },
|
|
2608
2608
|
(_, i) => (i + 1).toString()
|
|
@@ -2656,7 +2656,7 @@ var useVotingRewards = (currentRoundId, voter) => {
|
|
|
2656
2656
|
var voterRewardsInterface2 = chunk5GZ7N47F_cjs.VoterRewards__factory.createInterface();
|
|
2657
2657
|
var buildClaimRoundReward = (roundId, address, networkType) => {
|
|
2658
2658
|
const clause = {
|
|
2659
|
-
to:
|
|
2659
|
+
to: chunkRUIC653T_cjs.getConfig(networkType).voterRewardsContractAddress,
|
|
2660
2660
|
value: 0,
|
|
2661
2661
|
data: voterRewardsInterface2.encodeFunctionData("claimReward", [
|
|
2662
2662
|
roundId,
|
|
@@ -2691,7 +2691,7 @@ var method33 = "getNodeManager";
|
|
|
2691
2691
|
var getNodeManagerQueryKey = (nodeId) => getCallKey({ method: method33, keyArgs: [nodeId] });
|
|
2692
2692
|
var useGetNodeManager = (nodeId) => {
|
|
2693
2693
|
const { network } = useVeChainKitConfig();
|
|
2694
|
-
const contractAddress =
|
|
2694
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(
|
|
2695
2695
|
network.type
|
|
2696
2696
|
).nodeManagementContractAddress;
|
|
2697
2697
|
return useCall({
|
|
@@ -2705,7 +2705,7 @@ var useGetNodeManager = (nodeId) => {
|
|
|
2705
2705
|
var ERC20Interface = chunk5GZ7N47F_cjs.IERC20__factory.createInterface();
|
|
2706
2706
|
var getVeDelegateBalance = async (thor, network, address) => {
|
|
2707
2707
|
const functionFragment2 = ERC20Interface.getFunction("balanceOf").format("json");
|
|
2708
|
-
const res = await thor.account(
|
|
2708
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(network).veDelegateTokenContractAddress).method(JSON.parse(functionFragment2)).call(address);
|
|
2709
2709
|
if (res.reverted) throw new Error("Reverted");
|
|
2710
2710
|
return res.decoded[0];
|
|
2711
2711
|
};
|
|
@@ -2800,7 +2800,7 @@ var fetchVechainDomain = async (thor, networkType, addressOrDomain) => {
|
|
|
2800
2800
|
const isValidAddress2 = ethers.isAddress(addressOrDomain);
|
|
2801
2801
|
if (isValidAddress2) {
|
|
2802
2802
|
try {
|
|
2803
|
-
const res = await thor.account(
|
|
2803
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).vnsResolverAddress).method(getNamesABI).call([addressOrDomain]);
|
|
2804
2804
|
const domainName = res.decoded.names?.[0];
|
|
2805
2805
|
return {
|
|
2806
2806
|
address: addressOrDomain,
|
|
@@ -2817,7 +2817,7 @@ var fetchVechainDomain = async (thor, networkType, addressOrDomain) => {
|
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
2819
2819
|
try {
|
|
2820
|
-
const res = await thor.account(
|
|
2820
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).vnsResolverAddress).method(getAddressesABI).call([addressOrDomain]);
|
|
2821
2821
|
const domainAddress = res.decoded.addresses?.[0];
|
|
2822
2822
|
if (domainAddress === "0x0000000000000000000000000000000000000000") {
|
|
2823
2823
|
return {
|
|
@@ -2863,7 +2863,7 @@ var getEnsRecordExists = async (thor, network, name) => {
|
|
|
2863
2863
|
const labelHash = viem.keccak256(viem.toBytes(name));
|
|
2864
2864
|
const subnode = viem.keccak256(viem.concat([hashedNode, labelHash]));
|
|
2865
2865
|
const functionFragment2 = MockENSInterface.getFunction("recordExists").format("json");
|
|
2866
|
-
const res = await thor.account(
|
|
2866
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(network).vetDomainsContractAddress).method(JSON.parse(functionFragment2)).call(subnode);
|
|
2867
2867
|
if (res.reverted) throw new Error("Reverted");
|
|
2868
2868
|
return res.decoded[0];
|
|
2869
2869
|
};
|
|
@@ -2892,14 +2892,14 @@ var useClaimVeWorldSubdomain = ({
|
|
|
2892
2892
|
const queryClient = reactQuery.useQueryClient();
|
|
2893
2893
|
const { account } = useWallet();
|
|
2894
2894
|
const { network } = useVeChainKitConfig();
|
|
2895
|
-
const buildClauses =
|
|
2895
|
+
const buildClauses = React10.useCallback(async () => {
|
|
2896
2896
|
if (!subdomain) throw new Error("Invalid subdomain");
|
|
2897
2897
|
const clausesArray = [];
|
|
2898
2898
|
clausesArray.push({
|
|
2899
|
-
to:
|
|
2899
|
+
to: chunkRUIC653T_cjs.getConfig(network.type).vetDomainsReverseRegistrarAddress,
|
|
2900
2900
|
value: "0x0",
|
|
2901
2901
|
data: ReverseRegistrarInterface.encodeFunctionData("setName", [""]),
|
|
2902
|
-
comment: `Unsetting your current VeChain nickname of the account ${
|
|
2902
|
+
comment: `Unsetting your current VeChain nickname of the account ${chunkRUIC653T_cjs.humanAddress(
|
|
2903
2903
|
account?.address ?? "",
|
|
2904
2904
|
4,
|
|
2905
2905
|
4
|
|
@@ -2908,23 +2908,23 @@ var useClaimVeWorldSubdomain = ({
|
|
|
2908
2908
|
});
|
|
2909
2909
|
if (!alreadyOwned) {
|
|
2910
2910
|
clausesArray.push({
|
|
2911
|
-
to:
|
|
2911
|
+
to: chunkRUIC653T_cjs.getConfig(network.type).veWorldSubdomainClaimerContractAddress,
|
|
2912
2912
|
value: "0x0",
|
|
2913
2913
|
data: SubdomainClaimerInterface.encodeFunctionData("claim", [
|
|
2914
2914
|
subdomain,
|
|
2915
|
-
|
|
2915
|
+
chunkRUIC653T_cjs.getConfig(network.type).vetDomainsPublicResolverAddress
|
|
2916
2916
|
]),
|
|
2917
2917
|
comment: `Claim VeChain subdomain: ${subdomain}.${domain}`,
|
|
2918
2918
|
abi: SubdomainClaimerInterface.getFunction("claim")
|
|
2919
2919
|
});
|
|
2920
2920
|
}
|
|
2921
2921
|
clausesArray.push({
|
|
2922
|
-
to:
|
|
2922
|
+
to: chunkRUIC653T_cjs.getConfig(network.type).vetDomainsReverseRegistrarAddress,
|
|
2923
2923
|
value: "0x0",
|
|
2924
2924
|
data: ReverseRegistrarInterface.encodeFunctionData("setName", [
|
|
2925
2925
|
subdomain + "." + domain
|
|
2926
2926
|
]),
|
|
2927
|
-
comment: `Set ${subdomain}.${domain} as the VeChain nickname of the account ${
|
|
2927
|
+
comment: `Set ${subdomain}.${domain} as the VeChain nickname of the account ${chunkRUIC653T_cjs.humanAddress(
|
|
2928
2928
|
account?.address ?? "",
|
|
2929
2929
|
4,
|
|
2930
2930
|
4
|
|
@@ -2933,7 +2933,7 @@ var useClaimVeWorldSubdomain = ({
|
|
|
2933
2933
|
});
|
|
2934
2934
|
return clausesArray;
|
|
2935
2935
|
}, [subdomain, domain, account?.address, alreadyOwned]);
|
|
2936
|
-
const handleOnSuccess =
|
|
2936
|
+
const handleOnSuccess = React10.useCallback(async () => {
|
|
2937
2937
|
queryClient.cancelQueries({
|
|
2938
2938
|
queryKey: getVechainDomainQueryKey(account?.address ?? ""),
|
|
2939
2939
|
refetchType: "none"
|
|
@@ -3007,7 +3007,7 @@ var method34 = "isDomainProtected";
|
|
|
3007
3007
|
var getIsDomainProtectedQueryKey = (domain) => getCallKey({ method: method34, keyArgs: [domain] });
|
|
3008
3008
|
var useIsDomainProtected = (domain, enabled = true) => {
|
|
3009
3009
|
const { network } = useVeChainKitConfig();
|
|
3010
|
-
const contractAddress =
|
|
3010
|
+
const contractAddress = chunkRUIC653T_cjs.getConfig(
|
|
3011
3011
|
network.type
|
|
3012
3012
|
).veWorldSubdomainClaimerContractAddress;
|
|
3013
3013
|
return useCall({
|
|
@@ -3027,7 +3027,7 @@ var DomainsResponseSchema = zod.z.object({
|
|
|
3027
3027
|
});
|
|
3028
3028
|
var getDomainsOfAddress = async (networkType, address, parentDomain = "vet") => {
|
|
3029
3029
|
if (!address) throw new Error("Address is required");
|
|
3030
|
-
const graphQlIndexerUrl =
|
|
3030
|
+
const graphQlIndexerUrl = chunkRUIC653T_cjs.getConfig(networkType).graphQlIndexerUrl;
|
|
3031
3031
|
const query = `query Registrations {
|
|
3032
3032
|
domains(
|
|
3033
3033
|
where: {owner: "${address.toLowerCase()}", parent_: {name: "${parentDomain}"}}
|
|
@@ -3078,7 +3078,7 @@ var getAvatar = async (networkType, nodeUrl, name) => {
|
|
|
3078
3078
|
body: JSON.stringify({
|
|
3079
3079
|
clauses: [
|
|
3080
3080
|
{
|
|
3081
|
-
to:
|
|
3081
|
+
to: chunkRUIC653T_cjs.getConfig(networkType).vetDomainsContractAddress,
|
|
3082
3082
|
data: nameInterface.encodeFunctionData("resolver", [
|
|
3083
3083
|
node
|
|
3084
3084
|
])
|
|
@@ -3138,7 +3138,7 @@ var getAvatarQueryKey = (name) => [
|
|
|
3138
3138
|
];
|
|
3139
3139
|
var useGetAvatar = (name) => {
|
|
3140
3140
|
const { network } = useVeChainKitConfig();
|
|
3141
|
-
const nodeUrl = network.nodeUrl ??
|
|
3141
|
+
const nodeUrl = network.nodeUrl ?? chunkRUIC653T_cjs.getConfig(network.type).nodeUrl;
|
|
3142
3142
|
const avatarQuery = reactQuery.useQuery({
|
|
3143
3143
|
queryKey: getAvatarQueryKey(name ?? ""),
|
|
3144
3144
|
queryFn: () => getAvatar(network.type, nodeUrl, name),
|
|
@@ -3166,7 +3166,7 @@ var getTextRecords = async (nodeUrl, network, domain) => {
|
|
|
3166
3166
|
body: JSON.stringify({
|
|
3167
3167
|
clauses: [
|
|
3168
3168
|
{
|
|
3169
|
-
to:
|
|
3169
|
+
to: chunkRUIC653T_cjs.getConfig(network).vetDomainsContractAddress,
|
|
3170
3170
|
data: nameInterface2.encodeFunctionData("resolver", [
|
|
3171
3171
|
node
|
|
3172
3172
|
])
|
|
@@ -3225,7 +3225,7 @@ var getTextRecords = async (nodeUrl, network, domain) => {
|
|
|
3225
3225
|
var getTextRecordsQueryKey = (domain, network) => ["VECHAIN_KIT_TEXT_RECORDS", domain, network];
|
|
3226
3226
|
var useGetTextRecords = (domain) => {
|
|
3227
3227
|
const { network } = useVeChainKitConfig();
|
|
3228
|
-
const nodeUrl = network.nodeUrl ??
|
|
3228
|
+
const nodeUrl = network.nodeUrl ?? chunkRUIC653T_cjs.getConfig(network.type).nodeUrl;
|
|
3229
3229
|
return reactQuery.useQuery({
|
|
3230
3230
|
queryKey: getTextRecordsQueryKey(domain, network.type),
|
|
3231
3231
|
queryFn: () => getTextRecords(nodeUrl, network.type, domain),
|
|
@@ -3275,7 +3275,7 @@ var useSendTransaction = ({
|
|
|
3275
3275
|
}
|
|
3276
3276
|
return parsedClauses;
|
|
3277
3277
|
}
|
|
3278
|
-
const sendTransaction =
|
|
3278
|
+
const sendTransaction = React10.useCallback(
|
|
3279
3279
|
async (clauses2, options) => {
|
|
3280
3280
|
if (connection.isConnectedWithPrivy) {
|
|
3281
3281
|
return await privyWalletProvider.sendTransaction({
|
|
@@ -3320,12 +3320,12 @@ var useSendTransaction = ({
|
|
|
3320
3320
|
privyUIOptions
|
|
3321
3321
|
]
|
|
3322
3322
|
);
|
|
3323
|
-
const [sendTransactionTx, setSendTransactionTx] =
|
|
3323
|
+
const [sendTransactionTx, setSendTransactionTx] = React10.useState(
|
|
3324
3324
|
null
|
|
3325
3325
|
);
|
|
3326
|
-
const [sendTransactionPending, setSendTransactionPending] =
|
|
3327
|
-
const [sendTransactionError, setSendTransactionError] =
|
|
3328
|
-
const sendTransactionAdapter =
|
|
3326
|
+
const [sendTransactionPending, setSendTransactionPending] = React10.useState(false);
|
|
3327
|
+
const [sendTransactionError, setSendTransactionError] = React10.useState(null);
|
|
3328
|
+
const sendTransactionAdapter = React10.useCallback(
|
|
3329
3329
|
async (_clauses) => {
|
|
3330
3330
|
if (!_clauses && !clauses) throw new Error("clauses are required");
|
|
3331
3331
|
try {
|
|
@@ -3361,7 +3361,7 @@ var useSendTransaction = ({
|
|
|
3361
3361
|
isLoading: isTxReceiptLoading,
|
|
3362
3362
|
error: txReceiptError
|
|
3363
3363
|
} = useTxReceipt(sendTransactionTx ?? "");
|
|
3364
|
-
const explainTxRevertReason =
|
|
3364
|
+
const explainTxRevertReason = React10.useCallback(
|
|
3365
3365
|
async (txReceipt2) => {
|
|
3366
3366
|
if (!txReceipt2.reverted) return;
|
|
3367
3367
|
const transactionData = await thor.transaction(txReceipt2.meta.txID).get();
|
|
@@ -3370,8 +3370,8 @@ var useSendTransaction = ({
|
|
|
3370
3370
|
},
|
|
3371
3371
|
[thor]
|
|
3372
3372
|
);
|
|
3373
|
-
const [error, setError] =
|
|
3374
|
-
const status =
|
|
3373
|
+
const [error, setError] = React10.useState();
|
|
3374
|
+
const status = React10.useMemo(() => {
|
|
3375
3375
|
if (sendTransactionPending) return "pending";
|
|
3376
3376
|
if (sendTransactionError) {
|
|
3377
3377
|
return "error";
|
|
@@ -3397,7 +3397,7 @@ var useSendTransaction = ({
|
|
|
3397
3397
|
txReceipt,
|
|
3398
3398
|
txReceiptError
|
|
3399
3399
|
]);
|
|
3400
|
-
|
|
3400
|
+
React10.useEffect(() => {
|
|
3401
3401
|
if (status === "success" || status === "error") {
|
|
3402
3402
|
if (sendTransactionError && !error) {
|
|
3403
3403
|
setError({
|
|
@@ -3432,16 +3432,16 @@ var useSendTransaction = ({
|
|
|
3432
3432
|
explainTxRevertReason,
|
|
3433
3433
|
sendTransactionError
|
|
3434
3434
|
]);
|
|
3435
|
-
const resetStatus =
|
|
3435
|
+
const resetStatus = React10.useCallback(() => {
|
|
3436
3436
|
setSendTransactionTx(null);
|
|
3437
3437
|
setSendTransactionPending(false);
|
|
3438
3438
|
setSendTransactionError(null);
|
|
3439
3439
|
setError(void 0);
|
|
3440
3440
|
}, []);
|
|
3441
|
-
const isTransactionPending =
|
|
3441
|
+
const isTransactionPending = React10.useMemo(() => {
|
|
3442
3442
|
return sendTransactionPending || isTxReceiptLoading || status === "pending" || status === "waitingConfirmation";
|
|
3443
3443
|
}, [sendTransactionPending, isTxReceiptLoading, status]);
|
|
3444
|
-
const isWaitingForWalletConfirmation =
|
|
3444
|
+
const isWaitingForWalletConfirmation = React10.useMemo(() => {
|
|
3445
3445
|
return status === "pending";
|
|
3446
3446
|
}, [sendTransactionPending, status]);
|
|
3447
3447
|
return {
|
|
@@ -3466,7 +3466,7 @@ var useUpdateTextRecord = ({
|
|
|
3466
3466
|
signerAccountAddress,
|
|
3467
3467
|
resolverAddress
|
|
3468
3468
|
} = {}) => {
|
|
3469
|
-
const buildClauses =
|
|
3469
|
+
const buildClauses = React10.useCallback(
|
|
3470
3470
|
async (params) => {
|
|
3471
3471
|
const clauses = [];
|
|
3472
3472
|
for (const { domain, key, value } of params) {
|
|
@@ -3520,7 +3520,7 @@ var getResolverAddress = async (nodeUrl, network, domain) => {
|
|
|
3520
3520
|
body: JSON.stringify({
|
|
3521
3521
|
clauses: [
|
|
3522
3522
|
{
|
|
3523
|
-
to:
|
|
3523
|
+
to: chunkRUIC653T_cjs.getConfig(network).vetDomainsContractAddress,
|
|
3524
3524
|
data: nameInterface4.encodeFunctionData("resolver", [node])
|
|
3525
3525
|
}
|
|
3526
3526
|
]
|
|
@@ -3541,7 +3541,7 @@ var getResolverAddressQueryKey = (domain) => [
|
|
|
3541
3541
|
];
|
|
3542
3542
|
var useGetResolverAddress = (domain) => {
|
|
3543
3543
|
const { network } = useVeChainKitConfig();
|
|
3544
|
-
const nodeUrl = network.nodeUrl ??
|
|
3544
|
+
const nodeUrl = network.nodeUrl ?? chunkRUIC653T_cjs.getConfig(network.type).nodeUrl;
|
|
3545
3545
|
return reactQuery.useQuery({
|
|
3546
3546
|
queryKey: getResolverAddressQueryKey(domain),
|
|
3547
3547
|
queryFn: () => getResolverAddress(nodeUrl, network.type, domain),
|
|
@@ -3562,14 +3562,14 @@ var useBalances = ({ address = "" }) => {
|
|
|
3562
3562
|
const customTokensLoading = customTokenBalancesQueries.some(
|
|
3563
3563
|
(query) => query.isLoading
|
|
3564
3564
|
);
|
|
3565
|
-
return
|
|
3565
|
+
return React10.useMemo(() => {
|
|
3566
3566
|
const isLoading = vetLoading || b3trLoading || vot3Loading || vetUsdPriceLoading || b3trUsdPriceLoading || veDelegateLoading || vthoUsdPriceLoading || customTokensLoading;
|
|
3567
3567
|
const contractAddresses = {
|
|
3568
3568
|
vet: "0x",
|
|
3569
|
-
vtho:
|
|
3570
|
-
b3tr:
|
|
3571
|
-
vot3:
|
|
3572
|
-
veDelegate:
|
|
3569
|
+
vtho: chunkRUIC653T_cjs.getConfig(network.type).vthoContractAddress,
|
|
3570
|
+
b3tr: chunkRUIC653T_cjs.getConfig(network.type).b3trContractAddress,
|
|
3571
|
+
vot3: chunkRUIC653T_cjs.getConfig(network.type).vot3ContractAddress,
|
|
3572
|
+
veDelegate: chunkRUIC653T_cjs.getConfig(network.type).veDelegate
|
|
3573
3573
|
};
|
|
3574
3574
|
const balances = [
|
|
3575
3575
|
{
|
|
@@ -3695,7 +3695,7 @@ var vechain = viem.defineChain({
|
|
|
3695
3695
|
});
|
|
3696
3696
|
var vechainConnector = () => {
|
|
3697
3697
|
return rainbowKit.toPrivyWalletConnector({
|
|
3698
|
-
id:
|
|
3698
|
+
id: chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID,
|
|
3699
3699
|
name: "VeChain",
|
|
3700
3700
|
iconUrl: "https://imagedelivery.net/oHBRUd2clqykxgDWmeAyLg/661dd77c-2f9d-40e7-baa1-f4e24fd7bf00/icon",
|
|
3701
3701
|
smartWalletMode: false
|
|
@@ -3705,7 +3705,7 @@ var PrivyCrossAppProvider = ({
|
|
|
3705
3705
|
privyEcosystemAppIDS,
|
|
3706
3706
|
children
|
|
3707
3707
|
}) => {
|
|
3708
|
-
const wagmiConfigRef =
|
|
3708
|
+
const wagmiConfigRef = React10.useRef(
|
|
3709
3709
|
wagmi.createConfig({
|
|
3710
3710
|
chains: [vechain],
|
|
3711
3711
|
ssr: true,
|
|
@@ -3731,9 +3731,9 @@ var usePrivyCrossAppSdk = () => {
|
|
|
3731
3731
|
const { signMessageAsync } = wagmi.useSignMessage();
|
|
3732
3732
|
const { disconnectAsync } = wagmi.useDisconnect();
|
|
3733
3733
|
const { isConnected } = wagmi.useAccount();
|
|
3734
|
-
const [isConnecting, setIsConnecting] =
|
|
3735
|
-
const [connectionError, setConnectionError] =
|
|
3736
|
-
const logout =
|
|
3734
|
+
const [isConnecting, setIsConnecting] = React10.useState(false);
|
|
3735
|
+
const [connectionError, setConnectionError] = React10.useState(null);
|
|
3736
|
+
const logout = React10.useCallback(async () => {
|
|
3737
3737
|
try {
|
|
3738
3738
|
if (isConnected) {
|
|
3739
3739
|
await disconnectAsync();
|
|
@@ -3744,13 +3744,13 @@ var usePrivyCrossAppSdk = () => {
|
|
|
3744
3744
|
throw error;
|
|
3745
3745
|
}
|
|
3746
3746
|
}, [disconnectAsync, isConnected]);
|
|
3747
|
-
const login =
|
|
3747
|
+
const login = React10.useCallback(
|
|
3748
3748
|
async (appID) => {
|
|
3749
3749
|
try {
|
|
3750
3750
|
setIsConnecting(true);
|
|
3751
3751
|
setConnectionError(null);
|
|
3752
3752
|
const connector = connectors.find(
|
|
3753
|
-
(c) => c.id === (appID ||
|
|
3753
|
+
(c) => c.id === (appID || chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID)
|
|
3754
3754
|
);
|
|
3755
3755
|
if (!connector) {
|
|
3756
3756
|
throw new Error("Connector not found");
|
|
@@ -3766,7 +3766,7 @@ var usePrivyCrossAppSdk = () => {
|
|
|
3766
3766
|
},
|
|
3767
3767
|
[connectAsync, connectors]
|
|
3768
3768
|
);
|
|
3769
|
-
const signMessage =
|
|
3769
|
+
const signMessage = React10.useCallback(
|
|
3770
3770
|
async (message) => {
|
|
3771
3771
|
try {
|
|
3772
3772
|
return await signMessageAsync({ message });
|
|
@@ -3781,7 +3781,7 @@ var usePrivyCrossAppSdk = () => {
|
|
|
3781
3781
|
},
|
|
3782
3782
|
[signMessageAsync]
|
|
3783
3783
|
);
|
|
3784
|
-
const signTypedData =
|
|
3784
|
+
const signTypedData = React10.useCallback(
|
|
3785
3785
|
async (data) => {
|
|
3786
3786
|
try {
|
|
3787
3787
|
return await signTypedDataAsync(data);
|
|
@@ -3814,11 +3814,11 @@ var useWalletMetadata = (address, networkType) => {
|
|
|
3814
3814
|
domain?.domain
|
|
3815
3815
|
);
|
|
3816
3816
|
const { data: textRecords, isLoading: isLoadingRecords } = useGetTextRecords(domain?.domain);
|
|
3817
|
-
const avatarUrl = avatar ?
|
|
3818
|
-
const headerUrl = textRecords?.header ?
|
|
3817
|
+
const avatarUrl = avatar ? chunkRUIC653T_cjs.convertUriToUrl(avatar, networkType) : null;
|
|
3818
|
+
const headerUrl = textRecords?.header ? chunkRUIC653T_cjs.convertUriToUrl(textRecords.header, networkType) : null;
|
|
3819
3819
|
return {
|
|
3820
3820
|
domain: domain?.domain,
|
|
3821
|
-
image: avatarUrl ??
|
|
3821
|
+
image: avatarUrl ?? chunkRUIC653T_cjs.getPicassoImage(address ?? ""),
|
|
3822
3822
|
records: {
|
|
3823
3823
|
...textRecords,
|
|
3824
3824
|
header: headerUrl
|
|
@@ -3847,9 +3847,9 @@ var useWallet = () => {
|
|
|
3847
3847
|
const isConnectedWithDappKit = !!dappKitAccount;
|
|
3848
3848
|
const isConnectedWithSocialLogin = authenticated && !!user;
|
|
3849
3849
|
const isConnectedWithPrivy = isConnectedWithSocialLogin || isConnectedWithCrossApp;
|
|
3850
|
-
const isConnectedWithVeChain = isConnectedWithSocialLogin && privy?.appId ===
|
|
3850
|
+
const isConnectedWithVeChain = isConnectedWithSocialLogin && privy?.appId === chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID || isConnectedWithCrossApp && connectionCache?.ecosystemApp?.appId === chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID;
|
|
3851
3851
|
const isLoading = isConnectingWithCrossApp || isReconnectingWithCrossApp || isLoadingLoginOAuth || !ready;
|
|
3852
|
-
const [isConnected, setIsConnected] =
|
|
3852
|
+
const [isConnected, setIsConnected] = React10.useState(false);
|
|
3853
3853
|
const connectionSource = isConnectedWithCrossApp ? {
|
|
3854
3854
|
type: "privy-cross-app",
|
|
3855
3855
|
displayName: "Ecosystem"
|
|
@@ -3860,7 +3860,7 @@ var useWallet = () => {
|
|
|
3860
3860
|
type: "privy",
|
|
3861
3861
|
displayName: "Social Login"
|
|
3862
3862
|
};
|
|
3863
|
-
|
|
3863
|
+
React10.useEffect(() => {
|
|
3864
3864
|
const isNowConnected = isConnectedWithDappKit || isConnectedWithSocialLogin || isConnectedWithCrossApp;
|
|
3865
3865
|
if (isConnected !== isNowConnected) {
|
|
3866
3866
|
setIsConnected(isNowConnected);
|
|
@@ -3899,7 +3899,7 @@ var useWallet = () => {
|
|
|
3899
3899
|
const account = activeAddress ? {
|
|
3900
3900
|
address: activeAddress,
|
|
3901
3901
|
domain: activeAccountDomain?.data?.domain,
|
|
3902
|
-
image: activeAccountAvatar.data ?
|
|
3902
|
+
image: activeAccountAvatar.data ? chunkRUIC653T_cjs.convertUriToUrl(activeAccountAvatar.data, network.type) : chunkRUIC653T_cjs.getPicassoImage(activeAddress ?? ""),
|
|
3903
3903
|
isLoadingMetadata: activeAccountAvatar?.isLoading || activeAccountDomain?.isLoading || activeAccountTextRecords?.isLoading,
|
|
3904
3904
|
metadata: activeAccountTextRecords?.data
|
|
3905
3905
|
} : null;
|
|
@@ -3913,8 +3913,8 @@ var useWallet = () => {
|
|
|
3913
3913
|
const { data: smartAccountVersion } = useSmartAccountVersion(
|
|
3914
3914
|
smartAccount?.address ?? ""
|
|
3915
3915
|
);
|
|
3916
|
-
const hasActiveSmartAccount = !!smartAccount?.address && !!account?.address &&
|
|
3917
|
-
const disconnect =
|
|
3916
|
+
const hasActiveSmartAccount = !!smartAccount?.address && !!account?.address && chunkRUIC653T_cjs.compareAddresses(smartAccount?.address, account?.address);
|
|
3917
|
+
const disconnect = React10.useCallback(async () => {
|
|
3918
3918
|
try {
|
|
3919
3919
|
setIsConnected(false);
|
|
3920
3920
|
if (isConnectedWithDappKit) {
|
|
@@ -4037,17 +4037,17 @@ var useCustomTokens = () => {
|
|
|
4037
4037
|
};
|
|
4038
4038
|
const isTokenIncluded = (address) => {
|
|
4039
4039
|
return customTokens.some(
|
|
4040
|
-
(t) =>
|
|
4040
|
+
(t) => chunkRUIC653T_cjs.compareAddresses(t.address, address)
|
|
4041
4041
|
);
|
|
4042
4042
|
};
|
|
4043
4043
|
const isDefaultToken = (address) => {
|
|
4044
4044
|
const contractAddresses = {
|
|
4045
4045
|
vet: "0x",
|
|
4046
4046
|
// VET has no contract address since it's the native token
|
|
4047
|
-
vtho:
|
|
4048
|
-
b3tr:
|
|
4049
|
-
vot3:
|
|
4050
|
-
veDelegate:
|
|
4047
|
+
vtho: chunkRUIC653T_cjs.getConfig(network.type).vthoContractAddress,
|
|
4048
|
+
b3tr: chunkRUIC653T_cjs.getConfig(network.type).b3trContractAddress,
|
|
4049
|
+
vot3: chunkRUIC653T_cjs.getConfig(network.type).vot3ContractAddress,
|
|
4050
|
+
veDelegate: chunkRUIC653T_cjs.getConfig(network.type).veDelegate
|
|
4051
4051
|
};
|
|
4052
4052
|
return Object.values(contractAddresses).includes(address);
|
|
4053
4053
|
};
|
|
@@ -4142,7 +4142,7 @@ var useAccountBalance = (address) => {
|
|
|
4142
4142
|
return reactQuery.useQuery({
|
|
4143
4143
|
queryKey: getAccountBalanceQueryKey(address),
|
|
4144
4144
|
queryFn: () => getAccountBalance(thor, address),
|
|
4145
|
-
enabled: !!address &&
|
|
4145
|
+
enabled: !!address && chunkRUIC653T_cjs.isValidAddress(address),
|
|
4146
4146
|
refetchInterval: 1e4
|
|
4147
4147
|
});
|
|
4148
4148
|
};
|
|
@@ -4169,7 +4169,7 @@ var useRefreshMetadata = (domain) => {
|
|
|
4169
4169
|
// src/hooks/api/utility/useGetNodeUrl.ts
|
|
4170
4170
|
var useGetNodeUrl = () => {
|
|
4171
4171
|
const { network } = useVeChainKitConfig();
|
|
4172
|
-
return network.nodeUrl ??
|
|
4172
|
+
return network.nodeUrl ?? chunkRUIC653T_cjs.getConfig(network.type).nodeUrl;
|
|
4173
4173
|
};
|
|
4174
4174
|
|
|
4175
4175
|
// src/hooks/api/utility/useGetChainId.ts
|
|
@@ -4197,7 +4197,7 @@ var getCustomTokenBalance = async (thor, token, address) => {
|
|
|
4197
4197
|
if (res.reverted) throw new Error("Reverted");
|
|
4198
4198
|
const original = res.decoded[0];
|
|
4199
4199
|
const scaled = viem.formatEther(original);
|
|
4200
|
-
const formatted = scaled === "0" ? "0" :
|
|
4200
|
+
const formatted = scaled === "0" ? "0" : chunkRUIC653T_cjs.humanNumber(scaled);
|
|
4201
4201
|
return {
|
|
4202
4202
|
...token,
|
|
4203
4203
|
original,
|
|
@@ -4220,7 +4220,7 @@ var useGetCustomTokenBalances = (address) => {
|
|
|
4220
4220
|
};
|
|
4221
4221
|
var getNFTMetadataUri = async (networkType, thor, tokenID) => {
|
|
4222
4222
|
if (!tokenID) return Promise.reject(new Error("tokenID not provided"));
|
|
4223
|
-
const galaxyMemberContract =
|
|
4223
|
+
const galaxyMemberContract = chunkRUIC653T_cjs.getConfig(networkType).galaxyMemberContractAddress;
|
|
4224
4224
|
const functionFragment2 = chunk5GZ7N47F_cjs.GalaxyMember__factory.createInterface().getFunction("tokenURI").format("json");
|
|
4225
4225
|
const res = await thor.account(galaxyMemberContract).method(JSON.parse(functionFragment2)).call(tokenID);
|
|
4226
4226
|
if (res.vmError) return Promise.reject(new Error(res.vmError));
|
|
@@ -4284,7 +4284,7 @@ var getAccountAddress = async (thor, ownerAddress, networkType) => {
|
|
|
4284
4284
|
const functionFragment2 = SimpleAccountFactoryInterface.getFunction("getAccountAddress").format(
|
|
4285
4285
|
"json"
|
|
4286
4286
|
);
|
|
4287
|
-
const res = await thor.account(
|
|
4287
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).accountFactoryAddress).method(JSON.parse(functionFragment2)).call(ownerAddress);
|
|
4288
4288
|
if (res.reverted) throw new Error("Reverted");
|
|
4289
4289
|
return res.decoded[0];
|
|
4290
4290
|
};
|
|
@@ -4310,7 +4310,7 @@ var getUpgradeRequiredForAccount = async (thor, contractAddress, targetVersion,
|
|
|
4310
4310
|
const functionFragment2 = SimpleAccountFactoryInterface2.getFunction(
|
|
4311
4311
|
"upgradeRequiredForAccount"
|
|
4312
4312
|
).format("json");
|
|
4313
|
-
const res = await thor.account(
|
|
4313
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).accountFactoryAddress).method(JSON.parse(functionFragment2)).call(contractAddress, targetVersion);
|
|
4314
4314
|
if (res.reverted) throw new Error("Reverted");
|
|
4315
4315
|
return res.decoded[0];
|
|
4316
4316
|
};
|
|
@@ -4365,7 +4365,7 @@ var getAccountImplementationAddress = async (thor, version, networkType) => {
|
|
|
4365
4365
|
default:
|
|
4366
4366
|
throw new Error("Invalid version, must be between 1 and 3");
|
|
4367
4367
|
}
|
|
4368
|
-
const res = await thor.account(
|
|
4368
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).accountFactoryAddress).method(JSON.parse(functionFragment2)).call();
|
|
4369
4369
|
if (res.reverted) throw new Error("Reverted");
|
|
4370
4370
|
return res.decoded[0];
|
|
4371
4371
|
};
|
|
@@ -4396,7 +4396,7 @@ var getHasV1SmartAccount = async (thor, ownerAddress, networkType) => {
|
|
|
4396
4396
|
const functionFragment2 = SimpleAccountFactoryInterface4.getFunction("hasLegacyAccount").format(
|
|
4397
4397
|
"json"
|
|
4398
4398
|
);
|
|
4399
|
-
const res = await thor.account(
|
|
4399
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).accountFactoryAddress).method(JSON.parse(functionFragment2)).call(ownerAddress);
|
|
4400
4400
|
if (res.reverted) throw new Error("Reverted");
|
|
4401
4401
|
return res.decoded[0];
|
|
4402
4402
|
};
|
|
@@ -4421,7 +4421,7 @@ var getUpgradeRequired = async (thor, accountAddress, ownerAddress, targetVersio
|
|
|
4421
4421
|
const functionFragment2 = SimpleAccountFactoryInterface5.getFunction("upgradeRequired").format(
|
|
4422
4422
|
"json"
|
|
4423
4423
|
);
|
|
4424
|
-
const res = await thor.account(
|
|
4424
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).accountFactoryAddress).method(JSON.parse(functionFragment2)).call(accountAddress, ownerAddress, targetVersion);
|
|
4425
4425
|
if (res.reverted) throw new Error("Reverted");
|
|
4426
4426
|
return res.decoded[0];
|
|
4427
4427
|
};
|
|
@@ -4460,7 +4460,7 @@ var getAccountVersion = async (thor, accountAddress, ownerAddress, networkType)
|
|
|
4460
4460
|
const functionFragment2 = SimpleAccountFactoryInterface6.getFunction("getAccountVersion").format(
|
|
4461
4461
|
"json"
|
|
4462
4462
|
);
|
|
4463
|
-
const res = await thor.account(
|
|
4463
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).accountFactoryAddress).method(JSON.parse(functionFragment2)).call(accountAddress, ownerAddress);
|
|
4464
4464
|
if (res.reverted) throw new Error("Reverted");
|
|
4465
4465
|
return {
|
|
4466
4466
|
version: res.decoded[0],
|
|
@@ -4495,7 +4495,7 @@ var getCurrentAccountImplementationVersion = async (thor, networkType) => {
|
|
|
4495
4495
|
const functionFragment2 = SimpleAccountFactoryInterface7.getFunction(
|
|
4496
4496
|
"currentAccountImplementationVersion"
|
|
4497
4497
|
).format("json");
|
|
4498
|
-
const res = await thor.account(
|
|
4498
|
+
const res = await thor.account(chunkRUIC653T_cjs.getConfig(networkType).accountFactoryAddress).method(JSON.parse(functionFragment2)).call();
|
|
4499
4499
|
if (res.reverted) throw new Error("Reverted");
|
|
4500
4500
|
return parseInt(res.decoded[0]);
|
|
4501
4501
|
};
|
|
@@ -4520,8 +4520,8 @@ var getSmartAccount = async (thor, network, ownerAddress) => {
|
|
|
4520
4520
|
return { address: void 0 };
|
|
4521
4521
|
}
|
|
4522
4522
|
const account = await thor.contracts.executeCall(
|
|
4523
|
-
|
|
4524
|
-
sdkCore.ABIContract.ofAbi(
|
|
4523
|
+
chunkRUIC653T_cjs.getConfig(network).accountFactoryAddress,
|
|
4524
|
+
sdkCore.ABIContract.ofAbi(chunkFID67WC3_cjs.SimpleAccountFactoryABI).getFunction(
|
|
4525
4525
|
"getAccountAddress"
|
|
4526
4526
|
),
|
|
4527
4527
|
[ownerAddress]
|
|
@@ -4737,8 +4737,8 @@ var useUpgradeSmartAccount = ({
|
|
|
4737
4737
|
const { refresh: refreshFactoryQueries } = useRefreshFactoryQueries();
|
|
4738
4738
|
const { refresh: refreshSmartAccountQueries } = useRefreshSmartAccountQueries();
|
|
4739
4739
|
const { data: newImplementationAddress } = useAccountImplementationAddress(targetVersion);
|
|
4740
|
-
const buildClauses =
|
|
4741
|
-
if (!smartAccountAddress || !
|
|
4740
|
+
const buildClauses = React10.useCallback(async () => {
|
|
4741
|
+
if (!smartAccountAddress || !chunkRUIC653T_cjs.isValidAddress(smartAccountAddress)) {
|
|
4742
4742
|
throw new Error("Invalid smart account address");
|
|
4743
4743
|
}
|
|
4744
4744
|
if (!newImplementationAddress) {
|
|
@@ -4769,7 +4769,7 @@ var useUpgradeSmartAccount = ({
|
|
|
4769
4769
|
const result = useSendTransaction({
|
|
4770
4770
|
privyUIOptions: {
|
|
4771
4771
|
title: "Upgrade Smart Account",
|
|
4772
|
-
description: `Upgrading your account at ${
|
|
4772
|
+
description: `Upgrading your account at ${chunkRUIC653T_cjs.humanAddress(
|
|
4773
4773
|
smartAccountAddress
|
|
4774
4774
|
)} to version ${targetVersion}`,
|
|
4775
4775
|
buttonText: "Sign to continue"
|
|
@@ -4798,7 +4798,7 @@ var FadeInView = ({ children }) => {
|
|
|
4798
4798
|
);
|
|
4799
4799
|
};
|
|
4800
4800
|
var FadeInViewFromBottom = ({ children }) => {
|
|
4801
|
-
|
|
4801
|
+
React10.useEffect(() => {
|
|
4802
4802
|
const modalContent = document.querySelector(".chakra-modal__content");
|
|
4803
4803
|
if (modalContent) {
|
|
4804
4804
|
modalContent.scrollTop = 0;
|
|
@@ -4862,8 +4862,8 @@ var AddressDisplay = ({
|
|
|
4862
4862
|
style,
|
|
4863
4863
|
showHumanAddress = true
|
|
4864
4864
|
}) => {
|
|
4865
|
-
const [copied, setCopied] =
|
|
4866
|
-
const [copiedDomain, setCopiedDomain] =
|
|
4865
|
+
const [copied, setCopied] = React10.useState(false);
|
|
4866
|
+
const [copiedDomain, setCopiedDomain] = React10.useState(false);
|
|
4867
4867
|
const copyToClipboard = async (textToCopy, setCopied2) => {
|
|
4868
4868
|
await navigator.clipboard.writeText(textToCopy);
|
|
4869
4869
|
setCopied2(true);
|
|
@@ -4909,7 +4909,7 @@ var AddressDisplay = ({
|
|
|
4909
4909
|
react.Input,
|
|
4910
4910
|
{
|
|
4911
4911
|
cursor: "pointer",
|
|
4912
|
-
value: showHumanAddress ?
|
|
4912
|
+
value: showHumanAddress ? chunkRUIC653T_cjs.humanAddress(
|
|
4913
4913
|
wallet.address ?? "",
|
|
4914
4914
|
8,
|
|
4915
4915
|
7
|
|
@@ -4942,7 +4942,7 @@ var AddressDisplay = ({
|
|
|
4942
4942
|
react.Input,
|
|
4943
4943
|
{
|
|
4944
4944
|
cursor: "pointer",
|
|
4945
|
-
value: showHumanAddress ?
|
|
4945
|
+
value: showHumanAddress ? chunkRUIC653T_cjs.humanAddress(wallet?.address ?? "", 6, 4) : wallet?.address,
|
|
4946
4946
|
readOnly: true,
|
|
4947
4947
|
fontSize: "sm",
|
|
4948
4948
|
fontWeight: "700",
|
|
@@ -4971,7 +4971,7 @@ var AddressDisplay = ({
|
|
|
4971
4971
|
// package.json
|
|
4972
4972
|
var package_default = {
|
|
4973
4973
|
name: "@vechain/vechain-kit",
|
|
4974
|
-
version: "1.5.
|
|
4974
|
+
version: "1.5.2",
|
|
4975
4975
|
private: false,
|
|
4976
4976
|
homepage: "https://github.com/vechain/vechain-kit",
|
|
4977
4977
|
repository: "github:vechain/vechain-kit",
|
|
@@ -5098,16 +5098,27 @@ var VersionFooter = ({ ...props }) => {
|
|
|
5098
5098
|
spacing: 0,
|
|
5099
5099
|
...props,
|
|
5100
5100
|
children: [
|
|
5101
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5101
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5102
|
+
chunkFID67WC3_cjs.VechainLogo,
|
|
5103
|
+
{
|
|
5104
|
+
isDark,
|
|
5105
|
+
w: "70px",
|
|
5106
|
+
h: "auto",
|
|
5107
|
+
opacity: 0.4,
|
|
5108
|
+
mr: 1,
|
|
5109
|
+
ml: "-16px"
|
|
5110
|
+
}
|
|
5111
|
+
),
|
|
5102
5112
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5103
5113
|
react.Link,
|
|
5104
5114
|
{
|
|
5105
5115
|
fontSize: "11px",
|
|
5106
|
-
fontWeight: "
|
|
5116
|
+
fontWeight: "500",
|
|
5107
5117
|
opacity: 0.4,
|
|
5108
5118
|
textAlign: "left",
|
|
5109
5119
|
href: `https://github.com/vechain/vechain-kit/releases/tag/${package_default.version}`,
|
|
5110
5120
|
isExternal: true,
|
|
5121
|
+
pt: "1px",
|
|
5111
5122
|
children: [
|
|
5112
5123
|
"v",
|
|
5113
5124
|
package_default.version
|
|
@@ -5119,10 +5130,10 @@ var VersionFooter = ({ ...props }) => {
|
|
|
5119
5130
|
);
|
|
5120
5131
|
};
|
|
5121
5132
|
var StickyHeaderContainer = ({ children }) => {
|
|
5122
|
-
const [hasContentBelow, setHasContentBelow] =
|
|
5123
|
-
const observerRef =
|
|
5133
|
+
const [hasContentBelow, setHasContentBelow] = React10.useState(false);
|
|
5134
|
+
const observerRef = React10.useRef(null);
|
|
5124
5135
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
5125
|
-
|
|
5136
|
+
React10.useEffect(() => {
|
|
5126
5137
|
const observer = new IntersectionObserver(
|
|
5127
5138
|
([entry]) => {
|
|
5128
5139
|
setHasContentBelow(!entry.isIntersecting);
|
|
@@ -5143,7 +5154,7 @@ var StickyHeaderContainer = ({ children }) => {
|
|
|
5143
5154
|
left: "0",
|
|
5144
5155
|
w: "full",
|
|
5145
5156
|
borderRadius: "24px 24px 0px 0px",
|
|
5146
|
-
bg: isDark ? "
|
|
5157
|
+
bg: isDark ? "rgb(24 24 27 / 90%)" : "rgba(255, 255, 255, 0.8)",
|
|
5147
5158
|
backdropFilter: "blur(12px)",
|
|
5148
5159
|
style: { WebkitBackdropFilter: "blur(12px)" },
|
|
5149
5160
|
zIndex: 1e3,
|
|
@@ -5170,7 +5181,7 @@ var StickyFooterContainer = ({ children }) => {
|
|
|
5170
5181
|
bottom: "0",
|
|
5171
5182
|
left: "0",
|
|
5172
5183
|
right: "0",
|
|
5173
|
-
bg: isDark ? "#
|
|
5184
|
+
bg: isDark ? "#18181b" : "white",
|
|
5174
5185
|
zIndex: "1000",
|
|
5175
5186
|
p: 4,
|
|
5176
5187
|
boxShadow: "0px -1px 6px -3px rgb(0 0 0 / 56%)",
|
|
@@ -5246,56 +5257,69 @@ var AssetButton = ({
|
|
|
5246
5257
|
isDisabled,
|
|
5247
5258
|
onClick,
|
|
5248
5259
|
...buttonProps
|
|
5249
|
-
}) =>
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
{
|
|
5269
|
-
src: chunkCPG25VOQ_cjs.TOKEN_LOGOS[symbol],
|
|
5270
|
-
alt: `${symbol} logo`,
|
|
5260
|
+
}) => {
|
|
5261
|
+
const { darkMode: isDark } = useVeChainKitConfig();
|
|
5262
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5263
|
+
react.Button,
|
|
5264
|
+
{
|
|
5265
|
+
height: "72px",
|
|
5266
|
+
variant: "ghost",
|
|
5267
|
+
justifyContent: "space-between",
|
|
5268
|
+
isDisabled,
|
|
5269
|
+
p: 4,
|
|
5270
|
+
w: "100%",
|
|
5271
|
+
_disabled: {
|
|
5272
|
+
cursor: "not-allowed",
|
|
5273
|
+
opacity: 0.5
|
|
5274
|
+
},
|
|
5275
|
+
onClick,
|
|
5276
|
+
...buttonProps,
|
|
5277
|
+
children: [
|
|
5278
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { children: [
|
|
5279
|
+
chunkRUIC653T_cjs.TOKEN_LOGO_COMPONENTS[symbol] ? React10__default.default.cloneElement(chunkRUIC653T_cjs.TOKEN_LOGO_COMPONENTS[symbol], {
|
|
5271
5280
|
boxSize: "24px",
|
|
5272
|
-
borderRadius: "full"
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5281
|
+
borderRadius: "full"
|
|
5282
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5283
|
+
react.Image,
|
|
5284
|
+
{
|
|
5285
|
+
src: chunkRUIC653T_cjs.TOKEN_LOGOS[symbol],
|
|
5286
|
+
alt: `${symbol} logo`,
|
|
5287
|
+
boxSize: "24px",
|
|
5288
|
+
borderRadius: "full",
|
|
5289
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5290
|
+
react.Box,
|
|
5291
|
+
{
|
|
5292
|
+
boxSize: "24px",
|
|
5293
|
+
borderRadius: "full",
|
|
5294
|
+
bg: "whiteAlpha.200",
|
|
5295
|
+
display: "flex",
|
|
5296
|
+
alignItems: "center",
|
|
5297
|
+
justifyContent: "center",
|
|
5298
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "10px", fontWeight: "bold", children: symbol.slice(0, 3) })
|
|
5299
|
+
}
|
|
5300
|
+
)
|
|
5301
|
+
}
|
|
5302
|
+
),
|
|
5303
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { children: symbol })
|
|
5293
5304
|
] }),
|
|
5294
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
)
|
|
5305
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { align: "flex-end", spacing: 0, children: [
|
|
5306
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Text, { children: [
|
|
5307
|
+
"$",
|
|
5308
|
+
compactFormatter.format(usdValue)
|
|
5309
|
+
] }),
|
|
5310
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5311
|
+
react.Text,
|
|
5312
|
+
{
|
|
5313
|
+
fontSize: "sm",
|
|
5314
|
+
color: isDark ? "whiteAlpha.600" : "blackAlpha.600",
|
|
5315
|
+
children: compactFormatter.format(amount)
|
|
5316
|
+
}
|
|
5317
|
+
)
|
|
5318
|
+
] })
|
|
5319
|
+
]
|
|
5320
|
+
}
|
|
5321
|
+
);
|
|
5322
|
+
};
|
|
5299
5323
|
var compactFormatter2 = new Intl.NumberFormat("en-US", {
|
|
5300
5324
|
notation: "compact",
|
|
5301
5325
|
compactDisplay: "short",
|
|
@@ -5325,7 +5349,7 @@ var AddressDisplayCard = ({
|
|
|
5325
5349
|
w: "full",
|
|
5326
5350
|
p: 2,
|
|
5327
5351
|
borderRadius: "lg",
|
|
5328
|
-
bg: isDark ? "#
|
|
5352
|
+
bg: isDark ? "#00000038" : "gray.50",
|
|
5329
5353
|
wordBreak: "break-word",
|
|
5330
5354
|
children: [
|
|
5331
5355
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", fontWeight: "bold", mb: 2, children: label }),
|
|
@@ -5343,8 +5367,8 @@ var AddressDisplayCard = ({
|
|
|
5343
5367
|
),
|
|
5344
5368
|
/* @__PURE__ */ jsxRuntime.jsx(react.VStack, { align: "start", spacing: 0, children: domain ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5345
5369
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: "medium", fontSize: "sm", children: domain }),
|
|
5346
|
-
!hideAddress && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "xs", opacity: 0.5, children:
|
|
5347
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: "medium", fontSize: "sm", children:
|
|
5370
|
+
!hideAddress && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "xs", opacity: 0.5, children: chunkRUIC653T_cjs.humanAddress(address, 6, 4) })
|
|
5371
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: "medium", fontSize: "sm", children: chunkRUIC653T_cjs.humanAddress(address, 6, 4) }) })
|
|
5348
5372
|
] }),
|
|
5349
5373
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5350
5374
|
react.VStack,
|
|
@@ -5385,7 +5409,7 @@ var ModalFAQButton = ({ onClick, ...props }) => {
|
|
|
5385
5409
|
);
|
|
5386
5410
|
};
|
|
5387
5411
|
var useScrollToTop = () => {
|
|
5388
|
-
|
|
5412
|
+
React10.useEffect(() => {
|
|
5389
5413
|
const modalContent = document.querySelector(".chakra-modal__content");
|
|
5390
5414
|
if (modalContent) {
|
|
5391
5415
|
modalContent.scrollTop = 0;
|
|
@@ -5400,7 +5424,7 @@ var AccountAvatar = ({ wallet, props }) => {
|
|
|
5400
5424
|
if (wallet?.isLoadingMetadata) {
|
|
5401
5425
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Spinner, { size: "sm" });
|
|
5402
5426
|
}
|
|
5403
|
-
const fallbackImage = wallet?.address ?
|
|
5427
|
+
const fallbackImage = wallet?.address ? chunkRUIC653T_cjs.getPicassoImage(wallet.address) : void 0;
|
|
5404
5428
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5405
5429
|
react.Image,
|
|
5406
5430
|
{
|
|
@@ -5427,7 +5451,7 @@ var TransactionButtonAndStatus = ({
|
|
|
5427
5451
|
const { t } = reactI18next.useTranslation();
|
|
5428
5452
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
5429
5453
|
const { network } = useVeChainKitConfig();
|
|
5430
|
-
const errorMessage =
|
|
5454
|
+
const errorMessage = React10.useMemo(() => {
|
|
5431
5455
|
if (!transactionError) return null;
|
|
5432
5456
|
return transactionError.reason || t("Something went wrong. Please try again.");
|
|
5433
5457
|
}, [transactionError, t]);
|
|
@@ -5451,10 +5475,10 @@ var TransactionButtonAndStatus = ({
|
|
|
5451
5475
|
{
|
|
5452
5476
|
isExternal: true,
|
|
5453
5477
|
fontSize: "sm",
|
|
5454
|
-
color: isDark ? "whiteAlpha.600" : "
|
|
5478
|
+
color: isDark ? "whiteAlpha.600" : "blackAlpha.600",
|
|
5455
5479
|
textAlign: "center",
|
|
5456
5480
|
width: "full",
|
|
5457
|
-
href: `${
|
|
5481
|
+
href: `${chunkRUIC653T_cjs.getConfig(network.type).explorerUrl}/${txReceipt?.meta.txID}`,
|
|
5458
5482
|
target: "_blank",
|
|
5459
5483
|
rel: "noopener noreferrer",
|
|
5460
5484
|
children: t("View transaction on the explorer")
|
|
@@ -5471,10 +5495,10 @@ var EmailCodeVerificationModal = ({
|
|
|
5471
5495
|
}) => {
|
|
5472
5496
|
const { t } = reactI18next.useTranslation();
|
|
5473
5497
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
5474
|
-
const [code, setCode] =
|
|
5475
|
-
const [error, setError] =
|
|
5498
|
+
const [code, setCode] = React10.useState("");
|
|
5499
|
+
const [error, setError] = React10.useState(null);
|
|
5476
5500
|
const { loginWithCode } = reactAuth.useLoginWithEmail({});
|
|
5477
|
-
|
|
5501
|
+
React10.useEffect(() => {
|
|
5478
5502
|
if (code.length === 6) {
|
|
5479
5503
|
loginWithCode({ code }).then(() => {
|
|
5480
5504
|
onClose();
|
|
@@ -5521,7 +5545,7 @@ var EmailCodeVerificationModal = ({
|
|
|
5521
5545
|
otp: true,
|
|
5522
5546
|
size: "lg",
|
|
5523
5547
|
isInvalid: !!error,
|
|
5524
|
-
errorBorderColor: "
|
|
5548
|
+
errorBorderColor: "#ef4444",
|
|
5525
5549
|
children: [
|
|
5526
5550
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5527
5551
|
react.PinInputField,
|
|
@@ -5616,7 +5640,7 @@ var EmailCodeVerificationModal = ({
|
|
|
5616
5640
|
]
|
|
5617
5641
|
}
|
|
5618
5642
|
) }),
|
|
5619
|
-
error && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "
|
|
5643
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "#ef4444", fontSize: "xs", children: error })
|
|
5620
5644
|
] }) }),
|
|
5621
5645
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalFooter, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5622
5646
|
react.Text,
|
|
@@ -5648,7 +5672,7 @@ var EmailCodeVerificationModal = ({
|
|
|
5648
5672
|
var EmailLoginButton = () => {
|
|
5649
5673
|
const { t } = reactI18next.useTranslation();
|
|
5650
5674
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
5651
|
-
const [email, setEmail] =
|
|
5675
|
+
const [email, setEmail] = React10.useState("");
|
|
5652
5676
|
const { sendCode, state: emailState } = reactAuth.useLoginWithEmail({});
|
|
5653
5677
|
const emailCodeVerificationModal = react.useDisclosure();
|
|
5654
5678
|
const handleSendCode = async () => {
|
|
@@ -5745,7 +5769,7 @@ var VeChainWithPrivyLoginButton = ({ isDark, gridColumn }) => {
|
|
|
5745
5769
|
{
|
|
5746
5770
|
isDark,
|
|
5747
5771
|
onClick: viewMoreLogin,
|
|
5748
|
-
icon: isDark ?
|
|
5772
|
+
icon: isDark ? chunkFID67WC3_cjs.VechainLogoLight : chunkFID67WC3_cjs.VechainLogoDark,
|
|
5749
5773
|
text: t("Use social login with VeChain"),
|
|
5750
5774
|
variant: "loginWithVechain",
|
|
5751
5775
|
rightIcon: /* @__PURE__ */ jsxRuntime.jsx(SocialIcons, {})
|
|
@@ -5755,7 +5779,7 @@ var VeChainWithPrivyLoginButton = ({ isDark, gridColumn }) => {
|
|
|
5755
5779
|
var VeChainLoginButton = ({ isDark, gridColumn }) => {
|
|
5756
5780
|
const { t } = reactI18next.useTranslation();
|
|
5757
5781
|
const { login: loginWithVeChain } = useLoginWithVeChain();
|
|
5758
|
-
const [loginError, setLoginError] =
|
|
5782
|
+
const [loginError, setLoginError] = React10.useState();
|
|
5759
5783
|
const loginLoadingModal = react.useDisclosure();
|
|
5760
5784
|
const handleLoginWithVeChain = async () => {
|
|
5761
5785
|
loginLoadingModal.onOpen();
|
|
@@ -5776,7 +5800,7 @@ var VeChainLoginButton = ({ isDark, gridColumn }) => {
|
|
|
5776
5800
|
{
|
|
5777
5801
|
isDark,
|
|
5778
5802
|
onClick: handleLoginWithVeChain,
|
|
5779
|
-
icon: isDark ?
|
|
5803
|
+
icon: isDark ? chunkFID67WC3_cjs.VechainLogoLight : chunkFID67WC3_cjs.VechainLogoDark,
|
|
5780
5804
|
text: t("Use social login with VeChain"),
|
|
5781
5805
|
variant: "loginWithVechain",
|
|
5782
5806
|
rightIcon: /* @__PURE__ */ jsxRuntime.jsx(SocialIcons, {})
|
|
@@ -5802,7 +5826,7 @@ var VeChainLoginButton = ({ isDark, gridColumn }) => {
|
|
|
5802
5826
|
var PasskeyLoginButton = ({ isDark, gridColumn }) => {
|
|
5803
5827
|
const { t } = reactI18next.useTranslation();
|
|
5804
5828
|
const { loginWithPasskey } = useLoginWithPasskey();
|
|
5805
|
-
const [loginError, setLoginError] =
|
|
5829
|
+
const [loginError, setLoginError] = React10.useState();
|
|
5806
5830
|
const loginLoadingModal = react.useDisclosure();
|
|
5807
5831
|
const handleLoginWithPasskey = async () => {
|
|
5808
5832
|
loginLoadingModal.onOpen();
|
|
@@ -5995,7 +6019,7 @@ var MainContent = ({ setCurrentContent, onClose }) => {
|
|
|
5995
6019
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
5996
6020
|
const { connection } = useWallet();
|
|
5997
6021
|
const { loginModalUI } = useVeChainKitConfig();
|
|
5998
|
-
|
|
6022
|
+
React10.useEffect(() => {
|
|
5999
6023
|
if (connection.isConnected) {
|
|
6000
6024
|
onClose();
|
|
6001
6025
|
}
|
|
@@ -6038,13 +6062,13 @@ var MainContent = ({ setCurrentContent, onClose }) => {
|
|
|
6038
6062
|
),
|
|
6039
6063
|
/* @__PURE__ */ jsxRuntime.jsx(ConnectionOptionsStack, {})
|
|
6040
6064
|
] }),
|
|
6041
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.ModalFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(VersionFooter, {}) })
|
|
6065
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.ModalFooter, { pt: 0, pb: "5px", children: /* @__PURE__ */ jsxRuntime.jsx(VersionFooter, {}) })
|
|
6042
6066
|
] });
|
|
6043
6067
|
};
|
|
6044
6068
|
var useFeatureAnnouncement = () => {
|
|
6045
|
-
const [isVisible, setIsVisible] =
|
|
6069
|
+
const [isVisible, setIsVisible] = React10.useState(true);
|
|
6046
6070
|
const CACHE_KEY = "vechain_kit_feature_announcement_closed";
|
|
6047
|
-
|
|
6071
|
+
React10.useEffect(() => {
|
|
6048
6072
|
const isClosed = localStorage.getItem(CACHE_KEY);
|
|
6049
6073
|
if (isClosed) {
|
|
6050
6074
|
setIsVisible(false);
|
|
@@ -6267,7 +6291,7 @@ var AccountDetailsButton = ({
|
|
|
6267
6291
|
wordBreak: "break-word",
|
|
6268
6292
|
whiteSpace: "normal",
|
|
6269
6293
|
w: "full",
|
|
6270
|
-
children: wallet?.domain ?
|
|
6294
|
+
children: wallet?.domain ? chunkRUIC653T_cjs.humanDomain(wallet?.domain, 4, 11) : chunkRUIC653T_cjs.humanAddress(wallet?.address ?? "", 6, 4)
|
|
6271
6295
|
}
|
|
6272
6296
|
)
|
|
6273
6297
|
] }),
|
|
@@ -6298,7 +6322,7 @@ var ActionButton = ({
|
|
|
6298
6322
|
}) => {
|
|
6299
6323
|
const { t } = reactI18next.useTranslation();
|
|
6300
6324
|
const { colorMode } = react.useColorMode();
|
|
6301
|
-
const baseBackgroundColor = backgroundColor ?? colorMode === "dark" ? "
|
|
6325
|
+
const baseBackgroundColor = backgroundColor ?? colorMode === "dark" ? "#ffffff05" : "#00000005";
|
|
6302
6326
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6303
6327
|
react.Button,
|
|
6304
6328
|
{
|
|
@@ -6312,7 +6336,9 @@ var ActionButton = ({
|
|
|
6312
6336
|
isLoading,
|
|
6313
6337
|
loadingText,
|
|
6314
6338
|
bgColor: baseBackgroundColor,
|
|
6315
|
-
_hover
|
|
6339
|
+
_hover: _hover ?? {
|
|
6340
|
+
backgroundColor: colorMode === "dark" ? "#ffffff0d" : "blackAlpha.200"
|
|
6341
|
+
},
|
|
6316
6342
|
...style,
|
|
6317
6343
|
children: /* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { w: "full", justify: "space-between", children: [
|
|
6318
6344
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { minW: "40px", children: leftImage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6354,7 +6380,7 @@ var AccountSelector = ({
|
|
|
6354
6380
|
mt,
|
|
6355
6381
|
style
|
|
6356
6382
|
}) => {
|
|
6357
|
-
const [copied, setCopied] =
|
|
6383
|
+
const [copied, setCopied] = React10.useState(false);
|
|
6358
6384
|
const copyToClipboard = async () => {
|
|
6359
6385
|
await navigator.clipboard.writeText(
|
|
6360
6386
|
wallet?.domain ?? wallet?.address ?? ""
|
|
@@ -6397,7 +6423,7 @@ var AccountSelector = ({
|
|
|
6397
6423
|
props: { width: 7, height: 7 }
|
|
6398
6424
|
}
|
|
6399
6425
|
),
|
|
6400
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: size, fontWeight: "500", children:
|
|
6426
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: size, fontWeight: "500", children: chunkRUIC653T_cjs.humanDomain(wallet?.domain ?? "", 15, 0) || chunkRUIC653T_cjs.humanAddress(wallet?.address ?? "", 6, 4) })
|
|
6401
6427
|
] }),
|
|
6402
6428
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6403
6429
|
react.Icon,
|
|
@@ -6462,10 +6488,17 @@ var AssetIcons = ({
|
|
|
6462
6488
|
border: "2px solid #00000024",
|
|
6463
6489
|
alignItems: "center",
|
|
6464
6490
|
justifyContent: "center",
|
|
6465
|
-
children:
|
|
6491
|
+
children: chunkRUIC653T_cjs.TOKEN_LOGO_COMPONENTS[token.symbol] ? React10__default.default.cloneElement(
|
|
6492
|
+
chunkRUIC653T_cjs.TOKEN_LOGO_COMPONENTS[token.symbol],
|
|
6493
|
+
{
|
|
6494
|
+
width: `${iconSize * 0.8}px`,
|
|
6495
|
+
height: `${iconSize * 0.8}px`,
|
|
6496
|
+
rounded: "full"
|
|
6497
|
+
}
|
|
6498
|
+
) : chunkRUIC653T_cjs.TOKEN_LOGOS[token.symbol] ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6466
6499
|
react.Image,
|
|
6467
6500
|
{
|
|
6468
|
-
src:
|
|
6501
|
+
src: chunkRUIC653T_cjs.TOKEN_LOGOS[token.symbol],
|
|
6469
6502
|
alt: `${token.symbol} logo`,
|
|
6470
6503
|
width: `${iconSize * 0.8}px`,
|
|
6471
6504
|
height: `${iconSize * 0.8}px`,
|
|
@@ -6540,7 +6573,7 @@ var BalanceSection = ({
|
|
|
6540
6573
|
address: account?.address ?? ""
|
|
6541
6574
|
});
|
|
6542
6575
|
const { refresh } = useRefreshBalances();
|
|
6543
|
-
const [isRefreshing, setIsRefreshing] =
|
|
6576
|
+
const [isRefreshing, setIsRefreshing] = React10.useState(false);
|
|
6544
6577
|
const handleRefresh = async () => {
|
|
6545
6578
|
setIsRefreshing(true);
|
|
6546
6579
|
await refresh();
|
|
@@ -6601,7 +6634,7 @@ var BalanceSection = ({
|
|
|
6601
6634
|
onClick: onAssetsClick,
|
|
6602
6635
|
maxIcons: 10,
|
|
6603
6636
|
iconSize: 26,
|
|
6604
|
-
iconsGap:
|
|
6637
|
+
iconsGap: 3,
|
|
6605
6638
|
address: account?.address ?? "",
|
|
6606
6639
|
showNoAssetsWarning: true,
|
|
6607
6640
|
rightIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6616,12 +6649,12 @@ var BalanceSection = ({
|
|
|
6616
6649
|
style: {
|
|
6617
6650
|
width: "100%",
|
|
6618
6651
|
mt: 2,
|
|
6619
|
-
backgroundColor: isDark ? "
|
|
6652
|
+
backgroundColor: isDark ? "#ffffff05" : "blackAlpha.50",
|
|
6620
6653
|
borderRadius: "xl",
|
|
6621
6654
|
p: 3,
|
|
6622
6655
|
cursor: "pointer",
|
|
6623
6656
|
_hover: {
|
|
6624
|
-
backgroundColor: isDark ? "
|
|
6657
|
+
backgroundColor: isDark ? "#ffffff0d" : "blackAlpha.200"
|
|
6625
6658
|
},
|
|
6626
6659
|
justifyContent: "space-between"
|
|
6627
6660
|
}
|
|
@@ -6690,7 +6723,7 @@ var AssetsSection = ({ mt, setCurrentContent }) => {
|
|
|
6690
6723
|
const tabBgColor = react.useColorModeValue("white", "#1f1f1e");
|
|
6691
6724
|
const tabBorderColor = react.useColorModeValue("#ebebeb", "#2d2d2d");
|
|
6692
6725
|
const tabTextColor = react.useColorModeValue("#4d4d4d", "#dfdfdd");
|
|
6693
|
-
const tabPanelsRef =
|
|
6726
|
+
const tabPanelsRef = React10.useRef(null);
|
|
6694
6727
|
const scrollToContent = () => {
|
|
6695
6728
|
setTimeout(() => {
|
|
6696
6729
|
if (tabPanelsRef.current) {
|
|
@@ -6967,7 +7000,7 @@ var useNotificationAlerts = () => {
|
|
|
6967
7000
|
3
|
|
6968
7001
|
// Target version
|
|
6969
7002
|
);
|
|
6970
|
-
|
|
7003
|
+
React10.useEffect(() => {
|
|
6971
7004
|
if (!connection.isConnectedWithPrivy || !account?.address) return;
|
|
6972
7005
|
const notifications = getNotifications();
|
|
6973
7006
|
const upgradeNotificationId = `smart_account_upgrade_${account.address.toLowerCase()}`;
|
|
@@ -6985,7 +7018,7 @@ var useNotificationAlerts = () => {
|
|
|
6985
7018
|
});
|
|
6986
7019
|
}
|
|
6987
7020
|
}, [connection.isConnectedWithPrivy, account?.address, upgradeRequired]);
|
|
6988
|
-
|
|
7021
|
+
React10.useEffect(() => {
|
|
6989
7022
|
if (!connection.isConnectedWithPrivy || !account?.address) return;
|
|
6990
7023
|
const notifications = getNotifications();
|
|
6991
7024
|
const hasSmartAccountNotification = notifications.some(
|
|
@@ -7002,7 +7035,7 @@ var useNotificationAlerts = () => {
|
|
|
7002
7035
|
});
|
|
7003
7036
|
}
|
|
7004
7037
|
}, [connection.isConnectedWithPrivy, account?.address]);
|
|
7005
|
-
|
|
7038
|
+
React10.useEffect(() => {
|
|
7006
7039
|
if (!connection.isConnectedWithPrivy || !account?.address) return;
|
|
7007
7040
|
const notifications = getNotifications();
|
|
7008
7041
|
const hasMulticlauseWarning = notifications.some(
|
|
@@ -7027,7 +7060,7 @@ var useNotificationAlerts = () => {
|
|
|
7027
7060
|
// src/hooks/notifications/useNotifications.ts
|
|
7028
7061
|
var useNotifications = () => {
|
|
7029
7062
|
const { account } = useWallet();
|
|
7030
|
-
const getStorageKeys =
|
|
7063
|
+
const getStorageKeys = React10.useCallback((address) => {
|
|
7031
7064
|
const normalizedAddress = address?.toLowerCase();
|
|
7032
7065
|
return {
|
|
7033
7066
|
notifications: `vechain_kit_notifications_${normalizedAddress}`,
|
|
@@ -7035,7 +7068,7 @@ var useNotifications = () => {
|
|
|
7035
7068
|
initialized: `vechain_kit_notifications_initialized_${normalizedAddress}`
|
|
7036
7069
|
};
|
|
7037
7070
|
}, []);
|
|
7038
|
-
const initializeNotifications =
|
|
7071
|
+
const initializeNotifications = React10.useCallback(() => {
|
|
7039
7072
|
if (!account?.address) return;
|
|
7040
7073
|
const keys = getStorageKeys(account.address);
|
|
7041
7074
|
const isInitialized = localStorage.getItem(keys.initialized);
|
|
@@ -7047,24 +7080,24 @@ var useNotifications = () => {
|
|
|
7047
7080
|
localStorage.setItem(keys.initialized, "true");
|
|
7048
7081
|
}
|
|
7049
7082
|
}, [account?.address, getStorageKeys]);
|
|
7050
|
-
|
|
7083
|
+
React10.useEffect(() => {
|
|
7051
7084
|
initializeNotifications();
|
|
7052
7085
|
}, [initializeNotifications]);
|
|
7053
|
-
const getNotifications =
|
|
7086
|
+
const getNotifications = React10.useCallback(() => {
|
|
7054
7087
|
if (!account?.address) return [];
|
|
7055
7088
|
const keys = getStorageKeys(account.address);
|
|
7056
7089
|
const cached = localStorage.getItem(keys.notifications);
|
|
7057
7090
|
if (!cached) return [];
|
|
7058
7091
|
return JSON.parse(cached);
|
|
7059
7092
|
}, [account?.address, getStorageKeys]);
|
|
7060
|
-
const getArchivedNotifications =
|
|
7093
|
+
const getArchivedNotifications = React10.useCallback(() => {
|
|
7061
7094
|
if (!account?.address) return [];
|
|
7062
7095
|
const keys = getStorageKeys(account.address);
|
|
7063
7096
|
const cached = localStorage.getItem(keys.archived);
|
|
7064
7097
|
if (!cached) return [];
|
|
7065
7098
|
return JSON.parse(cached);
|
|
7066
7099
|
}, [account?.address, getStorageKeys]);
|
|
7067
|
-
const addNotification =
|
|
7100
|
+
const addNotification = React10.useCallback(
|
|
7068
7101
|
(notification) => {
|
|
7069
7102
|
if (!account?.address) return;
|
|
7070
7103
|
const keys = getStorageKeys(account.address);
|
|
@@ -7090,7 +7123,7 @@ var useNotifications = () => {
|
|
|
7090
7123
|
},
|
|
7091
7124
|
[account?.address, getNotifications, getStorageKeys]
|
|
7092
7125
|
);
|
|
7093
|
-
const deleteNotification =
|
|
7126
|
+
const deleteNotification = React10.useCallback(
|
|
7094
7127
|
(notificationId) => {
|
|
7095
7128
|
if (!account?.address) return;
|
|
7096
7129
|
const keys = getStorageKeys(account.address);
|
|
@@ -7105,7 +7138,7 @@ var useNotifications = () => {
|
|
|
7105
7138
|
},
|
|
7106
7139
|
[account?.address, getNotifications, getStorageKeys]
|
|
7107
7140
|
);
|
|
7108
|
-
const clearAllNotifications =
|
|
7141
|
+
const clearAllNotifications = React10.useCallback(() => {
|
|
7109
7142
|
if (!account?.address) return;
|
|
7110
7143
|
const keys = getStorageKeys(account.address);
|
|
7111
7144
|
const notifications = getNotifications();
|
|
@@ -7120,7 +7153,7 @@ var useNotifications = () => {
|
|
|
7120
7153
|
getArchivedNotifications,
|
|
7121
7154
|
getStorageKeys
|
|
7122
7155
|
]);
|
|
7123
|
-
const markAsRead =
|
|
7156
|
+
const markAsRead = React10.useCallback(
|
|
7124
7157
|
(notificationId) => {
|
|
7125
7158
|
if (!account?.address) return;
|
|
7126
7159
|
const keys = getStorageKeys(account.address);
|
|
@@ -7167,7 +7200,7 @@ var SettingsContent = ({
|
|
|
7167
7200
|
setCurrentContent,
|
|
7168
7201
|
onLogoutSuccess
|
|
7169
7202
|
}) => {
|
|
7170
|
-
const contentRef =
|
|
7203
|
+
const contentRef = React10.useRef(null);
|
|
7171
7204
|
const { t } = reactI18next.useTranslation();
|
|
7172
7205
|
const { privy } = useVeChainKitConfig();
|
|
7173
7206
|
const { connection, disconnect, account } = useWallet();
|
|
@@ -7177,7 +7210,7 @@ var SettingsContent = ({
|
|
|
7177
7210
|
const { getNotifications } = useNotifications();
|
|
7178
7211
|
const notifications = getNotifications();
|
|
7179
7212
|
const hasUnreadNotifications = notifications.some((n) => !n.isRead);
|
|
7180
|
-
|
|
7213
|
+
React10.useEffect(() => {
|
|
7181
7214
|
if (contentRef.current) {
|
|
7182
7215
|
contentRef.current.scrollTop = 0;
|
|
7183
7216
|
}
|
|
@@ -7388,7 +7421,7 @@ var NetworkInfo = () => {
|
|
|
7388
7421
|
InfoRow,
|
|
7389
7422
|
{
|
|
7390
7423
|
label: t("Node URL"),
|
|
7391
|
-
value: network.nodeUrl ||
|
|
7424
|
+
value: network.nodeUrl || chunkRUIC653T_cjs.getConfig(network.type).nodeUrl
|
|
7392
7425
|
}
|
|
7393
7426
|
),
|
|
7394
7427
|
connection.isConnectedWithPrivy ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -7433,7 +7466,7 @@ var CrossAppConnectionCard = ({ connectionCache }) => {
|
|
|
7433
7466
|
react.VStack,
|
|
7434
7467
|
{
|
|
7435
7468
|
p: 4,
|
|
7436
|
-
bg: isDark ? "#
|
|
7469
|
+
bg: isDark ? "#00000038" : "#f5f5f5",
|
|
7437
7470
|
borderRadius: "xl",
|
|
7438
7471
|
spacing: 4,
|
|
7439
7472
|
w: "full",
|
|
@@ -7495,7 +7528,7 @@ var DappKitConnectionCard = () => {
|
|
|
7495
7528
|
react.VStack,
|
|
7496
7529
|
{
|
|
7497
7530
|
p: 4,
|
|
7498
|
-
bg: isDark ? "#
|
|
7531
|
+
bg: isDark ? "#00000038" : "#f5f5f5",
|
|
7499
7532
|
borderRadius: "xl",
|
|
7500
7533
|
spacing: 4,
|
|
7501
7534
|
w: "full",
|
|
@@ -7537,7 +7570,7 @@ var PrivyConnectionCard = () => {
|
|
|
7537
7570
|
react.VStack,
|
|
7538
7571
|
{
|
|
7539
7572
|
p: 4,
|
|
7540
|
-
bg: isDark ? "#
|
|
7573
|
+
bg: isDark ? "#00000038" : "#f5f5f5",
|
|
7541
7574
|
borderRadius: "xl",
|
|
7542
7575
|
spacing: 4,
|
|
7543
7576
|
w: "full",
|
|
@@ -7589,9 +7622,17 @@ var WalletSecuredBy = () => {
|
|
|
7589
7622
|
children: [
|
|
7590
7623
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "xs", fontWeight: "800", children: t("Wallet secured by") }),
|
|
7591
7624
|
/* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { justify: "center", children: [
|
|
7592
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7593
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Icon, { as: pi.PiLineVertical, ml:
|
|
7594
|
-
connection.isConnectedWithVeChain ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7625
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkFID67WC3_cjs.PrivyLogo, { isDark, w: "50px" }),
|
|
7626
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Icon, { as: pi.PiLineVertical, ml: 3 }),
|
|
7627
|
+
connection.isConnectedWithVeChain ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7628
|
+
chunkFID67WC3_cjs.VechainLogo,
|
|
7629
|
+
{
|
|
7630
|
+
isDark,
|
|
7631
|
+
w: "80px",
|
|
7632
|
+
h: "auto",
|
|
7633
|
+
mb: "3px"
|
|
7634
|
+
}
|
|
7635
|
+
) : connection.isConnectedWithCrossApp && connectionCache && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7595
7636
|
react.Image,
|
|
7596
7637
|
{
|
|
7597
7638
|
src: connectionCache.ecosystemApp.logoUrl,
|
|
@@ -7617,7 +7658,7 @@ var WalletSecuredBy = () => {
|
|
|
7617
7658
|
var EmbeddedWalletContent = ({ setCurrentContent }) => {
|
|
7618
7659
|
const { t } = reactI18next.useTranslation();
|
|
7619
7660
|
const { connectedWallet, connection } = useWallet();
|
|
7620
|
-
const walletImage =
|
|
7661
|
+
const walletImage = chunkRUIC653T_cjs.getPicassoImage(connectedWallet?.address ?? "");
|
|
7621
7662
|
const { getConnectionCache } = useCrossAppConnectionCache();
|
|
7622
7663
|
const connectionCache = getConnectionCache();
|
|
7623
7664
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScrollToTopWrapper, { children: [
|
|
@@ -7687,7 +7728,7 @@ var EmbeddedWalletContent = ({ setCurrentContent }) => {
|
|
|
7687
7728
|
{
|
|
7688
7729
|
href: "https://www.veworld.net/",
|
|
7689
7730
|
isExternal: true,
|
|
7690
|
-
color: "
|
|
7731
|
+
color: "blackAlpha.600",
|
|
7691
7732
|
fontSize: "14px",
|
|
7692
7733
|
textDecoration: "underline",
|
|
7693
7734
|
children: [
|
|
@@ -7707,7 +7748,7 @@ var EmbeddedWalletContent = ({ setCurrentContent }) => {
|
|
|
7707
7748
|
{
|
|
7708
7749
|
href: "https://docs.vechainkit.vechain.org/vechain-kit/embedded-wallets",
|
|
7709
7750
|
isExternal: true,
|
|
7710
|
-
color: "
|
|
7751
|
+
color: "blackAlpha.600",
|
|
7711
7752
|
fontSize: "14px",
|
|
7712
7753
|
textDecoration: "underline",
|
|
7713
7754
|
children: t("here")
|
|
@@ -7731,7 +7772,7 @@ var SelectTokenContent = ({ onSelectToken, onBack }) => {
|
|
|
7731
7772
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
7732
7773
|
const { account } = useWallet();
|
|
7733
7774
|
const { tokens } = useBalances({ address: account?.address ?? "" });
|
|
7734
|
-
const [searchQuery, setSearchQuery] =
|
|
7775
|
+
const [searchQuery, setSearchQuery] = React10.useState("");
|
|
7735
7776
|
const allTokens = [
|
|
7736
7777
|
...Object.entries(tokens).map(([symbol, data]) => ({
|
|
7737
7778
|
symbol,
|
|
@@ -7761,7 +7802,7 @@ var SelectTokenContent = ({ onSelectToken, onBack }) => {
|
|
|
7761
7802
|
react.Input,
|
|
7762
7803
|
{
|
|
7763
7804
|
placeholder: "Search token",
|
|
7764
|
-
bg: isDark ? "#
|
|
7805
|
+
bg: isDark ? "#00000038" : "gray.50",
|
|
7765
7806
|
borderRadius: "xl",
|
|
7766
7807
|
height: "56px",
|
|
7767
7808
|
pl: 12,
|
|
@@ -7791,7 +7832,7 @@ var SelectTokenContent = ({ onSelectToken, onBack }) => {
|
|
|
7791
7832
|
{
|
|
7792
7833
|
spacing: 2,
|
|
7793
7834
|
py: 8,
|
|
7794
|
-
color: isDark ? "whiteAlpha.600" : "
|
|
7835
|
+
color: isDark ? "whiteAlpha.600" : "blackAlpha.600",
|
|
7795
7836
|
children: [
|
|
7796
7837
|
/* @__PURE__ */ jsxRuntime.jsx(react.Icon, { as: fi.FiSlash, boxSize: 12, opacity: 0.5 }),
|
|
7797
7838
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "lg", children: t("No tokens found") }),
|
|
@@ -7830,13 +7871,13 @@ var SendTokenContent = ({
|
|
|
7830
7871
|
}) => {
|
|
7831
7872
|
const { t } = reactI18next.useTranslation();
|
|
7832
7873
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
7833
|
-
const [selectedToken, setSelectedToken] =
|
|
7874
|
+
const [selectedToken, setSelectedToken] = React10.useState(
|
|
7834
7875
|
preselectedToken ?? null
|
|
7835
7876
|
);
|
|
7836
|
-
const [isSelectingToken, setIsSelectingToken] =
|
|
7877
|
+
const [isSelectingToken, setIsSelectingToken] = React10.useState(
|
|
7837
7878
|
isNavigatingFromMain && !preselectedToken
|
|
7838
7879
|
);
|
|
7839
|
-
const [isInitialTokenSelection, setIsInitialTokenSelection] =
|
|
7880
|
+
const [isInitialTokenSelection, setIsInitialTokenSelection] = React10.useState(isNavigatingFromMain);
|
|
7840
7881
|
const {
|
|
7841
7882
|
register,
|
|
7842
7883
|
watch,
|
|
@@ -7864,7 +7905,7 @@ var SendTokenContent = ({
|
|
|
7864
7905
|
};
|
|
7865
7906
|
const onSubmit = async (data) => {
|
|
7866
7907
|
if (!selectedToken) return;
|
|
7867
|
-
const isValidReceiver = !
|
|
7908
|
+
const isValidReceiver = !chunkRUIC653T_cjs.compareAddresses(resolvedAddress ?? ethers.ZeroAddress, ethers.ZeroAddress) || chunkRUIC653T_cjs.isValidAddress(data.toAddressOrDomain);
|
|
7868
7909
|
if (!isValidReceiver) {
|
|
7869
7910
|
setError("toAddressOrDomain", {
|
|
7870
7911
|
type: "manual",
|
|
@@ -7928,7 +7969,7 @@ var SendTokenContent = ({
|
|
|
7928
7969
|
{
|
|
7929
7970
|
p: 6,
|
|
7930
7971
|
borderRadius: "xl",
|
|
7931
|
-
bg: isDark ? "#
|
|
7972
|
+
bg: isDark ? "#00000038" : "gray.50",
|
|
7932
7973
|
children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { align: "stretch", spacing: 2, children: [
|
|
7933
7974
|
/* @__PURE__ */ jsxRuntime.jsxs(react.FormControl, { isInvalid: !!errors.amount, children: [
|
|
7934
7975
|
/* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { justify: "space-between", children: [
|
|
@@ -7977,10 +8018,16 @@ var SendTokenContent = ({
|
|
|
7977
8018
|
bg: isDark ? "whiteAlpha.300" : "blackAlpha.300"
|
|
7978
8019
|
},
|
|
7979
8020
|
onClick: () => setIsSelectingToken(true),
|
|
7980
|
-
leftIcon:
|
|
8021
|
+
leftIcon: chunkRUIC653T_cjs.TOKEN_LOGO_COMPONENTS[selectedToken.symbol] ? React10__default.default.cloneElement(
|
|
8022
|
+
chunkRUIC653T_cjs.TOKEN_LOGO_COMPONENTS[selectedToken.symbol],
|
|
8023
|
+
{
|
|
8024
|
+
boxSize: "20px",
|
|
8025
|
+
borderRadius: "full"
|
|
8026
|
+
}
|
|
8027
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
7981
8028
|
react.Image,
|
|
7982
8029
|
{
|
|
7983
|
-
src:
|
|
8030
|
+
src: chunkRUIC653T_cjs.TOKEN_LOGOS[selectedToken.symbol],
|
|
7984
8031
|
alt: `${selectedToken.symbol} logo`,
|
|
7985
8032
|
boxSize: "20px",
|
|
7986
8033
|
borderRadius: "full",
|
|
@@ -8028,7 +8075,7 @@ var SendTokenContent = ({
|
|
|
8028
8075
|
}
|
|
8029
8076
|
)
|
|
8030
8077
|
] }),
|
|
8031
|
-
errors.amount && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "
|
|
8078
|
+
errors.amount && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "#ef4444", fontSize: "sm", children: errors.amount.message })
|
|
8032
8079
|
] }),
|
|
8033
8080
|
selectedToken && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8034
8081
|
react.HStack,
|
|
@@ -8071,7 +8118,7 @@ var SendTokenContent = ({
|
|
|
8071
8118
|
marginTop: "-20px",
|
|
8072
8119
|
marginBottom: "-20px",
|
|
8073
8120
|
marginX: "auto",
|
|
8074
|
-
bg: isDark ? "#
|
|
8121
|
+
bg: isDark ? "#151515" : "gray.100",
|
|
8075
8122
|
borderRadius: "xl",
|
|
8076
8123
|
w: "40px",
|
|
8077
8124
|
h: "40px",
|
|
@@ -8087,34 +8134,41 @@ var SendTokenContent = ({
|
|
|
8087
8134
|
)
|
|
8088
8135
|
}
|
|
8089
8136
|
),
|
|
8090
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8137
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8138
|
+
react.Box,
|
|
8139
|
+
{
|
|
8140
|
+
borderRadius: "xl",
|
|
8141
|
+
bg: isDark ? "#00000038" : "gray.50",
|
|
8142
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.VStack, { align: "stretch", spacing: 2, p: 6, width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(react.FormControl, { isInvalid: !!errors.toAddressOrDomain, children: [
|
|
8143
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8144
|
+
react.Input,
|
|
8145
|
+
{
|
|
8146
|
+
...register("toAddressOrDomain", {
|
|
8147
|
+
required: t("Address is required")
|
|
8148
|
+
}),
|
|
8149
|
+
onChange: (e) => {
|
|
8150
|
+
const trimmed = e.target.value.trim();
|
|
8151
|
+
e.target.value = trimmed;
|
|
8152
|
+
setValue("toAddressOrDomain", trimmed, {
|
|
8153
|
+
shouldValidate: true
|
|
8154
|
+
});
|
|
8155
|
+
},
|
|
8156
|
+
placeholder: t(
|
|
8157
|
+
"Type the receiver address or domain"
|
|
8158
|
+
),
|
|
8159
|
+
_placeholder: {
|
|
8160
|
+
fontSize: "md",
|
|
8161
|
+
fontWeight: "normal"
|
|
8162
|
+
},
|
|
8163
|
+
fontSize: "lg",
|
|
8164
|
+
fontWeight: "bold",
|
|
8165
|
+
variant: "unstyled"
|
|
8166
|
+
}
|
|
8106
8167
|
),
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
fontSize: "lg",
|
|
8112
|
-
fontWeight: "bold",
|
|
8113
|
-
variant: "unstyled"
|
|
8114
|
-
}
|
|
8115
|
-
),
|
|
8116
|
-
errors.toAddressOrDomain && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "red.500", fontSize: "sm", children: errors.toAddressOrDomain.message })
|
|
8117
|
-
] }) }) })
|
|
8168
|
+
errors.toAddressOrDomain && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "#ef4444", fontSize: "sm", children: errors.toAddressOrDomain.message })
|
|
8169
|
+
] }) })
|
|
8170
|
+
}
|
|
8171
|
+
)
|
|
8118
8172
|
] }) }),
|
|
8119
8173
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalFooter, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8120
8174
|
react.Button,
|
|
@@ -8155,11 +8209,11 @@ var SendTokenSummaryContent = ({
|
|
|
8155
8209
|
3
|
|
8156
8210
|
);
|
|
8157
8211
|
const { open: openUpgradeSmartAccountModal } = useUpgradeSmartAccountModal();
|
|
8158
|
-
const toImageSrc =
|
|
8212
|
+
const toImageSrc = React10.useMemo(() => {
|
|
8159
8213
|
if (avatar) {
|
|
8160
|
-
return
|
|
8214
|
+
return chunkRUIC653T_cjs.convertUriToUrl(avatar, network.type);
|
|
8161
8215
|
}
|
|
8162
|
-
return
|
|
8216
|
+
return chunkRUIC653T_cjs.getPicassoImage(resolvedAddress || toAddressOrDomain);
|
|
8163
8217
|
}, [avatar, network.type, resolvedAddress, toAddressOrDomain]);
|
|
8164
8218
|
const {
|
|
8165
8219
|
sendTransaction: transferERC20,
|
|
@@ -8231,7 +8285,7 @@ var SendTokenSummaryContent = ({
|
|
|
8231
8285
|
};
|
|
8232
8286
|
const isTxWaitingConfirmation = transferERC20WaitingForWalletConfirmation || transferVETWaitingForWalletConfirmation;
|
|
8233
8287
|
const isSubmitting = isTxWaitingConfirmation || transferERC20Pending || transferVETPending;
|
|
8234
|
-
|
|
8288
|
+
React10.useEffect(() => {
|
|
8235
8289
|
if (upgradeRequired) {
|
|
8236
8290
|
openUpgradeSmartAccountModal();
|
|
8237
8291
|
}
|
|
@@ -8554,7 +8608,7 @@ var ExistingDomainsList = ({
|
|
|
8554
8608
|
react.Text,
|
|
8555
8609
|
{
|
|
8556
8610
|
fontSize: "sm",
|
|
8557
|
-
color: isDark ? "whiteAlpha.600" : "
|
|
8611
|
+
color: isDark ? "whiteAlpha.600" : "blackAlpha.600",
|
|
8558
8612
|
children: t(
|
|
8559
8613
|
"Current domain"
|
|
8560
8614
|
)
|
|
@@ -8567,8 +8621,8 @@ var ExistingDomainsList = ({
|
|
|
8567
8621
|
react.Tag,
|
|
8568
8622
|
{
|
|
8569
8623
|
size: "sm",
|
|
8570
|
-
bg: isDark ? "
|
|
8571
|
-
color: isDark ? "whiteAlpha.
|
|
8624
|
+
bg: isDark ? "#ffffff05" : "whiteAlpha.100",
|
|
8625
|
+
color: isDark ? "whiteAlpha.900" : "blackAlpha.600",
|
|
8572
8626
|
px: 3,
|
|
8573
8627
|
py: 1,
|
|
8574
8628
|
borderRadius: "full",
|
|
@@ -8590,11 +8644,11 @@ var ChooseNameSearchContent = ({
|
|
|
8590
8644
|
const { t } = reactI18next.useTranslation();
|
|
8591
8645
|
const { account } = useWallet();
|
|
8592
8646
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
8593
|
-
const [name, setName] =
|
|
8594
|
-
const [error, setError] =
|
|
8595
|
-
const [isOwnDomain, setIsOwnDomain] =
|
|
8596
|
-
const [isAvailable, setIsAvailable] =
|
|
8597
|
-
const [hasInteracted, setHasInteracted] =
|
|
8647
|
+
const [name, setName] = React10.useState(initialName);
|
|
8648
|
+
const [error, setError] = React10.useState(null);
|
|
8649
|
+
const [isOwnDomain, setIsOwnDomain] = React10.useState(false);
|
|
8650
|
+
const [isAvailable, setIsAvailable] = React10.useState(false);
|
|
8651
|
+
const [hasInteracted, setHasInteracted] = React10.useState(false);
|
|
8598
8652
|
const { data: ensRecordExists, isLoading: isEnsCheckLoading } = useEnsRecordExists(name);
|
|
8599
8653
|
const { data: domainInfo, isLoading: isDomainInfoLoading } = useVechainDomain(`${name}.veworld.vet`);
|
|
8600
8654
|
const { data: isProtected, isLoading: isProtectedLoading } = useIsDomainProtected(name);
|
|
@@ -8612,7 +8666,7 @@ var ChooseNameSearchContent = ({
|
|
|
8612
8666
|
...veworldDomainsOfAddress?.domains || [],
|
|
8613
8667
|
...vetDomainsOfAddress?.domains || []
|
|
8614
8668
|
];
|
|
8615
|
-
|
|
8669
|
+
React10.useEffect(() => {
|
|
8616
8670
|
if (!hasInteracted) return;
|
|
8617
8671
|
if (name.length < 3) {
|
|
8618
8672
|
setError(t("Name must be at least 3 characters long"));
|
|
@@ -8705,7 +8759,7 @@ var ChooseNameSearchContent = ({
|
|
|
8705
8759
|
paddingRight: "120px",
|
|
8706
8760
|
fontSize: "lg",
|
|
8707
8761
|
height: "60px",
|
|
8708
|
-
bg: isDark ? "#
|
|
8762
|
+
bg: isDark ? "#00000038" : "white",
|
|
8709
8763
|
border: `1px solid ${isDark ? "#ffffff29" : "#ebebeb"}`,
|
|
8710
8764
|
_hover: {
|
|
8711
8765
|
border: `1px solid ${isDark ? "#ffffff40" : "#e0e0e0"}`
|
|
@@ -8728,19 +8782,19 @@ var ChooseNameSearchContent = ({
|
|
|
8728
8782
|
{
|
|
8729
8783
|
mr: 4,
|
|
8730
8784
|
fontSize: "sm",
|
|
8731
|
-
color: isDark ? "whiteAlpha.800" : "
|
|
8785
|
+
color: isDark ? "whiteAlpha.800" : "blackAlpha.600",
|
|
8732
8786
|
children: ".veworld.vet"
|
|
8733
8787
|
}
|
|
8734
8788
|
)
|
|
8735
8789
|
}
|
|
8736
8790
|
)
|
|
8737
8791
|
] }),
|
|
8738
|
-
error && hasInteracted && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "
|
|
8792
|
+
error && hasInteracted && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "#ef4444", fontSize: "sm", children: error }),
|
|
8739
8793
|
!error && hasInteracted && name.length >= 3 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8740
8794
|
react.Text,
|
|
8741
8795
|
{
|
|
8742
8796
|
fontSize: "sm",
|
|
8743
|
-
color: isAvailable ? "green.500" : "
|
|
8797
|
+
color: isAvailable ? "green.500" : "#ef4444",
|
|
8744
8798
|
fontWeight: "500",
|
|
8745
8799
|
children: isOwnDomain ? t("YOU OWN THIS") : isAvailable ? t("AVAILABLE") : t("UNAVAILABLE")
|
|
8746
8800
|
}
|
|
@@ -8806,7 +8860,7 @@ var ChooseNameSummaryContent = ({
|
|
|
8806
8860
|
console.error("Transaction failed:", error);
|
|
8807
8861
|
}
|
|
8808
8862
|
};
|
|
8809
|
-
|
|
8863
|
+
React10.useEffect(() => {
|
|
8810
8864
|
if (upgradeRequired) {
|
|
8811
8865
|
openUpgradeSmartAccountModal();
|
|
8812
8866
|
}
|
|
@@ -8852,7 +8906,7 @@ var ChooseNameSummaryContent = ({
|
|
|
8852
8906
|
var FAQAccordion = () => {
|
|
8853
8907
|
const { t } = reactI18next.useTranslation();
|
|
8854
8908
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
8855
|
-
const [searchQuery, setSearchQuery] =
|
|
8909
|
+
const [searchQuery, setSearchQuery] = React10.useState("");
|
|
8856
8910
|
const faqItems = [
|
|
8857
8911
|
{
|
|
8858
8912
|
question: t("What is VeChain?"),
|
|
@@ -8954,7 +9008,7 @@ var FAQAccordion = () => {
|
|
|
8954
9008
|
react.Input,
|
|
8955
9009
|
{
|
|
8956
9010
|
placeholder: t("Search FAQ"),
|
|
8957
|
-
bg: isDark ? "#
|
|
9011
|
+
bg: isDark ? "#00000038" : "gray.50",
|
|
8958
9012
|
borderRadius: "xl",
|
|
8959
9013
|
height: "56px",
|
|
8960
9014
|
pl: 12,
|
|
@@ -8962,14 +9016,19 @@ var FAQAccordion = () => {
|
|
|
8962
9016
|
onChange: (e) => setSearchQuery(e.target.value)
|
|
8963
9017
|
}
|
|
8964
9018
|
),
|
|
8965
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.InputLeftElement, { h: "56px", w: "56px", pl: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9019
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.InputLeftElement, { h: "56px", w: "56px", pl: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9020
|
+
ci.CiSearch,
|
|
9021
|
+
{
|
|
9022
|
+
color: isDark ? "whiteAlpha.400" : "blackAlpha.600"
|
|
9023
|
+
}
|
|
9024
|
+
) })
|
|
8966
9025
|
] }),
|
|
8967
9026
|
filteredFaqItems.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8968
9027
|
react.VStack,
|
|
8969
9028
|
{
|
|
8970
9029
|
spacing: 2,
|
|
8971
9030
|
py: 8,
|
|
8972
|
-
color: isDark ? "whiteAlpha.600" : "
|
|
9031
|
+
color: isDark ? "whiteAlpha.600" : "blackAlpha.600",
|
|
8973
9032
|
children: [
|
|
8974
9033
|
/* @__PURE__ */ jsxRuntime.jsx(react.Icon, { as: fi.FiSlash, boxSize: 12, opacity: 0.5 }),
|
|
8975
9034
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "lg", children: t("No questions found") }),
|
|
@@ -8980,10 +9039,10 @@ var FAQAccordion = () => {
|
|
|
8980
9039
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8981
9040
|
react.AccordionButton,
|
|
8982
9041
|
{
|
|
8983
|
-
bg: isDark ? "whiteAlpha.50" : "
|
|
9042
|
+
bg: isDark ? "whiteAlpha.50" : "blackAlpha.50",
|
|
8984
9043
|
borderRadius: "xl",
|
|
8985
9044
|
_hover: {
|
|
8986
|
-
bg: isDark ? "whiteAlpha.100" : "
|
|
9045
|
+
bg: isDark ? "whiteAlpha.100" : "blackAlpha.100"
|
|
8987
9046
|
},
|
|
8988
9047
|
children: [
|
|
8989
9048
|
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { flex: "1", textAlign: "left", py: 2, children: /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: "500", children: item.question }) }),
|
|
@@ -9299,6 +9358,7 @@ var en_default = {
|
|
|
9299
9358
|
"Save Changes": "Save Changes",
|
|
9300
9359
|
"Saving changes...": "Saving changes...",
|
|
9301
9360
|
"Say goodbye to 0x addresses, claim your .veworld.vet subdomain now for free!": "Say goodbye to 0x addresses, claim your .veworld.vet subdomain now for free!",
|
|
9361
|
+
"Search Apps": "Search Apps",
|
|
9302
9362
|
"Search FAQ": "Search FAQ",
|
|
9303
9363
|
"Search dApps": "Search dApps",
|
|
9304
9364
|
"Search for a domain": "Search for a domain",
|
|
@@ -9777,6 +9837,7 @@ var de_default = {
|
|
|
9777
9837
|
"Save Changes": "\xC4nderungen speichern",
|
|
9778
9838
|
"Saving changes...": "\xC4nderungen werden gespeichert...",
|
|
9779
9839
|
"Say goodbye to 0x addresses, claim your .veworld.vet subdomain now for free!": "Verabschieden Sie sich von 0x-Adressen, beanspruchen Sie Ihre .veworld.vet-Subdomain jetzt kostenlos!",
|
|
9840
|
+
"Search Apps": "Apps durchsuchen",
|
|
9780
9841
|
"Search FAQ": "FAQ durchsuchen",
|
|
9781
9842
|
"Search dApps": "dApps durchsuchen",
|
|
9782
9843
|
"Search for a domain": "Nach einer Domain suchen",
|
|
@@ -10255,6 +10316,7 @@ var it_default = {
|
|
|
10255
10316
|
"Save Changes": "Salva modifiche",
|
|
10256
10317
|
"Saving changes...": "Salvataggio delle modifiche...",
|
|
10257
10318
|
"Say goodbye to 0x addresses, claim your .veworld.vet subdomain now for free!": "D\xEC addio agli indirizzi 0x, richiedi il tuo sottodominio .veworld.vet ora gratuitamente!",
|
|
10319
|
+
"Search Apps": "Cerca App",
|
|
10258
10320
|
"Search FAQ": "Cerca FAQ",
|
|
10259
10321
|
"Search dApps": "Cerca dApp",
|
|
10260
10322
|
"Search for a domain": "Cerca un dominio",
|
|
@@ -10733,6 +10795,7 @@ var fr_default = {
|
|
|
10733
10795
|
"Save Changes": "Enregistrer les modifications",
|
|
10734
10796
|
"Saving changes...": "Enregistrement des modifications...",
|
|
10735
10797
|
"Say goodbye to 0x addresses, claim your .veworld.vet subdomain now for free!": "Dites adieu aux adresses 0x, r\xE9clamez d\xE8s maintenant votre sous-domaine .veworld.vet gratuitement!",
|
|
10798
|
+
"Search Apps": "Rechercher des applications",
|
|
10736
10799
|
"Search FAQ": "Rechercher dans la FAQ",
|
|
10737
10800
|
"Search dApps": "Rechercher des dApps",
|
|
10738
10801
|
"Search for a domain": "Rechercher un domaine",
|
|
@@ -11211,6 +11274,7 @@ var es_default = {
|
|
|
11211
11274
|
"Save Changes": "Guardar cambios",
|
|
11212
11275
|
"Saving changes...": "Guardando cambios...",
|
|
11213
11276
|
"Say goodbye to 0x addresses, claim your .veworld.vet subdomain now for free!": "Desp\xEDdete de las direcciones 0x, \xA1reclama tu subdominio .veworld.vet ahora gratis!",
|
|
11277
|
+
"Search Apps": "Buscar aplicaciones",
|
|
11214
11278
|
"Search FAQ": "Buscar en las preguntas frecuentes",
|
|
11215
11279
|
"Search dApps": "Buscar dApps",
|
|
11216
11280
|
"Search for a domain": "Buscar un dominio",
|
|
@@ -11689,6 +11753,7 @@ var zh_default = {
|
|
|
11689
11753
|
"Save Changes": "\u4FDD\u5B58\u66F4\u6539",
|
|
11690
11754
|
"Saving changes...": "\u6B63\u5728\u4FDD\u5B58\u66F4\u6539...",
|
|
11691
11755
|
"Say goodbye to 0x addresses, claim your .veworld.vet subdomain now for free!": "\u544A\u522B 0x \u5730\u5740\uFF0C\u7ACB\u5373\u514D\u8D39\u9886\u53D6\u60A8\u7684 .veworld.vet \u5B50\u57DF\u540D\uFF01",
|
|
11756
|
+
"Search Apps": "\u641C\u7D22\u5E94\u7528",
|
|
11692
11757
|
"Search FAQ": "\u641C\u7D22\u5E38\u89C1\u95EE\u9898",
|
|
11693
11758
|
"Search dApps": "\u641C\u7D22 dApps",
|
|
11694
11759
|
"Search for a domain": "\u641C\u7D22\u57DF\u540D",
|
|
@@ -12167,6 +12232,7 @@ var ja_default = {
|
|
|
12167
12232
|
"Save Changes": "\u5909\u66F4\u3092\u4FDD\u5B58",
|
|
12168
12233
|
"Saving changes...": "\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u3066\u3044\u307E\u3059...",
|
|
12169
12234
|
"Say goodbye to 0x addresses, claim your .veworld.vet subdomain now for free!": "0x\u30A2\u30C9\u30EC\u30B9\u306B\u5225\u308C\u3092\u544A\u3052\u3001\u4ECA\u3059\u3050\u7121\u6599\u3067.veworld.vet\u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\u3092\u53D6\u5F97\u3057\u307E\u3057\u3087\u3046\uFF01",
|
|
12235
|
+
"Search Apps": "\u30A2\u30D7\u30EA\u3092\u691C\u7D22",
|
|
12170
12236
|
"Search FAQ": "FAQ\u3092\u691C\u7D22",
|
|
12171
12237
|
"Search dApps": "dApps\u3092\u691C\u7D22",
|
|
12172
12238
|
"Search for a domain": "\u30C9\u30E1\u30A4\u30F3\u3092\u691C\u7D22",
|
|
@@ -12417,10 +12483,12 @@ var FAQContent = ({ onGoBack }) => {
|
|
|
12417
12483
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { spacing: 6, align: "stretch", children: [
|
|
12418
12484
|
/* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { children: [
|
|
12419
12485
|
/* @__PURE__ */ jsxRuntime.jsx(react.HStack, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12420
|
-
|
|
12486
|
+
chunkFID67WC3_cjs.VechainLogo,
|
|
12421
12487
|
{
|
|
12422
12488
|
isDark,
|
|
12423
|
-
w: "200px"
|
|
12489
|
+
w: "200px",
|
|
12490
|
+
h: "auto",
|
|
12491
|
+
ml: -6
|
|
12424
12492
|
}
|
|
12425
12493
|
) }),
|
|
12426
12494
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", opacity: 0.7, textAlign: "center", children: t(
|
|
@@ -12493,23 +12561,23 @@ var CustomizationContent = ({
|
|
|
12493
12561
|
const { t } = reactI18next.useTranslation();
|
|
12494
12562
|
const { network, darkMode: isDark } = useVeChainKitConfig();
|
|
12495
12563
|
const { account } = useWallet();
|
|
12496
|
-
const fileInputRef =
|
|
12497
|
-
const coverInputRef =
|
|
12498
|
-
const [isUploading, setIsUploading] =
|
|
12564
|
+
const fileInputRef = React10.useRef(null);
|
|
12565
|
+
const coverInputRef = React10.useRef(null);
|
|
12566
|
+
const [isUploading, setIsUploading] = React10.useState(false);
|
|
12499
12567
|
const { onUpload } = useSingleImageUpload({
|
|
12500
12568
|
compressImage: true
|
|
12501
12569
|
});
|
|
12502
|
-
const [previewImageUrl, setPreviewImageUrl] =
|
|
12503
|
-
const [avatarIpfsHash, setAvatarIpfsHash] =
|
|
12570
|
+
const [previewImageUrl, setPreviewImageUrl] = React10.useState(null);
|
|
12571
|
+
const [avatarIpfsHash, setAvatarIpfsHash] = React10.useState(null);
|
|
12504
12572
|
const hasDomain = !!account?.domain;
|
|
12505
|
-
const [initialAvatarHash, setInitialAvatarHash] =
|
|
12573
|
+
const [initialAvatarHash, setInitialAvatarHash] = React10.useState(
|
|
12506
12574
|
null
|
|
12507
12575
|
);
|
|
12508
|
-
const [initialDisplayName, setInitialDisplayName] =
|
|
12509
|
-
const [initialDescription, setInitialDescription] =
|
|
12510
|
-
const [initialTwitter, setInitialTwitter] =
|
|
12511
|
-
const [initialWebsite, setInitialWebsite] =
|
|
12512
|
-
const [initialEmail, setInitialEmail] =
|
|
12576
|
+
const [initialDisplayName, setInitialDisplayName] = React10.useState("");
|
|
12577
|
+
const [initialDescription, setInitialDescription] = React10.useState("");
|
|
12578
|
+
const [initialTwitter, setInitialTwitter] = React10.useState("");
|
|
12579
|
+
const [initialWebsite, setInitialWebsite] = React10.useState("");
|
|
12580
|
+
const [initialEmail, setInitialEmail] = React10.useState("");
|
|
12513
12581
|
const {
|
|
12514
12582
|
register,
|
|
12515
12583
|
watch,
|
|
@@ -12524,7 +12592,7 @@ var CustomizationContent = ({
|
|
|
12524
12592
|
},
|
|
12525
12593
|
mode: "onChange"
|
|
12526
12594
|
});
|
|
12527
|
-
|
|
12595
|
+
React10.useEffect(() => {
|
|
12528
12596
|
if (account?.metadata) {
|
|
12529
12597
|
const metadata = account.metadata;
|
|
12530
12598
|
setInitialDisplayName(metadata.display || "");
|
|
@@ -12536,7 +12604,7 @@ var CustomizationContent = ({
|
|
|
12536
12604
|
metadata.avatar ? metadata.avatar.replace("ipfs://", "") : null
|
|
12537
12605
|
);
|
|
12538
12606
|
setPreviewImageUrl(
|
|
12539
|
-
|
|
12607
|
+
chunkRUIC653T_cjs.convertUriToUrl(metadata.avatar ?? "", network.type) || null
|
|
12540
12608
|
);
|
|
12541
12609
|
}
|
|
12542
12610
|
}, [account?.metadata, network.type]);
|
|
@@ -12549,7 +12617,7 @@ var CustomizationContent = ({
|
|
|
12549
12617
|
setPreviewImageUrl(URL.createObjectURL(file));
|
|
12550
12618
|
const uploadedImage = await onUpload(file);
|
|
12551
12619
|
if (!uploadedImage) throw new Error("Failed to compress image");
|
|
12552
|
-
const ipfsHash = await
|
|
12620
|
+
const ipfsHash = await chunkRUIC653T_cjs.uploadBlobToIPFS(
|
|
12553
12621
|
uploadedImage.file,
|
|
12554
12622
|
file.name,
|
|
12555
12623
|
network.type
|
|
@@ -12562,7 +12630,7 @@ var CustomizationContent = ({
|
|
|
12562
12630
|
setIsUploading(false);
|
|
12563
12631
|
}
|
|
12564
12632
|
};
|
|
12565
|
-
|
|
12633
|
+
React10.useEffect(() => {
|
|
12566
12634
|
return () => {
|
|
12567
12635
|
if (previewImageUrl) {
|
|
12568
12636
|
URL.revokeObjectURL(previewImageUrl);
|
|
@@ -12584,7 +12652,7 @@ var CustomizationContent = ({
|
|
|
12584
12652
|
if (formValues.email !== initialEmail) changes.email = formValues.email;
|
|
12585
12653
|
return changes;
|
|
12586
12654
|
};
|
|
12587
|
-
const hasChanges =
|
|
12655
|
+
const hasChanges = React10.useMemo(() => {
|
|
12588
12656
|
const changes = getChangedValues();
|
|
12589
12657
|
return Object.keys(changes).length > 0;
|
|
12590
12658
|
}, [getChangedValues]);
|
|
@@ -12607,7 +12675,7 @@ var CustomizationContent = ({
|
|
|
12607
12675
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12608
12676
|
react.Card,
|
|
12609
12677
|
{
|
|
12610
|
-
bg: isDark ? "
|
|
12678
|
+
bg: isDark ? "#1e1e21" : "#00000005",
|
|
12611
12679
|
borderRadius: "xl",
|
|
12612
12680
|
width: "full",
|
|
12613
12681
|
position: "relative",
|
|
@@ -12621,7 +12689,7 @@ var CustomizationContent = ({
|
|
|
12621
12689
|
backgroundPosition: "center",
|
|
12622
12690
|
position: "relative",
|
|
12623
12691
|
h: "80px",
|
|
12624
|
-
background: `no-repeat url('${
|
|
12692
|
+
background: `no-repeat url('${chunkRUIC653T_cjs.getPicassoImage(
|
|
12625
12693
|
account?.address ?? ""
|
|
12626
12694
|
)}')`,
|
|
12627
12695
|
w: "100%",
|
|
@@ -12748,7 +12816,7 @@ var CustomizationContent = ({
|
|
|
12748
12816
|
placeholder: !hasDomain ? t("Set a domain first") : t("Enter your display name")
|
|
12749
12817
|
}
|
|
12750
12818
|
),
|
|
12751
|
-
errors.displayName && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "
|
|
12819
|
+
errors.displayName && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "#ef4444", fontSize: "sm", mt: 1, children: errors.displayName.message })
|
|
12752
12820
|
]
|
|
12753
12821
|
}
|
|
12754
12822
|
),
|
|
@@ -12773,7 +12841,7 @@ var CustomizationContent = ({
|
|
|
12773
12841
|
placeholder: t("Eg: DevRel @ ENS Labs")
|
|
12774
12842
|
}
|
|
12775
12843
|
),
|
|
12776
|
-
errors.description && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "
|
|
12844
|
+
errors.description && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "#ef4444", fontSize: "sm", mt: 1, children: errors.description.message })
|
|
12777
12845
|
]
|
|
12778
12846
|
}
|
|
12779
12847
|
),
|
|
@@ -12808,7 +12876,7 @@ var CustomizationContent = ({
|
|
|
12808
12876
|
errors.twitter && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12809
12877
|
react.Text,
|
|
12810
12878
|
{
|
|
12811
|
-
color: "
|
|
12879
|
+
color: "#ef4444",
|
|
12812
12880
|
fontSize: "sm",
|
|
12813
12881
|
mt: 1,
|
|
12814
12882
|
children: errors.twitter.message
|
|
@@ -12844,7 +12912,7 @@ var CustomizationContent = ({
|
|
|
12844
12912
|
errors.website && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12845
12913
|
react.Text,
|
|
12846
12914
|
{
|
|
12847
|
-
color: "
|
|
12915
|
+
color: "#ef4444",
|
|
12848
12916
|
fontSize: "sm",
|
|
12849
12917
|
mt: 1,
|
|
12850
12918
|
children: errors.website.message
|
|
@@ -12880,7 +12948,7 @@ var CustomizationContent = ({
|
|
|
12880
12948
|
errors.email && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12881
12949
|
react.Text,
|
|
12882
12950
|
{
|
|
12883
|
-
color: "
|
|
12951
|
+
color: "#ef4444",
|
|
12884
12952
|
fontSize: "sm",
|
|
12885
12953
|
mt: 1,
|
|
12886
12954
|
children: errors.email.message
|
|
@@ -13016,14 +13084,14 @@ var CustomizationSummaryContent = ({
|
|
|
13016
13084
|
react.Text,
|
|
13017
13085
|
{
|
|
13018
13086
|
fontSize: "sm",
|
|
13019
|
-
color: isDark ? "whiteAlpha.600" : "
|
|
13087
|
+
color: isDark ? "whiteAlpha.600" : "blackAlpha.600",
|
|
13020
13088
|
children: label
|
|
13021
13089
|
}
|
|
13022
13090
|
),
|
|
13023
13091
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "md", children: value })
|
|
13024
13092
|
] });
|
|
13025
13093
|
};
|
|
13026
|
-
|
|
13094
|
+
React10.useEffect(() => {
|
|
13027
13095
|
if (upgradeRequired) {
|
|
13028
13096
|
openUpgradeSmartAccountModal();
|
|
13029
13097
|
}
|
|
@@ -13046,7 +13114,7 @@ var CustomizationSummaryContent = ({
|
|
|
13046
13114
|
react.Text,
|
|
13047
13115
|
{
|
|
13048
13116
|
fontSize: "sm",
|
|
13049
|
-
color: isDark ? "whiteAlpha.600" : "
|
|
13117
|
+
color: isDark ? "whiteAlpha.600" : "blackAlpha.600",
|
|
13050
13118
|
children: t("Profile Image")
|
|
13051
13119
|
}
|
|
13052
13120
|
),
|
|
@@ -13262,7 +13330,7 @@ var AssetsContent = ({ setCurrentContent }) => {
|
|
|
13262
13330
|
const { allowCustomTokens, darkMode } = useVeChainKitConfig();
|
|
13263
13331
|
const { customTokens } = useCustomTokens();
|
|
13264
13332
|
const { t } = reactI18next.useTranslation();
|
|
13265
|
-
const [searchQuery, setSearchQuery] =
|
|
13333
|
+
const [searchQuery, setSearchQuery] = React10.useState("");
|
|
13266
13334
|
const handleTokenSelect = (token) => {
|
|
13267
13335
|
setCurrentContent({
|
|
13268
13336
|
type: "send-token",
|
|
@@ -13308,7 +13376,7 @@ var AssetsContent = ({ setCurrentContent }) => {
|
|
|
13308
13376
|
react.Input,
|
|
13309
13377
|
{
|
|
13310
13378
|
placeholder: "Search token",
|
|
13311
|
-
bg: darkMode ? "#
|
|
13379
|
+
bg: darkMode ? "#00000038" : "gray.50",
|
|
13312
13380
|
borderRadius: "xl",
|
|
13313
13381
|
height: "56px",
|
|
13314
13382
|
pl: 12,
|
|
@@ -13421,7 +13489,7 @@ var ManageCustomTokenContent = ({
|
|
|
13421
13489
|
fontWeight: "medium"
|
|
13422
13490
|
}
|
|
13423
13491
|
),
|
|
13424
|
-
errors.newTokenAddress && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "
|
|
13492
|
+
errors.newTokenAddress && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { color: "#ef4444", fontSize: "sm", children: errors.newTokenAddress.message })
|
|
13425
13493
|
] }) })
|
|
13426
13494
|
}
|
|
13427
13495
|
),
|
|
@@ -13446,7 +13514,7 @@ var ManageCustomTokenContent = ({
|
|
|
13446
13514
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13447
13515
|
react.Image,
|
|
13448
13516
|
{
|
|
13449
|
-
src:
|
|
13517
|
+
src: chunkRUIC653T_cjs.TOKEN_LOGOS[token?.symbol],
|
|
13450
13518
|
alt: `${token.symbol} logo`,
|
|
13451
13519
|
boxSize: "20px",
|
|
13452
13520
|
borderRadius: "full",
|
|
@@ -13476,7 +13544,7 @@ var ManageCustomTokenContent = ({
|
|
|
13476
13544
|
),
|
|
13477
13545
|
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontWeight: "medium", children: token.symbol ?? "Unknown" })
|
|
13478
13546
|
] }),
|
|
13479
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { opacity: 0.7, children:
|
|
13547
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { opacity: 0.7, children: chunkRUIC653T_cjs.humanAddress(
|
|
13480
13548
|
token.address ?? "",
|
|
13481
13549
|
4,
|
|
13482
13550
|
4
|
|
@@ -13525,7 +13593,7 @@ var BridgeContent = ({ setCurrentContent }) => {
|
|
|
13525
13593
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13526
13594
|
react.Image,
|
|
13527
13595
|
{
|
|
13528
|
-
src: isDark ? "https://
|
|
13596
|
+
src: isDark ? "https://static.vechain.energy/logo-dark.svg" : "https://static.vechain.energy/logo-light.svg",
|
|
13529
13597
|
alt: "bridge token",
|
|
13530
13598
|
w: "200px",
|
|
13531
13599
|
h: "200px",
|
|
@@ -13572,7 +13640,7 @@ var ConnectionDetailsContent = ({ onGoBack }) => {
|
|
|
13572
13640
|
/* @__PURE__ */ jsxRuntime.jsxs(react.ModalBody, { w: "full", children: [
|
|
13573
13641
|
connection.isConnectedWithCrossApp && connectionCache && /* @__PURE__ */ jsxRuntime.jsx(CrossAppConnectionCard, { connectionCache }),
|
|
13574
13642
|
connection.isConnectedWithSocialLogin && /* @__PURE__ */ jsxRuntime.jsx(PrivyConnectionCard, {}),
|
|
13575
|
-
connection.isConnectedWithDappKit && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13643
|
+
connection.isConnectedWithDappKit && /* @__PURE__ */ jsxRuntime.jsx(DappKitConnectionCard, {}),
|
|
13576
13644
|
connection.isConnectedWithPrivy && /* @__PURE__ */ jsxRuntime.jsx(WalletSecuredBy, {})
|
|
13577
13645
|
] }),
|
|
13578
13646
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalFooter, { pt: 0 })
|
|
@@ -13622,10 +13690,10 @@ var ConfirmUnlink = ({
|
|
|
13622
13690
|
var PrivyLinkedAccounts = ({ onBack }) => {
|
|
13623
13691
|
const { t } = reactI18next.useTranslation();
|
|
13624
13692
|
const { privy, dappKit } = useVeChainKitConfig();
|
|
13625
|
-
const [unlinkingAccount, setUnlinkingAccount] =
|
|
13626
|
-
const [showLinkOptions, setShowLinkOptions] =
|
|
13627
|
-
const [showFullText, setShowFullText] =
|
|
13628
|
-
const [isLoadingUnlink, setIsLoadingUnlink] =
|
|
13693
|
+
const [unlinkingAccount, setUnlinkingAccount] = React10.useState(null);
|
|
13694
|
+
const [showLinkOptions, setShowLinkOptions] = React10.useState(false);
|
|
13695
|
+
const [showFullText, setShowFullText] = React10.useState(false);
|
|
13696
|
+
const [isLoadingUnlink, setIsLoadingUnlink] = React10.useState(false);
|
|
13629
13697
|
const {
|
|
13630
13698
|
user,
|
|
13631
13699
|
linkEmail,
|
|
@@ -13657,7 +13725,7 @@ var PrivyLinkedAccounts = ({ onBack }) => {
|
|
|
13657
13725
|
unlinkDiscord,
|
|
13658
13726
|
linkWallet
|
|
13659
13727
|
} = reactAuth.usePrivy();
|
|
13660
|
-
const canLinkWallets =
|
|
13728
|
+
const canLinkWallets = React10.useMemo(() => {
|
|
13661
13729
|
const privyWallets = privy?.loginMethods?.filter(
|
|
13662
13730
|
(method35) => [
|
|
13663
13731
|
"rabby_wallet",
|
|
@@ -13777,7 +13845,7 @@ var PrivyLinkedAccounts = ({ onBack }) => {
|
|
|
13777
13845
|
case "phone":
|
|
13778
13846
|
return account.number;
|
|
13779
13847
|
case "wallet":
|
|
13780
|
-
return `${
|
|
13848
|
+
return `${chunkRUIC653T_cjs.humanAddress(account.address)} - ${account.walletClientType}`;
|
|
13781
13849
|
default:
|
|
13782
13850
|
return "";
|
|
13783
13851
|
}
|
|
@@ -14189,9 +14257,9 @@ var NotificationsContent = ({ setCurrentContent }) => {
|
|
|
14189
14257
|
clearAllNotifications,
|
|
14190
14258
|
markAsRead
|
|
14191
14259
|
} = useNotifications();
|
|
14192
|
-
const [isArchiveView, setIsArchiveView] =
|
|
14193
|
-
const [notifications, setNotifications] =
|
|
14194
|
-
const [archivedNotifications, setArchivedNotifications] =
|
|
14260
|
+
const [isArchiveView, setIsArchiveView] = React10.useState(false);
|
|
14261
|
+
const [notifications, setNotifications] = React10.useState(getNotifications());
|
|
14262
|
+
const [archivedNotifications, setArchivedNotifications] = React10.useState(
|
|
14195
14263
|
getArchivedNotifications()
|
|
14196
14264
|
);
|
|
14197
14265
|
const handleClearAll = () => {
|
|
@@ -14276,6 +14344,7 @@ var NotificationsContent = ({ setCurrentContent }) => {
|
|
|
14276
14344
|
var SharedAppCard = ({
|
|
14277
14345
|
name,
|
|
14278
14346
|
imageUrl,
|
|
14347
|
+
logoComponent,
|
|
14279
14348
|
onClick,
|
|
14280
14349
|
size = "md"
|
|
14281
14350
|
}) => {
|
|
@@ -14286,12 +14355,12 @@ var SharedAppCard = ({
|
|
|
14286
14355
|
_hover: { opacity: 0.8 },
|
|
14287
14356
|
cursor: "pointer",
|
|
14288
14357
|
onClick,
|
|
14289
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(react.CardBody, { p: size === "sm" ? 2 : 4, alignItems: "center", children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { spacing:
|
|
14290
|
-
imageUrl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14358
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.CardBody, { p: size === "sm" ? 2 : 4, alignItems: "center", children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { spacing: 2, h: "100%", justifyContent: "space-between", children: [
|
|
14359
|
+
logoComponent ? logoComponent : imageUrl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14291
14360
|
react.Image,
|
|
14292
14361
|
{
|
|
14293
14362
|
src: imageUrl,
|
|
14294
|
-
fallbackSrc:
|
|
14363
|
+
fallbackSrc: chunkRUIC653T_cjs.notFoundImage,
|
|
14295
14364
|
alt: name,
|
|
14296
14365
|
height: "90px",
|
|
14297
14366
|
objectFit: "contain",
|
|
@@ -14323,6 +14392,7 @@ var AppComponent = ({ xApp, setCurrentContent }) => {
|
|
|
14323
14392
|
{
|
|
14324
14393
|
isLoaded: !appMetadataLoading && !isLogoLoading,
|
|
14325
14394
|
borderRadius: "md",
|
|
14395
|
+
height: "100%",
|
|
14326
14396
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14327
14397
|
SharedAppCard,
|
|
14328
14398
|
{
|
|
@@ -14351,6 +14421,7 @@ var CustomAppComponent = ({
|
|
|
14351
14421
|
image,
|
|
14352
14422
|
url,
|
|
14353
14423
|
description,
|
|
14424
|
+
logoComponent,
|
|
14354
14425
|
setCurrentContent
|
|
14355
14426
|
}) => {
|
|
14356
14427
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14365,9 +14436,11 @@ var CustomAppComponent = ({
|
|
|
14365
14436
|
name,
|
|
14366
14437
|
image,
|
|
14367
14438
|
url,
|
|
14368
|
-
description
|
|
14439
|
+
description,
|
|
14440
|
+
logoComponent
|
|
14369
14441
|
}
|
|
14370
|
-
})
|
|
14442
|
+
}),
|
|
14443
|
+
...logoComponent && { logoComponent }
|
|
14371
14444
|
}
|
|
14372
14445
|
);
|
|
14373
14446
|
};
|
|
@@ -14387,7 +14460,7 @@ var ShortcutsSection = ({}) => {
|
|
|
14387
14460
|
react.Image,
|
|
14388
14461
|
{
|
|
14389
14462
|
src: shortcut.image,
|
|
14390
|
-
fallbackSrc:
|
|
14463
|
+
fallbackSrc: chunkRUIC653T_cjs.notFoundImage,
|
|
14391
14464
|
alt: shortcut.name,
|
|
14392
14465
|
objectFit: "contain",
|
|
14393
14466
|
rounded: "full"
|
|
@@ -14444,7 +14517,7 @@ var DEFAULT_APPS = [
|
|
|
14444
14517
|
var ExploreEcosystemContent = ({ setCurrentContent }) => {
|
|
14445
14518
|
const { t } = reactI18next.useTranslation();
|
|
14446
14519
|
const { darkMode: isDark, network } = useVeChainKitConfig();
|
|
14447
|
-
const [searchQuery, setSearchQuery] =
|
|
14520
|
+
const [searchQuery, setSearchQuery] = React10.useState("");
|
|
14448
14521
|
const { data: currentRoundId } = useCurrentAllocationsRoundId();
|
|
14449
14522
|
const { data: vbdApps } = useMostVotedAppsInRound(
|
|
14450
14523
|
currentRoundId ? (parseInt(currentRoundId) - 1).toString() : "1"
|
|
@@ -14455,7 +14528,17 @@ var ExploreEcosystemContent = ({ setCurrentContent }) => {
|
|
|
14455
14528
|
) : [];
|
|
14456
14529
|
const filteredDefaultApps = DEFAULT_APPS.filter(
|
|
14457
14530
|
(dapp) => dapp.name.toLowerCase().includes(searchQuery.toLowerCase())
|
|
14458
|
-
)
|
|
14531
|
+
).map((dapp) => {
|
|
14532
|
+
if (dapp.logoComponent) {
|
|
14533
|
+
return {
|
|
14534
|
+
...dapp,
|
|
14535
|
+
logoComponent: React10__default.default.cloneElement(dapp.logoComponent, {
|
|
14536
|
+
isDark
|
|
14537
|
+
})
|
|
14538
|
+
};
|
|
14539
|
+
}
|
|
14540
|
+
return dapp;
|
|
14541
|
+
});
|
|
14459
14542
|
const { shortcuts } = useEcosystemShortcuts();
|
|
14460
14543
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
|
|
14461
14544
|
/* @__PURE__ */ jsxRuntime.jsxs(StickyHeaderContainer, { children: [
|
|
@@ -14479,10 +14562,10 @@ var ExploreEcosystemContent = ({ setCurrentContent }) => {
|
|
|
14479
14562
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14480
14563
|
react.Input,
|
|
14481
14564
|
{
|
|
14482
|
-
placeholder: t("Search
|
|
14565
|
+
placeholder: t("Search Apps"),
|
|
14483
14566
|
value: searchQuery,
|
|
14484
14567
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
14485
|
-
bg: isDark ? "#
|
|
14568
|
+
bg: isDark ? "#00000038" : "gray.50",
|
|
14486
14569
|
borderRadius: "xl",
|
|
14487
14570
|
height: "56px",
|
|
14488
14571
|
pl: 12
|
|
@@ -14503,7 +14586,10 @@ var ExploreEcosystemContent = ({ setCurrentContent }) => {
|
|
|
14503
14586
|
image: dapp.logo,
|
|
14504
14587
|
url: dapp.external_url,
|
|
14505
14588
|
setCurrentContent,
|
|
14506
|
-
description: dapp.description
|
|
14589
|
+
description: dapp.description,
|
|
14590
|
+
...dapp.logoComponent && {
|
|
14591
|
+
logoComponent: dapp.logoComponent
|
|
14592
|
+
}
|
|
14507
14593
|
}
|
|
14508
14594
|
) }, dapp.name)),
|
|
14509
14595
|
filteredDapps.map((dapp) => /* @__PURE__ */ jsxRuntime.jsx(react.GridItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14547,7 +14633,8 @@ var AppOverviewContent = ({
|
|
|
14547
14633
|
name,
|
|
14548
14634
|
image,
|
|
14549
14635
|
url,
|
|
14550
|
-
description
|
|
14636
|
+
description,
|
|
14637
|
+
logoComponent
|
|
14551
14638
|
}) => {
|
|
14552
14639
|
const { t } = reactI18next.useTranslation();
|
|
14553
14640
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
|
|
@@ -14562,7 +14649,7 @@ var AppOverviewContent = ({
|
|
|
14562
14649
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalCloseButton, {})
|
|
14563
14650
|
] }),
|
|
14564
14651
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { spacing: 6, align: "center", w: "full", children: [
|
|
14565
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14652
|
+
logoComponent ? logoComponent : /* @__PURE__ */ jsxRuntime.jsx(
|
|
14566
14653
|
react.Image,
|
|
14567
14654
|
{
|
|
14568
14655
|
src: image,
|
|
@@ -14699,7 +14786,7 @@ var TransactionModalContent = ({
|
|
|
14699
14786
|
}) => {
|
|
14700
14787
|
const { t } = reactI18next.useTranslation();
|
|
14701
14788
|
const { network } = useVeChainKitConfig();
|
|
14702
|
-
const errorMessage =
|
|
14789
|
+
const errorMessage = React10.useMemo(() => {
|
|
14703
14790
|
if (!txError) return null;
|
|
14704
14791
|
return txError.reason || t("Something went wrong. Please try again.");
|
|
14705
14792
|
}, [txError, t]);
|
|
@@ -14724,7 +14811,7 @@ var TransactionModalContent = ({
|
|
|
14724
14811
|
react.Icon,
|
|
14725
14812
|
{
|
|
14726
14813
|
as: md.MdOutlineErrorOutline,
|
|
14727
|
-
color: "
|
|
14814
|
+
color: "#ef4444",
|
|
14728
14815
|
fontSize: "100px"
|
|
14729
14816
|
}
|
|
14730
14817
|
),
|
|
@@ -14737,7 +14824,7 @@ var TransactionModalContent = ({
|
|
|
14737
14824
|
react.Icon,
|
|
14738
14825
|
{
|
|
14739
14826
|
as: io.IoIosCheckmarkCircleOutline,
|
|
14740
|
-
color: "#
|
|
14827
|
+
color: "#22c55e",
|
|
14741
14828
|
fontSize: "100px"
|
|
14742
14829
|
}
|
|
14743
14830
|
),
|
|
@@ -14760,7 +14847,7 @@ var TransactionModalContent = ({
|
|
|
14760
14847
|
}
|
|
14761
14848
|
};
|
|
14762
14849
|
const statusConfig = getStatusConfig();
|
|
14763
|
-
const socialDescription = `${
|
|
14850
|
+
const socialDescription = `${chunkRUIC653T_cjs.getConfig(network.type).explorerUrl}/${txReceipt?.meta.txID}`;
|
|
14764
14851
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
|
|
14765
14852
|
/* @__PURE__ */ jsxRuntime.jsxs(StickyHeaderContainer, { children: [
|
|
14766
14853
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalHeader, { children: statusConfig.title }),
|
|
@@ -14772,22 +14859,17 @@ var TransactionModalContent = ({
|
|
|
14772
14859
|
)
|
|
14773
14860
|
] }),
|
|
14774
14861
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { align: "center", p: 6, spacing: 3, children: [
|
|
14775
|
-
statusConfig.icon
|
|
14776
|
-
|
|
14777
|
-
|
|
14778
|
-
|
|
14779
|
-
|
|
14780
|
-
|
|
14781
|
-
|
|
14782
|
-
|
|
14783
|
-
|
|
14784
|
-
|
|
14785
|
-
|
|
14786
|
-
children: statusConfig.icon
|
|
14787
|
-
}
|
|
14788
|
-
),
|
|
14789
|
-
status === "success" && uiConfig?.showShareOnSocials && /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { mt: 2, children: [
|
|
14790
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "xs", children: t("Share on") }),
|
|
14862
|
+
statusConfig.icon,
|
|
14863
|
+
status === "success" && uiConfig?.showShareOnSocials && /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { mt: 2, spacing: 3, children: [
|
|
14864
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14865
|
+
react.Text,
|
|
14866
|
+
{
|
|
14867
|
+
fontSize: "sm",
|
|
14868
|
+
fontWeight: "bold",
|
|
14869
|
+
opacity: 0.5,
|
|
14870
|
+
children: t("Share on")
|
|
14871
|
+
}
|
|
14872
|
+
),
|
|
14791
14873
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14792
14874
|
ShareButtons,
|
|
14793
14875
|
{
|
|
@@ -14843,7 +14925,7 @@ var TransactionModalContent = ({
|
|
|
14843
14925
|
uiConfig?.showExplorerButton && txReceipt?.meta.txID && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14844
14926
|
react.Link,
|
|
14845
14927
|
{
|
|
14846
|
-
href: `${
|
|
14928
|
+
href: `${chunkRUIC653T_cjs.getConfig(network.type).explorerUrl}/${txReceipt?.meta.txID}`,
|
|
14847
14929
|
isExternal: true,
|
|
14848
14930
|
opacity: 0.5,
|
|
14849
14931
|
fontSize: "14px",
|
|
@@ -14906,7 +14988,7 @@ var SuccessfulOperationContent = ({
|
|
|
14906
14988
|
}) => {
|
|
14907
14989
|
const { t } = reactI18next.useTranslation();
|
|
14908
14990
|
const { network } = useVeChainKitConfig();
|
|
14909
|
-
const explorerUrl =
|
|
14991
|
+
const explorerUrl = chunkRUIC653T_cjs.getConfig(network.type).explorerUrl;
|
|
14910
14992
|
const socialDescription = `${explorerUrl}/${txId}`;
|
|
14911
14993
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
|
|
14912
14994
|
/* @__PURE__ */ jsxRuntime.jsxs(StickyHeaderContainer, { children: [
|
|
@@ -14915,29 +14997,24 @@ var SuccessfulOperationContent = ({
|
|
|
14915
14997
|
] }),
|
|
14916
14998
|
/* @__PURE__ */ jsxRuntime.jsx(react.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { align: "center", p: 6, spacing: 3, children: [
|
|
14917
14999
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14918
|
-
|
|
15000
|
+
react.Icon,
|
|
14919
15001
|
{
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
repeat: Infinity
|
|
14924
|
-
},
|
|
14925
|
-
animate: {
|
|
14926
|
-
scale: [1, 1.1, 1]
|
|
14927
|
-
},
|
|
14928
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14929
|
-
react.Icon,
|
|
14930
|
-
{
|
|
14931
|
-
as: io.IoIosCheckmarkCircleOutline,
|
|
14932
|
-
fontSize: "100px",
|
|
14933
|
-
color: "#00ff45de"
|
|
14934
|
-
}
|
|
14935
|
-
)
|
|
15002
|
+
as: io.IoIosCheckmarkCircleOutline,
|
|
15003
|
+
fontSize: "100px",
|
|
15004
|
+
color: "#22c55e"
|
|
14936
15005
|
}
|
|
14937
15006
|
),
|
|
14938
15007
|
description && /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", textAlign: "center", children: description }),
|
|
14939
|
-
showSocialButtons && txId && /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { mt: 2, children: [
|
|
14940
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15008
|
+
showSocialButtons && txId && /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { mt: 2, spacing: 3, children: [
|
|
15009
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15010
|
+
react.Text,
|
|
15011
|
+
{
|
|
15012
|
+
fontSize: "sm",
|
|
15013
|
+
fontWeight: "bold",
|
|
15014
|
+
opacity: 0.5,
|
|
15015
|
+
children: t("Share on")
|
|
15016
|
+
}
|
|
15017
|
+
),
|
|
14941
15018
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14942
15019
|
ShareButtons,
|
|
14943
15020
|
{
|
|
@@ -14993,7 +15070,7 @@ var AccountModal = ({
|
|
|
14993
15070
|
accountModalContent: currentContent,
|
|
14994
15071
|
setAccountModalContent: setCurrentContent
|
|
14995
15072
|
} = useModal();
|
|
14996
|
-
|
|
15073
|
+
React10.useEffect(() => {
|
|
14997
15074
|
if (isOpen && initialContent) {
|
|
14998
15075
|
setCurrentContent(initialContent);
|
|
14999
15076
|
}
|
|
@@ -15152,8 +15229,8 @@ var AccountModal = ({
|
|
|
15152
15229
|
);
|
|
15153
15230
|
};
|
|
15154
15231
|
var ConnectModal = ({ isOpen, onClose }) => {
|
|
15155
|
-
const [currentContent, setCurrentContent] =
|
|
15156
|
-
|
|
15232
|
+
const [currentContent, setCurrentContent] = React10.useState("main");
|
|
15233
|
+
React10.useEffect(() => {
|
|
15157
15234
|
if (isOpen) {
|
|
15158
15235
|
setCurrentContent("main");
|
|
15159
15236
|
}
|
|
@@ -15251,7 +15328,7 @@ var WalletDisplay = ({ variant }) => {
|
|
|
15251
15328
|
return null;
|
|
15252
15329
|
}
|
|
15253
15330
|
if (variant === "iconAndDomain") {
|
|
15254
|
-
return account.domain ? /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", children: account.domain }) : /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", children:
|
|
15331
|
+
return account.domain ? /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", children: account.domain }) : /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "sm", children: chunkRUIC653T_cjs.humanAddress(account.address ?? "", 4, 4) });
|
|
15255
15332
|
}
|
|
15256
15333
|
if (variant === "iconDomainAndAssets") {
|
|
15257
15334
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { spacing: 2, children: [
|
|
@@ -15262,7 +15339,7 @@ var WalletDisplay = ({ variant }) => {
|
|
|
15262
15339
|
{
|
|
15263
15340
|
fontSize: account.domain ? "xs" : "sm",
|
|
15264
15341
|
opacity: account.domain ? 0.5 : 1,
|
|
15265
|
-
children:
|
|
15342
|
+
children: chunkRUIC653T_cjs.humanAddress(account.address ?? "", 4, 4)
|
|
15266
15343
|
}
|
|
15267
15344
|
)
|
|
15268
15345
|
] }),
|
|
@@ -15283,7 +15360,7 @@ var WalletDisplay = ({ variant }) => {
|
|
|
15283
15360
|
{
|
|
15284
15361
|
fontSize: account.domain ? "xs" : "sm",
|
|
15285
15362
|
opacity: account.domain ? 0.5 : 1,
|
|
15286
|
-
children:
|
|
15363
|
+
children: chunkRUIC653T_cjs.humanAddress(account.address ?? "", 4, 4)
|
|
15287
15364
|
}
|
|
15288
15365
|
)
|
|
15289
15366
|
] });
|
|
@@ -15438,8 +15515,8 @@ var TransactionToastContent = ({
|
|
|
15438
15515
|
}) => {
|
|
15439
15516
|
const { t } = reactI18next.useTranslation();
|
|
15440
15517
|
const { network } = useVeChainKitConfig();
|
|
15441
|
-
const explorerUrl =
|
|
15442
|
-
const errorMessage =
|
|
15518
|
+
const explorerUrl = chunkRUIC653T_cjs.getConfig(network.type).explorerUrl;
|
|
15519
|
+
const errorMessage = React10.useMemo(() => {
|
|
15443
15520
|
if (!txError) return null;
|
|
15444
15521
|
return txError.reason || t("Something went wrong. Please try again.");
|
|
15445
15522
|
}, [txError, t]);
|
|
@@ -15624,8 +15701,8 @@ var LoadingContent = ({
|
|
|
15624
15701
|
onTryAgain
|
|
15625
15702
|
}) => {
|
|
15626
15703
|
const { t } = reactI18next.useTranslation();
|
|
15627
|
-
const [showTimeout, setShowTimeout] =
|
|
15628
|
-
|
|
15704
|
+
const [showTimeout, setShowTimeout] = React10__default.default.useState(false);
|
|
15705
|
+
React10__default.default.useEffect(() => {
|
|
15629
15706
|
const timer = setTimeout(() => {
|
|
15630
15707
|
setShowTimeout(true);
|
|
15631
15708
|
}, 7e3);
|
|
@@ -15703,7 +15780,7 @@ var ErrorContent = ({
|
|
|
15703
15780
|
react.Icon,
|
|
15704
15781
|
{
|
|
15705
15782
|
as: md.MdOutlineErrorOutline,
|
|
15706
|
-
color: "
|
|
15783
|
+
color: "#ef4444",
|
|
15707
15784
|
fontSize: "60px",
|
|
15708
15785
|
opacity: 0.5
|
|
15709
15786
|
}
|
|
@@ -15723,8 +15800,8 @@ var ErrorContent = ({
|
|
|
15723
15800
|
var EcosystemContent = ({ onClose, appsInfo, isLoading }) => {
|
|
15724
15801
|
const { t } = reactI18next.useTranslation();
|
|
15725
15802
|
const { darkMode: isDark } = useVeChainKitConfig();
|
|
15726
|
-
const [loginError, setLoginError] =
|
|
15727
|
-
const [selectedApp, setSelectedApp] =
|
|
15803
|
+
const [loginError, setLoginError] = React10.useState();
|
|
15804
|
+
const [selectedApp, setSelectedApp] = React10.useState();
|
|
15728
15805
|
const loginLoadingModal = react.useDisclosure();
|
|
15729
15806
|
const { setConnectionCache } = useCrossAppConnectionCache();
|
|
15730
15807
|
const { login: loginWithCrossApp } = usePrivyCrossAppSdk();
|
|
@@ -15889,8 +15966,8 @@ var ProfileCard = ({
|
|
|
15889
15966
|
const activeAccountTextRecords = useGetTextRecords(
|
|
15890
15967
|
activeAccountDomain?.data?.domain
|
|
15891
15968
|
);
|
|
15892
|
-
const baseBackgroundColor = isDark ? "
|
|
15893
|
-
const headerImageSvg =
|
|
15969
|
+
const baseBackgroundColor = isDark ? "#1e1e21" : "#00000005";
|
|
15970
|
+
const headerImageSvg = chunkRUIC653T_cjs.getPicassoImage(address);
|
|
15894
15971
|
const isConnectedAccount = address === account?.address;
|
|
15895
15972
|
const hasLinks = activeAccountTextRecords?.data?.url || activeAccountTextRecords?.data?.["com.x"] || activeAccountTextRecords?.data?.email;
|
|
15896
15973
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -15928,10 +16005,10 @@ var ProfileCard = ({
|
|
|
15928
16005
|
wallet: {
|
|
15929
16006
|
address,
|
|
15930
16007
|
domain: activeAccountDomain?.data?.domain,
|
|
15931
|
-
image:
|
|
16008
|
+
image: chunkRUIC653T_cjs.convertUriToUrl(
|
|
15932
16009
|
activeAccountAvatar?.data ?? "",
|
|
15933
16010
|
network.type
|
|
15934
|
-
) ??
|
|
16011
|
+
) ?? chunkRUIC653T_cjs.getPicassoImage(address),
|
|
15935
16012
|
isLoadingMetadata: activeAccountAvatar?.isLoading || activeAccountDomain?.isLoading || activeAccountTextRecords?.isLoading,
|
|
15936
16013
|
metadata: activeAccountTextRecords?.data
|
|
15937
16014
|
},
|
|
@@ -15944,7 +16021,7 @@ var ProfileCard = ({
|
|
|
15944
16021
|
)
|
|
15945
16022
|
}
|
|
15946
16023
|
),
|
|
15947
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.CardBody, {
|
|
16024
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.CardBody, { mt: 10, backgroundColor: "none", border: "none", children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { w: "full", spacing: 2, children: [
|
|
15948
16025
|
showDisplayName && activeAccountTextRecords?.data?.display && /* @__PURE__ */ jsxRuntime.jsx(
|
|
15949
16026
|
react.Text,
|
|
15950
16027
|
{
|
|
@@ -15998,10 +16075,10 @@ var ProfileCard = ({
|
|
|
15998
16075
|
wallet: {
|
|
15999
16076
|
address,
|
|
16000
16077
|
domain: activeAccountDomain?.data?.domain,
|
|
16001
|
-
image:
|
|
16078
|
+
image: chunkRUIC653T_cjs.convertUriToUrl(
|
|
16002
16079
|
activeAccountAvatar?.data ?? "",
|
|
16003
16080
|
network.type
|
|
16004
|
-
) ??
|
|
16081
|
+
) ?? chunkRUIC653T_cjs.getPicassoImage(address),
|
|
16005
16082
|
isLoadingMetadata: activeAccountAvatar?.isLoading || activeAccountDomain?.isLoading || activeAccountTextRecords?.isLoading,
|
|
16006
16083
|
metadata: activeAccountTextRecords?.data
|
|
16007
16084
|
},
|
|
@@ -16009,7 +16086,7 @@ var ProfileCard = ({
|
|
|
16009
16086
|
}
|
|
16010
16087
|
)
|
|
16011
16088
|
] }) }),
|
|
16012
|
-
isConnectedAccount && showEdit && /* @__PURE__ */ jsxRuntime.jsx(react.CardFooter, {
|
|
16089
|
+
isConnectedAccount && showEdit && /* @__PURE__ */ jsxRuntime.jsx(react.CardFooter, { justify: "space-between", children: /* @__PURE__ */ jsxRuntime.jsxs(react.VStack, { w: "full", justify: "space-between", spacing: 4, children: [
|
|
16013
16090
|
/* @__PURE__ */ jsxRuntime.jsx(react.Divider, {}),
|
|
16014
16091
|
/* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { w: "full", justify: "space-between", children: [
|
|
16015
16092
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -16053,7 +16130,7 @@ var SuccessfulOperationContent2 = ({
|
|
|
16053
16130
|
}) => {
|
|
16054
16131
|
const { t } = reactI18next.useTranslation();
|
|
16055
16132
|
const { network } = useVeChainKitConfig();
|
|
16056
|
-
const explorerUrl =
|
|
16133
|
+
const explorerUrl = chunkRUIC653T_cjs.getConfig(network.type).explorerUrl;
|
|
16057
16134
|
const socialDescription = `${explorerUrl}/${txId}`;
|
|
16058
16135
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
|
|
16059
16136
|
/* @__PURE__ */ jsxRuntime.jsxs(StickyHeaderContainer, { children: [
|
|
@@ -16246,10 +16323,10 @@ var UpgradeSmartAccountContent2 = ({
|
|
|
16246
16323
|
] });
|
|
16247
16324
|
};
|
|
16248
16325
|
var UpgradeSmartAccountModal = ({ isOpen, onClose }) => {
|
|
16249
|
-
const [currentContent, setCurrentContent] =
|
|
16326
|
+
const [currentContent, setCurrentContent] = React10.useState(
|
|
16250
16327
|
"upgrade-smart-account"
|
|
16251
16328
|
);
|
|
16252
|
-
|
|
16329
|
+
React10.useEffect(() => {
|
|
16253
16330
|
if (isOpen) {
|
|
16254
16331
|
setCurrentContent("upgrade-smart-account");
|
|
16255
16332
|
}
|
|
@@ -16281,18 +16358,18 @@ var UpgradeSmartAccountModal = ({ isOpen, onClose }) => {
|
|
|
16281
16358
|
}
|
|
16282
16359
|
);
|
|
16283
16360
|
};
|
|
16284
|
-
var ModalContext =
|
|
16361
|
+
var ModalContext = React10.createContext(null);
|
|
16285
16362
|
var useModal = () => {
|
|
16286
|
-
const context =
|
|
16363
|
+
const context = React10.useContext(ModalContext);
|
|
16287
16364
|
if (!context) {
|
|
16288
16365
|
throw new Error("useModal must be used within ModalProvider");
|
|
16289
16366
|
}
|
|
16290
16367
|
return context;
|
|
16291
16368
|
};
|
|
16292
16369
|
var ModalProvider = ({ children }) => {
|
|
16293
|
-
const [isConnectModalOpen, setIsConnectModalOpen] =
|
|
16370
|
+
const [isConnectModalOpen, setIsConnectModalOpen] = React10.useState(false);
|
|
16294
16371
|
const { setSource, connect } = dappKitReact.useWallet();
|
|
16295
|
-
const openConnectModal =
|
|
16372
|
+
const openConnectModal = React10.useCallback(() => {
|
|
16296
16373
|
if (window.vechain && window.vechain.isInAppBrowser) {
|
|
16297
16374
|
setSource("veworld");
|
|
16298
16375
|
connect();
|
|
@@ -16300,44 +16377,47 @@ var ModalProvider = ({ children }) => {
|
|
|
16300
16377
|
setIsConnectModalOpen(true);
|
|
16301
16378
|
}
|
|
16302
16379
|
}, []);
|
|
16303
|
-
const closeConnectModal =
|
|
16380
|
+
const closeConnectModal = React10.useCallback(
|
|
16304
16381
|
() => setIsConnectModalOpen(false),
|
|
16305
16382
|
[]
|
|
16306
16383
|
);
|
|
16307
|
-
const [isAccountModalOpen, setIsAccountModalOpen] =
|
|
16308
|
-
const openAccountModal =
|
|
16309
|
-
|
|
16384
|
+
const [isAccountModalOpen, setIsAccountModalOpen] = React10.useState(false);
|
|
16385
|
+
const openAccountModal = React10.useCallback(() => {
|
|
16386
|
+
setAccountModalContent("main");
|
|
16387
|
+
setIsAccountModalOpen(true);
|
|
16388
|
+
}, []);
|
|
16389
|
+
const closeAccountModal = React10.useCallback(
|
|
16310
16390
|
() => setIsAccountModalOpen(false),
|
|
16311
16391
|
[]
|
|
16312
16392
|
);
|
|
16313
|
-
const [isTransactionModalOpen, setIsTransactionModalOpen] =
|
|
16314
|
-
const openTransactionModal =
|
|
16393
|
+
const [isTransactionModalOpen, setIsTransactionModalOpen] = React10.useState(false);
|
|
16394
|
+
const openTransactionModal = React10.useCallback(
|
|
16315
16395
|
() => setIsTransactionModalOpen(true),
|
|
16316
16396
|
[]
|
|
16317
16397
|
);
|
|
16318
|
-
const closeTransactionModal =
|
|
16398
|
+
const closeTransactionModal = React10.useCallback(
|
|
16319
16399
|
() => setIsTransactionModalOpen(false),
|
|
16320
16400
|
[]
|
|
16321
16401
|
);
|
|
16322
|
-
const [isTransactionToastOpen, setIsTransactionToastOpen] =
|
|
16323
|
-
const openTransactionToast =
|
|
16402
|
+
const [isTransactionToastOpen, setIsTransactionToastOpen] = React10.useState(false);
|
|
16403
|
+
const openTransactionToast = React10.useCallback(
|
|
16324
16404
|
() => setIsTransactionToastOpen(true),
|
|
16325
16405
|
[]
|
|
16326
16406
|
);
|
|
16327
|
-
const closeTransactionToast =
|
|
16407
|
+
const closeTransactionToast = React10.useCallback(
|
|
16328
16408
|
() => setIsTransactionToastOpen(false),
|
|
16329
16409
|
[]
|
|
16330
16410
|
);
|
|
16331
|
-
const [isUpgradeSmartAccountModalOpen, setIsUpgradeSmartAccountModalOpen] =
|
|
16332
|
-
const openUpgradeSmartAccountModal =
|
|
16411
|
+
const [isUpgradeSmartAccountModalOpen, setIsUpgradeSmartAccountModalOpen] = React10.useState(false);
|
|
16412
|
+
const openUpgradeSmartAccountModal = React10.useCallback(
|
|
16333
16413
|
() => setIsUpgradeSmartAccountModalOpen(true),
|
|
16334
16414
|
[]
|
|
16335
16415
|
);
|
|
16336
|
-
const closeUpgradeSmartAccountModal =
|
|
16416
|
+
const closeUpgradeSmartAccountModal = React10.useCallback(
|
|
16337
16417
|
() => setIsUpgradeSmartAccountModalOpen(false),
|
|
16338
16418
|
[]
|
|
16339
16419
|
);
|
|
16340
|
-
const [accountModalContent, setAccountModalContent] =
|
|
16420
|
+
const [accountModalContent, setAccountModalContent] = React10.useState("main");
|
|
16341
16421
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16342
16422
|
ModalContext.Provider,
|
|
16343
16423
|
{
|
|
@@ -16654,7 +16734,7 @@ var useReceiveModal = () => {
|
|
|
16654
16734
|
var ReceiveModalProvider = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
16655
16735
|
var useLoginModalContent = () => {
|
|
16656
16736
|
const { privy, loginMethods } = useVeChainKitConfig();
|
|
16657
|
-
const isVeChainApp = privy?.appId ===
|
|
16737
|
+
const isVeChainApp = privy?.appId === chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID;
|
|
16658
16738
|
const isLoginMethodEnabled = (method35) => {
|
|
16659
16739
|
if (!loginMethods) return true;
|
|
16660
16740
|
if (Array.isArray(method35)) {
|
|
@@ -16664,31 +16744,31 @@ var useLoginModalContent = () => {
|
|
|
16664
16744
|
}
|
|
16665
16745
|
return loginMethods.some((lm) => lm.method === method35);
|
|
16666
16746
|
};
|
|
16667
|
-
const showEcosystemLogin =
|
|
16747
|
+
const showEcosystemLogin = React10.useMemo(() => {
|
|
16668
16748
|
if (!loginMethods) return true;
|
|
16669
16749
|
return loginMethods.length === 0 || isLoginMethodEnabled("ecosystem");
|
|
16670
16750
|
}, [loginMethods]);
|
|
16671
|
-
const showLoginWithVeChain =
|
|
16751
|
+
const showLoginWithVeChain = React10.useMemo(
|
|
16672
16752
|
() => isLoginMethodEnabled("vechain"),
|
|
16673
16753
|
[loginMethods]
|
|
16674
16754
|
);
|
|
16675
|
-
const showLoginWithDappKit =
|
|
16755
|
+
const showLoginWithDappKit = React10.useMemo(
|
|
16676
16756
|
() => isLoginMethodEnabled("dappkit"),
|
|
16677
16757
|
[loginMethods]
|
|
16678
16758
|
);
|
|
16679
|
-
const showLoginWithPasskey =
|
|
16759
|
+
const showLoginWithPasskey = React10.useMemo(
|
|
16680
16760
|
() => isLoginMethodEnabled("passkey"),
|
|
16681
16761
|
[loginMethods]
|
|
16682
16762
|
);
|
|
16683
|
-
const showLoginWithEmail =
|
|
16763
|
+
const showLoginWithEmail = React10.useMemo(
|
|
16684
16764
|
() => isLoginMethodEnabled("email"),
|
|
16685
16765
|
[loginMethods]
|
|
16686
16766
|
);
|
|
16687
|
-
const showLoginWithGoogle =
|
|
16767
|
+
const showLoginWithGoogle = React10.useMemo(
|
|
16688
16768
|
() => isLoginMethodEnabled("google"),
|
|
16689
16769
|
[loginMethods]
|
|
16690
16770
|
);
|
|
16691
|
-
const showMoreLogin =
|
|
16771
|
+
const showMoreLogin = React10.useMemo(
|
|
16692
16772
|
() => isLoginMethodEnabled("more"),
|
|
16693
16773
|
[loginMethods]
|
|
16694
16774
|
);
|
|
@@ -16744,8 +16824,8 @@ var useTransferERC20 = ({
|
|
|
16744
16824
|
}) => {
|
|
16745
16825
|
const queryClient = reactQuery.useQueryClient();
|
|
16746
16826
|
const { refresh } = useRefreshBalances();
|
|
16747
|
-
const buildClauses =
|
|
16748
|
-
if (!receiverAddress || !amount || !
|
|
16827
|
+
const buildClauses = React10.useCallback(async () => {
|
|
16828
|
+
if (!receiverAddress || !amount || !chunkRUIC653T_cjs.isValidAddress(receiverAddress))
|
|
16749
16829
|
throw new Error("Invalid receiver address or amount");
|
|
16750
16830
|
const clausesArray = [];
|
|
16751
16831
|
clausesArray.push({
|
|
@@ -16760,7 +16840,7 @@ var useTransferERC20 = ({
|
|
|
16760
16840
|
});
|
|
16761
16841
|
return clausesArray;
|
|
16762
16842
|
}, [receiverAddress, amount]);
|
|
16763
|
-
const handleOnSuccess =
|
|
16843
|
+
const handleOnSuccess = React10.useCallback(async () => {
|
|
16764
16844
|
await refresh();
|
|
16765
16845
|
onSuccess?.();
|
|
16766
16846
|
}, [onSuccess, fromAddress, queryClient]);
|
|
@@ -16768,7 +16848,7 @@ var useTransferERC20 = ({
|
|
|
16768
16848
|
signerAccountAddress: fromAddress,
|
|
16769
16849
|
privyUIOptions: {
|
|
16770
16850
|
title: "Confirm Transfer",
|
|
16771
|
-
description: `Transfer ${amount} ${tokenName} to ${
|
|
16851
|
+
description: `Transfer ${amount} ${tokenName} to ${chunkRUIC653T_cjs.humanAddress(
|
|
16772
16852
|
receiverAddress
|
|
16773
16853
|
)}`,
|
|
16774
16854
|
buttonText: "Sign to continue"
|
|
@@ -16793,8 +16873,8 @@ var useTransferVET = ({
|
|
|
16793
16873
|
onError
|
|
16794
16874
|
}) => {
|
|
16795
16875
|
const { refresh } = useRefreshBalances();
|
|
16796
|
-
const buildClauses =
|
|
16797
|
-
if (!receiverAddress || !amount || !
|
|
16876
|
+
const buildClauses = React10.useCallback(async () => {
|
|
16877
|
+
if (!receiverAddress || !amount || !chunkRUIC653T_cjs.isValidAddress(receiverAddress))
|
|
16798
16878
|
throw new Error("Invalid receiver address or amount");
|
|
16799
16879
|
if (isNaN(Number(amount))) {
|
|
16800
16880
|
throw new Error("Invalid amount");
|
|
@@ -16818,7 +16898,7 @@ var useTransferVET = ({
|
|
|
16818
16898
|
signerAccountAddress: fromAddress,
|
|
16819
16899
|
privyUIOptions: {
|
|
16820
16900
|
title: "Confirm Transfer",
|
|
16821
|
-
description: `Transfer ${amount} VET to ${
|
|
16901
|
+
description: `Transfer ${amount} VET to ${chunkRUIC653T_cjs.humanAddress(
|
|
16822
16902
|
receiverAddress
|
|
16823
16903
|
)}`,
|
|
16824
16904
|
buttonText: "Sign to continue"
|
|
@@ -16839,13 +16919,13 @@ var useTransferVET = ({
|
|
|
16839
16919
|
};
|
|
16840
16920
|
};
|
|
16841
16921
|
var useSignMessage2 = () => {
|
|
16842
|
-
const [isSigningPending, setIsSigningPending] =
|
|
16843
|
-
const [signature, setSignature] =
|
|
16844
|
-
const [error, setError] =
|
|
16922
|
+
const [isSigningPending, setIsSigningPending] = React10.useState(false);
|
|
16923
|
+
const [signature, setSignature] = React10.useState(null);
|
|
16924
|
+
const [error, setError] = React10.useState(null);
|
|
16845
16925
|
const { connection } = useWallet();
|
|
16846
16926
|
const { vendor } = dappKitReact.useConnex();
|
|
16847
16927
|
const privyWalletProvider = usePrivyWalletProvider();
|
|
16848
|
-
const signMessage =
|
|
16928
|
+
const signMessage = React10.useCallback(
|
|
16849
16929
|
async (message) => {
|
|
16850
16930
|
setIsSigningPending(true);
|
|
16851
16931
|
setError(null);
|
|
@@ -16875,7 +16955,7 @@ var useSignMessage2 = () => {
|
|
|
16875
16955
|
},
|
|
16876
16956
|
[connection, privyWalletProvider]
|
|
16877
16957
|
);
|
|
16878
|
-
const reset =
|
|
16958
|
+
const reset = React10.useCallback(() => {
|
|
16879
16959
|
setIsSigningPending(false);
|
|
16880
16960
|
setSignature(null);
|
|
16881
16961
|
setError(null);
|
|
@@ -16889,13 +16969,13 @@ var useSignMessage2 = () => {
|
|
|
16889
16969
|
};
|
|
16890
16970
|
};
|
|
16891
16971
|
var useSignTypedData2 = () => {
|
|
16892
|
-
const [isSigningPending, setIsSigningPending] =
|
|
16893
|
-
const [signature, setSignature] =
|
|
16894
|
-
const [error, setError] =
|
|
16972
|
+
const [isSigningPending, setIsSigningPending] = React10.useState(false);
|
|
16973
|
+
const [signature, setSignature] = React10.useState(null);
|
|
16974
|
+
const [error, setError] = React10.useState(null);
|
|
16895
16975
|
const { connection } = useWallet();
|
|
16896
16976
|
const privyWalletProvider = usePrivyWalletProvider();
|
|
16897
16977
|
const { signTypedData: signTypedDataDappKit } = dappKitReact.useWallet();
|
|
16898
|
-
const signTypedData =
|
|
16978
|
+
const signTypedData = React10.useCallback(
|
|
16899
16979
|
async (data) => {
|
|
16900
16980
|
setIsSigningPending(true);
|
|
16901
16981
|
setError(null);
|
|
@@ -16927,7 +17007,7 @@ var useSignTypedData2 = () => {
|
|
|
16927
17007
|
},
|
|
16928
17008
|
[connection, privyWalletProvider]
|
|
16929
17009
|
);
|
|
16930
|
-
const reset =
|
|
17010
|
+
const reset = React10.useCallback(() => {
|
|
16931
17011
|
setIsSigningPending(false);
|
|
16932
17012
|
setSignature(null);
|
|
16933
17013
|
setError(null);
|
|
@@ -16966,7 +17046,7 @@ var useLoginWithOAuth2 = () => {
|
|
|
16966
17046
|
};
|
|
16967
17047
|
var useCrossAppConnectionCache = () => {
|
|
16968
17048
|
const CACHE_KEY = "vechain_kit_cross_app_connection";
|
|
16969
|
-
const setConnectionCache =
|
|
17049
|
+
const setConnectionCache = React10.useCallback(
|
|
16970
17050
|
(ecosystemApp) => {
|
|
16971
17051
|
const cacheData = {
|
|
16972
17052
|
timestamp: Date.now(),
|
|
@@ -16976,12 +17056,12 @@ var useCrossAppConnectionCache = () => {
|
|
|
16976
17056
|
},
|
|
16977
17057
|
[]
|
|
16978
17058
|
);
|
|
16979
|
-
const getConnectionCache =
|
|
17059
|
+
const getConnectionCache = React10.useCallback(() => {
|
|
16980
17060
|
const cached = localStorage.getItem(CACHE_KEY);
|
|
16981
17061
|
if (!cached) return null;
|
|
16982
17062
|
return JSON.parse(cached);
|
|
16983
17063
|
}, []);
|
|
16984
|
-
const clearConnectionCache =
|
|
17064
|
+
const clearConnectionCache = React10.useCallback(() => {
|
|
16985
17065
|
localStorage.removeItem(CACHE_KEY);
|
|
16986
17066
|
}, []);
|
|
16987
17067
|
return {
|
|
@@ -16995,14 +17075,14 @@ var useCrossAppConnectionCache = () => {
|
|
|
16995
17075
|
var useLoginWithVeChain = () => {
|
|
16996
17076
|
const { login: loginWithVeChain } = usePrivyCrossAppSdk();
|
|
16997
17077
|
const { setConnectionCache } = useCrossAppConnectionCache();
|
|
16998
|
-
const { data: appsInfo } = useFetchAppInfo([
|
|
17078
|
+
const { data: appsInfo } = useFetchAppInfo([chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID]);
|
|
16999
17079
|
const login = async () => {
|
|
17000
17080
|
try {
|
|
17001
|
-
await loginWithVeChain(
|
|
17081
|
+
await loginWithVeChain(chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID);
|
|
17002
17082
|
setConnectionCache({
|
|
17003
17083
|
name: "VeChain",
|
|
17004
|
-
logoUrl: appsInfo?.[
|
|
17005
|
-
appId:
|
|
17084
|
+
logoUrl: appsInfo?.[chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID]?.logo_url,
|
|
17085
|
+
appId: chunkRUIC653T_cjs.VECHAIN_PRIVY_APP_ID
|
|
17006
17086
|
});
|
|
17007
17087
|
} catch (error) {
|
|
17008
17088
|
throw handlePopupError({
|
|
@@ -17016,8 +17096,8 @@ var useLoginWithVeChain = () => {
|
|
|
17016
17096
|
return { login };
|
|
17017
17097
|
};
|
|
17018
17098
|
var useIsPWA = () => {
|
|
17019
|
-
const [isPWA, setIsPWA] =
|
|
17020
|
-
|
|
17099
|
+
const [isPWA, setIsPWA] = React10.useState(true);
|
|
17100
|
+
React10.useEffect(() => {
|
|
17021
17101
|
const checkIsPWA = () => {
|
|
17022
17102
|
const isStandalone = window.matchMedia("(display-mode: standalone)").matches || window.standalone || document.referrer.includes("android-app://");
|
|
17023
17103
|
setIsPWA(isStandalone);
|
|
@@ -17040,7 +17120,7 @@ var useCall = ({
|
|
|
17040
17120
|
mapResponse
|
|
17041
17121
|
}) => {
|
|
17042
17122
|
const { thor } = dappKitReact.useConnex();
|
|
17043
|
-
const queryFn =
|
|
17123
|
+
const queryFn = React10.useCallback(async () => {
|
|
17044
17124
|
try {
|
|
17045
17125
|
const functionFragment2 = contractInterface21?.getFunction(method35)?.format("json");
|
|
17046
17126
|
if (!functionFragment2)
|
|
@@ -17060,11 +17140,11 @@ var useCall = ({
|
|
|
17060
17140
|
throw error;
|
|
17061
17141
|
}
|
|
17062
17142
|
}, [args, contractAddress, contractInterface21, mapResponse, method35, thor]);
|
|
17063
|
-
const queryKey =
|
|
17143
|
+
const queryKey = React10.useMemo(
|
|
17064
17144
|
() => getCallKey({ method: method35, keyArgs: keyArgs || args }),
|
|
17065
17145
|
[method35, keyArgs, args]
|
|
17066
17146
|
);
|
|
17067
|
-
const enableQuery =
|
|
17147
|
+
const enableQuery = React10.useMemo(() => enabled, [enabled]);
|
|
17068
17148
|
return reactQuery.useQuery({
|
|
17069
17149
|
queryFn,
|
|
17070
17150
|
queryKey,
|
|
@@ -17075,7 +17155,7 @@ var getCallKey = ({ method: method35, keyArgs = [] }) => {
|
|
|
17075
17155
|
return ["VECHAIN_KIT_", method35, ...keyArgs];
|
|
17076
17156
|
};
|
|
17077
17157
|
var useLocalStorage = (key, initialValue) => {
|
|
17078
|
-
const [storedValue, setStoredValue] =
|
|
17158
|
+
const [storedValue, setStoredValue] = React10.useState(() => {
|
|
17079
17159
|
try {
|
|
17080
17160
|
const item = window.localStorage.getItem(key);
|
|
17081
17161
|
return item ? JSON.parse(item) : initialValue;
|
|
@@ -17084,7 +17164,7 @@ var useLocalStorage = (key, initialValue) => {
|
|
|
17084
17164
|
return initialValue;
|
|
17085
17165
|
}
|
|
17086
17166
|
});
|
|
17087
|
-
|
|
17167
|
+
React10.useEffect(() => {
|
|
17088
17168
|
window.localStorage.setItem(key, JSON.stringify(storedValue));
|
|
17089
17169
|
}, [key, storedValue]);
|
|
17090
17170
|
return [storedValue, setStoredValue];
|
|
@@ -17114,7 +17194,7 @@ var useEcosystemShortcuts = () => {
|
|
|
17114
17194
|
isShortcut
|
|
17115
17195
|
};
|
|
17116
17196
|
};
|
|
17117
|
-
var PrivyWalletProviderContext =
|
|
17197
|
+
var PrivyWalletProviderContext = React10.createContext(null);
|
|
17118
17198
|
var PrivyWalletProvider = ({
|
|
17119
17199
|
children,
|
|
17120
17200
|
nodeUrl,
|
|
@@ -17265,9 +17345,9 @@ var PrivyWalletProvider = ({
|
|
|
17265
17345
|
clauses.push(
|
|
17266
17346
|
sdkCore.Clause.callFunction(
|
|
17267
17347
|
sdkCore.Address.of(
|
|
17268
|
-
|
|
17348
|
+
chunkRUIC653T_cjs.getConfig(network.type).accountFactoryAddress
|
|
17269
17349
|
),
|
|
17270
|
-
sdkCore.ABIContract.ofAbi(
|
|
17350
|
+
sdkCore.ABIContract.ofAbi(chunkFID67WC3_cjs.SimpleAccountFactoryABI).getFunction(
|
|
17271
17351
|
"createAccount"
|
|
17272
17352
|
),
|
|
17273
17353
|
[connectedWallet.address ?? ""]
|
|
@@ -17277,7 +17357,7 @@ var PrivyWalletProvider = ({
|
|
|
17277
17357
|
clauses.push(
|
|
17278
17358
|
sdkCore.Clause.callFunction(
|
|
17279
17359
|
sdkCore.Address.of(smartAccount.address),
|
|
17280
|
-
sdkCore.ABIContract.ofAbi(
|
|
17360
|
+
sdkCore.ABIContract.ofAbi(chunkFID67WC3_cjs.SimpleAccountABI).getFunction(
|
|
17281
17361
|
"executeBatchWithAuthorization"
|
|
17282
17362
|
),
|
|
17283
17363
|
[
|
|
@@ -17340,9 +17420,9 @@ var PrivyWalletProvider = ({
|
|
|
17340
17420
|
clauses.push(
|
|
17341
17421
|
sdkCore.Clause.callFunction(
|
|
17342
17422
|
sdkCore.Address.of(
|
|
17343
|
-
|
|
17423
|
+
chunkRUIC653T_cjs.getConfig(network.type).accountFactoryAddress
|
|
17344
17424
|
),
|
|
17345
|
-
sdkCore.ABIContract.ofAbi(
|
|
17425
|
+
sdkCore.ABIContract.ofAbi(chunkFID67WC3_cjs.SimpleAccountFactoryABI).getFunction(
|
|
17346
17426
|
"createAccount"
|
|
17347
17427
|
),
|
|
17348
17428
|
[connectedWallet.address ?? ""]
|
|
@@ -17354,7 +17434,7 @@ var PrivyWalletProvider = ({
|
|
|
17354
17434
|
clauses.push(
|
|
17355
17435
|
sdkCore.Clause.callFunction(
|
|
17356
17436
|
sdkCore.Address.of(smartAccount.address ?? ""),
|
|
17357
|
-
sdkCore.ABIContract.ofAbi(
|
|
17437
|
+
sdkCore.ABIContract.ofAbi(chunkFID67WC3_cjs.SimpleAccountABI).getFunction(
|
|
17358
17438
|
"executeWithAuthorization"
|
|
17359
17439
|
),
|
|
17360
17440
|
[
|
|
@@ -17389,10 +17469,10 @@ var PrivyWalletProvider = ({
|
|
|
17389
17469
|
[
|
|
17390
17470
|
{
|
|
17391
17471
|
privateKey: Buffer.from(
|
|
17392
|
-
|
|
17472
|
+
chunkRUIC653T_cjs.randomTransactionUser.privateKey.slice(2),
|
|
17393
17473
|
"hex"
|
|
17394
17474
|
),
|
|
17395
|
-
address:
|
|
17475
|
+
address: chunkRUIC653T_cjs.randomTransactionUser.address
|
|
17396
17476
|
}
|
|
17397
17477
|
],
|
|
17398
17478
|
{ delegator: { delegatorUrl } }
|
|
@@ -17403,11 +17483,11 @@ var PrivyWalletProvider = ({
|
|
|
17403
17483
|
true
|
|
17404
17484
|
);
|
|
17405
17485
|
const signer = await providerWithDelegationEnabled.getSigner(
|
|
17406
|
-
|
|
17486
|
+
chunkRUIC653T_cjs.randomTransactionUser.address
|
|
17407
17487
|
);
|
|
17408
17488
|
const txInput = sdkNetwork.signerUtils.transactionBodyToTransactionRequestInput(
|
|
17409
17489
|
txBody,
|
|
17410
|
-
|
|
17490
|
+
chunkRUIC653T_cjs.randomTransactionUser.address
|
|
17411
17491
|
);
|
|
17412
17492
|
const rawDelegateSigned = await signer.signTransaction(txInput);
|
|
17413
17493
|
const { id } = await fetch(`${nodeUrl}/transactions`, {
|
|
@@ -17446,7 +17526,7 @@ var PrivyWalletProvider = ({
|
|
|
17446
17526
|
PrivyWalletProviderContext.Provider,
|
|
17447
17527
|
{
|
|
17448
17528
|
value: {
|
|
17449
|
-
accountFactory:
|
|
17529
|
+
accountFactory: chunkRUIC653T_cjs.getConfig(network.type).accountFactoryAddress,
|
|
17450
17530
|
sendTransaction,
|
|
17451
17531
|
signMessage,
|
|
17452
17532
|
signTypedData,
|
|
@@ -17458,7 +17538,7 @@ var PrivyWalletProvider = ({
|
|
|
17458
17538
|
);
|
|
17459
17539
|
};
|
|
17460
17540
|
var usePrivyWalletProvider = () => {
|
|
17461
|
-
const context =
|
|
17541
|
+
const context = React10.useContext(PrivyWalletProviderContext);
|
|
17462
17542
|
if (!context) {
|
|
17463
17543
|
throw new Error(
|
|
17464
17544
|
"usePrivyWalletProvider must be used within a PrivyWalletProvider"
|
|
@@ -17502,9 +17582,9 @@ var DEFAULT_PRIVY_ECOSYSTEM_APP_IDS = [
|
|
|
17502
17582
|
"clv9sfos20j6x1431ga80d95f"
|
|
17503
17583
|
//mughsot
|
|
17504
17584
|
];
|
|
17505
|
-
var VeChainKitContext =
|
|
17585
|
+
var VeChainKitContext = React10.createContext(null);
|
|
17506
17586
|
var useVeChainKitConfig = () => {
|
|
17507
|
-
const context =
|
|
17587
|
+
const context = React10.useContext(VeChainKitContext);
|
|
17508
17588
|
if (!context) {
|
|
17509
17589
|
throw new Error("useVeChainKitConfig must be used within VeChainKit");
|
|
17510
17590
|
}
|
|
@@ -17564,7 +17644,7 @@ var VeChainKitProvider = (props) => {
|
|
|
17564
17644
|
allowCustomTokens
|
|
17565
17645
|
} = validatedProps;
|
|
17566
17646
|
const validatedLoginMethods = loginMethods;
|
|
17567
|
-
const allowedEcosystemApps =
|
|
17647
|
+
const allowedEcosystemApps = React10.useMemo(() => {
|
|
17568
17648
|
const userEcosystemMethods = validatedLoginMethods?.find(
|
|
17569
17649
|
(method35) => method35.method === "ecosystem"
|
|
17570
17650
|
);
|
|
@@ -17578,7 +17658,7 @@ var VeChainKitProvider = (props) => {
|
|
|
17578
17658
|
privyAppId = privy.appId;
|
|
17579
17659
|
privyClientId = privy.clientId;
|
|
17580
17660
|
}
|
|
17581
|
-
|
|
17661
|
+
React10.useEffect(() => {
|
|
17582
17662
|
initializeI18n(i18n_default);
|
|
17583
17663
|
if (language) {
|
|
17584
17664
|
i18n_default.changeLanguage(language);
|
|
@@ -17646,8 +17726,8 @@ var VeChainKitProvider = (props) => {
|
|
|
17646
17726
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17647
17727
|
dappKitReact.DAppKitProvider,
|
|
17648
17728
|
{
|
|
17649
|
-
nodeUrl: network.nodeUrl ??
|
|
17650
|
-
genesis:
|
|
17729
|
+
nodeUrl: network.nodeUrl ?? chunkRUIC653T_cjs.getConfig(network.type).nodeUrl,
|
|
17730
|
+
genesis: chunkRUIC653T_cjs.getConfig(network.type).network.genesis,
|
|
17651
17731
|
i18n: i18nConfig,
|
|
17652
17732
|
language,
|
|
17653
17733
|
logLevel: dappKit.logLevel,
|
|
@@ -17682,7 +17762,7 @@ var VeChainKitProvider = (props) => {
|
|
|
17682
17762
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17683
17763
|
PrivyWalletProvider,
|
|
17684
17764
|
{
|
|
17685
|
-
nodeUrl: network.nodeUrl ??
|
|
17765
|
+
nodeUrl: network.nodeUrl ?? chunkRUIC653T_cjs.getConfig(network.type).nodeUrl,
|
|
17686
17766
|
delegatorUrl: feeDelegation.delegatorUrl,
|
|
17687
17767
|
delegateAllTransactions: feeDelegation.delegateAllTransactions,
|
|
17688
17768
|
children: /* @__PURE__ */ jsxRuntime.jsx(ModalProvider, { children })
|
|
@@ -17705,14 +17785,14 @@ var variants = {
|
|
|
17705
17785
|
overflowX: "hidden",
|
|
17706
17786
|
maxHeight: "550px",
|
|
17707
17787
|
borderRadius: "24px",
|
|
17708
|
-
backgroundColor: props.colorMode === "dark" ? "#
|
|
17788
|
+
backgroundColor: props.colorMode === "dark" ? "#18181b" : "white"
|
|
17709
17789
|
},
|
|
17710
17790
|
closeButton: {
|
|
17711
17791
|
borderRadius: "50%"
|
|
17712
17792
|
},
|
|
17713
17793
|
header: {
|
|
17714
17794
|
w: "full",
|
|
17715
|
-
color: props.colorMode === "dark" ? "#dfdfdd" : "#
|
|
17795
|
+
color: props.colorMode === "dark" ? "#dfdfdd" : "#2e2e2e",
|
|
17716
17796
|
fontSize: "md",
|
|
17717
17797
|
fontWeight: "700",
|
|
17718
17798
|
textAlign: "center"
|
|
@@ -17731,7 +17811,7 @@ var variants = {
|
|
|
17731
17811
|
pointerEvents: "auto",
|
|
17732
17812
|
boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.1)",
|
|
17733
17813
|
py: "10px",
|
|
17734
|
-
backgroundColor: props.colorMode === "dark" ? "#
|
|
17814
|
+
backgroundColor: props.colorMode === "dark" ? "#18181b" : "white"
|
|
17735
17815
|
},
|
|
17736
17816
|
closeButton: {
|
|
17737
17817
|
borderRadius: "50%",
|
|
@@ -17753,7 +17833,11 @@ var variants2 = {
|
|
|
17753
17833
|
body: {
|
|
17754
17834
|
borderRadius: "12px",
|
|
17755
17835
|
backgroundColor: props.colorMode === "dark" ? "#1f1f1e" : "white",
|
|
17756
|
-
border: props.colorMode === "dark" ? "1px solid #2d2d2d" : "1px solid #eaeaea"
|
|
17836
|
+
border: props.colorMode === "dark" ? "1px solid #2d2d2d" : "1px solid #eaeaea",
|
|
17837
|
+
p: 5
|
|
17838
|
+
},
|
|
17839
|
+
footer: {
|
|
17840
|
+
p: 5
|
|
17757
17841
|
}
|
|
17758
17842
|
}),
|
|
17759
17843
|
featureAnnouncement: (props) => definePartsStyle2({
|
|
@@ -17897,12 +17981,12 @@ var variants3 = {
|
|
|
17897
17981
|
})),
|
|
17898
17982
|
mainContentButton: react.defineStyle(({ colorMode }) => ({
|
|
17899
17983
|
width: "100%",
|
|
17900
|
-
backgroundColor: colorMode === "dark" ? "
|
|
17984
|
+
backgroundColor: colorMode === "dark" ? "#ffffff05" : "blackAlpha.50",
|
|
17901
17985
|
borderRadius: "xl",
|
|
17902
17986
|
p: 3,
|
|
17903
17987
|
cursor: "pointer",
|
|
17904
17988
|
_hover: {
|
|
17905
|
-
backgroundColor: colorMode === "dark" ? "
|
|
17989
|
+
backgroundColor: colorMode === "dark" ? "#ffffff0d" : "blackAlpha.200"
|
|
17906
17990
|
}
|
|
17907
17991
|
}))
|
|
17908
17992
|
};
|
|
@@ -17983,7 +18067,7 @@ var VechainKitThemeProvider = ({
|
|
|
17983
18067
|
children,
|
|
17984
18068
|
darkMode = false
|
|
17985
18069
|
}) => {
|
|
17986
|
-
const theme =
|
|
18070
|
+
const theme = React10.useMemo(
|
|
17987
18071
|
() => ({
|
|
17988
18072
|
...VechainKitTheme,
|
|
17989
18073
|
config: {
|
|
@@ -18002,7 +18086,7 @@ var VechainKitThemeProvider = ({
|
|
|
18002
18086
|
|
|
18003
18087
|
Object.defineProperty(exports, "getConfig", {
|
|
18004
18088
|
enumerable: true,
|
|
18005
|
-
get: function () { return
|
|
18089
|
+
get: function () { return chunkRUIC653T_cjs.getConfig; }
|
|
18006
18090
|
});
|
|
18007
18091
|
Object.defineProperty(exports, "useMfaEnrollment", {
|
|
18008
18092
|
enumerable: true,
|