From 8ae4bb38e8104701ab344b323537764f6eab3c12 Mon Sep 17 00:00:00 2001 From: Vladislav Shabanov Date: Sat, 30 Mar 2019 23:14:01 +0700 Subject: [PATCH] Add index to Wallet --- packages/web3-eth-accounts/types/index.d.ts | 2 ++ packages/web3-eth-accounts/types/tests/accounts-tests.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/packages/web3-eth-accounts/types/index.d.ts b/packages/web3-eth-accounts/types/index.d.ts index 46951aaee0d..87dd1fb7ea7 100644 --- a/packages/web3-eth-accounts/types/index.d.ts +++ b/packages/web3-eth-accounts/types/index.d.ts @@ -54,6 +54,8 @@ export class Wallet { length: number; defaultKeyName: string; + [key: number]: Account; + create(numberOfAccounts: number, entropy?: string): Wallet; add(account: string | AddAccount): AddedAccount; diff --git a/packages/web3-eth-accounts/types/tests/accounts-tests.ts b/packages/web3-eth-accounts/types/tests/accounts-tests.ts index ae5e1a7b56b..54487abb407 100644 --- a/packages/web3-eth-accounts/types/tests/accounts-tests.ts +++ b/packages/web3-eth-accounts/types/tests/accounts-tests.ts @@ -112,6 +112,9 @@ accounts.decrypt( // $ExpectType Wallet accounts.wallet.create(2); +// $ExpectType Account +accounts.wallet[0]; + // $ExpectType Wallet accounts.wallet.create(2, '54674321§3456764321§345674321§3453647544±±±§±±±!!!43534534534534');