@wheelx-widget/widget 0.1.13 → 0.1.15
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.js +127 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +127 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -51450,6 +51450,21 @@ var TokenSelectAndInput = ({
|
|
|
51450
51450
|
}
|
|
51451
51451
|
);
|
|
51452
51452
|
}, [solanaWalletKey]);
|
|
51453
|
+
const renderDefaultWalletIcon = useCallback(() => {
|
|
51454
|
+
return /* @__PURE__ */ jsx(
|
|
51455
|
+
Box,
|
|
51456
|
+
{
|
|
51457
|
+
boxSize: {
|
|
51458
|
+
base: "12px",
|
|
51459
|
+
md: "14px"
|
|
51460
|
+
},
|
|
51461
|
+
borderRadius: "full",
|
|
51462
|
+
overflow: "hidden",
|
|
51463
|
+
bg: "white",
|
|
51464
|
+
children: /* @__PURE__ */ jsx(Image, { src: defaultIcon, alt: "connector", w: "100%", h: "100%" })
|
|
51465
|
+
}
|
|
51466
|
+
);
|
|
51467
|
+
}, []);
|
|
51453
51468
|
useEffect(() => {
|
|
51454
51469
|
if (isFrom) {
|
|
51455
51470
|
const { tags } = tokenInfo;
|
|
@@ -51535,12 +51550,22 @@ var TokenSelectAndInput = ({
|
|
|
51535
51550
|
isNativeSOL ? void 0 : tokenInfo.isSolana ? tokenInfo.address : void 0,
|
|
51536
51551
|
tokenInfo.isSolana
|
|
51537
51552
|
);
|
|
51553
|
+
const { data: solanaFixedAddressBalance } = useSolanaTokenBalance(
|
|
51554
|
+
isNativeSOL ? void 0 : tokenInfo.isSolana ? tokenInfo.address : void 0,
|
|
51555
|
+
!isFrom && tokenInfo.isSolana && !!config?.solanaDifferentAddress,
|
|
51556
|
+
config?.solanaDifferentAddress || void 0
|
|
51557
|
+
);
|
|
51538
51558
|
const displayBalance = useMemo(() => {
|
|
51539
|
-
if (!isFrom && tokenInfo.isSolana
|
|
51540
|
-
|
|
51559
|
+
if (!isFrom && tokenInfo.isSolana) {
|
|
51560
|
+
if (config?.solanaDifferentAddress && solanaFixedAddressBalance) {
|
|
51561
|
+
return solanaFixedAddressBalance.formatted;
|
|
51562
|
+
}
|
|
51563
|
+
if (solanaBalance) {
|
|
51564
|
+
return solanaBalance.formatted;
|
|
51565
|
+
}
|
|
51541
51566
|
}
|
|
51542
51567
|
return differentAddressBalance;
|
|
51543
|
-
}, [isFrom, tokenInfo.isSolana, solanaBalance, differentAddressBalance]);
|
|
51568
|
+
}, [isFrom, tokenInfo.isSolana, config?.solanaDifferentAddress, solanaFixedAddressBalance, solanaBalance, differentAddressBalance]);
|
|
51544
51569
|
useEffect(() => {
|
|
51545
51570
|
if (isFrom) {
|
|
51546
51571
|
setFromAmountToUsd(usdValue);
|
|
@@ -51623,7 +51648,7 @@ var TokenSelectAndInput = ({
|
|
|
51623
51648
|
if (!address && !solanaWalletAddress) {
|
|
51624
51649
|
if (isSolanaChain2(toTokenInfo.chain_id) && config?.solanaDifferentAddress) {
|
|
51625
51650
|
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51626
|
-
|
|
51651
|
+
renderDefaultWalletIcon(),
|
|
51627
51652
|
/* @__PURE__ */ jsx(
|
|
51628
51653
|
Text2,
|
|
51629
51654
|
{
|
|
@@ -51638,7 +51663,7 @@ var TokenSelectAndInput = ({
|
|
|
51638
51663
|
}
|
|
51639
51664
|
if (!isSolanaChain2(toTokenInfo.chain_id) && config?.evmDifferentAddress) {
|
|
51640
51665
|
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51641
|
-
|
|
51666
|
+
renderDefaultWalletIcon(),
|
|
51642
51667
|
/* @__PURE__ */ jsx(
|
|
51643
51668
|
Text2,
|
|
51644
51669
|
{
|
|
@@ -51693,7 +51718,7 @@ var TokenSelectAndInput = ({
|
|
|
51693
51718
|
if (!fromTokenInfo.isSolana && isSolanaChain2(toTokenInfo.chain_id) || fromTokenInfo.isSolana && isSolanaChain2(toTokenInfo.chain_id)) {
|
|
51694
51719
|
if (config?.solanaDifferentAddress) {
|
|
51695
51720
|
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51696
|
-
|
|
51721
|
+
renderDefaultWalletIcon(),
|
|
51697
51722
|
/* @__PURE__ */ jsx(
|
|
51698
51723
|
Text2,
|
|
51699
51724
|
{
|
|
@@ -51743,11 +51768,26 @@ var TokenSelectAndInput = ({
|
|
|
51743
51768
|
}
|
|
51744
51769
|
} else if (!address && solanaWalletAddress) {
|
|
51745
51770
|
if (!fromTokenInfo.isSolana && isSolanaChain2(toTokenInfo.chain_id) || fromTokenInfo.isSolana && isSolanaChain2(toTokenInfo.chain_id)) {
|
|
51771
|
+
if (config?.solanaDifferentAddress) {
|
|
51772
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51773
|
+
renderDefaultWalletIcon(),
|
|
51774
|
+
/* @__PURE__ */ jsx(
|
|
51775
|
+
Text2,
|
|
51776
|
+
{
|
|
51777
|
+
variant: "content8",
|
|
51778
|
+
backgroundColor: theme.highlightBgColor,
|
|
51779
|
+
padding: "2px",
|
|
51780
|
+
color: theme.highlightTextColor,
|
|
51781
|
+
children: sliceAddress(config.solanaDifferentAddress)
|
|
51782
|
+
}
|
|
51783
|
+
)
|
|
51784
|
+
] });
|
|
51785
|
+
}
|
|
51746
51786
|
return renderSolanaAddress(solanaWalletAddress);
|
|
51747
51787
|
} else {
|
|
51748
51788
|
if (config?.evmDifferentAddress) {
|
|
51749
51789
|
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51750
|
-
|
|
51790
|
+
renderDefaultWalletIcon(),
|
|
51751
51791
|
/* @__PURE__ */ jsx(
|
|
51752
51792
|
Text2,
|
|
51753
51793
|
{
|
|
@@ -51797,10 +51837,72 @@ var TokenSelectAndInput = ({
|
|
|
51797
51837
|
}
|
|
51798
51838
|
} else if (address && solanaWalletAddress) {
|
|
51799
51839
|
if (isSolanaChain2(toTokenInfo.chain_id)) {
|
|
51840
|
+
if (config?.solanaDifferentAddress) {
|
|
51841
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51842
|
+
renderDefaultWalletIcon(),
|
|
51843
|
+
/* @__PURE__ */ jsx(
|
|
51844
|
+
Text2,
|
|
51845
|
+
{
|
|
51846
|
+
variant: "content8",
|
|
51847
|
+
backgroundColor: theme.highlightBgColor,
|
|
51848
|
+
padding: "2px",
|
|
51849
|
+
color: theme.highlightTextColor,
|
|
51850
|
+
children: sliceAddress(config.solanaDifferentAddress)
|
|
51851
|
+
}
|
|
51852
|
+
)
|
|
51853
|
+
] });
|
|
51854
|
+
}
|
|
51800
51855
|
return renderSolanaAddress(solanaWalletAddress);
|
|
51801
51856
|
}
|
|
51857
|
+
if (config?.evmDifferentAddress) {
|
|
51858
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51859
|
+
renderDefaultWalletIcon(),
|
|
51860
|
+
/* @__PURE__ */ jsx(
|
|
51861
|
+
Text2,
|
|
51862
|
+
{
|
|
51863
|
+
variant: "content8",
|
|
51864
|
+
backgroundColor: theme.highlightBgColor,
|
|
51865
|
+
padding: "2px",
|
|
51866
|
+
color: theme.highlightTextColor,
|
|
51867
|
+
children: sliceAddress(config.evmDifferentAddress)
|
|
51868
|
+
}
|
|
51869
|
+
)
|
|
51870
|
+
] });
|
|
51871
|
+
}
|
|
51802
51872
|
return renderEvmAddress(address);
|
|
51803
51873
|
}
|
|
51874
|
+
if (!isFrom) {
|
|
51875
|
+
if (isSolanaChain2(toTokenInfo.chain_id) && config?.solanaDifferentAddress) {
|
|
51876
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51877
|
+
renderDefaultWalletIcon(),
|
|
51878
|
+
/* @__PURE__ */ jsx(
|
|
51879
|
+
Text2,
|
|
51880
|
+
{
|
|
51881
|
+
variant: "content8",
|
|
51882
|
+
backgroundColor: theme.highlightBgColor,
|
|
51883
|
+
padding: "2px",
|
|
51884
|
+
color: theme.highlightTextColor,
|
|
51885
|
+
children: sliceAddress(config.solanaDifferentAddress)
|
|
51886
|
+
}
|
|
51887
|
+
)
|
|
51888
|
+
] });
|
|
51889
|
+
}
|
|
51890
|
+
if (!isSolanaChain2(toTokenInfo.chain_id) && config?.evmDifferentAddress) {
|
|
51891
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51892
|
+
renderDefaultWalletIcon(),
|
|
51893
|
+
/* @__PURE__ */ jsx(
|
|
51894
|
+
Text2,
|
|
51895
|
+
{
|
|
51896
|
+
variant: "content8",
|
|
51897
|
+
backgroundColor: theme.highlightBgColor,
|
|
51898
|
+
padding: "2px",
|
|
51899
|
+
color: theme.highlightTextColor,
|
|
51900
|
+
children: sliceAddress(config.evmDifferentAddress)
|
|
51901
|
+
}
|
|
51902
|
+
)
|
|
51903
|
+
] });
|
|
51904
|
+
}
|
|
51905
|
+
}
|
|
51804
51906
|
return /* @__PURE__ */ jsxs(HStack, { gap: 1, children: [
|
|
51805
51907
|
walletIcon,
|
|
51806
51908
|
/* @__PURE__ */ jsx(
|
|
@@ -53258,6 +53360,11 @@ var FormBody = ({
|
|
|
53258
53360
|
isToNativeSOL ? void 0 : toTokenInfo.isSolana ? toTokenInfo.address : void 0,
|
|
53259
53361
|
toTokenInfo.isSolana
|
|
53260
53362
|
);
|
|
53363
|
+
const toTokenFixedSolanaBalance = useSolanaTokenBalance(
|
|
53364
|
+
isToNativeSOL ? void 0 : toTokenInfo.isSolana ? toTokenInfo.address : void 0,
|
|
53365
|
+
toTokenInfo.isSolana && !!config?.solanaDifferentAddress,
|
|
53366
|
+
config?.solanaDifferentAddress || void 0
|
|
53367
|
+
);
|
|
53261
53368
|
const fromTokenBalance = useMemo(() => {
|
|
53262
53369
|
if (fromTokenInfo.isSolana) {
|
|
53263
53370
|
return fromTokenBalanceSolana.data ? {
|
|
@@ -53276,6 +53383,13 @@ var FormBody = ({
|
|
|
53276
53383
|
]);
|
|
53277
53384
|
const toTokenBalance = useMemo(() => {
|
|
53278
53385
|
if (toTokenInfo.isSolana) {
|
|
53386
|
+
if (config?.solanaDifferentAddress && toTokenFixedSolanaBalance.data) {
|
|
53387
|
+
return {
|
|
53388
|
+
decimals: toTokenFixedSolanaBalance.data.decimals,
|
|
53389
|
+
value: toTokenFixedSolanaBalance.data.value,
|
|
53390
|
+
formatted: toTokenFixedSolanaBalance.data.formatted
|
|
53391
|
+
};
|
|
53392
|
+
}
|
|
53279
53393
|
if (toTokenBalanceSolana.data) {
|
|
53280
53394
|
return {
|
|
53281
53395
|
decimals: toTokenBalanceSolana.data.decimals,
|
|
@@ -53286,17 +53400,18 @@ var FormBody = ({
|
|
|
53286
53400
|
return void 0;
|
|
53287
53401
|
}
|
|
53288
53402
|
if (isToHyperChain) return toTokenBalanceHyper;
|
|
53289
|
-
if (
|
|
53403
|
+
if (config?.evmDifferentAddress && toTokenFixedEvmBalance) {
|
|
53290
53404
|
return toTokenFixedEvmBalance;
|
|
53291
53405
|
}
|
|
53292
53406
|
return toTokenBalanceNormal;
|
|
53293
53407
|
}, [
|
|
53294
53408
|
toTokenInfo.isSolana,
|
|
53409
|
+
config?.solanaDifferentAddress,
|
|
53410
|
+
toTokenFixedSolanaBalance.data,
|
|
53295
53411
|
toTokenBalanceSolana.data,
|
|
53296
53412
|
isToHyperChain,
|
|
53297
53413
|
toTokenBalanceHyper,
|
|
53298
53414
|
toTokenBalanceNormal,
|
|
53299
|
-
address,
|
|
53300
53415
|
config?.evmDifferentAddress,
|
|
53301
53416
|
toTokenFixedEvmBalance
|
|
53302
53417
|
]);
|
|
@@ -53573,7 +53688,7 @@ var FormBody = ({
|
|
|
53573
53688
|
if (fromAddress && fromAmount) {
|
|
53574
53689
|
refetchQuote2();
|
|
53575
53690
|
}
|
|
53576
|
-
}, [differentAddress, fromAddress, toAddress]);
|
|
53691
|
+
}, [differentAddress, fromAddress, toAddress, sponsorGas]);
|
|
53577
53692
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
53578
53693
|
/* @__PURE__ */ jsxs(
|
|
53579
53694
|
VStack,
|
|
@@ -56099,7 +56214,8 @@ var MainForm = ({ config }) => {
|
|
|
56099
56214
|
slippage: calculateSlippage(slippage?.value),
|
|
56100
56215
|
toTokenDecimals: toTokenInfo.decimals,
|
|
56101
56216
|
affiliation: vCode,
|
|
56102
|
-
to_platform_id: toTokenInfo.platform_id || 0
|
|
56217
|
+
to_platform_id: toTokenInfo.platform_id || 0,
|
|
56218
|
+
sponsor_gas: useGetGasStore.getState().sponsorGas
|
|
56103
56219
|
});
|
|
56104
56220
|
}
|
|
56105
56221
|
if (isWalletChangingRef.current) {
|