@deframe-sdk/components 0.1.39 → 0.1.41
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.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1498,7 +1498,7 @@ interface ChooseAnAssetSwapViewProps {
|
|
|
1498
1498
|
isFetching: boolean;
|
|
1499
1499
|
onAssetClick: (token: TokenData) => void;
|
|
1500
1500
|
labels: ChooseAnAssetSwapLabels;
|
|
1501
|
-
formatTokenAmount: (amountUI: string, priceUSD: number
|
|
1501
|
+
formatTokenAmount: (amountUI: string, priceUSD: number) => string;
|
|
1502
1502
|
formatCurrencyValue: (value: number) => string;
|
|
1503
1503
|
}
|
|
1504
1504
|
declare const ChooseAnAssetSwapView: React__default.FC<ChooseAnAssetSwapViewProps>;
|
|
@@ -1632,6 +1632,7 @@ interface ConfirmSwapButtonLabels {
|
|
|
1632
1632
|
noAmountLabel: string;
|
|
1633
1633
|
belowMinimumLabel: string;
|
|
1634
1634
|
insufficientBalanceLabel: string;
|
|
1635
|
+
noRouteFoundLabel: string;
|
|
1635
1636
|
}
|
|
1636
1637
|
|
|
1637
1638
|
interface ConfirmSwapButtonViewProps {
|
|
@@ -1738,7 +1739,7 @@ interface ChooseNetworkAndAssetViewSimpleProps {
|
|
|
1738
1739
|
onNetworkSelect: (network: NetworkOption) => void;
|
|
1739
1740
|
displayedTokens: TokenData[];
|
|
1740
1741
|
findBalance: (token: TokenData) => BalanceDomain | undefined;
|
|
1741
|
-
formatTokenAmount: (amountUI: string, priceUSD: number
|
|
1742
|
+
formatTokenAmount: (amountUI: string, priceUSD: number) => string;
|
|
1742
1743
|
formatCurrencyValue: (value: number) => string;
|
|
1743
1744
|
onAssetClick: (token: TokenData) => void;
|
|
1744
1745
|
onSearch: (value: string) => void;
|
|
@@ -3201,7 +3202,7 @@ declare const OfframpSuccessSimpleView: React$1.FC<OfframpSuccessViewProps>;
|
|
|
3201
3202
|
|
|
3202
3203
|
declare const OfframpFailedSimpleView: React$1.FC<OfframpSuccessViewProps>;
|
|
3203
3204
|
|
|
3204
|
-
type SwapValidationCode = 'NO_WALLET' | 'NO_CHAIN' | 'NO_TOKEN' | 'INVALID_TOKEN' | 'NO_AMOUNT' | 'AMOUNT_BELOW_MINIMUM' | 'INSUFFICIENT_BALANCE' | 'INVALID_AMOUNT' | 'VALID_SWAP';
|
|
3205
|
+
type SwapValidationCode = 'NO_WALLET' | 'NO_CHAIN' | 'NO_TOKEN' | 'INVALID_TOKEN' | 'NO_AMOUNT' | 'AMOUNT_BELOW_MINIMUM' | 'INSUFFICIENT_BALANCE' | 'INVALID_AMOUNT' | 'NO_ROUTE_FOUND' | 'VALID_SWAP';
|
|
3205
3206
|
|
|
3206
3207
|
interface DashboardStrategyItem {
|
|
3207
3208
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1498,7 +1498,7 @@ interface ChooseAnAssetSwapViewProps {
|
|
|
1498
1498
|
isFetching: boolean;
|
|
1499
1499
|
onAssetClick: (token: TokenData) => void;
|
|
1500
1500
|
labels: ChooseAnAssetSwapLabels;
|
|
1501
|
-
formatTokenAmount: (amountUI: string, priceUSD: number
|
|
1501
|
+
formatTokenAmount: (amountUI: string, priceUSD: number) => string;
|
|
1502
1502
|
formatCurrencyValue: (value: number) => string;
|
|
1503
1503
|
}
|
|
1504
1504
|
declare const ChooseAnAssetSwapView: React__default.FC<ChooseAnAssetSwapViewProps>;
|
|
@@ -1632,6 +1632,7 @@ interface ConfirmSwapButtonLabels {
|
|
|
1632
1632
|
noAmountLabel: string;
|
|
1633
1633
|
belowMinimumLabel: string;
|
|
1634
1634
|
insufficientBalanceLabel: string;
|
|
1635
|
+
noRouteFoundLabel: string;
|
|
1635
1636
|
}
|
|
1636
1637
|
|
|
1637
1638
|
interface ConfirmSwapButtonViewProps {
|
|
@@ -1738,7 +1739,7 @@ interface ChooseNetworkAndAssetViewSimpleProps {
|
|
|
1738
1739
|
onNetworkSelect: (network: NetworkOption) => void;
|
|
1739
1740
|
displayedTokens: TokenData[];
|
|
1740
1741
|
findBalance: (token: TokenData) => BalanceDomain | undefined;
|
|
1741
|
-
formatTokenAmount: (amountUI: string, priceUSD: number
|
|
1742
|
+
formatTokenAmount: (amountUI: string, priceUSD: number) => string;
|
|
1742
1743
|
formatCurrencyValue: (value: number) => string;
|
|
1743
1744
|
onAssetClick: (token: TokenData) => void;
|
|
1744
1745
|
onSearch: (value: string) => void;
|
|
@@ -3201,7 +3202,7 @@ declare const OfframpSuccessSimpleView: React$1.FC<OfframpSuccessViewProps>;
|
|
|
3201
3202
|
|
|
3202
3203
|
declare const OfframpFailedSimpleView: React$1.FC<OfframpSuccessViewProps>;
|
|
3203
3204
|
|
|
3204
|
-
type SwapValidationCode = 'NO_WALLET' | 'NO_CHAIN' | 'NO_TOKEN' | 'INVALID_TOKEN' | 'NO_AMOUNT' | 'AMOUNT_BELOW_MINIMUM' | 'INSUFFICIENT_BALANCE' | 'INVALID_AMOUNT' | 'VALID_SWAP';
|
|
3205
|
+
type SwapValidationCode = 'NO_WALLET' | 'NO_CHAIN' | 'NO_TOKEN' | 'INVALID_TOKEN' | 'NO_AMOUNT' | 'AMOUNT_BELOW_MINIMUM' | 'INSUFFICIENT_BALANCE' | 'INVALID_AMOUNT' | 'NO_ROUTE_FOUND' | 'VALID_SWAP';
|
|
3205
3206
|
|
|
3206
3207
|
interface DashboardStrategyItem {
|
|
3207
3208
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -5753,7 +5753,7 @@ var ChooseAnAssetSwapView = ({
|
|
|
5753
5753
|
displayedTokens.map((token, index) => {
|
|
5754
5754
|
const balance = findBalance == null ? void 0 : findBalance(token);
|
|
5755
5755
|
const priceUSD = Number(balance == null ? void 0 : balance.priceUSD) || token.priceInUSD || 0;
|
|
5756
|
-
const formattedBalance = (balance == null ? void 0 : balance.amountUI) ? formatTokenAmount(balance.amountUI, priceUSD
|
|
5756
|
+
const formattedBalance = (balance == null ? void 0 : balance.amountUI) ? formatTokenAmount(balance.amountUI, priceUSD) : "0";
|
|
5757
5757
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5758
5758
|
ListItem,
|
|
5759
5759
|
{
|
|
@@ -8083,9 +8083,9 @@ function AssetRowInline({
|
|
|
8083
8083
|
onKeyDown,
|
|
8084
8084
|
index
|
|
8085
8085
|
}) {
|
|
8086
|
-
var _a;
|
|
8087
8086
|
const hasBalance = !!balance && parseFloat(balance.amountInUSD) >= 0.01;
|
|
8088
|
-
const
|
|
8087
|
+
const priceUSD = Number(balance == null ? void 0 : balance.priceUSD) || token.priceInUSD || 0;
|
|
8088
|
+
const formattedAmount = balance ? formatTokenAmount(balance.amountUI, priceUSD) : void 0;
|
|
8089
8089
|
const formattedUsd = balance ? formatCurrencyValue(parseFloat(balance.amountInUSD)) : void 0;
|
|
8090
8090
|
const baseClasses = [
|
|
8091
8091
|
"group",
|