public class TransferOperation extends Operation
| Modifier and Type | Field and Description |
|---|---|
protected Asset |
amount |
protected AccountName |
from |
protected AccountName |
to |
| Constructor and Description |
|---|
TransferOperation(AccountName from,
AccountName to,
Asset amount,
Asset fee,
String memo)
Create a new transfer operation.Use this operation to transfer an asset
from one account to another.
|
| Modifier and Type | Method and Description |
|---|---|
Asset |
getAmount()
Get the
amount of that has been send. |
Asset |
getFee() |
AccountName |
getFrom()
Get the account name of the user who transfered the
amount. |
String |
getMemo()
Get the message added to this operation.
|
Map<SignatureObject,PrivateKeyType> |
getRequiredAuthorities(Map<SignatureObject,PrivateKeyType> requiredAuthoritiesBase)
Add the authorities which are required to sign this operation to an
existing map.
|
AccountName |
getTo()
Get the account name of the user who received the
amount. |
void |
setAmount(Asset amount)
Set the
amount of that will be send. |
void |
setFee(Asset fee) |
void |
setFrom(AccountName from)
Set the account name of the user who transfers the
amount. |
void |
setMemo(String memo)
Add an additional message to this operation.
|
void |
setTo(AccountName to)
Set the account name of the user who will received the
amount. |
byte[] |
toByteArray()
Covert the operation into a byte array.
|
String |
toString() |
void |
validate(ValidationType validationType)
Use this method to verify that this object is valid.
|
isVirtual, mergeRequiredAuthorities, mergeRequiredAuthoritiesprotected AccountName from
protected AccountName to
protected Asset amount
public TransferOperation(AccountName from, AccountName to, Asset amount, Asset fee, String memo)
from - The account to transfer the vestings from (see
setFrom(AccountName)).to - The account that will receive the transfered vestings (see
setTo(AccountName)).amount - The amount of vests to transfer (see
setAmount(Asset)).fee - The fee of transaction.memo - An additional message added to the operation (see
setMemo(String)).InvalidParameterException - If one of the arguments does not fulfill the requirements.public void setAmount(Asset amount)
amount of that will be send.amount - The amount of that will be send.InvalidParameterException - If the amount is null, of symbol type M or
less than 1.public String getMemo()
public void setMemo(String memo)
memo - The message added to this operation.InvalidParameterException - If the memo has more than 2048 characters.public byte[] toByteArray()
throws BeowulfInvalidTransactionException
ByteTransformableBeowulfInvalidTransactionException - If there was a problem while transforming the transaction
into a byte array.public void validate(ValidationType validationType)
Validatablevalidate in interface ValidatablevalidationType - An indicator telling the method what should be validated.public AccountName getFrom()
amount.amount.public void setFrom(AccountName from)
amount.
Notice: The private active key of this account needs to be stored
in the key storage.from - The account name of the user who will transfer the
amount.InvalidParameterException - If the from account is null.public AccountName getTo()
amount.amount.public void setTo(AccountName to)
amount.to - The account name of the user who will received the
amount.InvalidParameterException - If the to account is null.public Asset getAmount()
amount of that has been send.amount of that has been send.public Asset getFee()
public void setFee(Asset fee)
public Map<SignatureObject,PrivateKeyType> getRequiredAuthorities(Map<SignatureObject,PrivateKeyType> requiredAuthoritiesBase)
OperationgetRequiredAuthorities in class OperationrequiredAuthoritiesBase - A map to which the required authorities of this operation
should be added to.Copyright © 2019. All rights reserved.