@unicitylabs/sphere-sdk 0.5.1 → 0.5.3

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.
Files changed (43) hide show
  1. package/dist/connect/index.cjs +3 -1
  2. package/dist/connect/index.cjs.map +1 -1
  3. package/dist/connect/index.js +3 -1
  4. package/dist/connect/index.js.map +1 -1
  5. package/dist/core/index.cjs +669 -277
  6. package/dist/core/index.cjs.map +1 -1
  7. package/dist/core/index.d.cts +57 -2
  8. package/dist/core/index.d.ts +57 -2
  9. package/dist/core/index.js +669 -277
  10. package/dist/core/index.js.map +1 -1
  11. package/dist/impl/browser/connect/index.cjs +3 -1
  12. package/dist/impl/browser/connect/index.cjs.map +1 -1
  13. package/dist/impl/browser/connect/index.js +3 -1
  14. package/dist/impl/browser/connect/index.js.map +1 -1
  15. package/dist/impl/browser/index.cjs +11 -3
  16. package/dist/impl/browser/index.cjs.map +1 -1
  17. package/dist/impl/browser/index.js +11 -3
  18. package/dist/impl/browser/index.js.map +1 -1
  19. package/dist/impl/browser/ipfs.cjs +9 -2
  20. package/dist/impl/browser/ipfs.cjs.map +1 -1
  21. package/dist/impl/browser/ipfs.js +9 -2
  22. package/dist/impl/browser/ipfs.js.map +1 -1
  23. package/dist/impl/nodejs/connect/index.cjs +3 -1
  24. package/dist/impl/nodejs/connect/index.cjs.map +1 -1
  25. package/dist/impl/nodejs/connect/index.js +3 -1
  26. package/dist/impl/nodejs/connect/index.js.map +1 -1
  27. package/dist/impl/nodejs/index.cjs +11 -3
  28. package/dist/impl/nodejs/index.cjs.map +1 -1
  29. package/dist/impl/nodejs/index.d.cts +7 -0
  30. package/dist/impl/nodejs/index.d.ts +7 -0
  31. package/dist/impl/nodejs/index.js +11 -3
  32. package/dist/impl/nodejs/index.js.map +1 -1
  33. package/dist/index.cjs +671 -277
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +128 -3
  36. package/dist/index.d.ts +128 -3
  37. package/dist/index.js +670 -277
  38. package/dist/index.js.map +1 -1
  39. package/dist/l1/index.cjs +3 -1
  40. package/dist/l1/index.cjs.map +1 -1
  41. package/dist/l1/index.js +3 -1
  42. package/dist/l1/index.js.map +1 -1
  43. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -711,6 +711,70 @@ interface UnconfirmedResolutionResult {
711
711
  status: 'resolved' | 'pending' | 'failed';
712
712
  }>;
713
713
  }
714
+ /**
715
+ * A single direct (whole-token) transfer entry inside a combined bundle.
716
+ * The receiver processes each entry the same way as a standalone NOSTR-FIRST
717
+ * commitment-only transfer.
718
+ */
719
+ interface DirectTokenEntry {
720
+ /** JSON-serialized SDK token */
721
+ sourceToken: string;
722
+ /** JSON-serialized TransferCommitment */
723
+ commitmentData: string;
724
+ /** Token value (display metadata) */
725
+ amount: string;
726
+ /** Coin ID hex */
727
+ coinId: string;
728
+ /** Extracted tokenId for receiver-side dedup (optional) */
729
+ tokenId?: string;
730
+ }
731
+ /**
732
+ * Combined Transfer Bundle V6
733
+ *
734
+ * Packs ALL tokens for a single send() operation into ONE Nostr message:
735
+ * - An optional V5 split bundle (when the sender had to split a token)
736
+ * - Zero or more direct token entries (whole tokens transferred as-is)
737
+ *
738
+ * Benefits over V5 + NOSTR-FIRST multi-message approach:
739
+ * - Single Nostr event = no relay overwrite issues (kind 31113 replaceable events)
740
+ * - Atomic delivery: all tokens arrive together or not at all
741
+ * - One notification, one history entry on receiver side
742
+ */
743
+ interface CombinedTransferBundleV6 {
744
+ /** Bundle version */
745
+ version: '6.0';
746
+ /** Bundle type identifier */
747
+ type: 'COMBINED_TRANSFER';
748
+ /** Transfer ID (matches sender's TransferResult.id) */
749
+ transferId: string;
750
+ /** V5 split bundle (null if no split was needed) */
751
+ splitBundle: InstantSplitBundleV5 | null;
752
+ /** Direct tokens sent without splitting */
753
+ directTokens: DirectTokenEntry[];
754
+ /** Total transfer amount (display metadata) */
755
+ totalAmount: string;
756
+ /** Coin ID hex */
757
+ coinId: string;
758
+ /** Sender's transport pubkey */
759
+ senderPubkey: string;
760
+ /** Optional memo (one per transfer) */
761
+ memo?: string;
762
+ }
763
+ /**
764
+ * Type guard for CombinedTransferBundleV6
765
+ */
766
+ declare function isCombinedTransferBundleV6(obj: unknown): obj is CombinedTransferBundleV6;
767
+ /**
768
+ * Result of building a split bundle (without sending it)
769
+ */
770
+ interface BuildSplitBundleResult {
771
+ /** The constructed V5 bundle */
772
+ bundle: InstantSplitBundleV5;
773
+ /** Split group ID for correlation */
774
+ splitGroupId: string;
775
+ /** Call this after transport delivery to start background mint proof + change token creation */
776
+ startBackground: () => Promise<void>;
777
+ }
714
778
 
715
779
  /**
716
780
  * Payment Session Types
@@ -942,6 +1006,8 @@ interface Asset {
942
1006
  readonly confirmedTokenCount: number;
943
1007
  /** Number of unconfirmed tokens aggregated */
944
1008
  readonly unconfirmedTokenCount: number;
1009
+ /** Number of tokens currently being sent */
1010
+ readonly transferringTokenCount: number;
945
1011
  /** Price per whole unit in USD (null if PriceProvider not configured) */
946
1012
  readonly priceUsd: number | null;
947
1013
  /** Price per whole unit in EUR (null if PriceProvider not configured) */
@@ -1508,6 +1574,12 @@ interface HistoryRecord {
1508
1574
  recipientNametag?: string;
1509
1575
  /** Optional memo/message attached to the transfer */
1510
1576
  memo?: string;
1577
+ /** All token IDs in a combined transfer (V6 bundle breakdown) */
1578
+ tokenIds?: Array<{
1579
+ id: string;
1580
+ amount: string;
1581
+ source: 'split' | 'direct';
1582
+ }>;
1511
1583
  }
1512
1584
  /**
1513
1585
  * Storage result types
@@ -1599,6 +1671,7 @@ interface TxfStorageDataBase {
1599
1671
  _outbox?: TxfOutboxEntry[];
1600
1672
  _sent?: TxfSentEntry[];
1601
1673
  _invalid?: TxfInvalidEntry[];
1674
+ _history?: HistoryRecord[];
1602
1675
  [key: `_${string}`]: unknown;
1603
1676
  }
1604
1677
  interface TxfMeta {
@@ -2577,6 +2650,7 @@ declare class PaymentsModule {
2577
2650
  private loadedPromise;
2578
2651
  private loaded;
2579
2652
  private processedSplitGroupIds;
2653
+ private processedCombinedTransferIds;
2580
2654
  private storageEventUnsubscribers;
2581
2655
  private syncDebounceTimer;
2582
2656
  private static readonly SYNC_DEBOUNCE_MS;
@@ -2646,6 +2720,43 @@ declare class PaymentsModule {
2646
2720
  * @returns InstantSplitResult with timing info
2647
2721
  */
2648
2722
  sendInstant(request: TransferRequest, options?: InstantSplitOptions): Promise<InstantSplitResult>;
2723
+ /**
2724
+ * Save a V5 split bundle as an unconfirmed token (shared by V5 standalone and V6 combined).
2725
+ * Returns the created UI token, or null if deduped.
2726
+ *
2727
+ * @param deferPersistence - If true, skip addToken/save calls (caller batches them).
2728
+ * The token is still added to the in-memory map for dedup; caller must call save().
2729
+ */
2730
+ private saveUnconfirmedV5Token;
2731
+ /**
2732
+ * Save a commitment-only (NOSTR-FIRST) token and start proof polling.
2733
+ * Shared by standalone NOSTR-FIRST handler and V6 combined handler.
2734
+ * Returns the created UI token, or null if deduped/tombstoned.
2735
+ *
2736
+ * @param deferPersistence - If true, skip save() and commitment submission
2737
+ * (caller batches them). Token is added to in-memory map + proof polling is queued.
2738
+ * @param skipGenesisDedup - If true, skip genesis-ID-only dedup. V6 handler sets this
2739
+ * because bundle-level dedup protects against replays, and split children share genesis IDs.
2740
+ */
2741
+ private saveCommitmentOnlyToken;
2742
+ /**
2743
+ * Process a received COMBINED_TRANSFER V6 bundle.
2744
+ *
2745
+ * Unpacks a single Nostr message into its component tokens:
2746
+ * - Optional V5 split bundle (saved as unconfirmed, resolved lazily)
2747
+ * - Zero or more direct tokens (saved as unconfirmed, proof-polled)
2748
+ *
2749
+ * Emits ONE transfer:incoming event and records ONE history entry.
2750
+ */
2751
+ private processCombinedTransferBundle;
2752
+ /**
2753
+ * Persist processed combined transfer IDs to KV storage.
2754
+ */
2755
+ private saveProcessedCombinedTransferIds;
2756
+ /**
2757
+ * Load processed combined transfer IDs from KV storage.
2758
+ */
2759
+ private loadProcessedCombinedTransferIds;
2649
2760
  /**
2650
2761
  * Process a received INSTANT_SPLIT bundle.
2651
2762
  *
@@ -2836,7 +2947,8 @@ declare class PaymentsModule {
2836
2947
  getAssets(coinId?: string): Promise<Asset[]>;
2837
2948
  /**
2838
2949
  * Aggregate tokens by coinId with confirmed/unconfirmed breakdown.
2839
- * Excludes tokens with status 'spent', 'invalid', or 'transferring'.
2950
+ * Excludes tokens with status 'spent' or 'invalid'.
2951
+ * Tokens with status 'transferring' are counted as unconfirmed (visible in UI as "Sending").
2840
2952
  */
2841
2953
  private aggregateTokens;
2842
2954
  /**
@@ -3087,6 +3199,13 @@ declare class PaymentsModule {
3087
3199
  * Also performs one-time migration from legacy KV storage.
3088
3200
  */
3089
3201
  loadHistory(): Promise<void>;
3202
+ /**
3203
+ * Import history entries from remote TXF data into local store.
3204
+ * Delegates to the local TokenStorageProvider's importHistoryEntries() for
3205
+ * persistent storage, with in-memory fallback.
3206
+ * Reused by both load() (initial IPFS fetch) and _doSync() (merge result).
3207
+ */
3208
+ private importRemoteHistoryEntries;
3090
3209
  /**
3091
3210
  * Get the first local token storage provider (for history operations).
3092
3211
  */
@@ -3236,7 +3355,7 @@ declare class PaymentsModule {
3236
3355
  /**
3237
3356
  * Handle NOSTR-FIRST commitment-only transfer (recipient side)
3238
3357
  * This is called when receiving a transfer with only commitmentData and no proof yet.
3239
- * We create the token as 'submitted', submit commitment (idempotent), and poll for proof.
3358
+ * Delegates to saveCommitmentOnlyToken() helper, then emits event + records history.
3240
3359
  */
3241
3360
  private handleCommitmentOnlyTransfer;
3242
3361
  /**
@@ -3779,6 +3898,8 @@ declare const STORAGE_KEYS_ADDRESS: {
3779
3898
  readonly GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events";
3780
3899
  /** Processed V5 split group IDs for Nostr re-delivery dedup */
3781
3900
  readonly PROCESSED_SPLIT_GROUP_IDS: "processed_split_group_ids";
3901
+ /** Processed V6 combined transfer IDs for Nostr re-delivery dedup */
3902
+ readonly PROCESSED_COMBINED_TRANSFER_IDS: "processed_combined_transfer_ids";
3782
3903
  };
3783
3904
  /** @deprecated Use STORAGE_KEYS_GLOBAL and STORAGE_KEYS_ADDRESS instead */
3784
3905
  declare const STORAGE_KEYS: {
@@ -3804,6 +3925,8 @@ declare const STORAGE_KEYS: {
3804
3925
  readonly GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events";
3805
3926
  /** Processed V5 split group IDs for Nostr re-delivery dedup */
3806
3927
  readonly PROCESSED_SPLIT_GROUP_IDS: "processed_split_group_ids";
3928
+ /** Processed V6 combined transfer IDs for Nostr re-delivery dedup */
3929
+ readonly PROCESSED_COMBINED_TRANSFER_IDS: "processed_combined_transfer_ids";
3807
3930
  /** Encrypted BIP39 mnemonic */
3808
3931
  readonly MNEMONIC: "mnemonic";
3809
3932
  /** Encrypted master private key */
@@ -5472,6 +5595,7 @@ declare function buildTxfStorageData(tokens: Token[], meta: Omit<TxfMeta$1, 'for
5472
5595
  outboxEntries?: OutboxEntry[];
5473
5596
  mintOutboxEntries?: MintOutboxEntry[];
5474
5597
  invalidatedNametags?: InvalidatedNametagEntry[];
5598
+ historyEntries?: HistoryRecord[];
5475
5599
  }): Promise<TxfStorageData>;
5476
5600
  interface ParsedStorageData {
5477
5601
  tokens: Token[];
@@ -5483,6 +5607,7 @@ interface ParsedStorageData {
5483
5607
  outboxEntries: OutboxEntry[];
5484
5608
  mintOutboxEntries: MintOutboxEntry[];
5485
5609
  invalidatedNametags: InvalidatedNametagEntry[];
5610
+ historyEntries: HistoryRecord[];
5486
5611
  validationErrors: string[];
5487
5612
  }
5488
5613
  /**
@@ -6624,4 +6749,4 @@ declare function getCoinIdBySymbol(symbol: string): string | undefined;
6624
6749
  */
6625
6750
  declare function getCoinIdByName(name: string): string | undefined;
6626
6751
 
6627
- export { type AddressInfo, type AddressMode, type AggregatorClient, type AggregatorEvent, type AggregatorEventCallback, type AggregatorEventType, type AggregatorProvider, type AggregatorProviderConfig, type Asset, type BackgroundProgressStatus, type BaseProvider, type BroadcastHandler, type BroadcastMessage, type CMasterKeyData, COIN_TYPES, type CheckNetworkHealthOptions, CoinGeckoPriceProvider, CommunicationsModule, type CommunicationsModuleConfig, type CommunicationsModuleDependencies, type ComposingIndicator, type ConversationPage, type CreateGroupOptions, DEFAULT_AGGREGATOR_TIMEOUT, DEFAULT_AGGREGATOR_URL, DEFAULT_DERIVATION_PATH, DEFAULT_ELECTRUM_URL, DEFAULT_GROUP_RELAYS, DEFAULT_IPFS_BOOTSTRAP_PEERS, DEFAULT_IPFS_GATEWAYS, DEFAULT_MARKET_API_URL, DEFAULT_NOSTR_RELAYS, DEV_AGGREGATOR_URL, type DecryptionProgressCallback, type DerivationMode, type DirectMessage, type DiscoverAddressProgress, type DiscoverAddressesOptions, type DiscoverAddressesResult, type DiscoveredAddress, type ExtendedValidationResult, type FullIdentity, type GetConversationPageOptions, GroupChatModule, type GroupChatModuleConfig, type GroupChatModuleDependencies, type GroupData, type GroupMemberData, type GroupMessageData, GroupRole, GroupVisibility, type HealthCheckFn, type Identity, type IdentityConfig, type InclusionProof, type IncomingBroadcast, type IncomingMessage, type IncomingPaymentRequest$1 as IncomingPaymentRequest, type IncomingTokenTransfer, type IncomingTransfer, type InitProgress, type InitProgressCallback, type InitProgressStep, type InstantSplitBundle, type InstantSplitBundleV4, type InstantSplitBundleV5, type InstantSplitOptions, type InstantSplitProcessResult, type InstantSplitResult, type InstantSplitV5RecoveryMetadata, type IntentStatus, type IntentType, type InvalidatedNametagEntry, index as L1, type L1Balance, L1PaymentsModule, type L1PaymentsModuleConfig, type L1PaymentsModuleDependencies, type L1SendRequest, type L1SendResult, type L1Transaction, type L1Utxo, LIMITS, type LegacyFileImportOptions, type LegacyFileInfo, type LegacyFileParseResult, type LegacyFileParsedData, type LegacyFileType, type LoadResult, type LoggingConfig, type MarketIntent, MarketModule, type MarketModuleConfig, type MarketModuleDependencies, type MessageHandler, type MintOutboxEntry, type MintParams, type MintResult, NETWORKS, NIP29_KINDS, NOSTR_EVENT_KINDS, type NametagData, type NetworkHealthResult, type NetworkType, type OracleEvent, type OracleEventCallback, type OracleEventType, type OracleProvider, type OutboxEntry, type OutgoingPaymentRequest, type ParsedStorageData, type PaymentRequest, type PaymentRequestHandler$1 as PaymentRequestHandler, type PaymentRequestResponse, type PaymentRequestResponseHandler$1 as PaymentRequestResponseHandler, type PaymentRequestResponseType$1 as PaymentRequestResponseType, type PaymentRequestResult, type PaymentRequestStatus, type PaymentSession, type PaymentSessionDirection, type PaymentSessionError, type PaymentSessionErrorCode, type PaymentSessionStatus, PaymentsModule, type PaymentsModuleConfig, type PaymentsModuleDependencies, type PeerInfo, type PendingV5Finalization, type PostIntentRequest, type PostIntentResult, type PricePlatform, type PriceProvider, type PriceProviderConfig, type ProviderMetadata, type ProviderRole, type ProviderStatus, type ProviderStatusInfo, type ReceiveOptions, type ReceiveResult, type RegistryNetwork, STORAGE_KEYS, STORAGE_KEYS_ADDRESS, STORAGE_KEYS_GLOBAL, STORAGE_PREFIX, type SaveResult, type ScanAddressProgress, type ScanAddressesOptions, type ScanAddressesResult, type ScannedAddressResult, type SearchFilters, type SearchIntentResult, type SearchOptions, type SearchResult, type ServiceHealthResult, type SpentTokenInfo, type SpentTokenResult, Sphere, type SphereConfig, type SphereCreateOptions, SphereError, type SphereErrorCode, type SphereEventHandler, type SphereEventMap, type SphereEventType, type SphereImportOptions, type SphereInitOptions, type SphereInitResult, type SphereLoadOptions, type SphereStatus, type SplitPaymentSession, type SplitRecoveryResult, type StorageEvent, type StorageEventCallback, type StorageEventType, type StorageProvider, type StorageProviderConfig, type SubmitResult, type SyncResult, TEST_AGGREGATOR_URL, TEST_ELECTRUM_URL, TEST_NOSTR_RELAYS, TIMEOUTS, type Token, type TokenDefinition, type TokenIcon, type TokenPrice, TokenRegistry, type TokenState, type TokenStatus, type TokenStorageProvider, type TokenTransferDetail, type TokenTransferHandler, type TokenTransferPayload, type ValidationResult as TokenValidationResult, TokenValidator, type TombstoneEntry, type TrackedAddress, type TrackedAddressEntry, type TransactionHistoryEntry, type TransferCommitment, type TransferMode, type TransferRequest, type TransferResult, type TransferStatus, type TransportEvent, type TransportEventCallback, type TransportEventType, type TransportProvider, type TransportProviderConfig, type TrustBaseLoader, type TxfAuthenticator, type TxfGenesis, type TxfGenesisData, type TxfInclusionProof, type TxfIntegrity, type TxfInvalidEntry, type TxfMerkleStep, type TxfMerkleTreePath, type TxfMeta, type TxfOutboxEntry, type TxfSentEntry, type TxfState, type TxfStorageData, type TxfStorageDataBase, type TxfToken, type TxfTombstone, type TxfTransaction, type UnconfirmedResolutionResult, type V5FinalizationStage, type ValidationAction, type ValidationIssue, type ValidationResult$1 as ValidationResult, type WaitOptions, type WalletDatInfo, type WalletInfo, type WalletJSON$1 as WalletJSON, type WalletJSONExportOptions$1 as WalletJSONExportOptions, type WalletSource, archivedKeyFromTokenId, base58Decode, base58Encode, buildTxfStorageData, bytesToHex, checkNetworkHealth, countCommittedTransactions, createAddress, createCommunicationsModule, createGroupChatModule, createKeyPair, createL1PaymentsModule, createMarketModule, createPaymentSession, createPaymentSessionError, createPaymentsModule, createPriceProvider, createSphere, createSplitPaymentSession, createTokenValidator, decodeBech32, decryptCMasterKey, decryptPrivateKey, decryptTextFormatKey, deriveAddressInfo, deriveChildKey$1 as deriveChildKey, deriveKeyAtPath$1 as deriveKeyAtPath, doubleSha256, encodeBech32, extractFromText, findPattern, forkedKeyFromTokenIdAndState, formatAmount, generateMasterKey, generateMnemonic, getAddressHrp, getAddressId, getAddressStorageKey, getCoinIdByName, getCoinIdBySymbol, getCurrentStateHash, getPublicKey, getSphere, getTokenDecimals, getTokenDefinition, getTokenIconUrl, getTokenId, getTokenName, getTokenSymbol, hasMissingNewStateHash, hasUncommittedTransactions, hasValidTxfData, hash160, hexToBytes, identityFromMnemonicSync, initSphere, isArchivedKey, isForkedKey, isInstantSplitBundle, isInstantSplitBundleV4, isInstantSplitBundleV5, isKnownToken, isPaymentSessionTerminal, isPaymentSessionTimedOut, isSQLiteDatabase, isTextWalletEncrypted, isTokenKey, isValidBech32, isValidNametag, isValidPrivateKey, isValidTokenId, isWalletDatEncrypted, isWalletTextFormat, keyFromTokenId, loadSphere, mnemonicToSeedSync, normalizeSdkTokenToStorage, objectToTxf, parseAndDecryptWalletDat, parseAndDecryptWalletText, parseForkedKey, parseTxfStorageData, parseWalletDat, parseWalletText, randomBytes, randomHex, randomUUID, ripemd160, sha256, sleep, sphereExists, toHumanReadable, toSmallestUnit, tokenIdFromArchivedKey, tokenIdFromKey, tokenToTxf, txfToToken, validateMnemonic };
6752
+ export { type AddressInfo, type AddressMode, type AggregatorClient, type AggregatorEvent, type AggregatorEventCallback, type AggregatorEventType, type AggregatorProvider, type AggregatorProviderConfig, type Asset, type BackgroundProgressStatus, type BaseProvider, type BroadcastHandler, type BroadcastMessage, type BuildSplitBundleResult, type CMasterKeyData, COIN_TYPES, type CheckNetworkHealthOptions, CoinGeckoPriceProvider, type CombinedTransferBundleV6, CommunicationsModule, type CommunicationsModuleConfig, type CommunicationsModuleDependencies, type ComposingIndicator, type ConversationPage, type CreateGroupOptions, DEFAULT_AGGREGATOR_TIMEOUT, DEFAULT_AGGREGATOR_URL, DEFAULT_DERIVATION_PATH, DEFAULT_ELECTRUM_URL, DEFAULT_GROUP_RELAYS, DEFAULT_IPFS_BOOTSTRAP_PEERS, DEFAULT_IPFS_GATEWAYS, DEFAULT_MARKET_API_URL, DEFAULT_NOSTR_RELAYS, DEV_AGGREGATOR_URL, type DecryptionProgressCallback, type DerivationMode, type DirectMessage, type DirectTokenEntry, type DiscoverAddressProgress, type DiscoverAddressesOptions, type DiscoverAddressesResult, type DiscoveredAddress, type ExtendedValidationResult, type FullIdentity, type GetConversationPageOptions, GroupChatModule, type GroupChatModuleConfig, type GroupChatModuleDependencies, type GroupData, type GroupMemberData, type GroupMessageData, GroupRole, GroupVisibility, type HealthCheckFn, type Identity, type IdentityConfig, type InclusionProof, type IncomingBroadcast, type IncomingMessage, type IncomingPaymentRequest$1 as IncomingPaymentRequest, type IncomingTokenTransfer, type IncomingTransfer, type InitProgress, type InitProgressCallback, type InitProgressStep, type InstantSplitBundle, type InstantSplitBundleV4, type InstantSplitBundleV5, type InstantSplitOptions, type InstantSplitProcessResult, type InstantSplitResult, type InstantSplitV5RecoveryMetadata, type IntentStatus, type IntentType, type InvalidatedNametagEntry, index as L1, type L1Balance, L1PaymentsModule, type L1PaymentsModuleConfig, type L1PaymentsModuleDependencies, type L1SendRequest, type L1SendResult, type L1Transaction, type L1Utxo, LIMITS, type LegacyFileImportOptions, type LegacyFileInfo, type LegacyFileParseResult, type LegacyFileParsedData, type LegacyFileType, type LoadResult, type LoggingConfig, type MarketIntent, MarketModule, type MarketModuleConfig, type MarketModuleDependencies, type MessageHandler, type MintOutboxEntry, type MintParams, type MintResult, NETWORKS, NIP29_KINDS, NOSTR_EVENT_KINDS, type NametagData, type NetworkHealthResult, type NetworkType, type OracleEvent, type OracleEventCallback, type OracleEventType, type OracleProvider, type OutboxEntry, type OutgoingPaymentRequest, type ParsedStorageData, type PaymentRequest, type PaymentRequestHandler$1 as PaymentRequestHandler, type PaymentRequestResponse, type PaymentRequestResponseHandler$1 as PaymentRequestResponseHandler, type PaymentRequestResponseType$1 as PaymentRequestResponseType, type PaymentRequestResult, type PaymentRequestStatus, type PaymentSession, type PaymentSessionDirection, type PaymentSessionError, type PaymentSessionErrorCode, type PaymentSessionStatus, PaymentsModule, type PaymentsModuleConfig, type PaymentsModuleDependencies, type PeerInfo, type PendingV5Finalization, type PostIntentRequest, type PostIntentResult, type PricePlatform, type PriceProvider, type PriceProviderConfig, type ProviderMetadata, type ProviderRole, type ProviderStatus, type ProviderStatusInfo, type ReceiveOptions, type ReceiveResult, type RegistryNetwork, STORAGE_KEYS, STORAGE_KEYS_ADDRESS, STORAGE_KEYS_GLOBAL, STORAGE_PREFIX, type SaveResult, type ScanAddressProgress, type ScanAddressesOptions, type ScanAddressesResult, type ScannedAddressResult, type SearchFilters, type SearchIntentResult, type SearchOptions, type SearchResult, type ServiceHealthResult, type SpentTokenInfo, type SpentTokenResult, Sphere, type SphereConfig, type SphereCreateOptions, SphereError, type SphereErrorCode, type SphereEventHandler, type SphereEventMap, type SphereEventType, type SphereImportOptions, type SphereInitOptions, type SphereInitResult, type SphereLoadOptions, type SphereStatus, type SplitPaymentSession, type SplitRecoveryResult, type StorageEvent, type StorageEventCallback, type StorageEventType, type StorageProvider, type StorageProviderConfig, type SubmitResult, type SyncResult, TEST_AGGREGATOR_URL, TEST_ELECTRUM_URL, TEST_NOSTR_RELAYS, TIMEOUTS, type Token, type TokenDefinition, type TokenIcon, type TokenPrice, TokenRegistry, type TokenState, type TokenStatus, type TokenStorageProvider, type TokenTransferDetail, type TokenTransferHandler, type TokenTransferPayload, type ValidationResult as TokenValidationResult, TokenValidator, type TombstoneEntry, type TrackedAddress, type TrackedAddressEntry, type TransactionHistoryEntry, type TransferCommitment, type TransferMode, type TransferRequest, type TransferResult, type TransferStatus, type TransportEvent, type TransportEventCallback, type TransportEventType, type TransportProvider, type TransportProviderConfig, type TrustBaseLoader, type TxfAuthenticator, type TxfGenesis, type TxfGenesisData, type TxfInclusionProof, type TxfIntegrity, type TxfInvalidEntry, type TxfMerkleStep, type TxfMerkleTreePath, type TxfMeta, type TxfOutboxEntry, type TxfSentEntry, type TxfState, type TxfStorageData, type TxfStorageDataBase, type TxfToken, type TxfTombstone, type TxfTransaction, type UnconfirmedResolutionResult, type V5FinalizationStage, type ValidationAction, type ValidationIssue, type ValidationResult$1 as ValidationResult, type WaitOptions, type WalletDatInfo, type WalletInfo, type WalletJSON$1 as WalletJSON, type WalletJSONExportOptions$1 as WalletJSONExportOptions, type WalletSource, archivedKeyFromTokenId, base58Decode, base58Encode, buildTxfStorageData, bytesToHex, checkNetworkHealth, countCommittedTransactions, createAddress, createCommunicationsModule, createGroupChatModule, createKeyPair, createL1PaymentsModule, createMarketModule, createPaymentSession, createPaymentSessionError, createPaymentsModule, createPriceProvider, createSphere, createSplitPaymentSession, createTokenValidator, decodeBech32, decryptCMasterKey, decryptPrivateKey, decryptTextFormatKey, deriveAddressInfo, deriveChildKey$1 as deriveChildKey, deriveKeyAtPath$1 as deriveKeyAtPath, doubleSha256, encodeBech32, extractFromText, findPattern, forkedKeyFromTokenIdAndState, formatAmount, generateMasterKey, generateMnemonic, getAddressHrp, getAddressId, getAddressStorageKey, getCoinIdByName, getCoinIdBySymbol, getCurrentStateHash, getPublicKey, getSphere, getTokenDecimals, getTokenDefinition, getTokenIconUrl, getTokenId, getTokenName, getTokenSymbol, hasMissingNewStateHash, hasUncommittedTransactions, hasValidTxfData, hash160, hexToBytes, identityFromMnemonicSync, initSphere, isArchivedKey, isCombinedTransferBundleV6, isForkedKey, isInstantSplitBundle, isInstantSplitBundleV4, isInstantSplitBundleV5, isKnownToken, isPaymentSessionTerminal, isPaymentSessionTimedOut, isSQLiteDatabase, isTextWalletEncrypted, isTokenKey, isValidBech32, isValidNametag, isValidPrivateKey, isValidTokenId, isWalletDatEncrypted, isWalletTextFormat, keyFromTokenId, loadSphere, mnemonicToSeedSync, normalizeSdkTokenToStorage, objectToTxf, parseAndDecryptWalletDat, parseAndDecryptWalletText, parseForkedKey, parseTxfStorageData, parseWalletDat, parseWalletText, randomBytes, randomHex, randomUUID, ripemd160, sha256, sleep, sphereExists, toHumanReadable, toSmallestUnit, tokenIdFromArchivedKey, tokenIdFromKey, tokenToTxf, txfToToken, validateMnemonic };
package/dist/index.d.ts CHANGED
@@ -711,6 +711,70 @@ interface UnconfirmedResolutionResult {
711
711
  status: 'resolved' | 'pending' | 'failed';
712
712
  }>;
713
713
  }
714
+ /**
715
+ * A single direct (whole-token) transfer entry inside a combined bundle.
716
+ * The receiver processes each entry the same way as a standalone NOSTR-FIRST
717
+ * commitment-only transfer.
718
+ */
719
+ interface DirectTokenEntry {
720
+ /** JSON-serialized SDK token */
721
+ sourceToken: string;
722
+ /** JSON-serialized TransferCommitment */
723
+ commitmentData: string;
724
+ /** Token value (display metadata) */
725
+ amount: string;
726
+ /** Coin ID hex */
727
+ coinId: string;
728
+ /** Extracted tokenId for receiver-side dedup (optional) */
729
+ tokenId?: string;
730
+ }
731
+ /**
732
+ * Combined Transfer Bundle V6
733
+ *
734
+ * Packs ALL tokens for a single send() operation into ONE Nostr message:
735
+ * - An optional V5 split bundle (when the sender had to split a token)
736
+ * - Zero or more direct token entries (whole tokens transferred as-is)
737
+ *
738
+ * Benefits over V5 + NOSTR-FIRST multi-message approach:
739
+ * - Single Nostr event = no relay overwrite issues (kind 31113 replaceable events)
740
+ * - Atomic delivery: all tokens arrive together or not at all
741
+ * - One notification, one history entry on receiver side
742
+ */
743
+ interface CombinedTransferBundleV6 {
744
+ /** Bundle version */
745
+ version: '6.0';
746
+ /** Bundle type identifier */
747
+ type: 'COMBINED_TRANSFER';
748
+ /** Transfer ID (matches sender's TransferResult.id) */
749
+ transferId: string;
750
+ /** V5 split bundle (null if no split was needed) */
751
+ splitBundle: InstantSplitBundleV5 | null;
752
+ /** Direct tokens sent without splitting */
753
+ directTokens: DirectTokenEntry[];
754
+ /** Total transfer amount (display metadata) */
755
+ totalAmount: string;
756
+ /** Coin ID hex */
757
+ coinId: string;
758
+ /** Sender's transport pubkey */
759
+ senderPubkey: string;
760
+ /** Optional memo (one per transfer) */
761
+ memo?: string;
762
+ }
763
+ /**
764
+ * Type guard for CombinedTransferBundleV6
765
+ */
766
+ declare function isCombinedTransferBundleV6(obj: unknown): obj is CombinedTransferBundleV6;
767
+ /**
768
+ * Result of building a split bundle (without sending it)
769
+ */
770
+ interface BuildSplitBundleResult {
771
+ /** The constructed V5 bundle */
772
+ bundle: InstantSplitBundleV5;
773
+ /** Split group ID for correlation */
774
+ splitGroupId: string;
775
+ /** Call this after transport delivery to start background mint proof + change token creation */
776
+ startBackground: () => Promise<void>;
777
+ }
714
778
 
715
779
  /**
716
780
  * Payment Session Types
@@ -942,6 +1006,8 @@ interface Asset {
942
1006
  readonly confirmedTokenCount: number;
943
1007
  /** Number of unconfirmed tokens aggregated */
944
1008
  readonly unconfirmedTokenCount: number;
1009
+ /** Number of tokens currently being sent */
1010
+ readonly transferringTokenCount: number;
945
1011
  /** Price per whole unit in USD (null if PriceProvider not configured) */
946
1012
  readonly priceUsd: number | null;
947
1013
  /** Price per whole unit in EUR (null if PriceProvider not configured) */
@@ -1508,6 +1574,12 @@ interface HistoryRecord {
1508
1574
  recipientNametag?: string;
1509
1575
  /** Optional memo/message attached to the transfer */
1510
1576
  memo?: string;
1577
+ /** All token IDs in a combined transfer (V6 bundle breakdown) */
1578
+ tokenIds?: Array<{
1579
+ id: string;
1580
+ amount: string;
1581
+ source: 'split' | 'direct';
1582
+ }>;
1511
1583
  }
1512
1584
  /**
1513
1585
  * Storage result types
@@ -1599,6 +1671,7 @@ interface TxfStorageDataBase {
1599
1671
  _outbox?: TxfOutboxEntry[];
1600
1672
  _sent?: TxfSentEntry[];
1601
1673
  _invalid?: TxfInvalidEntry[];
1674
+ _history?: HistoryRecord[];
1602
1675
  [key: `_${string}`]: unknown;
1603
1676
  }
1604
1677
  interface TxfMeta {
@@ -2577,6 +2650,7 @@ declare class PaymentsModule {
2577
2650
  private loadedPromise;
2578
2651
  private loaded;
2579
2652
  private processedSplitGroupIds;
2653
+ private processedCombinedTransferIds;
2580
2654
  private storageEventUnsubscribers;
2581
2655
  private syncDebounceTimer;
2582
2656
  private static readonly SYNC_DEBOUNCE_MS;
@@ -2646,6 +2720,43 @@ declare class PaymentsModule {
2646
2720
  * @returns InstantSplitResult with timing info
2647
2721
  */
2648
2722
  sendInstant(request: TransferRequest, options?: InstantSplitOptions): Promise<InstantSplitResult>;
2723
+ /**
2724
+ * Save a V5 split bundle as an unconfirmed token (shared by V5 standalone and V6 combined).
2725
+ * Returns the created UI token, or null if deduped.
2726
+ *
2727
+ * @param deferPersistence - If true, skip addToken/save calls (caller batches them).
2728
+ * The token is still added to the in-memory map for dedup; caller must call save().
2729
+ */
2730
+ private saveUnconfirmedV5Token;
2731
+ /**
2732
+ * Save a commitment-only (NOSTR-FIRST) token and start proof polling.
2733
+ * Shared by standalone NOSTR-FIRST handler and V6 combined handler.
2734
+ * Returns the created UI token, or null if deduped/tombstoned.
2735
+ *
2736
+ * @param deferPersistence - If true, skip save() and commitment submission
2737
+ * (caller batches them). Token is added to in-memory map + proof polling is queued.
2738
+ * @param skipGenesisDedup - If true, skip genesis-ID-only dedup. V6 handler sets this
2739
+ * because bundle-level dedup protects against replays, and split children share genesis IDs.
2740
+ */
2741
+ private saveCommitmentOnlyToken;
2742
+ /**
2743
+ * Process a received COMBINED_TRANSFER V6 bundle.
2744
+ *
2745
+ * Unpacks a single Nostr message into its component tokens:
2746
+ * - Optional V5 split bundle (saved as unconfirmed, resolved lazily)
2747
+ * - Zero or more direct tokens (saved as unconfirmed, proof-polled)
2748
+ *
2749
+ * Emits ONE transfer:incoming event and records ONE history entry.
2750
+ */
2751
+ private processCombinedTransferBundle;
2752
+ /**
2753
+ * Persist processed combined transfer IDs to KV storage.
2754
+ */
2755
+ private saveProcessedCombinedTransferIds;
2756
+ /**
2757
+ * Load processed combined transfer IDs from KV storage.
2758
+ */
2759
+ private loadProcessedCombinedTransferIds;
2649
2760
  /**
2650
2761
  * Process a received INSTANT_SPLIT bundle.
2651
2762
  *
@@ -2836,7 +2947,8 @@ declare class PaymentsModule {
2836
2947
  getAssets(coinId?: string): Promise<Asset[]>;
2837
2948
  /**
2838
2949
  * Aggregate tokens by coinId with confirmed/unconfirmed breakdown.
2839
- * Excludes tokens with status 'spent', 'invalid', or 'transferring'.
2950
+ * Excludes tokens with status 'spent' or 'invalid'.
2951
+ * Tokens with status 'transferring' are counted as unconfirmed (visible in UI as "Sending").
2840
2952
  */
2841
2953
  private aggregateTokens;
2842
2954
  /**
@@ -3087,6 +3199,13 @@ declare class PaymentsModule {
3087
3199
  * Also performs one-time migration from legacy KV storage.
3088
3200
  */
3089
3201
  loadHistory(): Promise<void>;
3202
+ /**
3203
+ * Import history entries from remote TXF data into local store.
3204
+ * Delegates to the local TokenStorageProvider's importHistoryEntries() for
3205
+ * persistent storage, with in-memory fallback.
3206
+ * Reused by both load() (initial IPFS fetch) and _doSync() (merge result).
3207
+ */
3208
+ private importRemoteHistoryEntries;
3090
3209
  /**
3091
3210
  * Get the first local token storage provider (for history operations).
3092
3211
  */
@@ -3236,7 +3355,7 @@ declare class PaymentsModule {
3236
3355
  /**
3237
3356
  * Handle NOSTR-FIRST commitment-only transfer (recipient side)
3238
3357
  * This is called when receiving a transfer with only commitmentData and no proof yet.
3239
- * We create the token as 'submitted', submit commitment (idempotent), and poll for proof.
3358
+ * Delegates to saveCommitmentOnlyToken() helper, then emits event + records history.
3240
3359
  */
3241
3360
  private handleCommitmentOnlyTransfer;
3242
3361
  /**
@@ -3779,6 +3898,8 @@ declare const STORAGE_KEYS_ADDRESS: {
3779
3898
  readonly GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events";
3780
3899
  /** Processed V5 split group IDs for Nostr re-delivery dedup */
3781
3900
  readonly PROCESSED_SPLIT_GROUP_IDS: "processed_split_group_ids";
3901
+ /** Processed V6 combined transfer IDs for Nostr re-delivery dedup */
3902
+ readonly PROCESSED_COMBINED_TRANSFER_IDS: "processed_combined_transfer_ids";
3782
3903
  };
3783
3904
  /** @deprecated Use STORAGE_KEYS_GLOBAL and STORAGE_KEYS_ADDRESS instead */
3784
3905
  declare const STORAGE_KEYS: {
@@ -3804,6 +3925,8 @@ declare const STORAGE_KEYS: {
3804
3925
  readonly GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events";
3805
3926
  /** Processed V5 split group IDs for Nostr re-delivery dedup */
3806
3927
  readonly PROCESSED_SPLIT_GROUP_IDS: "processed_split_group_ids";
3928
+ /** Processed V6 combined transfer IDs for Nostr re-delivery dedup */
3929
+ readonly PROCESSED_COMBINED_TRANSFER_IDS: "processed_combined_transfer_ids";
3807
3930
  /** Encrypted BIP39 mnemonic */
3808
3931
  readonly MNEMONIC: "mnemonic";
3809
3932
  /** Encrypted master private key */
@@ -5472,6 +5595,7 @@ declare function buildTxfStorageData(tokens: Token[], meta: Omit<TxfMeta$1, 'for
5472
5595
  outboxEntries?: OutboxEntry[];
5473
5596
  mintOutboxEntries?: MintOutboxEntry[];
5474
5597
  invalidatedNametags?: InvalidatedNametagEntry[];
5598
+ historyEntries?: HistoryRecord[];
5475
5599
  }): Promise<TxfStorageData>;
5476
5600
  interface ParsedStorageData {
5477
5601
  tokens: Token[];
@@ -5483,6 +5607,7 @@ interface ParsedStorageData {
5483
5607
  outboxEntries: OutboxEntry[];
5484
5608
  mintOutboxEntries: MintOutboxEntry[];
5485
5609
  invalidatedNametags: InvalidatedNametagEntry[];
5610
+ historyEntries: HistoryRecord[];
5486
5611
  validationErrors: string[];
5487
5612
  }
5488
5613
  /**
@@ -6624,4 +6749,4 @@ declare function getCoinIdBySymbol(symbol: string): string | undefined;
6624
6749
  */
6625
6750
  declare function getCoinIdByName(name: string): string | undefined;
6626
6751
 
6627
- export { type AddressInfo, type AddressMode, type AggregatorClient, type AggregatorEvent, type AggregatorEventCallback, type AggregatorEventType, type AggregatorProvider, type AggregatorProviderConfig, type Asset, type BackgroundProgressStatus, type BaseProvider, type BroadcastHandler, type BroadcastMessage, type CMasterKeyData, COIN_TYPES, type CheckNetworkHealthOptions, CoinGeckoPriceProvider, CommunicationsModule, type CommunicationsModuleConfig, type CommunicationsModuleDependencies, type ComposingIndicator, type ConversationPage, type CreateGroupOptions, DEFAULT_AGGREGATOR_TIMEOUT, DEFAULT_AGGREGATOR_URL, DEFAULT_DERIVATION_PATH, DEFAULT_ELECTRUM_URL, DEFAULT_GROUP_RELAYS, DEFAULT_IPFS_BOOTSTRAP_PEERS, DEFAULT_IPFS_GATEWAYS, DEFAULT_MARKET_API_URL, DEFAULT_NOSTR_RELAYS, DEV_AGGREGATOR_URL, type DecryptionProgressCallback, type DerivationMode, type DirectMessage, type DiscoverAddressProgress, type DiscoverAddressesOptions, type DiscoverAddressesResult, type DiscoveredAddress, type ExtendedValidationResult, type FullIdentity, type GetConversationPageOptions, GroupChatModule, type GroupChatModuleConfig, type GroupChatModuleDependencies, type GroupData, type GroupMemberData, type GroupMessageData, GroupRole, GroupVisibility, type HealthCheckFn, type Identity, type IdentityConfig, type InclusionProof, type IncomingBroadcast, type IncomingMessage, type IncomingPaymentRequest$1 as IncomingPaymentRequest, type IncomingTokenTransfer, type IncomingTransfer, type InitProgress, type InitProgressCallback, type InitProgressStep, type InstantSplitBundle, type InstantSplitBundleV4, type InstantSplitBundleV5, type InstantSplitOptions, type InstantSplitProcessResult, type InstantSplitResult, type InstantSplitV5RecoveryMetadata, type IntentStatus, type IntentType, type InvalidatedNametagEntry, index as L1, type L1Balance, L1PaymentsModule, type L1PaymentsModuleConfig, type L1PaymentsModuleDependencies, type L1SendRequest, type L1SendResult, type L1Transaction, type L1Utxo, LIMITS, type LegacyFileImportOptions, type LegacyFileInfo, type LegacyFileParseResult, type LegacyFileParsedData, type LegacyFileType, type LoadResult, type LoggingConfig, type MarketIntent, MarketModule, type MarketModuleConfig, type MarketModuleDependencies, type MessageHandler, type MintOutboxEntry, type MintParams, type MintResult, NETWORKS, NIP29_KINDS, NOSTR_EVENT_KINDS, type NametagData, type NetworkHealthResult, type NetworkType, type OracleEvent, type OracleEventCallback, type OracleEventType, type OracleProvider, type OutboxEntry, type OutgoingPaymentRequest, type ParsedStorageData, type PaymentRequest, type PaymentRequestHandler$1 as PaymentRequestHandler, type PaymentRequestResponse, type PaymentRequestResponseHandler$1 as PaymentRequestResponseHandler, type PaymentRequestResponseType$1 as PaymentRequestResponseType, type PaymentRequestResult, type PaymentRequestStatus, type PaymentSession, type PaymentSessionDirection, type PaymentSessionError, type PaymentSessionErrorCode, type PaymentSessionStatus, PaymentsModule, type PaymentsModuleConfig, type PaymentsModuleDependencies, type PeerInfo, type PendingV5Finalization, type PostIntentRequest, type PostIntentResult, type PricePlatform, type PriceProvider, type PriceProviderConfig, type ProviderMetadata, type ProviderRole, type ProviderStatus, type ProviderStatusInfo, type ReceiveOptions, type ReceiveResult, type RegistryNetwork, STORAGE_KEYS, STORAGE_KEYS_ADDRESS, STORAGE_KEYS_GLOBAL, STORAGE_PREFIX, type SaveResult, type ScanAddressProgress, type ScanAddressesOptions, type ScanAddressesResult, type ScannedAddressResult, type SearchFilters, type SearchIntentResult, type SearchOptions, type SearchResult, type ServiceHealthResult, type SpentTokenInfo, type SpentTokenResult, Sphere, type SphereConfig, type SphereCreateOptions, SphereError, type SphereErrorCode, type SphereEventHandler, type SphereEventMap, type SphereEventType, type SphereImportOptions, type SphereInitOptions, type SphereInitResult, type SphereLoadOptions, type SphereStatus, type SplitPaymentSession, type SplitRecoveryResult, type StorageEvent, type StorageEventCallback, type StorageEventType, type StorageProvider, type StorageProviderConfig, type SubmitResult, type SyncResult, TEST_AGGREGATOR_URL, TEST_ELECTRUM_URL, TEST_NOSTR_RELAYS, TIMEOUTS, type Token, type TokenDefinition, type TokenIcon, type TokenPrice, TokenRegistry, type TokenState, type TokenStatus, type TokenStorageProvider, type TokenTransferDetail, type TokenTransferHandler, type TokenTransferPayload, type ValidationResult as TokenValidationResult, TokenValidator, type TombstoneEntry, type TrackedAddress, type TrackedAddressEntry, type TransactionHistoryEntry, type TransferCommitment, type TransferMode, type TransferRequest, type TransferResult, type TransferStatus, type TransportEvent, type TransportEventCallback, type TransportEventType, type TransportProvider, type TransportProviderConfig, type TrustBaseLoader, type TxfAuthenticator, type TxfGenesis, type TxfGenesisData, type TxfInclusionProof, type TxfIntegrity, type TxfInvalidEntry, type TxfMerkleStep, type TxfMerkleTreePath, type TxfMeta, type TxfOutboxEntry, type TxfSentEntry, type TxfState, type TxfStorageData, type TxfStorageDataBase, type TxfToken, type TxfTombstone, type TxfTransaction, type UnconfirmedResolutionResult, type V5FinalizationStage, type ValidationAction, type ValidationIssue, type ValidationResult$1 as ValidationResult, type WaitOptions, type WalletDatInfo, type WalletInfo, type WalletJSON$1 as WalletJSON, type WalletJSONExportOptions$1 as WalletJSONExportOptions, type WalletSource, archivedKeyFromTokenId, base58Decode, base58Encode, buildTxfStorageData, bytesToHex, checkNetworkHealth, countCommittedTransactions, createAddress, createCommunicationsModule, createGroupChatModule, createKeyPair, createL1PaymentsModule, createMarketModule, createPaymentSession, createPaymentSessionError, createPaymentsModule, createPriceProvider, createSphere, createSplitPaymentSession, createTokenValidator, decodeBech32, decryptCMasterKey, decryptPrivateKey, decryptTextFormatKey, deriveAddressInfo, deriveChildKey$1 as deriveChildKey, deriveKeyAtPath$1 as deriveKeyAtPath, doubleSha256, encodeBech32, extractFromText, findPattern, forkedKeyFromTokenIdAndState, formatAmount, generateMasterKey, generateMnemonic, getAddressHrp, getAddressId, getAddressStorageKey, getCoinIdByName, getCoinIdBySymbol, getCurrentStateHash, getPublicKey, getSphere, getTokenDecimals, getTokenDefinition, getTokenIconUrl, getTokenId, getTokenName, getTokenSymbol, hasMissingNewStateHash, hasUncommittedTransactions, hasValidTxfData, hash160, hexToBytes, identityFromMnemonicSync, initSphere, isArchivedKey, isForkedKey, isInstantSplitBundle, isInstantSplitBundleV4, isInstantSplitBundleV5, isKnownToken, isPaymentSessionTerminal, isPaymentSessionTimedOut, isSQLiteDatabase, isTextWalletEncrypted, isTokenKey, isValidBech32, isValidNametag, isValidPrivateKey, isValidTokenId, isWalletDatEncrypted, isWalletTextFormat, keyFromTokenId, loadSphere, mnemonicToSeedSync, normalizeSdkTokenToStorage, objectToTxf, parseAndDecryptWalletDat, parseAndDecryptWalletText, parseForkedKey, parseTxfStorageData, parseWalletDat, parseWalletText, randomBytes, randomHex, randomUUID, ripemd160, sha256, sleep, sphereExists, toHumanReadable, toSmallestUnit, tokenIdFromArchivedKey, tokenIdFromKey, tokenToTxf, txfToToken, validateMnemonic };
6752
+ export { type AddressInfo, type AddressMode, type AggregatorClient, type AggregatorEvent, type AggregatorEventCallback, type AggregatorEventType, type AggregatorProvider, type AggregatorProviderConfig, type Asset, type BackgroundProgressStatus, type BaseProvider, type BroadcastHandler, type BroadcastMessage, type BuildSplitBundleResult, type CMasterKeyData, COIN_TYPES, type CheckNetworkHealthOptions, CoinGeckoPriceProvider, type CombinedTransferBundleV6, CommunicationsModule, type CommunicationsModuleConfig, type CommunicationsModuleDependencies, type ComposingIndicator, type ConversationPage, type CreateGroupOptions, DEFAULT_AGGREGATOR_TIMEOUT, DEFAULT_AGGREGATOR_URL, DEFAULT_DERIVATION_PATH, DEFAULT_ELECTRUM_URL, DEFAULT_GROUP_RELAYS, DEFAULT_IPFS_BOOTSTRAP_PEERS, DEFAULT_IPFS_GATEWAYS, DEFAULT_MARKET_API_URL, DEFAULT_NOSTR_RELAYS, DEV_AGGREGATOR_URL, type DecryptionProgressCallback, type DerivationMode, type DirectMessage, type DirectTokenEntry, type DiscoverAddressProgress, type DiscoverAddressesOptions, type DiscoverAddressesResult, type DiscoveredAddress, type ExtendedValidationResult, type FullIdentity, type GetConversationPageOptions, GroupChatModule, type GroupChatModuleConfig, type GroupChatModuleDependencies, type GroupData, type GroupMemberData, type GroupMessageData, GroupRole, GroupVisibility, type HealthCheckFn, type Identity, type IdentityConfig, type InclusionProof, type IncomingBroadcast, type IncomingMessage, type IncomingPaymentRequest$1 as IncomingPaymentRequest, type IncomingTokenTransfer, type IncomingTransfer, type InitProgress, type InitProgressCallback, type InitProgressStep, type InstantSplitBundle, type InstantSplitBundleV4, type InstantSplitBundleV5, type InstantSplitOptions, type InstantSplitProcessResult, type InstantSplitResult, type InstantSplitV5RecoveryMetadata, type IntentStatus, type IntentType, type InvalidatedNametagEntry, index as L1, type L1Balance, L1PaymentsModule, type L1PaymentsModuleConfig, type L1PaymentsModuleDependencies, type L1SendRequest, type L1SendResult, type L1Transaction, type L1Utxo, LIMITS, type LegacyFileImportOptions, type LegacyFileInfo, type LegacyFileParseResult, type LegacyFileParsedData, type LegacyFileType, type LoadResult, type LoggingConfig, type MarketIntent, MarketModule, type MarketModuleConfig, type MarketModuleDependencies, type MessageHandler, type MintOutboxEntry, type MintParams, type MintResult, NETWORKS, NIP29_KINDS, NOSTR_EVENT_KINDS, type NametagData, type NetworkHealthResult, type NetworkType, type OracleEvent, type OracleEventCallback, type OracleEventType, type OracleProvider, type OutboxEntry, type OutgoingPaymentRequest, type ParsedStorageData, type PaymentRequest, type PaymentRequestHandler$1 as PaymentRequestHandler, type PaymentRequestResponse, type PaymentRequestResponseHandler$1 as PaymentRequestResponseHandler, type PaymentRequestResponseType$1 as PaymentRequestResponseType, type PaymentRequestResult, type PaymentRequestStatus, type PaymentSession, type PaymentSessionDirection, type PaymentSessionError, type PaymentSessionErrorCode, type PaymentSessionStatus, PaymentsModule, type PaymentsModuleConfig, type PaymentsModuleDependencies, type PeerInfo, type PendingV5Finalization, type PostIntentRequest, type PostIntentResult, type PricePlatform, type PriceProvider, type PriceProviderConfig, type ProviderMetadata, type ProviderRole, type ProviderStatus, type ProviderStatusInfo, type ReceiveOptions, type ReceiveResult, type RegistryNetwork, STORAGE_KEYS, STORAGE_KEYS_ADDRESS, STORAGE_KEYS_GLOBAL, STORAGE_PREFIX, type SaveResult, type ScanAddressProgress, type ScanAddressesOptions, type ScanAddressesResult, type ScannedAddressResult, type SearchFilters, type SearchIntentResult, type SearchOptions, type SearchResult, type ServiceHealthResult, type SpentTokenInfo, type SpentTokenResult, Sphere, type SphereConfig, type SphereCreateOptions, SphereError, type SphereErrorCode, type SphereEventHandler, type SphereEventMap, type SphereEventType, type SphereImportOptions, type SphereInitOptions, type SphereInitResult, type SphereLoadOptions, type SphereStatus, type SplitPaymentSession, type SplitRecoveryResult, type StorageEvent, type StorageEventCallback, type StorageEventType, type StorageProvider, type StorageProviderConfig, type SubmitResult, type SyncResult, TEST_AGGREGATOR_URL, TEST_ELECTRUM_URL, TEST_NOSTR_RELAYS, TIMEOUTS, type Token, type TokenDefinition, type TokenIcon, type TokenPrice, TokenRegistry, type TokenState, type TokenStatus, type TokenStorageProvider, type TokenTransferDetail, type TokenTransferHandler, type TokenTransferPayload, type ValidationResult as TokenValidationResult, TokenValidator, type TombstoneEntry, type TrackedAddress, type TrackedAddressEntry, type TransactionHistoryEntry, type TransferCommitment, type TransferMode, type TransferRequest, type TransferResult, type TransferStatus, type TransportEvent, type TransportEventCallback, type TransportEventType, type TransportProvider, type TransportProviderConfig, type TrustBaseLoader, type TxfAuthenticator, type TxfGenesis, type TxfGenesisData, type TxfInclusionProof, type TxfIntegrity, type TxfInvalidEntry, type TxfMerkleStep, type TxfMerkleTreePath, type TxfMeta, type TxfOutboxEntry, type TxfSentEntry, type TxfState, type TxfStorageData, type TxfStorageDataBase, type TxfToken, type TxfTombstone, type TxfTransaction, type UnconfirmedResolutionResult, type V5FinalizationStage, type ValidationAction, type ValidationIssue, type ValidationResult$1 as ValidationResult, type WaitOptions, type WalletDatInfo, type WalletInfo, type WalletJSON$1 as WalletJSON, type WalletJSONExportOptions$1 as WalletJSONExportOptions, type WalletSource, archivedKeyFromTokenId, base58Decode, base58Encode, buildTxfStorageData, bytesToHex, checkNetworkHealth, countCommittedTransactions, createAddress, createCommunicationsModule, createGroupChatModule, createKeyPair, createL1PaymentsModule, createMarketModule, createPaymentSession, createPaymentSessionError, createPaymentsModule, createPriceProvider, createSphere, createSplitPaymentSession, createTokenValidator, decodeBech32, decryptCMasterKey, decryptPrivateKey, decryptTextFormatKey, deriveAddressInfo, deriveChildKey$1 as deriveChildKey, deriveKeyAtPath$1 as deriveKeyAtPath, doubleSha256, encodeBech32, extractFromText, findPattern, forkedKeyFromTokenIdAndState, formatAmount, generateMasterKey, generateMnemonic, getAddressHrp, getAddressId, getAddressStorageKey, getCoinIdByName, getCoinIdBySymbol, getCurrentStateHash, getPublicKey, getSphere, getTokenDecimals, getTokenDefinition, getTokenIconUrl, getTokenId, getTokenName, getTokenSymbol, hasMissingNewStateHash, hasUncommittedTransactions, hasValidTxfData, hash160, hexToBytes, identityFromMnemonicSync, initSphere, isArchivedKey, isCombinedTransferBundleV6, isForkedKey, isInstantSplitBundle, isInstantSplitBundleV4, isInstantSplitBundleV5, isKnownToken, isPaymentSessionTerminal, isPaymentSessionTimedOut, isSQLiteDatabase, isTextWalletEncrypted, isTokenKey, isValidBech32, isValidNametag, isValidPrivateKey, isValidTokenId, isWalletDatEncrypted, isWalletTextFormat, keyFromTokenId, loadSphere, mnemonicToSeedSync, normalizeSdkTokenToStorage, objectToTxf, parseAndDecryptWalletDat, parseAndDecryptWalletText, parseForkedKey, parseTxfStorageData, parseWalletDat, parseWalletText, randomBytes, randomHex, randomUUID, ripemd160, sha256, sleep, sphereExists, toHumanReadable, toSmallestUnit, tokenIdFromArchivedKey, tokenIdFromKey, tokenToTxf, txfToToken, validateMnemonic };