@leofcoin/endpoint-clients 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/exports/direct.js CHANGED
@@ -23,10 +23,15 @@ class Client {
23
23
  return format ? formatUnits(balance) : balance;
24
24
  }
25
25
  selectedAccount() {
26
- return chain.selectedAccount;
26
+ return peernet.selectedAccount;
27
27
  }
28
- selectAccount(address) {
29
- return chain.selectAccount({ address });
28
+ async selectAccount(address) {
29
+ try {
30
+ await walletStore.put('selected-account', address);
31
+ }
32
+ catch (error) {
33
+ throw new Error(`couldn't set selected account`);
34
+ }
30
35
  }
31
36
  accounts() {
32
37
  return chain.accounts;
@@ -10,7 +10,7 @@ export default class Client {
10
10
  balances(): any;
11
11
  balanceOf(address: string, format: boolean): Promise<any>;
12
12
  selectedAccount(): any;
13
- selectAccount(address: any): any;
13
+ selectAccount(address: any): Promise<void>;
14
14
  accounts(): any;
15
15
  hasTransactionToHandle(): any;
16
16
  getBlock(index: number): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/endpoint-clients",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
package/src/direct.ts CHANGED
@@ -33,11 +33,15 @@ export default class Client {
33
33
  }
34
34
 
35
35
  selectedAccount() {
36
- return chain.selectedAccount
36
+ return peernet.selectedAccount
37
37
  }
38
38
 
39
- selectAccount(address: any) {
40
- return chain.selectAccount({address})
39
+ async selectAccount(address: any) {
40
+ try {
41
+ await walletStore.put('selected-account', address)
42
+ } catch (error) {
43
+ throw new Error(`couldn't set selected account`)
44
+ }
41
45
  }
42
46
 
43
47
  accounts() {