1
+ /**
2
+ * @file stellar_priv.h
3
+ * @author Cypherock X1 Team
4
+ * @brief Support for stellar app internal operations
5
+ * This file is defined to separate Stellar's internal use
6
+ * functions, flows, common APIs
7
+ * @copyright Copyright (c) 2025 HODL TECH PTE LTD
8
+ * <br/> You may obtain a copy of license at <a href="https://mitcc.org/"
9
+ * target=_blank>https://mitcc.org/</a>
10
+ */
11
+ #ifndef STELLAR_PRIV_H
12
+ #define STELLAR_PRIV_H
13
+ /*****************************************************************************
14
+ * INCLUDES
15
+ *****************************************************************************/
16
+ #include <stdint.h>
17
+ #include <stellar/core.pb.h>
18
+
19
+ #include "stellar_context.h"
20
+
21
+ /*****************************************************************************
22
+ * TYPEDEFS
23
+ *****************************************************************************/
24
+ typedef struct {
25
+ /**
26
+ * The structure holds the wallet information of the transaction.
27
+ * @note Populated by stellar_handle_initiate_query()
28
+ */
29
+ stellar_sign_txn_initiate_request_t init_info ;
30
+
31
+ // remembers the allocated buffer for holding complete unsigned transaction
32
+ uint8_t * transaction ;
33
+
34
+ // decoded transaction structures
35
+ stellar_transaction_t * txn ;
36
+ stellar_payment_t * payment ;
37
+
38
+ } stellar_txn_context_t ;
39
+
40
+ /*****************************************************************************
41
+ * EXPORTED VARIABLES
42
+ *****************************************************************************/
43
+
44
+ /*****************************************************************************
45
+ * GLOBAL FUNCTION PROTOTYPES
46
+ *****************************************************************************/
47
+
48
+ /**
49
+ * @brief Handler for Stellar public key derivation.
50
+ * @details This flow expects STELLAR_GET_PUBLIC_KEY_REQUEST_INITIATE_TAG as initial
51
+ * query, otherwise the flow is aborted
52
+ *
53
+ * @param query object for address public key query
54
+ */
55
+ void stellar_get_pub_keys (stellar_query_t * query );
56
+
57
+ /**
58
+ * @brief Handler for signing a transaction on stellar.
59
+ * @details The expected request type is STELLAR_SIGN_TXN_REQUEST_INITIATE_TAG. The
60
+ * function controls the complete data exchange with host, user prompts and
61
+ * confirmations for signing an STELLAR based transaction.
62
+ *
63
+ * @param query Reference to the decoded query struct from the host app
64
+ */
65
+ void stellar_sign_transaction (stellar_query_t * query );
66
+
67
+ #endif /* STELLAR_PRIV_H */
0 commit comments