|
118 | 118 | ```rust |
119 | 119 | fn init_db(base_path: String) -> Result<String, DbError> |
120 | 120 | ``` |
| 121 | + - [get_default_wallet_id](src/modules/activity/README.md#usage-examples): Get the default wallet ID for the built-in Bitkit wallet |
| 122 | + ```rust |
| 123 | + fn get_default_wallet_id() -> String |
| 124 | + ``` |
121 | 125 | - [insert_activity](src/modules/activity/README.md#usage-examples): Insert an activity (onchain or lightning) |
122 | 126 | ```rust |
123 | 127 | fn insert_activity(activity: Activity) -> Result<(), ActivityError> |
124 | 128 | ``` |
125 | | - - [get_activities](src/modules/activity/README.md#usage-examples): Get activities with optional filtering, limit and sort direction |
126 | | - ```rust |
127 | | - fn get_activities(filter: ActivityFilter, limit: Option<u32>, sort_direction: Option<SortDirection>) -> Result<Vec<Activity>, ActivityError> |
| 129 | + - [get_activities](src/modules/activity/README.md#usage-examples): Get activities with optional wallet scope, filtering, limit and sort direction |
| 130 | + ```rust |
| 131 | + fn get_activities( |
| 132 | + wallet_id: Option<String>, |
| 133 | + filter: Option<ActivityFilter>, |
| 134 | + tx_type: Option<PaymentType>, |
| 135 | + tags: Option<Vec<String>>, |
| 136 | + search: Option<String>, |
| 137 | + min_date: Option<u64>, |
| 138 | + max_date: Option<u64>, |
| 139 | + limit: Option<u32>, |
| 140 | + sort_direction: Option<SortDirection> |
| 141 | + ) -> Result<Vec<Activity>, ActivityError> |
128 | 142 | ``` |
129 | | - - [get_activity_by_id](src/modules/activity/README.md#usage-examples): Look up any activity by its ID |
| 143 | + - [get_activity_by_id](src/modules/activity/README.md#usage-examples): Look up any activity by wallet ID and activity ID |
130 | 144 | ```rust |
131 | | - fn get_activity_by_id(activity_id: String) -> Result<Option<Activity>, ActivityError> |
| 145 | + fn get_activity_by_id(wallet_id: String, activity_id: String) -> Result<Option<Activity>, ActivityError> |
| 146 | + ``` |
| 147 | + - [get_activity_by_tx_id](src/modules/activity/README.md#usage-examples): Look up an onchain activity by wallet ID and transaction ID |
| 148 | + ```rust |
| 149 | + fn get_activity_by_tx_id(wallet_id: String, tx_id: String) -> Result<Option<OnchainActivity>, ActivityError> |
132 | 150 | ``` |
133 | 151 | - [update_activity](src/modules/activity/README.md#usage-examples): Update an existing activity (onchain or lightning) |
134 | 152 | ```rust |
135 | 153 | fn update_activity(activity_id: String, activity: Activity) -> Result<(), ActivityError> |
136 | 154 | ``` |
137 | | - - [delete_activity_by_id](src/modules/activity/README.md#usage-examples): Delete any activity (onchain or lightning) by its ID. Returns true if activity was found and deleted, false if not found |
| 155 | + - [delete_activity_by_id](src/modules/activity/README.md#usage-examples): Delete any activity by wallet ID and activity ID. Returns true if activity was found and deleted, false if not found |
| 156 | + ```rust |
| 157 | + fn delete_activity_by_id(wallet_id: String, activity_id: String) -> Result<bool, ActivityError> |
| 158 | + ``` |
| 159 | + - [delete_activities_by_wallet_id](src/modules/activity/README.md#usage-examples): Delete all activities and scoped activity data for a wallet |
138 | 160 | ```rust |
139 | | - fn delete_activity_by_id(activity_id: String) -> Result<bool, ActivityError> |
| 161 | + fn delete_activities_by_wallet_id(wallet_id: String) -> Result<u32, ActivityError> |
| 162 | + ``` |
| 163 | + - [mark_activity_as_seen](src/modules/activity/README.md#usage-examples): Mark an activity as seen by wallet ID and activity ID |
| 164 | + ```rust |
| 165 | + fn mark_activity_as_seen(wallet_id: String, activity_id: String, seen_at: u64) -> Result<(), ActivityError> |
140 | 166 | ``` |
141 | 167 | - [add_tags](src/modules/activity/README.md#usage-examples): Add tags to an activity |
142 | 168 | ```rust |
143 | | - fn add_tags(activity_id: String, tags: Vec<String>) -> Result<(), ActivityError> |
| 169 | + fn add_tags(wallet_id: String, activity_id: String, tags: Vec<String>) -> Result<(), ActivityError> |
144 | 170 | ``` |
145 | 171 | - [remove_tags](src/modules/activity/README.md#usage-examples): Remove tags from an activity |
146 | 172 | ```rust |
147 | | - fn remove_tags(activity_id: String, tags: Vec<String>) -> Result<(), ActivityError> |
| 173 | + fn remove_tags(wallet_id: String, activity_id: String, tags: Vec<String>) -> Result<(), ActivityError> |
148 | 174 | ``` |
149 | 175 | - [get_tags](src/modules/activity/README.md#usage-examples): Get all tags for an activity |
150 | 176 | ```rust |
151 | | - fn get_tags(activity_id: String) -> Result<Vec<String>, ActivityError> |
| 177 | + fn get_tags(wallet_id: String, activity_id: String) -> Result<Vec<String>, ActivityError> |
152 | 178 | ``` |
153 | 179 | - [get_all_unique_tags](src/modules/activity/README.md#usage-examples): Get all unique tags in the database sorted alphabetically |
154 | 180 | ```rust |
155 | 181 | fn get_all_unique_tags() -> Result<Vec<String>, ActivityError> |
156 | 182 | ``` |
157 | | - - [get_activities_by_tag](src/modules/activity/README.md#usage-examples): Get all activities with a specific tag |
| 183 | + - [get_activities_by_tag](src/modules/activity/README.md#usage-examples): Get activities with a specific tag and optional wallet scope |
158 | 184 | ```rust |
159 | | - fn get_activities_by_tag(tag: String, limit: Option<u32>, sort_direction: Option<SortDirection>) -> Result<Vec<Activity>, ActivityError> |
| 185 | + fn get_activities_by_tag( |
| 186 | + wallet_id: Option<String>, |
| 187 | + tag: String, |
| 188 | + limit: Option<u32>, |
| 189 | + sort_direction: Option<SortDirection> |
| 190 | + ) -> Result<Vec<Activity>, ActivityError> |
160 | 191 | ``` |
161 | 192 | - [upsert_activity](src/modules/activity/README.md#usage-examples): Insert or update an activity |
162 | 193 | ```rust |
163 | 194 | fn upsert_activity(activity: Activity) -> Result<(), ActivityError> |
164 | 195 | ``` |
| 196 | + - [add_pre_activity_metadata](src/modules/activity/README.md#usage-examples): Store pending metadata before an activity exists |
| 197 | + ```rust |
| 198 | + fn add_pre_activity_metadata(pre_activity_metadata: PreActivityMetadata) -> Result<(), ActivityError> |
| 199 | + ``` |
| 200 | + - [get_pre_activity_metadata](src/modules/activity/README.md#usage-examples): Get pending metadata by wallet ID and payment ID or address |
| 201 | + ```rust |
| 202 | + fn get_pre_activity_metadata( |
| 203 | + wallet_id: String, |
| 204 | + search_key: String, |
| 205 | + search_by_address: bool |
| 206 | + ) -> Result<Option<PreActivityMetadata>, ActivityError> |
| 207 | + ``` |
| 208 | + - [add_pre_activity_metadata_tags](src/modules/activity/README.md#usage-examples): Add tags to pending metadata |
| 209 | + ```rust |
| 210 | + fn add_pre_activity_metadata_tags(wallet_id: String, payment_id: String, tags: Vec<String>) -> Result<(), ActivityError> |
| 211 | + ``` |
| 212 | + - [remove_pre_activity_metadata_tags](src/modules/activity/README.md#usage-examples): Remove tags from pending metadata |
| 213 | + ```rust |
| 214 | + fn remove_pre_activity_metadata_tags(wallet_id: String, payment_id: String, tags: Vec<String>) -> Result<(), ActivityError> |
| 215 | + ``` |
| 216 | + - [reset_pre_activity_metadata_tags](src/modules/activity/README.md#usage-examples): Remove all tags from pending metadata |
| 217 | + ```rust |
| 218 | + fn reset_pre_activity_metadata_tags(wallet_id: String, payment_id: String) -> Result<(), ActivityError> |
| 219 | + ``` |
| 220 | + - [delete_pre_activity_metadata](src/modules/activity/README.md#usage-examples): Delete pending metadata by wallet ID and payment ID |
| 221 | + ```rust |
| 222 | + fn delete_pre_activity_metadata(wallet_id: String, payment_id: String) -> Result<(), ActivityError> |
| 223 | + ``` |
| 224 | + - [upsert_pre_activity_metadata](src/modules/activity/README.md#usage-examples): Insert or update pending metadata records |
| 225 | + ```rust |
| 226 | + fn upsert_pre_activity_metadata(pre_activity_metadata: Vec<PreActivityMetadata>) -> Result<(), ActivityError> |
| 227 | + ``` |
| 228 | + - [get_transaction_details](src/modules/activity/README.md#usage-examples): Get transaction details by wallet ID and transaction ID |
| 229 | + ```rust |
| 230 | + fn get_transaction_details(wallet_id: String, tx_id: String) -> Result<Option<TransactionDetails>, ActivityError> |
| 231 | + ``` |
| 232 | + - [delete_transaction_details](src/modules/activity/README.md#usage-examples): Delete transaction details by wallet ID and transaction ID |
| 233 | + ```rust |
| 234 | + fn delete_transaction_details(wallet_id: String, tx_id: String) -> Result<bool, ActivityError> |
| 235 | + ``` |
165 | 236 | - Blocktank: |
166 | 237 | - [init_db](src/modules/blocktank/README.md#usage-examples): Initialize database |
167 | 238 | ```rust |
@@ -510,4 +581,4 @@ cargo test modules::blocktank |
510 | 581 |
|
511 | 582 | # Run tests for the Trezor module |
512 | 583 | cargo test modules::trezor |
513 | | -``` |
| 584 | +``` |
0 commit comments