-
Notifications
You must be signed in to change notification settings - Fork 7
/
WalletApi.java
78 lines (68 loc) · 1.62 KB
/
WalletApi.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* @copyright defined in LICENSE.txt
*/
package hera.wallet;
import hera.annotation.ApiAudience;
import hera.annotation.ApiStability;
import hera.api.model.AccountAddress;
import hera.api.model.Authentication;
import hera.client.AergoClient;
import hera.exception.WalletException;
import hera.key.Signer;
/**
* A wallet api holding single identity. It interact with {@link hera.keystore.KeyStore}. Has a
* signing role.
*
* @author taeiklim
*
*/
@ApiAudience.Public
@ApiStability.Unstable
public interface WalletApi extends Signer {
/**
* Get an principal of current wallet. null if not binded.
*
* @return an principal of current wallet. null if not binded
*/
AccountAddress getPrincipal();
/**
* Bind an aergo client to use.
*
* @param aergoClient an aergo client
*/
void bind(AergoClient aergoClient);
/**
* Unlock an account and bind it to wallet api.
*
* @param authentication an authentication to unlock account
* @return an unlock result
*
* @throws WalletException on wallet error
*/
boolean unlock(Authentication authentication);
/**
* Lock an account.
*
* @param authentication an authentication to lock account binded to wallet api
* @return a lock result
*
* @throws WalletException on wallet error
*/
boolean lock(Authentication authentication);
/**
* Get transaction api.
*
* @return a transaction api
*
* @throws WalletException on wallet error
*/
TransactionApi transactionApi();
/**
* Get query api.
*
* @return a query api
*
* @throws WalletException on wallet error
*/
QueryApi queryApi();
}