Adjust withdraw function and listing valid deposits by wallet address, also remove cancel deposit option and use a fixed amount to withdraw while there isn't a input to inform it
This commit is contained in:
@@ -84,10 +84,13 @@ const cancelDeposit = async (depositId: BigNumber): Promise<any> => {
|
||||
return cancel;
|
||||
};
|
||||
|
||||
const withdrawDeposit = async (depositId: BigNumber): Promise<any> => {
|
||||
const withdrawDeposit = async (
|
||||
depositId: BigNumber,
|
||||
amount: string
|
||||
): Promise<any> => {
|
||||
const contract = getContract();
|
||||
|
||||
const withdraw = await contract.withdraw(depositId, []);
|
||||
const withdraw = await contract.withdraw(depositId, amount, []);
|
||||
await withdraw.wait();
|
||||
|
||||
return withdraw;
|
||||
|
||||
@@ -92,7 +92,8 @@ const getValidDeposits = async (
|
||||
};
|
||||
}
|
||||
|
||||
if (validDeposit) depositList[deposit.args?.seller + token] = validDeposit;
|
||||
if (validDeposit)
|
||||
depositList[deposit.args?.seller + token] = validDeposit;
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ const updateWalletStatus = async (): Promise<void> => {
|
||||
const listValidDepositTransactionsByWalletAddress = async (
|
||||
walletAddress: string
|
||||
): Promise<ValidDeposit[]> => {
|
||||
const walletDeposits = await getValidDeposits();
|
||||
const walletDeposits = await getValidDeposits(getTokenAddress());
|
||||
|
||||
if (walletDeposits) {
|
||||
return walletDeposits
|
||||
|
||||
Reference in New Issue
Block a user