b017 0.0.0-b1 → 0.1.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +274 -1
  2. package/README.md +118 -23
  3. package/dist/index.d.ts +15 -7
  4. package/dist/index.js +14 -5
  5. package/dist/lib/boltLib.d.ts +29 -3
  6. package/dist/lib/boltLib.js +60 -12
  7. package/dist/lib/genesis.d.ts +20 -0
  8. package/dist/lib/genesis.js +45 -0
  9. package/dist/lib/multi/multiBoltLib.d.ts +22 -2
  10. package/dist/lib/multi/multiBoltLib.js +111 -117
  11. package/dist/lib/scanner/beef.d.ts +11 -0
  12. package/dist/lib/scanner/beef.js +63 -0
  13. package/dist/lib/scanner/fingerprints.d.ts +12 -2
  14. package/dist/lib/scanner/fingerprints.js +44 -11
  15. package/dist/lib/scanner/verifyEvents.d.ts +84 -6
  16. package/dist/lib/scanner/verifyEvents.js +519 -44
  17. package/dist/lib/single/singleAncestor.d.ts +27 -3
  18. package/dist/lib/single/singleAncestor.js +49 -18
  19. package/dist/lib/single/singleSpend.d.ts +12 -3
  20. package/dist/lib/single/singleSpend.js +48 -16
  21. package/dist/tokens/BOLT.d.ts +6 -5
  22. package/dist/tokens/GenesisMultiBOLT.d.ts +29 -0
  23. package/dist/tokens/GenesisMultiBOLT.js +48 -0
  24. package/dist/tokens/MultiBOLT.d.ts +17 -11
  25. package/dist/tokens/MultiBOLT.js +79 -68
  26. package/dist/tokens/templates/AuthBolt.sx.template.d.ts +35 -0
  27. package/dist/tokens/templates/AuthBolt.sx.template.js +82 -0
  28. package/dist/tokens/templates/FixedMulti.sx.template.d.ts +13 -0
  29. package/dist/tokens/templates/FixedMulti.sx.template.js +23 -0
  30. package/dist/tokens/templates/MinSimple.sx.template.d.ts +10 -1
  31. package/dist/tokens/templates/MinSimple.sx.template.js +15 -1
  32. package/dist/tokens/templates/OpenMulti.sx.template.d.ts +13 -0
  33. package/dist/tokens/templates/OpenMulti.sx.template.js +23 -0
  34. package/dist/tokens/templates/SerialBolt.sx.template.d.ts +23 -0
  35. package/dist/tokens/templates/SerialBolt.sx.template.js +61 -0
  36. package/dist/tokens/templates/SimpleMulti.sx.template.d.ts +11 -5
  37. package/dist/tokens/templates/SimpleMulti.sx.template.js +30 -21
  38. package/dist/tokens/templates/pay2Proof.d.ts +2 -1
  39. package/dist/tokens/templates/pay2Proof.js +1 -1
  40. package/package.json +8 -3
  41. package/dist/tokens/templates/MinSimpleBalance.sx.template.d.ts +0 -24
  42. package/dist/tokens/templates/MinSimpleBalance.sx.template.js +0 -59
  43. package/dist/tokens/templates/MinSimpleDiscount.sx.template.d.ts +0 -23
  44. package/dist/tokens/templates/MinSimpleDiscount.sx.template.js +0 -58
@@ -0,0 +1,63 @@
1
+ // beef.ts - the data package for an off-chain (SPV) token transfer: Atomic BEEF (BRC-95) over BEEF V2 (BRC-96).
2
+ //
3
+ // A commit or settle received by SPV is only verifiable if the txs it spends travel with it, back to txs a block
4
+ // has proven. BEEF carries exactly that: the subject tx, every unproven ancestor, and a BUMP (merkle path) for the
5
+ // proven ones. b017 uses the CURRENT format only: BEEF V2, wrapped as Atomic BEEF so the package names ONE subject.
6
+ // BEEF V1 (BRC-62) is refused. The scanner checks the package is SELF-CONTAINED (every tx is proven by a BUMP or has
7
+ // all its inputs in the BEEF) but fromBeef does NOT check a BUMP's merkle root against a block header; do that with
8
+ // `Beef.verify(chainTracker)` / `tx.merklePath.verify(txid, chainTracker)`, which needs a header source. The one
9
+ // BUMP verifyEvents checks itself is an ANCHOR's, against the headers the caller supplies (isKnownBlockRoot).
10
+ import { Beef, Utils } from "@bsv/sdk";
11
+ const BEEF_V2 = 4022206466; // 0200BEEF (LE)
12
+ const MAGIC_V1 = "0100beef";
13
+ const MAGIC_V2 = "0200beef";
14
+ const MAGIC_ATOMIC = "01010101";
15
+ /** True when the hex string / bytes begin with a BEEF magic (V1, V2 or Atomic). */
16
+ export function isBeef(x) {
17
+ const head = typeof x === "string" ? x.slice(0, 8).toLowerCase() : Utils.toHex(Array.from(x).slice(0, 4));
18
+ return head === MAGIC_V1 || head === MAGIC_V2 || head === MAGIC_ATOMIC;
19
+ }
20
+ /** The SDK orders a BEEF by each input's `sourceTXID`; an in-memory tx often carries only `sourceTransaction`, which
21
+ * would make every tx look input-less and lose the dependency order. Fill it in across the attached graph. */
22
+ function fillSourceTxids(tx, seen = new Set()) {
23
+ if (seen.has(tx))
24
+ return;
25
+ seen.add(tx);
26
+ for (const input of tx.inputs) {
27
+ if (!input.sourceTransaction)
28
+ continue;
29
+ if (input.sourceTXID === undefined)
30
+ input.sourceTXID = input.sourceTransaction.id("hex");
31
+ fillSourceTxids(input.sourceTransaction, seen);
32
+ }
33
+ }
34
+ /** Serialise `tx` and every attached source tx (with merkle paths where known) as Atomic BEEF over BEEF V2. */
35
+ export function toAtomicBeef(tx) {
36
+ fillSourceTxids(tx);
37
+ const beef = new Beef(BEEF_V2);
38
+ beef.mergeTransaction(tx);
39
+ return beef.toBinaryAtomic(tx.id("hex"));
40
+ }
41
+ /**
42
+ * Parse BEEF V2 (plain or Atomic) into its subject transaction, with every ancestor wired in through
43
+ * `sourceTransaction` (and `merklePath` on proven ones). Throws on BEEF V1, on a BEEF that is not self-contained
44
+ * (a tx neither proven by a BUMP nor having all its inputs in the BEEF, or txid-only entries), or on no subject.
45
+ */
46
+ export function fromBeef(input) {
47
+ const bytes = typeof input === "string" ? Utils.toArray(input, "hex") : Array.from(input);
48
+ const beef = Beef.fromBinary(bytes);
49
+ if (beef.version !== BEEF_V2)
50
+ throw new Error("BEEF V1 (BRC-62) is not accepted; use BEEF V2 (BRC-96) / Atomic BEEF (BRC-95)");
51
+ if (!beef.isValid(false))
52
+ throw new Error("BEEF is not self-contained: a tx is neither proven by a BUMP nor has all its inputs in the BEEF");
53
+ // The SDK counts a tx with no inputs and no BUMP as vacuously valid. A real tx always spends something, so an
54
+ // unproven tx with no inputs is a fabricated root: refuse it.
55
+ for (const t of beef.txs)
56
+ if (t.tx && t.bumpIndex === undefined && t.tx.inputs.length === 0)
57
+ throw new Error(`BEEF is not self-contained: tx ${t.txid.slice(0, 8)} has no inputs and no BUMP`);
58
+ const subject = beef.atomicTxid ?? [...beef.txs].reverse().find((t) => t.tx)?.txid;
59
+ const tx = subject ? beef.findAtomicTransaction(subject) : undefined;
60
+ if (!tx)
61
+ throw new Error("BEEF has no subject transaction");
62
+ return tx;
63
+ }
@@ -1,18 +1,28 @@
1
1
  import { Script } from "@bsv/sdk";
2
- export type TokenType = "MinSimpleBOLT" | "MinSimpleDiscountBOLT" | "MinSimpleBalanceBOLT" | "SimpleMultiBOLT";
2
+ export type TokenType = "MinSimpleBOLT" | "AuthBOLT" | "SimpleMultiBOLT" | "FixedBOLT" | "OpenBOLT" | "SerialBOLT";
3
+ /** Genesis-family recognition phase: the mint (null field, any mintData) or any later output. */
4
+ export type TokenPhase = "mint" | "postMint";
3
5
  export interface TypeSpec {
4
6
  type: TokenType;
5
7
  dataPushCount: number;
8
+ /** Exact push lengths (for the genesis family: the postMint spec; the mint spec relaxes pushes 0-1). */
6
9
  pushLengths: number[];
7
10
  suffixHashHex: string;
11
+ /** Genesis family: leads with the 36-byte genesis / LMG field and the mintData push. */
12
+ genesis: boolean;
8
13
  }
9
14
  export declare const sha256Hex: (bin: number[]) => string;
10
15
  export declare const REGISTRY: Record<TokenType, TypeSpec>;
11
16
  /**
12
- * Recognise a locking script as a genuine BOLT token of a known type (or null).
17
+ * Recognise a locking script as a genuine BOLT token of a known type, with its genesis-family phase (or null).
13
18
  * Requires BOTH the leading-push layout AND the static-code hash to match a registered type —
14
19
  * so a tampered contract body or a non-token script is rejected.
15
20
  */
21
+ export declare function recognizeToken(lock: Script | null | undefined, expected?: TokenType): {
22
+ type: TokenType;
23
+ phase?: TokenPhase;
24
+ } | null;
25
+ /** Recognise a locking script as a genuine BOLT token of a known type (or null). See recognizeToken. */
16
26
  export declare function recognizeType(lock: Script | null | undefined, expected?: TokenType): TokenType | null;
17
27
  /** The issuerPubKey is always the last dynamic data push of a recognised token. */
18
28
  export declare function issuerPubKeyOf(lock: Script, type: TokenType): number[];
@@ -3,27 +3,42 @@
3
3
  // A type's fingerprint is { pushLengths (the data-push byte layout) , suffixHash = sha256(static code) }.
4
4
  // issuerPubKey is always the LAST dynamic push (33 bytes); it identifies the issuer, not the type.
5
5
  //
6
+ // The genesis family (FixedBOLT, OpenBOLT, SerialBOLT) leads with two more pushes: a 36-byte outpoint field and the
7
+ // issuer's mintData, which is variable on the MINT and empty (OP_0) on every later output. So each has TWO specs:
8
+ // mint field 0 = 36 zero bytes (null), mintData 0..255 bytes;
9
+ // postMint field 0 = 36 bytes, not all zero, mintData exactly 0 bytes.
10
+ // Every other push is exact-length in both. A non-empty mintData after the mint is therefore unrecognised.
11
+ //
6
12
  // The same golden-hash idea also fingerprints the p2Proof output (the b017 marker proof carried by
7
13
  // commit txs and consumed by settle txs): its only dynamic field is the 20-byte beneficiary pkh, so
8
14
  // recognizeP2P hashes the static skeleton (incl. the b017 marker bytes) and checks the pkh length.
9
15
  import { Hash, Script, Utils } from "@bsv/sdk";
10
16
  import MinSimpleTemplate from "../../tokens/templates/MinSimple.sx.template.js";
11
- import MinSimpleDiscountTemplate from "../../tokens/templates/MinSimpleDiscount.sx.template.js";
12
- import MinSimpleBalanceTemplate from "../../tokens/templates/MinSimpleBalance.sx.template.js";
17
+ import AuthBoltTemplate from "../../tokens/templates/AuthBolt.sx.template.js";
13
18
  import SimpleMultiTemplate from "../../tokens/templates/SimpleMulti.sx.template.js";
19
+ import FixedMultiTemplate from "../../tokens/templates/FixedMulti.sx.template.js";
20
+ import OpenMultiTemplate from "../../tokens/templates/OpenMulti.sx.template.js";
21
+ import SerialBoltTemplate from "../../tokens/templates/SerialBolt.sx.template.js";
14
22
  import Pay2ProofTemplate from "../../tokens/templates/pay2Proof.js";
15
23
  // Leading dynamic-push byte lengths per type (issuerPubKey is always the last, 33 bytes).
16
24
  const LAYOUTS = Object.freeze({
17
25
  MinSimpleBOLT: [20, 20, 1, 36, 36, 33],
18
- MinSimpleDiscountBOLT: [1, 20, 20, 1, 36, 36, 33],
19
- MinSimpleBalanceBOLT: [16, 20, 20, 1, 36, 36, 33],
26
+ AuthBOLT: [20, 20, 1, 36, 36, 33], // same lock layout as MinSimpleBOLT: told apart by the suffix hash alone
20
27
  SimpleMultiBOLT: [16, 16, 20, 20, 20, 36, 1, 1, 36, 36, 33],
28
+ FixedBOLT: [36, 0, 16, 16, 20, 20, 20, 36, 1, 1, 36, 36, 33],
29
+ OpenBOLT: [36, 0, 16, 16, 20, 20, 20, 36, 1, 1, 36, 36, 33],
30
+ SerialBOLT: [36, 0, 20, 20, 1, 36, 36, 33],
21
31
  });
32
+ const GENESIS = new Set(["FixedBOLT", "OpenBOLT", "SerialBOLT"]);
33
+ /** mintData is pushed with at most PUSHDATA1. */
34
+ const MINT_DATA_MAX = 255;
22
35
  const SUFFIX = {
23
36
  MinSimpleBOLT: new MinSimpleTemplate().staticSuffix(),
24
- MinSimpleDiscountBOLT: new MinSimpleDiscountTemplate().staticSuffix(),
25
- MinSimpleBalanceBOLT: new MinSimpleBalanceTemplate().staticSuffix(),
37
+ AuthBOLT: new AuthBoltTemplate().staticSuffix(),
26
38
  SimpleMultiBOLT: new SimpleMultiTemplate().staticSuffix(),
39
+ FixedBOLT: new FixedMultiTemplate().staticSuffix(),
40
+ OpenBOLT: new OpenMultiTemplate().staticSuffix(),
41
+ SerialBOLT: new SerialBoltTemplate().staticSuffix(),
27
42
  };
28
43
  export const sha256Hex = (bin) => Utils.toHex(Hash.sha256(bin));
29
44
  export const REGISTRY = Object.freeze(Object.fromEntries(Object.keys(LAYOUTS).map((type) => [
@@ -33,14 +48,28 @@ export const REGISTRY = Object.freeze(Object.fromEntries(Object.keys(LAYOUTS).ma
33
48
  dataPushCount: LAYOUTS[type].length,
34
49
  pushLengths: Object.freeze([...LAYOUTS[type]]),
35
50
  suffixHashHex: sha256Hex(SUFFIX[type].toBinary()),
51
+ genesis: GENESIS.has(type),
36
52
  }),
37
53
  ])));
54
+ /** The leading pushes match a spec: exact lengths, except the genesis family's mint / postMint pair (see top). */
55
+ function pushesMatch(lock, spec) {
56
+ const n = spec.dataPushCount;
57
+ const lens = lock.chunks.slice(0, n).map((c) => c.data?.length ?? 0);
58
+ if (!spec.genesis)
59
+ return lens.every((l, i) => l === spec.pushLengths[i]) ? "exact" : null;
60
+ if (!lens.every((l, i) => i < 2 || l === spec.pushLengths[i]) || lens[0] !== 36)
61
+ return null;
62
+ const nullField = lock.chunks[0].data.every((b) => b === 0);
63
+ if (nullField)
64
+ return lens[1] <= MINT_DATA_MAX ? "mint" : null;
65
+ return lens[1] === 0 ? "postMint" : null;
66
+ }
38
67
  /**
39
- * Recognise a locking script as a genuine BOLT token of a known type (or null).
68
+ * Recognise a locking script as a genuine BOLT token of a known type, with its genesis-family phase (or null).
40
69
  * Requires BOTH the leading-push layout AND the static-code hash to match a registered type —
41
70
  * so a tampered contract body or a non-token script is rejected.
42
71
  */
43
- export function recognizeType(lock, expected) {
72
+ export function recognizeToken(lock, expected) {
44
73
  if (!lock || !Array.isArray(lock.chunks))
45
74
  return null;
46
75
  for (const spec of Object.values(REGISTRY)) {
@@ -49,16 +78,20 @@ export function recognizeType(lock, expected) {
49
78
  const n = spec.dataPushCount;
50
79
  if (lock.chunks.length <= n)
51
80
  continue;
52
- const lens = lock.chunks.slice(0, n).map((c) => c.data?.length ?? 0);
53
- if (!lens.every((l, i) => l === spec.pushLengths[i]))
81
+ const m = pushesMatch(lock, spec);
82
+ if (!m)
54
83
  continue;
55
84
  const suffix = new Script(lock.chunks.slice(n));
56
85
  if (sha256Hex(suffix.toBinary()) !== spec.suffixHashHex)
57
86
  continue;
58
- return spec.type;
87
+ return m === "exact" ? { type: spec.type } : { type: spec.type, phase: m };
59
88
  }
60
89
  return null;
61
90
  }
91
+ /** Recognise a locking script as a genuine BOLT token of a known type (or null). See recognizeToken. */
92
+ export function recognizeType(lock, expected) {
93
+ return recognizeToken(lock, expected)?.type ?? null;
94
+ }
62
95
  /** The issuerPubKey is always the last dynamic data push of a recognised token. */
63
96
  export function issuerPubKeyOf(lock, type) {
64
97
  return lock.chunks[REGISTRY[type].dataPushCount - 1]?.data ?? [];
@@ -3,35 +3,113 @@ import { type TokenType } from "./fingerprints.js";
3
3
  export interface ScanOpts {
4
4
  expectedType?: TokenType;
5
5
  trustedIssuerPubKey?: number[] | string;
6
+ /** Your block headers: is `merkleRoot` the merkle root of the block at `height`? An anchor whose merkle path
7
+ * proves it into a header you know is HEADER-PROVEN: consensus already validated it, so its own inputs are not
8
+ * re-executed and its sources need not be supplied (a BEEF stops at proven txs). An UNFUNDED anchor is refused
9
+ * unless it is header-proven. */
10
+ isKnownBlockRoot?: (merkleRoot: string, height: number) => boolean;
11
+ /** Refuse a batch holding an event tx whose outputs exceed its inputs (see ScanResult.offChainOnly). Default
12
+ * false: such a tx is valid OFF chain (a never-broadcast commit / settle certifying auth data) and is only
13
+ * reported. Set true when the events are meant to be broadcast as they are. */
14
+ requireBroadcastable?: boolean;
15
+ }
16
+ /** An event tx whose outputs exceed its inputs: its scripts are valid, but no node will accept it as built. */
17
+ export interface OffChainOnlyTx {
18
+ txid: string;
19
+ inputSats: number;
20
+ outputSats: number;
21
+ }
22
+ /** An async source of block headers (the `@bsv/sdk` ChainTracker shape), usable with verifyAndBroadcast. */
23
+ export interface HeaderSource {
24
+ isValidRootForHeight(root: string, height: number): Promise<boolean>;
25
+ }
26
+ /** A tx an event spends that is not itself part of the event; `proven` = it carries a BUMP (merkle path). */
27
+ export interface SourceTx {
28
+ txid: string;
29
+ proven: boolean;
6
30
  }
7
31
  export type EventKind = "mint" | "transfer" | "split" | "merge" | "melt";
32
+ /** What the network said about a broadcast anchor. "already-seen" = the node already knows the tx (mempool or mined). */
33
+ export type AnchorStatus = "accepted" | "already-seen" | "rejected";
34
+ /** An anchor: the token tx a batch stands on (the settle before its first commit, or the mint). The caller must
35
+ * broadcast it; `status` / `detail` are filled in by verifyAndBroadcast. */
36
+ export interface AnchorRef {
37
+ txid: string;
38
+ kind: "mint" | "settle";
39
+ status?: AnchorStatus;
40
+ detail?: string;
41
+ }
42
+ export interface AnchorBroadcastResult {
43
+ status: AnchorStatus;
44
+ detail?: string;
45
+ }
46
+ /** The caller's broadcaster: send ONE anchor tx (its unproven ancestors are attached through `sourceTransaction`)
47
+ * and report whether the network accepted it, already knew it, or rejected it. */
48
+ export type AnchorBroadcaster = (anchor: Transaction) => Promise<AnchorBroadcastResult>;
8
49
  export interface ScanResult {
9
50
  ok: boolean;
10
51
  reason?: string;
11
52
  type?: TokenType;
12
53
  issuerPubKeyHex?: string;
54
+ /** The txs the event txs spend that are not themselves event txs (parents / funding), with whether each carries a BUMP.
55
+ * A `proven` source is NOT checked against a block header here: verify its merkle path with your ChainTracker.
56
+ * (Only an ANCHOR's merkle path is checked, against `isKnownBlockRoot`.) */
57
+ sources?: SourceTx[];
58
+ /** true when the batch holds a mint that no commit in it spends (the mint alone proves nothing about the issuer key). */
59
+ unauthenticated?: boolean;
13
60
  events?: {
14
61
  kind: EventKind;
15
62
  txids: string[];
16
63
  }[];
64
+ /** The anchors the batch stands on (see AnchorRef). `ok: true` from verifyEvents is only FINAL once the network has
65
+ * accepted (or already seen) every one of them: broadcast them, or call verifyAndBroadcast. */
66
+ anchors?: AnchorRef[];
67
+ /** VALUE CONSERVATION, reported not refused: the event txs whose outputs exceed their inputs. They are valid off
68
+ * chain (the scripts execute) but cannot be broadcast as built; fund them first. Absent when every event tx
69
+ * conserves value. An ANCHOR that creates value is refused instead: the network would never accept it. */
70
+ offChainOnly?: OffChainOnlyTx[];
17
71
  }
18
72
  export interface EventResult {
19
73
  ok: boolean;
20
74
  reason?: string;
21
75
  type?: TokenType;
22
76
  kind?: EventKind;
77
+ /** See ScanResult.sources. */
78
+ sources?: SourceTx[];
79
+ /** true when the event is a mint that no commit in it spends (see ScanResult.unauthenticated). */
80
+ unauthenticated?: boolean;
81
+ /** See ScanResult.anchors. */
82
+ anchors?: AnchorRef[];
83
+ /** See ScanResult.offChainOnly. */
84
+ offChainOnly?: OffChainOnlyTx[];
23
85
  }
86
+ /** An event tx: a Transaction, raw tx hex, or BEEF (hex / bytes: Atomic BEEF over BEEF V2) whose subject is the tx. */
87
+ export type TxInput = Transaction | string | Uint8Array;
24
88
  /**
25
- * Verify ONE token event — a mint, a commit->settle pair, or a melt. Categorises each tx by its
26
- * token's txoType action, fingerprints EVERY interface against the action's golden shape, and (for
27
- * a commit+settle pair) checks the settle links back to the commit via parentOutpoint.
89
+ * Verify ONE token event - a commit->settle pair or a melt (a mint is accepted only with the commit that spends
90
+ * it). Categorises each tx by its token's txoType action, fingerprints EVERY interface against the action's
91
+ * golden shape, checks the settle links back to the commit, then takes its verdict from the same scan as
92
+ * verifyEvents: the anchor step, pairing, sources and script execution all apply, and `anchors` names what the
93
+ * caller must broadcast. A lone commit or a lone settle is NOT an event.
28
94
  */
29
- export declare function verifyEvent(eventTxs: (Transaction | string)[], opts?: ScanOpts): EventResult;
95
+ export declare function verifyEvent(eventTxs: TxInput[], opts?: ScanOpts): EventResult;
30
96
  /**
31
97
  * Verify a BATCH of transactional events end to end. The multistep inspection: recognise the type,
32
98
  * pin the issuer across every token output in the batch, fingerprint every tx's interface
33
99
  * arrangement, then pair the events — every commit (txoType 21/23/25) must be matched by a settle
34
100
  * that links back via parentOutpoint, and every settle must link to a commit in the batch. A lone
35
- * mint (genesis) or melt (terminal) is a valid single-tx event.
101
+ * melt (terminal) is a valid single-tx event; a MINT must be spent by a commit in the batch, else the
102
+ * result is `unauthenticated: true` (a mint alone does not prove the sender holds the issuer key).
103
+ * The batch's ANCHORS (settle N-1 / the mint) are validated with it and named in `anchors`; this function is offline,
104
+ * so the caller still has to broadcast them (verifyAndBroadcast does both).
105
+ */
106
+ export declare function verifyEvents(txsIn: TxInput[], opts?: ScanOpts): ScanResult;
107
+ /**
108
+ * verifyEvents, then BROADCAST every anchor through the caller's broadcaster. The batch is accepted only when the
109
+ * offline verdict is ok AND the network accepted (or had already seen) each anchor: that shows the tx the batch
110
+ * stands on exists and that a node accepted its scripts and its ancestry. Nothing is broadcast when the offline
111
+ * verdict fails. A rejected anchor, a throwing broadcaster or an unknown status all fail closed.
36
112
  */
37
- export declare function verifyEvents(txsIn: (Transaction | string)[], opts?: ScanOpts): ScanResult;
113
+ export declare function verifyAndBroadcast(txsIn: TxInput[], broadcastAnchor: AnchorBroadcaster, opts?: ScanOpts & {
114
+ chainTracker?: HeaderSource;
115
+ }): Promise<ScanResult>;