Skip to content

Commit

Permalink
Merge pull request #162 from pavlovcik/style/claim-complete
Browse files Browse the repository at this point in the history
style: remove hash from claim complete toast
  • Loading branch information
0x4007 authored Feb 16, 2024
2 parents bd24f46 + 5d9adb5 commit 8b78cc9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions static/scripts/rewards/web3/erc20-permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export function claimErc20PermitHandler(permit: Erc20Permit) {
const permit2Contract = new ethers.Contract(permit2Address, permit2Abi, signer);
const tx = await permit2Contract.permitTransferFrom(permit.permit, permit.transferDetails, permit.owner, permit.signature);
toaster.create("info", `Transaction sent`);

const receipt = await tx.wait();
toaster.create("success", `Claim Complete: ${receipt?.transactionHash}`);
toaster.create("success", `Claim Complete.`);
console.log(receipt.transactionHash); // @TODO: post to database

claimButton.element.removeEventListener("click", handler);
renderTransaction(true);
Expand Down
11 changes: 6 additions & 5 deletions static/scripts/rewards/web3/erc721-permit.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TransactionResponse } from "@ethersproject/providers";
import { ethers } from "ethers";
import { Erc721Permit } from "../render-transaction/tx-type";
import { claimButton, errorToast, loadingClaimButton, resetClaimButton, toaster } from "../toaster";
import { connectWallet } from "./wallet";
import { nftRewardAbi } from "../abis/nftRewardAbi";
import { TransactionResponse } from "@ethersproject/providers";
import { getOptimalRPC } from "../helpers";
import { renderTransaction } from "../render-transaction/render-transaction";
import { Erc721Permit } from "../render-transaction/tx-type";
import { claimButton, errorToast, loadingClaimButton, resetClaimButton, toaster } from "../toaster";
import { connectWallet } from "./wallet";

export function claimErc721PermitHandler(permit: Erc721Permit) {
return async function claimButtonHandler() {
Expand Down Expand Up @@ -40,7 +40,8 @@ export function claimErc721PermitHandler(permit: Erc721Permit) {
const tx: TransactionResponse = await nftContract.safeMint(permit.request, permit.signature);
toaster.create("info", `Transaction sent. Waiting for confirmation...`);
const receipt = await tx.wait();
toaster.create("success", `Claim Complete: ${receipt.transactionHash}`);
toaster.create("success", `Claim Complete.`);
console.log(receipt.transactionHash); // @TODO: post to database

claimButton.element.removeEventListener("click", claimButtonHandler);

Expand Down

0 comments on commit 8b78cc9

Please sign in to comment.