Package org.onyx.api
Class Account.Builder
java.lang.Object
org.onyx.api.Account.Builder
- Enclosing class:
Account
A builder for creating accounts in the ledger.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a key that controls the account.Adds a key-value pair to the account's tags.Creates a new account in the ledger.Specifies the id for the new account.setQuorum(int quorum) Specifies the number of keys required to sign transactions that transfer or retire tokens from the account.Specifies key-value data that describes the account.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
create
Creates a new account in the ledger.- Parameters:
client- ledger API connection object- Returns:
- an account
- Throws:
ChainException
-
setId
Specifies the id for the new account.- Parameters:
id- unique identifier. Will be auto-generated if not provided.- Returns:
- updated builder
-
setQuorum
Specifies the number of keys required to sign transactions that transfer or retire tokens from the account. Defaults to the number of keys provided.- Parameters:
quorum- a number less than or equal to the number of keys- Returns:
- updated builder
-
addKeyId
Adds a key that controls the account.- Parameters:
id- the key's ID- Returns:
- updated builder
-
addTag
Adds a key-value pair to the account's tags.- Parameters:
key- key of the tagvalue- value of the tag- Returns:
- updated builder
-
setTags
Specifies key-value data that describes the account.- Parameters:
tags- map of tag keys to tag values- Returns:
- updated builder
-