Package org.onyx.api
Class Asset.Builder
java.lang.Object
org.onyx.api.Asset.Builder
- Enclosing class:
Asset
A builder for defining assets in the ledger.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a key that controls the asset.Adds a key-value pair to the asset's tags.Creates a new asset in the ledger.Specifies the id for the new asset.setQuorum(int quorum) Specifies the number of keys required to sign transactions that issue tokens of the asset.Specifies key-value data that describes the asset.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
create
Creates a new asset in the ledger.- Parameters:
client- ledger API connection object- Returns:
- an asset
- Throws:
ChainException
-
setId
Specifies the id for the new asset.- Parameters:
id- a unique, user-specified identifier- Returns:
- updated builder
-
addTag
Adds a key-value pair to the asset's tags.- Parameters:
key- key of the tagvalue- value of the tag- Returns:
- updated builder
-
setTags
Specifies key-value data that describes the asset.- Parameters:
tags- map of tag keys to tag values- Returns:
- updated builder
-
setQuorum
Specifies the number of keys required to sign transactions that issue tokens of the asset. 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 asset.- Parameters:
id- the key's ID- Returns:
- updated builder
-