lwk_node 0.13.1 → 0.14.0

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.
package/lwk_wasm.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function searchLedgerDevice(): Promise<HIDDevice>;
3
4
  /**
4
5
  * Convert the given string to a QR code image uri
5
6
  *
@@ -9,7 +10,6 @@
9
10
  * for example in html: `style="image-rendering: pixelated; border: 20px solid white;"`
10
11
  */
11
12
  export function stringToQr(str: string, pixel_per_module?: number | null): string;
12
- export function searchLedgerDevice(): Promise<HIDDevice>;
13
13
  /**
14
14
  * Wallet chain
15
15
  */
@@ -578,6 +578,21 @@ export class EsploraClient {
578
578
  * Set the waterfalls server recipient key. This is used to encrypt the descriptor when calling the waterfalls endpoint.
579
579
  */
580
580
  setWaterfallsServerRecipient(recipient: string): Promise<void>;
581
+ /**
582
+ * Query the last used derivation index for a wallet's descriptor from the waterfalls server.
583
+ *
584
+ * This method queries the waterfalls `/v1/last_used_index` endpoint to get the last used
585
+ * derivation index for both external and internal chains of the wallet's descriptor.
586
+ *
587
+ * Returns `LastUsedIndexResponse` containing the last used indexes and the tip block hash.
588
+ *
589
+ * # Errors
590
+ *
591
+ * Returns an error if this client was not configured with waterfalls support,
592
+ * if the descriptor does not contain a wildcard,
593
+ * or if the descriptor uses ELIP151 blinding.
594
+ */
595
+ lastUsedIndex(descriptor: WolletDescriptor): Promise<LastUsedIndexResponse>;
581
596
  }
582
597
  /**
583
598
  * Multiple exchange rates against BTC provided from various sources
@@ -743,6 +758,30 @@ export class JadeWebSocket {
743
758
  keyoriginXpub(bip: Bip): Promise<string>;
744
759
  registerDescriptor(name: string, desc: WolletDescriptor): Promise<boolean>;
745
760
  }
761
+ /**
762
+ * Response from the last_used_index endpoint
763
+ *
764
+ * Returns the highest derivation index that has been used (has transaction history)
765
+ * for both external and internal chains. This is useful for quickly determining
766
+ * the next unused address without downloading full transaction history.
767
+ */
768
+ export class LastUsedIndexResponse {
769
+ private constructor();
770
+ free(): void;
771
+ [Symbol.dispose](): void;
772
+ /**
773
+ * Last used index on the external (receive) chain, or undefined if no addresses have been used.
774
+ */
775
+ readonly external: number | undefined;
776
+ /**
777
+ * Last used index on the internal (change) chain, or undefined if no addresses have been used.
778
+ */
779
+ readonly internal: number | undefined;
780
+ /**
781
+ * Current blockchain tip hash for reference.
782
+ */
783
+ readonly tip: string | undefined;
784
+ }
746
785
  export class LedgerWeb {
747
786
  free(): void;
748
787
  [Symbol.dispose](): void;
@@ -1285,18 +1324,6 @@ export class Script {
1285
1324
  export class Signer {
1286
1325
  free(): void;
1287
1326
  [Symbol.dispose](): void;
1288
- /**
1289
- * AMP0 signer data for login
1290
- */
1291
- amp0SignerData(): Amp0SignerData;
1292
- /**
1293
- * AMP0 sign login challenge
1294
- */
1295
- amp0SignChallenge(challenge: string): string;
1296
- /**
1297
- * AMP0 account xpub
1298
- */
1299
- amp0AccountXpub(account: number): string;
1300
1327
  /**
1301
1328
  * Creates a `Signer`
1302
1329
  */
@@ -1333,6 +1360,18 @@ export class Signer {
1333
1360
  * Return the derived BIP85 mnemonic
1334
1361
  */
1335
1362
  derive_bip85_mnemonic(index: number, word_count: number): Mnemonic;
1363
+ /**
1364
+ * AMP0 signer data for login
1365
+ */
1366
+ amp0SignerData(): Amp0SignerData;
1367
+ /**
1368
+ * AMP0 sign login challenge
1369
+ */
1370
+ amp0SignChallenge(challenge: string): string;
1371
+ /**
1372
+ * AMP0 account xpub
1373
+ */
1374
+ amp0AccountXpub(account: number): string;
1336
1375
  }
1337
1376
  export class Singlesig {
1338
1377
  private constructor();