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:
- IntentScope (what the type of the message is)
- IntentVersion
- 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
| Intent | constructor(scope: IntentScope, version: IntentVersion, appId: IntentAppId) Create a new signing intent. |
Functions
| Name | Summary |
|---|---|
| appId | open override fun appId(): IntentAppId Get the app id of the signing intent. |
| close | @Synchronized open override fun close() |
| destroy | open override fun destroy() |
| equals | open operator override fun equals(other: Any?): Boolean |
| hashCode | open override fun hashCode(): Int |
| scope | open override fun scope(): IntentScope Get the scope of the signing intent. |
| toBytes | open override fun toBytes(): ByteArray Convert the signing intent to bytes. |
| toString | open override fun toString(): String |
| version | open override fun version(): IntentVersion Get the version of the signing intent. |
Companion object functions
| Name | Summary |
|---|---|
| fromBytes | fun fromBytes(bytes: ByteArray): Intent Create a signing intent from bytes. |
| fromHex | fun fromHex(hex: String): Intent Create a signing intent from a hex string. |
| newConsensusApp | fun newConsensusApp(scope: IntentScope): Intent Create a new Consensus app signing intent. |
| newIotaApp | fun newIotaApp(scope: IntentScope): Intent Create a new IOTA app signing intent. |
| newIotaTransaction | fun newIotaTransaction(): Intent Create a new IOTA transaction signing intent. |
| newPersonalMessage | fun newPersonalMessage(): Intent Create a new IOTA personal message signing intent. |