@rocketh/deploy 0.10.6 → 0.10.8
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 +15 -0
- package/LICENSE +21 -0
- package/dist/index.d.ts +94 -36
- package/package.json +9 -10
- package/tsup.config.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @rocketh/deploy
|
|
2
2
|
|
|
3
|
+
## 0.10.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- rocketh@0.10.15
|
|
9
|
+
|
|
10
|
+
## 0.10.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- latest dependencies
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- rocketh@0.10.14
|
|
17
|
+
|
|
3
18
|
## 0.10.6
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-present Ronan Sandford
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,39 +1,51 @@
|
|
|
1
1
|
import { DeploymentConstruction, Deployment } from 'rocketh';
|
|
2
2
|
import { Chain, ContractFunctionName, ContractFunctionArgs, DecodeFunctionResultReturnType, WriteContractParameters, ReadContractParameters, Address } from 'viem';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface Register {
|
|
5
|
+
}
|
|
5
6
|
type ResolvedRegister = {
|
|
6
7
|
/**
|
|
7
8
|
* TypeScript type to use for `address` values
|
|
8
9
|
* @default `0x${string}`
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
addressType: Register extends {
|
|
12
|
+
addressType: infer type;
|
|
13
|
+
} ? type : Register extends {
|
|
11
14
|
AddressType: infer type;
|
|
12
|
-
} ? type : DefaultRegister['
|
|
15
|
+
} ? type : DefaultRegister['addressType'];
|
|
13
16
|
/**
|
|
14
17
|
* TypeScript type to use for `int<M>` and `uint<M>` values, where `M > 48`
|
|
15
18
|
* @default bigint
|
|
16
19
|
*/
|
|
17
|
-
|
|
20
|
+
bigIntType: Register extends {
|
|
21
|
+
bigIntType: infer type;
|
|
22
|
+
} ? type : Register extends {
|
|
18
23
|
BigIntType: infer type;
|
|
19
|
-
} ? type : DefaultRegister['
|
|
24
|
+
} ? type : DefaultRegister['bigIntType'];
|
|
20
25
|
/**
|
|
21
26
|
* TypeScript type to use for `bytes` values
|
|
22
27
|
* @default { inputs: `0x${string}`; outputs: `0x${string}`; }
|
|
23
28
|
*/
|
|
24
|
-
|
|
29
|
+
bytesType: Register extends {
|
|
30
|
+
bytesType: infer type extends {
|
|
31
|
+
inputs: unknown;
|
|
32
|
+
outputs: unknown;
|
|
33
|
+
};
|
|
34
|
+
} ? type : Register extends {
|
|
25
35
|
BytesType: infer type extends {
|
|
26
36
|
inputs: unknown;
|
|
27
37
|
outputs: unknown;
|
|
28
38
|
};
|
|
29
|
-
} ? type : DefaultRegister['
|
|
39
|
+
} ? type : DefaultRegister['bytesType'];
|
|
30
40
|
/**
|
|
31
41
|
* TypeScript type to use for `int<M>` and `uint<M>` values, where `M <= 48`
|
|
32
42
|
* @default number
|
|
33
43
|
*/
|
|
34
|
-
|
|
44
|
+
intType: Register extends {
|
|
45
|
+
intType: infer type;
|
|
46
|
+
} ? type : Register extends {
|
|
35
47
|
IntType: infer type;
|
|
36
|
-
} ? type : DefaultRegister['
|
|
48
|
+
} ? type : DefaultRegister['intType'];
|
|
37
49
|
/**
|
|
38
50
|
* Maximum depth for nested array types (e.g. string[][])
|
|
39
51
|
*
|
|
@@ -42,23 +54,29 @@ type ResolvedRegister = {
|
|
|
42
54
|
*
|
|
43
55
|
* @default false
|
|
44
56
|
*/
|
|
45
|
-
|
|
57
|
+
arrayMaxDepth: Register extends {
|
|
58
|
+
arrayMaxDepth: infer type extends number | false;
|
|
59
|
+
} ? type : Register extends {
|
|
46
60
|
ArrayMaxDepth: infer type extends number | false;
|
|
47
|
-
} ? type : DefaultRegister['
|
|
61
|
+
} ? type : DefaultRegister['arrayMaxDepth'];
|
|
48
62
|
/**
|
|
49
63
|
* Lower bound for fixed array length
|
|
50
64
|
* @default 1
|
|
51
65
|
*/
|
|
52
|
-
|
|
66
|
+
fixedArrayMinLength: Register extends {
|
|
67
|
+
fixedArrayMinLength: infer type extends number;
|
|
68
|
+
} ? type : Register extends {
|
|
53
69
|
FixedArrayMinLength: infer type extends number;
|
|
54
|
-
} ? type : DefaultRegister['
|
|
70
|
+
} ? type : DefaultRegister['fixedArrayMinLength'];
|
|
55
71
|
/**
|
|
56
72
|
* Upper bound for fixed array length
|
|
57
73
|
* @default 99
|
|
58
74
|
*/
|
|
59
|
-
|
|
75
|
+
fixedArrayMaxLength: Register extends {
|
|
76
|
+
fixedArrayMaxLength: infer type extends number;
|
|
77
|
+
} ? type : Register extends {
|
|
60
78
|
FixedArrayMaxLength: infer type extends number;
|
|
61
|
-
} ? type : DefaultRegister['
|
|
79
|
+
} ? type : DefaultRegister['fixedArrayMaxLength'];
|
|
62
80
|
/**
|
|
63
81
|
* When set, validates {@link AbiParameter}'s `type` against {@link AbiType}
|
|
64
82
|
*
|
|
@@ -67,32 +85,69 @@ type ResolvedRegister = {
|
|
|
67
85
|
*
|
|
68
86
|
* @default false
|
|
69
87
|
*/
|
|
70
|
-
|
|
88
|
+
strictAbiType: Register extends {
|
|
89
|
+
strictAbiType: infer type extends boolean;
|
|
90
|
+
} ? type : Register extends {
|
|
71
91
|
StrictAbiType: infer type extends boolean;
|
|
72
|
-
} ? type : DefaultRegister['
|
|
92
|
+
} ? type : DefaultRegister['strictAbiType'];
|
|
93
|
+
/** @deprecated Use `addressType` instead */
|
|
94
|
+
AddressType: ResolvedRegister['addressType'];
|
|
95
|
+
/** @deprecated Use `addressType` instead */
|
|
96
|
+
BigIntType: ResolvedRegister['bigIntType'];
|
|
97
|
+
/** @deprecated Use `bytesType` instead */
|
|
98
|
+
BytesType: ResolvedRegister['bytesType'];
|
|
99
|
+
/** @deprecated Use `intType` instead */
|
|
100
|
+
IntType: ResolvedRegister['intType'];
|
|
101
|
+
/** @deprecated Use `arrayMaxDepth` instead */
|
|
102
|
+
ArrayMaxDepth: ResolvedRegister['arrayMaxDepth'];
|
|
103
|
+
/** @deprecated Use `fixedArrayMinLength` instead */
|
|
104
|
+
FixedArrayMinLength: ResolvedRegister['fixedArrayMinLength'];
|
|
105
|
+
/** @deprecated Use `fixedArrayMaxLength` instead */
|
|
106
|
+
FixedArrayMaxLength: ResolvedRegister['fixedArrayMaxLength'];
|
|
107
|
+
/** @deprecated Use `strictAbiType` instead */
|
|
108
|
+
StrictAbiType: ResolvedRegister['strictAbiType'];
|
|
73
109
|
};
|
|
74
110
|
type DefaultRegister = {
|
|
75
111
|
/** Maximum depth for nested array types (e.g. string[][]) */
|
|
76
|
-
|
|
112
|
+
arrayMaxDepth: false;
|
|
77
113
|
/** Lower bound for fixed array length */
|
|
78
|
-
|
|
114
|
+
fixedArrayMinLength: 1;
|
|
79
115
|
/** Upper bound for fixed array length */
|
|
80
|
-
|
|
116
|
+
fixedArrayMaxLength: 99;
|
|
81
117
|
/** TypeScript type to use for `address` values */
|
|
82
|
-
|
|
118
|
+
addressType: `0x${string}`;
|
|
83
119
|
/** TypeScript type to use for `bytes` values */
|
|
84
|
-
|
|
120
|
+
bytesType: {
|
|
85
121
|
/** TypeScript type to use for `bytes` input values */
|
|
86
122
|
inputs: `0x${string}`;
|
|
87
123
|
/** TypeScript type to use for `bytes` output values */
|
|
88
124
|
outputs: `0x${string}`;
|
|
89
125
|
};
|
|
90
126
|
/** TypeScript type to use for `int<M>` and `uint<M>` values, where `M > 48` */
|
|
91
|
-
|
|
127
|
+
bigIntType: bigint;
|
|
92
128
|
/** TypeScript type to use for `int<M>` and `uint<M>` values, where `M <= 48` */
|
|
93
|
-
|
|
129
|
+
intType: number;
|
|
94
130
|
/** When set, validates {@link AbiParameter}'s `type` against {@link AbiType} */
|
|
95
|
-
|
|
131
|
+
strictAbiType: false;
|
|
132
|
+
/** @deprecated Use `arrayMaxDepth` instead */
|
|
133
|
+
ArrayMaxDepth: DefaultRegister['arrayMaxDepth'];
|
|
134
|
+
/** @deprecated Use `fixedArrayMinLength` instead */
|
|
135
|
+
FixedArrayMinLength: DefaultRegister['fixedArrayMinLength'];
|
|
136
|
+
/** @deprecated Use `fixedArrayMaxLength` instead */
|
|
137
|
+
FixedArrayMaxLength: DefaultRegister['fixedArrayMaxLength'];
|
|
138
|
+
/** @deprecated Use `addressType` instead */
|
|
139
|
+
AddressType: DefaultRegister['addressType'];
|
|
140
|
+
/** @deprecated Use `bytesType` instead */
|
|
141
|
+
BytesType: {
|
|
142
|
+
inputs: DefaultRegister['bytesType']['inputs'];
|
|
143
|
+
outputs: DefaultRegister['bytesType']['outputs'];
|
|
144
|
+
};
|
|
145
|
+
/** @deprecated Use `bigIntType` instead */
|
|
146
|
+
BigIntType: DefaultRegister['bigIntType'];
|
|
147
|
+
/** @deprecated Use `intType` instead */
|
|
148
|
+
IntType: DefaultRegister['intType'];
|
|
149
|
+
/** @deprecated Use `strictAbiType` instead */
|
|
150
|
+
StrictAbiType: DefaultRegister['strictAbiType'];
|
|
96
151
|
};
|
|
97
152
|
|
|
98
153
|
/**
|
|
@@ -103,21 +158,21 @@ type DefaultRegister = {
|
|
|
103
158
|
* type Result = Pretty<{ a: string } | { b: string } | { c: number, d: bigint }>
|
|
104
159
|
* // ^? type Result = { a: string; b: string; c: number; d: bigint }
|
|
105
160
|
*/
|
|
106
|
-
type Pretty<
|
|
107
|
-
[
|
|
161
|
+
type Pretty<type> = {
|
|
162
|
+
[key in keyof type]: type[key];
|
|
108
163
|
} & unknown;
|
|
109
164
|
/**
|
|
110
165
|
* Creates range between two positive numbers using [tail recursion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types).
|
|
111
166
|
*
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
114
|
-
* @returns Array with inclusive range from {@link
|
|
167
|
+
* @param start - Number to start range
|
|
168
|
+
* @param stop - Number to end range
|
|
169
|
+
* @returns Array with inclusive range from {@link start} to {@link stop}
|
|
115
170
|
*
|
|
116
171
|
* @example
|
|
117
172
|
* type Result = Range<1, 3>
|
|
118
173
|
* // ^? type Result = [1, 2, 3]
|
|
119
174
|
*/
|
|
120
|
-
type Range<
|
|
175
|
+
type Range<start extends number, stop extends number, result extends number[] = [], padding extends 0[] = [], current extends number = [...padding, ...result]['length'] & number> = current extends stop ? current extends start ? [current] : result extends [] ? [] : [...result, current] : current extends start ? Range<start, stop, [current], padding> : result extends [] ? Range<start, stop, [], [...padding, 0]> : Range<start, stop, [...result, current], padding>;
|
|
121
176
|
|
|
122
177
|
type MBytes = '' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32;
|
|
123
178
|
type MBits = '' | 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 88 | 96 | 104 | 112 | 120 | 128 | 136 | 144 | 152 | 160 | 168 | 176 | 184 | 192 | 200 | 208 | 216 | 224 | 232 | 240 | 248 | 256;
|
|
@@ -128,17 +183,20 @@ type SolidityFunction = 'function';
|
|
|
128
183
|
type SolidityString = 'string';
|
|
129
184
|
type SolidityTuple = 'tuple';
|
|
130
185
|
type SolidityInt = `${'u' | ''}int${MBits}`;
|
|
131
|
-
type SolidityFixedArrayRange = Range<ResolvedRegister['
|
|
186
|
+
type SolidityFixedArrayRange = Range<ResolvedRegister['fixedArrayMinLength'], ResolvedRegister['fixedArrayMaxLength']>[number];
|
|
132
187
|
/**
|
|
133
188
|
* Recursively build arrays up to maximum depth
|
|
134
189
|
* or use a more broad type when maximum depth is switched "off"
|
|
135
190
|
*/
|
|
136
|
-
type _BuildArrayTypes<T extends string, Depth extends readonly number[] = []> = ResolvedRegister['
|
|
191
|
+
type _BuildArrayTypes<T extends string, Depth extends readonly number[] = []> = ResolvedRegister['arrayMaxDepth'] extends false ? `${T}[${string}]` : Depth['length'] extends ResolvedRegister['arrayMaxDepth'] ? T : T extends `${any}[${SolidityFixedArrayRange | ''}]` ? _BuildArrayTypes<T | `${T}[${SolidityFixedArrayRange | ''}]`, [
|
|
192
|
+
...Depth,
|
|
193
|
+
1
|
|
194
|
+
]> : _BuildArrayTypes<`${T}[${SolidityFixedArrayRange | ''}]`, [...Depth, 1]>;
|
|
137
195
|
type SolidityArrayWithoutTuple = _BuildArrayTypes<SolidityAddress | SolidityBool | SolidityBytes | SolidityFunction | SolidityInt | SolidityString>;
|
|
138
196
|
type SolidityArrayWithTuple = _BuildArrayTypes<SolidityTuple>;
|
|
139
197
|
type SolidityArray = SolidityArrayWithoutTuple | SolidityArrayWithTuple;
|
|
140
198
|
type AbiType = SolidityArray | SolidityAddress | SolidityBool | SolidityBytes | SolidityFunction | SolidityInt | SolidityString | SolidityTuple;
|
|
141
|
-
type ResolvedAbiType = ResolvedRegister['
|
|
199
|
+
type ResolvedAbiType = ResolvedRegister['strictAbiType'] extends true ? AbiType : string;
|
|
142
200
|
type AbiInternalType = ResolvedAbiType | `address ${string}` | `contract ${string}` | `enum ${string}` | `struct ${string}`;
|
|
143
201
|
type AbiParameter = Pretty<{
|
|
144
202
|
type: ResolvedAbiType;
|
|
@@ -151,9 +209,9 @@ type AbiParameter = Pretty<{
|
|
|
151
209
|
type: SolidityTuple | SolidityArrayWithTuple;
|
|
152
210
|
components: readonly AbiParameter[];
|
|
153
211
|
})>;
|
|
154
|
-
type AbiEventParameter =
|
|
212
|
+
type AbiEventParameter = AbiParameter & {
|
|
155
213
|
indexed?: boolean | undefined;
|
|
156
|
-
}
|
|
214
|
+
};
|
|
157
215
|
/**
|
|
158
216
|
* State mutability for {@link AbiFunction}
|
|
159
217
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocketh/deploy",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.8",
|
|
4
4
|
"description": "provide deploy function for rocketh",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,23 +20,22 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"abitype": "^1.0.
|
|
23
|
+
"abitype": "^1.0.4",
|
|
24
24
|
"eip-1193": "^0.5.0",
|
|
25
|
-
"pkgroll": "^2.
|
|
26
|
-
"rimraf": "^5.0.
|
|
27
|
-
"typescript": "^5.
|
|
28
|
-
"rocketh": "0.10.
|
|
25
|
+
"pkgroll": "^2.1.1",
|
|
26
|
+
"rimraf": "^5.0.7",
|
|
27
|
+
"typescript": "^5.5.2",
|
|
28
|
+
"rocketh": "0.10.15"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"rocketh": "0.10.
|
|
31
|
+
"rocketh": "0.10.15"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"named-logs": "^0.2.4",
|
|
35
|
-
"viem": "^2.
|
|
35
|
+
"viem": "^2.16.2"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "rimraf dist && pkgroll --sourcemap",
|
|
39
|
-
"dev": "pkgroll --watch"
|
|
40
|
-
"dev-no-reset": "tsup src/index.ts --dts --format esm,cjs --watch"
|
|
39
|
+
"dev": "pkgroll --watch"
|
|
41
40
|
}
|
|
42
41
|
}
|