@unicitylabs/sphere-sdk 0.5.8 → 0.6.0

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/dist/index.cjs CHANGED
@@ -845,6 +845,8 @@ __export(index_exports, {
845
845
  NETWORKS: () => NETWORKS,
846
846
  NIP29_KINDS: () => NIP29_KINDS,
847
847
  NOSTR_EVENT_KINDS: () => NOSTR_EVENT_KINDS,
848
+ NostrClient: () => import_nostr_js_sdk5.NostrClient,
849
+ NostrKeyManager: () => import_nostr_js_sdk5.NostrKeyManager,
848
850
  PaymentsModule: () => PaymentsModule,
849
851
  SIGN_MESSAGE_PREFIX: () => SIGN_MESSAGE_PREFIX,
850
852
  STORAGE_KEYS: () => STORAGE_KEYS,
@@ -882,6 +884,7 @@ __export(index_exports, {
882
884
  createTokenValidator: () => createTokenValidator,
883
885
  decodeBech32: () => decodeBech32,
884
886
  decryptCMasterKey: () => decryptCMasterKey,
887
+ decryptNametag: () => import_nostr_js_sdk4.decryptNametag,
885
888
  decryptPrivateKey: () => decryptPrivateKey,
886
889
  decryptTextFormatKey: () => decryptTextFormatKey,
887
890
  deriveAddressInfo: () => deriveAddressInfo,
@@ -889,6 +892,7 @@ __export(index_exports, {
889
892
  deriveKeyAtPath: () => deriveKeyAtPath,
890
893
  doubleSha256: () => doubleSha256,
891
894
  encodeBech32: () => encodeBech32,
895
+ encryptNametag: () => import_nostr_js_sdk4.encryptNametag,
892
896
  extractFromText: () => extractFromText,
893
897
  findPattern: () => findPattern,
894
898
  forkedKeyFromTokenIdAndState: () => forkedKeyFromTokenIdAndState,
@@ -913,6 +917,7 @@ __export(index_exports, {
913
917
  hasUncommittedTransactions: () => hasUncommittedTransactions,
914
918
  hasValidTxfData: () => hasValidTxfData,
915
919
  hash160: () => hash160,
920
+ hashAddressForTag: () => import_nostr_js_sdk4.hashAddressForTag,
916
921
  hashNametag: () => import_nostr_js_sdk4.hashNametag,
917
922
  hashSignMessage: () => hashSignMessage,
918
923
  hexToBytes: () => hexToBytes,
@@ -15927,6 +15932,17 @@ var Sphere = class _Sphere {
15927
15932
  if (this._identity?.nametag) {
15928
15933
  throw new SphereError(`Unicity ID already registered for address ${this._currentAddressIndex}: @${this._identity.nametag}`, "ALREADY_INITIALIZED");
15929
15934
  }
15935
+ if (!this._payments.hasNametag()) {
15936
+ logger.debug("Sphere", `Minting nametag token for @${cleanNametag}...`);
15937
+ const result = await this.mintNametag(cleanNametag);
15938
+ if (!result.success) {
15939
+ throw new SphereError(
15940
+ `Failed to mint nametag token: ${result.error}`,
15941
+ "AGGREGATOR_ERROR"
15942
+ );
15943
+ }
15944
+ logger.debug("Sphere", `Nametag token minted successfully`);
15945
+ }
15930
15946
  if (this._transport.publishIdentityBinding) {
15931
15947
  const success = await this._transport.publishIdentityBinding(
15932
15948
  this._identity.chainPubkey,
@@ -15950,15 +15966,6 @@ var Sphere = class _Sphere {
15950
15966
  nametags.set(0, cleanNametag);
15951
15967
  }
15952
15968
  await this.persistAddressNametags();
15953
- if (!this._payments.hasNametag()) {
15954
- logger.debug("Sphere", `Minting nametag token for @${cleanNametag}...`);
15955
- const result = await this.mintNametag(cleanNametag);
15956
- if (!result.success) {
15957
- logger.warn("Sphere", `Failed to mint nametag token: ${result.error}`);
15958
- } else {
15959
- logger.debug("Sphere", `Nametag token minted successfully`);
15960
- }
15961
- }
15962
15969
  this.emitEvent("nametag:registered", {
15963
15970
  nametag: cleanNametag,
15964
15971
  addressIndex: this._currentAddressIndex
@@ -17291,6 +17298,7 @@ function createTokenValidator(options) {
17291
17298
 
17292
17299
  // index.ts
17293
17300
  var import_nostr_js_sdk4 = require("@unicitylabs/nostr-js-sdk");
17301
+ var import_nostr_js_sdk5 = require("@unicitylabs/nostr-js-sdk");
17294
17302
 
17295
17303
  // price/CoinGeckoPriceProvider.ts
17296
17304
  init_logger();
@@ -17563,6 +17571,8 @@ function createPriceProvider(config) {
17563
17571
  NETWORKS,
17564
17572
  NIP29_KINDS,
17565
17573
  NOSTR_EVENT_KINDS,
17574
+ NostrClient,
17575
+ NostrKeyManager,
17566
17576
  PaymentsModule,
17567
17577
  SIGN_MESSAGE_PREFIX,
17568
17578
  STORAGE_KEYS,
@@ -17600,6 +17610,7 @@ function createPriceProvider(config) {
17600
17610
  createTokenValidator,
17601
17611
  decodeBech32,
17602
17612
  decryptCMasterKey,
17613
+ decryptNametag,
17603
17614
  decryptPrivateKey,
17604
17615
  decryptTextFormatKey,
17605
17616
  deriveAddressInfo,
@@ -17607,6 +17618,7 @@ function createPriceProvider(config) {
17607
17618
  deriveKeyAtPath,
17608
17619
  doubleSha256,
17609
17620
  encodeBech32,
17621
+ encryptNametag,
17610
17622
  extractFromText,
17611
17623
  findPattern,
17612
17624
  forkedKeyFromTokenIdAndState,
@@ -17631,6 +17643,7 @@ function createPriceProvider(config) {
17631
17643
  hasUncommittedTransactions,
17632
17644
  hasValidTxfData,
17633
17645
  hash160,
17646
+ hashAddressForTag,
17634
17647
  hashNametag,
17635
17648
  hashSignMessage,
17636
17649
  hexToBytes,