@ApiAudience.Private @ApiStability.Unstable public class AccountTemplate extends java.lang.Object implements AccountOperation, ChannelInjectable, ContextProviderInjectable
Modifier and Type | Field and Description |
---|---|
protected AccountBaseTemplate |
accountBaseTemplate |
protected ContextProvider |
contextProvider |
protected ExceptionConverter<RpcException> |
exceptionConverter |
Constructor and Description |
---|
AccountTemplate() |
Modifier and Type | Method and Description |
---|---|
TxHash |
createName(Account account,
java.lang.String name,
long nonce)
Use
AccountOperation.createName(Signer, String, long) instead. |
TxHash |
createName(Signer signer,
java.lang.String name,
long nonce)
Create name info of an account.
|
AccountAddress |
getNameOwner(java.lang.String name)
Get owner of an account name.
|
AccountAddress |
getNameOwner(java.lang.String name,
long blockNumber)
Get owner of an account name at block
blockNumber . |
StakeInfo |
getStakingInfo(AccountAddress accountAddress)
Get staking information of
accountAddress . |
AccountState |
getState(Account account)
Use
AccountOperation.getState(AccountAddress) instead. |
AccountState |
getState(AccountAddress address)
Get account state by address.
|
AccountTotalVote |
getVotesOf(AccountAddress accountAddress)
Get votes which
accountAddress votes for. |
java.util.List<ElectedCandidate> |
listElected(java.lang.String voteId,
int showCount)
Get elected candidates per
voteId for current round. |
void |
setChannel(io.grpc.ManagedChannel channel) |
void |
setContextProvider(ContextProvider contextProvider) |
Transaction |
sign(Account account,
RawTransaction rawTransaction)
Use
Signer.sign(RawTransaction) instead. |
TxHash |
stake(Account account,
Aer amount,
long nonce)
Use
AccountOperation.stake(Signer, Aer, long) instead. |
TxHash |
stake(Signer signer,
Aer amount,
long nonce)
Staking an account with amount.
|
TxHash |
unstake(Account account,
Aer amount,
long nonce)
Use
AccountOperation.unstake(Signer, Aer, long) instead. |
TxHash |
unstake(Signer signer,
Aer amount,
long nonce)
Unstaking an account with amount.
|
TxHash |
updateName(Account account,
java.lang.String name,
AccountAddress newOwner,
long nonce)
|
TxHash |
updateName(Signer signer,
java.lang.String name,
AccountAddress newOwner,
long nonce)
Update name info of an account.
|
boolean |
verify(Account account,
Transaction signedTransaction)
Use
AergoSignVerifier.verify(Transaction) instead. |
TxHash |
vote(Signer signer,
java.lang.String voteId,
java.util.List<java.lang.String> candidates,
long nonce)
Vote to
candidates with corresponding voteId . |
protected final ExceptionConverter<RpcException> exceptionConverter
protected AccountBaseTemplate accountBaseTemplate
protected ContextProvider contextProvider
public void setChannel(io.grpc.ManagedChannel channel)
setChannel
in interface ChannelInjectable
public void setContextProvider(ContextProvider contextProvider)
setContextProvider
in interface ContextProviderInjectable
public AccountState getState(Account account)
AccountOperation
AccountOperation.getState(AccountAddress)
instead.getState
in interface AccountOperation
account
- an accountpublic AccountState getState(AccountAddress address)
AccountOperation
getState
in interface AccountOperation
address
- an account addresspublic TxHash createName(Account account, java.lang.String name, long nonce)
AccountOperation
AccountOperation.createName(Signer, String, long)
instead.createName
in interface AccountOperation
account
- an accountname
- an new namenonce
- an nonce which is used in a transactionpublic TxHash createName(Signer signer, java.lang.String name, long nonce)
AccountOperation
signer
.createName
in interface AccountOperation
signer
- a signername
- an new namenonce
- an nonce which is used in a transactionpublic TxHash updateName(Account account, java.lang.String name, AccountAddress newOwner, long nonce)
AccountOperation
updateName
in interface AccountOperation
account
- an accountname
- an already binded namenewOwner
- an new owner of namenonce
- an nonce which is used in a transactionpublic TxHash updateName(Signer signer, java.lang.String name, AccountAddress newOwner, long nonce)
AccountOperation
name
.updateName
in interface AccountOperation
signer
- a signername
- an already binded namenewOwner
- an new owner of namenonce
- an nonce which is used in a transactionpublic AccountAddress getNameOwner(java.lang.String name)
AccountOperation
getNameOwner
in interface AccountOperation
name
- an name of accountpublic AccountAddress getNameOwner(java.lang.String name, long blockNumber)
AccountOperation
blockNumber
.getNameOwner
in interface AccountOperation
name
- an name of accountblockNumber
- a block numberpublic TxHash stake(Account account, Aer amount, long nonce)
AccountOperation
AccountOperation.stake(Signer, Aer, long)
instead.stake
in interface AccountOperation
account
- an accountamount
- an amount to stakenonce
- an nonce which is used in a transactionpublic TxHash stake(Signer signer, Aer amount, long nonce)
AccountOperation
amount
will be staked by signer
.stake
in interface AccountOperation
signer
- a signeramount
- an amount to stakenonce
- an nonce which is used in a transactionpublic TxHash unstake(Account account, Aer amount, long nonce)
AccountOperation
AccountOperation.unstake(Signer, Aer, long)
instead.unstake
in interface AccountOperation
account
- an accountamount
- an amount to stakenonce
- an nonce which is used in a transactionpublic TxHash unstake(Signer signer, Aer amount, long nonce)
AccountOperation
unstake
in interface AccountOperation
signer
- a signeramount
- an amount to stakenonce
- an nonce which is used in a transactionpublic StakeInfo getStakingInfo(AccountAddress accountAddress)
AccountOperation
accountAddress
.getStakingInfo
in interface AccountOperation
accountAddress
- an account address to check staking informationpublic Transaction sign(Account account, RawTransaction rawTransaction)
AccountOperation
Signer.sign(RawTransaction)
instead.sign
in interface AccountOperation
account
- an account to signrawTransaction
- a raw transaction to signpublic boolean verify(Account account, Transaction signedTransaction)
AccountOperation
AergoSignVerifier.verify(Transaction)
instead.verify
in interface AccountOperation
account
- an account to verifysignedTransaction
- a signed transaction to verifypublic TxHash vote(Signer signer, java.lang.String voteId, java.util.List<java.lang.String> candidates, long nonce)
AccountOperation
candidates
with corresponding voteId
. Pre-defined vote id is
followings:
signer
must have staked aergo.vote
in interface AccountOperation
signer
- a signervoteId
- a vote idcandidates
- a candidatesnonce
- an nonce which is used in a transactionpublic java.util.List<ElectedCandidate> listElected(java.lang.String voteId, int showCount)
AccountOperation
voteId
for current round.listElected
in interface AccountOperation
voteId
- a vote idshowCount
- a show countpublic AccountTotalVote getVotesOf(AccountAddress accountAddress)
AccountOperation
accountAddress
votes for.getVotesOf
in interface AccountOperation
accountAddress
- an account address