@vechain/vechain-kit 1.5.2 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +134 -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 +135 -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
|
});
|
|
@@ -3611,16 +3622,17 @@ var useBalances = ({ address = "" }) => {
|
|
|
3611
3622
|
{ address: contractAddresses.vtho, price: vthoUsdPrice || 0 },
|
|
3612
3623
|
{ address: contractAddresses.b3tr, price: b3trUsdPrice || 0 }
|
|
3613
3624
|
];
|
|
3614
|
-
const totalBalance = balances.reduce((acc, {
|
|
3615
|
-
const price = prices.find((p) => p.address ===
|
|
3616
|
-
return acc + value * price;
|
|
3625
|
+
const totalBalance = balances.reduce((acc, { priceAddress, value }) => {
|
|
3626
|
+
const price = prices.find((p) => p.address === priceAddress)?.price || 0;
|
|
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.4",
|
|
4970
4982
|
private: false,
|
|
4971
4983
|
homepage: "https://github.com/vechain/vechain-kit",
|
|
4972
4984
|
repository: "github:vechain/vechain-kit",
|
|
@@ -5375,7 +5387,7 @@ var AddressDisplayCard = ({
|
|
|
5375
5387
|
children: [
|
|
5376
5388
|
/* @__PURE__ */ jsx(Text, { fontSize: "sm", fontWeight: "medium", children: t("Balance") }),
|
|
5377
5389
|
/* @__PURE__ */ jsx(Skeleton, { isLoaded: !isLoading, children: /* @__PURE__ */ jsxs(Text, { fontSize: "xs", opacity: 0.5, children: [
|
|
5378
|
-
compactFormatter2.format(displayBalance),
|
|
5390
|
+
compactFormatter2.format(Number(displayBalance)),
|
|
5379
5391
|
displaySymbol && ` ${displaySymbol}`
|
|
5380
5392
|
] }) })
|
|
5381
5393
|
]
|
|
@@ -6163,7 +6175,7 @@ var DomainRequiredAlert = () => {
|
|
|
6163
6175
|
var AccountMainContent = ({ setCurrentContent, wallet }) => {
|
|
6164
6176
|
const { t } = useTranslation();
|
|
6165
6177
|
const { network } = useVeChainKitConfig();
|
|
6166
|
-
const {
|
|
6178
|
+
const { account } = useWallet();
|
|
6167
6179
|
return /* @__PURE__ */ jsxs(ScrollToTopWrapper, { children: [
|
|
6168
6180
|
/* @__PURE__ */ jsxs(StickyHeaderContainer, { children: [
|
|
6169
6181
|
/* @__PURE__ */ jsx(
|
|
@@ -6177,7 +6189,7 @@ var AccountMainContent = ({ setCurrentContent, wallet }) => {
|
|
|
6177
6189
|
})
|
|
6178
6190
|
}
|
|
6179
6191
|
),
|
|
6180
|
-
/* @__PURE__ */ jsx(ModalHeader, { children:
|
|
6192
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: t("Wallet") }),
|
|
6181
6193
|
/* @__PURE__ */ jsx(ModalCloseButton, {})
|
|
6182
6194
|
] }),
|
|
6183
6195
|
/* @__PURE__ */ jsx(ModalBody, { w: "full", children: /* @__PURE__ */ jsxs(
|
|
@@ -6205,14 +6217,23 @@ var AccountMainContent = ({ setCurrentContent, wallet }) => {
|
|
|
6205
6217
|
}
|
|
6206
6218
|
),
|
|
6207
6219
|
network?.type !== "main" && /* @__PURE__ */ jsx(
|
|
6208
|
-
|
|
6220
|
+
HStack,
|
|
6209
6221
|
{
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
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
|
+
)
|
|
6216
6237
|
}
|
|
6217
6238
|
),
|
|
6218
6239
|
/* @__PURE__ */ jsx(
|
|
@@ -6317,7 +6338,7 @@ var ActionButton = ({
|
|
|
6317
6338
|
}) => {
|
|
6318
6339
|
const { t } = useTranslation();
|
|
6319
6340
|
const { colorMode } = useColorMode();
|
|
6320
|
-
const baseBackgroundColor = backgroundColor ?? colorMode === "dark" ? "#
|
|
6341
|
+
const baseBackgroundColor = backgroundColor ?? colorMode === "dark" ? "#ffffff0a" : "#00000005";
|
|
6321
6342
|
return /* @__PURE__ */ jsx(
|
|
6322
6343
|
Button,
|
|
6323
6344
|
{
|
|
@@ -6332,7 +6353,7 @@ var ActionButton = ({
|
|
|
6332
6353
|
loadingText,
|
|
6333
6354
|
bgColor: baseBackgroundColor,
|
|
6334
6355
|
_hover: _hover ?? {
|
|
6335
|
-
backgroundColor: colorMode === "dark" ? "#
|
|
6356
|
+
backgroundColor: colorMode === "dark" ? "#ffffff12" : "blackAlpha.200"
|
|
6336
6357
|
},
|
|
6337
6358
|
...style,
|
|
6338
6359
|
children: /* @__PURE__ */ jsxs(HStack, { w: "full", justify: "space-between", children: [
|
|
@@ -6554,6 +6575,7 @@ var AssetIcons = ({
|
|
|
6554
6575
|
var compactFormatter3 = new Intl.NumberFormat("en-US", {
|
|
6555
6576
|
notation: "compact",
|
|
6556
6577
|
compactDisplay: "short",
|
|
6578
|
+
minimumFractionDigits: 2,
|
|
6557
6579
|
maximumFractionDigits: 2
|
|
6558
6580
|
});
|
|
6559
6581
|
var BalanceSection = ({
|
|
@@ -6644,12 +6666,12 @@ var BalanceSection = ({
|
|
|
6644
6666
|
style: {
|
|
6645
6667
|
width: "100%",
|
|
6646
6668
|
mt: 2,
|
|
6647
|
-
backgroundColor: isDark ? "#
|
|
6669
|
+
backgroundColor: isDark ? "#ffffff0a" : "blackAlpha.50",
|
|
6648
6670
|
borderRadius: "xl",
|
|
6649
6671
|
p: 3,
|
|
6650
6672
|
cursor: "pointer",
|
|
6651
6673
|
_hover: {
|
|
6652
|
-
backgroundColor: isDark ? "#
|
|
6674
|
+
backgroundColor: isDark ? "#ffffff12" : "blackAlpha.200"
|
|
6653
6675
|
},
|
|
6654
6676
|
justifyContent: "space-between"
|
|
6655
6677
|
}
|
|
@@ -7780,10 +7802,10 @@ var SelectTokenContent = ({ onSelectToken, onBack }) => {
|
|
|
7780
7802
|
const filteredTokens = allTokens.filter(
|
|
7781
7803
|
({ symbol }) => symbol.toLowerCase().includes(searchQuery.toLowerCase())
|
|
7782
7804
|
).sort((a, b) => {
|
|
7783
|
-
if (a.numericBalance > 0 !== b.numericBalance > 0) {
|
|
7784
|
-
return b.numericBalance > 0 ? 1 : -1;
|
|
7805
|
+
if (Number(a.numericBalance) > 0 !== Number(b.numericBalance) > 0) {
|
|
7806
|
+
return Number(b.numericBalance) > 0 ? 1 : -1;
|
|
7785
7807
|
}
|
|
7786
|
-
return b.numericBalance * b.price - a.numericBalance * a.price;
|
|
7808
|
+
return Number(b.numericBalance) * b.price - Number(a.numericBalance) * a.price;
|
|
7787
7809
|
});
|
|
7788
7810
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7789
7811
|
/* @__PURE__ */ jsxs(StickyHeaderContainer, { children: [
|
|
@@ -7835,13 +7857,13 @@ var SelectTokenContent = ({ onSelectToken, onBack }) => {
|
|
|
7835
7857
|
]
|
|
7836
7858
|
}
|
|
7837
7859
|
) : /* @__PURE__ */ jsx(VStack, { spacing: 2, align: "stretch", children: filteredTokens.map((token) => {
|
|
7838
|
-
const hasBalance = token.numericBalance > 0;
|
|
7839
|
-
const usdValue = token.numericBalance * token.price;
|
|
7860
|
+
const hasBalance = Number(token.numericBalance) > 0;
|
|
7861
|
+
const usdValue = Number(token.numericBalance) * token.price;
|
|
7840
7862
|
return /* @__PURE__ */ jsx(
|
|
7841
7863
|
AssetButton,
|
|
7842
7864
|
{
|
|
7843
7865
|
symbol: token.symbol,
|
|
7844
|
-
amount: token.numericBalance,
|
|
7866
|
+
amount: Number(token.numericBalance),
|
|
7845
7867
|
usdValue,
|
|
7846
7868
|
onClick: () => onSelectToken(token),
|
|
7847
7869
|
isDisabled: !hasBalance
|
|
@@ -7895,7 +7917,7 @@ var SendTokenContent = ({
|
|
|
7895
7917
|
} = useVechainDomain$1({ addressOrDomain: toAddressOrDomain });
|
|
7896
7918
|
const handleSetMaxAmount = () => {
|
|
7897
7919
|
if (selectedToken) {
|
|
7898
|
-
setValue("amount", selectedToken.numericBalance
|
|
7920
|
+
setValue("amount", selectedToken.numericBalance);
|
|
7899
7921
|
}
|
|
7900
7922
|
};
|
|
7901
7923
|
const onSubmit = async (data) => {
|
|
@@ -7909,8 +7931,8 @@ var SendTokenContent = ({
|
|
|
7909
7931
|
return;
|
|
7910
7932
|
}
|
|
7911
7933
|
if (selectedToken) {
|
|
7912
|
-
const numericAmount =
|
|
7913
|
-
if (numericAmount > selectedToken.numericBalance) {
|
|
7934
|
+
const numericAmount = parseEther$1(data.amount);
|
|
7935
|
+
if (numericAmount > parseEther$1(selectedToken.numericBalance)) {
|
|
7914
7936
|
setError("amount", {
|
|
7915
7937
|
type: "manual",
|
|
7916
7938
|
message: t(`Insufficient {{symbol}} balance`, {
|
|
@@ -8096,7 +8118,9 @@ var SendTokenContent = ({
|
|
|
8096
8118
|
overflow: "hidden",
|
|
8097
8119
|
textOverflow: "ellipsis",
|
|
8098
8120
|
children: compactFormatter4.format(
|
|
8099
|
-
|
|
8121
|
+
Number(
|
|
8122
|
+
selectedToken.numericBalance
|
|
8123
|
+
)
|
|
8100
8124
|
)
|
|
8101
8125
|
}
|
|
8102
8126
|
)
|
|
@@ -8313,7 +8337,7 @@ var SendTokenSummaryContent = ({
|
|
|
8313
8337
|
domain: account?.domain,
|
|
8314
8338
|
imageSrc: account?.image ?? "",
|
|
8315
8339
|
imageAlt: "From account",
|
|
8316
|
-
balance: selectedToken.numericBalance,
|
|
8340
|
+
balance: Number(selectedToken.numericBalance),
|
|
8317
8341
|
tokenAddress: selectedToken.address
|
|
8318
8342
|
}
|
|
8319
8343
|
),
|
|
@@ -8616,7 +8640,7 @@ var ExistingDomainsList = ({
|
|
|
8616
8640
|
Tag,
|
|
8617
8641
|
{
|
|
8618
8642
|
size: "sm",
|
|
8619
|
-
bg: isDark ? "#
|
|
8643
|
+
bg: isDark ? "#ffffff0a" : "whiteAlpha.100",
|
|
8620
8644
|
color: isDark ? "whiteAlpha.900" : "blackAlpha.600",
|
|
8621
8645
|
px: 3,
|
|
8622
8646
|
py: 1,
|
|
@@ -9358,6 +9382,7 @@ var en_default = {
|
|
|
9358
9382
|
"Search dApps": "Search dApps",
|
|
9359
9383
|
"Search for a domain": "Search for a domain",
|
|
9360
9384
|
"Secured by": "Secured by",
|
|
9385
|
+
"Select Additional Login Method": "Select Additional Login Method",
|
|
9361
9386
|
"Select Token": "Select Token",
|
|
9362
9387
|
"Select an app": "Select an app",
|
|
9363
9388
|
"Select token": "Select token",
|
|
@@ -9837,6 +9862,7 @@ var de_default = {
|
|
|
9837
9862
|
"Search dApps": "dApps durchsuchen",
|
|
9838
9863
|
"Search for a domain": "Nach einer Domain suchen",
|
|
9839
9864
|
"Secured by": "Gesichert durch",
|
|
9865
|
+
"Select Additional Login Method": "Zus\xE4tzliche Anmeldemethode ausw\xE4hlen",
|
|
9840
9866
|
"Select Token": "Token ausw\xE4hlen",
|
|
9841
9867
|
"Select an app": "W\xE4hlen Sie eine App",
|
|
9842
9868
|
"Select token": "Token ausw\xE4hlen",
|
|
@@ -10316,6 +10342,7 @@ var it_default = {
|
|
|
10316
10342
|
"Search dApps": "Cerca dApp",
|
|
10317
10343
|
"Search for a domain": "Cerca un dominio",
|
|
10318
10344
|
"Secured by": "Protetto da",
|
|
10345
|
+
"Select Additional Login Method": "Seleziona metodo di accesso aggiuntivo",
|
|
10319
10346
|
"Select Token": "Seleziona Token",
|
|
10320
10347
|
"Select an app": "Seleziona un'app",
|
|
10321
10348
|
"Select token": "Seleziona",
|
|
@@ -10795,6 +10822,7 @@ var fr_default = {
|
|
|
10795
10822
|
"Search dApps": "Rechercher des dApps",
|
|
10796
10823
|
"Search for a domain": "Rechercher un domaine",
|
|
10797
10824
|
"Secured by": "S\xE9curis\xE9 par",
|
|
10825
|
+
"Select Additional Login Method": "S\xE9lectionner une m\xE9thode de connexion suppl\xE9mentaire",
|
|
10798
10826
|
"Select Token": "S\xE9lectionner un jeton",
|
|
10799
10827
|
"Select an app": "S\xE9lectionnez une application",
|
|
10800
10828
|
"Select token": "S\xE9lectionner un jeton",
|
|
@@ -11274,6 +11302,7 @@ var es_default = {
|
|
|
11274
11302
|
"Search dApps": "Buscar dApps",
|
|
11275
11303
|
"Search for a domain": "Buscar un dominio",
|
|
11276
11304
|
"Secured by": "Asegurado por",
|
|
11305
|
+
"Select Additional Login Method": "Seleccionar M\xE9todo de Inicio de Sesi\xF3n Adicional",
|
|
11277
11306
|
"Select Token": "Seleccionar Token",
|
|
11278
11307
|
"Select an app": "Seleccionar una aplicaci\xF3n",
|
|
11279
11308
|
"Select token": "Seleccionar token",
|
|
@@ -11753,6 +11782,7 @@ var zh_default = {
|
|
|
11753
11782
|
"Search dApps": "\u641C\u7D22 dApps",
|
|
11754
11783
|
"Search for a domain": "\u641C\u7D22\u57DF\u540D",
|
|
11755
11784
|
"Secured by": "\u5B89\u5168\u4FDD\u969C",
|
|
11785
|
+
"Select Additional Login Method": "\u9009\u62E9\u5176\u4ED6\u767B\u5F55\u65B9\u5F0F",
|
|
11756
11786
|
"Select Token": "\u9009\u62E9\u4EE3\u5E01",
|
|
11757
11787
|
"Select an app": "\u9009\u62E9\u4E00\u4E2A\u5E94\u7528",
|
|
11758
11788
|
"Select token": "\u9009\u62E9\u4EE3\u5E01",
|
|
@@ -12232,6 +12262,7 @@ var ja_default = {
|
|
|
12232
12262
|
"Search dApps": "dApps\u3092\u691C\u7D22",
|
|
12233
12263
|
"Search for a domain": "\u30C9\u30E1\u30A4\u30F3\u3092\u691C\u7D22",
|
|
12234
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",
|
|
12235
12266
|
"Select Token": "\u30C8\u30FC\u30AF\u30F3\u3092\u9078\u629E",
|
|
12236
12267
|
"Select an app": "\u30A2\u30D7\u30EA\u3092\u9078\u629E",
|
|
12237
12268
|
"Select token": "\u30C8\u30FC\u30AF\u30F3\u3092\u9078\u629E",
|
|
@@ -13153,6 +13184,7 @@ var ProfileContent = ({
|
|
|
13153
13184
|
{
|
|
13154
13185
|
onEditClick: () => setCurrentContent("account-customization"),
|
|
13155
13186
|
address: account?.address ?? "",
|
|
13187
|
+
showHeader: false,
|
|
13156
13188
|
onLogout: () => {
|
|
13157
13189
|
setCurrentContent?.({
|
|
13158
13190
|
type: "disconnect-confirm",
|
|
@@ -13350,14 +13382,14 @@ var AssetsContent = ({ setCurrentContent }) => {
|
|
|
13350
13382
|
value: tokens[token.symbol]?.value ?? 0,
|
|
13351
13383
|
price: tokens[token.symbol]?.price ?? 0
|
|
13352
13384
|
}))
|
|
13353
|
-
].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);
|
|
13354
13386
|
const filteredTokens = allTokens.filter(
|
|
13355
13387
|
({ symbol }) => symbol.toLowerCase().includes(searchQuery.toLowerCase())
|
|
13356
13388
|
).sort((a, b) => {
|
|
13357
|
-
if (a.value > 0 !== b.value > 0) {
|
|
13358
|
-
return b.value > 0 ? 1 : -1;
|
|
13389
|
+
if (Number(a.value) > 0 !== Number(b.value) > 0) {
|
|
13390
|
+
return Number(b.value) > 0 ? 1 : -1;
|
|
13359
13391
|
}
|
|
13360
|
-
return b.value * b.price - a.value * a.price;
|
|
13392
|
+
return Number(b.value) * b.price - Number(a.value) * a.price;
|
|
13361
13393
|
});
|
|
13362
13394
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13363
13395
|
/* @__PURE__ */ jsxs(StickyHeaderContainer, { children: [
|
|
@@ -13365,48 +13397,50 @@ var AssetsContent = ({ setCurrentContent }) => {
|
|
|
13365
13397
|
/* @__PURE__ */ jsx(ModalBackButton, { onClick: () => setCurrentContent("main") }),
|
|
13366
13398
|
/* @__PURE__ */ jsx(ModalCloseButton, {})
|
|
13367
13399
|
] }),
|
|
13368
|
-
/* @__PURE__ */ jsxs(
|
|
13369
|
-
/* @__PURE__ */ jsxs(
|
|
13370
|
-
/* @__PURE__ */
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
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,
|
|
13384
13424
|
{
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
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
|
+
)) })
|
|
13388
13433
|
] }),
|
|
13389
|
-
/* @__PURE__ */ jsx(
|
|
13390
|
-
|
|
13434
|
+
/* @__PURE__ */ jsx(ModalFooter, { children: allowCustomTokens && /* @__PURE__ */ jsx(
|
|
13435
|
+
Button,
|
|
13391
13436
|
{
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
)) })
|
|
13400
|
-
] }),
|
|
13401
|
-
/* @__PURE__ */ jsx(ModalFooter, { children: allowCustomTokens && /* @__PURE__ */ jsx(
|
|
13402
|
-
Button,
|
|
13403
|
-
{
|
|
13404
|
-
variant: "vechainKitSecondary",
|
|
13405
|
-
leftIcon: /* @__PURE__ */ jsx(Icon, { as: RiEdit2Line, boxSize: 4 }),
|
|
13406
|
-
onClick: () => setCurrentContent("add-custom-token"),
|
|
13407
|
-
children: t("Manage Custom Tokens")
|
|
13408
|
-
}
|
|
13409
|
-
) })
|
|
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
|
+
] })
|
|
13410
13444
|
] });
|
|
13411
13445
|
};
|
|
13412
13446
|
var ManageCustomTokenContent = ({
|
|
@@ -13863,7 +13897,7 @@ var PrivyLinkedAccounts = ({ onBack }) => {
|
|
|
13863
13897
|
if (showLinkOptions) {
|
|
13864
13898
|
return /* @__PURE__ */ jsxs(ScrollToTopWrapper, { children: [
|
|
13865
13899
|
/* @__PURE__ */ jsxs(StickyHeaderContainer, { children: [
|
|
13866
|
-
/* @__PURE__ */ jsx(ModalHeader, { children: t("
|
|
13900
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: t("Select Additional Login Method") }),
|
|
13867
13901
|
/* @__PURE__ */ jsx(
|
|
13868
13902
|
ModalBackButton,
|
|
13869
13903
|
{
|
|
@@ -14168,7 +14202,7 @@ var PrivyLinkedAccounts = ({ onBack }) => {
|
|
|
14168
14202
|
]
|
|
14169
14203
|
}
|
|
14170
14204
|
) }),
|
|
14171
|
-
/* @__PURE__ */ jsx(ModalFooter, { children: /* @__PURE__ */ jsx(
|
|
14205
|
+
/* @__PURE__ */ jsx(ModalFooter, { w: "full", children: /* @__PURE__ */ jsx(
|
|
14172
14206
|
Button,
|
|
14173
14207
|
{
|
|
14174
14208
|
w: "full",
|
|
@@ -14294,8 +14328,8 @@ var NotificationsContent = ({ setCurrentContent }) => {
|
|
|
14294
14328
|
/* @__PURE__ */ jsx(ModalHeader, { children: isArchiveView ? t("Archived Notifications") : t("Notifications") }),
|
|
14295
14329
|
/* @__PURE__ */ jsx(ModalCloseButton, {})
|
|
14296
14330
|
] }),
|
|
14297
|
-
/* @__PURE__ */ jsxs(Container, {
|
|
14298
|
-
/* @__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: [
|
|
14299
14333
|
/* @__PURE__ */ jsxs(HStack, { justify: "space-between", children: [
|
|
14300
14334
|
/* @__PURE__ */ jsx(
|
|
14301
14335
|
Button,
|
|
@@ -16836,7 +16870,7 @@ var useTransferERC20 = ({
|
|
|
16836
16870
|
return clausesArray;
|
|
16837
16871
|
}, [receiverAddress, amount]);
|
|
16838
16872
|
const handleOnSuccess = useCallback(async () => {
|
|
16839
|
-
|
|
16873
|
+
refresh();
|
|
16840
16874
|
onSuccess?.();
|
|
16841
16875
|
}, [onSuccess, fromAddress, queryClient]);
|
|
16842
16876
|
const result = useSendTransaction({
|
|
@@ -16899,7 +16933,7 @@ var useTransferVET = ({
|
|
|
16899
16933
|
buttonText: "Sign to continue"
|
|
16900
16934
|
},
|
|
16901
16935
|
onTxConfirmed: async () => {
|
|
16902
|
-
|
|
16936
|
+
refresh();
|
|
16903
16937
|
onSuccess?.();
|
|
16904
16938
|
},
|
|
16905
16939
|
onTxFailedOrCancelled: async () => {
|
|
@@ -17976,12 +18010,12 @@ var variants3 = {
|
|
|
17976
18010
|
})),
|
|
17977
18011
|
mainContentButton: defineStyle(({ colorMode }) => ({
|
|
17978
18012
|
width: "100%",
|
|
17979
|
-
backgroundColor: colorMode === "dark" ? "#
|
|
18013
|
+
backgroundColor: colorMode === "dark" ? "#ffffff0a" : "blackAlpha.50",
|
|
17980
18014
|
borderRadius: "xl",
|
|
17981
18015
|
p: 3,
|
|
17982
18016
|
cursor: "pointer",
|
|
17983
18017
|
_hover: {
|
|
17984
|
-
backgroundColor: colorMode === "dark" ? "#
|
|
18018
|
+
backgroundColor: colorMode === "dark" ? "#ffffff12" : "blackAlpha.200"
|
|
17985
18019
|
}
|
|
17986
18020
|
}))
|
|
17987
18021
|
};
|