Module iota::auth_context
- Struct
AuthContext - Function
digest - Function
sender_auth_digest - Function
sponsor_auth_digest - Function
tx_inputs - Function
tx_commands - Function
tx_data_bytes - Function
intent_tx_data_bytes - Function
signing_digest - Function
native_digest - Function
native_sender_auth_digest - Function
native_sponsor_auth_digest - Function
native_tx_data_bytes - Function
native_tx_inputs - Function
native_tx_commands
use iota::address;
use iota::hash;
use iota::hex;
use iota::intent;
use iota::object;
use iota::ptb_call_arg;
use iota::ptb_command;
use iota::tx_context;
use std::address;
use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::type_name;
use std::vector;
Struct AuthContext
public struct AuthContext has drop
Fields
auth_digest: vector<u8>The digest of the MoveAuthenticator
tx_inputs: vector<iota::ptb_call_arg::CallArg>The transaction input objects or primitive values
tx_commands: vector<iota::ptb_command::Command>The transaction commands to be executed sequentially.
Function digest
Returns the MoveAuthenticator digest.
public fun digest(_ctx: &iota::auth_context::AuthContext): &vector
Implementation
public fun digest(_ctx: &AuthContext): &vector {
native_digest()
}
Function sender_auth_digest
Returns the sender's auth digest. For MoveAuthenticator signatures equals
its digest; for all other signature types it is the Blake2b256 of the
serialized (flag-prefixed) signature bytes.
public fun sender_auth_digest(_ctx: &iota::auth_context::AuthContext): &vector
Implementation
public fun sender_auth_digest(_ctx: &AuthContext): &vector {
native_sender_auth_digest()
}
Function sponsor_auth_digest
Returns the sponsor's auth digest for sponsored transactions, none
otherwise. For MoveAuthenticator signatures equals its digest; for all
other signature types it is the Blake2b256 of the serialized
(flag-prefixed) signature bytes.
public fun sponsor_auth_digest(_ctx: &iota::auth_context::AuthContext): &std::option::Option<vector<u8>>
Implementation
public fun sponsor_auth_digest(_ctx: &AuthContext): &Option> {
native_sponsor_auth_digest()
}
Function tx_inputs
public fun tx_inputs(_ctx: &iota::auth_context::AuthContext): &vector<iota::ptb_call_arg::CallArg>
Implementation
public fun tx_inputs(_ctx: &AuthContext): &vector {
native_tx_inputs()
}
Function tx_commands
public fun tx_commands(_ctx: &iota::auth_context::AuthContext): &vector<iota::ptb_command::Command>
Implementation
public fun tx_commands(_ctx: &AuthContext): &vector {
native_tx_commands()
}
Function tx_data_bytes
Returns bcs::to_bytes(TransactionData).
public fun tx_data_bytes(_ctx: &iota::auth_context::AuthContext): &vector
Implementation
public fun tx_data_bytes(_ctx: &AuthContext): &vector {
native_tx_data_bytes()
}
Function intent_tx_data_bytes
Returns bcs::to_bytes(IntentMessage<TransactionData>), i.e., the IOTA
transaction intent bytes prepended to the BCS-serialized TransactionData.
public fun intent_tx_data_bytes(ctx: &iota::auth_context::AuthContext): vector<u8>
Implementation
public fun intent_tx_data_bytes(ctx: &AuthContext): vector<u8> {
let mut result = intent::iota_transaction().to_bytes();
result.append(*ctx.tx_data_bytes());
result
}
Function signing_digest
Returns Blake2b256(bcs::to_bytes(IntentMessage<TransactionData>)).
This is the message that protocol generic signatures sign over.
public fun signing_digest(ctx: &iota::auth_context::AuthContext): vector<u8>
Implementation
public fun signing_digest(ctx: &AuthContext): vector<u8> {
let intent_msg = ctx.intent_tx_data_bytes();
hash::blake2b256(&intent_msg)
}
Function native_digest
fun native_digest(): &vector
Implementation
native fun native_digest(): &vector;
Function native_sender_auth_digest
fun native_sender_auth_digest(): &vector
Implementation
native fun native_sender_auth_digest(): &vector;
Function native_sponsor_auth_digest
fun native_sponsor_auth_digest(): &std::option::Option<vector<u8>>
Implementation
native fun native_sponsor_auth_digest(): &Option>;
Function native_tx_data_bytes
fun native_tx_data_bytes(): &vector
Implementation
native fun native_tx_data_bytes(): &vector;
Function native_tx_inputs
fun native_tx_inputs<I>(): &vector
Implementation
native fun native_tx_inputs<I>(): &vector;
Function native_tx_commands
fun native_tx_commands<C>(): &vector
Implementation
native fun native_tx_commands<C>(): &vector;