From 9d60e4e7d42ac2c3b7a14dfbd8cd3a7daec68aa4 Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Wed, 15 May 2024 12:15:15 -0500 Subject: [PATCH 1/3] Add ConstructorArgs type --- packages/evm-client-ethers/src/index.ts | 1 + packages/evm-client-viem/src/index.ts | 1 + packages/evm-client/src/contract/types/Function.ts | 10 ++++++++++ packages/evm-client/src/exports/contract.ts | 1 + 4 files changed, 13 insertions(+) diff --git a/packages/evm-client-ethers/src/index.ts b/packages/evm-client-ethers/src/index.ts index 28e58641..711e5d47 100644 --- a/packages/evm-client-ethers/src/index.ts +++ b/packages/evm-client-ethers/src/index.ts @@ -38,6 +38,7 @@ export type { AbiParameters, CachedReadContract, CachedReadWriteContract, + ConstructorArgs, ContractDecodeFunctionDataArgs, ContractEncodeFunctionDataArgs, ContractGetEventsArgs, diff --git a/packages/evm-client-viem/src/index.ts b/packages/evm-client-viem/src/index.ts index 8a4d0ecc..6de2a8aa 100644 --- a/packages/evm-client-viem/src/index.ts +++ b/packages/evm-client-viem/src/index.ts @@ -38,6 +38,7 @@ export type { AbiParameters, CachedReadContract, CachedReadWriteContract, + ConstructorArgs, ContractDecodeFunctionDataArgs, ContractEncodeFunctionDataArgs, ContractGetEventsArgs, diff --git a/packages/evm-client/src/contract/types/Function.ts b/packages/evm-client/src/contract/types/Function.ts index d8f51a24..ce8309df 100644 --- a/packages/evm-client/src/contract/types/Function.ts +++ b/packages/evm-client/src/contract/types/Function.ts @@ -20,6 +20,16 @@ export type FunctionArgs< TFunctionName extends FunctionName = FunctionName, > = AbiObjectType; +/** + * Get an object type for an abi's constructor arguments. + */ +export type ConstructorArgs = AbiObjectType< + TAbi, + 'constructor', + any, + 'inputs' +>; + /** * Get a user-friendly return type for an abi function, which is determined by * it's outputs: diff --git a/packages/evm-client/src/exports/contract.ts b/packages/evm-client/src/exports/contract.ts index 9a42ded7..5fb3411c 100644 --- a/packages/evm-client/src/exports/contract.ts +++ b/packages/evm-client/src/exports/contract.ts @@ -40,6 +40,7 @@ export type { EventName, } from 'src/contract/types/Event'; export type { + ConstructorArgs, DecodedFunctionData, FunctionArgs, FunctionName, From 0c634055fd31b607af934a32f88ba242233caca5 Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Wed, 15 May 2024 12:16:51 -0500 Subject: [PATCH 2/3] Add changeset --- .changeset/config.json | 5 ++++- .changeset/funny-masks-care.md | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/funny-masks-care.md diff --git a/.changeset/config.json b/.changeset/config.json index 91b6a951..ba53c998 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,5 +7,8 @@ "access": "restricted", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": [], + "privatePackages": { + "version": false + } } diff --git a/.changeset/funny-masks-care.md b/.changeset/funny-masks-care.md new file mode 100644 index 00000000..009dd733 --- /dev/null +++ b/.changeset/funny-masks-care.md @@ -0,0 +1,7 @@ +--- +"@delvtech/evm-client-ethers": patch +"@delvtech/evm-client-viem": patch +"@delvtech/evm-client": patch +--- + +Added `ConstructorArgs` type From 034a897adb96c7039904aec960384330d4fe3fe1 Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Wed, 15 May 2024 12:30:36 -0500 Subject: [PATCH 3/3] Fix typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3c6ca0bf..380f438f 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ library agnostic. ## Creating a release This repo uses [changesets](https://github.com/changesets/changesets) to manage -versioning and changelogs. This means you shouldn't need to manually change of -the internal package versions. +versioning and changelogs. This means you shouldn't need to manually change any +of the internal package versions. Before opening a PR, run `yarn changeset` and follow the prompts to describe the changes you've made. This will create a changeset file that should be committed.