Skip to main content

Intent

type Intent​

A Signing Intent

An intent is a compact struct that serves as the domain separator for a message that a signature commits to. It consists of three parts: 1. IntentScope (what the type of the message is) 2. IntentVersion 3. IntentAppId (what application the signature refers to).

The serialization of an Intent is a 3-byte array where each field is represented by a byte and it is prepended onto a message before it is signed in IOTA.

BCS​

The BCS serialized form of this type is specified in [`bcs-schema.abnf`](https://github.com/iotaledger/iota-rust-sdk/blob/develop/crates/iota-sdk-types/bcs-schema.abnf\).

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

func IntentFromBytes​

func IntentFromBytes(bytes []byte) (*Intent, error)

Create a signing intent from bytes.

func IntentFromHex​

func IntentFromHex(hex string) (*Intent, error)

Create a signing intent from a hex string.

func IntentNewConsensusApp​

func IntentNewConsensusApp(scope IntentScope) *Intent

Create a new Consensus app signing intent.

func IntentNewIotaApp​

func IntentNewIotaApp(scope IntentScope) *Intent

Create a new IOTA app signing intent.

func IntentNewIotaTransaction​

func IntentNewIotaTransaction() *Intent

Create a new IOTA transaction signing intent.

func IntentNewPersonalMessage​

func IntentNewPersonalMessage() *Intent

Create a new IOTA personal message signing intent.

func LiftFromExternalIntent​

func LiftFromExternalIntent(handle uint64) *Intent

func NewIntent​

func NewIntent(scope IntentScope, version IntentVersion, appId IntentAppId) *Intent

Create a new signing intent.

func (*Intent) AppId​

func (_self *Intent) AppId() IntentAppId

Get the app id of the signing intent.

func (*Intent) DebugString​

func (_self *Intent) DebugString() string

func (*Intent) Destroy​

func (object *Intent) Destroy()

func (*Intent) Eq​

func (_self *Intent) Eq(other *Intent) bool

func (*Intent) Hash​

func (_self *Intent) Hash() uint64

func (*Intent) Ne​

func (_self *Intent) Ne(other *Intent) bool

func (*Intent) Scope​

func (_self *Intent) Scope() IntentScope

Get the scope of the signing intent.

func (*Intent) ToBytes​

func (_self *Intent) ToBytes() []byte

Convert the signing intent to bytes.

func (*Intent) ToDisplayString​

func (_self *Intent) ToDisplayString() string

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

func (*Intent) Version​

func (_self *Intent) Version() IntentVersion

Get the version of the signing intent.