Skip to content

Commit

Permalink
style: remove hash from claim complete toast
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Feb 16, 2024
1 parent a23be4c commit 04f5e5d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/cloudflare-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to Cloudflare Pages

on:
push:

jobs:
deploy-to-cloudflare:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-22.04
permissions:
contents: read

steps:
- name: Check Cloudflare API Token
run: |
if [[ -z "${{ secrets.CLOUDFLARE_API_TOKEN }}" ]]; then
echo "CLOUDFLARE_API_TOKEN secret must be set" >&2
exit 1
fi
- name: Deploy to Cloudflare
uses: ubiquity/cloudflare-deploy-action@main
with:
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
repository: ${{ github.repository }}
production_branch: ${{ github.event.repository.default_branch }}
output_directory: "static"
is_production: ${{ github.event_name == 'push' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' }}
# env:
# Add any environment variables you need to pass along here
# SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
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 04f5e5d

Please sign in to comment.