@utexo/rgb-sdk 1.0.4 → 1.0.6

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 +308 -0
  30. package/cli/utils.mjs +220 -0
  31. package/dist/index.cjs +2070 -195
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.mts +1243 -151
  34. package/dist/index.d.ts +1243 -151
  35. package/dist/index.mjs +2056 -190
  36. package/dist/index.mjs.map +1 -1
  37. package/package.json +38 -8
package/dist/index.d.mts 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,53 +491,54 @@ 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
- * @type {string}
502
+ * @type {string | null}
439
503
  * @memberof AssetNIA
440
- * @example asset details
504
+ * @example asset details (API may return null)
441
505
  */
442
- details?: string;
506
+ details?: string | null;
443
507
  /**
444
508
  * @type {number}
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
- * @type {Media}
537
+ * @type {Media | null}
474
538
  * @memberof AssetNIA
539
+ * @example API may return null
475
540
  */
476
- media?: Media;
541
+ media?: Media | null;
477
542
  }
478
543
  interface AssetIfa {
479
544
  assetId: string;
@@ -514,86 +579,432 @@ declare enum AssetSchema {
514
579
  Uda = "Uda",
515
580
  Cfa = "Cfa"
516
581
  }
582
+ type ListAssets = {
583
+ nia: AssetNIA[];
584
+ uda: AssetUDA[];
585
+ cfa: AssetCFA[];
586
+ ifa: AssetIfa[];
587
+ };
588
+ type AssetUDA = {
589
+ assetId: string;
590
+ ticker: string;
591
+ name: string;
592
+ details?: string;
593
+ precision: number;
594
+ timestamp: number;
595
+ addedAt: number;
596
+ balance: Balance;
597
+ token?: {
598
+ index: number;
599
+ ticker?: string;
600
+ name?: string;
601
+ details?: string;
602
+ embeddedMedia: boolean;
603
+ media?: Media;
604
+ attachments: Array<{
605
+ key: number;
606
+ filePath: string;
607
+ mime: string;
608
+ digest: string;
609
+ }>;
610
+ reserves: boolean;
611
+ };
612
+ };
613
+ type AssetCFA = {
614
+ assetId: string;
615
+ name: string;
616
+ details?: string;
617
+ precision: number;
618
+ issuedSupply: number;
619
+ timestamp: number;
620
+ addedAt: number;
621
+ balance: Balance;
622
+ media?: Media;
623
+ };
517
624
  /**
518
625
  *
519
626
  *
520
627
  * @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
628
+ * @interface AssetBalance
552
629
  */
553
- interface AssetBalanceResponse {
630
+ interface AssetBalance {
554
631
  /**
555
632
  * @type {number}
556
- * @memberof AssetBalanceResponse
633
+ * @memberof AssetBalance
557
634
  * @example 777
558
635
  */
559
636
  settled?: number;
560
637
  /**
561
638
  * @type {number}
562
- * @memberof AssetBalanceResponse
639
+ * @memberof AssetBalance
563
640
  * @example 777
564
641
  */
565
642
  future?: number;
566
643
  /**
567
644
  * @type {number}
568
- * @memberof AssetBalanceResponse
645
+ * @memberof AssetBalance
569
646
  * @example 777
570
647
  */
571
648
  spendable?: number;
572
649
  /**
573
650
  * @type {number}
574
- * @memberof AssetBalanceResponse
651
+ * @memberof AssetBalance
575
652
  * @example 444
576
653
  */
577
654
  offchainOutbound?: number;
578
655
  /**
579
656
  * @type {number}
580
- * @memberof AssetBalanceResponse
657
+ * @memberof AssetBalance
581
658
  * @example 0
582
659
  */
583
660
  offchainInbound?: number;
584
661
  }
585
- interface DecodeRgbInvoiceResponse {
662
+ interface InvoiceData {
663
+ invoice: string;
586
664
  recipientId: string;
587
- assetSchema?: string;
665
+ assetSchema?: AssetSchema;
588
666
  assetId?: string;
589
- network: string;
667
+ network: BitcoinNetwork;
590
668
  assignment: Assignment;
591
669
  assignmentName?: string;
592
- expirationTimestamp?: number;
670
+ expirationTimestamp: number | null;
593
671
  transportEndpoints: string[];
594
672
  }
595
- interface Assignment {
596
- [key: string]: any;
673
+ type AssignmentType = 'Fungible' | 'NonFungible' | 'InflationRight' | 'ReplaceRight' | 'Any';
674
+ type Assignment = {
675
+ type: AssignmentType;
676
+ amount?: number;
677
+ };
678
+
679
+ /**
680
+ * IWalletManager - Unified interface for WalletManager implementations
681
+ *
682
+ * This interface defines the contract that all WalletManager implementations must follow
683
+ * for cross-platform compatibility.
684
+ *
685
+ * All methods are async to support native module requirements.
686
+ * Synchronous implementations should wrap operations in Promise.resolve().
687
+ *
688
+ * Type Standards:
689
+ * - All enum-like types use PascalCase: 'RgbSend', 'WaitingCounterparty', 'Nia', etc.
690
+ * - Network identifiers use lowercase: 'mainnet', 'testnet', 'regtest', 'signet', 'testnet4'
691
+ * - Transaction types: 'RgbSend' | 'Drain' | 'CreateUtxos' | 'User'
692
+ * - Transfer status: 'WaitingCounterparty' | 'WaitingConfirmations' | 'Settled' | 'Failed'
693
+ * - Transfer kind: 'Issuance' | 'ReceiveBlind' | 'ReceiveWitness' | 'Send' | 'Inflation'
694
+ * - Asset schemas: 'Nia' | 'Uda' | 'Cfa' | 'Ifa'
695
+ * - Assignment types: 'Fungible' | 'NonFungible' | 'InflationRight' | 'ReplaceRight' | 'Any'
696
+ */
697
+
698
+ /**
699
+ * Unified WalletManager interface for cross-platform compatibility
700
+ *
701
+ * This interface ensures all implementations provide the same API surface,
702
+ * allowing clients to switch between implementations based on environment.
703
+ */
704
+ interface IWalletManager {
705
+ /**
706
+ * Initialize the wallet and establish online connection
707
+ * Must be called before performing operations that require network access.
708
+ *
709
+ * @returns Promise that resolves when initialization is complete
710
+ * @throws {WalletError} if initialization fails
711
+ *
712
+ * NOTE: Some implementations require this method to be called explicitly,
713
+ * while others may initialize automatically in the constructor.
714
+ */
715
+ initialize(): Promise<void>;
716
+ /**
717
+ * Connect the wallet to an online indexer service for syncing and transaction operations.
718
+ * Must be called before performing operations that require network connectivity.
719
+ *
720
+ * @param indexerUrl - The URL of the RGB indexer service to connect to
721
+ * @param skipConsistencyCheck - If true, skips the consistency check with the indexer (default: false)
722
+ * @returns Promise that resolves when the wallet is successfully connected online
723
+ * @throws {WalletError} if connection fails
724
+ */
725
+ goOnline(indexerUrl: string, skipConsistencyCheck?: boolean): Promise<void>;
726
+ /**
727
+ * Get wallet's extended public keys
728
+ * @returns Object containing vanilla and colored extended public keys
729
+ */
730
+ getXpub(): {
731
+ xpubVan: string;
732
+ xpubCol: string;
733
+ };
734
+ /**
735
+ * Get wallet's network
736
+ * @returns Network identifier
737
+ */
738
+ getNetwork(): Network;
739
+ /**
740
+ * Dispose of sensitive wallet data
741
+ * Clears mnemonic and seed from memory, closes connections
742
+ * Idempotent - safe to call multiple times
743
+ *
744
+ * @returns Promise that resolves when disposal is complete
745
+ */
746
+ dispose(): Promise<void>;
747
+ /**
748
+ * Check if wallet has been disposed
749
+ * @returns true if wallet has been disposed, false otherwise
750
+ */
751
+ isDisposed(): boolean;
752
+ /**
753
+ * Register wallet and get initial address and balance
754
+ * This is typically called once after wallet creation
755
+ *
756
+ * @returns Promise resolving to address and BTC balance
757
+ */
758
+ /**
759
+ * Get current BTC balance
760
+ * @returns Promise resolving to BTC balance information
761
+ */
762
+ getBtcBalance(): Promise<BtcBalance>;
763
+ /**
764
+ * Get wallet's receiving address
765
+ * @returns Promise resolving to Bitcoin address string
766
+ */
767
+ getAddress(): Promise<string>;
768
+ /**
769
+ * List all unspent transaction outputs (UTXOs)
770
+ * @returns Promise resolving to array of unspent outputs
771
+ */
772
+ listUnspents(): Promise<Unspent$1[]>;
773
+ /**
774
+ * Begin creating UTXOs (first step of two-step process)
775
+ * @param params - UTXO creation parameters
776
+ * @returns Promise resolving to base64-encoded PSBT that needs to be signed
777
+ */
778
+ createUtxosBegin(params: CreateUtxosBeginRequestModel): Promise<string>;
779
+ /**
780
+ * Complete UTXO creation (second step after signing)
781
+ * @param params - Signed PSBT from createUtxosBegin
782
+ * @returns Promise resolving to number of UTXOs created
783
+ */
784
+ createUtxosEnd(params: CreateUtxosEndRequestModel): Promise<number>;
785
+ /**
786
+ * Complete UTXO creation flow: begin → sign → end
787
+ * Convenience method that combines createUtxosBegin, signing, and createUtxosEnd
788
+ *
789
+ * @param params - UTXO creation parameters
790
+ * @returns Promise resolving to number of UTXOs created
791
+ */
792
+ createUtxos(params: {
793
+ upTo?: boolean;
794
+ num?: number;
795
+ size?: number;
796
+ feeRate?: number;
797
+ }): Promise<number>;
798
+ /**
799
+ * List all assets in the wallet
800
+ * Returns assets grouped by schema (NIA, UDA, CFA, IFA)
801
+ * @returns Promise resolving to assets information grouped by schema
802
+ */
803
+ listAssets(): Promise<ListAssets>;
804
+ /**
805
+ * Get balance for a specific asset
806
+ * @param asset_id - Asset identifier
807
+ * @returns Promise resolving to asset balance information
808
+ */
809
+ getAssetBalance(asset_id: string): Promise<AssetBalance>;
810
+ /**
811
+ * Issue a new NIA (Non-Inflatable Asset)
812
+ * @param params - Asset issuance parameters
813
+ * @returns Promise resolving to issued asset information
814
+ */
815
+ issueAssetNia(params: IssueAssetNiaRequestModel): Promise<AssetNIA>;
816
+ /**
817
+ * Issue a new IFA (Inflatable Fungible Asset)
818
+ * @param params - Asset issuance parameters
819
+ * @returns Promise resolving to issued asset information
820
+ */
821
+ issueAssetIfa(params: IssueAssetIfaRequestModel): Promise<any>;
822
+ /**
823
+ * Begin asset inflation (first step of two-step process)
824
+ * @param params - Inflation parameters
825
+ * @returns Promise resolving to base64-encoded PSBT that needs to be signed
826
+ */
827
+ inflateBegin(params: InflateAssetIfaRequestModel): Promise<string>;
828
+ /**
829
+ * Complete asset inflation (second step after signing)
830
+ * @param params - Signed PSBT from inflateBegin
831
+ * @returns Promise resolving to operation result
832
+ */
833
+ inflateEnd(params: InflateEndRequestModel): Promise<OperationResult>;
834
+ /**
835
+ * Complete inflation flow: begin → sign → end
836
+ * Convenience method that combines inflateBegin, signing, and inflateEnd
837
+ *
838
+ * @param params - Inflation parameters
839
+ * @param mnemonic - Optional mnemonic for signing (uses wallet's mnemonic if not provided)
840
+ * @returns Promise resolving to operation result
841
+ */
842
+ inflate(params: InflateAssetIfaRequestModel, mnemonic?: string): Promise<OperationResult>;
843
+ /**
844
+ * Begin sending assets (first step of two-step process)
845
+ * @param params - Send parameters including invoice
846
+ * @returns Promise resolving to base64-encoded PSBT that needs to be signed
847
+ */
848
+ sendBegin(params: SendAssetBeginRequestModel): Promise<string>;
849
+ /**
850
+ * Complete sending assets (second step after signing)
851
+ * @param params - Signed PSBT from sendBegin
852
+ * @returns Promise resolving to send result with txid
853
+ */
854
+ sendEnd(params: SendAssetEndRequestModel): Promise<SendResult>;
855
+ /**
856
+ * Complete send flow: begin → sign → end
857
+ * Convenience method that combines sendBegin, signing, and sendEnd
858
+ *
859
+ * @param invoiceTransfer - Send parameters including invoice
860
+ * @param mnemonic - Optional mnemonic for signing (uses wallet's mnemonic if not provided)
861
+ * @returns Promise resolving to send result with txid
862
+ */
863
+ send(invoiceTransfer: SendAssetBeginRequestModel, mnemonic?: string): Promise<SendResult>;
864
+ /**
865
+ * Begin sending BTC (first step of two-step process)
866
+ * @param params - Send BTC parameters
867
+ * @returns Promise resolving to base64-encoded PSBT that needs to be signed
868
+ */
869
+ sendBtcBegin(params: SendBtcBeginRequestModel): Promise<string>;
870
+ /**
871
+ * Complete sending BTC (second step after signing)
872
+ * @param params - Signed PSBT from sendBtcBegin
873
+ * @returns Promise resolving to transaction ID
874
+ */
875
+ sendBtcEnd(params: SendBtcEndRequestModel): Promise<string>;
876
+ /**
877
+ * Complete BTC send flow: begin → sign → end
878
+ * Convenience method that combines sendBtcBegin, signing, and sendBtcEnd
879
+ *
880
+ * @param params - Send BTC parameters
881
+ * @returns Promise resolving to transaction ID
882
+ */
883
+ sendBtc(params: SendBtcBeginRequestModel): Promise<string>;
884
+ /**
885
+ * Generate blind receive invoice
886
+ * Creates an invoice for receiving assets without revealing the amount
887
+ *
888
+ * @param params - Invoice generation parameters including assignment type
889
+ * Assignment types: 'Fungible' | 'NonFungible' | 'InflationRight' | 'ReplaceRight' | 'Any'
890
+ * @returns Promise resolving to invoice data including invoice string
891
+ */
892
+ blindReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
893
+ /**
894
+ * Generate witness receive invoice
895
+ * Creates an invoice for receiving assets with amount visible
896
+ *
897
+ * @param params - Invoice generation parameters including assignment type
898
+ * Assignment types: 'Fungible' | 'NonFungible' | 'InflationRight' | 'ReplaceRight' | 'Any'
899
+ * @returns Promise resolving to invoice data including invoice string
900
+ */
901
+ witnessReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
902
+ /**
903
+ * Decode RGB invoice
904
+ * Extracts information from an RGB invoice string
905
+ *
906
+ * @param params - Invoice string to decode
907
+ * @returns Promise resolving to decoded invoice data including recipientId, assetSchema, assignment, etc.
908
+ */
909
+ decodeRGBInvoice(params: {
910
+ invoice: string;
911
+ }): Promise<InvoiceData>;
912
+ /**
913
+ * List all transactions
914
+ * @returns Promise resolving to array of transactions
915
+ * Each transaction includes transactionType ('RgbSend' | 'Drain' | 'CreateUtxos' | 'User'),
916
+ * txid, received/sent amounts, fee, and optional confirmationTime
917
+ */
918
+ listTransactions(): Promise<Transaction[]>;
919
+ /**
920
+ * List transfers for a specific asset or all assets
921
+ * @param asset_id - Optional asset identifier (lists all if not provided)
922
+ * @returns Promise resolving to array of transfers
923
+ * Each transfer includes status ('WaitingCounterparty' | 'WaitingConfirmations' | 'Settled' | 'Failed'),
924
+ * kind ('Issuance' | 'ReceiveBlind' | 'ReceiveWitness' | 'Send' | 'Inflation'),
925
+ * assignments, and transport endpoints
926
+ */
927
+ listTransfers(asset_id?: string): Promise<Transfer[]>;
928
+ /**
929
+ * Mark transfers as failed
930
+ * @param params - Transfer failure parameters
931
+ * @returns Promise resolving to boolean indicating success
932
+ */
933
+ failTransfers(params: FailTransfersRequest): Promise<boolean>;
934
+ /**
935
+ * Refresh wallet state
936
+ * Syncs wallet with the network and updates internal state
937
+ *
938
+ * @returns Promise that resolves when refresh is complete
939
+ */
940
+ refreshWallet(): Promise<void>;
941
+ /**
942
+ * Sync wallet with network
943
+ * Performs a full synchronization with the indexer
944
+ *
945
+ * @returns Promise that resolves when sync is complete
946
+ */
947
+ syncWallet(): Promise<void>;
948
+ /**
949
+ * Configure VSS (Versioned Storage Service) cloud backup for this wallet.
950
+ * When configured with autoBackup enabled, the wallet will perform automatic
951
+ * backups after state-changing operations according to the underlying rgb-lib behavior.
952
+ */
953
+ configureVssBackup(config: VssBackupConfig): Promise<void>;
954
+ /**
955
+ * Disable automatic VSS backup for this wallet.
956
+ */
957
+ disableVssAutoBackup(): Promise<void>;
958
+ /**
959
+ * Trigger a VSS backup immediately and return the server version of the stored backup.
960
+ */
961
+ vssBackup(config: VssBackupConfig): Promise<number>;
962
+ /**
963
+ * Get VSS backup status information for this wallet.
964
+ */
965
+ vssBackupInfo(config: VssBackupConfig): Promise<VssBackupInfo>;
966
+ /**
967
+ * Estimate fee rate for a given number of blocks
968
+ * @param blocks - Number of blocks for fee estimation
969
+ * @returns Promise resolving to fee estimation response
970
+ */
971
+ estimateFeeRate(blocks: number): Promise<GetFeeEstimationResponse>;
972
+ /**
973
+ * Estimate fee for a specific PSBT
974
+ * @param psbtBase64 - Base64-encoded PSBT
975
+ * @returns Promise resolving to fee estimation result
976
+ */
977
+ estimateFee(psbtBase64: string): Promise<EstimateFeeResult>;
978
+ /**
979
+ * Create wallet backup
980
+ * @param params - Backup parameters including path and password
981
+ * @returns Promise resolving to backup response
982
+ */
983
+ createBackup(params: {
984
+ backupPath: string;
985
+ password: string;
986
+ }): Promise<WalletBackupResponse>;
987
+ /**
988
+ * Sign a PSBT using the wallet's mnemonic or a provided mnemonic
989
+ * @param psbt - Base64 encoded PSBT
990
+ * @param mnemonic - Optional mnemonic (uses wallet's mnemonic if not provided)
991
+ * @returns Promise resolving to signed PSBT (base64-encoded)
992
+ */
993
+ signPsbt(psbt: string, mnemonic?: string): Promise<string>;
994
+ /**
995
+ * Sign a message using Schnorr signature
996
+ * @param message - Message to sign
997
+ * @returns Promise resolving to signature string
998
+ */
999
+ signMessage(message: string): Promise<string>;
1000
+ /**
1001
+ * Verify a Schnorr message signature
1002
+ * @param message - Original message
1003
+ * @param signature - Signature to verify
1004
+ * @param accountXpub - Optional account xpub (uses wallet's xpubVan if not provided)
1005
+ * @returns Promise resolving to boolean indicating if signature is valid
1006
+ */
1007
+ verifyMessage(message: string, signature: string, accountXpub?: string): Promise<boolean>;
597
1008
  }
598
1009
 
599
1010
  /**
@@ -645,7 +1056,7 @@ type WalletInitParams = {
645
1056
  * const balance = await wallet.getBtcBalance();
646
1057
  * ```
647
1058
  */
648
- declare class WalletManager {
1059
+ declare class WalletManager implements IWalletManager {
649
1060
  private readonly client;
650
1061
  private readonly xpub;
651
1062
  private readonly xpubVan;
@@ -657,6 +1068,8 @@ declare class WalletManager {
657
1068
  private disposed;
658
1069
  private readonly dataDir;
659
1070
  constructor(params: WalletInitParams);
1071
+ initialize(): Promise<void>;
1072
+ goOnline(): Promise<void>;
660
1073
  /**
661
1074
  * Get wallet's extended public keys
662
1075
  */
@@ -673,7 +1086,7 @@ declare class WalletManager {
673
1086
  * Clears mnemonic and seed from memory
674
1087
  * Idempotent - safe to call multiple times
675
1088
  */
676
- dispose(): void;
1089
+ dispose(): Promise<void>;
677
1090
  /**
678
1091
  * Check if wallet has been disposed
679
1092
  */
@@ -687,43 +1100,78 @@ declare class WalletManager {
687
1100
  address: string;
688
1101
  btcBalance: BtcBalance;
689
1102
  };
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;
1103
+ getBtcBalance(): Promise<BtcBalance>;
1104
+ getAddress(): Promise<string>;
1105
+ listUnspents(): Promise<Unspent$1[]>;
1106
+ listAssets(): Promise<ListAssets>;
1107
+ getAssetBalance(asset_id: string): Promise<AssetBalance>;
1108
+ createUtxosBegin(params: CreateUtxosBeginRequestModel): Promise<string>;
1109
+ createUtxosEnd(params: CreateUtxosEndRequestModel): Promise<number>;
1110
+ sendBegin(params: SendAssetBeginRequestModel): Promise<string>;
710
1111
  /**
711
- * Complete inflate operation: begin sign → end
712
- * @param params - Inflate parameters
713
- * @param mnemonic - Optional mnemonic for signing
1112
+ * Batch send begin: accepts already-built recipientMap.
1113
+ * Returns unsigned PSBT (use signPsbt then sendEnd to complete).
714
1114
  */
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;
1115
+ sendBeginBatch(params: {
1116
+ recipientMap: RecipientMap;
1117
+ feeRate?: number;
1118
+ minConfirmations?: number;
1119
+ donation?: boolean;
1120
+ }): Promise<string>;
1121
+ /**
1122
+ * Complete batch send: sendBeginBatch → sign PSBT → sendEnd.
1123
+ */
1124
+ sendBatch(params: {
1125
+ recipientMap: RecipientMap;
1126
+ feeRate?: number;
1127
+ minConfirmations?: number;
1128
+ donation?: boolean;
1129
+ }, mnemonic?: string): Promise<SendResult>;
1130
+ sendEnd(params: SendAssetEndRequestModel): Promise<SendResult>;
1131
+ sendBtcBegin(params: SendBtcBeginRequestModel): Promise<string>;
1132
+ sendBtcEnd(params: SendBtcEndRequestModel): Promise<string>;
1133
+ estimateFeeRate(blocks: number): Promise<GetFeeEstimationResponse>;
1134
+ estimateFee(psbtBase64: string): Promise<EstimateFeeResult>;
1135
+ sendBtc(params: SendBtcBeginRequestModel): Promise<string>;
1136
+ blindReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
1137
+ witnessReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
720
1138
  decodeRGBInvoice(params: {
721
1139
  invoice: string;
722
- }): DecodeRgbInvoiceResponse;
1140
+ }): Promise<InvoiceData>;
1141
+ issueAssetNia(params: IssueAssetNiaRequestModel): Promise<AssetNIA>;
1142
+ issueAssetIfa(params: IssueAssetIfaRequestModel): Promise<AssetIfa>;
1143
+ inflateBegin(params: InflateAssetIfaRequestModel): Promise<string>;
1144
+ inflateEnd(params: InflateEndRequestModel): Promise<OperationResult>;
1145
+ /**
1146
+ * Complete inflate operation: begin → sign → end
1147
+ * @param params - Inflate parameters
1148
+ * @param mnemonic - Optional mnemonic for signing
1149
+ */
1150
+ inflate(params: InflateAssetIfaRequestModel, mnemonic?: string): Promise<OperationResult>;
1151
+ refreshWallet(): Promise<void>;
1152
+ listTransactions(): Promise<Transaction[]>;
1153
+ listTransfers(asset_id?: string): Promise<Transfer[]>;
1154
+ failTransfers(params: FailTransfersRequest): Promise<boolean>;
723
1155
  createBackup(params: {
724
1156
  backupPath: string;
725
1157
  password: string;
726
- }): WalletBackupResponse;
1158
+ }): Promise<WalletBackupResponse>;
1159
+ /**
1160
+ * Configure VSS cloud backup for this wallet.
1161
+ */
1162
+ configureVssBackup(config: VssBackupConfig): Promise<void>;
1163
+ /**
1164
+ * Disable automatic VSS backup.
1165
+ */
1166
+ disableVssAutoBackup(): Promise<void>;
1167
+ /**
1168
+ * Trigger a VSS backup immediately and return the server version.
1169
+ */
1170
+ vssBackup(config: VssBackupConfig): Promise<number>;
1171
+ /**
1172
+ * Get VSS backup info for this wallet.
1173
+ */
1174
+ vssBackupInfo(config: VssBackupConfig): Promise<VssBackupInfo>;
727
1175
  /**
728
1176
  * Sign a PSBT using the wallet's mnemonic or a provided mnemonic
729
1177
  * @param psbt - Base64 encoded PSBT
@@ -736,13 +1184,13 @@ declare class WalletManager {
736
1184
  * @param mnemonic - Optional mnemonic for signing
737
1185
  */
738
1186
  send(invoiceTransfer: SendAssetBeginRequestModel, mnemonic?: string): Promise<SendResult>;
739
- createUtxos({ upTo, num, size, feeRate }: {
1187
+ createUtxos({ upTo, num, size, feeRate, }: {
740
1188
  upTo?: boolean;
741
1189
  num?: number;
742
1190
  size?: number;
743
1191
  feeRate?: number;
744
1192
  }): Promise<number>;
745
- syncWallet(): void;
1193
+ syncWallet(): Promise<void>;
746
1194
  signMessage(message: string): Promise<string>;
747
1195
  verifyMessage(message: string, signature: string, accountXpub?: string): Promise<boolean>;
748
1196
  }
@@ -767,6 +1215,649 @@ declare class WalletManager {
767
1215
  declare function createWalletManager(params: WalletInitParams): WalletManager;
768
1216
  declare const wallet: WalletManager;
769
1217
 
1218
+ /**
1219
+ * UTEXO Protocol Types
1220
+ */
1221
+ type PublicKeys = {
1222
+ xpub: string;
1223
+ accountXpubVanilla: string;
1224
+ accountXpubColored: string;
1225
+ masterFingerprint: string;
1226
+ };
1227
+ /**
1228
+ * Lightning API Types
1229
+ */
1230
+ interface LightningAsset {
1231
+ /**
1232
+ * @type {string}
1233
+ * @memberof LightningAsset
1234
+ */
1235
+ assetId: string;
1236
+ /**
1237
+ * @type {number}
1238
+ * @memberof LightningAsset
1239
+ */
1240
+ amount: number;
1241
+ }
1242
+ /**
1243
+ * Request model for creating Lightning invoice.
1244
+ *
1245
+ * @export
1246
+ * @interface CreateLightningInvoiceRequestModel
1247
+ */
1248
+ interface CreateLightningInvoiceRequestModel {
1249
+ /**
1250
+ * @type {number}
1251
+ * @memberof CreateLightningInvoiceRequestModel
1252
+ */
1253
+ amountSats?: number;
1254
+ /**
1255
+ * @type {LightningAsset}
1256
+ * @memberof CreateLightningInvoiceRequestModel
1257
+ */
1258
+ asset: LightningAsset;
1259
+ /**
1260
+ * @type {number}
1261
+ * @memberof CreateLightningInvoiceRequestModel
1262
+ */
1263
+ expirySeconds?: number;
1264
+ }
1265
+ interface LightningReceiveRequest {
1266
+ lnInvoice: string;
1267
+ expiresAt?: number;
1268
+ }
1269
+ interface LightningSendRequest extends SendResult {
1270
+ }
1271
+ interface GetLightningSendFeeEstimateRequestModel {
1272
+ invoice: string;
1273
+ assetId?: string;
1274
+ }
1275
+ interface PayLightningInvoiceRequestModel {
1276
+ lnInvoice: string;
1277
+ amount?: number;
1278
+ assetId?: string;
1279
+ maxFee?: number;
1280
+ }
1281
+ interface PayLightningInvoiceEndRequestModel {
1282
+ signedPsbt: string;
1283
+ lnInvoice: string;
1284
+ }
1285
+ /**
1286
+ * Onchain API Types
1287
+ */
1288
+ interface OnchainReceiveRequestModel extends InvoiceRequest {
1289
+ amount: number;
1290
+ assetId: string;
1291
+ }
1292
+ interface OnchainReceiveResponse {
1293
+ /** Mainnet invoice */
1294
+ invoice: string;
1295
+ }
1296
+ interface OnchainSendRequestModel {
1297
+ /** Mainnet invoice */
1298
+ invoice: string;
1299
+ assetId?: string;
1300
+ amount?: number;
1301
+ }
1302
+ interface OnchainSendEndRequestModel {
1303
+ /** Mainnet invoice */
1304
+ invoice: string;
1305
+ signedPsbt: string;
1306
+ }
1307
+ interface OnchainSendResponse extends SendResult {
1308
+ }
1309
+ interface ListLightningPaymentsResponse {
1310
+ payments: LightningSendRequest[];
1311
+ }
1312
+
1313
+ /**
1314
+ * UTEXO Protocol Interfaces
1315
+ *
1316
+ * These interfaces define the contract for UTEXO-specific operations.
1317
+ * They are separated by concern (Lightning vs Onchain) and combined into IUTEXOProtocol.
1318
+ */
1319
+
1320
+ /**
1321
+ * Lightning Protocol Interface
1322
+ *
1323
+ * Defines methods for Lightning Network operations including
1324
+ * invoice creation, payments, and fee estimation.
1325
+ */
1326
+ interface ILightningProtocol {
1327
+ /**
1328
+ * Creates a Lightning invoice for receiving BTC or asset payments.
1329
+ *
1330
+ * @param params - Request parameters for creating the Lightning invoice
1331
+ * @returns Promise resolving to Lightning invoice response
1332
+ */
1333
+ createLightningInvoice(params: CreateLightningInvoiceRequestModel): Promise<LightningReceiveRequest>;
1334
+ /**
1335
+ * Returns the status of a Lightning invoice created with createLightningInvoice.
1336
+ * Supports both BTC and asset invoices.
1337
+ *
1338
+ * @param id - The request ID of the Lightning invoice
1339
+ * @returns Promise resolving to Lightning invoice response or null if not found
1340
+ */
1341
+ getLightningReceiveRequest(id: string): Promise<TransferStatus | null>;
1342
+ /**
1343
+ * Returns the current status of a Lightning payment initiated with payLightningInvoice.
1344
+ * Works for both BTC and asset payments.
1345
+ *
1346
+ * @param id - The request ID of the Lightning send request
1347
+ * @returns Promise resolving to Lightning send request response or null if not found
1348
+ */
1349
+ getLightningSendRequest(id: string): Promise<TransferStatus | null>;
1350
+ /**
1351
+ * Estimates the routing fee required to pay a Lightning invoice.
1352
+ * For asset payments, the returned fee is always denominated in satoshis.
1353
+ *
1354
+ * @param params - Request parameters containing the invoice and optional asset
1355
+ * @returns Promise resolving to estimated fee in satoshis
1356
+ */
1357
+ getLightningSendFeeEstimate(params: GetLightningSendFeeEstimateRequestModel): Promise<number>;
1358
+ /**
1359
+ * Begins a Lightning invoice payment process.
1360
+ * Returns the invoice string as a mock PSBT (later will be constructed base64 PSBT).
1361
+ *
1362
+ * @param params - Request parameters containing the invoice and max fee
1363
+ * @returns Promise resolving to PSBT string (currently returns invoice, later will be base64 PSBT)
1364
+ */
1365
+ payLightningInvoiceBegin(params: PayLightningInvoiceRequestModel): Promise<string>;
1366
+ /**
1367
+ * Completes a Lightning invoice payment using signed PSBT.
1368
+ * Works the same as pay-invoice but uses signed_psbt instead of invoice.
1369
+ *
1370
+ * @param params - Request parameters containing the signed PSBT
1371
+ * @returns Promise resolving to Lightning send request response
1372
+ */
1373
+ payLightningInvoiceEnd(params: SendAssetEndRequestModel): Promise<LightningSendRequest>;
1374
+ /**
1375
+ * Pays a Lightning invoice using the UTEXOWallet.
1376
+ * This method supports BTC Lightning payments and asset-based Lightning payments.
1377
+ *
1378
+ * This is a convenience method that combines:
1379
+ * 1. payLightningInvoiceBegin - to get the PSBT
1380
+ * 2. signPsbt - to sign the PSBT (mock for now)
1381
+ * 3. payLightningInvoiceEnd - to complete the payment
1382
+ *
1383
+ * @param params - Request parameters containing the invoice and max fee
1384
+ * @param mnemonic - Optional mnemonic for signing (uses wallet's mnemonic if not provided)
1385
+ * @returns Promise resolving to Lightning send request response
1386
+ */
1387
+ payLightningInvoice(params: PayLightningInvoiceRequestModel, mnemonic?: string): Promise<LightningSendRequest>;
1388
+ /**
1389
+ * Lists Lightning payments.
1390
+ *
1391
+ * @returns Promise resolving to response containing array of Lightning payments
1392
+ */
1393
+ listLightningPayments(): Promise<ListLightningPaymentsResponse>;
1394
+ }
1395
+ /**
1396
+ * Onchain Protocol Interface
1397
+ *
1398
+ * Defines methods for on-chain withdrawal operations from UTEXO layer.
1399
+ */
1400
+ interface IOnchainProtocol {
1401
+ /**
1402
+ * Begins an on-chain send process from UTEXO.
1403
+ * Returns the request encoded as base64 (mock PSBT).
1404
+ * Later this should construct and return a real base64 PSBT.
1405
+ *
1406
+ * @param params - Request parameters for on-chain send
1407
+ * @returns Promise resolving to PSBT string (currently returns encoded request, later will be base64 PSBT)
1408
+ */
1409
+ onchainSendBegin(params: OnchainSendRequestModel): Promise<string>;
1410
+ /**
1411
+ * Completes an on-chain send from UTEXO using signed PSBT.
1412
+ *
1413
+ * @param params - Request parameters containing the signed PSBT
1414
+ * @returns Promise resolving to on-chain send response
1415
+ */
1416
+ onchainSendEnd(params: SendAssetEndRequestModel): Promise<OnchainSendResponse>;
1417
+ /**
1418
+ * Sends BTC or assets on-chain from the UTEXO layer.
1419
+ * This operation creates a Bitcoin transaction that releases funds from UTEXO to a specified on-chain address.
1420
+ *
1421
+ * This is a convenience method that combines:
1422
+ * 1. onchainSendBegin - to get the PSBT
1423
+ * 2. signPsbt - to sign the PSBT (mock for now)
1424
+ * 3. onchainSendEnd - to complete the on-chain send
1425
+ *
1426
+ * @param params - Request parameters for on-chain send
1427
+ * @param mnemonic - Optional mnemonic for signing (uses wallet's mnemonic if not provided)
1428
+ * @returns Promise resolving to on-chain send response
1429
+ */
1430
+ onchainSend(params: OnchainSendRequestModel, mnemonic?: string): Promise<OnchainSendResponse>;
1431
+ /**
1432
+ * Gets the status of an on-chain send by send ID.
1433
+ *
1434
+ * @param send_id - The on-chain send ID
1435
+ * @returns Promise resolving to on-chain send status response
1436
+ */
1437
+ getOnchainSendStatus(send_id: string): Promise<OnchainSendStatus | null>;
1438
+ /**
1439
+ * Lists on-chain transfers for a specific asset.
1440
+ *
1441
+ * @param asset_id - The asset ID to list transfers for
1442
+ * @returns Promise resolving to array of on-chain transfers
1443
+ */
1444
+ listOnchainTransfers(asset_id?: string): Promise<Transfer[]>;
1445
+ }
1446
+ /**
1447
+ * UTEXO Protocol Interface
1448
+ *
1449
+ * Combines Lightning and Onchain protocol interfaces.
1450
+ * This is the main interface that UTEXOWallet implements.
1451
+ */
1452
+ interface IUTEXOProtocol extends ILightningProtocol, IOnchainProtocol {
1453
+ }
1454
+
1455
+ /**
1456
+ * UTEXO Protocol Base Implementations
1457
+ *
1458
+ * These classes provide empty implementations for UTEXO-specific operations.
1459
+ * They should be extended or used as mixins for concrete implementations.
1460
+ */
1461
+
1462
+ /**
1463
+ * Lightning Protocol Base Class
1464
+ *
1465
+ * Provides empty implementations for all Lightning protocol methods.
1466
+ * Concrete implementations should override these methods.
1467
+ */
1468
+ declare class LightningProtocol implements ILightningProtocol {
1469
+ createLightningInvoice(_params: CreateLightningInvoiceRequestModel): Promise<LightningReceiveRequest>;
1470
+ getLightningReceiveRequest(_id: string): Promise<TransferStatus | null>;
1471
+ getLightningSendRequest(_id: string): Promise<TransferStatus | null>;
1472
+ getLightningSendFeeEstimate(_params: GetLightningSendFeeEstimateRequestModel): Promise<number>;
1473
+ payLightningInvoiceBegin(_params: PayLightningInvoiceRequestModel): Promise<string>;
1474
+ payLightningInvoiceEnd(_params: SendAssetEndRequestModel): Promise<LightningSendRequest>;
1475
+ payLightningInvoice(_params: PayLightningInvoiceRequestModel, _mnemonic?: string): Promise<LightningSendRequest>;
1476
+ listLightningPayments(): Promise<ListLightningPaymentsResponse>;
1477
+ }
1478
+ /**
1479
+ * Onchain Protocol Base Class
1480
+ *
1481
+ * Provides empty implementations for all onchain protocol methods.
1482
+ * Concrete implementations should override these methods.
1483
+ */
1484
+ declare class OnchainProtocol implements IOnchainProtocol {
1485
+ onchainReceive(_params: OnchainReceiveRequestModel): Promise<OnchainReceiveResponse>;
1486
+ onchainSendBegin(_params: OnchainSendRequestModel): Promise<string>;
1487
+ onchainSendEnd(_params: SendAssetEndRequestModel): Promise<OnchainSendResponse>;
1488
+ onchainSend(_params: OnchainSendRequestModel, _mnemonic?: string): Promise<OnchainSendResponse>;
1489
+ getOnchainSendStatus(_send_id: string): Promise<OnchainSendStatus | null>;
1490
+ listOnchainTransfers(_asset_id?: string): Promise<Transfer[]>;
1491
+ }
1492
+ /**
1493
+ * UTEXO Protocol Base Class
1494
+ *
1495
+ * Combines Lightning and Onchain protocol implementations.
1496
+ * Provides empty implementations for all UTEXO protocol methods.
1497
+ * Concrete implementations should override these methods.
1498
+ */
1499
+ declare class UTEXOProtocol extends LightningProtocol implements IUTEXOProtocol {
1500
+ private onchainProtocol;
1501
+ onchainReceive(params: OnchainReceiveRequestModel): Promise<OnchainReceiveResponse>;
1502
+ onchainSendBegin(params: OnchainSendRequestModel): Promise<string>;
1503
+ onchainSendEnd(params: SendAssetEndRequestModel): Promise<OnchainSendResponse>;
1504
+ onchainSend(params: OnchainSendRequestModel, mnemonic?: string): Promise<OnchainSendResponse>;
1505
+ getOnchainSendStatus(send_id: string): Promise<OnchainSendStatus | null>;
1506
+ listOnchainTransfers(asset_id?: string): Promise<Transfer[]>;
1507
+ }
1508
+
1509
+ /**
1510
+ * UTEXO network and asset mapping
1511
+ */
1512
+
1513
+ /**
1514
+ * Network preset type - determines which configuration bundle to use
1515
+ */
1516
+ type UtxoNetworkPreset = 'mainnet' | 'testnet';
1517
+ /**
1518
+ * Network map configuration - maps logical network names to Bitcoin network types
1519
+ */
1520
+ type UtxoNetworkMap = {
1521
+ mainnet: Network;
1522
+ utexo: Network;
1523
+ };
1524
+ /**
1525
+ * Network configuration for a single network (RGB, RGB Lightning, or UTEXO)
1526
+ */
1527
+ type NetworkConfig = {
1528
+ networkName: string;
1529
+ networkId: number;
1530
+ assets: {
1531
+ assetId: string;
1532
+ tokenName: string;
1533
+ longName: string;
1534
+ precision: number;
1535
+ tokenId: number;
1536
+ }[];
1537
+ };
1538
+ /**
1539
+ * Network ID map configuration - contains all network configs with asset lookup
1540
+ */
1541
+ type UtxoNetworkIdMap = {
1542
+ mainnet: NetworkConfig & {
1543
+ getAssetById(tokenId: number): NetworkConfig['assets'][number] | undefined;
1544
+ };
1545
+ mainnetLightning: NetworkConfig & {
1546
+ getAssetById(tokenId: number): NetworkConfig['assets'][number] | undefined;
1547
+ };
1548
+ utexo: NetworkConfig & {
1549
+ getAssetById(tokenId: number): NetworkConfig['assets'][number] | undefined;
1550
+ };
1551
+ };
1552
+ /**
1553
+ * Complete network preset configuration bundle
1554
+ */
1555
+ type UtxoNetworkPresetConfig = {
1556
+ networkMap: UtxoNetworkMap;
1557
+ networkIdMap: UtxoNetworkIdMap;
1558
+ };
1559
+ /**
1560
+ * Gets the network configuration for a given preset
1561
+ * @param preset - Network preset ('mainnet' or 'testnet')
1562
+ * @returns Network preset configuration bundle
1563
+ */
1564
+ declare function getUtxoNetworkConfig(preset: UtxoNetworkPreset): UtxoNetworkPresetConfig;
1565
+ /**
1566
+ * Backward compatibility: Export testnet preset as default (current behavior)
1567
+ * @deprecated Use getUtxoNetworkConfig('testnet') or getUtxoNetworkConfig('mainnet') instead
1568
+ */
1569
+ declare const utexoNetworkMap: UtxoNetworkMap;
1570
+ /**
1571
+ * Backward compatibility: Export testnet preset as default (current behavior)
1572
+ * @deprecated Use getUtxoNetworkConfig('testnet') or getUtxoNetworkConfig('mainnet') instead
1573
+ */
1574
+ declare const utexoNetworkIdMap: UtxoNetworkIdMap;
1575
+ type NetworkAsset = (typeof utexoNetworkIdMap)[keyof typeof utexoNetworkIdMap]['assets'][number];
1576
+ type UtxoNetworkId = keyof typeof utexoNetworkIdMap;
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
+ * @param networkIdMap - Optional. When provided (e.g. from wallet's preset), uses this config. Otherwise uses deprecated testnet preset.
1582
+ */
1583
+ declare function getDestinationAsset(senderNetwork: UtxoNetworkId, destinationNetwork: UtxoNetworkId, assetIdSender: string | null, networkIdMap?: UtxoNetworkIdMap): NetworkAsset | undefined;
1584
+
1585
+ /**
1586
+ * UTEXOWallet constructor and runtime options.
1587
+ */
1588
+
1589
+ /**
1590
+ * Options for UTEXOWallet. When omitted, defaults apply (e.g. DEFAULT_VSS_SERVER_URL for VSS).
1591
+ */
1592
+ interface ConfigOptions {
1593
+ /**
1594
+ * Network preset: 'mainnet' (production) or 'testnet' (development).
1595
+ * Default: 'mainnet'.
1596
+ */
1597
+ network?: UtxoNetworkPreset;
1598
+ /**
1599
+ * Optional base directory for wallet data. When set, each wallet uses a subdir by network + fingerprint:
1600
+ * utexoRGBWallet → dataDir/{networkMap.utexo}/{masterFingerprint} (e.g. ./utexo/signet/3780bc30)
1601
+ * layer1RGBWallet → dataDir/{networkMap.mainnet}/{masterFingerprint} (e.g. ./utexo/testnet/3780bc30)
1602
+ * Same structure is used by restoreUtxoWalletFromVss so restored data can be loaded with this dataDir.
1603
+ */
1604
+ dataDir?: string;
1605
+ /**
1606
+ * Optional VSS server URL. When omitted, DEFAULT_VSS_SERVER_URL is used.
1607
+ * vssBackup() / vssBackupInfo() build config from mnemonic + this URL when config is not passed.
1608
+ */
1609
+ vssServerUrl?: string;
1610
+ }
1611
+
1612
+ /**
1613
+ * UTEXOWallet - Wallet class for UTEXO operations
1614
+ *
1615
+ * This class provides a wallet interface that accepts either a mnemonic or seed
1616
+ * for initialization. It implements both IWalletManager (standard RGB operations)
1617
+ * and IUTEXOProtocol (UTEXO-specific Lightning and on-chain operations).
1618
+ */
1619
+
1620
+ /**
1621
+ * UTEXOWallet - Combines standard RGB wallet operations with UTEXO protocol features
1622
+ *
1623
+ * Architecture:
1624
+ * - Implements IWalletManager for standard RGB operations (via WalletManager delegation)
1625
+ * - Implements IUTEXOProtocol for UTEXO-specific operations (Lightning, on-chain sends)
1626
+ * - Manages two WalletManager instances: layer1 (Bitcoin) and utexo (UTEXO network)
1627
+ */
1628
+ declare class UTEXOWallet extends UTEXOProtocol implements IWalletManager, IUTEXOProtocol {
1629
+ private readonly mnemonicOrSeed;
1630
+ private readonly options;
1631
+ private readonly networkMap;
1632
+ private readonly networkIdMap;
1633
+ private readonly bridge;
1634
+ private layer1Keys;
1635
+ private utexoKeys;
1636
+ private layer1RGBWallet;
1637
+ private utexoRGBWallet;
1638
+ /**
1639
+ * Creates a new UTEXOWallet instance
1640
+ * @param mnemonicOrSeed - Either a mnemonic phrase (string) or seed (Uint8Array)
1641
+ * @param options - Optional configuration options (defaults to { network: 'mainnet' })
1642
+ */
1643
+ constructor(mnemonicOrSeed: string | Uint8Array, options?: ConfigOptions);
1644
+ initialize(): Promise<void>;
1645
+ /**
1646
+ * Derive public keys from mnemonic or seed
1647
+ * @param network - BitcoinNetwork identifier
1648
+ * @returns Promise resolving to PublicKeys containing xpub, accountXpubVanilla, accountXpubColored, and masterFingerprint
1649
+ * @throws {ValidationError} If mnemonic is invalid
1650
+ */
1651
+ derivePublicKeys(network: BitcoinNetwork): Promise<PublicKeys>;
1652
+ getPubKeys(): Promise<PublicKeys>;
1653
+ /**
1654
+ * Guard method to ensure wallet is initialized
1655
+ * @throws {WalletError} if wallet is not initialized
1656
+ */
1657
+ private ensureInitialized;
1658
+ goOnline(): Promise<void>;
1659
+ getXpub(): {
1660
+ xpubVan: string;
1661
+ xpubCol: string;
1662
+ };
1663
+ getNetwork(): Network;
1664
+ dispose(): Promise<void>;
1665
+ isDisposed(): boolean;
1666
+ getBtcBalance(): Promise<BtcBalance>;
1667
+ getAddress(): Promise<string>;
1668
+ listUnspents(): Promise<Unspent$1[]>;
1669
+ createUtxosBegin(params: CreateUtxosBeginRequestModel): Promise<string>;
1670
+ createUtxosEnd(params: CreateUtxosEndRequestModel): Promise<number>;
1671
+ createUtxos(params: {
1672
+ upTo?: boolean;
1673
+ num?: number;
1674
+ size?: number;
1675
+ feeRate?: number;
1676
+ }): Promise<number>;
1677
+ listAssets(): Promise<ListAssets>;
1678
+ getAssetBalance(asset_id: string): Promise<AssetBalance>;
1679
+ issueAssetNia(params: IssueAssetNiaRequestModel): Promise<AssetNIA>;
1680
+ issueAssetIfa(params: IssueAssetIfaRequestModel): Promise<any>;
1681
+ inflateBegin(params: InflateAssetIfaRequestModel): Promise<string>;
1682
+ inflateEnd(params: InflateEndRequestModel): Promise<OperationResult>;
1683
+ inflate(params: InflateAssetIfaRequestModel, mnemonic?: string): Promise<OperationResult>;
1684
+ sendBegin(params: SendAssetBeginRequestModel): Promise<string>;
1685
+ sendEnd(params: SendAssetEndRequestModel): Promise<SendResult>;
1686
+ send(invoiceTransfer: SendAssetBeginRequestModel, mnemonic?: string): Promise<SendResult>;
1687
+ sendBtcBegin(params: SendBtcBeginRequestModel): Promise<string>;
1688
+ sendBtcEnd(params: SendBtcEndRequestModel): Promise<string>;
1689
+ sendBtc(params: SendBtcBeginRequestModel): Promise<string>;
1690
+ blindReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
1691
+ witnessReceive(params: InvoiceRequest): Promise<InvoiceReceiveData>;
1692
+ decodeRGBInvoice(params: {
1693
+ invoice: string;
1694
+ }): Promise<InvoiceData>;
1695
+ listTransactions(): Promise<Transaction[]>;
1696
+ listTransfers(asset_id?: string): Promise<Transfer[]>;
1697
+ failTransfers(params: FailTransfersRequest): Promise<boolean>;
1698
+ refreshWallet(): Promise<void>;
1699
+ syncWallet(): Promise<void>;
1700
+ estimateFeeRate(blocks: number): Promise<GetFeeEstimationResponse>;
1701
+ estimateFee(psbtBase64: string): Promise<EstimateFeeResult>;
1702
+ /**
1703
+ * Create backup for both layer1 and utexo stores in one folder.
1704
+ * Writes backupPath/wallet_{masterFingerprint}_layer1.backup and backupPath/wallet_{masterFingerprint}_utexo.backup
1705
+ * (same naming convention as VSS: storeId_layer1, storeId_utexo with storeId = wallet_<fp>).
1706
+ * Use restoreUtxoWalletFromBackup with the same backupPath to restore both.
1707
+ */
1708
+ createBackup(params: {
1709
+ backupPath: string;
1710
+ password: string;
1711
+ }): Promise<WalletBackupResponse & {
1712
+ layer1BackupPath: string;
1713
+ utexoBackupPath: string;
1714
+ }>;
1715
+ configureVssBackup(config: VssBackupConfig): Promise<void>;
1716
+ disableVssAutoBackup(): Promise<void>;
1717
+ /**
1718
+ * Run VSS backup for both layer1 and utexo stores.
1719
+ * Config is optional: when omitted, builds config from mnemonic (option param or wallet mnemonic)
1720
+ * and options.vssServerUrl (or DEFAULT_VSS_SERVER_URL if not set).
1721
+ *
1722
+ * @param config - Optional; when omitted, built from mnemonic and vssServerUrl
1723
+ * @param mnemonic - Optional; when omitted, uses wallet mnemonic (only if wallet was created with mnemonic string)
1724
+ */
1725
+ vssBackup(config?: VssBackupConfig, mnemonic?: string): Promise<number>;
1726
+ /**
1727
+ * Get VSS backup info. Config is optional; when omitted, built from mnemonic (param or wallet)
1728
+ * and options.vssServerUrl (or DEFAULT_VSS_SERVER_URL if not set).
1729
+ */
1730
+ vssBackupInfo(config?: VssBackupConfig, mnemonic?: string): Promise<VssBackupInfo>;
1731
+ signPsbt(psbt: string, mnemonic?: string): Promise<string>;
1732
+ signMessage(message: string): Promise<string>;
1733
+ verifyMessage(message: string, signature: string, accountXpub?: string): Promise<boolean>;
1734
+ /**
1735
+ * Validates that the wallet has sufficient spendable balance for the given asset and amount.
1736
+ * @param assetId - Asset ID to check balance for
1737
+ * @param amount - Required amount (in asset units)
1738
+ * @throws {ValidationError} If balance is not found or insufficient
1739
+ */
1740
+ validateBalance(assetId: string, amount: number): Promise<void>;
1741
+ /**
1742
+ * Extracts invoice data and destination asset from a bridge transfer.
1743
+ *
1744
+ * @param bridgeTransfer - Bridge transfer response containing recipient invoice and token info
1745
+ * @returns Object containing invoice string, decoded invoice data, and destination asset
1746
+ * @throws {ValidationError} If destination asset is not supported
1747
+ */
1748
+ private extractInvoiceAndAsset;
1749
+ /**
1750
+ * IUTEXOProtocol Implementation
1751
+ */
1752
+ onchainReceive(params: OnchainReceiveRequestModel): Promise<OnchainReceiveResponse>;
1753
+ onchainSendBegin(params: OnchainSendRequestModel): Promise<string>;
1754
+ onchainSendEnd(params: OnchainSendEndRequestModel): Promise<OnchainSendResponse>;
1755
+ onchainSend(params: OnchainSendRequestModel, mnemonic?: string): Promise<OnchainSendResponse>;
1756
+ getOnchainSendStatus(invoice: string): Promise<OnchainSendStatus | null>;
1757
+ listOnchainTransfers(asset_id?: string): Promise<Transfer[]>;
1758
+ createLightningInvoice(params: CreateLightningInvoiceRequestModel): Promise<LightningReceiveRequest>;
1759
+ payLightningInvoiceBegin(params: PayLightningInvoiceRequestModel): Promise<string>;
1760
+ payLightningInvoiceEnd(params: PayLightningInvoiceEndRequestModel): Promise<SendResult>;
1761
+ payLightningInvoice(params: PayLightningInvoiceRequestModel, mnemonic?: string): Promise<LightningSendRequest>;
1762
+ getLightningSendRequest(lnInvoice: string): Promise<TransferStatus | null>;
1763
+ getLightningReceiveRequest(lnInvoice: string): Promise<TransferStatus | null>;
1764
+ private UTEXOToMainnetRGB;
1765
+ private UtexoToMainnetLightning;
1766
+ }
1767
+
1768
+ /**
1769
+ * VSS (Versioned Storage Service) configuration defaults and helpers for UTEXO wallet backup/restore.
1770
+ */
1771
+
1772
+ /** Default VSS server URL used when vssServerUrl is not set in config or restore params. */
1773
+ declare const DEFAULT_VSS_SERVER_URL = "https://vss-server.utexo.com/vss";
1774
+
1775
+ /**
1776
+ * UTEXO wallet restore: VSS and file backup restore helpers.
1777
+ */
1778
+
1779
+ /**
1780
+ * Restore a UTEXOWallet from VSS by restoring both layer1 and utexo stores.
1781
+ * Mnemonic is required; config is optional (built from mnemonic when omitted; vssServerUrl uses DEFAULT_VSS_SERVER_URL if omitted).
1782
+ * Uses the same storeId suffix convention as UTEXOWallet VSS backup (storeId_layer1, storeId_utexo).
1783
+ * Restored data is written to targetDir/{layer1Network}/{masterFingerprint} and
1784
+ * targetDir/{utexoNetwork}/{masterFingerprint} (same layout as when using dataDir on UTEXOWallet).
1785
+ */
1786
+ declare function restoreUtxoWalletFromVss(params: {
1787
+ mnemonic: string;
1788
+ targetDir: string;
1789
+ /** Optional; when omitted, config is built from mnemonic (vssServerUrl defaults to DEFAULT_VSS_SERVER_URL). */
1790
+ config?: VssBackupConfig;
1791
+ /** Preset to derive layer1/utexo network names; defaults to 'testnet'. */
1792
+ networkPreset?: UtxoNetworkPreset;
1793
+ /** Optional; when omitted and config not passed, DEFAULT_VSS_SERVER_URL is used. */
1794
+ vssServerUrl?: string;
1795
+ }): Promise<{
1796
+ layer1Path: string;
1797
+ utexoPath: string;
1798
+ targetDir: string;
1799
+ }>;
1800
+ /**
1801
+ * Restore a UTEXOWallet from a regular (file) backup created by UTEXOWallet.createBackup.
1802
+ * Expects one folder with wallet_<masterFingerprint>_layer1.backup and wallet_<masterFingerprint>_utexo.backup
1803
+ * (same naming convention as VSS: storeId_layer1, storeId_utexo with storeId = wallet_<fp>).
1804
+ * Restores into targetDir (same layout as VSS restore).
1805
+ */
1806
+ declare function restoreUtxoWalletFromBackup(params: {
1807
+ backupPath: string;
1808
+ password: string;
1809
+ targetDir: string;
1810
+ networkPreset?: UtxoNetworkPreset;
1811
+ }): {
1812
+ layer1Path: string;
1813
+ utexoPath: string;
1814
+ targetDir: string;
1815
+ };
1816
+
1817
+ interface Unspent {
1818
+ utxo: Utxo;
1819
+ rgbAllocations: RgbAllocation[];
1820
+ }
1821
+ interface Utxo {
1822
+ outpoint: {
1823
+ txid: string;
1824
+ vout: number;
1825
+ };
1826
+ btcAmount: number;
1827
+ colorable: boolean;
1828
+ exists: boolean;
1829
+ pendingBlinded: number;
1830
+ }
1831
+ interface RgbAllocation {
1832
+ assetId: string;
1833
+ assignment: BindingAssignment;
1834
+ settled: boolean;
1835
+ }
1836
+ interface DecodeRgbInvoiceResponse {
1837
+ recipientId: string;
1838
+ assetSchema?: string;
1839
+ assetId?: string;
1840
+ network: string;
1841
+ assignment: BindingAssignment;
1842
+ assignmentName?: string;
1843
+ expirationTimestamp?: number;
1844
+ transportEndpoints: string[];
1845
+ }
1846
+ interface BindingAssignment {
1847
+ [key: string]: number;
1848
+ }
1849
+
1850
+ /**
1851
+ * Restore a wallet from a VSS backup into a target directory.
1852
+ * Returns a message indicating the restored wallet path.
1853
+ */
1854
+ declare const restoreFromVss: (params: {
1855
+ config: VssBackupConfig;
1856
+ targetDir: string;
1857
+ }) => WalletRestoreResponse & {
1858
+ walletPath: string;
1859
+ };
1860
+
770
1861
  /**
771
1862
  * Custom error classes for the RGB SDK
772
1863
  */
@@ -819,7 +1910,7 @@ declare class CryptoError extends SDKError {
819
1910
  * Configuration errors (missing or invalid configuration)
820
1911
  */
821
1912
  declare class ConfigurationError extends SDKError {
822
- constructor(message: string, field?: string);
1913
+ constructor(message: string, _field?: string);
823
1914
  }
824
1915
  /**
825
1916
  * Bad request errors (400) - Invalid request parameters or data
@@ -927,6 +2018,7 @@ declare const KEYCHAIN_BTC = 0;
927
2018
  /**
928
2019
  * Network-related constants
929
2020
  */
2021
+
930
2022
  /**
931
2023
  * Coin type constants
932
2024
  */
@@ -995,4 +2087,4 @@ declare const DEFAULT_MAX_RETRIES = 3;
995
2087
  */
996
2088
  declare const DEFAULT_LOG_LEVEL = 3;
997
2089
 
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 };
2090
+ 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 };