@unicitylabs/sphere-sdk 0.5.1 → 0.5.2

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 +615 -275
  6. package/dist/core/index.cjs.map +1 -1
  7. package/dist/core/index.d.cts +49 -2
  8. package/dist/core/index.d.ts +49 -2
  9. package/dist/core/index.js +615 -275
  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 +5 -2
  16. package/dist/impl/browser/index.cjs.map +1 -1
  17. package/dist/impl/browser/index.js +5 -2
  18. package/dist/impl/browser/index.js.map +1 -1
  19. package/dist/impl/browser/ipfs.cjs +3 -1
  20. package/dist/impl/browser/ipfs.cjs.map +1 -1
  21. package/dist/impl/browser/ipfs.js +3 -1
  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 +5 -2
  28. package/dist/impl/nodejs/index.cjs.map +1 -1
  29. package/dist/impl/nodejs/index.d.cts +6 -0
  30. package/dist/impl/nodejs/index.d.ts +6 -0
  31. package/dist/impl/nodejs/index.js +5 -2
  32. package/dist/impl/nodejs/index.js.map +1 -1
  33. package/dist/index.cjs +617 -275
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +118 -3
  36. package/dist/index.d.ts +118 -3
  37. package/dist/index.js +616 -275
  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
@@ -2577,6 +2649,7 @@ declare class PaymentsModule {
2577
2649
  private loadedPromise;
2578
2650
  private loaded;
2579
2651
  private processedSplitGroupIds;
2652
+ private processedCombinedTransferIds;
2580
2653
  private storageEventUnsubscribers;
2581
2654
  private syncDebounceTimer;
2582
2655
  private static readonly SYNC_DEBOUNCE_MS;
@@ -2646,6 +2719,43 @@ declare class PaymentsModule {
2646
2719
  * @returns InstantSplitResult with timing info
2647
2720
  */
2648
2721
  sendInstant(request: TransferRequest, options?: InstantSplitOptions): Promise<InstantSplitResult>;
2722
+ /**
2723
+ * Save a V5 split bundle as an unconfirmed token (shared by V5 standalone and V6 combined).
2724
+ * Returns the created UI token, or null if deduped.
2725
+ *
2726
+ * @param deferPersistence - If true, skip addToken/save calls (caller batches them).
2727
+ * The token is still added to the in-memory map for dedup; caller must call save().
2728
+ */
2729
+ private saveUnconfirmedV5Token;
2730
+ /**
2731
+ * Save a commitment-only (NOSTR-FIRST) token and start proof polling.
2732
+ * Shared by standalone NOSTR-FIRST handler and V6 combined handler.
2733
+ * Returns the created UI token, or null if deduped/tombstoned.
2734
+ *
2735
+ * @param deferPersistence - If true, skip save() and commitment submission
2736
+ * (caller batches them). Token is added to in-memory map + proof polling is queued.
2737
+ * @param skipGenesisDedup - If true, skip genesis-ID-only dedup. V6 handler sets this
2738
+ * because bundle-level dedup protects against replays, and split children share genesis IDs.
2739
+ */
2740
+ private saveCommitmentOnlyToken;
2741
+ /**
2742
+ * Process a received COMBINED_TRANSFER V6 bundle.
2743
+ *
2744
+ * Unpacks a single Nostr message into its component tokens:
2745
+ * - Optional V5 split bundle (saved as unconfirmed, resolved lazily)
2746
+ * - Zero or more direct tokens (saved as unconfirmed, proof-polled)
2747
+ *
2748
+ * Emits ONE transfer:incoming event and records ONE history entry.
2749
+ */
2750
+ private processCombinedTransferBundle;
2751
+ /**
2752
+ * Persist processed combined transfer IDs to KV storage.
2753
+ */
2754
+ private saveProcessedCombinedTransferIds;
2755
+ /**
2756
+ * Load processed combined transfer IDs from KV storage.
2757
+ */
2758
+ private loadProcessedCombinedTransferIds;
2649
2759
  /**
2650
2760
  * Process a received INSTANT_SPLIT bundle.
2651
2761
  *
@@ -2836,7 +2946,8 @@ declare class PaymentsModule {
2836
2946
  getAssets(coinId?: string): Promise<Asset[]>;
2837
2947
  /**
2838
2948
  * Aggregate tokens by coinId with confirmed/unconfirmed breakdown.
2839
- * Excludes tokens with status 'spent', 'invalid', or 'transferring'.
2949
+ * Excludes tokens with status 'spent' or 'invalid'.
2950
+ * Tokens with status 'transferring' are counted as unconfirmed (visible in UI as "Sending").
2840
2951
  */
2841
2952
  private aggregateTokens;
2842
2953
  /**
@@ -3236,7 +3347,7 @@ declare class PaymentsModule {
3236
3347
  /**
3237
3348
  * Handle NOSTR-FIRST commitment-only transfer (recipient side)
3238
3349
  * 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.
3350
+ * Delegates to saveCommitmentOnlyToken() helper, then emits event + records history.
3240
3351
  */
3241
3352
  private handleCommitmentOnlyTransfer;
3242
3353
  /**
@@ -3779,6 +3890,8 @@ declare const STORAGE_KEYS_ADDRESS: {
3779
3890
  readonly GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events";
3780
3891
  /** Processed V5 split group IDs for Nostr re-delivery dedup */
3781
3892
  readonly PROCESSED_SPLIT_GROUP_IDS: "processed_split_group_ids";
3893
+ /** Processed V6 combined transfer IDs for Nostr re-delivery dedup */
3894
+ readonly PROCESSED_COMBINED_TRANSFER_IDS: "processed_combined_transfer_ids";
3782
3895
  };
3783
3896
  /** @deprecated Use STORAGE_KEYS_GLOBAL and STORAGE_KEYS_ADDRESS instead */
3784
3897
  declare const STORAGE_KEYS: {
@@ -3804,6 +3917,8 @@ declare const STORAGE_KEYS: {
3804
3917
  readonly GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events";
3805
3918
  /** Processed V5 split group IDs for Nostr re-delivery dedup */
3806
3919
  readonly PROCESSED_SPLIT_GROUP_IDS: "processed_split_group_ids";
3920
+ /** Processed V6 combined transfer IDs for Nostr re-delivery dedup */
3921
+ readonly PROCESSED_COMBINED_TRANSFER_IDS: "processed_combined_transfer_ids";
3807
3922
  /** Encrypted BIP39 mnemonic */
3808
3923
  readonly MNEMONIC: "mnemonic";
3809
3924
  /** Encrypted master private key */
@@ -6624,4 +6739,4 @@ declare function getCoinIdBySymbol(symbol: string): string | undefined;
6624
6739
  */
6625
6740
  declare function getCoinIdByName(name: string): string | undefined;
6626
6741
 
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 };
6742
+ 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
@@ -2577,6 +2649,7 @@ declare class PaymentsModule {
2577
2649
  private loadedPromise;
2578
2650
  private loaded;
2579
2651
  private processedSplitGroupIds;
2652
+ private processedCombinedTransferIds;
2580
2653
  private storageEventUnsubscribers;
2581
2654
  private syncDebounceTimer;
2582
2655
  private static readonly SYNC_DEBOUNCE_MS;
@@ -2646,6 +2719,43 @@ declare class PaymentsModule {
2646
2719
  * @returns InstantSplitResult with timing info
2647
2720
  */
2648
2721
  sendInstant(request: TransferRequest, options?: InstantSplitOptions): Promise<InstantSplitResult>;
2722
+ /**
2723
+ * Save a V5 split bundle as an unconfirmed token (shared by V5 standalone and V6 combined).
2724
+ * Returns the created UI token, or null if deduped.
2725
+ *
2726
+ * @param deferPersistence - If true, skip addToken/save calls (caller batches them).
2727
+ * The token is still added to the in-memory map for dedup; caller must call save().
2728
+ */
2729
+ private saveUnconfirmedV5Token;
2730
+ /**
2731
+ * Save a commitment-only (NOSTR-FIRST) token and start proof polling.
2732
+ * Shared by standalone NOSTR-FIRST handler and V6 combined handler.
2733
+ * Returns the created UI token, or null if deduped/tombstoned.
2734
+ *
2735
+ * @param deferPersistence - If true, skip save() and commitment submission
2736
+ * (caller batches them). Token is added to in-memory map + proof polling is queued.
2737
+ * @param skipGenesisDedup - If true, skip genesis-ID-only dedup. V6 handler sets this
2738
+ * because bundle-level dedup protects against replays, and split children share genesis IDs.
2739
+ */
2740
+ private saveCommitmentOnlyToken;
2741
+ /**
2742
+ * Process a received COMBINED_TRANSFER V6 bundle.
2743
+ *
2744
+ * Unpacks a single Nostr message into its component tokens:
2745
+ * - Optional V5 split bundle (saved as unconfirmed, resolved lazily)
2746
+ * - Zero or more direct tokens (saved as unconfirmed, proof-polled)
2747
+ *
2748
+ * Emits ONE transfer:incoming event and records ONE history entry.
2749
+ */
2750
+ private processCombinedTransferBundle;
2751
+ /**
2752
+ * Persist processed combined transfer IDs to KV storage.
2753
+ */
2754
+ private saveProcessedCombinedTransferIds;
2755
+ /**
2756
+ * Load processed combined transfer IDs from KV storage.
2757
+ */
2758
+ private loadProcessedCombinedTransferIds;
2649
2759
  /**
2650
2760
  * Process a received INSTANT_SPLIT bundle.
2651
2761
  *
@@ -2836,7 +2946,8 @@ declare class PaymentsModule {
2836
2946
  getAssets(coinId?: string): Promise<Asset[]>;
2837
2947
  /**
2838
2948
  * Aggregate tokens by coinId with confirmed/unconfirmed breakdown.
2839
- * Excludes tokens with status 'spent', 'invalid', or 'transferring'.
2949
+ * Excludes tokens with status 'spent' or 'invalid'.
2950
+ * Tokens with status 'transferring' are counted as unconfirmed (visible in UI as "Sending").
2840
2951
  */
2841
2952
  private aggregateTokens;
2842
2953
  /**
@@ -3236,7 +3347,7 @@ declare class PaymentsModule {
3236
3347
  /**
3237
3348
  * Handle NOSTR-FIRST commitment-only transfer (recipient side)
3238
3349
  * 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.
3350
+ * Delegates to saveCommitmentOnlyToken() helper, then emits event + records history.
3240
3351
  */
3241
3352
  private handleCommitmentOnlyTransfer;
3242
3353
  /**
@@ -3779,6 +3890,8 @@ declare const STORAGE_KEYS_ADDRESS: {
3779
3890
  readonly GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events";
3780
3891
  /** Processed V5 split group IDs for Nostr re-delivery dedup */
3781
3892
  readonly PROCESSED_SPLIT_GROUP_IDS: "processed_split_group_ids";
3893
+ /** Processed V6 combined transfer IDs for Nostr re-delivery dedup */
3894
+ readonly PROCESSED_COMBINED_TRANSFER_IDS: "processed_combined_transfer_ids";
3782
3895
  };
3783
3896
  /** @deprecated Use STORAGE_KEYS_GLOBAL and STORAGE_KEYS_ADDRESS instead */
3784
3897
  declare const STORAGE_KEYS: {
@@ -3804,6 +3917,8 @@ declare const STORAGE_KEYS: {
3804
3917
  readonly GROUP_CHAT_PROCESSED_EVENTS: "group_chat_processed_events";
3805
3918
  /** Processed V5 split group IDs for Nostr re-delivery dedup */
3806
3919
  readonly PROCESSED_SPLIT_GROUP_IDS: "processed_split_group_ids";
3920
+ /** Processed V6 combined transfer IDs for Nostr re-delivery dedup */
3921
+ readonly PROCESSED_COMBINED_TRANSFER_IDS: "processed_combined_transfer_ids";
3807
3922
  /** Encrypted BIP39 mnemonic */
3808
3923
  readonly MNEMONIC: "mnemonic";
3809
3924
  /** Encrypted master private key */
@@ -6624,4 +6739,4 @@ declare function getCoinIdBySymbol(symbol: string): string | undefined;
6624
6739
  */
6625
6740
  declare function getCoinIdByName(name: string): string | undefined;
6626
6741
 
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 };
6742
+ 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 };