-
`
const SwitchText = styled(Text)`
color: ${(props) => props.theme.primaryTextv2};
`;
-
-const animation: Variants = {
- hidden: { x: "-100%", opacity: 0 },
- shown: { x: "0%", opacity: 1 }
-};
diff --git a/src/routes/popup/receive.tsx b/src/routes/popup/receive.tsx
index 07f9a111..a756905c 100644
--- a/src/routes/popup/receive.tsx
+++ b/src/routes/popup/receive.tsx
@@ -45,9 +45,6 @@ export default function Receive({ walletName, walletAddress }: ReceiveProps) {
// location
const [, setLocation] = useLocation();
- const wallet = useActiveWallet();
- const keystoneWarning = wallet?.type === "hardware";
-
const copyAddress: MouseEventHandler = (e) => {
e.stopPropagation();
copy(effectiveAddress);
@@ -77,16 +74,6 @@ export default function Receive({ walletName, walletAddress }: ReceiveProps) {
/>
- {keystoneWarning && (
-
-
-
-
-
- {browser.i18n.getMessage("keystone_ao_description")}
-
-
- )}
diff --git a/src/routes/popup/send/index.tsx b/src/routes/popup/send/index.tsx
index ea6e621e..77401098 100644
--- a/src/routes/popup/send/index.tsx
+++ b/src/routes/popup/send/index.tsx
@@ -241,7 +241,7 @@ export default function Send({ id }: Props) {
);
setBalance(
- balanceToFractioned(String(result[0]), {
+ balanceToFractioned(String(result[0] || 0), {
id: token.id,
decimals: token.decimals,
divisibility: token.divisibility
@@ -270,17 +270,29 @@ export default function Send({ id }: Props) {
if (isAo) {
return setPrice("0");
}
- const res = await redstone.getPrice(token.ticker);
- if (!res.value) {
- return setPrice("0");
- }
+ const redstonePromise = redstone.getPrice(token.ticker);
+ const multiplierPromise =
+ currency === "usd"
+ ? 1
+ : await getPrice("usd", currency).catch((err) => {
+ console.warn(`Error fetching price for ${currency}`, err);
+
+ return 0;
+ });
+
+ const [redstoneResponse, multiplier] = await Promise.all([
+ redstonePromise,
+ multiplierPromise
+ ]);
- // get price in currency
- const multiplier =
- currency !== "usd" ? await getPrice("usd", currency) : 1;
+ const redstoneValue = redstoneResponse.value;
- setPrice(BigNumber(res.value).multipliedBy(multiplier).toString());
+ setPrice(
+ redstoneResponse && multiplier
+ ? BigNumber(redstoneValue).multipliedBy(multiplier).toString()
+ : "0"
+ );
})();
}, [token, currency]);
@@ -321,10 +333,10 @@ export default function Send({ id }: Props) {
const max = useMemo(() => {
const balanceBigNum = BigNumber(balance);
const networkFeeBigNum = BigNumber(networkFee);
-
- let maxAmountToken = balanceBigNum.minus(networkFeeBigNum);
-
- if (token.id !== "AR") maxAmountToken = balanceBigNum;
+ const maxAmountToken =
+ token.id === "AR"
+ ? BigNumber.max(0, balanceBigNum.minus(networkFeeBigNum))
+ : balanceBigNum;
return maxAmountToken.multipliedBy(qtyMode === "fiat" ? price : 1);
}, [balance, token, networkFee, qtyMode]);
@@ -339,7 +351,12 @@ export default function Send({ id }: Props) {
// switch between fiat qty mode / token qty mode
function switchQtyMode() {
if (!+price) return;
- setQty(secondaryQty.toFixed(4));
+
+ let formattedQuantity = secondaryQty.toFixed(4);
+
+ if (formattedQuantity === "0.0000") formattedQuantity = "0";
+
+ setQty(formattedQuantity);
setQtyMode((val) => (val === "fiat" ? "token" : "fiat"));
}
@@ -492,14 +509,20 @@ export default function Send({ id }: Props) {
fullWidth
icon={
- {!!+price && (
-
- USD/
-
- {token.ticker.toUpperCase()}
-
-
- )}
+
+ {!!+price && (
+ <>
+ USD
+ {"/"}
+ >
+ )}
+
+ {token.ticker.toUpperCase()}
+
+
-
- {showTokenSelector && (
-
-
- updateSelectedToken("AR")} />
- {aoTokens.map((token, i) => (
- updateSelectedToken(token.id)}
- />
- ))}
- {tokens
- .filter((token) => token.type === "asset")
- .map((token, i) => (
- updateSelectedToken(token.id)}
- key={i}
- />
- ))}
-
-
- {tokens
- .filter((token) => token.type === "collectible")
- .map((token, i) => (
- updateSelectedToken(token.id)}
- key={i}
- />
- ))}
-
-
-
- )}
- {showSlider && (
-
- {
- setShowSlider(false);
- }}
- >
- setShowSlider(false)}
+
+ {
+ setShownTokenSelector(false);
+ }}
+ >
+
+ updateSelectedToken("AR")} />
+
+ {aoTokens.map((token, i) => (
+ updateSelectedToken(token.id)}
+ />
+ ))}
+
+ {tokens
+ .filter((token) => token.type === "asset")
+ .map((token, i) => (
+ updateSelectedToken(token.id)}
+ key={i}
/>
-
-
- )}
-
+ ))}
+
+
+
+ {tokens
+ .filter((token) => token.type === "collectible")
+ .map((token, i) => (
+ updateSelectedToken(token.id)}
+ key={i}
+ />
+ ))}
+
+
+
+ {
+ setShowSlider(false);
+ }}
+ >
+ setShowSlider(false)}
+ />
+
>
);
@@ -692,7 +707,7 @@ const MaxButton = styled.button<{ altColor?: string }>`
box-shadow: 0 0 0 0 rgba(${(props) => props.theme.theme});
`;
-const CurrencyButton = styled.button`
+const CurrencyButton = styled.button<{ altColor?: string }>`
font-weight: 400;
background-color: transparent;
border-radius: 4px;
@@ -706,6 +721,7 @@ const CurrencyButton = styled.button`
justify-content: center;
outline: none;
border: 0px;
+ color: #b9b9b9;
`;
const Wrapper = styled.div<{ showOverlay: boolean }>`
@@ -812,12 +828,6 @@ const InputIcons = styled.div`
gap: 0.625rem;
`;
-const qtyTextStyle = css`
- font-size: ${defaulQtytSize}rem;
- font-weight: 500;
- line-height: 1.1em;
-`;
-
const BottomActions = styled(Section)`
display: flex;
padding: 0 15px;
@@ -875,45 +885,12 @@ const TokenSelectorRightSide = styled.div`
}
`;
-export const SliderWrapper = styled(motion.div)<{ partial?: boolean }>`
- position: fixed;
- top: ${(props) => (props.partial ? "50px" : 0)};
- left: 0;
- bottom: 0;
- right: 0;
- overflow-y: auto;
- background-color: rgb(${(props) => props.theme.background});
- z-index: 1000;
-`;
-
-export const animation: Variants = {
- hidden: { opacity: 0 },
- shown: { opacity: 1 }
-};
-
-export const animation2: Variants = {
- hidden: {
- y: "100vh",
- transition: {
- duration: 0.2,
- ease: "easeOut"
- }
- },
- shown: {
- y: "0",
- transition: {
- duration: 0.2,
- ease: "easeInOut"
- }
- }
-};
-
-const TokensSection = styled(Section)`
+const TokensList = styled.ul`
display: flex;
flex-direction: column;
gap: 0.82rem;
- padding-top: 2rem;
- padding-bottom: 1.4rem;
+ padding: 0;
+ margin: 0;
`;
const CollectiblesList = styled(Section)`
@@ -921,4 +898,8 @@ const CollectiblesList = styled(Section)`
grid-template-columns: 1fr 1fr;
gap: 1.2rem;
padding-top: 0;
+
+ &:empty {
+ display: none;
+ }
`;
diff --git a/src/utils/apps.ts b/src/utils/apps.ts
index 0c9c7067..e0fc6028 100644
--- a/src/utils/apps.ts
+++ b/src/utils/apps.ts
@@ -15,6 +15,7 @@ import aoLinkLogo from "url:/assets/ecosystem/aolink.svg";
import llamaLogo from "url:/assets/ecosystem/llama.png";
import arswapLogo from "url:/assets/ecosystem/arswap.png";
import liquidopsLogo from "url:/assets/ecosystem/liquidops.svg";
+import quantumLogo from "url:/assets/ecosystem/quantum-logo.svg";
import betterideaLogo from "url:/assets/ecosystem/betteridea.png";
export interface App {
@@ -101,6 +102,21 @@ export const apps: App[] = [
twitter: "https://x.com/Liquid_Ops"
}
},
+ {
+ name: "Quantum",
+ category: "Defi",
+ description: "Bridge. Earn and Explore the AO ecosystem with Quantum.",
+ assets: {
+ logo: quantumLogo,
+ thumbnail: "",
+ lightBackground: "rgba(25, 25, 25, 1)",
+ darkBackground: "rgba(25, 25, 25, 1)"
+ },
+ links: {
+ website: "https://bridge.astrousd.com",
+ twitter: "https://x.com/astrousd"
+ }
+ },
{
name: "Bazar",
category: "Exchange",