Skip to main content

Intent

open class Intent : Disposable, AutoCloseable, IntentInterface

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 for this type is defined by the following ABNF:

intent = intent-scope intent-version intent-app-id

Constructors

Intentconstructor(scope: IntentScope, version: IntentVersion, appId: IntentAppId)
Create a new signing intent.

Functions

NameSummary
appIdopen override fun appId(): IntentAppId
Get the app id of the signing intent.
close@Synchronized
open override fun close()
destroyopen override fun destroy()
equalsopen operator override fun equals(other: Any?): Boolean
hashCodeopen override fun hashCode(): Int
scopeopen override fun scope(): IntentScope
Get the scope of the signing intent.
toBytesopen override fun toBytes(): ByteArray
Convert the signing intent to bytes.
toStringopen override fun toString(): String
versionopen override fun version(): IntentVersion
Get the version of the signing intent.

Companion object functions

NameSummary
fromBytesfun fromBytes(bytes: ByteArray): Intent
Create a signing intent from bytes.
fromHexfun fromHex(hex: String): Intent
Create a signing intent from a hex string.
newConsensusAppfun newConsensusApp(scope: IntentScope): Intent
Create a new Consensus app signing intent.
newIotaAppfun newIotaApp(scope: IntentScope): Intent
Create a new IOTA app signing intent.
newIotaTransactionfun newIotaTransaction(): Intent
Create a new IOTA transaction signing intent.
newPersonalMessagefun newPersonalMessage(): Intent
Create a new IOTA personal message signing intent.