55extern "C" {
66#endif
77
8- /// Registers custom wallet implementation.
8+ /// Registers custom wallet storage implementation.
99 ///
1010 /// It allows library user to provide custom wallet implementation.
1111 ///
1212 /// #Params
1313 /// command_handle: Command handle to map callback to caller context.
14- /// xtype : Wallet type name.
14+ /// type_ : Wallet type name.
1515 /// create: WalletType create operation handler
1616 /// open: WalletType open operation handler
17- /// set: Wallet set operation handler
18- /// get: Wallet get operation handler
19- /// get_not_expired: Wallet get_not_expired operation handler
20- /// list: Wallet list operation handler
2117 /// close: Wallet close operation handler
2218 /// delete: WalletType delete operation handler
19+ /// add_record: WalletType add record operation handler
20+ /// update_record_value: WalletType update record value operation handler
21+ /// update_record_tags: WalletType update record tags operation handler
22+ /// add_record_tags: WalletType add record tags operation handler
23+ /// delete_record_tags: WalletType delete record tags operation handler
24+ /// delete_record: WalletType delete record operation handler
25+ /// get_record: WalletType get record operation handler
26+ /// get_record_id: WalletType get record id operation handler
27+ /// get_record_type: WalletType get record type operation handler
28+ /// get_record_value: WalletType get record value operation handler
29+ /// get_record_tags: WalletType get record tags operation handler
30+ /// free_record: WalletType free record operation handler
31+ /// search_records: WalletType search records operation handler
32+ /// search_all_records: WalletType search all records operation handler
33+ /// get_search_total_count: WalletType get search total count operation handler
34+ /// fetch_search_next_record: WalletType fetch search next record operation handler
35+ /// free_search: WalletType free search operation handler
2336 /// free: Handler that allows to de-allocate strings allocated in caller code
2437 ///
2538 /// #Returns
2639 /// Error code
2740
2841
2942 extern indy_error_t indy_register_wallet_type (indy_handle_t command_handle ,
30- const char * xtype ,
43+ const char * type_ ,
3144 indy_error_t (* createFn )(const char * name ,
32- const char * config ,
33- const char * credentials ),
45+ const char * config ,
46+ const char * credentials_json ,
47+ const char * metadata ),
3448
3549 indy_error_t (* openFn )(const char * name ,
3650 const char * config ,
3751 const char * runtime_config ,
3852 const char * credentials ,
3953 indy_handle_t * handle ),
4054
41- indy_error_t (* setFn )(indy_handle_t handle ,
42- const char * key ,
43- const char * value ),
44-
45- indy_error_t (* getFn )(indy_handle_t handle ,
46- const char * key ,
47- const char * * const value_ptr ),
48-
49- indy_error_t (* getNotExpiredFn )(indy_handle_t handle ,
50- const char * key ,
51- const char * * const value_ptr ),
52-
53- indy_error_t (* listFn )(indy_handle_t handle ,
54- const char * key ,
55- const char * * const values_json_ptr ),
56-
5755 indy_error_t (* closeFn )(indy_handle_t handle ),
56+
5857 indy_error_t (* deleteFn )(const char * name ,
5958 const char * config ,
6059 const char * credentials ),
6160
62- indy_error_t (* freeFn )(indy_handle_t handle , const char * str ),
61+ indy_error_t (* addRecordFn )(indy_handle_t handle ,
62+ const char * type_ ,
63+ const char * id ,
64+ const indy_u8_t * value ,
65+ indy_u32_t value_len ,
66+ const char * tags_json ),
67+
68+ indy_error_t (* updateRecordValueFn )(indy_handle_t handle ,
69+ const char * type_ ,
70+ const char * id ,
71+ const indy_u8_t * value ,
72+ indy_u32_t value_len ),
73+
74+ indy_error_t (* updateRecordTagsFn )(indy_handle_t handle ,
75+ const char * type_ ,
76+ const char * id ,
77+ const char * tags_json ),
78+
79+ indy_error_t (* addRecordTagsFn )(indy_handle_t handle ,
80+ const char * type_ ,
81+ const char * id ,
82+ const char * tags_json ),
83+
84+ indy_error_t (* deleteRecordTagsFn )(indy_handle_t handle ,
85+ const char * type_ ,
86+ const char * id ,
87+ const char * tags_names ),
88+
89+ indy_error_t (* deleteRecordFn )(indy_handle_t handle ,
90+ const char * type_ ,
91+ const char * id ),
92+
93+ indy_error_t (* getRecordFn )(indy_handle_t handle ,
94+ const char * type_ ,
95+ const char * id ,
96+ const char * options_json ,
97+ int32_t * record_handle ), // TODO: clarify mutable param
98+
99+ indy_error_t (* getRecordIdFn )(indy_handle_t handle ,
100+ indy_handle_t record_handle ,
101+ char * id ),
102+
103+ indy_error_t (* getRecordValueFn )(indy_handle_t handle ,
104+ indy_handle_t record_handle ,
105+ indy_u8_t * value ,
106+ indy_u32_t value_len ),
107+
108+ indy_error_t (* getRecordTagsFn )(indy_handle_t handle ,
109+ indy_handle_t record_handle ,
110+ char * tags_json ),
111+
112+ indy_error_t (* freeRecordFn )(indy_handle_t handle ,
113+ indy_handle_t record_handle ),
114+
115+ indy_error_t (* getStorageMetadataFn )(indy_handle_t handle ,
116+ char * metadata ,
117+ indy_handle_t metadata_handle ),
118+
119+ indy_error_t (* setStorageMetadataFn )(indy_handle_t handle ,
120+ const char * metadata ),
121+
122+ indy_error_t (* freeStorageMetadataFn )(indy_handle_t handle ,
123+ indy_handle_t metadata_handle ),
124+
125+ indy_error_t (* openSearchFn )(indy_handle_t handle ,
126+ const char * type_ ,
127+ const char * query ,
128+ const char * options ,
129+ int32_t * search_handle ),
130+
131+ indy_error_t (* openSearchAllFn )(indy_handle_t handle ,
132+ indy_handle_t search_handle ),
133+
134+ indy_error_t (* getSearchTotalCountFn )(indy_handle_t handle ,
135+ indy_handle_t search_handle ,
136+ indy_u32_t * total_count ),
137+
138+ indy_error_t (* fetchSearchNextRecordsFn )(indy_handle_t handle ,
139+ indy_handle_t search_handle ,
140+ indy_handle_t record_handle ),
141+
142+ indy_error_t (* freeSearchFn )(indy_handle_t handle ,
143+ indy_handle_t search_handle ),
144+
63145 void (* fn )(indy_handle_t xcommand_handle , indy_error_t err )
64146 );
65147
@@ -72,8 +154,13 @@ extern "C" {
72154 /// Custom types can be registered with indy_register_wallet_type call.
73155 /// config(optional): Wallet configuration json. List of supported keys are defined by wallet type.
74156 /// if NULL, then default config will be used.
75- /// credentials(optional): Wallet credentials json. List of supported keys are defined by wallet type.
76- /// if NULL, then default config will be used.
157+ /// credentials: Wallet credentials json
158+ /// {
159+ /// "key": string,
160+ /// "rekey": Optional<string>,
161+ /// "storage": Optional<object> List of supported keys are defined by wallet type.
162+ ///
163+ /// }
77164 ///
78165 /// #Returns
79166 /// Error code
@@ -102,8 +189,13 @@ extern "C" {
102189 /// "freshness_time": string (optional), Amount of minutes to consider wallet value as fresh. Defaults to 24*60.
103190 /// ... List of additional supported keys are defined by wallet type.
104191 /// }
105- /// credentials(optional): Wallet credentials json. List of supported keys are defined by wallet type.
106- /// if NULL, then default credentials will be used.
192+ /// credentials: Wallet credentials json
193+ /// {
194+ /// "key": string,
195+ /// "rekey": Optional<string>,
196+ /// "storage": Optional<object> List of supported keys are defined by wallet type.
197+ ///
198+ /// }
107199 ///
108200 /// #Returns
109201 /// Handle to opened wallet to use in methods that require wallet access.
@@ -145,8 +237,13 @@ extern "C" {
145237 ///
146238 /// #Params
147239 /// name: Name of the wallet to delete.
148- /// credentials(optional): Wallet credentials json. List of supported keys are defined by wallet type.
149- /// if NULL, then default credentials will be used.
240+ /// credentials: Wallet credentials json
241+ /// {
242+ /// "key": string,
243+ /// "rekey": Optional<string>,
244+ /// "storage": Optional<object> List of supported keys are defined by wallet type.
245+ ///
246+ /// }
150247 ///
151248 /// #Returns
152249 /// Error code
0 commit comments