rocketh 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-3AP5LJ4H.js → chunk-YB7MYKFS.js} +9 -5
- package/dist/{chunk-3AP5LJ4H.js.map → chunk-YB7MYKFS.js.map} +1 -1
- package/dist/cli.cjs +9 -5
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +8 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +125 -29
- package/dist/index.d.ts +125 -29
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/environment/index.ts +8 -4
- package/src/environment/types.ts +128 -28
package/src/environment/index.ts
CHANGED
|
@@ -447,10 +447,14 @@ export async function createEnvironment<
|
|
|
447
447
|
delete (artifactObjectWithoutABI as any)[key];
|
|
448
448
|
}
|
|
449
449
|
if (key === 'evm') {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
450
|
+
if (artifactObjectWithoutABI.evm) {
|
|
451
|
+
if ('gasEstimates' in artifactObjectWithoutABI['evm']) {
|
|
452
|
+
const {gasEstimates} = artifactObjectWithoutABI.evm;
|
|
453
|
+
artifactObjectWithoutABI.evm = {
|
|
454
|
+
gasEstimates,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
}
|
|
454
458
|
}
|
|
455
459
|
}
|
|
456
460
|
|
package/src/environment/types.ts
CHANGED
|
@@ -11,40 +11,140 @@ import {Abi, Narrow} from 'abitype';
|
|
|
11
11
|
import type {DeployContractParameters} from 'viem/contract';
|
|
12
12
|
import type {Chain} from 'viem';
|
|
13
13
|
|
|
14
|
-
export type
|
|
14
|
+
export type {Abi};
|
|
15
|
+
export type Libraries = {readonly [libraryName: string]: EIP1193Account};
|
|
16
|
+
|
|
17
|
+
export type GasEstimate = 'infinite' | `${number}`;
|
|
18
|
+
export type CreationGasEstimate = {
|
|
19
|
+
readonly codeDepositCost: GasEstimate;
|
|
20
|
+
readonly executionCost: GasEstimate;
|
|
21
|
+
readonly totalCost: GasEstimate;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type GasEstimates = {
|
|
25
|
+
readonly creation?: CreationGasEstimate;
|
|
26
|
+
readonly external?: {
|
|
27
|
+
readonly [signature: string]: GasEstimate;
|
|
28
|
+
};
|
|
29
|
+
readonly internal?: {
|
|
30
|
+
readonly [signature: string]: GasEstimate;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type Storage = {
|
|
35
|
+
readonly astId: number;
|
|
36
|
+
readonly contract: string; // canonical name <path>:<name>
|
|
37
|
+
readonly label: string; // variable name
|
|
38
|
+
readonly offset: number;
|
|
39
|
+
readonly slot: 0; // slot bytes32
|
|
40
|
+
readonly type: string; // "t_mapping(t_uint256,t_struct(Cell)12382_storage)"
|
|
41
|
+
};
|
|
42
|
+
export type TypeDef = {
|
|
43
|
+
readonly encoding: 'inplace' | string; // TODO
|
|
44
|
+
readonly label: 'address' | 'byte24' | string; // TODO
|
|
45
|
+
readonly numberOfBytes: `${number}`;
|
|
46
|
+
readonly key?: string; // ref to another typedef
|
|
47
|
+
readonly value: string;
|
|
48
|
+
readonly members?: readonly Storage[];
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type DevEventDoc = {
|
|
52
|
+
readonly params?: {readonly [name: string]: string};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type DevErrorDoc = {
|
|
56
|
+
readonly params?: {readonly [name: string]: string};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type DevMethodDoc = {
|
|
60
|
+
readonly params?: {readonly [name: string]: string};
|
|
61
|
+
readonly returns?: {
|
|
62
|
+
readonly [key: string | `_${number}`]: string; // description
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type NoticeUserDoc = {
|
|
67
|
+
readonly notice: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type DevDoc = {
|
|
71
|
+
readonly events?: {
|
|
72
|
+
[signature: string]: DevEventDoc;
|
|
73
|
+
};
|
|
74
|
+
readonly errors?: {
|
|
75
|
+
[signature: string]: DevErrorDoc;
|
|
76
|
+
};
|
|
77
|
+
readonly methods: {
|
|
78
|
+
[signature: string]: DevMethodDoc;
|
|
79
|
+
};
|
|
80
|
+
readonly kind: 'dev';
|
|
81
|
+
readonly version: number;
|
|
82
|
+
readonly title?: string;
|
|
83
|
+
readonly author?: string;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export type UserDoc = {
|
|
87
|
+
readonly events?: {
|
|
88
|
+
readonly [signature: string]: NoticeUserDoc;
|
|
89
|
+
};
|
|
90
|
+
readonly errors?: {
|
|
91
|
+
readonly [signature: string]: NoticeUserDoc;
|
|
92
|
+
};
|
|
93
|
+
readonly kind: 'user';
|
|
94
|
+
readonly methods: {
|
|
95
|
+
readonly [signature: string]: NoticeUserDoc;
|
|
96
|
+
};
|
|
97
|
+
readonly version: number;
|
|
98
|
+
readonly notice?: string;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type StorageLayout = {
|
|
102
|
+
readonly storage: readonly Storage[];
|
|
103
|
+
readonly types: {
|
|
104
|
+
readonly [name: string]: TypeDef;
|
|
105
|
+
} | null;
|
|
106
|
+
};
|
|
15
107
|
|
|
16
108
|
export type Deployment<TAbi extends Abi> = {
|
|
17
|
-
address: EIP1193Account;
|
|
18
|
-
abi: Narrow<TAbi>;
|
|
19
|
-
transaction: {
|
|
20
|
-
hash: EIP1193DATA;
|
|
21
|
-
origin?: EIP1193Account;
|
|
22
|
-
nonce?: EIP1193DATA;
|
|
109
|
+
readonly address: EIP1193Account;
|
|
110
|
+
readonly abi: Narrow<TAbi>;
|
|
111
|
+
readonly transaction: {
|
|
112
|
+
readonly hash: EIP1193DATA;
|
|
113
|
+
readonly origin?: EIP1193Account;
|
|
114
|
+
readonly nonce?: EIP1193DATA;
|
|
23
115
|
};
|
|
24
|
-
bytecode: EIP1193DATA;
|
|
25
|
-
argsData: EIP1193DATA;
|
|
26
|
-
metadata: string;
|
|
27
|
-
libraries?: Libraries;
|
|
28
|
-
deployedBytecode?: EIP1193DATA;
|
|
29
|
-
linkReferences?: any;
|
|
30
|
-
deployedLinkReferences?: any;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
116
|
+
readonly bytecode: EIP1193DATA;
|
|
117
|
+
readonly argsData: EIP1193DATA;
|
|
118
|
+
readonly metadata: string;
|
|
119
|
+
readonly libraries?: Libraries;
|
|
120
|
+
readonly deployedBytecode?: EIP1193DATA;
|
|
121
|
+
readonly linkReferences?: any; // TODO
|
|
122
|
+
readonly deployedLinkReferences?: any; // TODO
|
|
123
|
+
readonly contractName?: string;
|
|
124
|
+
readonly sourceName?: string; // relative path
|
|
125
|
+
readonly devdoc?: DevDoc;
|
|
126
|
+
readonly evm?: {
|
|
127
|
+
readonly gasEstimates?: GasEstimates;
|
|
128
|
+
};
|
|
129
|
+
readonly storageLayout?: StorageLayout;
|
|
130
|
+
readonly userdoc?: UserDoc;
|
|
35
131
|
};
|
|
36
132
|
|
|
37
133
|
export type Artifact<TAbi extends Abi = Abi> = {
|
|
38
|
-
abi: TAbi;
|
|
39
|
-
bytecode: EIP1193DATA;
|
|
40
|
-
metadata: string;
|
|
41
|
-
deployedBytecode?: EIP1193DATA;
|
|
42
|
-
linkReferences?: any;
|
|
43
|
-
deployedLinkReferences?: any;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
134
|
+
readonly abi: TAbi;
|
|
135
|
+
readonly bytecode: EIP1193DATA;
|
|
136
|
+
readonly metadata: string;
|
|
137
|
+
readonly deployedBytecode?: EIP1193DATA;
|
|
138
|
+
readonly linkReferences?: any; // TODO
|
|
139
|
+
readonly deployedLinkReferences?: any; // TODO
|
|
140
|
+
readonly contractName?: string;
|
|
141
|
+
readonly sourceName?: string; // relative path
|
|
142
|
+
readonly devdoc?: DevDoc;
|
|
143
|
+
readonly evm?: {
|
|
144
|
+
readonly gasEstimates?: GasEstimates;
|
|
145
|
+
};
|
|
146
|
+
readonly storageLayout?: StorageLayout;
|
|
147
|
+
readonly userdoc?: UserDoc;
|
|
48
148
|
};
|
|
49
149
|
|
|
50
150
|
export type AccountDefinition = EIP1193Account | string | number;
|