Compare commits
2 Commits
814e6a4eac
...
4b4b5af550
Author | SHA1 | Date | |
---|---|---|---|
|
4b4b5af550 | ||
|
659cc34d68 |
@ -21,9 +21,6 @@ const addLock = async (
|
||||
const lock = await p2pContract.lock(
|
||||
seller,
|
||||
token,
|
||||
etherStore.walletAddress, // String "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" (Example)
|
||||
ethers.constants.AddressZero, // String "0x0000000000000000000000000000000000000000"
|
||||
0,
|
||||
parseEther(String(amount)), // BigNumber
|
||||
[],
|
||||
[]
|
||||
@ -36,7 +33,7 @@ const addLock = async (
|
||||
};
|
||||
|
||||
const releaseLock = async (
|
||||
pixKey: number,
|
||||
pixKey: string,
|
||||
amount: number,
|
||||
e2eId: string,
|
||||
lockId: string
|
||||
@ -46,7 +43,7 @@ const releaseLock = async (
|
||||
);
|
||||
|
||||
const messageToSign = ethers.utils.solidityKeccak256(
|
||||
["uint160", "uint256", "bytes32"],
|
||||
["bytes32", "uint256", "bytes32"],
|
||||
[
|
||||
pixKey,
|
||||
parseEther(String(amount)),
|
||||
@ -65,11 +62,8 @@ const releaseLock = async (
|
||||
|
||||
const release = await p2pContract.release(
|
||||
BigNumber.from(lockId),
|
||||
ethers.constants.AddressZero,
|
||||
ethers.utils.formatBytes32String(e2eId),
|
||||
sig.r,
|
||||
sig.s,
|
||||
sig.v
|
||||
flatSig
|
||||
);
|
||||
await release.wait();
|
||||
|
||||
|
@ -103,7 +103,7 @@ const getValidDeposits = async (
|
||||
blockNumber: deposit.blockNumber,
|
||||
remaining: Number(formatEther(mappedBalance._hex)),
|
||||
seller: deposit.args?.seller,
|
||||
pixKey: Number(mappedPixTarget._hex),
|
||||
pixKey: mappedPixTarget,
|
||||
};
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ const getUnreleasedLockById = async (
|
||||
|
||||
const pixTarget = lock.pixTarget;
|
||||
const amount = formatEther(lock?.amount);
|
||||
pixData.pixKey = String(Number(pixTarget));
|
||||
pixData.pixKey = pixTarget;
|
||||
pixData.value = Number(amount);
|
||||
|
||||
return {
|
||||
|
@ -32,11 +32,11 @@ const addDeposit = async (tokenQty: string, pixKey: string): Promise<any> => {
|
||||
const etherStore = useEtherStore();
|
||||
|
||||
const deposit = await p2pContract.deposit(
|
||||
pixKey,
|
||||
ethers.utils.formatBytes32String(""),
|
||||
getTokenAddress(etherStore.selectedToken),
|
||||
parseEther(tokenQty),
|
||||
pixKey,
|
||||
true,
|
||||
ethers.utils.formatBytes32String("")
|
||||
true
|
||||
);
|
||||
|
||||
await deposit.wait();
|
||||
|
@ -201,7 +201,7 @@ const checkUnreleasedLock = async (
|
||||
|
||||
const pixTarget = lock.pixTarget;
|
||||
const amount = formatEther(lock?.amount);
|
||||
pixData.pixKey = String(Number(pixTarget));
|
||||
pixData.pixKey = pixTarget;
|
||||
pixData.value = Number(amount);
|
||||
|
||||
return {
|
||||
|
@ -169,6 +169,11 @@ watch(walletAddress, (): void => {
|
||||
class="flex flex-row p-2 px-3 bg-gray-300 rounded-3xl min-w-fit gap-1"
|
||||
@click="openTokenSelection()"
|
||||
>
|
||||
<img
|
||||
class="text-gray-900"
|
||||
alt="Chevron Down"
|
||||
src="@/assets/chevronDownBlack.svg"
|
||||
/>
|
||||
<img
|
||||
alt="Token image"
|
||||
class="sm:w-fit w-4"
|
||||
|
File diff suppressed because one or more lines are too long
@ -83,7 +83,7 @@ const checkForUnreleasedLocks = async (): Promise<void> => {
|
||||
if (walletLocks) {
|
||||
lockID.value = walletLocks.lockID;
|
||||
tokenAmount.value = walletLocks.pix.value;
|
||||
pixTarget.value = Number(walletLocks.pix.pixKey);
|
||||
pixTarget.value = walletLocks.pix.pixKey;
|
||||
showModal.value = true;
|
||||
} else {
|
||||
flowStep.value = Step.Search;
|
||||
@ -96,7 +96,7 @@ if (paramLockID) {
|
||||
if (lockToRedirect) {
|
||||
lockID.value = lockToRedirect.lockID;
|
||||
tokenAmount.value = lockToRedirect.pix.value;
|
||||
pixTarget.value = Number(lockToRedirect.pix.pixKey);
|
||||
pixTarget.value = lockToRedirect.pix.pixKey;
|
||||
flowStep.value = Step.Buy;
|
||||
} else {
|
||||
flowStep.value = Step.Search;
|
||||
|
Loading…
x
Reference in New Issue
Block a user