Skip to content

Commit 59681df

Browse files
committed
feat: update minimum amount 0.00015
1 parent 58b7c1d commit 59681df

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

components/Bridge/Transfer/Form.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { IPaliWalletV2Context } from "@contexts/PaliWallet/V2Provider";
1515
import { usePaliWallet } from "@contexts/PaliWallet/usePaliWallet";
1616
import { useConnectedWallet } from "@contexts/ConnectedWallet/useConnectedWallet";
1717
import { useNEVM } from "@contexts/ConnectedWallet/NEVMProvider";
18+
import { MIN_AMOUNT } from "@constants";
1819

1920
const InitializeChecks: React.FC<{ children: React.ReactNode }> = ({
2021
children,
@@ -84,7 +85,7 @@ const InitializeChecks: React.FC<{ children: React.ReactNode }> = ({
8485
return <>{children}</>;
8586
};
8687

87-
const minAmount = 0.01;
88+
const minAmount = MIN_AMOUNT;
8889

8990
const BridgeTransferForm: React.FC = () => {
9091
const { startTransfer, transfer } = useTransfer();
@@ -123,7 +124,7 @@ const BridgeTransferForm: React.FC = () => {
123124
Balance:{" "}
124125
{balance === undefined
125126
? "--"
126-
: parseFloat(`${balance ?? 0}`).toFixed(4)}
127+
: parseFloat(`${balance ?? 0}`).toFixed(6)}
127128
</Typography>
128129
<TextField
129130
label="Amount"

components/Bridge/WalletSwitchV2/NEVMConnect.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ import WalletSwitchCard from "./Card";
55
import WalletSwitchConfirmCard from "./ConfirmCard";
66
import { ITransfer } from "@contexts/Transfer/types";
77
import { useNevmBalance } from "utils/balance-hooks";
8+
import { MIN_AMOUNT } from "@constants";
89

910
type NEVMConnectProps = {
1011
transfer: ITransfer;
1112
setNevm: (nevm: { address: string }) => void;
1213
};
1314

15+
const minAmount = MIN_AMOUNT;
16+
1417
const NEVMConnect: React.FC<NEVMConnectProps> = ({ setNevm, transfer }) => {
1518
const { account, connect } = useNEVM();
1619
const { isBitcoinBased, switchTo, changeAccount, isEVMInjected } =
@@ -39,7 +42,7 @@ const NEVMConnect: React.FC<NEVMConnectProps> = ({ setNevm, transfer }) => {
3942
balanceNum = 0;
4043
}
4144
const faucetLink =
42-
balance.isFetched && balanceNum < 0.01 ? (
45+
balance.isFetched && balanceNum < minAmount ? (
4346
<Alert severity="warning">
4447
<Typography variant="body2">
4548
You don&apos;t have enough balance. Please go to&nbsp;

components/Bridge/WalletSwitchV2/UTXOConnect.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import WalletSwitchCard from "./Card";
44
import WalletSwitchConfirmCard from "./ConfirmCard";
55
import { ITransfer } from "@contexts/Transfer/types";
66
import { useUtxoBalance } from "utils/balance-hooks";
7+
import { MIN_AMOUNT } from "@constants";
78

89
type UTXOConnectProps = {
910
transfer: ITransfer;
1011
setUtxo: (utxo: { xpub: string; address: string }) => void;
1112
};
1213

14+
const minAmount = MIN_AMOUNT;
15+
1316
const UTXOConnect: React.FC<UTXOConnectProps> = ({ setUtxo, transfer }) => {
1417
const balance = useUtxoBalance(transfer.utxoXpub);
1518
const {
@@ -44,10 +47,10 @@ const UTXOConnect: React.FC<UTXOConnectProps> = ({ setUtxo, transfer }) => {
4447
}
4548

4649
const faucetLink =
47-
balance.isFetched && balanceNum < 0.01 ? (
50+
balance.isFetched && balanceNum < minAmount ? (
4851
<Alert severity="warning">
4952
<Typography variant="body2">
50-
Please send at least 0.01 SYS into your Pali wallet to continue the
53+
Please send at least {minAmount} SYS into your Pali wallet to continue the
5154
transaction
5255
</Typography>
5356
</Alert>

components/Bridge/v3/Steps/ConnectValidate.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { ITransfer, TransferStatus } from "@contexts/Transfer/types";
2121
import { useRouter } from "next/router";
2222
import NextLink from "next/link";
2323
import CompareArrows from "@mui/icons-material/CompareArrows";
24+
import { MIN_AMOUNT } from "@constants";
2425

2526
const ErrorMessage = ({ message }: { message: string }) => (
2627
<Box sx={{ display: "flex", mb: 2 }}>
@@ -67,7 +68,7 @@ const BridgeV3ConnectValidateStep: React.FC<
6768
const utxoAddress = watch("utxoAddress");
6869
const utxoXpub = watch("utxoXpub");
6970
const nevmAddress = watch("nevmAddress");
70-
const minAmount = 0.01;
71+
const minAmount = MIN_AMOUNT;
7172

7273
const utxoBalance = useUtxoBalance(utxoXpub);
7374
const nevmBalance = useNevmBalance(nevmAddress);

constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const MIN_AMOUNT = 0.00015;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"baseUrl": "./",
1818
"paths": {
1919
"@contexts/*": ["./contexts/*"],
20-
"@firebase": ["./firebase"]
20+
"@firebase": ["./firebase"],
21+
"@constants": ["./constants"],
2122
}
2223
},
2324
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],

0 commit comments

Comments
 (0)