@unicitylabs/sphere-sdk 0.4.6 → 0.4.8

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/l1/index.js CHANGED
@@ -355,8 +355,75 @@ function generateHDAddress(masterPriv, chainCode, index) {
355
355
  return generateAddressInfo(child.privateKey, index, path);
356
356
  }
357
357
 
358
+ // constants.ts
359
+ var STORAGE_KEYS_GLOBAL = {
360
+ /** Encrypted BIP39 mnemonic */
361
+ MNEMONIC: "mnemonic",
362
+ /** Encrypted master private key */
363
+ MASTER_KEY: "master_key",
364
+ /** BIP32 chain code */
365
+ CHAIN_CODE: "chain_code",
366
+ /** HD derivation path (full path like m/44'/0'/0'/0/0) */
367
+ DERIVATION_PATH: "derivation_path",
368
+ /** Base derivation path (like m/44'/0'/0' without chain/index) */
369
+ BASE_PATH: "base_path",
370
+ /** Derivation mode: bip32, wif_hmac, legacy_hmac */
371
+ DERIVATION_MODE: "derivation_mode",
372
+ /** Wallet source: mnemonic, file, unknown */
373
+ WALLET_SOURCE: "wallet_source",
374
+ /** Wallet existence flag */
375
+ WALLET_EXISTS: "wallet_exists",
376
+ /** Current active address index */
377
+ CURRENT_ADDRESS_INDEX: "current_address_index",
378
+ /** Nametag cache per address (separate from tracked addresses registry) */
379
+ ADDRESS_NAMETAGS: "address_nametags",
380
+ /** Active addresses registry (JSON: TrackedAddressesStorage) */
381
+ TRACKED_ADDRESSES: "tracked_addresses",
382
+ /** Last processed Nostr wallet event timestamp (unix seconds), keyed per pubkey */
383
+ LAST_WALLET_EVENT_TS: "last_wallet_event_ts",
384
+ /** Group chat: last used relay URL (stale data detection) — global, same relay for all addresses */
385
+ GROUP_CHAT_RELAY_URL: "group_chat_relay_url",
386
+ /** Cached token registry JSON (fetched from remote) */
387
+ TOKEN_REGISTRY_CACHE: "token_registry_cache",
388
+ /** Timestamp of last token registry cache update (ms since epoch) */
389
+ TOKEN_REGISTRY_CACHE_TS: "token_registry_cache_ts",
390
+ /** Cached price data JSON (from CoinGecko or other provider) */
391
+ PRICE_CACHE: "price_cache",
392
+ /** Timestamp of last price cache update (ms since epoch) */
393
+ PRICE_CACHE_TS: "price_cache_ts"
394
+ };
395
+ var STORAGE_KEYS_ADDRESS = {
396
+ /** Pending transfers for this address */
397
+ PENDING_TRANSFERS: "pending_transfers",
398
+ /** Transfer outbox for this address */
399
+ OUTBOX: "outbox",
400
+ /** Conversations for this address */
401
+ CONVERSATIONS: "conversations",
402
+ /** Messages for this address */
403
+ MESSAGES: "messages",
404
+ /** Transaction history for this address */
405
+ TRANSACTION_HISTORY: "transaction_history",
406
+ /** Pending V5 finalization tokens (unconfirmed instant split tokens) */
407
+ PENDING_V5_TOKENS: "pending_v5_tokens",
408
+ /** Group chat: joined groups for this address */
409
+ GROUP_CHAT_GROUPS: "group_chat_groups",
410
+ /** Group chat: messages for this address */
411
+ GROUP_CHAT_MESSAGES: "group_chat_messages",
412
+ /** Group chat: members for this address */
413
+ GROUP_CHAT_MEMBERS: "group_chat_members",
414
+ /** Group chat: processed event IDs for deduplication */
415
+ GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events"
416
+ };
417
+ var STORAGE_KEYS = {
418
+ ...STORAGE_KEYS_GLOBAL,
419
+ ...STORAGE_KEYS_ADDRESS
420
+ };
421
+ var DEFAULT_BASE_PATH = "m/44'/0'/0'";
422
+ var DEFAULT_DERIVATION_PATH = `${DEFAULT_BASE_PATH}/0/0`;
423
+ var DEFAULT_ELECTRUM_URL = "wss://fulcrum.unicity.network:50004";
424
+
358
425
  // l1/network.ts
359
- var DEFAULT_ENDPOINT = "wss://fulcrum.unicity.network:50004";
426
+ var DEFAULT_ENDPOINT = DEFAULT_ELECTRUM_URL;
360
427
  var ws = null;
361
428
  var isConnected = false;
362
429
  var isConnecting = false;