Skip to main content

get_current_escrow_finish

Function get_current_escrow_finish 

Source
pub fn get_current_escrow_finish() -> EscrowFinish
Expand description

Creates a new EscrowFinish transaction handler for the current transaction context.

This function returns an EscrowFinish instance that can be used to access fields from the current XRPL transaction. The function assumes that the current transaction is indeed an EscrowFinish transaction - using this with other transaction types may result in unexpected behavior or errors when accessing type-specific fields.

§Returns

Returns an EscrowFinish struct that provides access to both common transaction fields and EscrowFinish-specific fields through its trait implementations.

§Safety

This function is safe to call, but the returned object should only be used when the current transaction context is guaranteed to be an EscrowFinish transaction. The XRPL Programmability environment ensures this context is correct when the smart contract is invoked in response to an EscrowFinish transaction.

§Performance

This function has zero runtime cost as it simply returns a zero-sized type. All actual field access happens lazily when trait methods are called.

§Example

use xrpl_escrow_stdlib::current_tx::escrow_finish::EscrowFinish;
use xrpl_escrow_stdlib::current_tx::traits::EscrowFinishFields;
use xrpl_wasm_stdlib::core::current_tx::traits::TransactionCommonFields;
let tx = EscrowFinish;
let owner = tx.get_owner().unwrap_or_panic();
let offer_seq = tx.get_offer_sequence().unwrap_or_panic();
let condition = tx.get_condition().unwrap_or_panic(); // Option<_>