Compare commits

..

No commits in common. "4b4b5af550871c0c2afc5c11eab023104ccdeef3" and "814e6a4eacf0a04c218203a83e9ac7868a496a0d" have entirely different histories.

7 changed files with 166 additions and 201 deletions

View File

@ -21,6 +21,9 @@ 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
[],
[]
@ -33,7 +36,7 @@ const addLock = async (
};
const releaseLock = async (
pixKey: string,
pixKey: number,
amount: number,
e2eId: string,
lockId: string
@ -43,7 +46,7 @@ const releaseLock = async (
);
const messageToSign = ethers.utils.solidityKeccak256(
["bytes32", "uint256", "bytes32"],
["uint160", "uint256", "bytes32"],
[
pixKey,
parseEther(String(amount)),
@ -62,8 +65,11 @@ const releaseLock = async (
const release = await p2pContract.release(
BigNumber.from(lockId),
ethers.constants.AddressZero,
ethers.utils.formatBytes32String(e2eId),
flatSig
sig.r,
sig.s,
sig.v
);
await release.wait();

View File

@ -103,7 +103,7 @@ const getValidDeposits = async (
blockNumber: deposit.blockNumber,
remaining: Number(formatEther(mappedBalance._hex)),
seller: deposit.args?.seller,
pixKey: mappedPixTarget,
pixKey: Number(mappedPixTarget._hex),
};
}
@ -127,7 +127,7 @@ const getUnreleasedLockById = async (
const pixTarget = lock.pixTarget;
const amount = formatEther(lock?.amount);
pixData.pixKey = pixTarget;
pixData.pixKey = String(Number(pixTarget));
pixData.value = Number(amount);
return {

View File

@ -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),
true
pixKey,
true,
ethers.utils.formatBytes32String("")
);
await deposit.wait();

View File

@ -201,7 +201,7 @@ const checkUnreleasedLock = async (
const pixTarget = lock.pixTarget;
const amount = formatEther(lock?.amount);
pixData.pixKey = pixTarget;
pixData.pixKey = String(Number(pixTarget));
pixData.value = Number(amount);
return {

View File

@ -169,11 +169,6 @@ 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

View File

@ -83,7 +83,7 @@ const checkForUnreleasedLocks = async (): Promise<void> => {
if (walletLocks) {
lockID.value = walletLocks.lockID;
tokenAmount.value = walletLocks.pix.value;
pixTarget.value = walletLocks.pix.pixKey;
pixTarget.value = Number(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 = lockToRedirect.pix.pixKey;
pixTarget.value = Number(lockToRedirect.pix.pixKey);
flowStep.value = Step.Buy;
} else {
flowStep.value = Step.Search;