@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.
@@ -15651,6 +15651,17 @@ var Sphere = class _Sphere {
15651
15651
  if (this._identity?.nametag) {
15652
15652
  throw new SphereError(`Unicity ID already registered for address ${this._currentAddressIndex}: @${this._identity.nametag}`, "ALREADY_INITIALIZED");
15653
15653
  }
15654
+ if (!this._payments.hasNametag()) {
15655
+ logger.debug("Sphere", `Minting nametag token for @${cleanNametag}...`);
15656
+ const result = await this.mintNametag(cleanNametag);
15657
+ if (!result.success) {
15658
+ throw new SphereError(
15659
+ `Failed to mint nametag token: ${result.error}`,
15660
+ "AGGREGATOR_ERROR"
15661
+ );
15662
+ }
15663
+ logger.debug("Sphere", `Nametag token minted successfully`);
15664
+ }
15654
15665
  if (this._transport.publishIdentityBinding) {
15655
15666
  const success = await this._transport.publishIdentityBinding(
15656
15667
  this._identity.chainPubkey,
@@ -15674,15 +15685,6 @@ var Sphere = class _Sphere {
15674
15685
  nametags.set(0, cleanNametag);
15675
15686
  }
15676
15687
  await this.persistAddressNametags();
15677
- if (!this._payments.hasNametag()) {
15678
- logger.debug("Sphere", `Minting nametag token for @${cleanNametag}...`);
15679
- const result = await this.mintNametag(cleanNametag);
15680
- if (!result.success) {
15681
- logger.warn("Sphere", `Failed to mint nametag token: ${result.error}`);
15682
- } else {
15683
- logger.debug("Sphere", `Nametag token minted successfully`);
15684
- }
15685
- }
15686
15688
  this.emitEvent("nametag:registered", {
15687
15689
  nametag: cleanNametag,
15688
15690
  addressIndex: this._currentAddressIndex