Skip to content

Commit 4f847d0

Browse files
Merge pull request #380 from bsv-blockchain/fix/registry-client
Fix/registry client
2 parents 6001df3 + 93a6680 commit 4f847d0

File tree

6 files changed

+438
-102
lines changed

6 files changed

+438
-102
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. The format
55
## Table of Contents
66

77
- [Unreleased](#unreleased)
8+
- [1.9.2 - 2025-11-11](#192---2025-11-11)
89
- [1.9.1 - 2025-11-10](#191---2025-11-10)
910
- [1.9.0 - 2025-11-09](#190---2025-11-09)
1011
- [1.8.13 - 2025-11-06](#1813---2025-11-06)
@@ -175,6 +176,15 @@ All notable changes to this project will be documented in this file. The format
175176

176177
---
177178

179+
### [1.9.2] - 2025-11-11
180+
181+
### Fixed
182+
183+
- Fixed bug with RegistryClient definition removal.
184+
- Added support for updating existing registry definitions.
185+
186+
---
187+
178188
### [1.9.1] - 2025-11-10
179189

180190
### Fixed

docs/reference/registry.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,22 +205,27 @@ It provides methods to:
205205
- Register new definitions using pushdrop-based UTXOs.
206206
- Resolve existing definitions using a lookup service.
207207
- List registry entries associated with the operator's wallet.
208-
- Revoke an existing registry entry by spending its UTXO.
208+
- Remove existing registry entries by spending their UTXOs.
209+
- Update existing registry entries.
209210

210211
Registry operators use this client to establish and manage
211212
canonical references for baskets, protocols, and certificate types.
212213

213214
```ts
214215
export class RegistryClient {
215-
constructor(private readonly wallet: WalletInterface = new WalletClient())
216+
constructor(private readonly wallet: WalletInterface = new WalletClient(), options: {
217+
acceptDelayedBroadcast?: boolean;
218+
resolver?: LookupResolver;
219+
} = {})
216220
async registerDefinition(data: DefinitionData): Promise<BroadcastResponse | BroadcastFailure>
217221
async resolve<T extends DefinitionType>(definitionType: T, query: RegistryQueryMapping[T]): Promise<DefinitionData[]>
218222
async listOwnRegistryEntries(definitionType: DefinitionType): Promise<RegistryRecord[]>
219-
async revokeOwnRegistryEntry(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
223+
async removeDefinition(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
224+
async updateDefinition(registryRecord: RegistryRecord, updatedData: DefinitionData): Promise<BroadcastResponse | BroadcastFailure>
220225
}
221226
```
222227

223-
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [DefinitionData](./registry.md#type-definitiondata), [DefinitionType](./registry.md#type-definitiontype), [RegistryQueryMapping](./registry.md#interface-registryquerymapping), [RegistryRecord](./registry.md#type-registryrecord), [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface)
228+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [DefinitionData](./registry.md#type-definitiondata), [DefinitionType](./registry.md#type-definitiontype), [LookupResolver](./overlay-tools.md#class-lookupresolver), [RegistryQueryMapping](./registry.md#interface-registryquerymapping), [RegistryRecord](./registry.md#type-registryrecord), [WalletClient](./wallet.md#class-walletclient), [WalletInterface](./wallet.md#interface-walletinterface)
224229

225230
#### Method listOwnRegistryEntries
226231

@@ -264,6 +269,24 @@ Argument Details
264269
+ **data**
265270
+ Structured information about a 'basket', 'protocol', or 'certificate'.
266271

272+
#### Method removeDefinition
273+
274+
Removes a registry definition by spending its associated UTXO.
275+
276+
```ts
277+
async removeDefinition(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
278+
```
279+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [RegistryRecord](./registry.md#type-registryrecord)
280+
281+
Returns
282+
283+
Broadcast success/failure.
284+
285+
Argument Details
286+
287+
+ **registryRecord**
288+
+ The registry record to remove (must have valid txid, outputIndex, and lockingScript).
289+
267290
#### Method resolve
268291

269292
Resolves registrant tokens of a particular type using a lookup service.
@@ -292,14 +315,14 @@ Argument Details
292315
+ **query**
293316
+ The query object used to filter registry records, whose shape is determined by the registry type.
294317
295-
#### Method revokeOwnRegistryEntry
318+
#### Method updateDefinition
296319
297-
Revokes a registry record by spending its associated UTXO.
320+
Updates an existing registry record by spending its UTXO and creating a new one with updated data.
298321
299322
```ts
300-
async revokeOwnRegistryEntry(registryRecord: RegistryRecord): Promise<BroadcastResponse | BroadcastFailure>
323+
async updateDefinition(registryRecord: RegistryRecord, updatedData: DefinitionData): Promise<BroadcastResponse | BroadcastFailure>
301324
```
302-
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [RegistryRecord](./registry.md#type-registryrecord)
325+
See also: [BroadcastFailure](./transaction.md#interface-broadcastfailure), [BroadcastResponse](./transaction.md#interface-broadcastresponse), [DefinitionData](./registry.md#type-definitiondata), [RegistryRecord](./registry.md#type-registryrecord)
303326
304327
Returns
305328
@@ -308,7 +331,9 @@ Broadcast success/failure.
308331
Argument Details
309332
310333
+ **registryRecord**
311-
+ Must have valid txid, outputIndex, and lockingScript.
334+
+ The existing registry record to update (must have valid txid, outputIndex, and lockingScript).
335+
+ **updatedData**
336+
+ The new definition data to replace the old record.
312337
313338
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
314339

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bsv/sdk",
3-
"version": "1.9.1",
3+
"version": "1.9.2",
44
"type": "module",
55
"description": "BSV Blockchain Software Development Kit",
66
"main": "dist/cjs/mod.js",

0 commit comments

Comments
 (0)