Skip to main content

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

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

Extends​

  • UniffiAbstractObject

Implements​

Constructors​

Constructor​

new Intent(
scope,
version,
appId
): Intent;

Create a new signing intent.

Parameters​

scope​

IntentScope

version​

V0

appId​

IntentAppId

Returns​

Intent

Overrides​

UniffiAbstractObject.constructor

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

readonly [uniffiTypeNameSymbol]: "Intent" = "Intent";

Methods​

appId()​

appId(): IntentAppId;

Get the app id of the signing intent.

Returns​

IntentAppId

Implementation of​

IntentLike.appId


equals()​

equals(other): boolean;

Parameters​

other​

Intent

Returns​

boolean


hashCode()​

hashCode(): bigint;

Returns​

bigint


scope()​

scope(): IntentScope;

Get the scope of the signing intent.

Returns​

IntentScope

Implementation of​

IntentLike.scope


toBytes()​

toBytes(): ArrayBuffer;

Convert the signing intent to bytes.

Returns​

ArrayBuffer

Implementation of​

IntentLike.toBytes


toDebugString()​

toDebugString(): string;

Returns​

string


toString()​

toString(): string;

Returns a string representation of an object.

Returns​

string


uniffiDestroy()​

uniffiDestroy(): void;

Explicitly tell Rust to destroy the native peer that backs this object.

Once this method has been called, any following method calls will throw an error.

Can be called more than once.

Returns​

void

Overrides​

UniffiAbstractObject.uniffiDestroy

uniffiUse()​

uniffiUse<T>(block): T;

A convenience method to use this object, then destroy it after its use.

Type Parameters​

T​

T

Parameters​

block​

(obj) => T

Returns​

T

Inherited from​

UniffiAbstractObject.uniffiUse

version()​

version(): V0;

Get the version of the signing intent.

Returns​

V0

Implementation of​

IntentLike.version


fromBytes()​

static fromBytes(bytes): IntentLike;

Create a signing intent from bytes.

Parameters​

bytes​

ArrayBuffer

Returns​

IntentLike


fromHex()​

static fromHex(hex): IntentLike;

Create a signing intent from a hex string.

Parameters​

hex​

string

Returns​

IntentLike


instanceOf()​

static instanceOf(obj_): obj_ is Intent;

Parameters​

obj_​

any

Returns​

obj_ is Intent


newConsensusApp()​

static newConsensusApp(scope): IntentLike;

Create a new Consensus app signing intent.

Parameters​

scope​

IntentScope

Returns​

IntentLike


newIotaApp()​

static newIotaApp(scope): IntentLike;

Create a new IOTA app signing intent.

Parameters​

scope​

IntentScope

Returns​

IntentLike


newIotaTransaction()​

static newIotaTransaction(): IntentLike;

Create a new IOTA transaction signing intent.

Returns​

IntentLike


newPersonalMessage()​

static newPersonalMessage(): IntentLike;

Create a new IOTA personal message signing intent.

Returns​

IntentLike