@@ -84,18 +84,21 @@ For interacting with data stored by ldk-node (e.g., `network_graph`, `channel_ma
8484
8585``` swift
8686// Delete an ldk-node key (e.g., stale network graph)
87- let wasDeleted = try await vssDeleteLdk (key : " network_graph" )
87+ let wasDeleted = try await vssDeleteLdk (key : " network_graph" , namespace : . default )
8888
8989// Read an ldk-node key
90- if let item = try await vssGetLdk (key : " network_graph" ) {
90+ if let item = try await vssGetLdk (key : " network_graph" , namespace : . default ) {
9191 print (" Graph size: \( item.value .count ) bytes" )
9292}
9393
94- // List all ldk-node keys
95- let ldkKeys = try await vssListKeysLdk ()
96- for kv in ldkKeys {
94+ // List all ldk-node keys across all namespaces
95+ let allLdkKeys = try await vssListAllKeysLdk ()
96+ for kv in allLdkKeys {
9797 print (" LDK key: \( kv.key ) , Version: \( kv.version ) " )
9898}
99+
100+ // List ldk-node keys in a specific namespace
101+ let defaultKeys = try await vssListKeysLdk (namespace : .default )
99102```
100103
101104### Python
@@ -153,14 +156,14 @@ vss_shutdown_client()
153156
154157``` python
155158# Delete an ldk-node key
156- was_deleted = await vss_delete_ldk(" network_graph" )
159+ was_deleted = await vss_delete_ldk(" network_graph" , LdkNamespace. DEFAULT )
157160
158161# Read an ldk-node key
159- item = await vss_get_ldk(" network_graph" )
162+ item = await vss_get_ldk(" network_graph" , LdkNamespace. DEFAULT )
160163
161- # List all ldk-node keys
162- ldk_keys = await vss_list_keys_ldk ()
163- for kv in ldk_keys :
164+ # List all ldk-node keys across all namespaces
165+ all_ldk_keys = await vss_list_all_keys_ldk ()
166+ for kv in all_ldk_keys :
164167 print (f " LDK key: { kv.key} , Version: { kv.version} " )
165168```
166169
@@ -212,15 +215,18 @@ vssShutdownClient()
212215
213216``` kotlin
214217// Delete an ldk-node key (e.g., stale network graph)
215- val wasDeleted = vssDeleteLdk(key = " network_graph" )
218+ val wasDeleted = vssDeleteLdk(key = " network_graph" , namespace = LdkNamespace . Default )
216219
217220// Read an ldk-node key
218- val graph = vssGetLdk(key = " network_graph" )
221+ val graph = vssGetLdk(key = " network_graph" , namespace = LdkNamespace . Default )
219222graph?.let { println (" Graph size: ${it.value.size} bytes" ) }
220223
221- // List all ldk-node keys
222- val ldkKeys = vssListKeysLdk()
223- ldkKeys.forEach { println (" LDK key: ${it.key} , Version: ${it.version} " ) }
224+ // List all ldk-node keys across all namespaces
225+ val allLdkKeys = vssListAllKeysLdk()
226+ allLdkKeys.forEach { println (" LDK key: ${it.key} , Version: ${it.version} " ) }
227+
228+ // List ldk-node keys in a specific namespace
229+ val defaultKeys = vssListKeysLdk(namespace = LdkNamespace .Default )
224230```
225231
226232## API Reference
@@ -280,20 +286,23 @@ These methods derive the same encryption and obfuscation keys as ldk-node. Use t
280286
281287The standard ` vssStore ` /` vssGet ` /` vssDelete ` methods use different key derivation and ** cannot** read or delete keys written by ldk-node.
282288
283- #### ` vssStoreLdk(key: String, value: Data) -> VssItem `
284- Store a key-value pair using ldk-node's key derivation.
289+ #### ` vssStoreLdk(key: String, value: Data, namespace: LdkNamespace ) -> VssItem `
290+ Store a key-value pair using ldk-node's key derivation in the given namespace .
285291
286- #### ` vssGetLdk(key: String) -> VssItem? `
292+ #### ` vssGetLdk(key: String, namespace: LdkNamespace ) -> VssItem? `
287293Retrieve an item by key using ldk-node's key derivation. Returns ` null ` if not found.
288294
289- #### ` vssDeleteLdk(key: String) -> Bool `
295+ #### ` vssDeleteLdk(key: String, namespace: LdkNamespace ) -> Bool `
290296Delete an item using ldk-node's key derivation. Returns ` true ` if item existed and was deleted.
291297
292- #### ` vssListKeysLdk() -> [KeyVersion] `
293- List all keys stored by ldk-node with their versions .
298+ #### ` vssListKeysLdk(namespace: LdkNamespace ) -> [KeyVersion] `
299+ List keys stored by ldk-node in the given namespace .
294300
295- #### ` vssListLdk() -> [VssItem] `
296- List all items stored by ldk-node with their full data.
301+ #### ` vssListAllKeysLdk() -> [KeyVersion] `
302+ List all keys across all singleton LDK namespaces (Default, Monitors, ArchivedMonitors).
303+
304+ #### ` vssListLdk(namespace: LdkNamespace) -> [VssItem] `
305+ List all items stored by ldk-node in the given namespace with their full data.
297306
298307### Data Types
299308
@@ -310,6 +319,12 @@ List all items stored by ldk-node with their full data.
310319- ` key: String ` - The item key
311320- ` version: Int64 ` - Version number
312321
322+ #### ` LdkNamespace `
323+ - ` Default ` - Default namespace (channel_manager, scorer, etc.)
324+ - ` Monitors ` - Channel monitors
325+ - ` MonitorUpdates(monitorId) ` - Updates for a specific monitor
326+ - ` ArchivedMonitors ` - Archived channel monitors
327+
313328#### ` VssError `
314329Error enum with detailed error information for different failure scenarios.
315330
0 commit comments