Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
transaction_check_entrypoints.h
Go to the documentation of this file.
1/*****************************************************************************
2 * (c) 2026 Ledger SAS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16#pragma once
17
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdint.h>
21#include "transaction_check.h"
22
23/*
24The handle functions must be defined by each Coin application implementing the Transaction Check
25feature. They hold what the SDK cannot know: the chain-specific checks, the persistent settings
26and the app UI states.
27*/
28
29#if defined(HAVE_TX_CHECK)
30
41
50bool handle_check_tx_report_signer(const uint8_t *address,
51 size_t address_len,
52 const tx_check_context_t *ctx);
53
62bool handle_check_tx_report_chain_id(bool chain_id_received,
63 uint64_t chain_id,
64 const tx_check_context_t *ctx);
65
73
81
88
98void handle_tx_check_opt_in_response(bool enabled);
99
107void finalize_ui_tx_check_opt_in(bool response_expected);
108
109#endif // HAVE_TX_CHECK
struct tlv_transaction_check_out_s tlv_transaction_check_out_t
Transaction Check: risk report from a security provider, displayed during the review.
tx_check_setting_t
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.
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_check_tx_report(const tlv_transaction_check_out_t *descriptor)
Validate the chain-specific fields of a received descriptor.
bool handle_tx_check_get_setting(tx_check_setting_t setting)
Read a persistent Transaction Check setting.
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_tx_check_is_idle(void)
Tell whether the app is idle, so that the opt-in screen can be displayed.
void handle_tx_check_set_setting(tx_check_setting_t setting, bool value)
Write a persistent Transaction Check setting.