@layerzerolabs/dw-model 0.2.13 → 0.2.18
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/.turbo/turbo-build.log +74 -65
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +2 -2
- package/dist/AB7BJRWS.js +63 -0
- package/dist/AB7BJRWS.js.map +1 -0
- package/dist/{722WUAS6.cjs → EXN4H4R3.cjs} +25 -25
- package/dist/EXN4H4R3.cjs.map +1 -0
- package/dist/HW27MZCG.js +61 -0
- package/dist/HW27MZCG.js.map +1 -0
- package/dist/{EQTOSW62.js → I5L5NLZY.js} +3 -3
- package/dist/{EQTOSW62.js.map → I5L5NLZY.js.map} +1 -1
- package/dist/NLDQ72XO.js +3 -0
- package/dist/NLDQ72XO.js.map +1 -0
- package/dist/QLEJL4UB.cjs +54 -0
- package/dist/QLEJL4UB.cjs.map +1 -0
- package/dist/{U463T6CN.js → RDYET6CZ.js} +3 -3
- package/dist/RDYET6CZ.js.map +1 -0
- package/dist/{UU3GEL4Y.js → RLVC22JB.js} +4 -13
- package/dist/RLVC22JB.js.map +1 -0
- package/dist/{PP5TDTMN.cjs → SRUGZSZY.cjs} +4 -13
- package/dist/SRUGZSZY.cjs.map +1 -0
- package/dist/TY2SXEDC.cjs +4 -0
- package/dist/TY2SXEDC.cjs.map +1 -0
- package/dist/{YAFQX433.js → UE2N6Q3B.js} +3 -3
- package/dist/UE2N6Q3B.js.map +1 -0
- package/dist/VZP4VEYJ.cjs +73 -0
- package/dist/VZP4VEYJ.cjs.map +1 -0
- package/dist/WP2E3P7I.cjs +80 -0
- package/dist/WP2E3P7I.cjs.map +1 -0
- package/dist/{W3NEISER.cjs → WYAGX6NX.cjs} +3 -3
- package/dist/WYAGX6NX.cjs.map +1 -0
- package/dist/{RMW3UTVK.js → ZQQ6EIFU.js} +12 -44
- package/dist/ZQQ6EIFU.js.map +1 -0
- package/dist/ZTLVAMWX.cjs +112 -0
- package/dist/ZTLVAMWX.cjs.map +1 -0
- package/dist/deploy/artifact.cjs +45 -0
- package/dist/deploy/artifact.cjs.map +1 -0
- package/dist/deploy/artifact.d.ts +86 -0
- package/dist/deploy/artifact.d.ts.map +1 -0
- package/dist/deploy/artifact.js +4 -0
- package/dist/deploy/artifact.js.map +1 -0
- package/dist/deploy/index.cjs +81 -64
- package/dist/deploy/index.d.ts +1 -0
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/index.js +6 -5
- package/dist/deploy/resourceBuilder.cjs +2 -2
- package/dist/deploy/resourceBuilder.d.ts +4 -4
- package/dist/deploy/resourceBuilder.d.ts.map +1 -1
- package/dist/deploy/resourceBuilder.js +1 -1
- package/dist/deploy/resources.cjs +26 -26
- package/dist/deploy/resources.d.ts +28 -30
- package/dist/deploy/resources.d.ts.map +1 -1
- package/dist/deploy/resources.js +2 -2
- package/dist/deploy/workflow.cjs +17 -36
- package/dist/deploy/workflow.d.ts +58 -461
- package/dist/deploy/workflow.d.ts.map +1 -1
- package/dist/deploy/workflow.js +2 -1
- package/dist/index.cjs +110 -93
- package/dist/index.js +8 -7
- package/dist/role-management/index.cjs +19 -19
- package/dist/role-management/index.js +1 -1
- package/dist/role-management/schemata.cjs +6 -6
- package/dist/role-management/schemata.d.ts +1 -1
- package/dist/role-management/schemata.d.ts.map +1 -1
- package/dist/role-management/schemata.js +1 -1
- package/dist/upgrade/index.cjs +10 -10
- package/dist/upgrade/index.js +1 -1
- package/dist/upgrade/types.cjs +10 -10
- package/dist/upgrade/types.d.ts +2 -2
- package/dist/upgrade/types.d.ts.map +1 -1
- package/dist/upgrade/types.js +1 -1
- package/dist/wire/index.cjs +6 -6
- package/dist/wire/index.js +1 -1
- package/dist/wire/schemata.cjs +6 -6
- package/dist/wire/schemata.d.ts +3 -3
- package/dist/wire/schemata.d.ts.map +1 -1
- package/dist/wire/schemata.js +1 -1
- package/package.json +10 -9
- package/src/deploy/artifact.ts +93 -0
- package/src/deploy/index.ts +1 -0
- package/src/deploy/resourceBuilder.ts +7 -16
- package/src/deploy/resources.ts +95 -77
- package/src/deploy/workflow.ts +31 -57
- package/src/role-management/schemata.ts +1 -1
- package/src/upgrade/types.ts +1 -1
- package/src/wire/schemata.ts +1 -1
- package/dist/5KVLMWQW.cjs +0 -54
- package/dist/5KVLMWQW.cjs.map +0 -1
- package/dist/722WUAS6.cjs.map +0 -1
- package/dist/JEBKWD5F.js +0 -40
- package/dist/JEBKWD5F.js.map +0 -1
- package/dist/MLHJKQTG.cjs +0 -59
- package/dist/MLHJKQTG.cjs.map +0 -1
- package/dist/N5NQRAA2.js +0 -3
- package/dist/N5NQRAA2.js.map +0 -1
- package/dist/OKS5GGII.cjs +0 -149
- package/dist/OKS5GGII.cjs.map +0 -1
- package/dist/PP5TDTMN.cjs.map +0 -1
- package/dist/RMW3UTVK.js.map +0 -1
- package/dist/U463T6CN.js.map +0 -1
- package/dist/UU3GEL4Y.js.map +0 -1
- package/dist/W3NEISER.cjs.map +0 -1
- package/dist/YAFQX433.js.map +0 -1
- package/dist/ZQEYO4LO.cjs +0 -4
- package/dist/ZQEYO4LO.cjs.map +0 -1
package/dist/upgrade/types.cjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var WYAGX6NX_cjs = require('../WYAGX6NX.cjs');
|
|
4
4
|
require('../YJF4D23A.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "EvmProxyType", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return WYAGX6NX_cjs.EvmProxyType; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "ProxyType", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return WYAGX6NX_cjs.ProxyType; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "UpgradeType", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return WYAGX6NX_cjs.UpgradeType; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "codeUpgradeableConfigSchema", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return WYAGX6NX_cjs.codeUpgradeableConfigSchema; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "notUpgradeableConfigSchema", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return WYAGX6NX_cjs.notUpgradeableConfigSchema; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "proxyConfigSchema", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return WYAGX6NX_cjs.proxyConfigSchema; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "proxyTypeSchema", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return WYAGX6NX_cjs.proxyTypeSchema; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "upgradeTypeSchema", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return WYAGX6NX_cjs.upgradeTypeSchema; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "upgradeableConfigSchema", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return WYAGX6NX_cjs.upgradeableConfigSchema; }
|
|
43
43
|
});
|
|
44
44
|
//# sourceMappingURL=types.cjs.map
|
|
45
45
|
//# sourceMappingURL=types.cjs.map
|
package/dist/upgrade/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import z from 'zod
|
|
1
|
+
import z from 'zod';
|
|
2
2
|
export declare enum UpgradeType {
|
|
3
3
|
NOT_UPGRADEABLE = "NOT_UPGRADEABLE",
|
|
4
4
|
PROXY = "PROXY",
|
|
@@ -44,6 +44,6 @@ export declare const upgradeableConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
44
44
|
upgradeType: z.ZodLiteral<UpgradeType.NOT_UPGRADEABLE>;
|
|
45
45
|
}, z.core.$strip>, z.ZodObject<{
|
|
46
46
|
upgradeType: z.ZodLiteral<UpgradeType.CODE_UPGRADE>;
|
|
47
|
-
}, z.core.$strip>]>;
|
|
47
|
+
}, z.core.$strip>], "upgradeType">;
|
|
48
48
|
export type UpgradeableConfig = z.infer<typeof upgradeableConfigSchema>;
|
|
49
49
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/upgrade/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/upgrade/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,oBAAY,WAAW;IAEnB,eAAe,oBAAoB;IAEnC,KAAK,UAAU;IAEf,YAAY,iBAAiB;CAChC;AAED,oBAAY,YAAY;IAEpB,uBAAuB,4BAA4B;IAEnD,qBAAqB,0BAA0B;CAClD;AAED,eAAO,MAAM,SAAS;;;CAErB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAEnE,eAAO,MAAM,iBAAiB,+BAAsB,CAAC;AAErD,eAAO,MAAM,eAAe;;;EAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB;;;;;;iBAG5B,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEvE,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,uBAAuB;;;;;;;;;;kCAIlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
package/dist/upgrade/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EvmProxyType, ProxyType, UpgradeType, codeUpgradeableConfigSchema, notUpgradeableConfigSchema, proxyConfigSchema, proxyTypeSchema, upgradeTypeSchema, upgradeableConfigSchema } from '../
|
|
1
|
+
export { EvmProxyType, ProxyType, UpgradeType, codeUpgradeableConfigSchema, notUpgradeableConfigSchema, proxyConfigSchema, proxyTypeSchema, upgradeTypeSchema, upgradeableConfigSchema } from '../RDYET6CZ.js';
|
|
2
2
|
import '../VUOMXK5T.js';
|
|
3
3
|
//# sourceMappingURL=types.js.map
|
|
4
4
|
//# sourceMappingURL=types.js.map
|
package/dist/wire/index.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../X4ZNR5GZ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var QLEJL4UB_cjs = require('../QLEJL4UB.cjs');
|
|
5
5
|
require('../YJF4D23A.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "wireWorkflowChainResultSchema", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowChainResultSchema; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "wireWorkflowChainStateSchema", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowChainStateSchema; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "wireWorkflowFilterArgsSchema", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowFilterArgsSchema; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "wireWorkflowOrchestratorResultSchema", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowOrchestratorResultSchema; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "wireWorkflowOrchestratorStateSchema", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowOrchestratorStateSchema; }
|
|
28
28
|
});
|
|
29
29
|
//# sourceMappingURL=index.cjs.map
|
|
30
30
|
//# sourceMappingURL=index.cjs.map
|
package/dist/wire/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../N5VNZXZB.js';
|
|
2
|
-
export { wireWorkflowChainResultSchema, wireWorkflowChainStateSchema, wireWorkflowFilterArgsSchema, wireWorkflowOrchestratorResultSchema, wireWorkflowOrchestratorStateSchema } from '../
|
|
2
|
+
export { wireWorkflowChainResultSchema, wireWorkflowChainStateSchema, wireWorkflowFilterArgsSchema, wireWorkflowOrchestratorResultSchema, wireWorkflowOrchestratorStateSchema } from '../I5L5NLZY.js';
|
|
3
3
|
import '../VUOMXK5T.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/wire/schemata.cjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var QLEJL4UB_cjs = require('../QLEJL4UB.cjs');
|
|
4
4
|
require('../YJF4D23A.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "wireWorkflowChainResultSchema", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowChainResultSchema; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "wireWorkflowChainStateSchema", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowChainStateSchema; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "wireWorkflowFilterArgsSchema", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowFilterArgsSchema; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "wireWorkflowOrchestratorResultSchema", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowOrchestratorResultSchema; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "wireWorkflowOrchestratorStateSchema", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return QLEJL4UB_cjs.wireWorkflowOrchestratorStateSchema; }
|
|
27
27
|
});
|
|
28
28
|
//# sourceMappingURL=schemata.cjs.map
|
|
29
29
|
//# sourceMappingURL=schemata.cjs.map
|
package/dist/wire/schemata.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { ChainName } from '@layerzerolabs/layerzero-definitions';
|
|
3
3
|
export declare const wireWorkflowFilterArgsSchema: {
|
|
4
4
|
onlyFrom: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof ChainName>>>;
|
|
@@ -35,7 +35,7 @@ export declare const wireWorkflowChainStateSchema: z.ZodObject<{
|
|
|
35
35
|
export type WireWorkflowChainState = z.infer<typeof wireWorkflowChainStateSchema>;
|
|
36
36
|
export type WireWorkflowChainResult = z.infer<typeof wireWorkflowChainResultSchema>;
|
|
37
37
|
export declare const wireWorkflowOrchestratorResultSchema: z.ZodObject<{
|
|
38
|
-
stateByChain: z.ZodDefault<z.ZodRecord<z.
|
|
38
|
+
stateByChain: z.ZodDefault<z.ZodRecord<z.ZodEnum<typeof ChainName> & z.core.$partial, z.ZodObject<{
|
|
39
39
|
results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
40
40
|
name: z.ZodString;
|
|
41
41
|
success: z.ZodLiteral<false>;
|
|
@@ -48,7 +48,7 @@ export declare const wireWorkflowOrchestratorResultSchema: z.ZodObject<{
|
|
|
48
48
|
}, z.core.$strip>>>;
|
|
49
49
|
}, z.core.$strip>;
|
|
50
50
|
export declare const wireWorkflowOrchestratorStateSchema: z.ZodObject<{
|
|
51
|
-
stateByChain: z.ZodDefault<z.ZodRecord<z.
|
|
51
|
+
stateByChain: z.ZodDefault<z.ZodRecord<z.ZodEnum<typeof ChainName> & z.core.$partial, z.ZodObject<{
|
|
52
52
|
results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
53
53
|
name: z.ZodString;
|
|
54
54
|
success: z.ZodLiteral<false>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemata.d.ts","sourceRoot":"","sources":["../../src/wire/schemata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"schemata.d.ts","sourceRoot":"","sources":["../../src/wire/schemata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,eAAO,MAAM,4BAA4B;;;;;;;CAsBxC,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;iBAexC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;iBAGvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;iBAE/C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;iBAE9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAChG,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC"}
|
package/dist/wire/schemata.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { wireWorkflowChainResultSchema, wireWorkflowChainStateSchema, wireWorkflowFilterArgsSchema, wireWorkflowOrchestratorResultSchema, wireWorkflowOrchestratorStateSchema } from '../
|
|
1
|
+
export { wireWorkflowChainResultSchema, wireWorkflowChainStateSchema, wireWorkflowFilterArgsSchema, wireWorkflowOrchestratorResultSchema, wireWorkflowOrchestratorStateSchema } from '../I5L5NLZY.js';
|
|
2
2
|
import '../VUOMXK5T.js';
|
|
3
3
|
//# sourceMappingURL=schemata.js.map
|
|
4
4
|
//# sourceMappingURL=schemata.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/dw-model",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,19 +14,20 @@
|
|
|
14
14
|
"module": "./dist/index.js",
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"zod": "3.
|
|
18
|
-
"@layerzerolabs/common-chain-model": "0.2.
|
|
19
|
-
"@layerzerolabs/
|
|
20
|
-
"@layerzerolabs/
|
|
21
|
-
"@layerzerolabs/
|
|
22
|
-
"@layerzerolabs/
|
|
17
|
+
"zod": "4.3.5",
|
|
18
|
+
"@layerzerolabs/common-chain-model": "0.2.18",
|
|
19
|
+
"@layerzerolabs/common-error-utils": "0.2.18",
|
|
20
|
+
"@layerzerolabs/gated-transaction": "0.2.18",
|
|
21
|
+
"@layerzerolabs/layerzero-definitions": "0.2.18",
|
|
22
|
+
"@layerzerolabs/typescript-utils": "0.2.18",
|
|
23
|
+
"@layerzerolabs/zod-utils": "0.2.18"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@mysten/sui": "^1.35.0",
|
|
26
27
|
"tsup": "^8.4.0",
|
|
27
28
|
"vitest": "^3.2.3",
|
|
28
|
-
"@layerzerolabs/tsup-configuration": "0.2.
|
|
29
|
-
"@layerzerolabs/typescript-configuration": "0.2.
|
|
29
|
+
"@layerzerolabs/tsup-configuration": "0.2.18",
|
|
30
|
+
"@layerzerolabs/typescript-configuration": "0.2.18"
|
|
30
31
|
},
|
|
31
32
|
"publishConfig": {
|
|
32
33
|
"access": "restricted",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { SuiObjectChange } from '@mysten/sui/client';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import { hexSchema, normalizedHexSchema } from '@layerzerolabs/common-chain-model';
|
|
5
|
+
import { ChainName } from '@layerzerolabs/layerzero-definitions';
|
|
6
|
+
export type { ChainName };
|
|
7
|
+
|
|
8
|
+
export type { SuiObjectChange };
|
|
9
|
+
|
|
10
|
+
export enum ArtifactType {
|
|
11
|
+
// should merge deployment, verification artifacts
|
|
12
|
+
|
|
13
|
+
// full record from deployment on-chain
|
|
14
|
+
DEPLOYMENT = 'deployment',
|
|
15
|
+
// information to verify contracts
|
|
16
|
+
VERIFICATION = 'verification',
|
|
17
|
+
// record of a successful push to lz metadata
|
|
18
|
+
METADATA = 'metadata',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Chain-specific extra deployment info schemas
|
|
22
|
+
export const solanaDeploymentArtifactExtraInfoSchema = z.object({
|
|
23
|
+
accounts: z.record(z.string(), normalizedHexSchema),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type SolanaDeploymentArtifactExtraInfo = z.infer<
|
|
27
|
+
typeof solanaDeploymentArtifactExtraInfoSchema
|
|
28
|
+
>;
|
|
29
|
+
|
|
30
|
+
export const suiDeploymentArtifactExtraInfoSchema = z.object({
|
|
31
|
+
digest: z.string(),
|
|
32
|
+
objectChanges: z.array(z.custom<SuiObjectChange>()),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type SuiDeploymentArtifactExtraInfo = z.infer<typeof suiDeploymentArtifactExtraInfoSchema>;
|
|
36
|
+
|
|
37
|
+
export const identityOnlyDeploymentArtifactSchema = z.object({
|
|
38
|
+
contractName: z.string(),
|
|
39
|
+
chainName: z.enum(ChainName),
|
|
40
|
+
address: normalizedHexSchema,
|
|
41
|
+
});
|
|
42
|
+
export type IdentityOnlyDeploymentArtifact = z.infer<typeof identityOnlyDeploymentArtifactSchema>;
|
|
43
|
+
|
|
44
|
+
// FIXME also include verification info in this
|
|
45
|
+
export const fullDeploymentArtifactSchema = z.object({
|
|
46
|
+
...identityOnlyDeploymentArtifactSchema.shape,
|
|
47
|
+
contractName: z.string(),
|
|
48
|
+
chainName: z.enum(ChainName),
|
|
49
|
+
address: normalizedHexSchema,
|
|
50
|
+
nativeAddress: z.string(),
|
|
51
|
+
bytecodeHash: z.string().optional(),
|
|
52
|
+
deploymentTimestamp: z.number(),
|
|
53
|
+
deployerAddress: normalizedHexSchema,
|
|
54
|
+
txHash: z.string(),
|
|
55
|
+
// should probably remove this
|
|
56
|
+
abiEncodedConstructorArguments: hexSchema.optional(),
|
|
57
|
+
extraDeploymentInfo: z.any().optional(),
|
|
58
|
+
});
|
|
59
|
+
export type FullDeploymentArtifact = z.infer<typeof fullDeploymentArtifactSchema>;
|
|
60
|
+
|
|
61
|
+
export const deploymentArtifactSchema = z.union([
|
|
62
|
+
// check this first since it's a superset
|
|
63
|
+
fullDeploymentArtifactSchema,
|
|
64
|
+
identityOnlyDeploymentArtifactSchema,
|
|
65
|
+
]);
|
|
66
|
+
|
|
67
|
+
export type DeploymentArtifact = z.infer<typeof deploymentArtifactSchema>;
|
|
68
|
+
|
|
69
|
+
export const verificationArtifactSchema = z.any();
|
|
70
|
+
|
|
71
|
+
export type VerificationArtifact = z.infer<typeof verificationArtifactSchema>;
|
|
72
|
+
|
|
73
|
+
export const metadataArtifactSchema = z.void();
|
|
74
|
+
|
|
75
|
+
export type MetadataArtifact = z.infer<typeof metadataArtifactSchema>;
|
|
76
|
+
|
|
77
|
+
export const artifactWithTypeSchema = z.discriminatedUnion('artifactType', [
|
|
78
|
+
z.object({
|
|
79
|
+
artifactType: z.literal(ArtifactType.DEPLOYMENT),
|
|
80
|
+
artifact: deploymentArtifactSchema,
|
|
81
|
+
}),
|
|
82
|
+
z.object({
|
|
83
|
+
artifactType: z.literal(ArtifactType.VERIFICATION),
|
|
84
|
+
artifact: z.any(),
|
|
85
|
+
}),
|
|
86
|
+
z.object({
|
|
87
|
+
artifactType: z.literal(ArtifactType.METADATA),
|
|
88
|
+
// not implemented yet
|
|
89
|
+
artifact: z.never(),
|
|
90
|
+
}),
|
|
91
|
+
]);
|
|
92
|
+
|
|
93
|
+
export type ArtifactWithType = z.infer<typeof artifactWithTypeSchema>;
|
package/src/deploy/index.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { z } from 'zod
|
|
1
|
+
import type { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
BaseContractResource,
|
|
5
5
|
BaseMeshResource,
|
|
6
6
|
baseResourceSchema,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
ContractResourceReference,
|
|
8
|
+
MeshResourceReference,
|
|
9
9
|
} from './resources';
|
|
10
10
|
|
|
11
11
|
export type ContractResourceBuilderResult<Resource extends BaseContractResource> = {
|
|
12
|
-
|
|
12
|
+
ref: () => ContractResourceReference<Resource>;
|
|
13
13
|
build: () => Resource;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export type MeshResourceBuilderResult<Resource extends BaseMeshResource> = {
|
|
17
|
-
|
|
17
|
+
ref: () => MeshResourceReference<Resource>;
|
|
18
18
|
build: () => Resource;
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -38,22 +38,13 @@ export const createResourceBuilder =
|
|
|
38
38
|
: never => {
|
|
39
39
|
if (resourceBaseType === 'CONTRACT') {
|
|
40
40
|
return {
|
|
41
|
-
|
|
42
|
-
__CONTRACT_RESOURCE_DEPENDENCY: true,
|
|
43
|
-
__dependencyType: null as any,
|
|
44
|
-
id: resource.id,
|
|
45
|
-
},
|
|
41
|
+
ref: () => `#C_REF:${resource.id}` as any,
|
|
46
42
|
build: () => ({ ...resource, type, resourceBaseType }),
|
|
47
43
|
} satisfies ContractResourceBuilderResult<any> as any;
|
|
48
44
|
}
|
|
49
45
|
if (resourceBaseType === 'MESH') {
|
|
50
46
|
return {
|
|
51
|
-
|
|
52
|
-
__MESH_RESOURCE_DEPENDENCY: true,
|
|
53
|
-
// this is just a type brand, doesnt need to exist
|
|
54
|
-
__dependencyType: null as any,
|
|
55
|
-
id: resource.id,
|
|
56
|
-
},
|
|
47
|
+
ref: () => `#M_REF:${resource.id}` as any,
|
|
57
48
|
build: () => ({ ...resource, type, resourceBaseType }),
|
|
58
49
|
} satisfies MeshResourceBuilderResult<any> as any;
|
|
59
50
|
}
|
package/src/deploy/resources.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import z from 'zod
|
|
1
|
+
import z from 'zod';
|
|
2
2
|
|
|
3
3
|
import type { NormalizedHexString } from '@layerzerolabs/common-chain-model';
|
|
4
|
+
import { throwError } from '@layerzerolabs/common-error-utils';
|
|
4
5
|
import { ChainName } from '@layerzerolabs/layerzero-definitions';
|
|
5
6
|
import type { IsAny } from '@layerzerolabs/typescript-utils';
|
|
6
7
|
|
|
@@ -31,82 +32,104 @@ export type BaseResource = z.infer<typeof baseResourceSchema>;
|
|
|
31
32
|
export type BaseMeshResource = z.infer<typeof baseMeshResourceSchema>;
|
|
32
33
|
export type BaseContractResource = z.infer<typeof baseContractResourceSchema>;
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/** WARNING:
|
|
37
|
-
|
|
38
|
-
['
|
|
35
|
+
// the actual expected runtime value for this type is #C_REF:${id}
|
|
36
|
+
export type ContractResourceReference<T extends BaseContractResource = BaseContractResource> = {
|
|
37
|
+
/** WARNING: these fields are not present at runtime */
|
|
38
|
+
__resourceReferenceType: T;
|
|
39
|
+
['__CONTRACT_RESOURCE_REFERENCE']: true;
|
|
39
40
|
};
|
|
40
41
|
|
|
41
|
-
export const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(
|
|
42
|
+
export const extractIdFromContractResourceReference = (ref: ContractResourceReference) =>
|
|
43
|
+
((ref as unknown as string).startsWith('#C_REF:') &&
|
|
44
|
+
(ref as unknown as string).slice('#C_REF:'.length)) ||
|
|
45
|
+
throwError(`Ref ${JSON.stringify(ref)} is not a contract resource ref`);
|
|
45
46
|
|
|
46
|
-
export type
|
|
47
|
-
z.ZodType<
|
|
47
|
+
export type ContractResourceReferenceSchema<T extends typeof baseContractResourceSchema> =
|
|
48
|
+
z.ZodType<ContractResourceReference<z.infer<T>>>;
|
|
48
49
|
|
|
49
|
-
export const
|
|
50
|
+
export const contractResourceReferenceSchema: ContractResourceReferenceSchema<
|
|
50
51
|
typeof baseContractResourceSchema
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
// at runtime, we expect a string
|
|
53
|
+
> = z.string().meta({
|
|
54
|
+
id: 'contract-resource-dependency',
|
|
55
|
+
title: 'Contract dependency to any',
|
|
56
|
+
description: 'A reference to another contract resource (any)',
|
|
57
|
+
}) as unknown as z.ZodType<ContractResourceReference>;
|
|
58
|
+
|
|
59
|
+
let contractResourceDependencyForSchemaZodMetaIdIdx = 0;
|
|
60
|
+
export const contractResourceReferenceSchemaFor = <T extends typeof baseContractResourceSchema>(
|
|
54
61
|
// FIXME use this to generate a real schema
|
|
55
62
|
_resource: T,
|
|
56
|
-
):
|
|
57
|
-
z.
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
): ContractResourceReferenceSchema<T> =>
|
|
64
|
+
z.string().meta({
|
|
65
|
+
id: `contract-resource-dependency-for-${++contractResourceDependencyForSchemaZodMetaIdIdx}`,
|
|
66
|
+
// we can't generate this properly yet because this function needs more information
|
|
67
|
+
// will be fixed when we clean up the runtime of dependencies id
|
|
68
|
+
title: 'Contract dependency to (unknown)',
|
|
69
|
+
description: 'A reference to another contract resource (unknown)',
|
|
70
|
+
}) as unknown as z.ZodType<ContractResourceReference<z.infer<T>>>;
|
|
71
|
+
|
|
72
|
+
export type ResolvedContractResourceReference<T extends BaseContractResource> = {
|
|
60
73
|
id: string;
|
|
61
74
|
resource: T;
|
|
62
75
|
address: NormalizedHexString;
|
|
63
76
|
};
|
|
64
77
|
|
|
65
|
-
export type
|
|
66
|
-
z.ZodType<
|
|
78
|
+
export type ResolvedContractResourceReferenceSchema<T extends typeof baseContractResourceSchema> =
|
|
79
|
+
z.ZodType<ResolvedContractResourceReference<z.infer<T>>>;
|
|
67
80
|
|
|
68
|
-
export const
|
|
81
|
+
export const resolvedContractResourceReferenceSchema: ResolvedContractResourceReferenceSchema<any> =
|
|
69
82
|
// FIXME could be a real schema
|
|
70
|
-
z.custom<
|
|
83
|
+
z.custom<ResolvedContractResourceReference<any>>();
|
|
71
84
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/** WARNING:
|
|
75
|
-
|
|
76
|
-
['
|
|
85
|
+
// the actual expected runtime value for this type is #M_REF:${id}
|
|
86
|
+
export type MeshResourceReference<T extends BaseMeshResource = BaseMeshResource> = {
|
|
87
|
+
/** WARNING: these fields are not present at runtime */
|
|
88
|
+
__resourceReferenceType: T;
|
|
89
|
+
['__MESH_RESOURCE_REFERENCE']: true;
|
|
77
90
|
};
|
|
78
91
|
|
|
79
|
-
export
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export type MeshResourceDependencySchema<T extends typeof baseMeshResourceSchema> = z.ZodType<
|
|
83
|
-
MeshResourceDependency<z.infer<T>>
|
|
92
|
+
export type MeshResourceReferenceSchema<T extends typeof baseMeshResourceSchema> = z.ZodType<
|
|
93
|
+
MeshResourceReference<z.infer<T>>
|
|
84
94
|
>;
|
|
85
95
|
|
|
86
|
-
export const
|
|
96
|
+
export const meshResourceReferenceSchema: MeshResourceReferenceSchema<
|
|
87
97
|
typeof baseMeshResourceSchema
|
|
88
|
-
> = z.
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
> = z.string().meta({
|
|
99
|
+
id: 'mesh-resource-dependency',
|
|
100
|
+
title: 'Mesh dependency to any',
|
|
101
|
+
description: 'A reference to another mesh resource (any)',
|
|
102
|
+
}) as unknown as z.ZodType<MeshResourceReference>;
|
|
103
|
+
|
|
104
|
+
let meshResourceDependencyForSchemaZodMetaIdIdx = 0;
|
|
105
|
+
export const meshResourceReferenceSchemaFor = <T extends typeof baseMeshResourceSchema>(
|
|
91
106
|
// FIXME use this to generate a real schema
|
|
92
107
|
_resource: T,
|
|
93
|
-
):
|
|
94
|
-
z.
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
): MeshResourceReferenceSchema<T> =>
|
|
109
|
+
z.string().meta({
|
|
110
|
+
id: `mesh-resource-dependency-for-${++meshResourceDependencyForSchemaZodMetaIdIdx}`,
|
|
111
|
+
title: 'Mesh dependency to (unknown)',
|
|
112
|
+
description: 'A reference to another mesh resource (unknown)',
|
|
113
|
+
}) as unknown as z.ZodType<MeshResourceReference<z.infer<T>>>;
|
|
114
|
+
|
|
115
|
+
export type ResolvedMeshResourceReference<T extends BaseMeshResource> = {
|
|
97
116
|
id: string;
|
|
98
117
|
resource: T;
|
|
99
118
|
// TODO: is there any other resolved information we want to inject here?
|
|
100
119
|
};
|
|
101
120
|
|
|
102
|
-
export
|
|
121
|
+
export const extractIdFromMeshResourceReference = (ref: MeshResourceReference) =>
|
|
122
|
+
((ref as unknown as string).startsWith('#M_REF:') &&
|
|
123
|
+
(ref as unknown as string).slice('#M_REF:'.length)) ||
|
|
124
|
+
throwError(`Ref ${JSON.stringify(ref)} is not a mesh resource ref`);
|
|
125
|
+
|
|
126
|
+
export type ResolvedMeshResourceReferenceSchema<T extends typeof baseMeshResourceSchema> =
|
|
103
127
|
// FIXME could be a real schema
|
|
104
|
-
z.ZodType<
|
|
128
|
+
z.ZodType<ResolvedMeshResourceReference<z.infer<T>>>;
|
|
105
129
|
|
|
106
|
-
export const
|
|
107
|
-
z.custom<
|
|
130
|
+
export const resolvedMeshResourceReferenceSchema: ResolvedMeshResourceReferenceSchema<any> =
|
|
131
|
+
z.custom<ResolvedMeshResourceReference<any>>();
|
|
108
132
|
|
|
109
|
-
// FIXME this could be recursive, probably overkill
|
|
110
133
|
export type ResolvedResourceSchema<Resource extends typeof baseResourceSchema> = z.ZodObject<
|
|
111
134
|
{
|
|
112
135
|
[K in keyof Resource['shape']]: Resource['shape'][K] extends infer R extends z.ZodType
|
|
@@ -114,21 +137,20 @@ export type ResolvedResourceSchema<Resource extends typeof baseResourceSchema> =
|
|
|
114
137
|
? R
|
|
115
138
|
: R extends z.ZodOptional<z.ZodAny>
|
|
116
139
|
? R
|
|
117
|
-
: R extends
|
|
118
|
-
?
|
|
119
|
-
: R extends z.ZodOptional<
|
|
120
|
-
? z.ZodOptional<
|
|
121
|
-
: R extends
|
|
122
|
-
?
|
|
123
|
-
: R extends z.ZodOptional<
|
|
124
|
-
? z.ZodOptional<
|
|
140
|
+
: R extends ContractResourceReferenceSchema<infer I>
|
|
141
|
+
? ResolvedContractResourceReferenceSchema<I>
|
|
142
|
+
: R extends z.ZodOptional<ContractResourceReferenceSchema<infer I>>
|
|
143
|
+
? z.ZodOptional<ResolvedContractResourceReferenceSchema<I>>
|
|
144
|
+
: R extends MeshResourceReferenceSchema<infer I>
|
|
145
|
+
? ResolvedMeshResourceReferenceSchema<I>
|
|
146
|
+
: R extends z.ZodOptional<MeshResourceReferenceSchema<infer I>>
|
|
147
|
+
? z.ZodOptional<ResolvedMeshResourceReferenceSchema<I>>
|
|
125
148
|
: R
|
|
126
149
|
: never;
|
|
127
150
|
},
|
|
128
151
|
z.core.$strip
|
|
129
152
|
>;
|
|
130
153
|
|
|
131
|
-
// FIXME this could be recursive, probably overkill
|
|
132
154
|
export type ResolvedResource<Resource extends BaseResource> = {
|
|
133
155
|
[K in keyof Resource]: Resource[K] extends infer R
|
|
134
156
|
? R extends undefined
|
|
@@ -137,33 +159,29 @@ export type ResolvedResource<Resource extends BaseResource> = {
|
|
|
137
159
|
? R
|
|
138
160
|
: IsAny<Exclude<R, undefined>> extends true
|
|
139
161
|
? R
|
|
140
|
-
: R extends
|
|
141
|
-
?
|
|
142
|
-
: R extends
|
|
143
|
-
?
|
|
144
|
-
: R extends
|
|
145
|
-
?
|
|
146
|
-
: R extends
|
|
147
|
-
?
|
|
162
|
+
: R extends ContractResourceReference<infer I>
|
|
163
|
+
? ResolvedContractResourceReference<I>
|
|
164
|
+
: R extends ContractResourceReference<infer I> | undefined
|
|
165
|
+
? ResolvedContractResourceReference<I> | undefined
|
|
166
|
+
: R extends MeshResourceReference<infer I>
|
|
167
|
+
? ResolvedMeshResourceReference<I>
|
|
168
|
+
: R extends MeshResourceReference<infer I> | undefined
|
|
169
|
+
? ResolvedMeshResourceReference<I> | undefined
|
|
148
170
|
: R
|
|
149
171
|
: never;
|
|
150
172
|
};
|
|
151
173
|
|
|
152
|
-
export const
|
|
153
|
-
resource: Resource,
|
|
154
|
-
) =>
|
|
155
|
-
Object.entries(resource).filter(([, id]) => isContractResourceDependency(id)) as unknown as [
|
|
156
|
-
prop: string,
|
|
157
|
-
id: ContractResourceDependency,
|
|
158
|
-
][];
|
|
159
|
-
|
|
160
|
-
export const extractMeshResourceDependencyIds = <Resource extends BaseResource>(
|
|
174
|
+
export const extractContractResourceReferences = <Resource extends BaseResource>(
|
|
161
175
|
resource: Resource,
|
|
162
176
|
) =>
|
|
163
|
-
Object.entries(resource).filter(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
177
|
+
Object.entries(resource).filter(
|
|
178
|
+
([, id]) => typeof id === 'string' && id.startsWith('#C_REF:'),
|
|
179
|
+
) as unknown as [prop: string, id: ContractResourceReference][];
|
|
180
|
+
|
|
181
|
+
export const extractMeshResourceReferences = <Resource extends BaseResource>(resource: Resource) =>
|
|
182
|
+
Object.entries(resource).filter(
|
|
183
|
+
([, id]) => typeof id === 'string' && id.startsWith('#M_REF:'),
|
|
184
|
+
) as unknown as [prop: string, id: MeshResourceReference][];
|
|
167
185
|
|
|
168
186
|
// FIXME implement runtime
|
|
169
187
|
export const createResolvedResourceSchema = <Resource extends typeof baseResourceSchema>(
|