@bsv/sdk 1.5.2 → 1.5.3

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.
@@ -391,7 +391,24 @@ export class Beef {
391
391
  return true
392
392
  }
393
393
 
394
- private verifyValid (allowTxidOnly?: boolean): {
394
+ /**
395
+ * Sorts `txs` and confirms validity of transaction data contained in beef
396
+ * by validating structure of this beef.
397
+ *
398
+ * Returns block heights and merkle root values to be confirmed by a chaintracker.
399
+ *
400
+ * Validity requirements:
401
+ * 1. No 'known' txids, unless `allowTxidOnly` is true.
402
+ * 2. All transactions have bumps or their inputs chain back to bumps (or are known).
403
+ * 3. Order of transactions satisfies dependencies before dependents.
404
+ * 4. No transactions with duplicate txids.
405
+ *
406
+ * @param allowTxidOnly optional. If true, transaction txid is assumed valid
407
+ * @returns {{valid: boolean, roots: Record<number, string>}}
408
+ * `valid` is true iff this Beef is structuraly valid.
409
+ * `roots` is a record where keys are block heights and values are the corresponding merkle roots to be validated.
410
+ */
411
+ verifyValid (allowTxidOnly?: boolean): {
395
412
  valid: boolean
396
413
  roots: Record<number, string>
397
414
  } {