Skip to main content

TreasuryCap

open class TreasuryCap : Disposable, AutoCloseable, TreasuryCapInterface

A typed view of an on-chain 0x2::coin::TreasuryCap<T> object, the capability controlling a coin type's supply.

Functions

NameSummary
close@Synchronized
open override fun close()
destroyopen override fun destroy()
idopen override fun id(): ObjectId
The object's ID.
toStringopen override fun toString(): String
totalSupplyopen override fun totalSupply(): ULong
Total supply of the coin currently in circulation, in base units.

Companion object functions

NameSummary
tryFromBcsfun tryFromBcs(bytes: ByteArray): TreasuryCap
Decode from BCS bytes, without validating the on-chain type tag.
tryFromObjectWithTypefun tryFromObjectWithType(object: Object, typeParam: TypeTag): TreasuryCap
Decode from an on-chain object, validating its Move type tag, including that its type parameter equals type_param.