@unicitylabs/sphere-sdk 0.16.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/connect/index.cjs +11 -5
  2. package/dist/connect/index.cjs.map +1 -1
  3. package/dist/connect/index.d.cts +4 -1
  4. package/dist/connect/index.d.ts +4 -1
  5. package/dist/connect/index.js +11 -5
  6. package/dist/connect/index.js.map +1 -1
  7. package/dist/core/index.cjs +692 -268
  8. package/dist/core/index.cjs.map +1 -1
  9. package/dist/core/index.d.cts +69 -0
  10. package/dist/core/index.d.ts +69 -0
  11. package/dist/core/index.js +692 -268
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/impl/browser/connect/index.cjs +11 -5
  14. package/dist/impl/browser/connect/index.cjs.map +1 -1
  15. package/dist/impl/browser/connect/index.d.cts +3 -1
  16. package/dist/impl/browser/connect/index.d.ts +3 -1
  17. package/dist/impl/browser/connect/index.js +11 -5
  18. package/dist/impl/browser/connect/index.js.map +1 -1
  19. package/dist/impl/nodejs/connect/index.cjs +10 -4
  20. package/dist/impl/nodejs/connect/index.cjs.map +1 -1
  21. package/dist/impl/nodejs/connect/index.d.cts +1 -1
  22. package/dist/impl/nodejs/connect/index.d.ts +1 -1
  23. package/dist/impl/nodejs/connect/index.js +10 -4
  24. package/dist/impl/nodejs/connect/index.js.map +1 -1
  25. package/dist/impl/nodejs/index.d.cts +11 -0
  26. package/dist/impl/nodejs/index.d.ts +11 -0
  27. package/dist/impl/shared/wallet-api/index.d.cts +11 -0
  28. package/dist/impl/shared/wallet-api/index.d.ts +11 -0
  29. package/dist/impl/wallet-api-v2/index.cjs +2 -0
  30. package/dist/impl/wallet-api-v2/index.cjs.map +1 -1
  31. package/dist/impl/wallet-api-v2/index.d.cts +13 -0
  32. package/dist/impl/wallet-api-v2/index.d.ts +13 -0
  33. package/dist/impl/wallet-api-v2/index.js +2 -0
  34. package/dist/impl/wallet-api-v2/index.js.map +1 -1
  35. package/dist/index.cjs +692 -268
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +63 -1
  38. package/dist/index.d.ts +63 -1
  39. package/dist/index.js +692 -268
  40. package/dist/index.js.map +1 -1
  41. package/dist/modules/payments-v2/index.cjs +767 -398
  42. package/dist/modules/payments-v2/index.cjs.map +1 -1
  43. package/dist/modules/payments-v2/index.d.cts +91 -14
  44. package/dist/modules/payments-v2/index.d.ts +91 -14
  45. package/dist/modules/payments-v2/index.js +767 -398
  46. package/dist/modules/payments-v2/index.js.map +1 -1
  47. package/dist/token-engine/index.cjs +132 -34
  48. package/dist/token-engine/index.cjs.map +1 -1
  49. package/dist/token-engine/index.d.cts +19 -0
  50. package/dist/token-engine/index.d.ts +19 -0
  51. package/dist/token-engine/index.js +132 -34
  52. package/dist/token-engine/index.js.map +1 -1
  53. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -88,6 +88,11 @@ interface SendRequest {
88
88
  coinId: string;
89
89
  memo?: string;
90
90
  }
91
+ interface SendWholeTokenRequest {
92
+ recipient: string;
93
+ tokenId: string;
94
+ memo?: string;
95
+ }
91
96
  interface MintResult {
92
97
  success: boolean;
93
98
  tokenId?: string;
@@ -157,6 +162,8 @@ interface PendingTransfer {
157
162
  recipient: string;
158
163
  coinId: string;
159
164
  amount: string;
165
+ /** Set instead of coinId/amount when the intent is a token-addressed spend. */
166
+ tokenId?: string;
160
167
  legs: {
161
168
  certified: number;
162
169
  total: number;
@@ -172,11 +179,16 @@ interface PaymentsV2 {
172
179
  tokens(filter?: {
173
180
  coinId?: string;
174
181
  }): Token[];
182
+ coinless(): CoinlessToken[];
183
+ tokenData(tokenId: string): Promise<Uint8Array | null>;
175
184
  history(page?: {
176
185
  before?: string;
177
186
  limit?: number;
178
187
  }): Promise<HistoryPage>;
179
188
  send(req: SendRequest): Promise<TransferResult>;
189
+ sendWholeToken(req: SendWholeTokenRequest): Promise<TransferResult>;
190
+ /** NFT-scoped twin: refuses a valued source. Connect's `send_nft` routes here. */
191
+ sendCoinless(req: SendWholeTokenRequest): Promise<TransferResult>;
180
192
  mint(coinId: string, amount: bigint): Promise<MintResult>;
181
193
  receive(): Promise<{
182
194
  transfers: IncomingTransfer[];
@@ -499,6 +511,31 @@ interface Token {
499
511
  */
500
512
  suspectedSpent?: boolean;
501
513
  }
514
+ /**
515
+ * A holding that names no coin (wallet-api#140) — an NFT. Deliberately NOT a
516
+ * `Token`: no amount, decimals or symbol, and never returned by `tokens()` or
517
+ * counted in `assets()`. `tokenType` names the token's CLASS and `tokenId` the
518
+ * instance (wallet-api#147). The payload is read with `payments.tokenData()`.
519
+ */
520
+ interface CoinlessToken {
521
+ readonly tokenId: string;
522
+ readonly tokenType?: string;
523
+ /**
524
+ * Class metadata resolved from the registry THIS wallet owns, when the type is
525
+ * recognised. Resolved here so callers never reach for a registry themselves:
526
+ * the process-global singleton is repointable by another Sphere's init, so a
527
+ * second wallet on another network would retarget it (#767).
528
+ */
529
+ readonly name?: string;
530
+ readonly iconUrl?: string;
531
+ readonly stateHash: string;
532
+ /** #737: reserved by a converging transfer — not spendable right now. */
533
+ readonly transferring: boolean;
534
+ /** #625: proven spent on-chain; excluded from spend selection. */
535
+ readonly suspectedSpent?: boolean;
536
+ readonly createdAt: number;
537
+ readonly updatedAt: number;
538
+ }
502
539
  interface Asset {
503
540
  readonly coinId: string;
504
541
  readonly symbol: string;
@@ -575,6 +612,8 @@ interface IncomingTransfer {
575
612
  readonly senderPubkey: string;
576
613
  readonly senderNametag?: string;
577
614
  readonly tokens: Token[];
615
+ /** Arrivals that name no coin (#777). Disjoint from `tokens`, never a zero Token. */
616
+ readonly coinless?: CoinlessToken[];
578
617
  readonly memo?: string;
579
618
  readonly receivedAt: number;
580
619
  }
@@ -2438,7 +2477,18 @@ interface InventoryItemWire {
2438
2477
  status: 'active' | 'removed';
2439
2478
  seq: number;
2440
2479
  stateHash: string;
2480
+ /**
2481
+ * Omitted for a tombstone AND for an ACTIVE COINLESS token (wallet-api#140),
2482
+ * so absence is never "removed" or "not loaded" — discriminate on `status`.
2483
+ */
2441
2484
  assets?: AssetWire[];
2485
+ /**
2486
+ * Genesis `TokenType`, lowercase hex (1-64 bytes ⇒ 2-128 chars). Names the
2487
+ * token's CLASS, not the instance (wallet-api#147). Absent on rows written
2488
+ * before wallet-api migration 0015. An unrecognised type is legitimate: never
2489
+ * reject or hide a token for it.
2490
+ */
2491
+ tokenType?: string;
2442
2492
  }
2443
2493
  interface InventoryPageWire {
2444
2494
  cursor: number;
@@ -4447,6 +4497,8 @@ interface TokenRegistryConfig {
4447
4497
  declare class TokenRegistry {
4448
4498
  private static instance;
4449
4499
  private readonly definitionsById;
4500
+ /** Non-fungible definitions keyed by TOKEN TYPE — a separate namespace (#147). */
4501
+ private readonly definitionsByType;
4450
4502
  private readonly definitionsBySymbol;
4451
4503
  private readonly definitionsByName;
4452
4504
  private remoteUrl;
@@ -4634,6 +4686,16 @@ declare class TokenRegistry {
4634
4686
  * @returns Array of all token definitions
4635
4687
  */
4636
4688
  getAllDefinitions(): TokenDefinition[];
4689
+ /**
4690
+ * Definition for a coinless token's genesis TOKEN TYPE (#777). Never falls back
4691
+ * to `getDefinition`: a type and a coin id live in different namespaces, so a
4692
+ * type that collided with a coin id would otherwise render as that coin.
4693
+ */
4694
+ getTypeMeta(tokenType: string): {
4695
+ name: string;
4696
+ iconUrl: string | null;
4697
+ } | null;
4698
+ getTypeDefinition(tokenType: string): TokenDefinition | undefined;
4637
4699
  /**
4638
4700
  * Get all fungible token definitions
4639
4701
  * @returns Array of fungible token definitions
@@ -4737,4 +4799,4 @@ declare function normalizeAddress(address: string): string;
4737
4799
  */
4738
4800
  declare function addressesMatch(a: string, b: string): boolean;
4739
4801
 
4740
- export { AUTH_CHALLENGE_PREFIX, type AddressInfo, type AddressType, type AggregatorEvent, type AggregatorEventCallback, type AggregatorEventType, type AggregatorProvider, type Asset, type BaseProvider, type BroadcastHandler, type BroadcastMessage, COIN_TYPES, ChallengeTemplateError, type CheckNetworkHealthOptions, CoinGeckoPriceProvider, CommunicationsModule, type CommunicationsModuleConfig, type CommunicationsModuleDependencies, type ComposingIndicator, type ConversationPage, type CreateGroupOptions, DEFAULT_AGGREGATOR_TIMEOUT, DEFAULT_DERIVATION_PATH, DEFAULT_GROUP_RELAYS, DEFAULT_MARKET_API_URL, DEFAULT_NOSTR_RELAYS, type DecryptionProgressCallback, type DerivationMode, type DirectMessage, type DiscoverAddressProgress, type DiscoverAddressesOptions, type DiscoverAddressesResult, type DiscoveredAddress, type EncryptedData, FIELD_ENCRYPTION_HKDF_INFO, FIELD_ENVELOPE_MAX_BYTES, FIELD_ENVELOPE_NONCE_BYTES, FIELD_ENVELOPE_PREFIX, type FullIdentity, type GetConversationPageOptions, GroupChatModule, type GroupChatModuleConfig, type GroupChatModuleDependencies, type GroupData, type GroupMemberData, type GroupMessageData, GroupRole, GroupVisibility, type HealthCheckFn, type HistoryRecord, type Identity, type IdentityConfig, type IncomingBroadcast, type IncomingMessage, type IncomingTransfer, type InitProgress, type InitProgressCallback, type InitProgressStep, type IntentStatus, type IntentType, LIMITS, type LegacyFileParseResult, type LegacyFileParsedData, type LegacyFileType, type LogHandler, type LogLevel, type LoggerConfig, type MarketIntent, MarketModule, type MarketModuleConfig, type MarketModuleDependencies, type MessageHandler, NETWORKS, NIP29_KINDS, NOSTR_EVENT_KINDS, type NetworkHealthResult, type NetworkType, type OracleEvent, type OracleEventCallback, type OracleEventType, type OracleProvider, type ParsedAddress, PartialSendConflictError, type PeerInfo, type PostIntentRequest, type PostIntentResult, type PricePlatform, type PriceProvider, type PriceProviderConfig, type ProviderMetadata, type ProviderRole, type ProviderStatus, type ProviderStatusInfo, type RegistryNetwork, SIGN_MESSAGE_PREFIX, STORAGE_KEYS_ADDRESS, STORAGE_KEYS_GLOBAL, STORAGE_PREFIX, type SearchFilters, type SearchIntentResult, type SearchOptions, type SearchResult, type ServiceHealthResult, Sphere, type SphereCreateOptions, SphereError, type SphereErrorCode, type SphereEventHandler, type SphereEventMap, type SphereEventType, type SphereImportOptions, type SphereInitOptions, type SphereInitResult, type SphereLoadOptions, type SphereStatus, type StorageProvider, TEST_NOSTR_RELAYS, TIMEOUTS, type Token, type TokenDefinition, type TokenIcon, type TokenPrice, TokenRegistry, type TokenStatus, type TokenTransferDetail, type TrackedAddress, type TrackedAddressEntry, type HistoryRecord as TransactionHistoryEntry, type TransferRequest, type TransferResult, type TransferStatus, type TransportEvent, type TransportEventCallback, type TransportEventType, type TransportProvider, type WalletApiTransportConfig, type WalletInfo, type WalletJSON, type WalletJSONExportOptions, type WalletSource, addressesMatch, assertFieldEnvelopeShape, base58Decode, base58Encode, bytesToHex, checkNetworkHealth, coinIdsMatch, createCommunicationsModule, createGroupChatModule, createKeyPair, createMarketModule, createPriceProvider, createSphere, decrypt, decryptField, decryptFieldBytes, decryptJson, decryptMnemonic, decryptSimple, decryptTextFormatKey, decryptWithSalt, deriveAddressInfo, deriveChildKey, deriveFieldEncryptionKey, deriveKeyAtPath, doubleSha256, encrypt, encryptField, encryptFieldBytes, encryptMnemonic, encryptSimple, extractFromText, findPattern, formatAmount, generateAddressFromMasterKey, generateMasterKey, generateMnemonic, getAddressId, getAddressStorageKey, getCoinIdByName, getCoinIdBySymbol, getPublicKey, getTokenDecimals, getTokenDefinition, getTokenIconUrl, getTokenName, getTokenSymbol, hash160, hashSignMessage, hexToBytes, identityFromMnemonicSync, initSphere, isKnownToken, isPossiblyCommittedSendOutcome, isSphereError, isTextWalletEncrypted, isValidAddress, isValidDirectAddress, isValidNametag, isValidPrivateKey, isWalletTextFormat, loadSphere, logger, mnemonicToSeedSync, normalizeAddress, normalizeCoinId, parseAddress, parseAndDecryptWalletText, parseTokenAmount, parseWalletText, randomBytes, randomHex, randomUUID, recoverPubkeyFromSignature, ripemd160, safeParseTokenAmount, sha256, signMessage, sleep, sphereExists, toHumanReadable, validateMnemonic, verifyChallengeTemplate, verifySignedMessage };
4802
+ export { AUTH_CHALLENGE_PREFIX, type AddressInfo, type AddressType, type AggregatorEvent, type AggregatorEventCallback, type AggregatorEventType, type AggregatorProvider, type Asset, type BaseProvider, type BroadcastHandler, type BroadcastMessage, COIN_TYPES, ChallengeTemplateError, type CheckNetworkHealthOptions, CoinGeckoPriceProvider, type CoinlessToken, CommunicationsModule, type CommunicationsModuleConfig, type CommunicationsModuleDependencies, type ComposingIndicator, type ConversationPage, type CreateGroupOptions, DEFAULT_AGGREGATOR_TIMEOUT, DEFAULT_DERIVATION_PATH, DEFAULT_GROUP_RELAYS, DEFAULT_MARKET_API_URL, DEFAULT_NOSTR_RELAYS, type DecryptionProgressCallback, type DerivationMode, type DirectMessage, type DiscoverAddressProgress, type DiscoverAddressesOptions, type DiscoverAddressesResult, type DiscoveredAddress, type EncryptedData, FIELD_ENCRYPTION_HKDF_INFO, FIELD_ENVELOPE_MAX_BYTES, FIELD_ENVELOPE_NONCE_BYTES, FIELD_ENVELOPE_PREFIX, type FullIdentity, type GetConversationPageOptions, GroupChatModule, type GroupChatModuleConfig, type GroupChatModuleDependencies, type GroupData, type GroupMemberData, type GroupMessageData, GroupRole, GroupVisibility, type HealthCheckFn, type HistoryRecord, type Identity, type IdentityConfig, type IncomingBroadcast, type IncomingMessage, type IncomingTransfer, type InitProgress, type InitProgressCallback, type InitProgressStep, type IntentStatus, type IntentType, LIMITS, type LegacyFileParseResult, type LegacyFileParsedData, type LegacyFileType, type LogHandler, type LogLevel, type LoggerConfig, type MarketIntent, MarketModule, type MarketModuleConfig, type MarketModuleDependencies, type MessageHandler, NETWORKS, NIP29_KINDS, NOSTR_EVENT_KINDS, type NetworkHealthResult, type NetworkType, type OracleEvent, type OracleEventCallback, type OracleEventType, type OracleProvider, type ParsedAddress, PartialSendConflictError, type PeerInfo, type PostIntentRequest, type PostIntentResult, type PricePlatform, type PriceProvider, type PriceProviderConfig, type ProviderMetadata, type ProviderRole, type ProviderStatus, type ProviderStatusInfo, type RegistryNetwork, SIGN_MESSAGE_PREFIX, STORAGE_KEYS_ADDRESS, STORAGE_KEYS_GLOBAL, STORAGE_PREFIX, type SearchFilters, type SearchIntentResult, type SearchOptions, type SearchResult, type ServiceHealthResult, Sphere, type SphereCreateOptions, SphereError, type SphereErrorCode, type SphereEventHandler, type SphereEventMap, type SphereEventType, type SphereImportOptions, type SphereInitOptions, type SphereInitResult, type SphereLoadOptions, type SphereStatus, type StorageProvider, TEST_NOSTR_RELAYS, TIMEOUTS, type Token, type TokenDefinition, type TokenIcon, type TokenPrice, TokenRegistry, type TokenStatus, type TokenTransferDetail, type TrackedAddress, type TrackedAddressEntry, type HistoryRecord as TransactionHistoryEntry, type TransferRequest, type TransferResult, type TransferStatus, type TransportEvent, type TransportEventCallback, type TransportEventType, type TransportProvider, type WalletApiTransportConfig, type WalletInfo, type WalletJSON, type WalletJSONExportOptions, type WalletSource, addressesMatch, assertFieldEnvelopeShape, base58Decode, base58Encode, bytesToHex, checkNetworkHealth, coinIdsMatch, createCommunicationsModule, createGroupChatModule, createKeyPair, createMarketModule, createPriceProvider, createSphere, decrypt, decryptField, decryptFieldBytes, decryptJson, decryptMnemonic, decryptSimple, decryptTextFormatKey, decryptWithSalt, deriveAddressInfo, deriveChildKey, deriveFieldEncryptionKey, deriveKeyAtPath, doubleSha256, encrypt, encryptField, encryptFieldBytes, encryptMnemonic, encryptSimple, extractFromText, findPattern, formatAmount, generateAddressFromMasterKey, generateMasterKey, generateMnemonic, getAddressId, getAddressStorageKey, getCoinIdByName, getCoinIdBySymbol, getPublicKey, getTokenDecimals, getTokenDefinition, getTokenIconUrl, getTokenName, getTokenSymbol, hash160, hashSignMessage, hexToBytes, identityFromMnemonicSync, initSphere, isKnownToken, isPossiblyCommittedSendOutcome, isSphereError, isTextWalletEncrypted, isValidAddress, isValidDirectAddress, isValidNametag, isValidPrivateKey, isWalletTextFormat, loadSphere, logger, mnemonicToSeedSync, normalizeAddress, normalizeCoinId, parseAddress, parseAndDecryptWalletText, parseTokenAmount, parseWalletText, randomBytes, randomHex, randomUUID, recoverPubkeyFromSignature, ripemd160, safeParseTokenAmount, sha256, signMessage, sleep, sphereExists, toHumanReadable, validateMnemonic, verifyChallengeTemplate, verifySignedMessage };
package/dist/index.d.ts CHANGED
@@ -88,6 +88,11 @@ interface SendRequest {
88
88
  coinId: string;
89
89
  memo?: string;
90
90
  }
91
+ interface SendWholeTokenRequest {
92
+ recipient: string;
93
+ tokenId: string;
94
+ memo?: string;
95
+ }
91
96
  interface MintResult {
92
97
  success: boolean;
93
98
  tokenId?: string;
@@ -157,6 +162,8 @@ interface PendingTransfer {
157
162
  recipient: string;
158
163
  coinId: string;
159
164
  amount: string;
165
+ /** Set instead of coinId/amount when the intent is a token-addressed spend. */
166
+ tokenId?: string;
160
167
  legs: {
161
168
  certified: number;
162
169
  total: number;
@@ -172,11 +179,16 @@ interface PaymentsV2 {
172
179
  tokens(filter?: {
173
180
  coinId?: string;
174
181
  }): Token[];
182
+ coinless(): CoinlessToken[];
183
+ tokenData(tokenId: string): Promise<Uint8Array | null>;
175
184
  history(page?: {
176
185
  before?: string;
177
186
  limit?: number;
178
187
  }): Promise<HistoryPage>;
179
188
  send(req: SendRequest): Promise<TransferResult>;
189
+ sendWholeToken(req: SendWholeTokenRequest): Promise<TransferResult>;
190
+ /** NFT-scoped twin: refuses a valued source. Connect's `send_nft` routes here. */
191
+ sendCoinless(req: SendWholeTokenRequest): Promise<TransferResult>;
180
192
  mint(coinId: string, amount: bigint): Promise<MintResult>;
181
193
  receive(): Promise<{
182
194
  transfers: IncomingTransfer[];
@@ -499,6 +511,31 @@ interface Token {
499
511
  */
500
512
  suspectedSpent?: boolean;
501
513
  }
514
+ /**
515
+ * A holding that names no coin (wallet-api#140) — an NFT. Deliberately NOT a
516
+ * `Token`: no amount, decimals or symbol, and never returned by `tokens()` or
517
+ * counted in `assets()`. `tokenType` names the token's CLASS and `tokenId` the
518
+ * instance (wallet-api#147). The payload is read with `payments.tokenData()`.
519
+ */
520
+ interface CoinlessToken {
521
+ readonly tokenId: string;
522
+ readonly tokenType?: string;
523
+ /**
524
+ * Class metadata resolved from the registry THIS wallet owns, when the type is
525
+ * recognised. Resolved here so callers never reach for a registry themselves:
526
+ * the process-global singleton is repointable by another Sphere's init, so a
527
+ * second wallet on another network would retarget it (#767).
528
+ */
529
+ readonly name?: string;
530
+ readonly iconUrl?: string;
531
+ readonly stateHash: string;
532
+ /** #737: reserved by a converging transfer — not spendable right now. */
533
+ readonly transferring: boolean;
534
+ /** #625: proven spent on-chain; excluded from spend selection. */
535
+ readonly suspectedSpent?: boolean;
536
+ readonly createdAt: number;
537
+ readonly updatedAt: number;
538
+ }
502
539
  interface Asset {
503
540
  readonly coinId: string;
504
541
  readonly symbol: string;
@@ -575,6 +612,8 @@ interface IncomingTransfer {
575
612
  readonly senderPubkey: string;
576
613
  readonly senderNametag?: string;
577
614
  readonly tokens: Token[];
615
+ /** Arrivals that name no coin (#777). Disjoint from `tokens`, never a zero Token. */
616
+ readonly coinless?: CoinlessToken[];
578
617
  readonly memo?: string;
579
618
  readonly receivedAt: number;
580
619
  }
@@ -2438,7 +2477,18 @@ interface InventoryItemWire {
2438
2477
  status: 'active' | 'removed';
2439
2478
  seq: number;
2440
2479
  stateHash: string;
2480
+ /**
2481
+ * Omitted for a tombstone AND for an ACTIVE COINLESS token (wallet-api#140),
2482
+ * so absence is never "removed" or "not loaded" — discriminate on `status`.
2483
+ */
2441
2484
  assets?: AssetWire[];
2485
+ /**
2486
+ * Genesis `TokenType`, lowercase hex (1-64 bytes ⇒ 2-128 chars). Names the
2487
+ * token's CLASS, not the instance (wallet-api#147). Absent on rows written
2488
+ * before wallet-api migration 0015. An unrecognised type is legitimate: never
2489
+ * reject or hide a token for it.
2490
+ */
2491
+ tokenType?: string;
2442
2492
  }
2443
2493
  interface InventoryPageWire {
2444
2494
  cursor: number;
@@ -4447,6 +4497,8 @@ interface TokenRegistryConfig {
4447
4497
  declare class TokenRegistry {
4448
4498
  private static instance;
4449
4499
  private readonly definitionsById;
4500
+ /** Non-fungible definitions keyed by TOKEN TYPE — a separate namespace (#147). */
4501
+ private readonly definitionsByType;
4450
4502
  private readonly definitionsBySymbol;
4451
4503
  private readonly definitionsByName;
4452
4504
  private remoteUrl;
@@ -4634,6 +4686,16 @@ declare class TokenRegistry {
4634
4686
  * @returns Array of all token definitions
4635
4687
  */
4636
4688
  getAllDefinitions(): TokenDefinition[];
4689
+ /**
4690
+ * Definition for a coinless token's genesis TOKEN TYPE (#777). Never falls back
4691
+ * to `getDefinition`: a type and a coin id live in different namespaces, so a
4692
+ * type that collided with a coin id would otherwise render as that coin.
4693
+ */
4694
+ getTypeMeta(tokenType: string): {
4695
+ name: string;
4696
+ iconUrl: string | null;
4697
+ } | null;
4698
+ getTypeDefinition(tokenType: string): TokenDefinition | undefined;
4637
4699
  /**
4638
4700
  * Get all fungible token definitions
4639
4701
  * @returns Array of fungible token definitions
@@ -4737,4 +4799,4 @@ declare function normalizeAddress(address: string): string;
4737
4799
  */
4738
4800
  declare function addressesMatch(a: string, b: string): boolean;
4739
4801
 
4740
- export { AUTH_CHALLENGE_PREFIX, type AddressInfo, type AddressType, type AggregatorEvent, type AggregatorEventCallback, type AggregatorEventType, type AggregatorProvider, type Asset, type BaseProvider, type BroadcastHandler, type BroadcastMessage, COIN_TYPES, ChallengeTemplateError, type CheckNetworkHealthOptions, CoinGeckoPriceProvider, CommunicationsModule, type CommunicationsModuleConfig, type CommunicationsModuleDependencies, type ComposingIndicator, type ConversationPage, type CreateGroupOptions, DEFAULT_AGGREGATOR_TIMEOUT, DEFAULT_DERIVATION_PATH, DEFAULT_GROUP_RELAYS, DEFAULT_MARKET_API_URL, DEFAULT_NOSTR_RELAYS, type DecryptionProgressCallback, type DerivationMode, type DirectMessage, type DiscoverAddressProgress, type DiscoverAddressesOptions, type DiscoverAddressesResult, type DiscoveredAddress, type EncryptedData, FIELD_ENCRYPTION_HKDF_INFO, FIELD_ENVELOPE_MAX_BYTES, FIELD_ENVELOPE_NONCE_BYTES, FIELD_ENVELOPE_PREFIX, type FullIdentity, type GetConversationPageOptions, GroupChatModule, type GroupChatModuleConfig, type GroupChatModuleDependencies, type GroupData, type GroupMemberData, type GroupMessageData, GroupRole, GroupVisibility, type HealthCheckFn, type HistoryRecord, type Identity, type IdentityConfig, type IncomingBroadcast, type IncomingMessage, type IncomingTransfer, type InitProgress, type InitProgressCallback, type InitProgressStep, type IntentStatus, type IntentType, LIMITS, type LegacyFileParseResult, type LegacyFileParsedData, type LegacyFileType, type LogHandler, type LogLevel, type LoggerConfig, type MarketIntent, MarketModule, type MarketModuleConfig, type MarketModuleDependencies, type MessageHandler, NETWORKS, NIP29_KINDS, NOSTR_EVENT_KINDS, type NetworkHealthResult, type NetworkType, type OracleEvent, type OracleEventCallback, type OracleEventType, type OracleProvider, type ParsedAddress, PartialSendConflictError, type PeerInfo, type PostIntentRequest, type PostIntentResult, type PricePlatform, type PriceProvider, type PriceProviderConfig, type ProviderMetadata, type ProviderRole, type ProviderStatus, type ProviderStatusInfo, type RegistryNetwork, SIGN_MESSAGE_PREFIX, STORAGE_KEYS_ADDRESS, STORAGE_KEYS_GLOBAL, STORAGE_PREFIX, type SearchFilters, type SearchIntentResult, type SearchOptions, type SearchResult, type ServiceHealthResult, Sphere, type SphereCreateOptions, SphereError, type SphereErrorCode, type SphereEventHandler, type SphereEventMap, type SphereEventType, type SphereImportOptions, type SphereInitOptions, type SphereInitResult, type SphereLoadOptions, type SphereStatus, type StorageProvider, TEST_NOSTR_RELAYS, TIMEOUTS, type Token, type TokenDefinition, type TokenIcon, type TokenPrice, TokenRegistry, type TokenStatus, type TokenTransferDetail, type TrackedAddress, type TrackedAddressEntry, type HistoryRecord as TransactionHistoryEntry, type TransferRequest, type TransferResult, type TransferStatus, type TransportEvent, type TransportEventCallback, type TransportEventType, type TransportProvider, type WalletApiTransportConfig, type WalletInfo, type WalletJSON, type WalletJSONExportOptions, type WalletSource, addressesMatch, assertFieldEnvelopeShape, base58Decode, base58Encode, bytesToHex, checkNetworkHealth, coinIdsMatch, createCommunicationsModule, createGroupChatModule, createKeyPair, createMarketModule, createPriceProvider, createSphere, decrypt, decryptField, decryptFieldBytes, decryptJson, decryptMnemonic, decryptSimple, decryptTextFormatKey, decryptWithSalt, deriveAddressInfo, deriveChildKey, deriveFieldEncryptionKey, deriveKeyAtPath, doubleSha256, encrypt, encryptField, encryptFieldBytes, encryptMnemonic, encryptSimple, extractFromText, findPattern, formatAmount, generateAddressFromMasterKey, generateMasterKey, generateMnemonic, getAddressId, getAddressStorageKey, getCoinIdByName, getCoinIdBySymbol, getPublicKey, getTokenDecimals, getTokenDefinition, getTokenIconUrl, getTokenName, getTokenSymbol, hash160, hashSignMessage, hexToBytes, identityFromMnemonicSync, initSphere, isKnownToken, isPossiblyCommittedSendOutcome, isSphereError, isTextWalletEncrypted, isValidAddress, isValidDirectAddress, isValidNametag, isValidPrivateKey, isWalletTextFormat, loadSphere, logger, mnemonicToSeedSync, normalizeAddress, normalizeCoinId, parseAddress, parseAndDecryptWalletText, parseTokenAmount, parseWalletText, randomBytes, randomHex, randomUUID, recoverPubkeyFromSignature, ripemd160, safeParseTokenAmount, sha256, signMessage, sleep, sphereExists, toHumanReadable, validateMnemonic, verifyChallengeTemplate, verifySignedMessage };
4802
+ export { AUTH_CHALLENGE_PREFIX, type AddressInfo, type AddressType, type AggregatorEvent, type AggregatorEventCallback, type AggregatorEventType, type AggregatorProvider, type Asset, type BaseProvider, type BroadcastHandler, type BroadcastMessage, COIN_TYPES, ChallengeTemplateError, type CheckNetworkHealthOptions, CoinGeckoPriceProvider, type CoinlessToken, CommunicationsModule, type CommunicationsModuleConfig, type CommunicationsModuleDependencies, type ComposingIndicator, type ConversationPage, type CreateGroupOptions, DEFAULT_AGGREGATOR_TIMEOUT, DEFAULT_DERIVATION_PATH, DEFAULT_GROUP_RELAYS, DEFAULT_MARKET_API_URL, DEFAULT_NOSTR_RELAYS, type DecryptionProgressCallback, type DerivationMode, type DirectMessage, type DiscoverAddressProgress, type DiscoverAddressesOptions, type DiscoverAddressesResult, type DiscoveredAddress, type EncryptedData, FIELD_ENCRYPTION_HKDF_INFO, FIELD_ENVELOPE_MAX_BYTES, FIELD_ENVELOPE_NONCE_BYTES, FIELD_ENVELOPE_PREFIX, type FullIdentity, type GetConversationPageOptions, GroupChatModule, type GroupChatModuleConfig, type GroupChatModuleDependencies, type GroupData, type GroupMemberData, type GroupMessageData, GroupRole, GroupVisibility, type HealthCheckFn, type HistoryRecord, type Identity, type IdentityConfig, type IncomingBroadcast, type IncomingMessage, type IncomingTransfer, type InitProgress, type InitProgressCallback, type InitProgressStep, type IntentStatus, type IntentType, LIMITS, type LegacyFileParseResult, type LegacyFileParsedData, type LegacyFileType, type LogHandler, type LogLevel, type LoggerConfig, type MarketIntent, MarketModule, type MarketModuleConfig, type MarketModuleDependencies, type MessageHandler, NETWORKS, NIP29_KINDS, NOSTR_EVENT_KINDS, type NetworkHealthResult, type NetworkType, type OracleEvent, type OracleEventCallback, type OracleEventType, type OracleProvider, type ParsedAddress, PartialSendConflictError, type PeerInfo, type PostIntentRequest, type PostIntentResult, type PricePlatform, type PriceProvider, type PriceProviderConfig, type ProviderMetadata, type ProviderRole, type ProviderStatus, type ProviderStatusInfo, type RegistryNetwork, SIGN_MESSAGE_PREFIX, STORAGE_KEYS_ADDRESS, STORAGE_KEYS_GLOBAL, STORAGE_PREFIX, type SearchFilters, type SearchIntentResult, type SearchOptions, type SearchResult, type ServiceHealthResult, Sphere, type SphereCreateOptions, SphereError, type SphereErrorCode, type SphereEventHandler, type SphereEventMap, type SphereEventType, type SphereImportOptions, type SphereInitOptions, type SphereInitResult, type SphereLoadOptions, type SphereStatus, type StorageProvider, TEST_NOSTR_RELAYS, TIMEOUTS, type Token, type TokenDefinition, type TokenIcon, type TokenPrice, TokenRegistry, type TokenStatus, type TokenTransferDetail, type TrackedAddress, type TrackedAddressEntry, type HistoryRecord as TransactionHistoryEntry, type TransferRequest, type TransferResult, type TransferStatus, type TransportEvent, type TransportEventCallback, type TransportEventType, type TransportProvider, type WalletApiTransportConfig, type WalletInfo, type WalletJSON, type WalletJSONExportOptions, type WalletSource, addressesMatch, assertFieldEnvelopeShape, base58Decode, base58Encode, bytesToHex, checkNetworkHealth, coinIdsMatch, createCommunicationsModule, createGroupChatModule, createKeyPair, createMarketModule, createPriceProvider, createSphere, decrypt, decryptField, decryptFieldBytes, decryptJson, decryptMnemonic, decryptSimple, decryptTextFormatKey, decryptWithSalt, deriveAddressInfo, deriveChildKey, deriveFieldEncryptionKey, deriveKeyAtPath, doubleSha256, encrypt, encryptField, encryptFieldBytes, encryptMnemonic, encryptSimple, extractFromText, findPattern, formatAmount, generateAddressFromMasterKey, generateMasterKey, generateMnemonic, getAddressId, getAddressStorageKey, getCoinIdByName, getCoinIdBySymbol, getPublicKey, getTokenDecimals, getTokenDefinition, getTokenIconUrl, getTokenName, getTokenSymbol, hash160, hashSignMessage, hexToBytes, identityFromMnemonicSync, initSphere, isKnownToken, isPossiblyCommittedSendOutcome, isSphereError, isTextWalletEncrypted, isValidAddress, isValidDirectAddress, isValidNametag, isValidPrivateKey, isWalletTextFormat, loadSphere, logger, mnemonicToSeedSync, normalizeAddress, normalizeCoinId, parseAddress, parseAndDecryptWalletText, parseTokenAmount, parseWalletText, randomBytes, randomHex, randomUUID, recoverPubkeyFromSignature, ripemd160, safeParseTokenAmount, sha256, signMessage, sleep, sphereExists, toHumanReadable, validateMnemonic, verifyChallengeTemplate, verifySignedMessage };