@bsv/sdk 1.4.11 → 1.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/sdk",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "type": "module",
5
5
  "description": "BSV Blockchain Software Development Kit",
6
6
  "main": "dist/cjs/mod.js",
@@ -199,6 +199,12 @@ export class RegistryClient {
199
199
  throw new Error('Invalid registry record. Missing txid, outputIndex, or lockingScript.')
200
200
  }
201
201
 
202
+ // Check if the registry record belongs to the current user
203
+ const currentIdentityKey = (await this.wallet.getPublicKey({ identityKey: true })).publicKey
204
+ if (registryRecord.registryOperator !== currentIdentityKey) {
205
+ throw new Error('This registry token does not belong to the current wallet.')
206
+ }
207
+
202
208
  // Create a descriptive label for the item we’re revoking
203
209
  const itemIdentifier =
204
210
  registryRecord.definitionType === 'basket'
@@ -421,12 +427,6 @@ export class RegistryClient {
421
427
  throw new Error(`Unsupported definition type: ${definitionType as string}`)
422
428
  }
423
429
 
424
- // Enforce that the pushdrop belongs to the CURRENT identity key
425
- const currentIdentityKey = (await this.wallet.getPublicKey({ identityKey: true })).publicKey
426
- if (registryOperator !== currentIdentityKey) {
427
- throw new Error('This registry token does not belong to the current wallet.')
428
- }
429
-
430
430
  // Return the typed data plus the operator key
431
431
  return { ...parsedData, registryOperator }
432
432
  }