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:
- 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
Extends
UniffiAbstractObject
Implements
Constructors
Constructor
new Intent(
scope,
version,
appId
): Intent;
Create a new signing intent.
Parameters
scope
version
appId
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
Implementation of
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
Implementation of
toBytes()
toBytes(): ArrayBuffer;
Convert the signing intent to bytes.
Returns
ArrayBuffer
Implementation of
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
Implementation of
fromBytes()
static fromBytes(bytes): IntentLike;
Create a signing intent from bytes.
Parameters
bytes
ArrayBuffer
Returns
fromHex()
static fromHex(hex): IntentLike;
Create a signing intent from a hex string.
Parameters
hex
string
Returns
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
Returns
newIotaApp()
static newIotaApp(scope): IntentLike;
Create a new IOTA app signing intent.
Parameters
scope
Returns
newIotaTransaction()
static newIotaTransaction(): IntentLike;
Create a new IOTA transaction signing intent.
Returns
newPersonalMessage()
static newPersonalMessage(): IntentLike;
Create a new IOTA personal message signing intent.