@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/connect/index.cjs.map +1 -1
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +484 -246
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +171 -23
- package/dist/core/index.d.ts +171 -23
- package/dist/core/index.js +483 -246
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/connect/index.cjs.map +1 -1
- package/dist/impl/browser/connect/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +40 -2
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +40 -2
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/browser/ipfs.cjs.map +1 -1
- package/dist/impl/browser/ipfs.js.map +1 -1
- package/dist/impl/nodejs/connect/index.cjs.map +1 -1
- package/dist/impl/nodejs/connect/index.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +40 -2
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.d.cts +16 -3
- package/dist/impl/nodejs/index.d.ts +16 -3
- package/dist/impl/nodejs/index.js +40 -2
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/index.cjs +540 -297
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +155 -25
- package/dist/index.d.ts +155 -25
- package/dist/index.js +540 -297
- package/dist/index.js.map +1 -1
- package/dist/l1/index.cjs +68 -1
- package/dist/l1/index.cjs.map +1 -1
- package/dist/l1/index.js +68 -1
- package/dist/l1/index.js.map +1 -1
- package/package.json +1 -1
package/dist/l1/index.cjs
CHANGED
|
@@ -444,8 +444,75 @@ function generateHDAddress(masterPriv, chainCode, index) {
|
|
|
444
444
|
return generateAddressInfo(child.privateKey, index, path);
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
+
// constants.ts
|
|
448
|
+
var STORAGE_KEYS_GLOBAL = {
|
|
449
|
+
/** Encrypted BIP39 mnemonic */
|
|
450
|
+
MNEMONIC: "mnemonic",
|
|
451
|
+
/** Encrypted master private key */
|
|
452
|
+
MASTER_KEY: "master_key",
|
|
453
|
+
/** BIP32 chain code */
|
|
454
|
+
CHAIN_CODE: "chain_code",
|
|
455
|
+
/** HD derivation path (full path like m/44'/0'/0'/0/0) */
|
|
456
|
+
DERIVATION_PATH: "derivation_path",
|
|
457
|
+
/** Base derivation path (like m/44'/0'/0' without chain/index) */
|
|
458
|
+
BASE_PATH: "base_path",
|
|
459
|
+
/** Derivation mode: bip32, wif_hmac, legacy_hmac */
|
|
460
|
+
DERIVATION_MODE: "derivation_mode",
|
|
461
|
+
/** Wallet source: mnemonic, file, unknown */
|
|
462
|
+
WALLET_SOURCE: "wallet_source",
|
|
463
|
+
/** Wallet existence flag */
|
|
464
|
+
WALLET_EXISTS: "wallet_exists",
|
|
465
|
+
/** Current active address index */
|
|
466
|
+
CURRENT_ADDRESS_INDEX: "current_address_index",
|
|
467
|
+
/** Nametag cache per address (separate from tracked addresses registry) */
|
|
468
|
+
ADDRESS_NAMETAGS: "address_nametags",
|
|
469
|
+
/** Active addresses registry (JSON: TrackedAddressesStorage) */
|
|
470
|
+
TRACKED_ADDRESSES: "tracked_addresses",
|
|
471
|
+
/** Last processed Nostr wallet event timestamp (unix seconds), keyed per pubkey */
|
|
472
|
+
LAST_WALLET_EVENT_TS: "last_wallet_event_ts",
|
|
473
|
+
/** Group chat: last used relay URL (stale data detection) — global, same relay for all addresses */
|
|
474
|
+
GROUP_CHAT_RELAY_URL: "group_chat_relay_url",
|
|
475
|
+
/** Cached token registry JSON (fetched from remote) */
|
|
476
|
+
TOKEN_REGISTRY_CACHE: "token_registry_cache",
|
|
477
|
+
/** Timestamp of last token registry cache update (ms since epoch) */
|
|
478
|
+
TOKEN_REGISTRY_CACHE_TS: "token_registry_cache_ts",
|
|
479
|
+
/** Cached price data JSON (from CoinGecko or other provider) */
|
|
480
|
+
PRICE_CACHE: "price_cache",
|
|
481
|
+
/** Timestamp of last price cache update (ms since epoch) */
|
|
482
|
+
PRICE_CACHE_TS: "price_cache_ts"
|
|
483
|
+
};
|
|
484
|
+
var STORAGE_KEYS_ADDRESS = {
|
|
485
|
+
/** Pending transfers for this address */
|
|
486
|
+
PENDING_TRANSFERS: "pending_transfers",
|
|
487
|
+
/** Transfer outbox for this address */
|
|
488
|
+
OUTBOX: "outbox",
|
|
489
|
+
/** Conversations for this address */
|
|
490
|
+
CONVERSATIONS: "conversations",
|
|
491
|
+
/** Messages for this address */
|
|
492
|
+
MESSAGES: "messages",
|
|
493
|
+
/** Transaction history for this address */
|
|
494
|
+
TRANSACTION_HISTORY: "transaction_history",
|
|
495
|
+
/** Pending V5 finalization tokens (unconfirmed instant split tokens) */
|
|
496
|
+
PENDING_V5_TOKENS: "pending_v5_tokens",
|
|
497
|
+
/** Group chat: joined groups for this address */
|
|
498
|
+
GROUP_CHAT_GROUPS: "group_chat_groups",
|
|
499
|
+
/** Group chat: messages for this address */
|
|
500
|
+
GROUP_CHAT_MESSAGES: "group_chat_messages",
|
|
501
|
+
/** Group chat: members for this address */
|
|
502
|
+
GROUP_CHAT_MEMBERS: "group_chat_members",
|
|
503
|
+
/** Group chat: processed event IDs for deduplication */
|
|
504
|
+
GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events"
|
|
505
|
+
};
|
|
506
|
+
var STORAGE_KEYS = {
|
|
507
|
+
...STORAGE_KEYS_GLOBAL,
|
|
508
|
+
...STORAGE_KEYS_ADDRESS
|
|
509
|
+
};
|
|
510
|
+
var DEFAULT_BASE_PATH = "m/44'/0'/0'";
|
|
511
|
+
var DEFAULT_DERIVATION_PATH = `${DEFAULT_BASE_PATH}/0/0`;
|
|
512
|
+
var DEFAULT_ELECTRUM_URL = "wss://fulcrum.unicity.network:50004";
|
|
513
|
+
|
|
447
514
|
// l1/network.ts
|
|
448
|
-
var DEFAULT_ENDPOINT =
|
|
515
|
+
var DEFAULT_ENDPOINT = DEFAULT_ELECTRUM_URL;
|
|
449
516
|
var ws = null;
|
|
450
517
|
var isConnected = false;
|
|
451
518
|
var isConnecting = false;
|