Expand description
This module contains generic utilities for serializing and deserializing method calls to/from payload bytes.
It can be reused to implement a different wallet implementation. TransactionPayloadCaller
calls the methods of a payload one by one. TransactionPayloadDecoder in decoder checks a
payload and describes its methods without calling them, for example to show a transaction on the
screen of a hardware wallet before it is signed. Both use the same decoding code, so they apply
the same rules.
Methods can pass values to later methods of the same payload through outputs. A payload declares
all its outputs upfront, each with a capacity, and every #[output] and return value of a
method writes one of them. Later methods can refer to what was written last into a declared
output as a slot or an input, see TransactionOutput.
Builder interface requires heap allocations and can be enabled with payload-builder feature,
while the rest works in no_std environment without a global allocator.
Modules§
- builder
- Transaction payload creation utilities
- decoder
- Checking a payload and describing its methods without calling them
Structs§
- Declared
Output - Output that a payload declares, with what is known about the value that was written into it
last, see
TransactionPayloadDecoder::new()andTransactionPayloadCaller::new() - Transaction
Input - The type of transaction input could be either explicit value or output index.
- Transaction
Output - The type of transaction output could be either
#[output]or return value, with the index of the declared output that it writes. - Transaction
Payload Caller - Caller of methods in a transaction payload created using
TransactionPayloadBuilder. - Transaction
Slot - The type of transaction slot could be either explicit slot address or output index.
Enums§
- Transaction
Input Type - Transaction
Method Context - Transaction
Output Kind - Whether an output is
#[output]or the return value - Transaction
Output Type - Transaction
Payload Call Error - Errors for
TransactionPayloadCaller::call_next_method() - Transaction
Payload Decoder Error - Errors of decoding a payload with
TransactionPayloadDecoderorTransactionPayloadCaller, whose constructors already read the declared outputs - Transaction
Slot Type