UNPKG

1.86 kBTypeScriptView Raw
1export type EvmType = BooleanType | IntegerType | UnsignedIntegerType | StringType | BytesType | DynamicBytesType | AddressType | ArrayType | TupleType | UnknownType;
2/**
3 * Like EvmType but with void
4 */
5export type EvmOutputType = EvmType | VoidType;
6export type StructType = ArrayType | TupleType;
7export type BooleanType = {
8 type: 'boolean';
9 originalType: string;
10};
11export type IntegerType = {
12 type: 'integer';
13 bits: number;
14 originalType: string;
15};
16export type UnsignedIntegerType = {
17 type: 'uinteger';
18 bits: number;
19 originalType: string;
20};
21export type StringType = {
22 type: 'string';
23 originalType: string;
24};
25export type BytesType = {
26 type: 'bytes';
27 size: number;
28 originalType: string;
29};
30export type DynamicBytesType = {
31 type: 'dynamic-bytes';
32 originalType: string;
33};
34export type AddressType = {
35 type: 'address';
36 originalType: string;
37};
38export type ArrayType = {
39 type: 'array';
40 itemType: EvmType;
41 size?: number;
42 originalType: string;
43 structName?: StructName;
44};
45export type TupleType = {
46 type: 'tuple';
47 components: EvmSymbol[];
48 originalType: string;
49 structName?: StructName;
50};
51export type VoidType = {
52 type: 'void';
53};
54export type UnknownType = {
55 type: 'unknown';
56 originalType: string;
57};
58export declare class StructName {
59 readonly identifier: string;
60 readonly namespace?: string;
61 constructor(_identifier: string, _namespace?: string);
62 toString(): string;
63 merge(other: Partial<StructName>): StructName;
64}
65export type EvmSymbol = {
66 type: EvmType;
67 name: string;
68};
69export declare function parseEvmType(rawType: string, components?: EvmSymbol[], internalType?: string): EvmType;
70/** @internal */
71export declare function extractStructNameIfAvailable(internalType: string | undefined): StructName | undefined;