public class BeowulfJ extends Object
| Modifier and Type | Method and Description |
|---|---|
static Asset |
beowulfToWd(Price price,
Asset beowulfAsset) |
void |
broadcastBlock(SignedBlock signedBlock)
Broadcast a whole block.
|
TransactionId |
broadcastTransaction(SignedTransaction transaction)
Broadcast a transaction on the Beowulf blockchain.
|
BroadcastTransactionSynchronousReturn |
broadcastTransactionSynchronous(SignedTransaction transaction)
Broadcast a transaction on the Beowulf blockchain.
|
AccountCreateOperation |
createAccount(AccountName creator,
Asset fee,
AccountName newAccount,
Authority owner,
String jsonMetadata) |
List<FindSmtTokenByName> |
findSmtTokenByName(List<String> names) |
long |
getAccountCount()
Get the current number of registered Beowulf accounts.
|
List<AccountHistoryReturn> |
getAccountHistory(AccountName accountName,
org.joou.ULong start,
org.joou.UInteger limit)
Deprecated.
|
List<ExtendedAccount> |
getAccounts(List<AccountName> accountNames) |
List<AccountName> |
getActiveSupernodes()
Get the list of the current active supernodes.
|
Asset |
getBalance(AccountName accountName,
AssetInfo assetInfo) |
Block |
getBlock(long blockNumber)
Get a full, signed block by providing its
blockNumber. |
BlockHeader |
getBlockHeader(long blockNumber)
Like
getBlock(long), but will only return the header of the
requested block instead of the full, signed one. |
Config |
getConfig() |
DynamicGlobalProperty |
getDynamicGlobalProperties()
Get the global properties.
|
static BeowulfJ |
getInstance() |
List<String> |
getKeyReferences(List<PublicKey> publicKeys)
Search for users under the use of their public key(s).
|
static BeowulfJ |
getNewInstance() |
ScheduledHardfork |
getNextScheduledHarfork()
TODO: Check what this method is supposed to do.
|
static org.apache.commons.lang3.tuple.ImmutablePair<PublicKey,String> |
getPrivateKeyFromPassword(AccountName account,
PrivateKeyType role,
String beowulfPassword)
Get the private and public key of a given type for the given
account |
Supernode |
getSupernodeByAccount(AccountName supernodeName)
Get the supernode information for a given supernode account name.
|
int |
getSupernodeCount()
Get the current number of active supernodes.
|
List<Supernode> |
getSupernodes()
Get all supernodes.
|
List<Supernode> |
getSupernodesByVote(AccountName supernodeName,
int limit,
int vestingShare)
Get a list of supernodes sorted by the amount of votes.
|
SupernodeSchedule |
getSupernodeSchedule()
Get the supernode schedule.
|
CompletedTransaction |
getTransactionDetail(String trx_id)
Use the Beowulf API to receive the HEX representation of a signed
transaction.
|
String |
getTransactionHex(SignedTransaction signedTransaction)
Use the Beowulf API to receive the HEX representation of a signed
transaction.
|
List<String> |
lookupAccounts(String pattern,
int limit)
Search for accounts.
|
List<String> |
lookupSupernodeAccounts(String pattern,
int limit)
Search for supernode accounts.
|
TransactionId |
signAndBroadcast(List<Operation> operations) |
BroadcastTransactionSynchronousReturn |
signAndBroadcastSynchronous(List<Operation> operations) |
TransactionId |
signAndBroadcastWithExtension(List<Operation> operations,
List<FutureExtensions> extensions) |
SmtCreateOperation |
smtCreate(AccountName controlAccount,
AccountName creator,
AssetInfo assetInfo,
Asset smtCreationFee,
long maxSupply) |
TransferOperation |
transfer(AccountName from,
AccountName to,
Asset amount,
Asset fee,
String memo)
Transfer currency from specified account to recipient.
|
boolean |
verifyAuthority(SignedTransaction signedTransaction)
Use the Beowulf API to verify the required authorities for this
transaction.
|
static Asset |
wdToBeowulf(Price price,
Asset wdAsset) |
public static BeowulfJ getInstance() throws BeowulfCommunicationException
BeowulfCommunicationExceptionpublic static BeowulfJ getNewInstance() throws BeowulfCommunicationException
BeowulfCommunicationExceptionpublic static org.apache.commons.lang3.tuple.ImmutablePair<PublicKey,String> getPrivateKeyFromPassword(AccountName account, PrivateKeyType role, String beowulfPassword)
accountaccount - The account name to generate the passwords for.role - The key type that should be generated.beowulfPassword - The password of the account valid for the Beowulf
blockchain.public List<String> getKeyReferences(List<PublicKey> publicKeys) throws BeowulfCommunicationException, BeowulfResponseException
publicKeys - An array containing one or more public keys.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - @Deprecated public List<AccountHistoryReturn> getAccountHistory(AccountName accountName, org.joou.ULong start, org.joou.UInteger limit) throws BeowulfCommunicationException, BeowulfResponseException
accountName - The user name of the account.start - The starting point.limit - The maximum number of entries.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public Block getBlock(long blockNumber) throws BeowulfCommunicationException, BeowulfResponseException
blockNumber. The
returned object contains all information related to the block (e.g.
processed transactions, the supernode and the creation time).blockNumber - Height of the block to be returned.null if no
matching block was found.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public BlockHeader getBlockHeader(long blockNumber) throws BeowulfCommunicationException, BeowulfResponseException
getBlock(long), but will only return the header of the
requested block instead of the full, signed one.blockNumber - Height of the block to be returned.null if no
matching block was found.BeowulfCommunicationException - setResponseTimeout ).BeowulfResponseException - public TransactionId broadcastTransaction(SignedTransaction transaction) throws BeowulfCommunicationException, BeowulfResponseException, BeowulfInvalidTransactionException
broadcastTransactionSynchronous(SignedTransaction) method.transaction - The SignedTransaction object to broadcast.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - BeowulfInvalidTransactionException - In case the provided transaction is not valid.public BroadcastTransactionSynchronousReturn broadcastTransactionSynchronous(SignedTransaction transaction) throws BeowulfCommunicationException, BeowulfResponseException, BeowulfInvalidTransactionException
transaction - The SignedTransaction object to broadcast.BroadcastTransactionSynchronousReturn object providing
information about the block in which the transaction has been
applied.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - BeowulfInvalidTransactionException - In case the provided transaction is not valid.public void broadcastBlock(SignedBlock signedBlock) throws BeowulfCommunicationException, BeowulfResponseException
signedBlock - The SignedBlock object to broadcast.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public List<AccountName> getActiveSupernodes() throws BeowulfCommunicationException, BeowulfResponseException
BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public DynamicGlobalProperty getDynamicGlobalProperties() throws BeowulfCommunicationException, BeowulfResponseException
BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public Config getConfig() throws BeowulfCommunicationException, BeowulfResponseException
public long getAccountCount()
throws BeowulfCommunicationException,
BeowulfResponseException
BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public List<ExtendedAccount> getAccounts(List<AccountName> accountNames) throws BeowulfCommunicationException, BeowulfResponseException
accountNames - A list of accounts you want to request the details for.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public Asset getBalance(AccountName accountName, AssetInfo assetInfo) throws BeowulfCommunicationException, BeowulfResponseException
public ScheduledHardfork getNextScheduledHarfork() throws BeowulfCommunicationException, BeowulfResponseException
BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public String getTransactionHex(SignedTransaction signedTransaction) throws BeowulfCommunicationException, BeowulfResponseException, BeowulfInvalidTransactionException
signedTransaction - The signed Transaction object you want to receive the HEX
representation for.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - BeowulfInvalidTransactionException - The beowulf invalid transaction exception.public CompletedTransaction getTransactionDetail(String trx_id) throws BeowulfCommunicationException, BeowulfResponseException
trx_id - transaction id for getting dataBeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public Supernode getSupernodeByAccount(AccountName supernodeName) throws BeowulfCommunicationException, BeowulfResponseException
supernodeName - The supernode name.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public List<Supernode> getSupernodesByVote(AccountName supernodeName, int limit, int vestingShare) throws BeowulfCommunicationException, BeowulfResponseException
supernodeName - The supernode name to start from.limit - The number of results.vestingShare - The number coin.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public int getSupernodeCount()
throws BeowulfCommunicationException,
BeowulfResponseException
BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public List<Supernode> getSupernodes() throws BeowulfCommunicationException, BeowulfResponseException
BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public SupernodeSchedule getSupernodeSchedule() throws BeowulfCommunicationException, BeowulfResponseException
BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public List<String> lookupAccounts(String pattern, int limit) throws BeowulfCommunicationException, BeowulfResponseException
pattern - The lower case pattern you want to search for.limit - The maximum number of account names.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public List<String> lookupSupernodeAccounts(String pattern, int limit) throws BeowulfCommunicationException, BeowulfResponseException
pattern - The lower case pattern you want to search for.limit - The maximum number of account names.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public boolean verifyAuthority(SignedTransaction signedTransaction) throws BeowulfCommunicationException, BeowulfResponseException
signedTransaction - A SignedTransaction transaction which has been signed.true if the given transaction has been signed
correctly, otherwise an Exception will be thrown.BeowulfCommunicationException - setResponseTimeout).BeowulfResponseException - public TransferOperation transfer(AccountName from, AccountName to, Asset amount, Asset fee, String memo)
BeowulfJ.transfer(new AccountName("accounta"), new AccountName("accountb"), AssetSymbolType.W, 1.0, "My memo");
Attention This method will write data on the blockchain. As all
writing operations, a private key is required to sign the transaction.
For a transfer operation the private active key of the
DefaultAccount needs to be
configured in the PrivateKeyStorage.from - The account from which to transfer currency.to - The account to which to transfer currency.amount - An Asset object containing the Asset type (see
AssetSymbolType
and the amount to transfer.fee - The fee of transaction.memo - Message include with transfer (255 char max)public List<FindSmtTokenByName> findSmtTokenByName(List<String> names) throws BeowulfCommunicationException, BeowulfResponseException
public SmtCreateOperation smtCreate(AccountName controlAccount, AccountName creator, AssetInfo assetInfo, Asset smtCreationFee, long maxSupply)
public AccountCreateOperation createAccount(AccountName creator, Asset fee, AccountName newAccount, Authority owner, String jsonMetadata)
public BroadcastTransactionSynchronousReturn signAndBroadcastSynchronous(List<Operation> operations) throws BeowulfCommunicationException, BeowulfResponseException, BeowulfInvalidTransactionException
public TransactionId signAndBroadcast(List<Operation> operations) throws BeowulfCommunicationException, BeowulfResponseException, BeowulfInvalidTransactionException
public TransactionId signAndBroadcastWithExtension(List<Operation> operations, List<FutureExtensions> extensions) throws BeowulfCommunicationException, BeowulfResponseException, BeowulfInvalidTransactionException, com.fasterxml.jackson.core.JsonProcessingException
BeowulfCommunicationExceptionBeowulfResponseExceptionBeowulfInvalidTransactionExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionCopyright © 2019. All rights reserved.