From 813287f85bceace1e2ade8545958fe201ca03cd0 Mon Sep 17 00:00:00 2001 From: Alissa Crane Date: Thu, 8 Aug 2024 11:30:02 -0700 Subject: [PATCH] chore: updated zora contract (#12) Co-authored-by: Alissa Crane --- bun.lockb | Bin 511636 -> 511628 bytes package.json | 2 +- src/components/TransactionWrapper.tsx | 53 ++++++++++++++++++++------ src/constants.ts | 29 ++++++++++---- 4 files changed, 63 insertions(+), 21 deletions(-) diff --git a/bun.lockb b/bun.lockb index 167ed4eeeeb6e676bd3342b83890f20c0efb93eb..1114b155cc3e54913b4b201202abc8ee7b56005e 100755 GIT binary patch delta 13783 zcmYM)3AkHx{>Slqdv8P0&?&K}rKGmTo|-{unbevtNY#?s8l|KtX>GaHl3FU1Hh0Wu zEG4x@6}i^fDm9E)hA1jpG$<2enGA#Ye}13O_j&&3@w>0zdFOXdPEL|r^;o!g$o$1a zZVv7^X;Ai-Q;t4)_{4iRxpna9SKnE9*2(LRI_a@HJujAipE>Y~AAWt~(Q!Y;Z(R}J z<<`B%Za8<=xMMh;V~3Cz>Mi1!G>cMD$C>f@q7_SBypBSYO;K zv!kQ4qrGVxj_UaTtvfaU%{TX)F>Kf0KV3E^u=2WF_Ska%MxEYqBUVnxOnATF_4k~4 z?7Exoo)-*EPOm8TJN)*^;WrlK2W+(SOW)sl-}vH!SLfgZfz#u25onUMsEOdWj2TfE zp?@=GMMH$YW6X)BhMi8)IIyM6}IV5N#3rov}z3dHUgwFN*VL z$^Gp0c9MiB3tvCRq^Jmg7h_6PMWCB8EovgzpD`oqBE;wJ&5DKyZ@`r~(G-yl8S|ng zq5~KUqAg+@F&2eqWA4R8Nq9G5Oo+1Z4P;D;itu|GQ=%#Yn=+Y8V_MWi@F2#FsEg3S zj9JkT;V@%PG)3eP#=K~W=%I`S(H5~$j78xY&AqrN3GZQy2~ifl!x@vJBK&`5Oo^%p zL>SYeCW2!aGomg+M=)kZLxhiH%!#Im9L1OyEfGDMu^`$ab_`=tc#h>>T$F@2%9s#k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?wjPVk6d(;-bDf5%8 zJ!b7KX}ef^+}avx8?8NI?QLoLcT3&!*4~l1{^Ryx@yX8e`RhA=SBCy`H77o03(GPu z%iX$6TyE_>nd_fo`psBj?R}Z+za;gW@wBxMWIoH)z-)Az{b$T9JGnFr)W^d>7= ztIAwoSnr)Tr0G>yFXK9SzSqRJq~Y&>8)Rp)#5cq>ws51&FS8eZ$DZ&jY3rovXZ^0V zuVt=(Zs6mx_KmbX_0?p1&)T;#Z;_MHtMO-d#GaaAXSqv>nq$ z|2?{1#>UK#|FjLr^li2c>hwpaj*FXZwYDyET5$%Bt(lRnoqKo8YVCaG0bTm`W4yQH zw}U#5>(nx!9Sh?43_Qhj+^^CyYAL9VBX>(&W^=H Jw)=Vh{{bpBo0I?m diff --git a/package.json b/package.json index 86657d3..9047cdf 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "test:coverage": "vitest run --coverage" }, "dependencies": { - "@coinbase/onchainkit": "^0.28.3", + "@coinbase/onchainkit": "^0.28.6", "next": "^14.2.5", "permissionless": "^0.1.26", "react": "^18", diff --git a/src/components/TransactionWrapper.tsx b/src/components/TransactionWrapper.tsx index be85cdc..61e0d4b 100644 --- a/src/components/TransactionWrapper.tsx +++ b/src/components/TransactionWrapper.tsx @@ -6,8 +6,22 @@ import { TransactionStatusAction, TransactionStatusLabel, } from '@coinbase/onchainkit/transaction'; -import { clickContractAbi, clickContractAddress } from 'src/constants'; +import type { + TransactionError, + TransactionResponse, +} from '@coinbase/onchainkit/transaction'; +import { + BASE_SEPOLIA_CHAIN_ID, + collectionAddress, + comment, + mintABI, + mintContractAddress, + mintReferral, + quantity, + tokenId, +} from 'src/constants'; import type { Address, ContractFunctionParameters } from 'viem'; +import { parseEther } from 'viem'; type TransactionWrapperParams = { address: Address; @@ -16,20 +30,32 @@ type TransactionWrapperParams = { export default function TransactionWrapper({ address, }: TransactionWrapperParams) { + const mintTo = address; + const contracts = [ { - address: clickContractAddress, - abi: clickContractAbi, - functionName: 'click', - args: [], + address: mintContractAddress, + abi: mintABI, + functionName: 'mint', + args: [ + mintTo, + BigInt(quantity), + collectionAddress, + BigInt(tokenId), + mintReferral, + comment, + ], + value: parseEther('0.000111'), }, - { - address: clickContractAddress, - abi: clickContractAbi, - functionName: 'click', - args: [], - }, - ] as ContractFunctionParameters[]; + ] as unknown as ContractFunctionParameters[]; + + const handleError = (err: TransactionError) => { + console.error('Transaction error:', err); + }; + + const handleSuccess = (response: TransactionResponse) => { + console.log('Transaction successful', response); + }; return (
@@ -37,6 +63,9 @@ export default function TransactionWrapper({ address={address} contracts={contracts} className="w-[450px]" + chainId={BASE_SEPOLIA_CHAIN_ID} + onError={handleError} + onSuccess={handleSuccess} >