Skip to content

Commit 94ceb70

Browse files
committed
add warning copy to balances;
disable some assets
1 parent fe8f2b2 commit 94ceb70

2 files changed

Lines changed: 20 additions & 6 deletions

File tree

turnkey/src/features/balances/balances-ui.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export const Balances = ({ rootOrgId }: { rootOrgId: string }) => {
9999
)}
100100
</Tabs.List>
101101

102+
<p className="text-sm text-gray text-center mb-4">
103+
This is a demo app, please use with care. Please do not deposit more
104+
than $500.
105+
</p>
106+
102107
<Tabs.Content value="evm">
103108
{balancesQuery.status === "success" &&
104109
balancesQuery.data.balances.balanceByAsset.filter(

turnkey/src/features/swap/swap-ui.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,20 @@ const SwapForm = ({
146146
}, [btcAccount, balances.assets]);
147147

148148
const toAssets = useMemo(() => {
149-
return fromAssets.filter(
150-
(asset) =>
151-
asset.aggregatedAssetId !== fromAssetId &&
152-
asset.aggregatedAssetId !== "BTC"
153-
);
149+
return fromAssets.filter((asset) => {
150+
const isBTC = asset.aggregatedAssetId === "BTC";
151+
const isFromAsset = asset.aggregatedAssetId === fromAssetId;
152+
const isBTCFromAsset = fromAsset?.aggregatedAssetId === "BTC";
153+
154+
// if BTC is the fromAsset, disable AVAX, USDC, APE
155+
const disableUSDC = isBTCFromAsset && asset.symbol === "USDC";
156+
const disableAVAX = isBTCFromAsset && asset.symbol === "AVAX";
157+
const disableAPE = isBTCFromAsset && asset.symbol === "APE";
158+
159+
return (
160+
!isFromAsset && !isBTC && !disableUSDC && !disableAVAX && !disableAPE
161+
);
162+
});
154163
}, [fromAssetId, fromAssets]);
155164

156165
if (mutation.status === "success") {
@@ -277,7 +286,7 @@ const SwapForm = ({
277286
: "This is an EVM network swap, make sure to use your [MAIN] Passkey when signing"}
278287
</p>
279288
<p className="text-sm text-gray text-center mb-4">
280-
This is a demo app. Transactions are capped at $500
289+
This is a demo app. Transactions are capped at $500.
281290
</p>
282291
<button
283292
type="submit"

0 commit comments

Comments
 (0)