diff --git a/src/components/Actions/MintWithStarknetReactNext.tsx b/src/components/Actions/MintWithStarknetReactNext.tsx deleted file mode 100644 index c178b89..0000000 --- a/src/components/Actions/MintWithStarknetReactNext.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { ETHTokenAddress, provider } from "@/constants" -import { lastTxHashAtom, lastTxStatusAtom } from "@/state/transactionState" -import { Flex, Heading, Input } from "@chakra-ui/react" -import { useAtom, useSetAtom } from "jotai" -import { useState } from "react" -import { Abi, useContract } from "starknet-react-core-next" - -const abi = [ - { - type: "function", - name: "permissionedMint", - state_mutability: "external", - inputs: [ - { - name: "recipient", - type: "core::starknet::contract_address::ContractAddress", - }, - { - name: "amount", - type: "core::integer::u256", - }, - ], - outputs: [], - }, -] as const satisfies Abi - -const MintWithStarknetReact = () => { - const [mintAmount, setMintAmount] = useState("10") - - const [transactionStatus, setTransactionStatus] = useAtom(lastTxStatusAtom) - const setLastTransactionHash = useSetAtom(lastTxHashAtom) - - const buttonsDisabled = ["approve", "pending"].includes(transactionStatus) - - const { contract } = useContract({ - abi, - address: ETHTokenAddress, - provider, - }) - - const handleMintSubmit = async (e: React.FormEvent) => { - e.preventDefault() - try { - setTransactionStatus("approve") - const { transaction_hash } = await contract - setLastTransactionHash(transaction_hash) - setTransactionStatus("pending") - } catch (e) { - console.error(e) - setTransactionStatus("idle") - } - } - - return ( - - - Mint token - setMintAmount(e.target.value)} - /> - - - - - ) -} - -export { MintWithStarknetReact }