Skip to content

Commit 4b5f8c7

Browse files
committed
feat: add managed_core_account_set_transaction_label FFI function
Add mutable access to `FFIManagedCoreAccount` via `inner_mut()` and expose a function to set or clear transaction labels by txid. Also add comprehensive tests for: - `managed_core_account_get_transactions` with real transaction data - `managed_core_account_free_transactions` verifying no crash on free - Label round-trip (set, read back, clear, verify cleared) - Error cases (null account, missing txid)
1 parent d0add65 commit 4b5f8c7

2 files changed

Lines changed: 402 additions & 2 deletions

File tree

key-wallet-ffi/FFI_API.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document provides a comprehensive reference for all FFI (Foreign Function I
44

55
**Auto-generated**: This documentation is automatically generated from the source code. Do not edit manually.
66

7-
**Total Functions**: 260
7+
**Total Functions**: 261
88

99
## Table of Contents
1010

@@ -140,7 +140,7 @@ Functions: 64
140140

141141
### Account Management
142142

143-
Functions: 109
143+
Functions: 110
144144

145145
| Function | Description | Module |
146146
|----------|-------------|--------|
@@ -243,6 +243,7 @@ Functions: 109
243243
| `managed_core_account_get_transaction_count` | Get the number of transactions in a managed account # Safety - `account`... | managed_account |
244244
| `managed_core_account_get_transactions` | Get all transactions from a managed account Returns an array of... | managed_account |
245245
| `managed_core_account_get_utxo_count` | Get the number of UTXOs in a managed account # Safety - `account` must be... | managed_account |
246+
| `managed_core_account_set_transaction_label` | Set a label on a transaction record # Safety - `account` must be a valid,... | managed_account |
246247
| `managed_platform_account_free` | Free a managed platform account handle # Safety - `account` must be a... | managed_account |
247248
| `managed_platform_account_get_account_index` | Get the account index of a managed platform account # Safety - `account`... | managed_account |
248249
| `managed_platform_account_get_address_pool` | Get the address pool from a managed platform account Platform accounts only... | managed_account |
@@ -3245,6 +3246,22 @@ Get the number of UTXOs in a managed account # Safety - `account` must be a va
32453246

32463247
---
32473248

3249+
#### `managed_core_account_set_transaction_label`
3250+
3251+
```c
3252+
managed_core_account_set_transaction_label(account: *mut FFIManagedCoreAccount, txid: *const u8, label: *const c_char, error: *mut FFIError,) -> bool
3253+
```
3254+
3255+
**Description:**
3256+
Set a label on a transaction record # Safety - `account` must be a valid, unique pointer to an FFIManagedCoreAccount - `txid` must be a valid pointer to a 32-byte transaction ID - `label` must be a valid null-terminated UTF-8 string, or null to clear the label - `error` must be a valid pointer to an FFIError
3257+
3258+
**Safety:**
3259+
- `account` must be a valid, unique pointer to an FFIManagedCoreAccount - `txid` must be a valid pointer to a 32-byte transaction ID - `label` must be a valid null-terminated UTF-8 string, or null to clear the label - `error` must be a valid pointer to an FFIError
3260+
3261+
**Module:** `managed_account`
3262+
3263+
---
3264+
32483265
#### `managed_platform_account_free`
32493266

32503267
```c

0 commit comments

Comments
 (0)