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 missing promievent handlers - closes #4194 #4336

Merged
merged 11 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 8 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,10 @@ Released with 1.0.0-beta.37 code base.
- lerna from 3.22.1 to 4.0.0 (#4231)
- Dropped build tests in CI for Node v8 and v10, and added support for Node v14
- Change default value for `maxPriorityFeePerGas` from `1 Gwei` to `2.5 Gwei` (#4284)
- Added missing PromiEvent handler types (#4194)
- Introduced new configuration "blockHeaderTimeout" for waiting of block headers for transaction receipt (#3891)
- Fixed bug in signTransaction (#4295)
- Format `block.baseFeePerGas` to number (#4330)
- Introduced new configuration "blockHeaderTimeout" for waiting of block headers for transaction receipt (#3891)

## [Unreleased]

Expand Down
18 changes: 14 additions & 4 deletions packages/web3-core/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,18 @@ export interface PromiEvent<T> extends Promise<T> {
once(type: 'error', handler: (error: Error) => void): PromiEvent<T>;

once(
type: 'error' | 'confirmation' | 'receipt' | 'transactionHash',
handler: (error: Error | TransactionReceipt | string) => void
type: 'error' | 'confirmation' | 'receipt' | 'transactionHash' | 'sent' | 'sending',
handler: (error: Error | TransactionReceipt | string | object) => void
): PromiEvent<T>;

on(
type: 'sending',
handler: (payload: object) => void
): PromiEvent<T>;

on(
type: 'sent',
handler: (payload: object) => void
): PromiEvent<T>;

on(
Expand All @@ -109,8 +119,8 @@ export interface PromiEvent<T> extends Promise<T> {
on(type: 'error', handler: (error: Error) => void): PromiEvent<T>;

on(
type: 'error' | 'confirmation' | 'receipt' | 'transactionHash',
handler: (error: Error | TransactionReceipt | string) => void
type: 'error' | 'confirmation' | 'receipt' | 'transactionHash' | 'sent' | 'sending',
handler: (error: Error | TransactionReceipt | string | object) => void
): PromiEvent<T>;
}

Expand Down