Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Callback type for Accounts.signTransaction fixed #3280

Merged
merged 2 commits into from
Dec 19, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ Released with 1.0.0-beta.37 code base.
- Fix minified bundle (#3256)
- ``defaultBlock`` property handling fixed (#3247)
- ``clearSubscriptions`` does no longer throw an error if no running subscriptions do exist (#3246)
- callback type definition for ``Accounts.signTransaction`` fixed (#3280)
2 changes: 1 addition & 1 deletion packages/web3-core/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class AccountsBase {
signTransaction(
transactionConfig: TransactionConfig,
privateKey: string,
callback?: () => void
callback?: (error: Error, signedTransaction: SignedTransaction) => void
): Promise<SignedTransaction>;

recoverTransaction(signature: string): string;
Expand Down
2 changes: 2 additions & 0 deletions packages/web3-eth-accounts/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import { AccountsBase, SignedTransaction, WalletBase } from 'web3-core';

export {SignedTransaction} from 'web3-core';

export class Accounts extends AccountsBase {}

export class Wallet extends WalletBase {}
Expand Down
4 changes: 2 additions & 2 deletions packages/web3-eth-accounts/types/tests/accounts-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @author Josh Stevens <joshstevens19@hotmail.co.uk>
* @date 2018
*/
import { Accounts } from 'web3-eth-accounts';
import { Accounts, SignedTransaction } from 'web3-eth-accounts';

// $ExpectType Accounts
const accounts_empty = new Accounts();
Expand Down Expand Up @@ -63,7 +63,7 @@ accounts.signTransaction(
gas: 2000000
},
'0x4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318',
() => {
(error: Error, signedTransaction: SignedTransaction) => {
console.log('hey');
}
);
Expand Down