@smartledger/bsv 6.2.2 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bsv.d.ts CHANGED
@@ -18,15 +18,16 @@ declare module '@smartledger/bsv' {
18
18
  hashbuf?: Buffer;
19
19
  sig?: Signature;
20
20
  pubkey?: PublicKey;
21
- /** Result of the last verify() call. */
21
+ /** Result of the last verify() call (also set as a side effect of verify()). */
22
22
  verified?: boolean;
23
23
  /**
24
- * @returns the ECDSA INSTANCE (always truthy) — the pass/fail result is on
25
- * `.verified`. Treating this return value as a boolean silently accepts
26
- * forged signatures; read `.verified` or use `verifyBool()`.
24
+ * Verify the signature. Returns a strict boolean: `true` only when valid.
25
+ * @breaking 7.0 — previously returned the ECDSA instance (always truthy);
26
+ * the chained `.verify().verified` idiom no longer works, read the return
27
+ * value directly.
27
28
  */
28
- verify(): this;
29
- /** Boolean verification — true only when the signature is valid (the safe form). */
29
+ verify(): boolean;
30
+ /** Explicit boolean alias of verify(), retained for pre-7.0 callers. */
30
31
  verifyBool(): boolean;
31
32
  /** Static: sign a hash. */
32
33
  static sign(message: Buffer, key: PrivateKey): Signature;
@@ -250,7 +251,8 @@ declare module '@smartledger/bsv' {
250
251
  toString(): string;
251
252
  inspect(): string;
252
253
 
253
- static fromRandom(wordlist?: Array<string>): Mnemonic;
254
+ static fromRandom(wordlist?: Array<string>, ent?: number): Mnemonic;
255
+ static fromRandom(ent: number, wordlist?: Array<string>): Mnemonic;
254
256
  static fromString(mnemonic: String, wordList?: Array<string>): Mnemonic;
255
257
  static isValid(mnemonic: String, wordList?: Array<string>): boolean;
256
258
  static fromSeed(seed: Buffer, wordlist: Array<string>): Mnemonic