@0xsequence/catapult 1.3.3 → 1.3.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/README.md +16 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +4 -2
- package/dist/commands/run.js.map +1 -1
- package/dist/lib/__tests__/deployer.spec.js +71 -1
- package/dist/lib/__tests__/deployer.spec.js.map +1 -1
- package/dist/lib/core/__tests__/engine.spec.js +270 -0
- package/dist/lib/core/__tests__/engine.spec.js.map +1 -1
- package/dist/lib/core/__tests__/resolver.spec.js +199 -2
- package/dist/lib/core/__tests__/resolver.spec.js.map +1 -1
- package/dist/lib/core/engine.d.ts +13 -0
- package/dist/lib/core/engine.d.ts.map +1 -1
- package/dist/lib/core/engine.js +59 -5
- package/dist/lib/core/engine.js.map +1 -1
- package/dist/lib/core/resolver.d.ts +1 -0
- package/dist/lib/core/resolver.d.ts.map +1 -1
- package/dist/lib/core/resolver.js +38 -8
- package/dist/lib/core/resolver.js.map +1 -1
- package/dist/lib/deployer.d.ts +2 -0
- package/dist/lib/deployer.d.ts.map +1 -1
- package/dist/lib/deployer.js +18 -1
- package/dist/lib/deployer.js.map +1 -1
- package/dist/lib/events/cli-adapter.d.ts.map +1 -1
- package/dist/lib/events/cli-adapter.js +20 -0
- package/dist/lib/events/cli-adapter.js.map +1 -1
- package/dist/lib/events/types.d.ts +25 -1
- package/dist/lib/events/types.d.ts.map +1 -1
- package/dist/lib/types/values.d.ts +8 -1
- package/dist/lib/types/values.d.ts.map +1 -1
- package/dist/lib/utils/assertion.d.ts +4 -0
- package/dist/lib/utils/assertion.d.ts.map +1 -0
- package/dist/lib/utils/assertion.js +27 -0
- package/dist/lib/utils/assertion.js.map +1 -0
- package/package.json +1 -1
- package/src/commands/run.ts +4 -1
- package/src/lib/__tests__/deployer.spec.ts +108 -1
- package/src/lib/core/__tests__/engine.spec.ts +321 -0
- package/src/lib/core/__tests__/resolver.spec.ts +231 -3
- package/src/lib/core/engine.ts +92 -6
- package/src/lib/core/resolver.ts +46 -9
- package/src/lib/deployer.ts +28 -1
- package/src/lib/events/cli-adapter.ts +24 -0
- package/src/lib/events/types.ts +29 -1
- package/src/lib/types/values.ts +10 -1
- package/src/lib/utils/assertion.ts +24 -0
package/src/lib/types/values.ts
CHANGED
|
@@ -32,6 +32,14 @@ export interface ConstructorEncodeValue {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
export interface ComputeCreateValue {
|
|
36
|
+
type: 'compute-create';
|
|
37
|
+
arguments: {
|
|
38
|
+
deployerAddress: AddressValue;
|
|
39
|
+
nonce: Uint256Value;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
35
43
|
export interface ComputeCreate2Value {
|
|
36
44
|
type: 'compute-create2';
|
|
37
45
|
arguments: {
|
|
@@ -94,6 +102,7 @@ export type ValueResolver =
|
|
|
94
102
|
| AbiEncodeValue
|
|
95
103
|
| AbiPackValue
|
|
96
104
|
| ConstructorEncodeValue
|
|
105
|
+
| ComputeCreateValue
|
|
97
106
|
| ComputeCreate2Value
|
|
98
107
|
| ReadBalanceValue
|
|
99
108
|
| BasicArithmeticValue
|
|
@@ -113,4 +122,4 @@ export type Value<T = string | number | boolean> = T | Reference | ValueResolver
|
|
|
113
122
|
export type BytesValue = Value<string>;
|
|
114
123
|
export type AddressValue = Value<string>;
|
|
115
124
|
export type Uint256Value = Value<string | number>;
|
|
116
|
-
export type BooleanValue = Value<boolean>;
|
|
125
|
+
export type BooleanValue = Value<boolean>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
|
|
3
|
+
export function isAddress(value: unknown): value is string {
|
|
4
|
+
return ethers.isAddress(value)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function isBytesLike(value: unknown): value is string {
|
|
8
|
+
return ethers.isBytesLike(value)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function isBigNumberish(value: unknown): value is string | number | bigint {
|
|
12
|
+
try {
|
|
13
|
+
switch (typeof(value)) {
|
|
14
|
+
case "bigint":
|
|
15
|
+
case "number":
|
|
16
|
+
case "string":
|
|
17
|
+
ethers.toBigInt(value)
|
|
18
|
+
return true
|
|
19
|
+
}
|
|
20
|
+
} catch (error) {
|
|
21
|
+
// Fail out
|
|
22
|
+
}
|
|
23
|
+
return false
|
|
24
|
+
}
|