Module iota::auth_context
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;
Module Functions
prv native_digest
fun native_digest(): &vector
Implementation
native fun native_digest(): &vector;
prv native_sender_auth_digest
fun native_sender_auth_digest(): &vector
Implementation
native fun native_sender_auth_digest(): &vector;
prv native_sender_authenticator_function_info_v1
fun native_sender_authenticator_function_info_v1<F>(): &std::option::Option<F>
Implementation
native fun native_sender_authenticator_function_info_v1<F>(): &Option;
prv native_sponsor_auth_digest
fun native_sponsor_auth_digest(): &std::option::Option<vector<u8>>
Implementation
native fun native_sponsor_auth_digest(): &Option>;
prv native_sponsor_authenticator_function_info_v1
fun native_sponsor_authenticator_function_info_v1<F>(): &std::option::Option<F>
Implementation
native fun native_sponsor_authenticator_function_info_v1<F>(): &Option;
prv native_tx_commands
fun native_tx_commands<C>(): &vector
Implementation
native fun native_tx_commands<C>(): &vector;
prv native_tx_data_bytes
fun native_tx_data_bytes(): &vector
Implementation
native fun native_tx_data_bytes(): &vector;
prv native_tx_inputs
fun native_tx_inputs<I>(): &vector
Implementation
native fun native_tx_inputs<I>(): &vector;
Structs
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.
pub digest
Returns the MoveAuthenticator digest.
public fun digest(_ctx: &iota::auth_context::AuthContext): &vector
Implementation
public fun digest(_ctx: &AuthContext): &vector {
native_digest()
}
pub 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
}
pub 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()
}
pub sender_authenticator_function_info_v1
Returns the sender's AuthenticatorFunctionInfoV1 if the sender uses a
MoveAuthenticator signature, none otherwise.
public fun sender_authenticator_function_info_v1(_ctx: &iota::auth_context::AuthContext): &std::option::Option<iota::auth_context::AuthenticatorFunctionInfoV1>
Implementation
public fun sender_authenticator_function_info_v1(
_ctx: &AuthContext,
): &Option<AuthenticatorFunctionInfoV1> {
native_sender_authenticator_function_info_v1()
}
pub 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)
}
pub 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()
}
pub sponsor_authenticator_function_info_v1
Returns the sponsor's AuthenticatorFunctionInfoV1 if the transaction is
sponsored and the sponsor uses a MoveAuthenticator signature, none
otherwise.
public fun sponsor_authenticator_function_info_v1(_ctx: &iota::auth_context::AuthContext): &std::option::Option<iota::auth_context::AuthenticatorFunctionInfoV1>
Implementation
public fun sponsor_authenticator_function_info_v1(
_ctx: &AuthContext,
): &Option<AuthenticatorFunctionInfoV1> {
native_sponsor_authenticator_function_info_v1()
}
pub tx_commands
Returns the transaction commands to be executed sequentially.
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()
}
pub 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()
}
pub tx_inputs
Returns the transaction input objects or primitive values.
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()
}
struct AuthenticatorFunctionInfoV1
Identifies the authenticate function used by a MoveAuthenticator
signature, without binding to a specific account type.
public struct AuthenticatorFunctionInfoV1 has copy, drop, store
pub function_name
Returns the function name of the AuthenticatorFunctionInfoV1.
public fun function_name(self: &iota::auth_context::AuthenticatorFunctionInfoV1): &std::ascii::String
Implementation
public fun function_name(self: &AuthenticatorFunctionInfoV1): &ascii::String {
&self.function_name
}
pub module_name
Returns the module name of the AuthenticatorFunctionInfoV1.
public fun module_name(self: &iota::auth_context::AuthenticatorFunctionInfoV1): &std::ascii::String
Implementation
public fun module_name(self: &AuthenticatorFunctionInfoV1): &ascii::String {
&self.module_name
}
pub package
Returns the package ID of the AuthenticatorFunctionInfoV1.
public fun package(self: &iota::auth_context::AuthenticatorFunctionInfoV1): iota::object::ID
Implementation
public fun package(self: &AuthenticatorFunctionInfoV1): ID {
self.package
}