Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
transaction_check_entrypoints.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "transaction_check.h"
Include dependency graph for transaction_check_entrypoints.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool handle_check_tx_report (const tlv_transaction_check_out_t *descriptor)
 Validate the chain-specific fields of a received descriptor.
bool handle_check_tx_report_signer (const uint8_t *address, size_t address_len, const tx_check_context_t *ctx)
 Check that the report address is the signer of the operation.
bool handle_check_tx_report_chain_id (bool chain_id_received, uint64_t chain_id, const tx_check_context_t *ctx)
 Check the report chain ID against the operation being signed.
bool handle_tx_check_get_setting (tx_check_setting_t setting)
 Read a persistent Transaction Check setting.
void handle_tx_check_set_setting (tx_check_setting_t setting, bool value)
 Write a persistent Transaction Check setting.
bool handle_tx_check_is_idle (void)
 Tell whether the app is idle, so that the opt-in screen can be displayed.
void handle_tx_check_opt_in_response (bool enabled)
 Reply to an opt-in request received on the app APDU.
void finalize_ui_tx_check_opt_in (bool response_expected)
 Leave the opt-in flow.

Function Documentation

◆ finalize_ui_tx_check_opt_in()

void finalize_ui_tx_check_opt_in ( bool response_expected)

Leave the opt-in flow.

Called once the user has chosen; the APDU reply, if any, has already been sent.

Parameters
[in]response_expectedWhether the flow was started by an APDU (else from the settings)

◆ handle_check_tx_report()

bool handle_check_tx_report ( const tlv_transaction_check_out_t * descriptor)

Validate the chain-specific fields of a received descriptor.

Called after the TLV parsing and the signature verification, before the descriptor is stored. Typically checks the address size and the supported check types.

Parameters
[in]descriptorParsed descriptor (zero-copy buffers valid only during the call)
Returns
true to store the descriptor, false to reject it

◆ handle_check_tx_report_chain_id()

bool handle_check_tx_report_chain_id ( bool chain_id_received,
uint64_t chain_id,
const tx_check_context_t * ctx )

Check the report chain ID against the operation being signed.

Parameters
[in]chain_id_receivedWhether the descriptor holds a chain ID
[in]chain_idChain ID of the descriptor
[in]ctxOperation being signed
Returns
true if the report applies to this chain

◆ handle_check_tx_report_signer()

bool handle_check_tx_report_signer ( const uint8_t * address,
size_t address_len,
const tx_check_context_t * ctx )

Check that the report address is the signer of the operation.

Parameters
[in]addressAddress received in the descriptor, in the chain format
[in]address_lenAddress length
[in]ctxOperation being signed
Returns
true if the address is the signer

◆ handle_tx_check_get_setting()

bool handle_tx_check_get_setting ( tx_check_setting_t setting)

Read a persistent Transaction Check setting.

Parameters
[in]settingSetting to read
Returns
Setting value

◆ handle_tx_check_is_idle()

bool handle_tx_check_is_idle ( void )

Tell whether the app is idle, so that the opt-in screen can be displayed.

Returns
true if no flow is on screen

◆ handle_tx_check_opt_in_response()

void handle_tx_check_opt_in_response ( bool enabled)

Reply to an opt-in request received on the app APDU.

Called once the user has chosen, before finalize_ui_tx_check_opt_in(), when tx_check_opt_in() was called with a pending reply. Optional: the SDK default sends the 1-byte enable state with SWO_SUCCESS.

Parameters
[in]enabledTransaction Check enable state, to send as the 1-byte reply

Reply to an opt-in request received on the app APDU.

Parameters
[in]enabledTransaction Check enable state

Definition at line 151 of file transaction_check_ui.c.

◆ handle_tx_check_set_setting()

void handle_tx_check_set_setting ( tx_check_setting_t setting,
bool value )

Write a persistent Transaction Check setting.

Parameters
[in]settingSetting to write
[in]valueNew value