diff --git a/.changeset/twelve-comics-bow.md b/.changeset/twelve-comics-bow.md new file mode 100644 index 000000000..59332fe3e --- /dev/null +++ b/.changeset/twelve-comics-bow.md @@ -0,0 +1,5 @@ +--- +'@typechain/web3-v1': minor +--- + +Support passing block number to call functions diff --git a/packages/target-web3-v1-test/types/types.d.ts b/packages/target-web3-v1-test/types/types.d.ts index 703bddc91..ac0662a0d 100644 --- a/packages/target-web3-v1-test/types/types.d.ts +++ b/packages/target-web3-v1-test/types/types.d.ts @@ -47,7 +47,7 @@ export interface PayableTx extends NonPayableTx { export interface NonPayableTransactionObject { arguments: any[]; - call(tx?: NonPayableTx): Promise; + call(tx?: NonPayableTx, block?: BlockType): Promise; send(tx?: NonPayableTx): PromiEvent; estimateGas(tx?: NonPayableTx): Promise; encodeABI(): string; @@ -55,11 +55,17 @@ export interface NonPayableTransactionObject { export interface PayableTransactionObject { arguments: any[]; - call(tx?: PayableTx): Promise; + call(tx?: PayableTx, block?: BlockType): Promise; send(tx?: PayableTx): PromiEvent; estimateGas(tx?: PayableTx): Promise; encodeABI(): string; } -export type BlockType = "latest" | "pending" | "genesis" | number; +export type BlockType = + | "latest" + | "pending" + | "genesis" + | "earliest" + | number + | BN; export type BaseContract = Omit; diff --git a/packages/target-web3-v1/static/types.d.ts b/packages/target-web3-v1/static/types.d.ts index 579ee4ee1..bde5a71af 100644 --- a/packages/target-web3-v1/static/types.d.ts +++ b/packages/target-web3-v1/static/types.d.ts @@ -41,7 +41,7 @@ export interface PayableTx extends NonPayableTx { export interface NonPayableTransactionObject { arguments: any[] - call(tx?: NonPayableTx): Promise + call(tx?: NonPayableTx, block?: BlockType): Promise send(tx?: NonPayableTx): PromiEvent estimateGas(tx?: NonPayableTx): Promise encodeABI(): string @@ -49,11 +49,11 @@ export interface NonPayableTransactionObject { export interface PayableTransactionObject { arguments: any[] - call(tx?: PayableTx): Promise + call(tx?: PayableTx, block?: BlockType): Promise send(tx?: PayableTx): PromiEvent estimateGas(tx?: PayableTx): Promise encodeABI(): string } -export type BlockType = 'latest' | 'pending' | 'genesis' | number +export type BlockType = 'latest' | 'pending' | 'genesis' | 'earliest' | number | BN export type BaseContract = Omit