@utexo/rgb-sdk 1.0.4 → 1.0.5

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 (37) hide show
  1. package/Readme.md +261 -299
  2. package/cli/README.md +348 -0
  3. package/cli/commands/address.mjs +16 -0
  4. package/cli/commands/blindreceive.mjs +15 -0
  5. package/cli/commands/btcbalance.mjs +11 -0
  6. package/cli/commands/createlightninginvoice.mjs +14 -0
  7. package/cli/commands/createutxos.mjs +13 -0
  8. package/cli/commands/decodergbinvoice.mjs +9 -0
  9. package/cli/commands/generate_keys.mjs +35 -0
  10. package/cli/commands/getlightningreceiverequest.mjs +10 -0
  11. package/cli/commands/getlightningsendrequest.mjs +10 -0
  12. package/cli/commands/getonchainsendstatus.mjs +20 -0
  13. package/cli/commands/listassets.mjs +11 -0
  14. package/cli/commands/listtransfers.mjs +10 -0
  15. package/cli/commands/listunspents.mjs +10 -0
  16. package/cli/commands/onchainreceive.mjs +16 -0
  17. package/cli/commands/onchainsend.mjs +11 -0
  18. package/cli/commands/onchainsendbegin.mjs +9 -0
  19. package/cli/commands/onchainsendend.mjs +9 -0
  20. package/cli/commands/paylightninginvoice.mjs +11 -0
  21. package/cli/commands/paylightninginvoicebegin.mjs +10 -0
  22. package/cli/commands/paylightninginvoiceend.mjs +9 -0
  23. package/cli/commands/refresh.mjs +9 -0
  24. package/cli/commands/send.mjs +31 -0
  25. package/cli/commands/sign-psbt.mjs +12 -0
  26. package/cli/commands/signpsbt.mjs +10 -0
  27. package/cli/commands/witnessreceive.mjs +15 -0
  28. package/cli/generate_keys.mjs +66 -0
  29. package/cli/run.mjs +291 -0
  30. package/cli/utils.mjs +220 -0
  31. package/dist/index.cjs +1606 -121
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.mts +1235 -145
  34. package/dist/index.d.ts +1235 -145
  35. package/dist/index.mjs +1592 -116
  36. package/dist/index.mjs.map +1 -1
  37. package/package.json +21 -7
package/dist/index.d.ts CHANGED
@@ -143,6 +143,27 @@ declare function deriveKeysFromMnemonic(bitcoinNetwork: string | number | undefi
143
143
  * Derive wallet keys directly from a BIP39 seed (hex string or Uint8Array)
144
144
  */
145
145
  declare function deriveKeysFromSeed(bitcoinNetwork: string | number | undefined, seed: string | Uint8Array): Promise<GeneratedKeys>;
146
+ /**
147
+ * Derive wallet keys from either a mnemonic phrase or seed
148
+ * Automatically detects the input type and uses the appropriate derivation method
149
+ *
150
+ * @param bitcoinNetwork - Network string or number (default: 'regtest')
151
+ * @param mnemonicOrSeed - Either a BIP39 mnemonic phrase (string) or seed (Uint8Array | string)
152
+ * @returns Promise resolving to derived keys including mnemonic, xpubs, and master fingerprint
153
+ * @throws {ValidationError} If mnemonic is invalid
154
+ * @throws {CryptoError} If key derivation fails
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * // With mnemonic
159
+ * const keys1 = await deriveKeysFromMnemonicOrSeed('testnet', 'abandon abandon abandon...');
160
+ *
161
+ * // With seed (Uint8Array)
162
+ * const seed = new Uint8Array([...]);
163
+ * const keys2 = await deriveKeysFromMnemonicOrSeed('testnet', seed);
164
+ * ```
165
+ */
166
+ declare function deriveKeysFromMnemonicOrSeed(bitcoinNetwork: string | number | undefined, mnemonicOrSeed: string | Uint8Array): Promise<GeneratedKeys>;
146
167
  /**
147
168
  * Restore wallet keys from existing mnemonic (backward compatibility alias)
148
169
  * @deprecated Use `deriveKeysFromMnemonic()` instead. This alias will be removed in a future version.
@@ -215,12 +236,28 @@ declare function getXpubFromXpriv(xpriv: string, bitcoinNetwork?: string | numbe
215
236
  declare function deriveKeysFromXpriv(bitcoinNetwork: string | number | undefined, xpriv: string): Promise<GeneratedKeys>;
216
237
  declare function accountXpubsFromMnemonic(bitcoinNetwork: string | number | undefined, mnemonic: string): Promise<AccountXpubs>;
217
238
 
218
- type RGBHTTPClientParams = {
219
- xpubVan: string;
220
- xpubCol: string;
221
- masterFingerprint: string;
222
- rgbEndpoint: string;
223
- };
239
+ /**
240
+ * VSS (Versioned Storage Service) backup key derivation.
241
+ *
242
+ * Derives a 32-byte signing key from a BIP39 mnemonic for use with rgb-lib's
243
+ * VssBackupClient (server_url, store_id, signing_key). rgb-lib does not define
244
+ * mnemonic → signing_key; this SDK uses HMAC-SHA256 with the same domain string
245
+ * as rgb-lib's HKDF so backup/restore stay deterministic per wallet.
246
+ *
247
+ * Derivation: HMAC-SHA256(key = "rgb-lib-vss-backup-encryption-v1", message = mnemonic),
248
+ * output as 64-char hex (32 bytes).
249
+ */
250
+ /**
251
+ * Derive the VSS backup signing key from a BIP39 mnemonic.
252
+ * The result is a 64-character hex string (32 bytes) suitable for
253
+ * VssBackupConfig.signingKey. Must match rgb-lib's Rust derivation.
254
+ *
255
+ * @param mnemonic - BIP39 mnemonic phrase (12 or 24 words)
256
+ * @returns 32-byte signing key as hex string (same mnemonic always yields same key for backup/restore)
257
+ */
258
+ declare function deriveVssSigningKeyFromMnemonic(mnemonic: string): string;
259
+
260
+ type BitcoinNetwork = 'mainnet' | 'testnet' | 'testnet4' | 'regtest' | 'signet';
224
261
  interface FailTransfersRequest {
225
262
  batchTransferIdx?: number;
226
263
  noAssetOnly?: boolean;
@@ -243,16 +280,54 @@ interface WitnessData {
243
280
  blinding?: number;
244
281
  }
245
282
  interface InvoiceRequest {
246
- amount: number;
247
- assetId: string;
283
+ amount?: number;
284
+ assetId?: string;
248
285
  minConfirmations?: number;
249
286
  durationSeconds?: number;
250
287
  }
251
- interface Recipient {
288
+ type BatchRecipient = {
252
289
  recipientId: string;
253
- witnessData?: WitnessData;
254
- amount: number;
290
+ witnessData?: {
291
+ amountSat: string;
292
+ blinding?: number | null;
293
+ } | null;
294
+ assignment: {
295
+ Fungible: number;
296
+ };
255
297
  transportEndpoints: string[];
298
+ };
299
+ type RecipientMap = Record<string, BatchRecipient[]>;
300
+ /**
301
+ * VSS backup mode: Async (fire-and-forget) or Blocking (wait for upload).
302
+ */
303
+ type VssBackupMode = 'Async' | 'Blocking';
304
+ /**
305
+ * VSS backup configuration for cloud backup.
306
+ *
307
+ * serverUrl, storeId and signingKey are required; other fields are optional
308
+ * and default to the underlying rgb-lib defaults when omitted:
309
+ * - encryptionEnabled: true
310
+ * - autoBackup: false
311
+ * - backupMode: 'Async'
312
+ */
313
+ interface VssBackupConfig {
314
+ serverUrl: string;
315
+ storeId: string;
316
+ /**
317
+ * Signing key as a hex-encoded 32-byte secret key string.
318
+ */
319
+ signingKey: string;
320
+ encryptionEnabled?: boolean;
321
+ autoBackup?: boolean;
322
+ backupMode?: VssBackupMode;
323
+ }
324
+ /**
325
+ * Information about the current VSS backup status for a wallet.
326
+ */
327
+ interface VssBackupInfo {
328
+ backupExists: boolean;
329
+ serverVersion?: number | null;
330
+ backupRequired: boolean;
256
331
  }
257
332
  interface IssueAssetNiaRequestModel {
258
333
  ticker: string;
@@ -267,13 +342,14 @@ interface IssueAssetIfaRequestModel {
267
342
  amounts: number[];
268
343
  inflationAmounts: number[];
269
344
  replaceRightsNum: number;
270
- rejectListUrl?: string;
345
+ rejectListUrl: string | null;
271
346
  }
272
347
  interface SendAssetBeginRequestModel {
273
348
  invoice: string;
274
349
  witnessData?: WitnessData;
275
350
  assetId?: string;
276
351
  amount?: number;
352
+ donation?: boolean;
277
353
  feeRate?: number;
278
354
  minConfirmations?: number;
279
355
  }
@@ -318,16 +394,8 @@ interface SendBtcEndRequestModel {
318
394
  signedPsbt: string;
319
395
  skipSync?: boolean;
320
396
  }
321
- interface GetFeeEstimationRequestModel {
322
- blocks: number;
323
- }
324
397
  type GetFeeEstimationResponse = Record<string, number> | number;
325
- declare enum TransactionType {
326
- RGB_SEND = 0,
327
- DRAIN = 1,
328
- CREATE_UTXOS = 2,
329
- USER = 3
330
- }
398
+ type TransactionType = 'RgbSend' | 'Drain' | 'CreateUtxos' | 'User';
331
399
  interface BlockTime {
332
400
  height: number;
333
401
  timestamp: number;
@@ -340,59 +408,55 @@ interface Transaction {
340
408
  fee: number;
341
409
  confirmationTime?: BlockTime;
342
410
  }
343
- declare enum TransferKind {
344
- ISSUANCE = 0,
345
- RECEIVE_BLIND = 1,
346
- RECEIVE_WITNESS = 2,
347
- SEND = 3,
348
- INFLATION = 4
349
- }
350
- interface RgbTransfer {
411
+ type TransferKind = 'Issuance' | 'ReceiveBlind' | 'ReceiveWitness' | 'Send' | 'Inflation';
412
+ type Outpoint = {
413
+ txid: string;
414
+ vout: number;
415
+ };
416
+ interface Transfer {
351
417
  idx: number;
352
418
  batchTransferIdx: number;
353
419
  createdAt: number;
354
420
  updatedAt: number;
355
421
  status: TransferStatus;
356
- amount: number;
422
+ requestedAssignment?: Assignment;
423
+ assignments: Assignment[];
357
424
  kind: TransferKind;
358
- txid: string | null;
359
- recipientId: string;
360
- receiveUtxo: {
361
- txid: string;
362
- vout: number;
363
- };
364
- changeUtxo: {
365
- txid: string;
366
- vout: number;
367
- } | null;
368
- expiration: number;
425
+ txid?: string;
426
+ recipientId?: string;
427
+ receiveUtxo?: Outpoint;
428
+ changeUtxo?: Outpoint;
429
+ expiration?: number;
369
430
  transportEndpoints: {
370
431
  endpoint: string;
371
- transportType: number;
432
+ transportType: string;
372
433
  used: boolean;
373
434
  }[];
374
- }
375
- declare enum TransferStatus {
376
- WAITING_COUNTERPARTY = 0,
377
- WAITING_CONFIRMATIONS = 1,
378
- SETTLED = 2,
379
- FAILED = 3
380
- }
381
- interface Unspent {
382
- utxo: Utxo;
383
- rgbAllocations: RgbAllocation[];
384
- }
385
- interface Utxo {
435
+ invoiceString?: string;
436
+ consignmentPath?: string;
437
+ }
438
+ type TransferStatus = 'WaitingCounterparty' | 'WaitingConfirmations' | 'Settled' | 'Failed';
439
+ /** Bridge transfer statuses (from UTEXO bridge API) */
440
+ type BridgeTransferStatus = 'Unspecified' | 'Confirming' | 'Canceled' | 'Finished' | 'Waiting' | 'Cancelling' | 'Failed' | 'Fetching';
441
+ /** Unified status for on-chain operations (from RGB wallet or bridge) */
442
+ type OnchainSendStatus = TransferStatus | BridgeTransferStatus;
443
+ interface Unspent$1 {
444
+ utxo: Utxo$1;
445
+ rgbAllocations: RgbAllocation$1[];
446
+ pendingBlinded: number;
447
+ }
448
+ interface Utxo$1 {
386
449
  outpoint: {
387
450
  txid: string;
388
451
  vout: number;
389
452
  };
390
453
  btcAmount: number;
391
454
  colorable: boolean;
455
+ exists: boolean;
392
456
  }
393
- interface RgbAllocation {
394
- assetId: string;
395
- amount: number;
457
+ interface RgbAllocation$1 {
458
+ assetId?: string;
459
+ assignment: Assignment;
396
460
  settled: boolean;
397
461
  }
398
462
  interface Balance {
@@ -407,7 +471,7 @@ interface BtcBalance {
407
471
  interface InvoiceReceiveData {
408
472
  invoice: string;
409
473
  recipientId: string;
410
- expirationTimestamp: number;
474
+ expirationTimestamp: number | null;
411
475
  batchTransferIdx: number;
412
476
  }
413
477
  interface AssetNIA {
@@ -416,7 +480,7 @@ interface AssetNIA {
416
480
  * @memberof AssetNIA
417
481
  * @example rgb:2dkSTbr-jFhznbPmo-TQafzswCN-av4gTsJjX-ttx6CNou5-M98k8Zd
418
482
  */
419
- assetId?: string;
483
+ assetId: string;
420
484
  /**
421
485
  * @type {AssetIface}
422
486
  * @memberof AssetNIA
@@ -427,13 +491,13 @@ interface AssetNIA {
427
491
  * @memberof AssetNIA
428
492
  * @example USDT
429
493
  */
430
- ticker?: string;
494
+ ticker: string;
431
495
  /**
432
496
  * @type {string}
433
497
  * @memberof AssetNIA
434
498
  * @example Tether
435
499
  */
436
- name?: string;
500
+ name: string;
437
501
  /**
438
502
  * @type {string}
439
503
  * @memberof AssetNIA
@@ -445,30 +509,30 @@ interface AssetNIA {
445
509
  * @memberof AssetNIA
446
510
  * @example 0
447
511
  */
448
- precision?: number;
512
+ precision: number;
449
513
  /**
450
514
  * @type {number}
451
515
  * @memberof AssetNIA
452
516
  * @example 777
453
517
  */
454
- issuedSupply?: number;
518
+ issuedSupply: number;
455
519
  /**
456
520
  * @type {number}
457
521
  * @memberof AssetNIA
458
522
  * @example 1691160565
459
523
  */
460
- timestamp?: number;
524
+ timestamp: number;
461
525
  /**
462
526
  * @type {number}
463
527
  * @memberof AssetNIA
464
528
  * @example 1691161979
465
529
  */
466
- addedAt?: number;
530
+ addedAt: number;
467
531
  /**
468
- * @type {BtcBalance}
532
+ * @type {Balance}
469
533
  * @memberof AssetNIA
470
534
  */
471
- balance?: BtcBalance;
535
+ balance: Balance;
472
536
  /**
473
537
  * @type {Media}
474
538
  * @memberof AssetNIA
@@ -514,86 +578,432 @@ declare enum AssetSchema {
514
578
  Uda = "Uda",
515
579
  Cfa = "Cfa"
516
580
  }
581
+ type ListAssets = {
582
+ nia: AssetNIA[];
583
+ uda: AssetUDA[];
584
+ cfa: AssetCFA[];
585
+ ifa: AssetIfa[];
586
+ };
587
+ type AssetUDA = {
588
+ assetId: string;
589
+ ticker: string;
590
+ name: string;
591
+ details?: string;
592
+ precision: number;
593
+ timestamp: number;
594
+ addedAt: number;
595
+ balance: Balance;
596
+ token?: {
597
+ index: number;
598
+ ticker?: string;
599
+ name?: string;
600
+ details?: string;
601
+ embeddedMedia: boolean;
602
+ media?: Media;
603
+ attachments: Array<{
604
+ key: number;
605
+ filePath: string;
606
+ mime: string;
607
+ digest: string;
608
+ }>;
609
+ reserves: boolean;
610
+ };
611
+ };
612
+ type AssetCFA = {
613
+ assetId: string;
614
+ name: string;
615
+ details?: string;
616
+ precision: number;
617
+ issuedSupply: number;
618
+ timestamp: number;
619
+ addedAt: number;
620
+ balance: Balance;
621
+ media?: Media;
622
+ };
517
623
  /**
518
624
  *
519
625
  *
520
626
  * @export
521
- * @interface ListAssetsResponse
522
- */
523
- interface ListAssetsResponse {
524
- /**
525
- * @type {Array<AssetNIA>}
526
- * @memberof ListAssetsResponse
527
- */
528
- nia?: Array<AssetNIA>;
529
- /**
530
- * @type {Array<AssetNIA>}
531
- * @memberof ListAssetsResponse
532
- */
533
- uda?: Array<AssetNIA>;
534
- /**
535
- * @type {Array<AssetNIA>}
536
- * @memberof ListAssetsResponse
537
- */
538
- cfa?: Array<AssetNIA>;
539
- }
540
- interface IssueAssetNIAResponse {
541
- /**
542
- * @type {AssetNIA}
543
- * @memberof IssueAssetNIAResponse
544
- */
545
- asset?: AssetNIA;
546
- }
547
- /**
548
- *
549
- *
550
- * @export
551
- * @interface AssetBalanceResponse
627
+ * @interface AssetBalance
552
628
  */
553
- interface AssetBalanceResponse {
629
+ interface AssetBalance {
554
630
  /**
555
631
  * @type {number}
556
- * @memberof AssetBalanceResponse
632
+ * @memberof AssetBalance
557
633
  * @example 777
558
634
  */
559
635
  settled?: number;
560
636
  /**
561
637
  * @type {number}
562
- * @memberof AssetBalanceResponse
638
+ * @memberof AssetBalance
563
639
  * @example 777
564
640
  */
565
641
  future?: number;
566
642
  /**
567
643
  * @type {number}
568
- * @memberof AssetBalanceResponse
644
+ * @memberof AssetBalance
569
645
  * @example 777
570
646
  */
571
647
  spendable?: number;
572
648
  /**
573
649
  * @type {number}
574
- * @memberof AssetBalanceResponse
650
+ * @memberof AssetBalance
575
651
  * @example 444
576
652
  */
577
653
  offchainOutbound?: number;
578
654
  /**
579
655
  * @type {number}
580
- * @memberof AssetBalanceResponse
656
+ * @memberof AssetBalance
581
657
  * @example 0
582
658
  */
583
659
  offchainInbound?: number;
584
660
  }
585
- interface DecodeRgbInvoiceResponse {
661
+ interface InvoiceData {
662
+ invoice: string;
586
663
  recipientId: string;
587
- assetSchema?: string;
664
+ assetSchema?: AssetSchema;
588
665
  assetId?: string;
589
- network: string;
666
+ network: BitcoinNetwork;
590
667
  assignment: Assignment;
591
668
  assignmentName?: string;
592
- expirationTimestamp?: number;
669
+ expirationTimestamp: number | null;
593
670
  transportEndpoints: string[];
594
671
  }
595
- interface Assignment {
596
- [key: string]: any;
672
+ type AssignmentType = 'Fungible' | 'NonFungible' | 'InflationRight' | 'ReplaceRight' | 'Any';
673
+ type Assignment = {
674
+ type: AssignmentType;
675
+ amount?: number;
676
+ };
677
+
678
+ /**
679
+ * IWalletManager - Unified interface for WalletManager implementations
680
+ *
681
+ * This interface defines the contract that all WalletManager implementations must follow
682
+ * for cross-platform compatibility.
683
+ *
684
+ * All methods are async to support native module requirements.
685
+ * Synchronous implementations should wrap operations in Promise.resolve().
686
+ *
687
+ * Type Standards:
688
+ * - All enum-like types use PascalCase: 'RgbSend', 'WaitingCounterparty', 'Nia', etc.
689
+ * - Network identifiers use lowercase: 'mainnet', 'testnet', 'regtest', 'signet', 'testnet4'
690
+ * - Transaction types: 'RgbSend' | 'Drain' | 'CreateUtxos' | 'User'
691
+ * - Transfer status: 'WaitingCounterparty' | 'WaitingConfirmations' | 'Settled' | 'Failed'
692
+ * - Transfer kind: 'Issuance' | 'ReceiveBlind' | 'ReceiveWitness' | 'Send' | 'Inflation'
693
+ * - Asset schemas: 'Nia' | 'Uda' | 'Cfa' | 'Ifa'
694
+ * - Assignment types: 'Fungible' | 'NonFungible' | 'InflationRight' | 'ReplaceRight' | 'Any'
695
+ */
696
+
697
+ /**
698
+ * Unified WalletManager interface for cross-platform compatibility
699
+ *
700
+ * This interface ensures all implementations provide the same API surface,
701
+ * allowing clients to switch between implementations based on environment.
702
+ */
703
+ interface IWalletManager {
704
+ /**
705
+ * Initialize the wallet and establish online connection
706
+ * Must be called before performing operations that require network access.
707
+ *
708
+ * @returns Promise that resolves when initialization is complete
709
+ * @throws {WalletError} if initialization fails
710
+ *
711
+ * NOTE: Some implementations require this method to be called explicitly,
712
+ * while others may initialize automatically in the constructor.
713
+ */
714
+ initialize(): Promise<void>;
715
+ /**
716
+ * Connect the wallet to an online indexer service for syncing and transaction operations.
717
+ * Must be called before performing operations that require network connectivity.
718
+ *
719
+ * @param indexerUrl - The URL of the RGB indexer service to connect to
720
+ * @param skipConsistencyCheck - If true, skips the consistency check with the indexer (default: false)
721
+ * @returns Promise that resolves when the wallet is successfully connected online
722
+ * @throws {WalletError} if connection fails
723
+ */
724
+ goOnline(indexerUrl: string, skipConsistencyCheck?: boolean): Promise<void>;
725
+ /**
726
+ * Get wallet's extended public keys
727
+ * @returns Object containing vanilla and colored extended public keys
728
+ */
729
+ getXpub(): {
730
+ xpubVan: string;
731
+ xpubCol: string;
732
+ };
733
+ /**
734
+ * Get wallet's network
735
+ * @returns Network identifier
736
+ */
737
+ getNetwork(): Network;
738
+ /**
739
+ * Dispose of sensitive wallet data
740
+ * Clears mnemonic and seed from memory, closes connections
741
+ * Idempotent - safe to call multiple times
742
+ *
743
+ * @returns Promise that resolves when disposal is complete
744
+ */
745
+ dispose(): Promise<void>;
746
+ /**
747
+ * Check if wallet has been disposed
748
+ * @returns true if wallet has been disposed, false otherwise
749
+ */
750
+ isDisposed(): boolean;
751
+ /**
752
+ * Register wallet and get initial address and balance
753
+ * This is typically called once after wallet creation
754
+ *
755
+ * @returns Promise resolving to address and BTC balance
756
+ */
757
+ /**
758
+ * Get current BTC balance
759
+ * @returns Promise resolving to BTC balance information
760
+ */
761
+ getBtcBalance(): Promise<BtcBalance>;
762
+ /**
763
+ * Get wallet's receiving address
764
+ * @returns Promise resolving to Bitcoin address string
765
+ */
766
+ getAddress(): Promise<string>;
767
+ /**
768
+ * List all unspent transaction outputs (UTXOs)
769
+ * @returns Promise resolving to array of unspent outputs
770
+ */
771
+ listUnspents(): Promise<Unspent$1[]>;
772
+ /**
773
+ * Begin creating UTXOs (first step of two-step process)
774
+ * @param params - UTXO creation parameters
775
+ * @returns Promise resolving to base64-encoded PSBT that needs to be signed
776
+ */
777
+ createUtxosBegin(params: CreateUtxosBeginRequestModel): Promise<string>;
778
+ /**
779
+ * Complete UTXO creation (second step after signing)
780
+ * @param params - Signed PSBT from createUtxosBegin
781
+ * @returns Promise resolving to number of UTXOs created
782
+ */
783
+ createUtxosEnd(params: CreateUtxosEndRequestModel): Promise<number>;
784
+ /**
785
+ * Complete UTXO creation flow: begin → sign → end
786
+ * Convenience method that combines createUtxosBegin, signing, and createUtxosEnd
787
+ *
788
+ * @param params - UTXO creation parameters
789
+ * @returns Promise resolving to number of UTXOs created
790
+ */
791
+ createUtxos(params: {
792
+ upTo?: boolean;
793
+ num?: number;
794
+ size?: number;
795
+ feeRate?: number;
796
+ }): Promise<number>;
797
+ /**
798
+ * List all assets in the wallet
799
+ * Returns assets grouped by schema (NIA, UDA, CFA, IFA)
800
+ * @returns Promise resolving to assets information grouped by schema
801
+ */
802
+ listAssets(): Promise<ListAssets>;
803
+ /**
804
+ * Get balance for a specific asset
805
+ * @param asset_id - Asset identifier
806
+ * @returns Promise resolving to asset balance information
807
+ */
808
+ getAssetBalance(asset_id: string): Promise<AssetBalance>;
809
+ /**
810
+ * Issue a new NIA (Non-Inflatable Asset)
811
+ * @param params - Asset issuance parameters
812
+ * @returns Promise resolving to issued asset information
813
+ */
814
+ issueAssetNia(params: IssueAssetNiaRequestModel): Promise<AssetNIA>;
815
+ /**
816
+ * Issue a new IFA (Inflatable Fungible Asset)
817
+ * @param params - Asset issuance parameters
818
+ * @returns Promise resolving to issued asset information
819
+ */
820
+ issueAssetIfa(params: IssueAssetIfaRequestModel): Promise<any>;
821
+ /**
822
+ * Begin asset inflation (first step of two-step process)
823
+ * @param params - Inflation parameters
824
+ * @returns Promise resolving to base64-encoded PSBT that needs to be signed
825
+ */
826
+ inflateBegin(params: InflateAssetIfaRequestModel): Promise<string>;
827
+ /**
828
+ * Complete asset inflation (second step after signing)
829
+ * @param params - Signed PSBT from inflateBegin
830
+ * @returns Promise resolving to operation result
831
+ */
832
+ inflateEnd(params: InflateEndRequestModel): Promise<OperationResult>;
833
+ /**
834
+ * Complete inflation flow: begin → sign → end
835
+ * Convenience method that combines inflateBegin, signing, and inflateEnd
836
+ *
837
+ * @param params - Inflation parameters
838
+ * @param mnemonic - Optional mnemonic for signing (uses wallet's mnemonic if not provided)
839
+ * @returns Promise resolving to operation result
840
+ */
841
+ inflate(params: InflateAssetIfaRequestModel, mnemonic?: string): Promise<OperationResult>;
842
+ /**
843
+ * Begin sending assets (first step of two-step process)
844
+ * @param params - Send parameters including invoice
845
+ * @returns Promise resolving to base64-encoded PSBT that needs to be signed
846
+ */
847
+ sendBegin(params: SendAssetBeginRequestModel): Promise<string>;
848
+ /**
849
+ * Complete sending assets (second step after signing)
850
+ * @param params - Signed PSBT from sendBegin
851
+ * @returns Promise resolving to send result with txid
852
+ */
853
+ sendEnd(params: SendAssetEndRequestModel): Promise<SendResult>;
854
+ /**
855
+ * Complete send flow: begin → sign → end
856
+ * Convenience method that combines sendBegin, signing, and sendEnd
857
+ *
858
+ * @param invoiceTransfer - Send parameters including invoice
859
+ * @param mnemonic - Optional mnemonic for signing (uses wallet's mnemonic if not provided)
860
+ * @returns Promise resolving to send result with txid
861
+ */
862
+ send(invoiceTransfer: SendAssetBeginRequestModel, mnemonic?: string): Promise<SendResult>;
863
+ /**
864
+ * Begin sending BTC (first step of two-step process)
865
+ * @param params - Send BTC parameters
866
+ * @returns Promise resolving to base64-encoded PSBT that needs to be signed
867
+ */
868
+ sendBtcBegin(params: SendBtcBeginRequestModel): Promise<string>;
869
+ /**
870
+ * Complete sending BTC (second step after signing)
871
+ * @param params - Signed PSBT from sendBtcBegin
872
+ * @returns Promise resolving to transaction ID
873
+ */
874
+ sendBtcEnd(params: SendBtcEndRequestModel): Promise<string>;
875
+ /**
876
+ * Complete BTC send flow: begin → sign → end
877
+ * Convenience method that combines sendBtcBegin, signing, and sendBtcEnd
878
+ *
879
+ * @param params - Send BTC parameters
880
+ * @returns Promise resolving to transaction ID
881
+ */
882
+ sendBtc(params: SendBtcBeginRequestModel): Promise<string>;
883
+ /**
884
+ * Generate blind receive invoice
885
+ * Creates an invoice for receiving assets without revealing the amount
886
+ *
887
+ * @param params - Invoice generation parameters including assignment type
888
+ * Assignment types: 'Fungible' | 'NonFungible' | 'InflationRight' | 'ReplaceRight' | 'Any'
889
+ * @returns Promise resolving to invoice data including invoice string
890
+ */
891
+ blindReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
892
+ /**
893
+ * Generate witness receive invoice
894
+ * Creates an invoice for receiving assets with amount visible
895
+ *
896
+ * @param params - Invoice generation parameters including assignment type
897
+ * Assignment types: 'Fungible' | 'NonFungible' | 'InflationRight' | 'ReplaceRight' | 'Any'
898
+ * @returns Promise resolving to invoice data including invoice string
899
+ */
900
+ witnessReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
901
+ /**
902
+ * Decode RGB invoice
903
+ * Extracts information from an RGB invoice string
904
+ *
905
+ * @param params - Invoice string to decode
906
+ * @returns Promise resolving to decoded invoice data including recipientId, assetSchema, assignment, etc.
907
+ */
908
+ decodeRGBInvoice(params: {
909
+ invoice: string;
910
+ }): Promise<InvoiceData>;
911
+ /**
912
+ * List all transactions
913
+ * @returns Promise resolving to array of transactions
914
+ * Each transaction includes transactionType ('RgbSend' | 'Drain' | 'CreateUtxos' | 'User'),
915
+ * txid, received/sent amounts, fee, and optional confirmationTime
916
+ */
917
+ listTransactions(): Promise<Transaction[]>;
918
+ /**
919
+ * List transfers for a specific asset or all assets
920
+ * @param asset_id - Optional asset identifier (lists all if not provided)
921
+ * @returns Promise resolving to array of transfers
922
+ * Each transfer includes status ('WaitingCounterparty' | 'WaitingConfirmations' | 'Settled' | 'Failed'),
923
+ * kind ('Issuance' | 'ReceiveBlind' | 'ReceiveWitness' | 'Send' | 'Inflation'),
924
+ * assignments, and transport endpoints
925
+ */
926
+ listTransfers(asset_id?: string): Promise<Transfer[]>;
927
+ /**
928
+ * Mark transfers as failed
929
+ * @param params - Transfer failure parameters
930
+ * @returns Promise resolving to boolean indicating success
931
+ */
932
+ failTransfers(params: FailTransfersRequest): Promise<boolean>;
933
+ /**
934
+ * Refresh wallet state
935
+ * Syncs wallet with the network and updates internal state
936
+ *
937
+ * @returns Promise that resolves when refresh is complete
938
+ */
939
+ refreshWallet(): Promise<void>;
940
+ /**
941
+ * Sync wallet with network
942
+ * Performs a full synchronization with the indexer
943
+ *
944
+ * @returns Promise that resolves when sync is complete
945
+ */
946
+ syncWallet(): Promise<void>;
947
+ /**
948
+ * Configure VSS (Versioned Storage Service) cloud backup for this wallet.
949
+ * When configured with autoBackup enabled, the wallet will perform automatic
950
+ * backups after state-changing operations according to the underlying rgb-lib behavior.
951
+ */
952
+ configureVssBackup(config: VssBackupConfig): Promise<void>;
953
+ /**
954
+ * Disable automatic VSS backup for this wallet.
955
+ */
956
+ disableVssAutoBackup(): Promise<void>;
957
+ /**
958
+ * Trigger a VSS backup immediately and return the server version of the stored backup.
959
+ */
960
+ vssBackup(config: VssBackupConfig): Promise<number>;
961
+ /**
962
+ * Get VSS backup status information for this wallet.
963
+ */
964
+ vssBackupInfo(config: VssBackupConfig): Promise<VssBackupInfo>;
965
+ /**
966
+ * Estimate fee rate for a given number of blocks
967
+ * @param blocks - Number of blocks for fee estimation
968
+ * @returns Promise resolving to fee estimation response
969
+ */
970
+ estimateFeeRate(blocks: number): Promise<GetFeeEstimationResponse>;
971
+ /**
972
+ * Estimate fee for a specific PSBT
973
+ * @param psbtBase64 - Base64-encoded PSBT
974
+ * @returns Promise resolving to fee estimation result
975
+ */
976
+ estimateFee(psbtBase64: string): Promise<EstimateFeeResult>;
977
+ /**
978
+ * Create wallet backup
979
+ * @param params - Backup parameters including path and password
980
+ * @returns Promise resolving to backup response
981
+ */
982
+ createBackup(params: {
983
+ backupPath: string;
984
+ password: string;
985
+ }): Promise<WalletBackupResponse>;
986
+ /**
987
+ * Sign a PSBT using the wallet's mnemonic or a provided mnemonic
988
+ * @param psbt - Base64 encoded PSBT
989
+ * @param mnemonic - Optional mnemonic (uses wallet's mnemonic if not provided)
990
+ * @returns Promise resolving to signed PSBT (base64-encoded)
991
+ */
992
+ signPsbt(psbt: string, mnemonic?: string): Promise<string>;
993
+ /**
994
+ * Sign a message using Schnorr signature
995
+ * @param message - Message to sign
996
+ * @returns Promise resolving to signature string
997
+ */
998
+ signMessage(message: string): Promise<string>;
999
+ /**
1000
+ * Verify a Schnorr message signature
1001
+ * @param message - Original message
1002
+ * @param signature - Signature to verify
1003
+ * @param accountXpub - Optional account xpub (uses wallet's xpubVan if not provided)
1004
+ * @returns Promise resolving to boolean indicating if signature is valid
1005
+ */
1006
+ verifyMessage(message: string, signature: string, accountXpub?: string): Promise<boolean>;
597
1007
  }
598
1008
 
599
1009
  /**
@@ -645,7 +1055,7 @@ type WalletInitParams = {
645
1055
  * const balance = await wallet.getBtcBalance();
646
1056
  * ```
647
1057
  */
648
- declare class WalletManager {
1058
+ declare class WalletManager implements IWalletManager {
649
1059
  private readonly client;
650
1060
  private readonly xpub;
651
1061
  private readonly xpubVan;
@@ -657,6 +1067,8 @@ declare class WalletManager {
657
1067
  private disposed;
658
1068
  private readonly dataDir;
659
1069
  constructor(params: WalletInitParams);
1070
+ initialize(): Promise<void>;
1071
+ goOnline(indexerUrl: string, skipConsistencyCheck?: boolean): Promise<void>;
660
1072
  /**
661
1073
  * Get wallet's extended public keys
662
1074
  */
@@ -673,7 +1085,7 @@ declare class WalletManager {
673
1085
  * Clears mnemonic and seed from memory
674
1086
  * Idempotent - safe to call multiple times
675
1087
  */
676
- dispose(): void;
1088
+ dispose(): Promise<void>;
677
1089
  /**
678
1090
  * Check if wallet has been disposed
679
1091
  */
@@ -687,43 +1099,78 @@ declare class WalletManager {
687
1099
  address: string;
688
1100
  btcBalance: BtcBalance;
689
1101
  };
690
- getBtcBalance(): BtcBalance;
691
- getAddress(): string;
692
- listUnspents(): Unspent[];
693
- listAssets(): ListAssetsResponse;
694
- getAssetBalance(asset_id: string): AssetBalanceResponse;
695
- createUtxosBegin(params: CreateUtxosBeginRequestModel): string;
696
- createUtxosEnd(params: CreateUtxosEndRequestModel): number;
697
- sendBegin(params: SendAssetBeginRequestModel): string;
698
- sendEnd(params: SendAssetEndRequestModel): SendResult;
699
- sendBtcBegin(params: SendBtcBeginRequestModel): string;
700
- sendBtcEnd(params: SendBtcEndRequestModel): string;
701
- estimateFeeRate(blocks: number): GetFeeEstimationResponse;
702
- estimateFee(psbtBase64: string): Promise<EstimateFeeResult>;
703
- sendBtc(params: SendBtcBeginRequestModel): Promise<string>;
704
- blindReceive(params: InvoiceRequest): InvoiceReceiveData;
705
- witnessReceive(params: InvoiceRequest): InvoiceReceiveData;
706
- issueAssetNia(params: IssueAssetNiaRequestModel): AssetNIA;
707
- issueAssetIfa(params: IssueAssetIfaRequestModel): AssetIfa;
708
- inflateBegin(params: InflateAssetIfaRequestModel): string;
709
- inflateEnd(params: InflateEndRequestModel): OperationResult;
1102
+ getBtcBalance(): Promise<BtcBalance>;
1103
+ getAddress(): Promise<string>;
1104
+ listUnspents(): Promise<Unspent$1[]>;
1105
+ listAssets(): Promise<ListAssets>;
1106
+ getAssetBalance(asset_id: string): Promise<AssetBalance>;
1107
+ createUtxosBegin(params: CreateUtxosBeginRequestModel): Promise<string>;
1108
+ createUtxosEnd(params: CreateUtxosEndRequestModel): Promise<number>;
1109
+ sendBegin(params: SendAssetBeginRequestModel): Promise<string>;
710
1110
  /**
711
- * Complete inflate operation: begin sign → end
712
- * @param params - Inflate parameters
713
- * @param mnemonic - Optional mnemonic for signing
1111
+ * Batch send begin: accepts already-built recipientMap.
1112
+ * Returns unsigned PSBT (use signPsbt then sendEnd to complete).
714
1113
  */
715
- inflate(params: InflateAssetIfaRequestModel, mnemonic?: string): Promise<OperationResult>;
716
- refreshWallet(): void;
717
- listTransactions(): Transaction[];
718
- listTransfers(asset_id?: string): RgbTransfer[];
719
- failTransfers(params: FailTransfersRequest): boolean;
720
- decodeRGBInvoice(params: {
1114
+ sendBeginBatch(params: {
1115
+ recipientMap: RecipientMap;
1116
+ feeRate?: number;
1117
+ minConfirmations?: number;
1118
+ donation?: boolean;
1119
+ }): Promise<string>;
1120
+ /**
1121
+ * Complete batch send: sendBeginBatch → sign PSBT → sendEnd.
1122
+ */
1123
+ sendBatch(params: {
1124
+ recipientMap: RecipientMap;
1125
+ feeRate?: number;
1126
+ minConfirmations?: number;
1127
+ donation?: boolean;
1128
+ }, mnemonic?: string): Promise<SendResult>;
1129
+ sendEnd(params: SendAssetEndRequestModel): Promise<SendResult>;
1130
+ sendBtcBegin(params: SendBtcBeginRequestModel): Promise<string>;
1131
+ sendBtcEnd(params: SendBtcEndRequestModel): Promise<string>;
1132
+ estimateFeeRate(blocks: number): Promise<GetFeeEstimationResponse>;
1133
+ estimateFee(psbtBase64: string): Promise<EstimateFeeResult>;
1134
+ sendBtc(params: SendBtcBeginRequestModel): Promise<string>;
1135
+ blindReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
1136
+ witnessReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
1137
+ decodeRGBInvoice(params: {
721
1138
  invoice: string;
722
- }): DecodeRgbInvoiceResponse;
1139
+ }): Promise<InvoiceData>;
1140
+ issueAssetNia(params: IssueAssetNiaRequestModel): Promise<AssetNIA>;
1141
+ issueAssetIfa(params: IssueAssetIfaRequestModel): Promise<AssetIfa>;
1142
+ inflateBegin(params: InflateAssetIfaRequestModel): Promise<string>;
1143
+ inflateEnd(params: InflateEndRequestModel): Promise<OperationResult>;
1144
+ /**
1145
+ * Complete inflate operation: begin → sign → end
1146
+ * @param params - Inflate parameters
1147
+ * @param mnemonic - Optional mnemonic for signing
1148
+ */
1149
+ inflate(params: InflateAssetIfaRequestModel, mnemonic?: string): Promise<OperationResult>;
1150
+ refreshWallet(): Promise<void>;
1151
+ listTransactions(): Promise<Transaction[]>;
1152
+ listTransfers(asset_id?: string): Promise<Transfer[]>;
1153
+ failTransfers(params: FailTransfersRequest): Promise<boolean>;
723
1154
  createBackup(params: {
724
1155
  backupPath: string;
725
1156
  password: string;
726
- }): WalletBackupResponse;
1157
+ }): Promise<WalletBackupResponse>;
1158
+ /**
1159
+ * Configure VSS cloud backup for this wallet.
1160
+ */
1161
+ configureVssBackup(config: VssBackupConfig): Promise<void>;
1162
+ /**
1163
+ * Disable automatic VSS backup.
1164
+ */
1165
+ disableVssAutoBackup(): Promise<void>;
1166
+ /**
1167
+ * Trigger a VSS backup immediately and return the server version.
1168
+ */
1169
+ vssBackup(config: VssBackupConfig): Promise<number>;
1170
+ /**
1171
+ * Get VSS backup info for this wallet.
1172
+ */
1173
+ vssBackupInfo(config: VssBackupConfig): Promise<VssBackupInfo>;
727
1174
  /**
728
1175
  * Sign a PSBT using the wallet's mnemonic or a provided mnemonic
729
1176
  * @param psbt - Base64 encoded PSBT
@@ -742,7 +1189,7 @@ declare class WalletManager {
742
1189
  size?: number;
743
1190
  feeRate?: number;
744
1191
  }): Promise<number>;
745
- syncWallet(): void;
1192
+ syncWallet(): Promise<void>;
746
1193
  signMessage(message: string): Promise<string>;
747
1194
  verifyMessage(message: string, signature: string, accountXpub?: string): Promise<boolean>;
748
1195
  }
@@ -767,6 +1214,648 @@ declare class WalletManager {
767
1214
  declare function createWalletManager(params: WalletInitParams): WalletManager;
768
1215
  declare const wallet: WalletManager;
769
1216
 
1217
+ /**
1218
+ * UTEXO Protocol Types
1219
+ */
1220
+ type PublicKeys = {
1221
+ xpub: string;
1222
+ accountXpubVanilla: string;
1223
+ accountXpubColored: string;
1224
+ masterFingerprint: string;
1225
+ };
1226
+ /**
1227
+ * Lightning API Types
1228
+ */
1229
+ interface LightningAsset {
1230
+ /**
1231
+ * @type {string}
1232
+ * @memberof LightningAsset
1233
+ */
1234
+ assetId: string;
1235
+ /**
1236
+ * @type {number}
1237
+ * @memberof LightningAsset
1238
+ */
1239
+ amount: number;
1240
+ }
1241
+ /**
1242
+ * Request model for creating Lightning invoice.
1243
+ *
1244
+ * @export
1245
+ * @interface CreateLightningInvoiceRequestModel
1246
+ */
1247
+ interface CreateLightningInvoiceRequestModel {
1248
+ /**
1249
+ * @type {number}
1250
+ * @memberof CreateLightningInvoiceRequestModel
1251
+ */
1252
+ amountSats?: number;
1253
+ /**
1254
+ * @type {LightningAsset}
1255
+ * @memberof CreateLightningInvoiceRequestModel
1256
+ */
1257
+ asset: LightningAsset;
1258
+ /**
1259
+ * @type {number}
1260
+ * @memberof CreateLightningInvoiceRequestModel
1261
+ */
1262
+ expirySeconds?: number;
1263
+ }
1264
+ interface LightningReceiveRequest {
1265
+ lnInvoice: string;
1266
+ expiresAt?: number;
1267
+ }
1268
+ interface LightningSendRequest extends SendResult {
1269
+ }
1270
+ interface GetLightningSendFeeEstimateRequestModel {
1271
+ invoice: string;
1272
+ assetId?: string;
1273
+ }
1274
+ interface PayLightningInvoiceRequestModel {
1275
+ lnInvoice: string;
1276
+ amount?: number;
1277
+ assetId?: string;
1278
+ maxFee?: number;
1279
+ }
1280
+ interface PayLightningInvoiceEndRequestModel {
1281
+ signedPsbt: string;
1282
+ lnInvoice: string;
1283
+ }
1284
+ /**
1285
+ * Onchain API Types
1286
+ */
1287
+ interface OnchainReceiveRequestModel extends InvoiceRequest {
1288
+ amount: number;
1289
+ assetId: string;
1290
+ }
1291
+ interface OnchainReceiveResponse {
1292
+ /** Mainnet invoice */
1293
+ invoice: string;
1294
+ }
1295
+ interface OnchainSendRequestModel {
1296
+ /** Mainnet invoice */
1297
+ invoice: string;
1298
+ assetId?: string;
1299
+ amount?: number;
1300
+ }
1301
+ interface OnchainSendEndRequestModel {
1302
+ /** Mainnet invoice */
1303
+ invoice: string;
1304
+ signedPsbt: string;
1305
+ }
1306
+ interface OnchainSendResponse extends SendResult {
1307
+ }
1308
+ interface ListLightningPaymentsResponse {
1309
+ payments: LightningSendRequest[];
1310
+ }
1311
+
1312
+ /**
1313
+ * UTEXO Protocol Interfaces
1314
+ *
1315
+ * These interfaces define the contract for UTEXO-specific operations.
1316
+ * They are separated by concern (Lightning vs Onchain) and combined into IUTEXOProtocol.
1317
+ */
1318
+
1319
+ /**
1320
+ * Lightning Protocol Interface
1321
+ *
1322
+ * Defines methods for Lightning Network operations including
1323
+ * invoice creation, payments, and fee estimation.
1324
+ */
1325
+ interface ILightningProtocol {
1326
+ /**
1327
+ * Creates a Lightning invoice for receiving BTC or asset payments.
1328
+ *
1329
+ * @param params - Request parameters for creating the Lightning invoice
1330
+ * @returns Promise resolving to Lightning invoice response
1331
+ */
1332
+ createLightningInvoice(params: CreateLightningInvoiceRequestModel): Promise<LightningReceiveRequest>;
1333
+ /**
1334
+ * Returns the status of a Lightning invoice created with createLightningInvoice.
1335
+ * Supports both BTC and asset invoices.
1336
+ *
1337
+ * @param id - The request ID of the Lightning invoice
1338
+ * @returns Promise resolving to Lightning invoice response or null if not found
1339
+ */
1340
+ getLightningReceiveRequest(id: string): Promise<TransferStatus | null>;
1341
+ /**
1342
+ * Returns the current status of a Lightning payment initiated with payLightningInvoice.
1343
+ * Works for both BTC and asset payments.
1344
+ *
1345
+ * @param id - The request ID of the Lightning send request
1346
+ * @returns Promise resolving to Lightning send request response or null if not found
1347
+ */
1348
+ getLightningSendRequest(id: string): Promise<TransferStatus | null>;
1349
+ /**
1350
+ * Estimates the routing fee required to pay a Lightning invoice.
1351
+ * For asset payments, the returned fee is always denominated in satoshis.
1352
+ *
1353
+ * @param params - Request parameters containing the invoice and optional asset
1354
+ * @returns Promise resolving to estimated fee in satoshis
1355
+ */
1356
+ getLightningSendFeeEstimate(params: GetLightningSendFeeEstimateRequestModel): Promise<number>;
1357
+ /**
1358
+ * Begins a Lightning invoice payment process.
1359
+ * Returns the invoice string as a mock PSBT (later will be constructed base64 PSBT).
1360
+ *
1361
+ * @param params - Request parameters containing the invoice and max fee
1362
+ * @returns Promise resolving to PSBT string (currently returns invoice, later will be base64 PSBT)
1363
+ */
1364
+ payLightningInvoiceBegin(params: PayLightningInvoiceRequestModel): Promise<string>;
1365
+ /**
1366
+ * Completes a Lightning invoice payment using signed PSBT.
1367
+ * Works the same as pay-invoice but uses signed_psbt instead of invoice.
1368
+ *
1369
+ * @param params - Request parameters containing the signed PSBT
1370
+ * @returns Promise resolving to Lightning send request response
1371
+ */
1372
+ payLightningInvoiceEnd(params: SendAssetEndRequestModel): Promise<LightningSendRequest>;
1373
+ /**
1374
+ * Pays a Lightning invoice using the UTEXOWallet.
1375
+ * This method supports BTC Lightning payments and asset-based Lightning payments.
1376
+ *
1377
+ * This is a convenience method that combines:
1378
+ * 1. payLightningInvoiceBegin - to get the PSBT
1379
+ * 2. signPsbt - to sign the PSBT (mock for now)
1380
+ * 3. payLightningInvoiceEnd - to complete the payment
1381
+ *
1382
+ * @param params - Request parameters containing the invoice and max fee
1383
+ * @param mnemonic - Optional mnemonic for signing (uses wallet's mnemonic if not provided)
1384
+ * @returns Promise resolving to Lightning send request response
1385
+ */
1386
+ payLightningInvoice(params: PayLightningInvoiceRequestModel, mnemonic?: string): Promise<LightningSendRequest>;
1387
+ /**
1388
+ * Lists Lightning payments.
1389
+ *
1390
+ * @returns Promise resolving to response containing array of Lightning payments
1391
+ */
1392
+ listLightningPayments(): Promise<ListLightningPaymentsResponse>;
1393
+ }
1394
+ /**
1395
+ * Onchain Protocol Interface
1396
+ *
1397
+ * Defines methods for on-chain withdrawal operations from UTEXO layer.
1398
+ */
1399
+ interface IOnchainProtocol {
1400
+ /**
1401
+ * Begins an on-chain send process from UTEXO.
1402
+ * Returns the request encoded as base64 (mock PSBT).
1403
+ * Later this should construct and return a real base64 PSBT.
1404
+ *
1405
+ * @param params - Request parameters for on-chain send
1406
+ * @returns Promise resolving to PSBT string (currently returns encoded request, later will be base64 PSBT)
1407
+ */
1408
+ onchainSendBegin(params: OnchainSendRequestModel): Promise<string>;
1409
+ /**
1410
+ * Completes an on-chain send from UTEXO using signed PSBT.
1411
+ *
1412
+ * @param params - Request parameters containing the signed PSBT
1413
+ * @returns Promise resolving to on-chain send response
1414
+ */
1415
+ onchainSendEnd(params: SendAssetEndRequestModel): Promise<OnchainSendResponse>;
1416
+ /**
1417
+ * Sends BTC or assets on-chain from the UTEXO layer.
1418
+ * This operation creates a Bitcoin transaction that releases funds from UTEXO to a specified on-chain address.
1419
+ *
1420
+ * This is a convenience method that combines:
1421
+ * 1. onchainSendBegin - to get the PSBT
1422
+ * 2. signPsbt - to sign the PSBT (mock for now)
1423
+ * 3. onchainSendEnd - to complete the on-chain send
1424
+ *
1425
+ * @param params - Request parameters for on-chain send
1426
+ * @param mnemonic - Optional mnemonic for signing (uses wallet's mnemonic if not provided)
1427
+ * @returns Promise resolving to on-chain send response
1428
+ */
1429
+ onchainSend(params: OnchainSendRequestModel, mnemonic?: string): Promise<OnchainSendResponse>;
1430
+ /**
1431
+ * Gets the status of an on-chain send by send ID.
1432
+ *
1433
+ * @param send_id - The on-chain send ID
1434
+ * @returns Promise resolving to on-chain send status response
1435
+ */
1436
+ getOnchainSendStatus(send_id: string): Promise<OnchainSendStatus | null>;
1437
+ /**
1438
+ * Lists on-chain transfers for a specific asset.
1439
+ *
1440
+ * @param asset_id - The asset ID to list transfers for
1441
+ * @returns Promise resolving to array of on-chain transfers
1442
+ */
1443
+ listOnchainTransfers(asset_id?: string): Promise<Transfer[]>;
1444
+ }
1445
+ /**
1446
+ * UTEXO Protocol Interface
1447
+ *
1448
+ * Combines Lightning and Onchain protocol interfaces.
1449
+ * This is the main interface that UTEXOWallet implements.
1450
+ */
1451
+ interface IUTEXOProtocol extends ILightningProtocol, IOnchainProtocol {
1452
+ }
1453
+
1454
+ /**
1455
+ * UTEXO Protocol Base Implementations
1456
+ *
1457
+ * These classes provide empty implementations for UTEXO-specific operations.
1458
+ * They should be extended or used as mixins for concrete implementations.
1459
+ */
1460
+
1461
+ /**
1462
+ * Lightning Protocol Base Class
1463
+ *
1464
+ * Provides empty implementations for all Lightning protocol methods.
1465
+ * Concrete implementations should override these methods.
1466
+ */
1467
+ declare class LightningProtocol implements ILightningProtocol {
1468
+ createLightningInvoice(params: CreateLightningInvoiceRequestModel): Promise<LightningReceiveRequest>;
1469
+ getLightningReceiveRequest(id: string): Promise<TransferStatus | null>;
1470
+ getLightningSendRequest(id: string): Promise<TransferStatus | null>;
1471
+ getLightningSendFeeEstimate(params: GetLightningSendFeeEstimateRequestModel): Promise<number>;
1472
+ payLightningInvoiceBegin(params: PayLightningInvoiceRequestModel): Promise<string>;
1473
+ payLightningInvoiceEnd(params: SendAssetEndRequestModel): Promise<LightningSendRequest>;
1474
+ payLightningInvoice(params: PayLightningInvoiceRequestModel, mnemonic?: string): Promise<LightningSendRequest>;
1475
+ listLightningPayments(): Promise<ListLightningPaymentsResponse>;
1476
+ }
1477
+ /**
1478
+ * Onchain Protocol Base Class
1479
+ *
1480
+ * Provides empty implementations for all onchain protocol methods.
1481
+ * Concrete implementations should override these methods.
1482
+ */
1483
+ declare class OnchainProtocol implements IOnchainProtocol {
1484
+ onchainReceive(params: OnchainReceiveRequestModel): Promise<OnchainReceiveResponse>;
1485
+ onchainSendBegin(params: OnchainSendRequestModel): Promise<string>;
1486
+ onchainSendEnd(params: SendAssetEndRequestModel): Promise<OnchainSendResponse>;
1487
+ onchainSend(params: OnchainSendRequestModel, mnemonic?: string): Promise<OnchainSendResponse>;
1488
+ getOnchainSendStatus(send_id: string): Promise<OnchainSendStatus | null>;
1489
+ listOnchainTransfers(asset_id?: string): Promise<Transfer[]>;
1490
+ }
1491
+ /**
1492
+ * UTEXO Protocol Base Class
1493
+ *
1494
+ * Combines Lightning and Onchain protocol implementations.
1495
+ * Provides empty implementations for all UTEXO protocol methods.
1496
+ * Concrete implementations should override these methods.
1497
+ */
1498
+ declare class UTEXOProtocol extends LightningProtocol implements IUTEXOProtocol {
1499
+ private onchainProtocol;
1500
+ onchainReceive(params: OnchainReceiveRequestModel): Promise<OnchainReceiveResponse>;
1501
+ onchainSendBegin(params: OnchainSendRequestModel): Promise<string>;
1502
+ onchainSendEnd(params: SendAssetEndRequestModel): Promise<OnchainSendResponse>;
1503
+ onchainSend(params: OnchainSendRequestModel, mnemonic?: string): Promise<OnchainSendResponse>;
1504
+ getOnchainSendStatus(send_id: string): Promise<OnchainSendStatus | null>;
1505
+ listOnchainTransfers(asset_id?: string): Promise<Transfer[]>;
1506
+ }
1507
+
1508
+ /**
1509
+ * UTEXO network and asset mapping
1510
+ */
1511
+
1512
+ /**
1513
+ * Network preset type - determines which configuration bundle to use
1514
+ */
1515
+ type UtxoNetworkPreset = 'mainnet' | 'testnet';
1516
+ /**
1517
+ * Network map configuration - maps logical network names to Bitcoin network types
1518
+ */
1519
+ type UtxoNetworkMap = {
1520
+ mainnet: Network;
1521
+ utexo: Network;
1522
+ };
1523
+ /**
1524
+ * Network configuration for a single network (RGB, RGB Lightning, or UTEXO)
1525
+ */
1526
+ type NetworkConfig = {
1527
+ networkName: string;
1528
+ networkId: number;
1529
+ assets: {
1530
+ assetId: string;
1531
+ tokenName: string;
1532
+ longName: string;
1533
+ precision: number;
1534
+ tokenId: number;
1535
+ }[];
1536
+ };
1537
+ /**
1538
+ * Network ID map configuration - contains all network configs with asset lookup
1539
+ */
1540
+ type UtxoNetworkIdMap = {
1541
+ mainnet: NetworkConfig & {
1542
+ getAssetById(tokenId: number): NetworkConfig['assets'][number] | undefined;
1543
+ };
1544
+ mainnetLightning: NetworkConfig & {
1545
+ getAssetById(tokenId: number): NetworkConfig['assets'][number] | undefined;
1546
+ };
1547
+ utexo: NetworkConfig & {
1548
+ getAssetById(tokenId: number): NetworkConfig['assets'][number] | undefined;
1549
+ };
1550
+ };
1551
+ /**
1552
+ * Complete network preset configuration bundle
1553
+ */
1554
+ type UtxoNetworkPresetConfig = {
1555
+ networkMap: UtxoNetworkMap;
1556
+ networkIdMap: UtxoNetworkIdMap;
1557
+ };
1558
+ /**
1559
+ * Gets the network configuration for a given preset
1560
+ * @param preset - Network preset ('mainnet' or 'testnet')
1561
+ * @returns Network preset configuration bundle
1562
+ */
1563
+ declare function getUtxoNetworkConfig(preset: UtxoNetworkPreset): UtxoNetworkPresetConfig;
1564
+ /**
1565
+ * Backward compatibility: Export testnet preset as default (current behavior)
1566
+ * @deprecated Use getUtxoNetworkConfig('testnet') or getUtxoNetworkConfig('mainnet') instead
1567
+ */
1568
+ declare const utexoNetworkMap: UtxoNetworkMap;
1569
+ /**
1570
+ * Backward compatibility: Export testnet preset as default (current behavior)
1571
+ * @deprecated Use getUtxoNetworkConfig('testnet') or getUtxoNetworkConfig('mainnet') instead
1572
+ */
1573
+ declare const utexoNetworkIdMap: UtxoNetworkIdMap;
1574
+ declare const networkConfigs: UtxoNetworkIdMap;
1575
+ type NetworkAsset = (typeof networkConfigs)[keyof typeof networkConfigs]['assets'][number];
1576
+ type UtxoNetworkId = keyof typeof networkConfigs;
1577
+ /**
1578
+ * Resolves the destination network's asset object from sender network, destination network, and sender asset ID.
1579
+ * Uses tokenId as the cross-network identifier (same tokenId = same logical asset).
1580
+ */
1581
+ declare function getDestinationAsset(senderNetwork: UtxoNetworkId, destinationNetwork: UtxoNetworkId, assetIdSender: string | null): NetworkAsset | undefined;
1582
+
1583
+ /**
1584
+ * UTEXOWallet constructor and runtime options.
1585
+ */
1586
+
1587
+ /**
1588
+ * Options for UTEXOWallet. When omitted, defaults apply (e.g. DEFAULT_VSS_SERVER_URL for VSS).
1589
+ */
1590
+ interface ConfigOptions {
1591
+ /**
1592
+ * Network preset: 'mainnet' (production) or 'testnet' (development).
1593
+ * Default: 'mainnet'.
1594
+ */
1595
+ network?: UtxoNetworkPreset;
1596
+ /**
1597
+ * Optional base directory for wallet data. When set, each wallet uses a subdir by network + fingerprint:
1598
+ * utexoRGBWallet → dataDir/{networkMap.utexo}/{masterFingerprint} (e.g. ./utexo/signet/3780bc30)
1599
+ * layer1RGBWallet → dataDir/{networkMap.mainnet}/{masterFingerprint} (e.g. ./utexo/testnet/3780bc30)
1600
+ * Same structure is used by restoreUtxoWalletFromVss so restored data can be loaded with this dataDir.
1601
+ */
1602
+ dataDir?: string;
1603
+ /**
1604
+ * Optional VSS server URL. When omitted, DEFAULT_VSS_SERVER_URL is used.
1605
+ * vssBackup() / vssBackupInfo() build config from mnemonic + this URL when config is not passed.
1606
+ */
1607
+ vssServerUrl?: string;
1608
+ }
1609
+
1610
+ /**
1611
+ * UTEXOWallet - Wallet class for UTEXO operations
1612
+ *
1613
+ * This class provides a wallet interface that accepts either a mnemonic or seed
1614
+ * for initialization. It implements both IWalletManager (standard RGB operations)
1615
+ * and IUTEXOProtocol (UTEXO-specific Lightning and on-chain operations).
1616
+ */
1617
+
1618
+ /**
1619
+ * UTEXOWallet - Combines standard RGB wallet operations with UTEXO protocol features
1620
+ *
1621
+ * Architecture:
1622
+ * - Implements IWalletManager for standard RGB operations (via WalletManager delegation)
1623
+ * - Implements IUTEXOProtocol for UTEXO-specific operations (Lightning, on-chain sends)
1624
+ * - Manages two WalletManager instances: layer1 (Bitcoin) and utexo (UTEXO network)
1625
+ */
1626
+ declare class UTEXOWallet extends UTEXOProtocol implements IWalletManager, IUTEXOProtocol {
1627
+ private readonly mnemonicOrSeed;
1628
+ private readonly options;
1629
+ private readonly networkMap;
1630
+ private readonly networkIdMap;
1631
+ private readonly bridge;
1632
+ private layer1Keys;
1633
+ private utexoKeys;
1634
+ private layer1RGBWallet;
1635
+ private utexoRGBWallet;
1636
+ /**
1637
+ * Creates a new UTEXOWallet instance
1638
+ * @param mnemonicOrSeed - Either a mnemonic phrase (string) or seed (Uint8Array)
1639
+ * @param options - Optional configuration options (defaults to { network: 'mainnet' })
1640
+ */
1641
+ constructor(mnemonicOrSeed: string | Uint8Array, options?: ConfigOptions);
1642
+ initialize(): Promise<void>;
1643
+ /**
1644
+ * Derive public keys from mnemonic or seed
1645
+ * @param network - BitcoinNetwork identifier
1646
+ * @returns Promise resolving to PublicKeys containing xpub, accountXpubVanilla, accountXpubColored, and masterFingerprint
1647
+ * @throws {ValidationError} If mnemonic is invalid
1648
+ */
1649
+ derivePublicKeys(network: BitcoinNetwork): Promise<PublicKeys>;
1650
+ getPubKeys(): Promise<PublicKeys>;
1651
+ /**
1652
+ * Guard method to ensure wallet is initialized
1653
+ * @throws {WalletError} if wallet is not initialized
1654
+ */
1655
+ private ensureInitialized;
1656
+ goOnline(indexerUrl: string, skipConsistencyCheck?: boolean): Promise<void>;
1657
+ getXpub(): {
1658
+ xpubVan: string;
1659
+ xpubCol: string;
1660
+ };
1661
+ getNetwork(): Network;
1662
+ dispose(): Promise<void>;
1663
+ isDisposed(): boolean;
1664
+ getBtcBalance(): Promise<BtcBalance>;
1665
+ getAddress(): Promise<string>;
1666
+ listUnspents(): Promise<Unspent$1[]>;
1667
+ createUtxosBegin(params: CreateUtxosBeginRequestModel): Promise<string>;
1668
+ createUtxosEnd(params: CreateUtxosEndRequestModel): Promise<number>;
1669
+ createUtxos(params: {
1670
+ upTo?: boolean;
1671
+ num?: number;
1672
+ size?: number;
1673
+ feeRate?: number;
1674
+ }): Promise<number>;
1675
+ listAssets(): Promise<ListAssets>;
1676
+ getAssetBalance(asset_id: string): Promise<AssetBalance>;
1677
+ issueAssetNia(params: IssueAssetNiaRequestModel): Promise<AssetNIA>;
1678
+ issueAssetIfa(params: IssueAssetIfaRequestModel): Promise<any>;
1679
+ inflateBegin(params: InflateAssetIfaRequestModel): Promise<string>;
1680
+ inflateEnd(params: InflateEndRequestModel): Promise<OperationResult>;
1681
+ inflate(params: InflateAssetIfaRequestModel, mnemonic?: string): Promise<OperationResult>;
1682
+ sendBegin(params: SendAssetBeginRequestModel): Promise<string>;
1683
+ sendEnd(params: SendAssetEndRequestModel): Promise<SendResult>;
1684
+ send(invoiceTransfer: SendAssetBeginRequestModel, mnemonic?: string): Promise<SendResult>;
1685
+ sendBtcBegin(params: SendBtcBeginRequestModel): Promise<string>;
1686
+ sendBtcEnd(params: SendBtcEndRequestModel): Promise<string>;
1687
+ sendBtc(params: SendBtcBeginRequestModel): Promise<string>;
1688
+ blindReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
1689
+ witnessReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
1690
+ decodeRGBInvoice(params: {
1691
+ invoice: string;
1692
+ }): Promise<InvoiceData>;
1693
+ listTransactions(): Promise<Transaction[]>;
1694
+ listTransfers(asset_id?: string): Promise<Transfer[]>;
1695
+ failTransfers(params: FailTransfersRequest): Promise<boolean>;
1696
+ refreshWallet(): Promise<void>;
1697
+ syncWallet(): Promise<void>;
1698
+ estimateFeeRate(blocks: number): Promise<GetFeeEstimationResponse>;
1699
+ estimateFee(psbtBase64: string): Promise<EstimateFeeResult>;
1700
+ /**
1701
+ * Create backup for both layer1 and utexo stores in one folder.
1702
+ * Writes backupPath/wallet_{masterFingerprint}_layer1.backup and backupPath/wallet_{masterFingerprint}_utexo.backup
1703
+ * (same naming convention as VSS: storeId_layer1, storeId_utexo with storeId = wallet_<fp>).
1704
+ * Use restoreUtxoWalletFromBackup with the same backupPath to restore both.
1705
+ */
1706
+ createBackup(params: {
1707
+ backupPath: string;
1708
+ password: string;
1709
+ }): Promise<WalletBackupResponse & {
1710
+ layer1BackupPath: string;
1711
+ utexoBackupPath: string;
1712
+ }>;
1713
+ configureVssBackup(config: VssBackupConfig): Promise<void>;
1714
+ disableVssAutoBackup(): Promise<void>;
1715
+ /**
1716
+ * Run VSS backup for both layer1 and utexo stores.
1717
+ * Config is optional: when omitted, builds config from mnemonic (option param or wallet mnemonic)
1718
+ * and options.vssServerUrl (or DEFAULT_VSS_SERVER_URL if not set).
1719
+ *
1720
+ * @param config - Optional; when omitted, built from mnemonic and vssServerUrl
1721
+ * @param mnemonic - Optional; when omitted, uses wallet mnemonic (only if wallet was created with mnemonic string)
1722
+ */
1723
+ vssBackup(config?: VssBackupConfig, mnemonic?: string): Promise<number>;
1724
+ /**
1725
+ * Get VSS backup info. Config is optional; when omitted, built from mnemonic (param or wallet)
1726
+ * and options.vssServerUrl (or DEFAULT_VSS_SERVER_URL if not set).
1727
+ */
1728
+ vssBackupInfo(config?: VssBackupConfig, mnemonic?: string): Promise<VssBackupInfo>;
1729
+ signPsbt(psbt: string, mnemonic?: string): Promise<string>;
1730
+ signMessage(message: string): Promise<string>;
1731
+ verifyMessage(message: string, signature: string, accountXpub?: string): Promise<boolean>;
1732
+ /**
1733
+ * Validates that the wallet has sufficient spendable balance for the given asset and amount.
1734
+ * @param assetId - Asset ID to check balance for
1735
+ * @param amount - Required amount (in asset units)
1736
+ * @throws {ValidationError} If balance is not found or insufficient
1737
+ */
1738
+ validateBalance(assetId: string, amount: number): Promise<void>;
1739
+ /**
1740
+ * Extracts invoice data and destination asset from a bridge transfer.
1741
+ *
1742
+ * @param bridgeTransfer - Bridge transfer response containing recipient invoice and token info
1743
+ * @returns Object containing invoice string, decoded invoice data, and destination asset
1744
+ * @throws {ValidationError} If destination asset is not supported
1745
+ */
1746
+ private extractInvoiceAndAsset;
1747
+ /**
1748
+ * IUTEXOProtocol Implementation
1749
+ */
1750
+ onchainReceive(params: OnchainReceiveRequestModel): Promise<OnchainReceiveResponse>;
1751
+ onchainSendBegin(params: OnchainSendRequestModel): Promise<string>;
1752
+ onchainSendEnd(params: OnchainSendEndRequestModel): Promise<OnchainSendResponse>;
1753
+ onchainSend(params: OnchainSendRequestModel, mnemonic?: string): Promise<OnchainSendResponse>;
1754
+ getOnchainSendStatus(invoice: string): Promise<OnchainSendStatus | null>;
1755
+ listOnchainTransfers(asset_id?: string): Promise<Transfer[]>;
1756
+ createLightningInvoice(params: CreateLightningInvoiceRequestModel): Promise<LightningReceiveRequest>;
1757
+ payLightningInvoiceBegin(params: PayLightningInvoiceRequestModel): Promise<string>;
1758
+ payLightningInvoiceEnd(params: PayLightningInvoiceEndRequestModel): Promise<SendResult>;
1759
+ payLightningInvoice(params: PayLightningInvoiceRequestModel, mnemonic?: string): Promise<LightningSendRequest>;
1760
+ getLightningSendRequest(lnInvoice: string): Promise<TransferStatus | null>;
1761
+ getLightningReceiveRequest(lnInvoice: string): Promise<TransferStatus | null>;
1762
+ private UTEXOToMainnetRGB;
1763
+ private UtexoToMainnetLightning;
1764
+ }
1765
+
1766
+ /**
1767
+ * VSS (Versioned Storage Service) configuration defaults and helpers for UTEXO wallet backup/restore.
1768
+ */
1769
+
1770
+ /** Default VSS server URL used when vssServerUrl is not set in config or restore params. */
1771
+ declare const DEFAULT_VSS_SERVER_URL = "https://vss-server.utexo.com/vss";
1772
+
1773
+ /**
1774
+ * UTEXO wallet restore: VSS and file backup restore helpers.
1775
+ */
1776
+
1777
+ /**
1778
+ * Restore a UTEXOWallet from VSS by restoring both layer1 and utexo stores.
1779
+ * Mnemonic is required; config is optional (built from mnemonic when omitted; vssServerUrl uses DEFAULT_VSS_SERVER_URL if omitted).
1780
+ * Uses the same storeId suffix convention as UTEXOWallet VSS backup (storeId_layer1, storeId_utexo).
1781
+ * Restored data is written to targetDir/{layer1Network}/{masterFingerprint} and
1782
+ * targetDir/{utexoNetwork}/{masterFingerprint} (same layout as when using dataDir on UTEXOWallet).
1783
+ */
1784
+ declare function restoreUtxoWalletFromVss(params: {
1785
+ mnemonic: string;
1786
+ targetDir: string;
1787
+ /** Optional; when omitted, config is built from mnemonic (vssServerUrl defaults to DEFAULT_VSS_SERVER_URL). */
1788
+ config?: VssBackupConfig;
1789
+ /** Preset to derive layer1/utexo network names; defaults to 'testnet'. */
1790
+ networkPreset?: UtxoNetworkPreset;
1791
+ /** Optional; when omitted and config not passed, DEFAULT_VSS_SERVER_URL is used. */
1792
+ vssServerUrl?: string;
1793
+ }): Promise<{
1794
+ layer1Path: string;
1795
+ utexoPath: string;
1796
+ targetDir: string;
1797
+ }>;
1798
+ /**
1799
+ * Restore a UTEXOWallet from a regular (file) backup created by UTEXOWallet.createBackup.
1800
+ * Expects one folder with wallet_<masterFingerprint>_layer1.backup and wallet_<masterFingerprint>_utexo.backup
1801
+ * (same naming convention as VSS: storeId_layer1, storeId_utexo with storeId = wallet_<fp>).
1802
+ * Restores into targetDir (same layout as VSS restore).
1803
+ */
1804
+ declare function restoreUtxoWalletFromBackup(params: {
1805
+ backupPath: string;
1806
+ password: string;
1807
+ targetDir: string;
1808
+ networkPreset?: UtxoNetworkPreset;
1809
+ }): {
1810
+ layer1Path: string;
1811
+ utexoPath: string;
1812
+ targetDir: string;
1813
+ };
1814
+
1815
+ interface Unspent {
1816
+ utxo: Utxo;
1817
+ rgbAllocations: RgbAllocation[];
1818
+ }
1819
+ interface Utxo {
1820
+ outpoint: {
1821
+ txid: string;
1822
+ vout: number;
1823
+ };
1824
+ btcAmount: number;
1825
+ colorable: boolean;
1826
+ exists: boolean;
1827
+ pendingBlinded: number;
1828
+ }
1829
+ interface RgbAllocation {
1830
+ assetId: string;
1831
+ assignment: BindingAssignment;
1832
+ settled: boolean;
1833
+ }
1834
+ interface DecodeRgbInvoiceResponse {
1835
+ recipientId: string;
1836
+ assetSchema?: string;
1837
+ assetId?: string;
1838
+ network: string;
1839
+ assignment: BindingAssignment;
1840
+ assignmentName?: string;
1841
+ expirationTimestamp?: number;
1842
+ transportEndpoints: string[];
1843
+ }
1844
+ interface BindingAssignment {
1845
+ [key: string]: number;
1846
+ }
1847
+
1848
+ /**
1849
+ * Restore a wallet from a VSS backup into a target directory.
1850
+ * Returns a message indicating the restored wallet path.
1851
+ */
1852
+ declare const restoreFromVss: (params: {
1853
+ config: VssBackupConfig;
1854
+ targetDir: string;
1855
+ }) => WalletRestoreResponse & {
1856
+ walletPath: string;
1857
+ };
1858
+
770
1859
  /**
771
1860
  * Custom error classes for the RGB SDK
772
1861
  */
@@ -927,6 +2016,7 @@ declare const KEYCHAIN_BTC = 0;
927
2016
  /**
928
2017
  * Network-related constants
929
2018
  */
2019
+
930
2020
  /**
931
2021
  * Coin type constants
932
2022
  */
@@ -995,4 +2085,4 @@ declare const DEFAULT_MAX_RETRIES = 3;
995
2085
  */
996
2086
  declare const DEFAULT_LOG_LEVEL = 3;
997
2087
 
998
- export { type AccountXpubs, type AssetBalanceResponse, type AssetIfa, AssetIface, type AssetNIA, AssetSchema, type Assignment, BIP32_VERSIONS, BadRequestError, type Balance, type BlockTime, type BtcBalance, COIN_BITCOIN_MAINNET, COIN_BITCOIN_TESTNET, COIN_RGB_MAINNET, COIN_RGB_TESTNET, ConfigurationError, ConflictError, type CreateUtxosBeginRequestModel, type CreateUtxosEndRequestModel, CryptoError, DEFAULT_API_TIMEOUT, DEFAULT_LOG_LEVEL, DEFAULT_MAX_RETRIES, DEFAULT_NETWORK, DERIVATION_ACCOUNT, DERIVATION_PURPOSE, type DecodeRgbInvoiceResponse, type Descriptors, type Environment, type FailTransfersRequest, type GeneratedKeys, type GetFeeEstimationRequestModel, type GetFeeEstimationResponse, type InflateAssetIfaRequestModel, type InflateEndRequestModel, type InvoiceReceiveData, type InvoiceRequest, type IssueAssetIfaRequestModel, type IssueAssetNIAResponse, type IssueAssetNiaRequestModel, KEYCHAIN_BTC, KEYCHAIN_RGB, type ListAssetsResponse, LogLevel, type Media, NETWORK_MAP, type Network, NetworkError, type NetworkVersions, NotFoundError, type OperationResult, type PsbtType, type RGBHTTPClientParams, type Recipient, type RestoreWalletRequestModel, type RgbAllocation, RgbNodeError, type RgbTransfer, SDKError, type SendAssetBeginRequestModel, type SendAssetEndRequestModel, type SendBtcBeginRequestModel, type SendBtcEndRequestModel, type SendResult, type SignPsbtOptions, type Transaction, TransactionType, TransferStatus, type Unspent, type Utxo, ValidationError, type WalletBackupResponse, WalletError, type WalletInitParams, WalletManager, type WalletRestoreResponse, type WitnessData, accountXpubsFromMnemonic, configureLogging, createWallet, createWalletManager, deriveKeysFromMnemonic, deriveKeysFromSeed, deriveKeysFromXpriv, generateKeys, getEnvironment, getXprivFromMnemonic, getXpubFromXpriv, isBrowser, isNode, logger, normalizeNetwork, restoreFromBackup, restoreKeys, signMessage, signPsbt, signPsbtFromSeed, signPsbtSync, validateBase64, validateHex, validateMnemonic, validateNetwork, validatePsbt, validateRequired, validateString, verifyMessage, wallet };
2088
+ export { type AccountXpubs, BIP32_VERSIONS, BadRequestError, type BindingAssignment, type BridgeTransferStatus, COIN_BITCOIN_MAINNET, COIN_BITCOIN_TESTNET, COIN_RGB_MAINNET, COIN_RGB_TESTNET, type ConfigOptions, ConfigurationError, ConflictError, CryptoError, DEFAULT_API_TIMEOUT, DEFAULT_LOG_LEVEL, DEFAULT_MAX_RETRIES, DEFAULT_NETWORK, DEFAULT_VSS_SERVER_URL, DERIVATION_ACCOUNT, DERIVATION_PURPOSE, type DecodeRgbInvoiceResponse, type Descriptors, type Environment, type GeneratedKeys, type ILightningProtocol, type IOnchainProtocol, type IUTEXOProtocol, KEYCHAIN_BTC, KEYCHAIN_RGB, LightningProtocol, LogLevel, NETWORK_MAP, type Network, type NetworkAsset, NetworkError, type NetworkVersions, NotFoundError, OnchainProtocol, type OnchainSendStatus, type PsbtType, type RgbAllocation, RgbNodeError, SDKError, type SignPsbtOptions, type TransferStatus, UTEXOProtocol, UTEXOWallet, type Unspent, type Utxo, type UtxoNetworkId, type UtxoNetworkIdMap, type UtxoNetworkMap, type UtxoNetworkPreset, type UtxoNetworkPresetConfig, ValidationError, WalletError, type WalletInitParams, WalletManager, accountXpubsFromMnemonic, configureLogging, createWallet, createWalletManager, deriveKeysFromMnemonic, deriveKeysFromMnemonicOrSeed, deriveKeysFromSeed, deriveKeysFromXpriv, deriveVssSigningKeyFromMnemonic, generateKeys, getDestinationAsset, getEnvironment, getUtxoNetworkConfig, getXprivFromMnemonic, getXpubFromXpriv, isBrowser, isNode, logger, normalizeNetwork, restoreFromBackup, restoreFromVss, restoreKeys, restoreUtxoWalletFromBackup, restoreUtxoWalletFromVss, signMessage, signPsbt, signPsbtFromSeed, signPsbtSync, utexoNetworkIdMap, utexoNetworkMap, validateBase64, validateHex, validateMnemonic, validateNetwork, validatePsbt, validateRequired, validateString, verifyMessage, wallet };