diff --git a/trade.renegade.fi/app/providers.tsx b/trade.renegade.fi/app/providers.tsx index ad37397e..45a76bcb 100644 --- a/trade.renegade.fi/app/providers.tsx +++ b/trade.renegade.fi/app/providers.tsx @@ -20,7 +20,7 @@ import { ConnectKitProvider, getDefaultConfig } from "connectkit" import { IntercomProvider } from "react-use-intercom" import { createPublicClient, http } from "viem" import { WagmiConfig, createConfig } from "wagmi" -import { stylusDevnet, stylusDevnetEc2, stylusTestnet } from "@/lib/stylus" +import { stylusDevnetEc2 } from "@/lib/stylus" const { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(menuAnatomy.keys) diff --git a/trade.renegade.fi/package.json b/trade.renegade.fi/package.json index 0ec6b40b..0eb387b7 100644 --- a/trade.renegade.fi/package.json +++ b/trade.renegade.fi/package.json @@ -44,7 +44,6 @@ "@types/react-dom": "^18.2.14", "@types/uuid": "^9.0.7", "@typescript-eslint/parser": "^5.61.0", - "@wagmi/cli": "^1.5.2", "eslint": "8.45.0", "eslint-config-next": "^14.0.3", "eslint-config-prettier": "^8.8.0", @@ -53,4 +52,4 @@ "prettier": "^2.8.8", "typescript": "5.1.6" } -} +} \ No newline at end of file diff --git a/trade.renegade.fi/src/generated.ts b/trade.renegade.fi/src/generated.ts deleted file mode 100644 index 0a0d065f..00000000 --- a/trade.renegade.fi/src/generated.ts +++ /dev/null @@ -1,1072 +0,0 @@ -import { - UseContractEventConfig, - UseContractReadConfig, - UseContractWriteConfig, - UsePrepareContractWriteConfig, - useContractEvent, - useContractRead, - useContractWrite, - usePrepareContractWrite, -} from "wagmi" -import { - PrepareWriteContractResult, - ReadContractResult, - WriteContractMode, -} from "wagmi/actions" - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// erc20 -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const erc20ABI = [ - { - type: "event", - inputs: [ - { name: "owner", type: "address", indexed: true }, - { name: "spender", type: "address", indexed: true }, - { name: "value", type: "uint256", indexed: false }, - ], - name: "Approval", - }, - { - type: "event", - inputs: [ - { name: "from", type: "address", indexed: true }, - { name: "to", type: "address", indexed: true }, - { name: "value", type: "uint256", indexed: false }, - ], - name: "Transfer", - }, - { - stateMutability: "view", - type: "function", - inputs: [ - { name: "owner", type: "address" }, - { name: "spender", type: "address" }, - ], - name: "allowance", - outputs: [{ name: "", type: "uint256" }], - }, - { - stateMutability: "nonpayable", - type: "function", - inputs: [ - { name: "spender", type: "address" }, - { name: "amount", type: "uint256" }, - ], - name: "approve", - outputs: [{ name: "", type: "bool" }], - }, - { - stateMutability: "view", - type: "function", - inputs: [{ name: "account", type: "address" }], - name: "balanceOf", - outputs: [{ name: "", type: "uint256" }], - }, - { - stateMutability: "view", - type: "function", - inputs: [], - name: "decimals", - outputs: [{ name: "", type: "uint8" }], - }, - { - stateMutability: "view", - type: "function", - inputs: [], - name: "name", - outputs: [{ name: "", type: "string" }], - }, - { - stateMutability: "view", - type: "function", - inputs: [], - name: "symbol", - outputs: [{ name: "", type: "string" }], - }, - { - stateMutability: "view", - type: "function", - inputs: [], - name: "totalSupply", - outputs: [{ name: "", type: "uint256" }], - }, - { - stateMutability: "nonpayable", - type: "function", - inputs: [ - { name: "recipient", type: "address" }, - { name: "amount", type: "uint256" }, - ], - name: "transfer", - outputs: [{ name: "", type: "bool" }], - }, - { - stateMutability: "nonpayable", - type: "function", - inputs: [ - { name: "sender", type: "address" }, - { name: "recipient", type: "address" }, - { name: "amount", type: "uint256" }, - ], - name: "transferFrom", - outputs: [{ name: "", type: "bool" }], - }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// weth -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const wethABI = [ - { - constant: true, - payable: false, - stateMutability: "view", - type: "function", - inputs: [], - name: "name", - outputs: [{ name: "", type: "string" }], - }, - { - constant: false, - payable: false, - stateMutability: "nonpayable", - type: "function", - inputs: [ - { name: "guy", type: "address" }, - { name: "wad", type: "uint256" }, - ], - name: "approve", - outputs: [{ name: "", type: "bool" }], - }, - { - constant: true, - payable: false, - stateMutability: "view", - type: "function", - inputs: [], - name: "totalSupply", - outputs: [{ name: "", type: "uint256" }], - }, - { - constant: false, - payable: false, - stateMutability: "nonpayable", - type: "function", - inputs: [ - { name: "src", type: "address" }, - { name: "dst", type: "address" }, - { name: "wad", type: "uint256" }, - ], - name: "transferFrom", - outputs: [{ name: "", type: "bool" }], - }, - { - constant: false, - payable: false, - stateMutability: "nonpayable", - type: "function", - inputs: [{ name: "wad", type: "uint256" }], - name: "withdraw", - outputs: [], - }, - { - constant: true, - payable: false, - stateMutability: "view", - type: "function", - inputs: [], - name: "decimals", - outputs: [{ name: "", type: "uint8" }], - }, - { - constant: true, - payable: false, - stateMutability: "view", - type: "function", - inputs: [{ name: "", type: "address" }], - name: "balanceOf", - outputs: [{ name: "", type: "uint256" }], - }, - { - constant: true, - payable: false, - stateMutability: "view", - type: "function", - inputs: [], - name: "symbol", - outputs: [{ name: "", type: "string" }], - }, - { - constant: false, - payable: false, - stateMutability: "nonpayable", - type: "function", - inputs: [ - { name: "dst", type: "address" }, - { name: "wad", type: "uint256" }, - ], - name: "transfer", - outputs: [{ name: "", type: "bool" }], - }, - { - constant: false, - payable: true, - stateMutability: "payable", - type: "function", - inputs: [], - name: "deposit", - outputs: [], - }, - { - constant: true, - payable: false, - stateMutability: "view", - type: "function", - inputs: [ - { name: "", type: "address" }, - { name: "", type: "address" }, - ], - name: "allowance", - outputs: [{ name: "", type: "uint256" }], - }, - { payable: true, stateMutability: "payable", type: "fallback" }, - { - type: "event", - anonymous: false, - inputs: [ - { name: "src", type: "address", indexed: true }, - { name: "guy", type: "address", indexed: true }, - { name: "wad", type: "uint256", indexed: false }, - ], - name: "Approval", - }, - { - type: "event", - anonymous: false, - inputs: [ - { name: "src", type: "address", indexed: true }, - { name: "dst", type: "address", indexed: true }, - { name: "wad", type: "uint256", indexed: false }, - ], - name: "Transfer", - }, - { - type: "event", - anonymous: false, - inputs: [ - { name: "dst", type: "address", indexed: true }, - { name: "wad", type: "uint256", indexed: false }, - ], - name: "Deposit", - }, - { - type: "event", - anonymous: false, - inputs: [ - { name: "src", type: "address", indexed: true }, - { name: "wad", type: "uint256", indexed: false }, - ], - name: "Withdrawal", - }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// React -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link erc20ABI}__. - */ -export function useErc20Read< - TFunctionName extends string, - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" - > = {} as any -) { - return useContractRead({ abi: erc20ABI, ...config } as UseContractReadConfig< - typeof erc20ABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"allowance"`. - */ -export function useErc20Allowance< - TFunctionName extends "allowance", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: erc20ABI, - functionName: "allowance", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"balanceOf"`. - */ -export function useErc20BalanceOf< - TFunctionName extends "balanceOf", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: erc20ABI, - functionName: "balanceOf", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"decimals"`. - */ -export function useErc20Decimals< - TFunctionName extends "decimals", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: erc20ABI, - functionName: "decimals", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"name"`. - */ -export function useErc20Name< - TFunctionName extends "name", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: erc20ABI, - functionName: "name", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"symbol"`. - */ -export function useErc20Symbol< - TFunctionName extends "symbol", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: erc20ABI, - functionName: "symbol", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"totalSupply"`. - */ -export function useErc20TotalSupply< - TFunctionName extends "totalSupply", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: erc20ABI, - functionName: "totalSupply", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link erc20ABI}__. - */ -export function useErc20Write< - TFunctionName extends string, - TMode extends WriteContractMode = undefined ->( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult["request"]["abi"], - TFunctionName, - TMode - > - : UseContractWriteConfig & { - abi?: never - } = {} as any -) { - return useContractWrite({ - abi: erc20ABI, - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"approve"`. - */ -export function useErc20Approve( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof erc20ABI, - "approve" - >["request"]["abi"], - "approve", - TMode - > & { functionName?: "approve" } - : UseContractWriteConfig & { - abi?: never - functionName?: "approve" - } = {} as any -) { - return useContractWrite({ - abi: erc20ABI, - functionName: "approve", - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"transfer"`. - */ -export function useErc20Transfer( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof erc20ABI, - "transfer" - >["request"]["abi"], - "transfer", - TMode - > & { functionName?: "transfer" } - : UseContractWriteConfig & { - abi?: never - functionName?: "transfer" - } = {} as any -) { - return useContractWrite({ - abi: erc20ABI, - functionName: "transfer", - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"transferFrom"`. - */ -export function useErc20TransferFrom< - TMode extends WriteContractMode = undefined ->( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof erc20ABI, - "transferFrom" - >["request"]["abi"], - "transferFrom", - TMode - > & { functionName?: "transferFrom" } - : UseContractWriteConfig & { - abi?: never - functionName?: "transferFrom" - } = {} as any -) { - return useContractWrite({ - abi: erc20ABI, - functionName: "transferFrom", - ...config, - } as any) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link erc20ABI}__. - */ -export function usePrepareErc20Write( - config: Omit< - UsePrepareContractWriteConfig, - "abi" - > = {} as any -) { - return usePrepareContractWrite({ - abi: erc20ABI, - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"approve"`. - */ -export function usePrepareErc20Approve( - config: Omit< - UsePrepareContractWriteConfig, - "abi" | "functionName" - > = {} as any -) { - return usePrepareContractWrite({ - abi: erc20ABI, - functionName: "approve", - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"transfer"`. - */ -export function usePrepareErc20Transfer( - config: Omit< - UsePrepareContractWriteConfig, - "abi" | "functionName" - > = {} as any -) { - return usePrepareContractWrite({ - abi: erc20ABI, - functionName: "transfer", - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link erc20ABI}__ and `functionName` set to `"transferFrom"`. - */ -export function usePrepareErc20TransferFrom( - config: Omit< - UsePrepareContractWriteConfig, - "abi" | "functionName" - > = {} as any -) { - return usePrepareContractWrite({ - abi: erc20ABI, - functionName: "transferFrom", - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link erc20ABI}__. - */ -export function useErc20Event( - config: Omit< - UseContractEventConfig, - "abi" - > = {} as any -) { - return useContractEvent({ - abi: erc20ABI, - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link erc20ABI}__ and `eventName` set to `"Approval"`. - */ -export function useErc20ApprovalEvent( - config: Omit< - UseContractEventConfig, - "abi" | "eventName" - > = {} as any -) { - return useContractEvent({ - abi: erc20ABI, - eventName: "Approval", - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link erc20ABI}__ and `eventName` set to `"Transfer"`. - */ -export function useErc20TransferEvent( - config: Omit< - UseContractEventConfig, - "abi" | "eventName" - > = {} as any -) { - return useContractEvent({ - abi: erc20ABI, - eventName: "Transfer", - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__. - */ -export function useWethRead< - TFunctionName extends string, - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" - > = {} as any -) { - return useContractRead({ abi: wethABI, ...config } as UseContractReadConfig< - typeof wethABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"name"`. - */ -export function useWethName< - TFunctionName extends "name", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: wethABI, - functionName: "name", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"totalSupply"`. - */ -export function useWethTotalSupply< - TFunctionName extends "totalSupply", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: wethABI, - functionName: "totalSupply", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"decimals"`. - */ -export function useWethDecimals< - TFunctionName extends "decimals", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: wethABI, - functionName: "decimals", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"balanceOf"`. - */ -export function useWethBalanceOf< - TFunctionName extends "balanceOf", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: wethABI, - functionName: "balanceOf", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"symbol"`. - */ -export function useWethSymbol< - TFunctionName extends "symbol", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: wethABI, - functionName: "symbol", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"allowance"`. - */ -export function useWethAllowance< - TFunctionName extends "allowance", - TSelectData = ReadContractResult ->( - config: Omit< - UseContractReadConfig, - "abi" | "functionName" - > = {} as any -) { - return useContractRead({ - abi: wethABI, - functionName: "allowance", - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__. - */ -export function useWethWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined ->( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult["request"]["abi"], - TFunctionName, - TMode - > - : UseContractWriteConfig & { - abi?: never - } = {} as any -) { - return useContractWrite({ - abi: wethABI, - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"approve"`. - */ -export function useWethApprove( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult["request"]["abi"], - "approve", - TMode - > & { functionName?: "approve" } - : UseContractWriteConfig & { - abi?: never - functionName?: "approve" - } = {} as any -) { - return useContractWrite({ - abi: wethABI, - functionName: "approve", - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"transferFrom"`. - */ -export function useWethTransferFrom< - TMode extends WriteContractMode = undefined ->( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof wethABI, - "transferFrom" - >["request"]["abi"], - "transferFrom", - TMode - > & { functionName?: "transferFrom" } - : UseContractWriteConfig & { - abi?: never - functionName?: "transferFrom" - } = {} as any -) { - return useContractWrite({ - abi: wethABI, - functionName: "transferFrom", - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"withdraw"`. - */ -export function useWethWithdraw( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof wethABI, - "withdraw" - >["request"]["abi"], - "withdraw", - TMode - > & { functionName?: "withdraw" } - : UseContractWriteConfig & { - abi?: never - functionName?: "withdraw" - } = {} as any -) { - return useContractWrite({ - abi: wethABI, - functionName: "withdraw", - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"transfer"`. - */ -export function useWethTransfer( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof wethABI, - "transfer" - >["request"]["abi"], - "transfer", - TMode - > & { functionName?: "transfer" } - : UseContractWriteConfig & { - abi?: never - functionName?: "transfer" - } = {} as any -) { - return useContractWrite({ - abi: wethABI, - functionName: "transfer", - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"deposit"`. - */ -export function useWethDeposit( - config: TMode extends "prepared" - ? UseContractWriteConfig< - PrepareWriteContractResult["request"]["abi"], - "deposit", - TMode - > & { functionName?: "deposit" } - : UseContractWriteConfig & { - abi?: never - functionName?: "deposit" - } = {} as any -) { - return useContractWrite({ - abi: wethABI, - functionName: "deposit", - ...config, - } as any) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__. - */ -export function usePrepareWethWrite( - config: Omit< - UsePrepareContractWriteConfig, - "abi" - > = {} as any -) { - return usePrepareContractWrite({ - abi: wethABI, - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"approve"`. - */ -export function usePrepareWethApprove( - config: Omit< - UsePrepareContractWriteConfig, - "abi" | "functionName" - > = {} as any -) { - return usePrepareContractWrite({ - abi: wethABI, - functionName: "approve", - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"transferFrom"`. - */ -export function usePrepareWethTransferFrom( - config: Omit< - UsePrepareContractWriteConfig, - "abi" | "functionName" - > = {} as any -) { - return usePrepareContractWrite({ - abi: wethABI, - functionName: "transferFrom", - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"withdraw"`. - */ -export function usePrepareWethWithdraw( - config: Omit< - UsePrepareContractWriteConfig, - "abi" | "functionName" - > = {} as any -) { - return usePrepareContractWrite({ - abi: wethABI, - functionName: "withdraw", - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"transfer"`. - */ -export function usePrepareWethTransfer( - config: Omit< - UsePrepareContractWriteConfig, - "abi" | "functionName" - > = {} as any -) { - return usePrepareContractWrite({ - abi: wethABI, - functionName: "transfer", - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link wethABI}__ and `functionName` set to `"deposit"`. - */ -export function usePrepareWethDeposit( - config: Omit< - UsePrepareContractWriteConfig, - "abi" | "functionName" - > = {} as any -) { - return usePrepareContractWrite({ - abi: wethABI, - functionName: "deposit", - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__. - */ -export function useWethEvent( - config: Omit< - UseContractEventConfig, - "abi" - > = {} as any -) { - return useContractEvent({ abi: wethABI, ...config } as UseContractEventConfig< - typeof wethABI, - TEventName - >) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__ and `eventName` set to `"Approval"`. - */ -export function useWethApprovalEvent( - config: Omit< - UseContractEventConfig, - "abi" | "eventName" - > = {} as any -) { - return useContractEvent({ - abi: wethABI, - eventName: "Approval", - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__ and `eventName` set to `"Transfer"`. - */ -export function useWethTransferEvent( - config: Omit< - UseContractEventConfig, - "abi" | "eventName" - > = {} as any -) { - return useContractEvent({ - abi: wethABI, - eventName: "Transfer", - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__ and `eventName` set to `"Deposit"`. - */ -export function useWethDepositEvent( - config: Omit< - UseContractEventConfig, - "abi" | "eventName" - > = {} as any -) { - return useContractEvent({ - abi: wethABI, - eventName: "Deposit", - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link wethABI}__ and `eventName` set to `"Withdrawal"`. - */ -export function useWethWithdrawalEvent( - config: Omit< - UseContractEventConfig, - "abi" | "eventName" - > = {} as any -) { - return useContractEvent({ - abi: wethABI, - eventName: "Withdrawal", - ...config, - } as UseContractEventConfig) -} diff --git a/trade.renegade.fi/wagmi.config.ts b/trade.renegade.fi/wagmi.config.ts deleted file mode 100644 index ff946700..00000000 --- a/trade.renegade.fi/wagmi.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { wethABI } from "@/wethABI" -import { defineConfig } from "@wagmi/cli" -import { react } from "@wagmi/cli/plugins" -import { erc20ABI } from "wagmi" - -export default defineConfig({ - out: "src/generated.ts", - contracts: [ - { - name: "erc20", - abi: erc20ABI, - }, - { - name: "weth", - abi: wethABI, - }, - ], - plugins: [react()], -}) diff --git a/trade.renegade.fi/wethABI.ts b/trade.renegade.fi/wethABI.ts deleted file mode 100644 index d26f97f2..00000000 --- a/trade.renegade.fi/wethABI.ts +++ /dev/null @@ -1,153 +0,0 @@ -export const wethABI = [ - { - constant: true, - inputs: [], - name: "name", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "guy", type: "address" }, - { name: "wad", type: "uint256" }, - ], - name: "approve", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "src", type: "address" }, - { name: "dst", type: "address" }, - { name: "wad", type: "uint256" }, - ], - name: "transferFrom", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [{ name: "wad", type: "uint256" }], - name: "withdraw", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: true, - inputs: [], - name: "decimals", - outputs: [{ name: "", type: "uint8" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [{ name: "", type: "address" }], - name: "balanceOf", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: true, - inputs: [], - name: "symbol", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { - constant: false, - inputs: [ - { name: "dst", type: "address" }, - { name: "wad", type: "uint256" }, - ], - name: "transfer", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, - { - constant: false, - inputs: [], - name: "deposit", - outputs: [], - payable: true, - stateMutability: "payable", - type: "function", - }, - { - constant: true, - inputs: [ - { name: "", type: "address" }, - { name: "", type: "address" }, - ], - name: "allowance", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function", - }, - { payable: true, stateMutability: "payable", type: "fallback" }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "src", type: "address" }, - { indexed: true, name: "guy", type: "address" }, - { indexed: false, name: "wad", type: "uint256" }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "src", type: "address" }, - { indexed: true, name: "dst", type: "address" }, - { indexed: false, name: "wad", type: "uint256" }, - ], - name: "Transfer", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "dst", type: "address" }, - { indexed: false, name: "wad", type: "uint256" }, - ], - name: "Deposit", - type: "event", - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "src", type: "address" }, - { indexed: false, name: "wad", type: "uint256" }, - ], - name: "Withdrawal", - type: "event", - }, -] as const