rocketh 0.11.21 → 0.11.22-testing.1

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/environment/index.d.ts +0 -3
  3. package/dist/environment/index.d.ts.map +1 -1
  4. package/dist/environment/index.js +14 -15
  5. package/dist/environment/index.js.map +1 -1
  6. package/dist/environment/types.d.ts +2 -0
  7. package/dist/environment/types.d.ts.map +1 -1
  8. package/dist/executor/index.d.ts +31 -3
  9. package/dist/executor/index.d.ts.map +1 -1
  10. package/dist/executor/index.js +46 -7
  11. package/dist/executor/index.js.map +1 -1
  12. package/dist/executor/setup.test.d.ts +13 -0
  13. package/dist/executor/setup.test.d.ts.map +1 -0
  14. package/dist/executor/setup.test.js +106 -0
  15. package/dist/executor/setup.test.js.map +1 -0
  16. package/dist/executor/types.d.ts +20 -0
  17. package/dist/executor/types.d.ts.map +1 -1
  18. package/dist/index.d.ts +0 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +0 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/internal/types.d.ts +2 -0
  23. package/dist/internal/types.d.ts.map +1 -1
  24. package/dist/utils/curry.d.ts +35 -0
  25. package/dist/utils/curry.d.ts.map +1 -0
  26. package/dist/utils/curry.js +30 -0
  27. package/dist/utils/curry.js.map +1 -0
  28. package/dist/utils/curry.test.d.ts +16 -0
  29. package/dist/utils/curry.test.d.ts.map +1 -0
  30. package/dist/utils/curry.test.js +33 -0
  31. package/dist/utils/curry.test.js.map +1 -0
  32. package/package.json +1 -1
  33. package/src/environment/index.ts +16 -18
  34. package/src/environment/types.ts +2 -0
  35. package/src/executor/index.ts +64 -18
  36. package/src/executor/setup.test.ts +133 -0
  37. package/src/executor/types.ts +45 -0
  38. package/src/index.ts +0 -1
  39. package/src/internal/types.ts +3 -0
  40. package/src/utils/curry.test.ts +42 -0
  41. package/src/utils/curry.ts +60 -0
@@ -8,4 +8,24 @@ export interface DeployScriptModule<NamedAccounts extends UnresolvedUnknownNamed
8
8
  id?: string;
9
9
  }
10
10
  export type ScriptCallback<NamedAccounts extends UnresolvedUnknownNamedAccounts = UnresolvedUnknownNamedAccounts, Data extends UnresolvedNetworkSpecificData = UnresolvedNetworkSpecificData, Deployments extends UnknownDeployments = UnknownDeployments> = (env: Environment<NamedAccounts, Data, Deployments>) => Promise<void>;
11
+ /**
12
+ * Utility type to remove the first parameter from a function type
13
+ */
14
+ type RemoveFirstParameter<T> = T extends (first: any, ...rest: infer R) => infer Return ? (...args: R) => Return : never;
15
+ /**
16
+ * Utility type to transform an object of functions by removing their first parameter
17
+ */
18
+ type CurriedFunctions<T> = {
19
+ [K in keyof T]: RemoveFirstParameter<T[K]>;
20
+ };
21
+ /**
22
+ * Type for the enhanced environment proxy that includes both the original environment
23
+ * and the curried functions
24
+ */
25
+ export type EnhancedEnvironment<NamedAccounts extends UnresolvedUnknownNamedAccounts = UnresolvedUnknownNamedAccounts, Data extends UnresolvedNetworkSpecificData = UnresolvedNetworkSpecificData, Deployments extends UnknownDeployments = UnknownDeployments, Functions extends Record<string, (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any> = Record<string, (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any>> = Environment<NamedAccounts, Data, Deployments> & CurriedFunctions<Functions>;
26
+ /**
27
+ * Type for a deploy script function that receives an enhanced environment
28
+ */
29
+ export type EnhancedDeployScriptFunction<NamedAccounts extends UnresolvedUnknownNamedAccounts = UnresolvedUnknownNamedAccounts, Data extends UnresolvedNetworkSpecificData = UnresolvedNetworkSpecificData, ArgumentsTypes = undefined, Deployments extends UnknownDeployments = UnknownDeployments, Functions extends Record<string, (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any> = Record<string, (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any>> = (env: EnhancedEnvironment<NamedAccounts, Data, Deployments, Functions>, args?: ArgumentsTypes) => Promise<void | boolean>;
30
+ export {};
11
31
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/executor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,oBAAoB,CAC/B,aAAa,SAAS,8BAA8B,GAAG,8BAA8B,EACrF,IAAI,SAAS,6BAA6B,GAAG,6BAA6B,EAC1E,cAAc,GAAG,SAAS,EAC1B,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,IACxD,CAAC,GAAG,EAAE,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;AAE3G,MAAM,WAAW,kBAAkB,CAClC,aAAa,SAAS,8BAA8B,GAAG,8BAA8B,EACrF,IAAI,SAAS,6BAA6B,GAAG,6BAA6B,EAC1E,cAAc,GAAG,SAAS,EAC1B,WAAW,SAAS,kBAAkB,GAAG,kBAAkB;IAE3D,CAAC,GAAG,EAAE,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;IACrG,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,cAAc,CACzB,aAAa,SAAS,8BAA8B,GAAG,8BAA8B,EACrF,IAAI,SAAS,6BAA6B,GAAG,6BAA6B,EAC1E,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,IACxD,CAAC,GAAG,EAAE,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/executor/types.ts"],"names":[],"mappings":"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"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from './executor/index.js';
2
2
  export * from './executor/types.js';
3
3
  export * from './environment/types.js';
4
- export { extendEnvironment, handleSignerProtocol } from './environment/index.js';
5
4
  export { loadDeployments } from './environment/deployments.js';
6
5
  export * from './environment/utils/artifacts.js';
7
6
  export * from './environment/utils/chains.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from './executor/index.js';
2
2
  export * from './executor/types.js';
3
3
  export * from './environment/types.js';
4
- export { extendEnvironment, handleSignerProtocol } from './environment/index.js';
5
4
  export { loadDeployments } from './environment/deployments.js';
6
5
  export * from './environment/utils/artifacts.js';
7
6
  export * from './environment/utils/chains.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAC,iBAAiB,EAAE,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC"}
@@ -1,6 +1,8 @@
1
+ import { SignerProtocol } from '../environment/index.js';
1
2
  export type InternalEnvironment = {
2
3
  exportDeploymentsAsTypes(): Promise<void>;
3
4
  recoverTransactionsIfAny(): Promise<void>;
4
5
  recordMigration(id: string): void;
6
+ getSignerProtocol(protocol: string): SignerProtocol | undefined;
5
7
  };
6
8
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/internal/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IACjC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/internal/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IACjC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;CAChE,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { Environment, UnknownDeployments, UnresolvedNetworkSpecificData, UnresolvedUnknownNamedAccounts } from '../environment/types.js';
2
+ /**
3
+ * Utility type to remove the first parameter from a function type
4
+ */
5
+ type RemoveFirstParameter<T> = T extends (first: any, ...rest: infer R) => infer Return ? (...args: R) => Return : never;
6
+ /**
7
+ * Utility type to transform an object of functions by removing their first parameter
8
+ */
9
+ type CurriedFunctions<T> = {
10
+ [K in keyof T]: RemoveFirstParameter<T[K]>;
11
+ };
12
+ /**
13
+ * Creates a curried version of functions that automatically inject an environment as the first parameter.
14
+ *
15
+ * @param env - The environment object to inject as the first parameter
16
+ * @param functions - An object containing functions that expect the environment as their first parameter
17
+ * @returns An object with the same function names, but with the environment parameter removed
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const functions = {
22
+ * deploy: (env: Environment, contractName: string, args: any[]) => Promise<void>,
23
+ * verify: (env: Environment, address: string) => Promise<boolean>
24
+ * };
25
+ *
26
+ * const curriedFunctions = withEnvironment(env, functions);
27
+ *
28
+ * // Now you can call without passing env:
29
+ * await curriedFunctions.deploy('MyContract', []);
30
+ * await curriedFunctions.verify('0x123...');
31
+ * ```
32
+ */
33
+ export declare function withEnvironment<NamedAccounts extends UnresolvedUnknownNamedAccounts = UnresolvedUnknownNamedAccounts, Data extends UnresolvedNetworkSpecificData = UnresolvedNetworkSpecificData, Deployments extends UnknownDeployments = UnknownDeployments, T extends Record<string, (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any> = Record<string, (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any>>(env: Environment<NamedAccounts, Data, Deployments>, functions: T): CurriedFunctions<T>;
34
+ export {};
35
+ //# sourceMappingURL=curry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry.d.ts","sourceRoot":"","sources":["../../src/utils/curry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,KAAK,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,MAAM,GACpF,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,MAAM,GACtB,KAAK,CAAC;AAET;;GAEG;AACH,KAAK,gBAAgB,CAAC,CAAC,IAAI;KACzB,CAAC,IAAI,MAAM,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAC9B,aAAa,SAAS,8BAA8B,GAAG,8BAA8B,EACrF,IAAI,SAAS,6BAA6B,GAAG,6BAA6B,EAC1E,WAAW,SAAS,kBAAkB,GAAG,kBAAkB,EAC3D,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,MAAM,CAC7G,MAAM,EACN,CAAC,GAAG,EAAE,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAC3E,EACA,GAAG,EAAE,WAAW,CAAC,aAAa,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CASvF"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Creates a curried version of functions that automatically inject an environment as the first parameter.
3
+ *
4
+ * @param env - The environment object to inject as the first parameter
5
+ * @param functions - An object containing functions that expect the environment as their first parameter
6
+ * @returns An object with the same function names, but with the environment parameter removed
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const functions = {
11
+ * deploy: (env: Environment, contractName: string, args: any[]) => Promise<void>,
12
+ * verify: (env: Environment, address: string) => Promise<boolean>
13
+ * };
14
+ *
15
+ * const curriedFunctions = withEnvironment(env, functions);
16
+ *
17
+ * // Now you can call without passing env:
18
+ * await curriedFunctions.deploy('MyContract', []);
19
+ * await curriedFunctions.verify('0x123...');
20
+ * ```
21
+ */
22
+ export function withEnvironment(env, functions) {
23
+ const result = {};
24
+ for (const [key, func] of Object.entries(functions)) {
25
+ // Create a new function that automatically passes the environment as the first argument
26
+ result[key] = (...args) => func(env, ...args);
27
+ }
28
+ return result;
29
+ }
30
+ //# sourceMappingURL=curry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry.js","sourceRoot":"","sources":["../../src/utils/curry.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,eAAe,CAQ7B,GAAkD,EAAE,SAAY;IACjE,MAAM,MAAM,GAAG,EAAyB,CAAC;IAEzC,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACrD,wFAAwF;QACvF,MAAc,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Environment } from '../environment/types.js';
2
+ declare const exampleFunctions: {
3
+ deploy: (env: Environment, contractName: string, args: any[]) => Promise<void>;
4
+ verify: (env: Environment, address: string) => Promise<boolean>;
5
+ getBalance: (env: Environment, address: string) => Promise<bigint>;
6
+ syncFunction: (env: Environment, value: number) => number;
7
+ };
8
+ declare const curriedFunctions: {
9
+ deploy: (contractName: string, args: any[]) => Promise<void>;
10
+ verify: (address: string) => Promise<boolean>;
11
+ getBalance: (address: string) => Promise<bigint>;
12
+ syncFunction: (value: number) => number;
13
+ };
14
+ declare function testTypes(): Promise<void>;
15
+ export { testTypes, curriedFunctions, exampleFunctions };
16
+ //# sourceMappingURL=curry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry.test.d.ts","sourceRoot":"","sources":["../../src/utils/curry.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAOzD,QAAA,MAAM,gBAAgB;kBACP,WAAW,gBAAgB,MAAM,QAAQ,GAAG,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC;kBAI9D,WAAW,WAAW,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;sBAI3C,WAAW,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC;wBAI5C,WAAW,SAAS,MAAM,KAAG,MAAM;CAGvD,CAAC;AAGF,QAAA,MAAM,gBAAgB;;;;;CAA6C,CAAC;AAGpE,iBAAe,SAAS,kBASvB;AAGD,OAAO,EAAC,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { withEnvironment } from './curry.js';
2
+ // Mock environment for testing
3
+ const mockEnv = {};
4
+ // Example functions that take environment as first parameter
5
+ const exampleFunctions = {
6
+ deploy: (env, contractName, args) => {
7
+ return Promise.resolve();
8
+ },
9
+ verify: (env, address) => {
10
+ return Promise.resolve(true);
11
+ },
12
+ getBalance: (env, address) => {
13
+ return Promise.resolve(BigInt(0));
14
+ },
15
+ syncFunction: (env, value) => {
16
+ return value * 2;
17
+ },
18
+ };
19
+ // Test the currying function
20
+ const curriedFunctions = withEnvironment(mockEnv, exampleFunctions);
21
+ // Type tests - these should compile without errors
22
+ async function testTypes() {
23
+ // These calls should work without passing env
24
+ await curriedFunctions.deploy('MyContract', []);
25
+ const isVerified = await curriedFunctions.verify('0x123...');
26
+ const balance = await curriedFunctions.getBalance('0x456...');
27
+ const doubled = curriedFunctions.syncFunction(42);
28
+ console.log('Type tests passed!');
29
+ console.log({ isVerified, balance, doubled });
30
+ }
31
+ // Export for potential use in actual tests
32
+ export { testTypes, curriedFunctions, exampleFunctions };
33
+ //# sourceMappingURL=curry.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curry.test.js","sourceRoot":"","sources":["../../src/utils/curry.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAE3C,+BAA+B;AAC/B,MAAM,OAAO,GAAG,EAAiB,CAAC;AAElC,6DAA6D;AAC7D,MAAM,gBAAgB,GAAG;IACxB,MAAM,EAAE,CAAC,GAAgB,EAAE,YAAoB,EAAE,IAAW,EAAiB,EAAE;QAC9E,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,CAAC,GAAgB,EAAE,OAAe,EAAoB,EAAE;QAC/D,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,UAAU,EAAE,CAAC,GAAgB,EAAE,OAAe,EAAmB,EAAE;QAClE,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,YAAY,EAAE,CAAC,GAAgB,EAAE,KAAa,EAAU,EAAE;QACzD,OAAO,KAAK,GAAG,CAAC,CAAC;IAClB,CAAC;CACD,CAAC;AAEF,6BAA6B;AAC7B,MAAM,gBAAgB,GAAG,eAAe,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AAEpE,mDAAmD;AACnD,KAAK,UAAU,SAAS;IACvB,8CAA8C;IAC9C,MAAM,gBAAgB,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAElD,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAClC,OAAO,CAAC,GAAG,CAAC,EAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAC,CAAC,CAAC;AAC7C,CAAC;AAED,2CAA2C;AAC3C,OAAO,EAAC,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rocketh",
3
- "version": "0.11.21",
3
+ "version": "0.11.22-testing.1",
4
4
  "description": "deploy smart contract on ethereum-compatible networks",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -42,26 +42,11 @@ import {TransactionHashTracker, TransactionHashTrackerProvider} from './provider
42
42
 
43
43
  type ReceiptResult = {receipt: EIP1193TransactionReceipt; latestBlockNumber: EIP1193QUANTITY};
44
44
 
45
- export type EnvironmentExtenstion = (env: Environment) => Environment;
46
- //we store this globally so this is not lost
47
- (globalThis as any).extensions = [];
48
- export function extendEnvironment(extension: EnvironmentExtenstion): void {
49
- (globalThis as any).extensions.push(extension);
50
- }
51
-
52
45
  export type SignerProtocolFunction = (protocolString: string) => Promise<Signer>;
53
46
  export type SignerProtocol = {
54
47
  getSigner: SignerProtocolFunction;
55
48
  };
56
49
 
57
- //we store this globally so this is not lost
58
- (globalThis as any).signerProtocols = {};
59
- export function handleSignerProtocol(protocol: string, getSigner: SignerProtocolFunction): void {
60
- (globalThis as any).signerProtocols[protocol] = {
61
- getSigner,
62
- };
63
- }
64
-
65
50
  function wait(numSeconds: number): Promise<void> {
66
51
  return new Promise((resolve) => {
67
52
  setTimeout(resolve, numSeconds * 1000);
@@ -103,6 +88,17 @@ export async function createEnvironment<
103
88
  console.error(`failed to get genesis hash`);
104
89
  }
105
90
 
91
+ const signerProtocols: {[protocol: string]: SignerProtocol} = {};
92
+ function getSignerProtocol(protocol: string): SignerProtocol | undefined {
93
+ return signerProtocols[protocol] || undefined;
94
+ }
95
+
96
+ function registerProtocol(protocol: string, getSigner: SignerProtocolFunction): void {
97
+ signerProtocols[protocol] = {
98
+ getSigner,
99
+ };
100
+ }
101
+
106
102
  let networkName: string;
107
103
  let saveDeployments: boolean;
108
104
  let networkTags: {[tag: string]: boolean} = {};
@@ -157,7 +153,7 @@ export async function createEnvironment<
157
153
  } else if (typeof accountDef === 'string') {
158
154
  if (accountDef.startsWith('0x')) {
159
155
  if (accountDef.length === 66) {
160
- const privateKeyProtocol: SignerProtocol = (globalThis as any).signerProtocols['privateKey'];
156
+ const privateKeyProtocol = getSignerProtocol('privateKey');
161
157
  if (privateKeyProtocol) {
162
158
  const namedSigner = await privateKeyProtocol.getSigner(`privateKey:${accountDef}`);
163
159
  const [address] = await namedSigner.signer.request({method: 'eth_accounts'});
@@ -176,9 +172,9 @@ export async function createEnvironment<
176
172
  } else {
177
173
  if (accountDef.indexOf(':') > 0) {
178
174
  const [protocolID, extra] = accountDef.split(':');
179
- const protocol: SignerProtocol = (globalThis as any).signerProtocols[protocolID];
175
+ const protocol = getSignerProtocol(protocolID);
180
176
  if (!protocol) {
181
- throw new Error(`protocol: ${protocol} is not supported`);
177
+ throw new Error(`protocol: ${protocolID} is not supported`);
182
178
  }
183
179
  const namedSigner = await protocol.getSigner(accountDef);
184
180
  const [address] = await namedSigner.signer.request({method: 'eth_accounts'});
@@ -710,6 +706,7 @@ export async function createEnvironment<
710
706
  showMessage,
711
707
  showProgress,
712
708
  hasMigrationBeenDone,
709
+ registerProtocol,
713
710
  };
714
711
  for (const extension of (globalThis as any).extensions) {
715
712
  env = extension(env);
@@ -718,6 +715,7 @@ export async function createEnvironment<
718
715
  return {
719
716
  external: env,
720
717
  internal: {
718
+ getSignerProtocol,
721
719
  exportDeploymentsAsTypes,
722
720
  recoverTransactionsIfAny,
723
721
  recordMigration,
@@ -13,6 +13,7 @@ import type {Chain} from 'viem';
13
13
  import {ProgressIndicator} from '../internal/logging.js';
14
14
  import {TransactionHashTracker} from './providers/TransactionHashTracker.js';
15
15
  import {DeterministicDeploymentInfo} from '../executor/index.js';
16
+ import {SignerProtocolFunction} from './index.js';
16
17
 
17
18
  export type {Abi, AbiError, AbiEvent, AbiConstructor, AbiFallback, AbiFunction, AbiReceive};
18
19
  export type Libraries = {readonly [libraryName: string]: EIP1193Account};
@@ -349,6 +350,7 @@ export interface Environment<
349
350
  showProgress(message?: string): ProgressIndicator;
350
351
 
351
352
  hasMigrationBeenDone(id: string): boolean;
353
+ registerProtocol(protocol: string, getSigner: SignerProtocolFunction): void;
352
354
  }
353
355
 
354
356
  export type DeploymentConstruction<TAbi extends Abi> = Omit<
@@ -5,13 +5,13 @@ import type {
5
5
  Config,
6
6
  Environment,
7
7
  ResolvedConfig,
8
- ResolvedNamedAccounts,
9
8
  UnknownDeployments,
10
9
  UnresolvedNetworkSpecificData,
11
10
  UnresolvedUnknownNamedAccounts,
12
11
  } from '../environment/types.js';
13
- import {createEnvironment} from '../environment/index.js';
14
- import {DeployScriptFunction, DeployScriptModule} from './types.js';
12
+ import {createEnvironment, SignerProtocolFunction} from '../environment/index.js';
13
+ import {DeployScriptFunction, DeployScriptModule, EnhancedDeployScriptFunction, EnhancedEnvironment} from './types.js';
14
+ import {withEnvironment} from '../utils/curry.js';
15
15
  import {logger, setLogLevel, spin} from '../internal/logging.js';
16
16
  import {EIP1193GenericRequestProvider, EIP1193ProviderWithoutEvents} from 'eip-1193';
17
17
  import {getRoughGasPriceEstimate} from '../utils/eth.js';
@@ -19,24 +19,70 @@ import prompts from 'prompts';
19
19
  import {formatEther} from 'viem';
20
20
  import {tsImport} from 'tsx/esm/api';
21
21
 
22
- export function execute<
22
+ /**
23
+ * Setup function that creates the execute function for deploy scripts. It allow to specify a set of functions that will be available in the environment.
24
+ *
25
+ * @param functions - An object of utility functions that expect Environment as their first parameter
26
+ * @returns An execute function that provides an enhanced environment with curried functions
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const functions = {
31
+ * deploy: (env: Environment, contractName: string, args: any[]) => Promise<void>,
32
+ * verify: (env: Environment, address: string) => Promise<boolean>
33
+ * };
34
+ *
35
+ * const execute = setup(functions);
36
+ *
37
+ * export default execute(async (env, args) => {
38
+ * // env now includes both the original environment AND the curried functions
39
+ * await env.deploy('MyContract', []); // No need to pass env
40
+ * await env.verify('0x123...'); // No need to pass env
41
+ *
42
+ * // Original environment properties are still available
43
+ * console.log(env.network.name);
44
+ * const deployment = env.get('MyContract');
45
+ * }, { tags: ['deploy'] });
46
+ * ```
47
+ */
48
+ export function setup<
49
+ Functions extends Record<string, (env: Environment<any, any, any>, ...args: any[]) => any> = {},
23
50
  NamedAccounts extends UnresolvedUnknownNamedAccounts = UnresolvedUnknownNamedAccounts,
24
51
  Data extends UnresolvedNetworkSpecificData = UnresolvedNetworkSpecificData,
25
- ArgumentsType = undefined,
26
52
  Deployments extends UnknownDeployments = UnknownDeployments
27
- >(
28
- callback: DeployScriptFunction<NamedAccounts, Data, ArgumentsType, Deployments>,
29
- options: {tags?: string[]; dependencies?: string[]; id?: string}
30
- ): DeployScriptModule<NamedAccounts, Data, ArgumentsType, Deployments> {
31
- const scriptModule: DeployScriptModule<NamedAccounts, Data, ArgumentsType, Deployments> = (
32
- env: Environment<NamedAccounts, Data, Deployments>,
33
- args?: ArgumentsType
34
- ) => callback(env, args);
35
- scriptModule.tags = options.tags;
36
- scriptModule.dependencies = options.dependencies;
37
- scriptModule.id = options.id;
38
- // TODO runAtTheEnd ?
39
- return scriptModule;
53
+ >(functions: Functions, signerProtocols?: Record<string, SignerProtocolFunction>) {
54
+ return function enhancedExecute<ArgumentsType = undefined>(
55
+ callback: EnhancedDeployScriptFunction<NamedAccounts, Data, ArgumentsType, Deployments, Functions>,
56
+ options: {tags?: string[]; dependencies?: string[]; id?: string; runAtTheEnd?: boolean}
57
+ ): DeployScriptModule<NamedAccounts, Data, ArgumentsType, Deployments> {
58
+ const scriptModule: DeployScriptModule<NamedAccounts, Data, ArgumentsType, Deployments> = (
59
+ env: Environment<NamedAccounts, Data, Deployments>,
60
+ args?: ArgumentsType
61
+ ) => {
62
+ if (signerProtocols) {
63
+ for (const key of Object.keys(signerProtocols)) {
64
+ env.registerProtocol(key, signerProtocols[key]);
65
+ }
66
+ }
67
+
68
+ // Create the enhanced environment by combining the original environment with curried functions
69
+ const curriedFunctions = withEnvironment(env, functions);
70
+ const enhancedEnv = Object.assign(
71
+ Object.create(Object.getPrototypeOf(env)),
72
+ env,
73
+ curriedFunctions
74
+ ) as EnhancedEnvironment<NamedAccounts, Data, Deployments, Functions>;
75
+
76
+ return callback(enhancedEnv, args);
77
+ };
78
+
79
+ scriptModule.tags = options.tags;
80
+ scriptModule.dependencies = options.dependencies;
81
+ scriptModule.id = options.id;
82
+ scriptModule.runAtTheEnd = options.runAtTheEnd;
83
+
84
+ return scriptModule;
85
+ };
40
86
  }
41
87
 
42
88
  export type NamedAccountExecuteFunction<
@@ -0,0 +1,133 @@
1
+ import type {Environment} from '../environment/types.js';
2
+ import {setup} from './index.js';
3
+
4
+ // Mock environment for testing
5
+ const mockEnv = {} as Environment;
6
+
7
+ // Example utility functions that take Environment as first parameter
8
+ const utilityFunctions = {
9
+ deployContract: async (env: Environment, contractName: string, args: any[] = []): Promise<string> => {
10
+ console.log(`Deploying ${contractName} with args:`, args);
11
+ return '0x1234567890123456789012345678901234567890';
12
+ },
13
+
14
+ verifyContract: async (env: Environment, address: string): Promise<boolean> => {
15
+ console.log(`Verifying contract at ${address}`);
16
+ return true;
17
+ },
18
+
19
+ getBalance: async (env: Environment, address: string): Promise<bigint> => {
20
+ console.log(`Getting balance for ${address}`);
21
+ return BigInt('1000000000000000000'); // 1 ETH
22
+ },
23
+
24
+ calculateGas: (env: Environment, operation: string): number => {
25
+ console.log(`Calculating gas for ${operation}`);
26
+ return 21000;
27
+ },
28
+
29
+ isDeployed: (env: Environment, contractName: string): boolean => {
30
+ console.log(`Checking if ${contractName} is deployed`);
31
+ return false;
32
+ },
33
+ };
34
+
35
+ // Create the enhanced execute function using setup
36
+ const execute = setup(utilityFunctions);
37
+
38
+ // Test the enhanced execute function
39
+ const testScript = execute(
40
+ async (env, args) => {
41
+ // Type test: env should have both original Environment properties AND curried functions
42
+
43
+ // Test curried functions (no need to pass env)
44
+ const address = await env.deployContract('MyToken', ['TokenName', 'TKN']);
45
+ const isVerified = await env.verifyContract(address);
46
+ const balance = await env.getBalance(address);
47
+ const gasEstimate = env.calculateGas('transfer');
48
+ const deployed = env.isDeployed('MyToken');
49
+
50
+ // Test that original environment properties are still accessible
51
+ // (These would normally be available on a real environment)
52
+ // console.log('Network name:', env.network?.name);
53
+ // console.log('Chain ID:', env.network?.chain?.id);
54
+
55
+ console.log('Test results:', {
56
+ address,
57
+ isVerified,
58
+ balance: balance.toString(),
59
+ gasEstimate,
60
+ deployed,
61
+ });
62
+
63
+ return true; // Return true to indicate successful completion
64
+ },
65
+ {
66
+ tags: ['test'],
67
+ dependencies: [],
68
+ id: 'test-setup-function',
69
+ }
70
+ );
71
+
72
+ // Type tests - these should compile without errors
73
+ async function testTypes() {
74
+ // The script should be a valid DeployScriptModule
75
+ console.log('Script tags:', testScript.tags);
76
+ console.log('Script dependencies:', testScript.dependencies);
77
+ console.log('Script ID:', testScript.id);
78
+
79
+ // The script should be callable with an environment
80
+ try {
81
+ const result = await testScript(mockEnv, undefined);
82
+ console.log('Script execution result:', result);
83
+ } catch (error) {
84
+ console.log('Script execution test completed (expected with mock env)');
85
+ }
86
+ }
87
+
88
+ // Example of how this would be used in a real deployment script
89
+ export const exampleUsage = () => {
90
+ // Define your utility functions
91
+ const myFunctions = {
92
+ deployERC20: async (env: Environment, name: string, symbol: string): Promise<string> => {
93
+ // Implementation would use env.save, env.network.provider, etc.
94
+ return '0x...';
95
+ },
96
+
97
+ setupPermissions: async (env: Environment, contractAddress: string, admin: string): Promise<void> => {
98
+ // Implementation would interact with contracts
99
+ },
100
+
101
+ verifyOnEtherscan: async (env: Environment, address: string, constructorArgs: any[]): Promise<boolean> => {
102
+ // Implementation would call verification service
103
+ return true;
104
+ },
105
+ };
106
+
107
+ // Create the enhanced execute function
108
+ const execute = setup(myFunctions);
109
+
110
+ // Export your deployment script
111
+ return execute(
112
+ async (env, args) => {
113
+ // Now you can use the functions without passing env each time
114
+ const tokenAddress = await env.deployERC20('MyToken', 'MTK');
115
+ await env.setupPermissions(tokenAddress, env.namedAccounts.deployer);
116
+ await env.verifyOnEtherscan(tokenAddress, ['MyToken', 'MTK']);
117
+
118
+ // Original environment is still fully accessible
119
+ console.log(`Deployed on network: ${env.network.name}`);
120
+ const deployment = env.get('MyToken');
121
+
122
+ return true;
123
+ },
124
+ {
125
+ tags: ['token', 'deploy'],
126
+ dependencies: ['setup'],
127
+ id: 'deploy-my-token',
128
+ }
129
+ );
130
+ };
131
+
132
+ // Export for potential use in actual tests
133
+ export {testTypes, testScript, utilityFunctions};
@@ -30,3 +30,48 @@ export type ScriptCallback<
30
30
  Data extends UnresolvedNetworkSpecificData = UnresolvedNetworkSpecificData,
31
31
  Deployments extends UnknownDeployments = UnknownDeployments
32
32
  > = (env: Environment<NamedAccounts, Data, Deployments>) => Promise<void>;
33
+
34
+ /**
35
+ * Utility type to remove the first parameter from a function type
36
+ */
37
+ type RemoveFirstParameter<T> = T extends (first: any, ...rest: infer R) => infer Return
38
+ ? (...args: R) => Return
39
+ : never;
40
+
41
+ /**
42
+ * Utility type to transform an object of functions by removing their first parameter
43
+ */
44
+ type CurriedFunctions<T> = {
45
+ [K in keyof T]: RemoveFirstParameter<T[K]>;
46
+ };
47
+
48
+ /**
49
+ * Type for the enhanced environment proxy that includes both the original environment
50
+ * and the curried functions
51
+ */
52
+ export type EnhancedEnvironment<
53
+ NamedAccounts extends UnresolvedUnknownNamedAccounts = UnresolvedUnknownNamedAccounts,
54
+ Data extends UnresolvedNetworkSpecificData = UnresolvedNetworkSpecificData,
55
+ Deployments extends UnknownDeployments = UnknownDeployments,
56
+ Functions extends Record<
57
+ string,
58
+ (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any
59
+ > = Record<string, (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any>
60
+ > = Environment<NamedAccounts, Data, Deployments> & CurriedFunctions<Functions>;
61
+
62
+ /**
63
+ * Type for a deploy script function that receives an enhanced environment
64
+ */
65
+ export type EnhancedDeployScriptFunction<
66
+ NamedAccounts extends UnresolvedUnknownNamedAccounts = UnresolvedUnknownNamedAccounts,
67
+ Data extends UnresolvedNetworkSpecificData = UnresolvedNetworkSpecificData,
68
+ ArgumentsTypes = undefined,
69
+ Deployments extends UnknownDeployments = UnknownDeployments,
70
+ Functions extends Record<
71
+ string,
72
+ (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any
73
+ > = Record<string, (env: Environment<NamedAccounts, Data, Deployments>, ...args: any[]) => any>
74
+ > = (
75
+ env: EnhancedEnvironment<NamedAccounts, Data, Deployments, Functions>,
76
+ args?: ArgumentsTypes
77
+ ) => Promise<void | boolean>;
package/src/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from './executor/index.js';
2
2
  export * from './executor/types.js';
3
3
  export * from './environment/types.js';
4
- export {extendEnvironment, handleSignerProtocol} from './environment/index.js';
5
4
  export {loadDeployments} from './environment/deployments.js';
6
5
  export * from './environment/utils/artifacts.js';
7
6
  export * from './environment/utils/chains.js';
@@ -1,5 +1,8 @@
1
+ import {SignerProtocol} from '../environment/index.js';
2
+
1
3
  export type InternalEnvironment = {
2
4
  exportDeploymentsAsTypes(): Promise<void>;
3
5
  recoverTransactionsIfAny(): Promise<void>;
4
6
  recordMigration(id: string): void;
7
+ getSignerProtocol(protocol: string): SignerProtocol | undefined;
5
8
  };