Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ConstructorArgs type #72

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": [],
"privatePackages": {
"version": false
}
}
7 changes: 7 additions & 0 deletions .changeset/funny-masks-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@delvtech/evm-client-ethers": patch
"@delvtech/evm-client-viem": patch
"@delvtech/evm-client": patch
---

Added `ConstructorArgs` type
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions packages/evm-client-ethers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type {
AbiParameters,
CachedReadContract,
CachedReadWriteContract,
ConstructorArgs,
ContractDecodeFunctionDataArgs,
ContractEncodeFunctionDataArgs,
ContractGetEventsArgs,
Expand Down
1 change: 1 addition & 0 deletions packages/evm-client-viem/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type {
AbiParameters,
CachedReadContract,
CachedReadWriteContract,
ConstructorArgs,
ContractDecodeFunctionDataArgs,
ContractEncodeFunctionDataArgs,
ContractGetEventsArgs,
Expand Down
10 changes: 10 additions & 0 deletions packages/evm-client/src/contract/types/Function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ export type FunctionArgs<
TFunctionName extends FunctionName<TAbi> = FunctionName<TAbi>,
> = AbiObjectType<TAbi, 'function', TFunctionName, 'inputs'>;

/**
* Get an object type for an abi's constructor arguments.
*/
export type ConstructorArgs<TAbi extends Abi> = AbiObjectType<
TAbi,
'constructor',
any,
'inputs'
>;

/**
* Get a user-friendly return type for an abi function, which is determined by
* it's outputs:
Expand Down
1 change: 1 addition & 0 deletions packages/evm-client/src/exports/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export type {
EventName,
} from 'src/contract/types/Event';
export type {
ConstructorArgs,
DecodedFunctionData,
FunctionArgs,
FunctionName,
Expand Down
Loading