@unicitylabs/sphere-sdk 0.5.8 → 0.6.0-dev.1

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.
@@ -1275,16 +1275,6 @@ interface TransportProvider extends BaseProvider {
1275
1275
  * @returns true if successful, false if nametag is taken by another pubkey
1276
1276
  */
1277
1277
  publishIdentityBinding?(chainPubkey: string, l1Address: string, directAddress: string, nametag?: string): Promise<boolean>;
1278
- /**
1279
- * @deprecated Use publishIdentityBinding instead
1280
- * Register a nametag for this identity
1281
- */
1282
- registerNametag?(nametag: string, chainPubkey: string, directAddress: string): Promise<boolean>;
1283
- /**
1284
- * @deprecated Use publishIdentityBinding instead
1285
- * Publish nametag binding
1286
- */
1287
- publishNametag?(nametag: string, address: string): Promise<void>;
1288
1278
  /**
1289
1279
  * Subscribe to broadcast messages (global/channel)
1290
1280
  */
@@ -1275,16 +1275,6 @@ interface TransportProvider extends BaseProvider {
1275
1275
  * @returns true if successful, false if nametag is taken by another pubkey
1276
1276
  */
1277
1277
  publishIdentityBinding?(chainPubkey: string, l1Address: string, directAddress: string, nametag?: string): Promise<boolean>;
1278
- /**
1279
- * @deprecated Use publishIdentityBinding instead
1280
- * Register a nametag for this identity
1281
- */
1282
- registerNametag?(nametag: string, chainPubkey: string, directAddress: string): Promise<boolean>;
1283
- /**
1284
- * @deprecated Use publishIdentityBinding instead
1285
- * Publish nametag binding
1286
- */
1287
- publishNametag?(nametag: string, address: string): Promise<void>;
1288
1278
  /**
1289
1279
  * Subscribe to broadcast messages (global/channel)
1290
1280
  */
@@ -15553,6 +15553,17 @@ var Sphere = class _Sphere {
15553
15553
  if (this._identity?.nametag) {
15554
15554
  throw new SphereError(`Unicity ID already registered for address ${this._currentAddressIndex}: @${this._identity.nametag}`, "ALREADY_INITIALIZED");
15555
15555
  }
15556
+ if (!this._payments.hasNametag()) {
15557
+ logger.debug("Sphere", `Minting nametag token for @${cleanNametag}...`);
15558
+ const result = await this.mintNametag(cleanNametag);
15559
+ if (!result.success) {
15560
+ throw new SphereError(
15561
+ `Failed to mint nametag token: ${result.error}`,
15562
+ "AGGREGATOR_ERROR"
15563
+ );
15564
+ }
15565
+ logger.debug("Sphere", `Nametag token minted successfully`);
15566
+ }
15556
15567
  if (this._transport.publishIdentityBinding) {
15557
15568
  const success = await this._transport.publishIdentityBinding(
15558
15569
  this._identity.chainPubkey,
@@ -15576,15 +15587,6 @@ var Sphere = class _Sphere {
15576
15587
  nametags.set(0, cleanNametag);
15577
15588
  }
15578
15589
  await this.persistAddressNametags();
15579
- if (!this._payments.hasNametag()) {
15580
- logger.debug("Sphere", `Minting nametag token for @${cleanNametag}...`);
15581
- const result = await this.mintNametag(cleanNametag);
15582
- if (!result.success) {
15583
- logger.warn("Sphere", `Failed to mint nametag token: ${result.error}`);
15584
- } else {
15585
- logger.debug("Sphere", `Nametag token minted successfully`);
15586
- }
15587
- }
15588
15590
  this.emitEvent("nametag:registered", {
15589
15591
  nametag: cleanNametag,
15590
15592
  addressIndex: this._currentAddressIndex