@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.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Token as Token$1 } from '@unicitylabs/state-transition-sdk/lib/token/Token';
2
2
  import elliptic from 'elliptic';
3
- export { areSameNametag, hashNametag, isPhoneNumber, normalizeNametag } from '@unicitylabs/nostr-js-sdk';
3
+ export { BindingInfo, ConnectionEventListener, IdentityBindingParams, NostrClient, NostrClientOptions, NostrKeyManager, areSameNametag, decryptNametag, encryptNametag, hashAddressForTag, hashNametag, isPhoneNumber, normalizeNametag } from '@unicitylabs/nostr-js-sdk';
4
4
 
5
5
  /**
6
6
  * Group Chat Types (NIP-29)
@@ -1853,16 +1853,6 @@ interface TransportProvider extends BaseProvider {
1853
1853
  * @returns true if successful, false if nametag is taken by another pubkey
1854
1854
  */
1855
1855
  publishIdentityBinding?(chainPubkey: string, l1Address: string, directAddress: string, nametag?: string): Promise<boolean>;
1856
- /**
1857
- * @deprecated Use publishIdentityBinding instead
1858
- * Register a nametag for this identity
1859
- */
1860
- registerNametag?(nametag: string, chainPubkey: string, directAddress: string): Promise<boolean>;
1861
- /**
1862
- * @deprecated Use publishIdentityBinding instead
1863
- * Publish nametag binding
1864
- */
1865
- publishNametag?(nametag: string, address: string): Promise<void>;
1866
1856
  /**
1867
1857
  * Subscribe to broadcast messages (global/channel)
1868
1858
  */
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Token as Token$1 } from '@unicitylabs/state-transition-sdk/lib/token/Token';
2
2
  import elliptic from 'elliptic';
3
- export { areSameNametag, hashNametag, isPhoneNumber, normalizeNametag } from '@unicitylabs/nostr-js-sdk';
3
+ export { BindingInfo, ConnectionEventListener, IdentityBindingParams, NostrClient, NostrClientOptions, NostrKeyManager, areSameNametag, decryptNametag, encryptNametag, hashAddressForTag, hashNametag, isPhoneNumber, normalizeNametag } from '@unicitylabs/nostr-js-sdk';
4
4
 
5
5
  /**
6
6
  * Group Chat Types (NIP-29)
@@ -1853,16 +1853,6 @@ interface TransportProvider extends BaseProvider {
1853
1853
  * @returns true if successful, false if nametag is taken by another pubkey
1854
1854
  */
1855
1855
  publishIdentityBinding?(chainPubkey: string, l1Address: string, directAddress: string, nametag?: string): Promise<boolean>;
1856
- /**
1857
- * @deprecated Use publishIdentityBinding instead
1858
- * Register a nametag for this identity
1859
- */
1860
- registerNametag?(nametag: string, chainPubkey: string, directAddress: string): Promise<boolean>;
1861
- /**
1862
- * @deprecated Use publishIdentityBinding instead
1863
- * Publish nametag binding
1864
- */
1865
- publishNametag?(nametag: string, address: string): Promise<void>;
1866
1856
  /**
1867
1857
  * Subscribe to broadcast messages (global/channel)
1868
1858
  */
package/dist/index.js CHANGED
@@ -15763,6 +15763,17 @@ var Sphere = class _Sphere {
15763
15763
  if (this._identity?.nametag) {
15764
15764
  throw new SphereError(`Unicity ID already registered for address ${this._currentAddressIndex}: @${this._identity.nametag}`, "ALREADY_INITIALIZED");
15765
15765
  }
15766
+ if (!this._payments.hasNametag()) {
15767
+ logger.debug("Sphere", `Minting nametag token for @${cleanNametag}...`);
15768
+ const result = await this.mintNametag(cleanNametag);
15769
+ if (!result.success) {
15770
+ throw new SphereError(
15771
+ `Failed to mint nametag token: ${result.error}`,
15772
+ "AGGREGATOR_ERROR"
15773
+ );
15774
+ }
15775
+ logger.debug("Sphere", `Nametag token minted successfully`);
15776
+ }
15766
15777
  if (this._transport.publishIdentityBinding) {
15767
15778
  const success = await this._transport.publishIdentityBinding(
15768
15779
  this._identity.chainPubkey,
@@ -15786,15 +15797,6 @@ var Sphere = class _Sphere {
15786
15797
  nametags.set(0, cleanNametag);
15787
15798
  }
15788
15799
  await this.persistAddressNametags();
15789
- if (!this._payments.hasNametag()) {
15790
- logger.debug("Sphere", `Minting nametag token for @${cleanNametag}...`);
15791
- const result = await this.mintNametag(cleanNametag);
15792
- if (!result.success) {
15793
- logger.warn("Sphere", `Failed to mint nametag token: ${result.error}`);
15794
- } else {
15795
- logger.debug("Sphere", `Nametag token minted successfully`);
15796
- }
15797
- }
15798
15800
  this.emitEvent("nametag:registered", {
15799
15801
  nametag: cleanNametag,
15800
15802
  addressIndex: this._currentAddressIndex
@@ -17130,8 +17132,12 @@ import {
17130
17132
  normalizeNametag as normalizeNametag3,
17131
17133
  isPhoneNumber as isPhoneNumber2,
17132
17134
  hashNametag,
17133
- areSameNametag
17135
+ hashAddressForTag,
17136
+ areSameNametag,
17137
+ encryptNametag,
17138
+ decryptNametag
17134
17139
  } from "@unicitylabs/nostr-js-sdk";
17140
+ import { NostrClient as NostrClient2, NostrKeyManager as NostrKeyManager2 } from "@unicitylabs/nostr-js-sdk";
17135
17141
 
17136
17142
  // price/CoinGeckoPriceProvider.ts
17137
17143
  init_logger();
@@ -17403,6 +17409,8 @@ export {
17403
17409
  NETWORKS,
17404
17410
  NIP29_KINDS,
17405
17411
  NOSTR_EVENT_KINDS,
17412
+ NostrClient2 as NostrClient,
17413
+ NostrKeyManager2 as NostrKeyManager,
17406
17414
  PaymentsModule,
17407
17415
  SIGN_MESSAGE_PREFIX,
17408
17416
  STORAGE_KEYS,
@@ -17440,6 +17448,7 @@ export {
17440
17448
  createTokenValidator,
17441
17449
  decodeBech32,
17442
17450
  decryptCMasterKey,
17451
+ decryptNametag,
17443
17452
  decryptPrivateKey,
17444
17453
  decryptTextFormatKey,
17445
17454
  deriveAddressInfo,
@@ -17447,6 +17456,7 @@ export {
17447
17456
  deriveKeyAtPath,
17448
17457
  doubleSha256,
17449
17458
  encodeBech32,
17459
+ encryptNametag,
17450
17460
  extractFromText,
17451
17461
  findPattern,
17452
17462
  forkedKeyFromTokenIdAndState,
@@ -17471,6 +17481,7 @@ export {
17471
17481
  hasUncommittedTransactions,
17472
17482
  hasValidTxfData,
17473
17483
  hash160,
17484
+ hashAddressForTag,
17474
17485
  hashNametag,
17475
17486
  hashSignMessage,
17476
17487
  hexToBytes,