Skip to content

Commit

Permalink
Merge pull request #325 from DanielZlotin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
krzkaczor authored Feb 22, 2021
2 parents 2824b63 + 5761302 commit 24c831b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-comics-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@typechain/web3-v1': minor
---

Support passing block number to call functions
12 changes: 9 additions & 3 deletions packages/target-web3-v1-test/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,25 @@ export interface PayableTx extends NonPayableTx {

export interface NonPayableTransactionObject<T> {
arguments: any[];
call(tx?: NonPayableTx): Promise<T>;
call(tx?: NonPayableTx, block?: BlockType): Promise<T>;
send(tx?: NonPayableTx): PromiEvent<TransactionReceipt>;
estimateGas(tx?: NonPayableTx): Promise<number>;
encodeABI(): string;
}

export interface PayableTransactionObject<T> {
arguments: any[];
call(tx?: PayableTx): Promise<T>;
call(tx?: PayableTx, block?: BlockType): Promise<T>;
send(tx?: PayableTx): PromiEvent<TransactionReceipt>;
estimateGas(tx?: PayableTx): Promise<number>;
encodeABI(): string;
}

export type BlockType = "latest" | "pending" | "genesis" | number;
export type BlockType =
| "latest"
| "pending"
| "genesis"
| "earliest"
| number
| BN;
export type BaseContract = Omit<Contract, "clone" | "once">;
6 changes: 3 additions & 3 deletions packages/target-web3-v1/static/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ export interface PayableTx extends NonPayableTx {

export interface NonPayableTransactionObject<T> {
arguments: any[]
call(tx?: NonPayableTx): Promise<T>
call(tx?: NonPayableTx, block?: BlockType): Promise<T>
send(tx?: NonPayableTx): PromiEvent<TransactionReceipt>
estimateGas(tx?: NonPayableTx): Promise<number>
encodeABI(): string
}

export interface PayableTransactionObject<T> {
arguments: any[]
call(tx?: PayableTx): Promise<T>
call(tx?: PayableTx, block?: BlockType): Promise<T>
send(tx?: PayableTx): PromiEvent<TransactionReceipt>
estimateGas(tx?: PayableTx): Promise<number>
encodeABI(): string
}

export type BlockType = 'latest' | 'pending' | 'genesis' | number
export type BlockType = 'latest' | 'pending' | 'genesis' | 'earliest' | number | BN
export type BaseContract = Omit<Contract, 'clone' | 'once'>

0 comments on commit 24c831b

Please sign in to comment.