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 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. 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,