1
1
import type { Abi as AbiKanabi , TypedContract as AbiWanTypedContract } from 'abi-wan-kanabi' ;
2
+ import type { Abi as AbiKanabiV2 , TypedContract as AbiWanTypedContractV2 } from 'abi-wan-kanabi-v2' ;
2
3
3
4
import { AccountInterface } from '../account' ;
4
5
import { ProviderInterface } from '../provider' ;
5
6
import {
6
7
Abi ,
7
8
ArgsOrCalldata ,
8
9
AsyncContractFunction ,
10
+ BigNumberish ,
9
11
BlockIdentifier ,
10
12
CallOptions ,
13
+ Calldata ,
11
14
ContractFunction ,
12
15
ContractVersion ,
13
16
EstimateFeeResponse ,
@@ -16,10 +19,35 @@ import {
16
19
InvokeFunctionResponse ,
17
20
InvokeOptions ,
18
21
ParsedEvents ,
22
+ RawArgs ,
19
23
Result ,
24
+ Uint256 ,
20
25
} from '../types' ;
26
+ import { CairoCustomEnum } from '../utils/calldata/enum/CairoCustomEnum' ;
27
+ import { CairoOption } from '../utils/calldata/enum/CairoOption' ;
28
+ import { CairoResult } from '../utils/calldata/enum/CairoResult' ;
29
+
30
+ // import { ResolvedConfig } from 'abi-wan-kanabi-v2/config';
31
+
32
+ declare module 'abi-wan-kanabi-v2' {
33
+ export interface Config < OptionT = any , ResultT = any , ErrorT = any > {
34
+ FeltType : BigNumberish ;
35
+ U256Type : number | bigint | Uint256 ;
36
+ Option : CairoOption < OptionT > ;
37
+ Tuple : Record < number , BigNumberish | object | boolean > ;
38
+ Result : CairoResult < ResultT , ErrorT > ;
39
+ Enum : CairoCustomEnum ;
40
+ Calldata : RawArgs | Calldata ;
41
+ CallOptions : CallOptions ;
42
+ InvokeOptions : InvokeOptions ;
43
+ InvokeFunctionResponse : InvokeFunctionResponse ;
44
+ }
45
+ }
46
+
47
+ // export type X = ResolvedConfig['InvokeOptions'];
21
48
22
49
export type TypedContract < TAbi extends AbiKanabi > = AbiWanTypedContract < TAbi > & ContractInterface ;
50
+ type TypedContractV2 < TAbi extends AbiKanabiV2 > = AbiWanTypedContractV2 < TAbi > & ContractInterface ;
23
51
24
52
export abstract class ContractInterface {
25
53
public abstract abi : Abi ;
@@ -139,4 +167,5 @@ export abstract class ContractInterface {
139
167
public abstract getVersion ( ) : Promise < ContractVersion > ;
140
168
141
169
public abstract typed < TAbi extends AbiKanabi > ( tAbi : TAbi ) : TypedContract < TAbi > ;
170
+ public abstract typedv2 < TAbi extends AbiKanabiV2 > ( tAbi : TAbi ) : TypedContractV2 < TAbi > ;
142
171
}
0 commit comments