-
Notifications
You must be signed in to change notification settings - Fork 7
/
TransactionApi.java
163 lines (144 loc) · 4.07 KB
/
TransactionApi.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
* @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.Aer;
import hera.api.model.BytesValue;
import hera.api.model.ContractAddress;
import hera.api.model.ContractDefinition;
import hera.api.model.ContractInvocation;
import hera.api.model.ContractTxHash;
import hera.api.model.Fee;
import hera.api.model.RawTransaction;
import hera.api.model.Transaction;
import hera.api.model.TxHash;
import java.util.List;
@ApiAudience.Public
@ApiStability.Unstable
public interface TransactionApi {
/**
* Create name info of a current account.
*
* @param name an new name
* @return a create name transaction hash
*/
TxHash createName(String name);
/**
* Update name info of to an new owner.
*
* @param name an already binded name
* @param newOwner an new owner of name
* @return a update name transaction hash
*/
TxHash updateName(String name, AccountAddress newOwner);
/**
* Staking an account with amount of a current account.
*
* @param amount an amount to stake
* @return a staking transaction hash
*/
TxHash stake(Aer amount);
/**
* Unstaking an account with amount of a current account.
*
* @param amount an amount to stake
* @return a staking transaction hash
*/
TxHash unstake(Aer amount);
/**
* Vote to bp {@code candidates}.
*
* @param candidates a candidates to vote
* @return voting transaction hash
*/
TxHash voteBp(List<String> candidates);
/**
* Vote to {@code candidates} with {@code voteId}.
*
* @param voteId a vote id
* @param candidates a candidates to vote
* @return voting transaction hash
*/
TxHash vote(String voteId, List<String> candidates);
/**
* Send <b>aer</b> with {@code fee}.
*
* @param recipient a recipient name
* @param amount an amount
* @param fee a fee
* @return a send transaction hash
*/
TxHash send(String recipient, Aer amount, Fee fee);
/**
* Send <b>aer</b> with {@code fee} and {@code payload}.
*
* @param recipient a recipient name
* @param amount an amount
* @param fee a fee
* @param payload a payload
* @return a send transaction hash
*/
TxHash send(String recipient, Aer amount, Fee fee, BytesValue payload);
/**
* Send <b>aer</b> with {@code fee}.
*
* @param recipient a recipient
* @param amount an amount
* @param fee a fee
* @return a send transaction hash
*/
TxHash send(AccountAddress recipient, Aer amount, Fee fee);
/**
* Send <b>aer</b> with {@code fee} and {@code payload}.
*
* @param recipient a recipient
* @param amount an amount
* @param fee a fee
* @param payload a payload
* @return a send transaction hash
*/
TxHash send(AccountAddress recipient, Aer amount, Fee fee, BytesValue payload);
/**
* Sign and commit transaction.
*
* @param rawTransaction a raw transaction
* @return a transaction hash
*/
TxHash commit(RawTransaction rawTransaction);
/**
* Commit a signed transaction.
*
* @param signedTransaction a signed transaction
* @return a transaction hash
*/
TxHash commit(Transaction signedTransaction);
/**
* Deploy smart contract.
*
* @param contractDefinition a contract definition
* @param fee a fee
* @return a contract transaction hash
*/
ContractTxHash deploy(ContractDefinition contractDefinition, Fee fee);
/**
* Re-deploy a deployed smart smart contract. This works enterprise aergo only.
*
* @param existingContract an existing contract address
* @param contractDefinition a contract definition to re-deploy
* @param fee a fee
* @return a contract transaction hash
*/
ContractTxHash redeploy(ContractAddress existingContract, ContractDefinition contractDefinition,
Fee fee);
/**
* Execute a smart contract function.
*
* @param contractInvocation a contract invocation
* @param fee a fee
* @return a contract transaction hash
*/
ContractTxHash execute(ContractInvocation contractInvocation, Fee fee);
}