Skip to main content

TokenPolicy

type TokenPolicy

A typed view of an on-chain `0x2::token::TokenPolicy<T>` object.

type TokenPolicy struct {
// contains filtered or unexported fields
}

func LiftFromExternalTokenPolicy

func LiftFromExternalTokenPolicy(handle uint64) *TokenPolicy

func TokenPolicyTryFromBcs

func TokenPolicyTryFromBcs(bytes []byte) (*TokenPolicy, error)

Decode from BCS bytes, without validating the on-chain type tag.

func TokenPolicyTryFromObjectWithType

func TokenPolicyTryFromObjectWithType(object *Object, typeParam *TypeTag) (*TokenPolicy, error)

Decode from an on-chain object, validating its Move type tag, including that its type parameter equals `type_param`.

func (*TokenPolicy) DebugString

func (_self *TokenPolicy) DebugString() string

func (*TokenPolicy) Destroy

func (object *TokenPolicy) Destroy()

func (*TokenPolicy) Id

func (_self *TokenPolicy) Id() *ObjectId

The object's ID.

func (*TokenPolicy) Rules

func (_self *TokenPolicy) Rules() map[string][]string

Fully-qualified type names of the rules attached to each action, keyed by action name.

func (*TokenPolicy) SpentBalance

func (_self *TokenPolicy) SpentBalance() uint64

Balance spent on the `spend` action, in base units.