@vechain/vechain-kit 1.5.1 → 1.5.3
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/index.cjs +135 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -28
- package/dist/index.d.ts +24 -28
- package/dist/index.js +136 -101
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { initReactI18next, useTranslation } from 'react-i18next';
|
|
|
17
17
|
import { abi, Transaction } from 'thor-devkit';
|
|
18
18
|
import imageCompression from 'browser-image-compression';
|
|
19
19
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
20
|
-
import { Interface, isAddress, namehash, ZeroAddress, ethers } from 'ethers';
|
|
20
|
+
import { Interface, formatEther as formatEther$1, isAddress, namehash, ZeroAddress, parseEther as parseEther$1, ethers } from 'ethers';
|
|
21
21
|
import { z } from 'zod';
|
|
22
22
|
import { useAccount, createConfig, http, WagmiProvider, useConnect, useSignTypedData, useSignMessage, useDisconnect } from 'wagmi';
|
|
23
23
|
import { toPrivyWalletConnector } from '@privy-io/cross-app-connect/rainbow-kit';
|
|
@@ -2702,7 +2702,14 @@ var getVeDelegateBalance = async (thor, network, address) => {
|
|
|
2702
2702
|
const functionFragment2 = ERC20Interface.getFunction("balanceOf").format("json");
|
|
2703
2703
|
const res = await thor.account(getConfig(network).veDelegateTokenContractAddress).method(JSON.parse(functionFragment2)).call(address);
|
|
2704
2704
|
if (res.reverted) throw new Error("Reverted");
|
|
2705
|
-
|
|
2705
|
+
const original = res.decoded[0];
|
|
2706
|
+
const scaled = formatEther$1(original);
|
|
2707
|
+
const formatted = scaled === "0" ? "0" : humanNumber(scaled);
|
|
2708
|
+
return {
|
|
2709
|
+
original,
|
|
2710
|
+
scaled,
|
|
2711
|
+
formatted
|
|
2712
|
+
};
|
|
2706
2713
|
};
|
|
2707
2714
|
var getVeDelegateBalanceQueryKey = (address) => [
|
|
2708
2715
|
"VECHAIN_KIT_VE_DELEGATE_BALANCE",
|
|
@@ -3569,40 +3576,44 @@ var useBalances = ({ address = "" }) => {
|
|
|
3569
3576
|
const balances = [
|
|
3570
3577
|
{
|
|
3571
3578
|
address: contractAddresses.vet,
|
|
3572
|
-
value:
|
|
3573
|
-
symbol: "VET"
|
|
3579
|
+
value: vetData?.balance || "0",
|
|
3580
|
+
symbol: "VET",
|
|
3581
|
+
priceAddress: contractAddresses.vet
|
|
3574
3582
|
},
|
|
3575
3583
|
{
|
|
3576
3584
|
address: contractAddresses.vtho,
|
|
3577
|
-
value:
|
|
3578
|
-
symbol: "VTHO"
|
|
3585
|
+
value: vetData?.energy || "0",
|
|
3586
|
+
symbol: "VTHO",
|
|
3587
|
+
priceAddress: contractAddresses.vtho
|
|
3579
3588
|
},
|
|
3580
3589
|
{
|
|
3581
3590
|
address: contractAddresses.b3tr,
|
|
3582
|
-
value:
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
symbol: "B3TR"
|
|
3591
|
+
value: b3trBalance?.scaled ?? "0",
|
|
3592
|
+
symbol: "B3TR",
|
|
3593
|
+
priceAddress: contractAddresses.b3tr
|
|
3586
3594
|
},
|
|
3587
3595
|
{
|
|
3588
3596
|
address: contractAddresses.vot3,
|
|
3589
|
-
value:
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3597
|
+
value: vot3Balance?.scaled ?? "0",
|
|
3598
|
+
symbol: "VOT3",
|
|
3599
|
+
priceAddress: contractAddresses.b3tr
|
|
3600
|
+
// using b3tr price for vot3
|
|
3593
3601
|
},
|
|
3594
3602
|
{
|
|
3595
3603
|
address: contractAddresses.veDelegate,
|
|
3596
|
-
value:
|
|
3597
|
-
symbol: "veDelegate"
|
|
3604
|
+
value: veDelegateBalance?.scaled ?? "0",
|
|
3605
|
+
symbol: "veDelegate",
|
|
3606
|
+
priceAddress: contractAddresses.b3tr
|
|
3607
|
+
// using b3tr price for veDelegate
|
|
3598
3608
|
}
|
|
3599
3609
|
];
|
|
3600
3610
|
customTokenBalances.forEach((token) => {
|
|
3601
3611
|
if (token) {
|
|
3602
3612
|
balances.push({
|
|
3603
3613
|
address: token.address,
|
|
3604
|
-
value:
|
|
3605
|
-
symbol: token.symbol
|
|
3614
|
+
value: token.scaled,
|
|
3615
|
+
symbol: token.symbol,
|
|
3616
|
+
priceAddress: token.address
|
|
3606
3617
|
});
|
|
3607
3618
|
}
|
|
3608
3619
|
});
|
|
@@ -3613,14 +3624,15 @@ var useBalances = ({ address = "" }) => {
|
|
|
3613
3624
|
];
|
|
3614
3625
|
const totalBalance = balances.reduce((acc, { address: address2, value }) => {
|
|
3615
3626
|
const price = prices.find((p) => p.address === address2)?.price || 0;
|
|
3616
|
-
return acc + value * price;
|
|
3627
|
+
return acc + Number(value) * price;
|
|
3617
3628
|
}, 0);
|
|
3618
3629
|
const tokens = balances.reduce(
|
|
3619
3630
|
(acc, balance) => {
|
|
3620
3631
|
acc[balance.symbol] = {
|
|
3621
3632
|
...balance,
|
|
3622
|
-
|
|
3623
|
-
|
|
3633
|
+
value: balance.value,
|
|
3634
|
+
price: prices.find((p) => p.address === balance.priceAddress)?.price || 0,
|
|
3635
|
+
usdValue: (prices.find((p) => p.address === balance.priceAddress)?.price || 0) * Number(balance.value)
|
|
3624
3636
|
};
|
|
3625
3637
|
return acc;
|
|
3626
3638
|
},
|
|
@@ -4966,7 +4978,7 @@ var AddressDisplay = ({
|
|
|
4966
4978
|
// package.json
|
|
4967
4979
|
var package_default = {
|
|
4968
4980
|
name: "@vechain/vechain-kit",
|
|
4969
|
-
version: "1.5.
|
|
4981
|
+
version: "1.5.3",
|
|
4970
4982
|
private: false,
|
|
4971
4983
|
homepage: "https://github.com/vechain/vechain-kit",
|
|
4972
4984
|
repository: "github:vechain/vechain-kit",
|
|
@@ -5100,7 +5112,8 @@ var VersionFooter = ({ ...props }) => {
|
|
|
5100
5112
|
w: "70px",
|
|
5101
5113
|
h: "auto",
|
|
5102
5114
|
opacity: 0.4,
|
|
5103
|
-
mr: 1
|
|
5115
|
+
mr: 1,
|
|
5116
|
+
ml: "-16px"
|
|
5104
5117
|
}
|
|
5105
5118
|
),
|
|
5106
5119
|
/* @__PURE__ */ jsxs(
|
|
@@ -5374,7 +5387,7 @@ var AddressDisplayCard = ({
|
|
|
5374
5387
|
children: [
|
|
5375
5388
|
/* @__PURE__ */ jsx(Text, { fontSize: "sm", fontWeight: "medium", children: t("Balance") }),
|
|
5376
5389
|
/* @__PURE__ */ jsx(Skeleton, { isLoaded: !isLoading, children: /* @__PURE__ */ jsxs(Text, { fontSize: "xs", opacity: 0.5, children: [
|
|
5377
|
-
compactFormatter2.format(displayBalance),
|
|
5390
|
+
compactFormatter2.format(Number(displayBalance)),
|
|
5378
5391
|
displaySymbol && ` ${displaySymbol}`
|
|
5379
5392
|
] }) })
|
|
5380
5393
|
]
|
|
@@ -6056,7 +6069,7 @@ var MainContent = ({ setCurrentContent, onClose }) => {
|
|
|
6056
6069
|
),
|
|
6057
6070
|
/* @__PURE__ */ jsx(ConnectionOptionsStack, {})
|
|
6058
6071
|
] }),
|
|
6059
|
-
/* @__PURE__ */ jsx(ModalFooter, { children: /* @__PURE__ */ jsx(VersionFooter, {}) })
|
|
6072
|
+
/* @__PURE__ */ jsx(ModalFooter, { pt: 0, pb: "5px", children: /* @__PURE__ */ jsx(VersionFooter, {}) })
|
|
6060
6073
|
] });
|
|
6061
6074
|
};
|
|
6062
6075
|
var useFeatureAnnouncement = () => {
|
|
@@ -6162,7 +6175,7 @@ var DomainRequiredAlert = () => {
|
|
|
6162
6175
|
var AccountMainContent = ({ setCurrentContent, wallet }) => {
|
|
6163
6176
|
const { t } = useTranslation();
|
|
6164
6177
|
const { network } = useVeChainKitConfig();
|
|
6165
|
-
const {
|
|
6178
|
+
const { account } = useWallet();
|
|
6166
6179
|
return /* @__PURE__ */ jsxs(ScrollToTopWrapper, { children: [
|
|
6167
6180
|
/* @__PURE__ */ jsxs(StickyHeaderContainer, { children: [
|
|
6168
6181
|
/* @__PURE__ */ jsx(
|
|
@@ -6176,7 +6189,7 @@ var AccountMainContent = ({ setCurrentContent, wallet }) => {
|
|
|
6176
6189
|
})
|
|
6177
6190
|
}
|
|
6178
6191
|
),
|
|
6179
|
-
/* @__PURE__ */ jsx(ModalHeader, { children:
|
|
6192
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: t("Wallet") }),
|
|
6180
6193
|
/* @__PURE__ */ jsx(ModalCloseButton, {})
|
|
6181
6194
|
] }),
|
|
6182
6195
|
/* @__PURE__ */ jsx(ModalBody, { w: "full", children: /* @__PURE__ */ jsxs(
|
|
@@ -6204,14 +6217,23 @@ var AccountMainContent = ({ setCurrentContent, wallet }) => {
|
|
|
6204
6217
|
}
|
|
6205
6218
|
),
|
|
6206
6219
|
network?.type !== "main" && /* @__PURE__ */ jsx(
|
|
6207
|
-
|
|
6220
|
+
HStack,
|
|
6208
6221
|
{
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6222
|
+
w: "full",
|
|
6223
|
+
justifyContent: "flex-start",
|
|
6224
|
+
mt: "-10px",
|
|
6225
|
+
mb: "-10px",
|
|
6226
|
+
children: /* @__PURE__ */ jsx(
|
|
6227
|
+
Tag,
|
|
6228
|
+
{
|
|
6229
|
+
size: "xl",
|
|
6230
|
+
colorScheme: "orange",
|
|
6231
|
+
fontSize: "xs",
|
|
6232
|
+
p: 2,
|
|
6233
|
+
textTransform: "capitalize",
|
|
6234
|
+
children: `${network?.type} network`
|
|
6235
|
+
}
|
|
6236
|
+
)
|
|
6215
6237
|
}
|
|
6216
6238
|
),
|
|
6217
6239
|
/* @__PURE__ */ jsx(
|
|
@@ -6316,7 +6338,7 @@ var ActionButton = ({
|
|
|
6316
6338
|
}) => {
|
|
6317
6339
|
const { t } = useTranslation();
|
|
6318
6340
|
const { colorMode } = useColorMode();
|
|
6319
|
-
const baseBackgroundColor = backgroundColor ?? colorMode === "dark" ? "#
|
|
6341
|
+
const baseBackgroundColor = backgroundColor ?? colorMode === "dark" ? "#ffffff0a" : "#00000005";
|
|
6320
6342
|
return /* @__PURE__ */ jsx(
|
|
6321
6343
|
Button,
|
|
6322
6344
|
{
|
|
@@ -6331,7 +6353,7 @@ var ActionButton = ({
|
|
|
6331
6353
|
loadingText,
|
|
6332
6354
|
bgColor: baseBackgroundColor,
|
|
6333
6355
|
_hover: _hover ?? {
|
|
6334
|
-
backgroundColor: colorMode === "dark" ? "#
|
|
6356
|
+
backgroundColor: colorMode === "dark" ? "#ffffff12" : "blackAlpha.200"
|
|
6335
6357
|
},
|
|
6336
6358
|
...style,
|
|
6337
6359
|
children: /* @__PURE__ */ jsxs(HStack, { w: "full", justify: "space-between", children: [
|
|
@@ -6553,6 +6575,7 @@ var AssetIcons = ({
|
|
|
6553
6575
|
var compactFormatter3 = new Intl.NumberFormat("en-US", {
|
|
6554
6576
|
notation: "compact",
|
|
6555
6577
|
compactDisplay: "short",
|
|
6578
|
+
minimumFractionDigits: 2,
|
|
6556
6579
|
maximumFractionDigits: 2
|
|
6557
6580
|
});
|
|
6558
6581
|
var BalanceSection = ({
|
|
@@ -6643,12 +6666,12 @@ var BalanceSection = ({
|
|
|
6643
6666
|
style: {
|
|
6644
6667
|
width: "100%",
|
|
6645
6668
|
mt: 2,
|
|
6646
|
-
backgroundColor: isDark ? "#
|
|
6669
|
+
backgroundColor: isDark ? "#ffffff0a" : "blackAlpha.50",
|
|
6647
6670
|
borderRadius: "xl",
|
|
6648
6671
|
p: 3,
|
|
6649
6672
|
cursor: "pointer",
|
|
6650
6673
|
_hover: {
|
|
6651
|
-
backgroundColor: isDark ? "#
|
|
6674
|
+
backgroundColor: isDark ? "#ffffff12" : "blackAlpha.200"
|
|
6652
6675
|
},
|
|
6653
6676
|
justifyContent: "space-between"
|
|
6654
6677
|
}
|
|
@@ -7779,10 +7802,10 @@ var SelectTokenContent = ({ onSelectToken, onBack }) => {
|
|
|
7779
7802
|
const filteredTokens = allTokens.filter(
|
|
7780
7803
|
({ symbol }) => symbol.toLowerCase().includes(searchQuery.toLowerCase())
|
|
7781
7804
|
).sort((a, b) => {
|
|
7782
|
-
if (a.numericBalance > 0 !== b.numericBalance > 0) {
|
|
7783
|
-
return b.numericBalance > 0 ? 1 : -1;
|
|
7805
|
+
if (Number(a.numericBalance) > 0 !== Number(b.numericBalance) > 0) {
|
|
7806
|
+
return Number(b.numericBalance) > 0 ? 1 : -1;
|
|
7784
7807
|
}
|
|
7785
|
-
return b.numericBalance * b.price - a.numericBalance * a.price;
|
|
7808
|
+
return Number(b.numericBalance) * b.price - Number(a.numericBalance) * a.price;
|
|
7786
7809
|
});
|
|
7787
7810
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7788
7811
|
/* @__PURE__ */ jsxs(StickyHeaderContainer, { children: [
|
|
@@ -7834,13 +7857,13 @@ var SelectTokenContent = ({ onSelectToken, onBack }) => {
|
|
|
7834
7857
|
]
|
|
7835
7858
|
}
|
|
7836
7859
|
) : /* @__PURE__ */ jsx(VStack, { spacing: 2, align: "stretch", children: filteredTokens.map((token) => {
|
|
7837
|
-
const hasBalance = token.numericBalance > 0;
|
|
7838
|
-
const usdValue = token.numericBalance * token.price;
|
|
7860
|
+
const hasBalance = Number(token.numericBalance) > 0;
|
|
7861
|
+
const usdValue = Number(token.numericBalance) * token.price;
|
|
7839
7862
|
return /* @__PURE__ */ jsx(
|
|
7840
7863
|
AssetButton,
|
|
7841
7864
|
{
|
|
7842
7865
|
symbol: token.symbol,
|
|
7843
|
-
amount: token.numericBalance,
|
|
7866
|
+
amount: Number(token.numericBalance),
|
|
7844
7867
|
usdValue,
|
|
7845
7868
|
onClick: () => onSelectToken(token),
|
|
7846
7869
|
isDisabled: !hasBalance
|
|
@@ -7894,7 +7917,7 @@ var SendTokenContent = ({
|
|
|
7894
7917
|
} = useVechainDomain$1({ addressOrDomain: toAddressOrDomain });
|
|
7895
7918
|
const handleSetMaxAmount = () => {
|
|
7896
7919
|
if (selectedToken) {
|
|
7897
|
-
setValue("amount", selectedToken.numericBalance
|
|
7920
|
+
setValue("amount", selectedToken.numericBalance);
|
|
7898
7921
|
}
|
|
7899
7922
|
};
|
|
7900
7923
|
const onSubmit = async (data) => {
|
|
@@ -7908,8 +7931,8 @@ var SendTokenContent = ({
|
|
|
7908
7931
|
return;
|
|
7909
7932
|
}
|
|
7910
7933
|
if (selectedToken) {
|
|
7911
|
-
const numericAmount =
|
|
7912
|
-
if (numericAmount > selectedToken.numericBalance) {
|
|
7934
|
+
const numericAmount = parseEther$1(data.amount);
|
|
7935
|
+
if (numericAmount > parseEther$1(selectedToken.numericBalance)) {
|
|
7913
7936
|
setError("amount", {
|
|
7914
7937
|
type: "manual",
|
|
7915
7938
|
message: t(`Insufficient {{symbol}} balance`, {
|
|
@@ -8095,7 +8118,9 @@ var SendTokenContent = ({
|
|
|
8095
8118
|
overflow: "hidden",
|
|
8096
8119
|
textOverflow: "ellipsis",
|
|
8097
8120
|
children: compactFormatter4.format(
|
|
8098
|
-
|
|
8121
|
+
Number(
|
|
8122
|
+
selectedToken.numericBalance
|
|
8123
|
+
)
|
|
8099
8124
|
)
|
|
8100
8125
|
}
|
|
8101
8126
|
)
|
|
@@ -8312,7 +8337,7 @@ var SendTokenSummaryContent = ({
|
|
|
8312
8337
|
domain: account?.domain,
|
|
8313
8338
|
imageSrc: account?.image ?? "",
|
|
8314
8339
|
imageAlt: "From account",
|
|
8315
|
-
balance: selectedToken.numericBalance,
|
|
8340
|
+
balance: Number(selectedToken.numericBalance),
|
|
8316
8341
|
tokenAddress: selectedToken.address
|
|
8317
8342
|
}
|
|
8318
8343
|
),
|
|
@@ -8615,7 +8640,7 @@ var ExistingDomainsList = ({
|
|
|
8615
8640
|
Tag,
|
|
8616
8641
|
{
|
|
8617
8642
|
size: "sm",
|
|
8618
|
-
bg: isDark ? "#
|
|
8643
|
+
bg: isDark ? "#ffffff0a" : "whiteAlpha.100",
|
|
8619
8644
|
color: isDark ? "whiteAlpha.900" : "blackAlpha.600",
|
|
8620
8645
|
px: 3,
|
|
8621
8646
|
py: 1,
|
|
@@ -9357,6 +9382,7 @@ var en_default = {
|
|
|
9357
9382
|
"Search dApps": "Search dApps",
|
|
9358
9383
|
"Search for a domain": "Search for a domain",
|
|
9359
9384
|
"Secured by": "Secured by",
|
|
9385
|
+
"Select Additional Login Method": "Select Additional Login Method",
|
|
9360
9386
|
"Select Token": "Select Token",
|
|
9361
9387
|
"Select an app": "Select an app",
|
|
9362
9388
|
"Select token": "Select token",
|
|
@@ -9836,6 +9862,7 @@ var de_default = {
|
|
|
9836
9862
|
"Search dApps": "dApps durchsuchen",
|
|
9837
9863
|
"Search for a domain": "Nach einer Domain suchen",
|
|
9838
9864
|
"Secured by": "Gesichert durch",
|
|
9865
|
+
"Select Additional Login Method": "Zus\xE4tzliche Anmeldemethode ausw\xE4hlen",
|
|
9839
9866
|
"Select Token": "Token ausw\xE4hlen",
|
|
9840
9867
|
"Select an app": "W\xE4hlen Sie eine App",
|
|
9841
9868
|
"Select token": "Token ausw\xE4hlen",
|
|
@@ -10315,6 +10342,7 @@ var it_default = {
|
|
|
10315
10342
|
"Search dApps": "Cerca dApp",
|
|
10316
10343
|
"Search for a domain": "Cerca un dominio",
|
|
10317
10344
|
"Secured by": "Protetto da",
|
|
10345
|
+
"Select Additional Login Method": "Seleziona metodo di accesso aggiuntivo",
|
|
10318
10346
|
"Select Token": "Seleziona Token",
|
|
10319
10347
|
"Select an app": "Seleziona un'app",
|
|
10320
10348
|
"Select token": "Seleziona",
|
|
@@ -10794,6 +10822,7 @@ var fr_default = {
|
|
|
10794
10822
|
"Search dApps": "Rechercher des dApps",
|
|
10795
10823
|
"Search for a domain": "Rechercher un domaine",
|
|
10796
10824
|
"Secured by": "S\xE9curis\xE9 par",
|
|
10825
|
+
"Select Additional Login Method": "S\xE9lectionner une m\xE9thode de connexion suppl\xE9mentaire",
|
|
10797
10826
|
"Select Token": "S\xE9lectionner un jeton",
|
|
10798
10827
|
"Select an app": "S\xE9lectionnez une application",
|
|
10799
10828
|
"Select token": "S\xE9lectionner un jeton",
|
|
@@ -11273,6 +11302,7 @@ var es_default = {
|
|
|
11273
11302
|
"Search dApps": "Buscar dApps",
|
|
11274
11303
|
"Search for a domain": "Buscar un dominio",
|
|
11275
11304
|
"Secured by": "Asegurado por",
|
|
11305
|
+
"Select Additional Login Method": "Seleccionar M\xE9todo de Inicio de Sesi\xF3n Adicional",
|
|
11276
11306
|
"Select Token": "Seleccionar Token",
|
|
11277
11307
|
"Select an app": "Seleccionar una aplicaci\xF3n",
|
|
11278
11308
|
"Select token": "Seleccionar token",
|
|
@@ -11752,6 +11782,7 @@ var zh_default = {
|
|
|
11752
11782
|
"Search dApps": "\u641C\u7D22 dApps",
|
|
11753
11783
|
"Search for a domain": "\u641C\u7D22\u57DF\u540D",
|
|
11754
11784
|
"Secured by": "\u5B89\u5168\u4FDD\u969C",
|
|
11785
|
+
"Select Additional Login Method": "\u9009\u62E9\u5176\u4ED6\u767B\u5F55\u65B9\u5F0F",
|
|
11755
11786
|
"Select Token": "\u9009\u62E9\u4EE3\u5E01",
|
|
11756
11787
|
"Select an app": "\u9009\u62E9\u4E00\u4E2A\u5E94\u7528",
|
|
11757
11788
|
"Select token": "\u9009\u62E9\u4EE3\u5E01",
|
|
@@ -12231,6 +12262,7 @@ var ja_default = {
|
|
|
12231
12262
|
"Search dApps": "dApps\u3092\u691C\u7D22",
|
|
12232
12263
|
"Search for a domain": "\u30C9\u30E1\u30A4\u30F3\u3092\u691C\u7D22",
|
|
12233
12264
|
"Secured by": "\u306B\u3088\u3063\u3066\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u4FDD\u8B77\u3055\u308C\u3066\u3044\u307E\u3059",
|
|
12265
|
+
"Select Additional Login Method": "\u8FFD\u52A0\u306E\u30ED\u30B0\u30A4\u30F3\u65B9\u6CD5\u3092\u9078\u629E",
|
|
12234
12266
|
"Select Token": "\u30C8\u30FC\u30AF\u30F3\u3092\u9078\u629E",
|
|
12235
12267
|
"Select an app": "\u30A2\u30D7\u30EA\u3092\u9078\u629E",
|
|
12236
12268
|
"Select token": "\u30C8\u30FC\u30AF\u30F3\u3092\u9078\u629E",
|
|
@@ -13152,6 +13184,7 @@ var ProfileContent = ({
|
|
|
13152
13184
|
{
|
|
13153
13185
|
onEditClick: () => setCurrentContent("account-customization"),
|
|
13154
13186
|
address: account?.address ?? "",
|
|
13187
|
+
showHeader: false,
|
|
13155
13188
|
onLogout: () => {
|
|
13156
13189
|
setCurrentContent?.({
|
|
13157
13190
|
type: "disconnect-confirm",
|
|
@@ -13349,14 +13382,14 @@ var AssetsContent = ({ setCurrentContent }) => {
|
|
|
13349
13382
|
value: tokens[token.symbol]?.value ?? 0,
|
|
13350
13383
|
price: tokens[token.symbol]?.price ?? 0
|
|
13351
13384
|
}))
|
|
13352
|
-
].sort((a, b) => b.value * b.price - a.value * a.price);
|
|
13385
|
+
].sort((a, b) => Number(b.value) * b.price - Number(a.value) * a.price);
|
|
13353
13386
|
const filteredTokens = allTokens.filter(
|
|
13354
13387
|
({ symbol }) => symbol.toLowerCase().includes(searchQuery.toLowerCase())
|
|
13355
13388
|
).sort((a, b) => {
|
|
13356
|
-
if (a.value > 0 !== b.value > 0) {
|
|
13357
|
-
return b.value > 0 ? 1 : -1;
|
|
13389
|
+
if (Number(a.value) > 0 !== Number(b.value) > 0) {
|
|
13390
|
+
return Number(b.value) > 0 ? 1 : -1;
|
|
13358
13391
|
}
|
|
13359
|
-
return b.value * b.price - a.value * a.price;
|
|
13392
|
+
return Number(b.value) * b.price - Number(a.value) * a.price;
|
|
13360
13393
|
});
|
|
13361
13394
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13362
13395
|
/* @__PURE__ */ jsxs(StickyHeaderContainer, { children: [
|
|
@@ -13364,48 +13397,50 @@ var AssetsContent = ({ setCurrentContent }) => {
|
|
|
13364
13397
|
/* @__PURE__ */ jsx(ModalBackButton, { onClick: () => setCurrentContent("main") }),
|
|
13365
13398
|
/* @__PURE__ */ jsx(ModalCloseButton, {})
|
|
13366
13399
|
] }),
|
|
13367
|
-
/* @__PURE__ */ jsxs(
|
|
13368
|
-
/* @__PURE__ */ jsxs(
|
|
13369
|
-
/* @__PURE__ */
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13400
|
+
/* @__PURE__ */ jsxs(Container, { h: ["540px", "auto"], p: 0, children: [
|
|
13401
|
+
/* @__PURE__ */ jsxs(ModalBody, { children: [
|
|
13402
|
+
/* @__PURE__ */ jsxs(InputGroup, { size: "lg", children: [
|
|
13403
|
+
/* @__PURE__ */ jsx(
|
|
13404
|
+
Input,
|
|
13405
|
+
{
|
|
13406
|
+
placeholder: "Search token",
|
|
13407
|
+
bg: darkMode ? "#00000038" : "gray.50",
|
|
13408
|
+
borderRadius: "xl",
|
|
13409
|
+
height: "56px",
|
|
13410
|
+
pl: 12,
|
|
13411
|
+
value: searchQuery,
|
|
13412
|
+
onChange: (e) => setSearchQuery(e.target.value)
|
|
13413
|
+
}
|
|
13414
|
+
),
|
|
13415
|
+
/* @__PURE__ */ jsx(InputLeftElement, { h: "56px", w: "56px", pl: 4, children: /* @__PURE__ */ jsx(
|
|
13416
|
+
CiSearch,
|
|
13417
|
+
{
|
|
13418
|
+
color: darkMode ? "whiteAlpha.400" : "gray.400"
|
|
13419
|
+
}
|
|
13420
|
+
) })
|
|
13421
|
+
] }),
|
|
13422
|
+
/* @__PURE__ */ jsx(VStack, { spacing: 2, align: "stretch", mt: 2, children: filteredTokens.map((token) => /* @__PURE__ */ jsx(
|
|
13423
|
+
AssetButton,
|
|
13383
13424
|
{
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
13425
|
+
symbol: token.symbol,
|
|
13426
|
+
amount: Number(token.value),
|
|
13427
|
+
usdValue: Number(token.value) * token.price,
|
|
13428
|
+
isDisabled: Number(token.value) === 0,
|
|
13429
|
+
onClick: () => handleTokenSelect(token)
|
|
13430
|
+
},
|
|
13431
|
+
token.address
|
|
13432
|
+
)) })
|
|
13387
13433
|
] }),
|
|
13388
|
-
/* @__PURE__ */ jsx(
|
|
13389
|
-
|
|
13434
|
+
/* @__PURE__ */ jsx(ModalFooter, { children: allowCustomTokens && /* @__PURE__ */ jsx(
|
|
13435
|
+
Button,
|
|
13390
13436
|
{
|
|
13391
|
-
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
)) })
|
|
13399
|
-
] }),
|
|
13400
|
-
/* @__PURE__ */ jsx(ModalFooter, { children: allowCustomTokens && /* @__PURE__ */ jsx(
|
|
13401
|
-
Button,
|
|
13402
|
-
{
|
|
13403
|
-
variant: "vechainKitSecondary",
|
|
13404
|
-
leftIcon: /* @__PURE__ */ jsx(Icon, { as: RiEdit2Line, boxSize: 4 }),
|
|
13405
|
-
onClick: () => setCurrentContent("add-custom-token"),
|
|
13406
|
-
children: t("Manage Custom Tokens")
|
|
13407
|
-
}
|
|
13408
|
-
) })
|
|
13437
|
+
variant: "vechainKitSecondary",
|
|
13438
|
+
leftIcon: /* @__PURE__ */ jsx(Icon, { as: RiEdit2Line, boxSize: 4 }),
|
|
13439
|
+
onClick: () => setCurrentContent("add-custom-token"),
|
|
13440
|
+
children: t("Manage Custom Tokens")
|
|
13441
|
+
}
|
|
13442
|
+
) })
|
|
13443
|
+
] })
|
|
13409
13444
|
] });
|
|
13410
13445
|
};
|
|
13411
13446
|
var ManageCustomTokenContent = ({
|
|
@@ -13862,7 +13897,7 @@ var PrivyLinkedAccounts = ({ onBack }) => {
|
|
|
13862
13897
|
if (showLinkOptions) {
|
|
13863
13898
|
return /* @__PURE__ */ jsxs(ScrollToTopWrapper, { children: [
|
|
13864
13899
|
/* @__PURE__ */ jsxs(StickyHeaderContainer, { children: [
|
|
13865
|
-
/* @__PURE__ */ jsx(ModalHeader, { children: t("
|
|
13900
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: t("Select Additional Login Method") }),
|
|
13866
13901
|
/* @__PURE__ */ jsx(
|
|
13867
13902
|
ModalBackButton,
|
|
13868
13903
|
{
|
|
@@ -14167,7 +14202,7 @@ var PrivyLinkedAccounts = ({ onBack }) => {
|
|
|
14167
14202
|
]
|
|
14168
14203
|
}
|
|
14169
14204
|
) }),
|
|
14170
|
-
/* @__PURE__ */ jsx(ModalFooter, { children: /* @__PURE__ */ jsx(
|
|
14205
|
+
/* @__PURE__ */ jsx(ModalFooter, { w: "full", children: /* @__PURE__ */ jsx(
|
|
14171
14206
|
Button,
|
|
14172
14207
|
{
|
|
14173
14208
|
w: "full",
|
|
@@ -14293,8 +14328,8 @@ var NotificationsContent = ({ setCurrentContent }) => {
|
|
|
14293
14328
|
/* @__PURE__ */ jsx(ModalHeader, { children: isArchiveView ? t("Archived Notifications") : t("Notifications") }),
|
|
14294
14329
|
/* @__PURE__ */ jsx(ModalCloseButton, {})
|
|
14295
14330
|
] }),
|
|
14296
|
-
/* @__PURE__ */ jsxs(Container, {
|
|
14297
|
-
/* @__PURE__ */ jsx(ModalBody, {
|
|
14331
|
+
/* @__PURE__ */ jsxs(Container, { h: ["540px", "auto"], p: 0, children: [
|
|
14332
|
+
/* @__PURE__ */ jsx(ModalBody, { children: /* @__PURE__ */ jsxs(VStack, { spacing: 4, align: "stretch", w: "full", children: [
|
|
14298
14333
|
/* @__PURE__ */ jsxs(HStack, { justify: "space-between", children: [
|
|
14299
14334
|
/* @__PURE__ */ jsx(
|
|
14300
14335
|
Button,
|
|
@@ -16835,7 +16870,7 @@ var useTransferERC20 = ({
|
|
|
16835
16870
|
return clausesArray;
|
|
16836
16871
|
}, [receiverAddress, amount]);
|
|
16837
16872
|
const handleOnSuccess = useCallback(async () => {
|
|
16838
|
-
|
|
16873
|
+
refresh();
|
|
16839
16874
|
onSuccess?.();
|
|
16840
16875
|
}, [onSuccess, fromAddress, queryClient]);
|
|
16841
16876
|
const result = useSendTransaction({
|
|
@@ -16898,7 +16933,7 @@ var useTransferVET = ({
|
|
|
16898
16933
|
buttonText: "Sign to continue"
|
|
16899
16934
|
},
|
|
16900
16935
|
onTxConfirmed: async () => {
|
|
16901
|
-
|
|
16936
|
+
refresh();
|
|
16902
16937
|
onSuccess?.();
|
|
16903
16938
|
},
|
|
16904
16939
|
onTxFailedOrCancelled: async () => {
|
|
@@ -17975,12 +18010,12 @@ var variants3 = {
|
|
|
17975
18010
|
})),
|
|
17976
18011
|
mainContentButton: defineStyle(({ colorMode }) => ({
|
|
17977
18012
|
width: "100%",
|
|
17978
|
-
backgroundColor: colorMode === "dark" ? "#
|
|
18013
|
+
backgroundColor: colorMode === "dark" ? "#ffffff0a" : "blackAlpha.50",
|
|
17979
18014
|
borderRadius: "xl",
|
|
17980
18015
|
p: 3,
|
|
17981
18016
|
cursor: "pointer",
|
|
17982
18017
|
_hover: {
|
|
17983
|
-
backgroundColor: colorMode === "dark" ? "#
|
|
18018
|
+
backgroundColor: colorMode === "dark" ? "#ffffff12" : "blackAlpha.200"
|
|
17984
18019
|
}
|
|
17985
18020
|
}))
|
|
17986
18021
|
};
|