1- import { createPublicClient , http , getContract } from "viem" ;
1+ import { createPublicClient , http , getContract , AbiFunction } from "viem" ;
22import { arbitrumSepolia } from "viem/chains" ;
33import { disputeKitClassicConfig } from "../deployments/devnet.viem" ;
4- import {
5- AbiFunction ,
6- AbiParametersToPrimitiveTypes ,
7- ExtractAbiFunction ,
8- FormatAbiItem ,
9- } from "abitype" ;
104
115const main = async ( ) => {
126 const client = createPublicClient ( {
@@ -24,24 +18,6 @@ const main = async () => {
2418
2519 // --------------------------------------------------
2620
27- // Working around the "unknown tuple types" issue
28- // https://viem.sh/docs/faq.html#why-are-contract-function-args-with-fully-named-inputs-represented-as-unnamed-tuple-types-instead-of-object-types
29-
30- // Not human-readable
31- type DelayedStakesFunction = ExtractAbiFunction <
32- typeof disputeKit . abi ,
33- "disputes"
34- > ;
35- // eslint-disable-next-line @typescript-eslint/no-unused-vars
36- type Result = AbiParametersToPrimitiveTypes < DelayedStakesFunction [ "outputs" ] > ;
37- // -> readonly [bigint, boolean, `0x${string}`]
38- // Ideally we would get an object instead of a tuple
39-
40- // Human-readable
41- // eslint-disable-next-line @typescript-eslint/no-unused-vars
42- type FormattedFunction = FormatAbiItem < DelayedStakesFunction > ;
43- // -> "function disputes(uint256) view returns (uint256 numberOfChoices, bool jumped, bytes extraData)"
44-
4521 const getFunctionReturnParameterNames = (
4622 abi : AbiFunction [ ] ,
4723 name : string ,
0 commit comments