Adding request to user change network in wallet

This commit is contained in:
brunoedcf
2023-01-13 14:12:11 -03:00
parent a5d5c0dde3
commit 4ef5308f36
7 changed files with 145 additions and 64 deletions

View File

@@ -8,7 +8,6 @@ import addresses from "./smart_contract_files/localhost.json";
// Mock wallets import
import { wallets } from "./smart_contract_files/wallets.json";
import { getProvider } from "../blockchain/provider";
import { updateWalletBalance, updateWalletStatus } from "../blockchain/wallet";
// Split tokens between wallets in wallets.json
const splitTokens = async () => {
@@ -28,7 +27,7 @@ const splitTokens = async () => {
ethers.utils.parseEther("4000000.0")
);
await tx.wait();
updateWalletStatus();
// updateWalletStatus();
}
};
@@ -268,7 +267,7 @@ const addDeposit = async (tokenQty: Number, pixKey: String) => {
);
await deposit.wait();
await updateWalletStatus();
// await updateWalletStatus();
await updateDepositAddedEvents();
await updateValidDeposits();
};
@@ -301,7 +300,7 @@ const mockDeposit = async (tokenQty: Number, pixKey: String) => {
);
await deposit.wait();
await updateWalletStatus();
// await updateWalletStatus();
await updateValidDeposits();
await updateDepositAddedEvents();
};
@@ -316,7 +315,7 @@ const cancelDeposit = async (depositId: BigNumber): Promise<Boolean> => {
const contract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer);
await contract.cancelDeposit(depositId);
await updateWalletBalance();
// await updateWalletBalance();
await updateValidDeposits();
return true;
};
@@ -331,7 +330,7 @@ const withdrawDeposit = async (depositId: BigNumber): Promise<Boolean> => {
const contract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer);
await contract.withdraw(depositId, []);
await updateWalletBalance();
// await updateWalletBalance();
await updateValidDeposits();
return true;
};

View File

@@ -0,0 +1,8 @@
{
"signers": [
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
],
"p2pix": "0x5f3EFA9A90532914545CEf527C530658af87e196",
"token": "0x294003F602c321627152c6b7DED3EAb5bEa853Ee"
}

View File

@@ -0,0 +1,8 @@
{
"signers": [
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
],
"p2pix": "0x5f3EFA9A90532914545CEf527C530658af87e196",
"token": "0x294003F602c321627152c6b7DED3EAb5bEa853Ee"
}