b017 0.0.0-b1 → 0.2.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/CHANGELOG.md +568 -39
- package/LICENSE.txt +56 -56
- package/README.md +310 -206
- package/dist/index.d.ts +15 -7
- package/dist/index.js +14 -5
- package/dist/lib/boltLib.d.ts +29 -3
- package/dist/lib/boltLib.js +60 -12
- package/dist/lib/genesis.d.ts +20 -0
- package/dist/lib/genesis.js +45 -0
- package/dist/lib/multi/multiBoltLib.d.ts +22 -2
- package/dist/lib/multi/multiBoltLib.js +114 -129
- package/dist/lib/scanner/beef.d.ts +11 -0
- package/dist/lib/scanner/beef.js +63 -0
- package/dist/lib/scanner/fingerprints.d.ts +12 -2
- package/dist/lib/scanner/fingerprints.js +45 -12
- package/dist/lib/scanner/verifyEvents.d.ts +84 -6
- package/dist/lib/scanner/verifyEvents.js +520 -45
- package/dist/lib/single/singleAncestor.d.ts +27 -3
- package/dist/lib/single/singleAncestor.js +49 -18
- package/dist/lib/single/singleSpend.d.ts +12 -3
- package/dist/lib/single/singleSpend.js +48 -16
- package/dist/tokens/BOLT.d.ts +6 -5
- package/dist/tokens/GenesisMultiBOLT.d.ts +29 -0
- package/dist/tokens/GenesisMultiBOLT.js +48 -0
- package/dist/tokens/MultiBOLT.d.ts +17 -12
- package/dist/tokens/MultiBOLT.js +82 -74
- package/dist/tokens/templates/AuthBolt.sx.template.d.ts +35 -0
- package/dist/tokens/templates/AuthBolt.sx.template.js +82 -0
- package/dist/tokens/templates/FixedMulti.sx.template.d.ts +13 -0
- package/dist/tokens/templates/FixedMulti.sx.template.js +23 -0
- package/dist/tokens/templates/MinSimple.sx.template.d.ts +10 -1
- package/dist/tokens/templates/MinSimple.sx.template.js +15 -1
- package/dist/tokens/templates/OpenMulti.sx.template.d.ts +13 -0
- package/dist/tokens/templates/OpenMulti.sx.template.js +23 -0
- package/dist/tokens/templates/SerialBolt.sx.template.d.ts +23 -0
- package/dist/tokens/templates/SerialBolt.sx.template.js +61 -0
- package/dist/tokens/templates/SimpleMulti.sx.template.d.ts +12 -6
- package/dist/tokens/templates/SimpleMulti.sx.template.js +33 -25
- package/dist/tokens/templates/pay2Proof.d.ts +2 -1
- package/dist/tokens/templates/pay2Proof.js +1 -1
- package/package.json +64 -58
- package/dist/tokens/templates/MinSimpleBalance.sx.template.d.ts +0 -24
- package/dist/tokens/templates/MinSimpleBalance.sx.template.js +0 -59
- package/dist/tokens/templates/MinSimpleDiscount.sx.template.d.ts +0 -23
- package/dist/tokens/templates/MinSimpleDiscount.sx.template.js +0 -58
package/dist/index.js
CHANGED
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
// Pre-compiled contract (no sx compiler at runtime); only @bsv/sdk.
|
|
3
3
|
export { SimpleMultiBOLT } from "./tokens/MultiBOLT.js";
|
|
4
4
|
export { default as SimpleMultiTemplate } from "./tokens/templates/SimpleMulti.sx.template.js";
|
|
5
|
+
// The genesis family: FixedBOLT (one genesis per asset), OpenBOLT (many mints, re-rooted merges), SerialBOLT (NFT serial).
|
|
6
|
+
export { FixedBOLT, OpenBOLT } from "./tokens/GenesisMultiBOLT.js";
|
|
7
|
+
export { default as FixedMultiTemplate } from "./tokens/templates/FixedMulti.sx.template.js";
|
|
8
|
+
export { default as OpenMultiTemplate } from "./tokens/templates/OpenMulti.sx.template.js";
|
|
9
|
+
export { default as SerialBoltTemplate } from "./tokens/templates/SerialBolt.sx.template.js";
|
|
10
|
+
export { genesisFieldFor, mintDataFor, outpointOf, MINT_DATA_MAX_BYTES } from "./lib/genesis.js";
|
|
11
|
+
export { SIMPLE_MULTI_LAYOUT, FIXED_BOLT_LAYOUT, OPEN_BOLT_LAYOUT } from "./lib/multi/multiBoltLib.js";
|
|
5
12
|
export { BOLT } from "./tokens/BOLT.js";
|
|
6
|
-
export { verifyTx, buildOutpoint } from "./lib/boltLib.js";
|
|
13
|
+
export { verifyTx, buildOutpoint, p2pkhUnlock, toSigner } from "./lib/boltLib.js";
|
|
7
14
|
// Token LOCK templates (mint/build the contract output for each type).
|
|
8
15
|
export { default as MinSimpleTemplate } from "./tokens/templates/MinSimple.sx.template.js";
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as MinSimpleBalanceTemplate } from "./tokens/templates/MinSimpleBalance.sx.template.js";
|
|
16
|
+
export { default as AuthBoltTemplate, AUTH_DATA_MAX_BYTES } from "./tokens/templates/AuthBolt.sx.template.js";
|
|
11
17
|
export { default as Pay2ProofTemplate } from "./tokens/templates/pay2Proof.js";
|
|
12
18
|
// Token recognition — the scanner's fingerprint primitive.
|
|
13
|
-
export { REGISTRY, recognizeType, recognizeP2P, issuerPubKeyOf, sha256Hex } from "./lib/scanner/fingerprints.js";
|
|
19
|
+
export { REGISTRY, recognizeType, recognizeToken, recognizeP2P, issuerPubKeyOf, sha256Hex } from "./lib/scanner/fingerprints.js";
|
|
14
20
|
// The shared off-chain BOLT event validator (the scanner): a batch verifier + the per-event checker.
|
|
15
|
-
|
|
21
|
+
// verifyAndBroadcast = verifyEvents + the caller's broadcast of the batch's ANCHOR (settle N-1 / the mint).
|
|
22
|
+
export { verifyEvents, verifyEvent, verifyAndBroadcast } from "./lib/scanner/verifyEvents.js";
|
|
23
|
+
// The off-chain data package: Atomic BEEF (BRC-95) over BEEF V2 (BRC-96); V1 is refused.
|
|
24
|
+
export { toAtomicBeef, fromBeef, isBeef } from "./lib/scanner/beef.js";
|
package/dist/lib/boltLib.d.ts
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
import { Script, Spend, Transaction, PrivateKey } from "@bsv/sdk";
|
|
1
|
+
import { Script, Spend, Transaction, PrivateKey, Signature, UnlockingScript } from "@bsv/sdk";
|
|
2
|
+
/** Signs on behalf of a key the caller may not hold. `sign(msg)` returns an ECDSA Signature over
|
|
3
|
+
* sha256(msg) — matching PrivateKey.sign — and may be async. `publicKey` is the 33-byte compressed key. */
|
|
4
|
+
export interface Signer {
|
|
5
|
+
publicKey: number[];
|
|
6
|
+
sign: (msg: number[]) => Signature | Promise<Signature>;
|
|
7
|
+
}
|
|
8
|
+
/** A recipient of a token: a PrivateKey or Signer the caller controls (so the builder can continue as
|
|
9
|
+
* the new owner), or just a compressed public key (33 bytes) when paying a third party. */
|
|
10
|
+
export type Recipient = PrivateKey | Signer | number[];
|
|
11
|
+
/** Normalise a PrivateKey or Signer to a Signer. */
|
|
12
|
+
export declare const toSigner: (x: PrivateKey | Signer) => Signer;
|
|
13
|
+
/** The recipient's compressed public key, whichever form it was given in. */
|
|
14
|
+
export declare const recipientPubKey: (r: Recipient) => number[];
|
|
15
|
+
/** A Signer for the recipient if the caller controls its key (so the builder can spend the token on a
|
|
16
|
+
* later hop); undefined when only a public key was given (the token has left this holder). */
|
|
17
|
+
export declare const recipientSigner: (r: Recipient) => Signer | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Verify every input of a tx with the @bsv/sdk Spend engine. THROWS on any failure (a missing source or unlocking
|
|
20
|
+
* script, a failing script - `Spend.validate()` throws rather than returning false - an output with no amount, or
|
|
21
|
+
* outputs worth more than inputs unless `skipOutputCheck`), so when it returns, `valid` is always `true`. The
|
|
22
|
+
* `{ valid, scriptExecutions }` shape is kept for existing callers.
|
|
23
|
+
*/
|
|
2
24
|
export declare const verifyTx: (tx: Transaction, skipOutputCheck?: boolean) => {
|
|
3
|
-
valid:
|
|
25
|
+
valid: true;
|
|
4
26
|
scriptExecutions: {
|
|
5
27
|
spend: Spend;
|
|
6
28
|
valid: boolean;
|
|
@@ -8,9 +30,13 @@ export declare const verifyTx: (tx: Transaction, skipOutputCheck?: boolean) => {
|
|
|
8
30
|
};
|
|
9
31
|
export declare const buildOutpoint: (tx: Transaction, outputIndex: number) => number[];
|
|
10
32
|
export declare const buildChangeOutput: (tx: Transaction, outputIndex: number) => number[];
|
|
11
|
-
export declare const createSignature: (
|
|
33
|
+
export declare const createSignature: (signerOrKey: PrivateKey | Signer, preimage: number[], signatureScope: number) => Promise<{
|
|
12
34
|
sigForScript: number[];
|
|
13
35
|
pubkeyForScript: number[];
|
|
36
|
+
}>;
|
|
37
|
+
export declare const p2pkhUnlock: (signerOrKey: PrivateKey | Signer) => {
|
|
38
|
+
sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
|
|
39
|
+
estimateLength: () => Promise<number>;
|
|
14
40
|
};
|
|
15
41
|
export declare const splitCtx: (ctx: number[], unlockBytesLen?: number) => {
|
|
16
42
|
ctxHeader: number[];
|
package/dist/lib/boltLib.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
// boltLib.ts — layout-agnostic helpers shared by both token streams:
|
|
2
2
|
// verifyTx (bsv Spend), buildOutpoint, buildChangeOutput, createSignature, splitCtx,
|
|
3
3
|
// and the tx-field primitives (le32/le64, spentOutpoint, vin*/vout*, …).
|
|
4
|
-
import { Script, Spend, Utils, TransactionSignature, Hash } from "@bsv/sdk";
|
|
4
|
+
import { Script, Spend, Utils, TransactionSignature, Hash, UnlockingScript } from "@bsv/sdk";
|
|
5
5
|
const { Reader, Writer } = Utils;
|
|
6
|
-
|
|
6
|
+
const isPrivateKey = (x) => !!x && typeof x.toPublicKey === "function" && typeof x.sign === "function";
|
|
7
|
+
/** Normalise a PrivateKey or Signer to a Signer. */
|
|
8
|
+
export const toSigner = (x) => isPrivateKey(x)
|
|
9
|
+
? { publicKey: x.toPublicKey().encode(true), sign: (msg) => x.sign(msg) }
|
|
10
|
+
: x;
|
|
11
|
+
/** The recipient's compressed public key, whichever form it was given in. */
|
|
12
|
+
export const recipientPubKey = (r) => Array.isArray(r) ? r : isPrivateKey(r) ? r.toPublicKey().encode(true) : r.publicKey;
|
|
13
|
+
/** A Signer for the recipient if the caller controls its key (so the builder can spend the token on a
|
|
14
|
+
* later hop); undefined when only a public key was given (the token has left this holder). */
|
|
15
|
+
export const recipientSigner = (r) => Array.isArray(r) ? undefined : toSigner(r);
|
|
16
|
+
/**
|
|
17
|
+
* Verify every input of a tx with the @bsv/sdk Spend engine. THROWS on any failure (a missing source or unlocking
|
|
18
|
+
* script, a failing script - `Spend.validate()` throws rather than returning false - an output with no amount, or
|
|
19
|
+
* outputs worth more than inputs unless `skipOutputCheck`), so when it returns, `valid` is always `true`. The
|
|
20
|
+
* `{ valid, scriptExecutions }` shape is kept for existing callers.
|
|
21
|
+
*/
|
|
7
22
|
export const verifyTx = (tx, skipOutputCheck = false) => {
|
|
8
23
|
let inputTotal = 0;
|
|
9
24
|
const txid = tx.id("hex");
|
|
@@ -13,6 +28,7 @@ export const verifyTx = (tx, skipOutputCheck = false) => {
|
|
|
13
28
|
if (typeof input.sourceTransaction !== "object") {
|
|
14
29
|
throw new Error(`Verification failed: input ${i} of ${txid} is missing its source transaction.`);
|
|
15
30
|
}
|
|
31
|
+
/* v8 ignore next 3 -- tx.id("hex") at the top of verifyTx already throws on an input with no unlocking script */
|
|
16
32
|
if (typeof input.unlockingScript !== "object") {
|
|
17
33
|
throw new Error(`Verification failed: input ${i} of ${txid} is missing its unlocking script.`);
|
|
18
34
|
}
|
|
@@ -30,15 +46,12 @@ export const verifyTx = (tx, skipOutputCheck = false) => {
|
|
|
30
46
|
transactionVersion: tx.version,
|
|
31
47
|
otherInputs,
|
|
32
48
|
unlockingScript: input.unlockingScript,
|
|
33
|
-
inputSequence: input.sequence
|
|
49
|
+
inputSequence: input.sequence ?? 0xffffffff,
|
|
34
50
|
inputIndex: i,
|
|
35
51
|
outputs: tx.outputs,
|
|
36
52
|
lockTime: tx.lockTime,
|
|
37
53
|
});
|
|
38
|
-
|
|
39
|
-
scriptExecutions.push({ spend, valid });
|
|
40
|
-
if (!valid)
|
|
41
|
-
return { valid: false, scriptExecutions };
|
|
54
|
+
scriptExecutions.push({ spend, valid: spend.validate() }); // throws on a failing script
|
|
42
55
|
}
|
|
43
56
|
let outputTotal = 0;
|
|
44
57
|
for (const out of tx.outputs) {
|
|
@@ -69,13 +82,48 @@ export const buildChangeOutput = (tx, outputIndex) => {
|
|
|
69
82
|
writer.write(scriptBin);
|
|
70
83
|
return writer.toArray();
|
|
71
84
|
};
|
|
72
|
-
// Sign a preimage (signs sha256(preimage); the engine double-hashes) -> checksig-format
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
// Sign a preimage (the signer signs sha256(preimage); the engine double-hashes) -> checksig-format
|
|
86
|
+
// sig + pubkey. Accepts a PrivateKey or a Signer; async because a Signer may be a remote wallet.
|
|
87
|
+
export const createSignature = async (signerOrKey, preimage, signatureScope) => {
|
|
88
|
+
const signer = toSigner(signerOrKey);
|
|
89
|
+
const rawSignature = await signer.sign(Hash.sha256(preimage));
|
|
75
90
|
const sig = new TransactionSignature(rawSignature.r, rawSignature.s, signatureScope);
|
|
76
91
|
const sigForScript = sig.toChecksigFormat();
|
|
77
|
-
|
|
78
|
-
|
|
92
|
+
return { sigForScript, pubkeyForScript: signer.publicKey };
|
|
93
|
+
};
|
|
94
|
+
// A P2PKH unlock driven by a Signer, for funding inputs the builder spends. Byte-identical to the SDK's
|
|
95
|
+
// P2PKH().unlock for a PrivateKey, but accepts a Signer so wallet-held funding works in the same pass.
|
|
96
|
+
export const p2pkhUnlock = (signerOrKey) => {
|
|
97
|
+
const signer = toSigner(signerOrKey);
|
|
98
|
+
const scope = TransactionSignature.SIGHASH_FORKID | TransactionSignature.SIGHASH_ALL;
|
|
99
|
+
return {
|
|
100
|
+
sign: async (tx, inputIndex) => {
|
|
101
|
+
const input = tx.inputs[inputIndex];
|
|
102
|
+
const src = input.sourceTransaction?.outputs[input.sourceOutputIndex];
|
|
103
|
+
const sourceTXID = input.sourceTXID ?? input.sourceTransaction?.id("hex");
|
|
104
|
+
if (!sourceTXID || !src)
|
|
105
|
+
throw new Error("p2pkhUnlock requires the input's source transaction");
|
|
106
|
+
const preimage = TransactionSignature.format({
|
|
107
|
+
sourceTXID,
|
|
108
|
+
sourceOutputIndex: input.sourceOutputIndex,
|
|
109
|
+
sourceSatoshis: src.satoshis,
|
|
110
|
+
transactionVersion: tx.version,
|
|
111
|
+
otherInputs: tx.inputs.filter((_, i) => i !== inputIndex),
|
|
112
|
+
inputIndex,
|
|
113
|
+
outputs: tx.outputs,
|
|
114
|
+
inputSequence: input.sequence,
|
|
115
|
+
subscript: src.lockingScript,
|
|
116
|
+
lockTime: tx.lockTime,
|
|
117
|
+
scope,
|
|
118
|
+
});
|
|
119
|
+
const { sigForScript, pubkeyForScript } = await createSignature(signer, preimage, scope);
|
|
120
|
+
return new UnlockingScript([
|
|
121
|
+
{ op: sigForScript.length, data: sigForScript },
|
|
122
|
+
{ op: pubkeyForScript.length, data: pubkeyForScript },
|
|
123
|
+
]);
|
|
124
|
+
},
|
|
125
|
+
estimateLength: async () => 108,
|
|
126
|
+
};
|
|
79
127
|
};
|
|
80
128
|
// Split a BIP143 preimage into header(104) + scriptCodeLen + unlockScriptCode + lockScriptCode +
|
|
81
129
|
// footer(52) + lockLen. unlockBytesLen = bytes of unlock-script-code prefix (2 for SimpleMultiBolt).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Transaction } from "@bsv/sdk";
|
|
2
|
+
export declare const NULL_OUTPOINT: readonly number[];
|
|
3
|
+
/** mintData is pushed with at most PUSHDATA1 (the covenant's canonical skip is capped there). */
|
|
4
|
+
export declare const MINT_DATA_MAX_BYTES = 255;
|
|
5
|
+
/** The 36-byte outpoint txid(LE) || vout(LE32). */
|
|
6
|
+
export declare const outpointOf: (tx: Transaction, vout: number) => number[];
|
|
7
|
+
export interface GenesisFieldInput {
|
|
8
|
+
/** The token tx this output's vin0 spends, or undefined for a mint. */
|
|
9
|
+
prevTx?: Transaction;
|
|
10
|
+
/** Which output of prevTx is that token. */
|
|
11
|
+
prevVoutIdx?: number;
|
|
12
|
+
/** Lock chunk index of parentOutpoint in this contract (FixedBolt/OpenBolt 10, SerialBolt 5). */
|
|
13
|
+
parentIdx: number;
|
|
14
|
+
/** OpenBolt merge commit: re-root to vin0's token outpoint. */
|
|
15
|
+
reroot?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Field 0 (genesis / LMG) for a new token output. */
|
|
18
|
+
export declare function genesisFieldFor({ prevTx, prevVoutIdx, parentIdx, reroot }: GenesisFieldInput): number[];
|
|
19
|
+
/** Field 1 (mintData) for a new token output: the issuer's bytes on the mint, empty (OP_0) after. */
|
|
20
|
+
export declare function mintDataFor(isMint: boolean, mintData?: number[]): number[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// genesis.ts
|
|
2
|
+
// The two leading lock pushes of the genesis family (FixedBolt, OpenBolt, SerialBolt; genesis layout v3):
|
|
3
|
+
//
|
|
4
|
+
// field 0 genesisOutpoint (FixedBolt, SerialBolt) | lastMergeOrGenesisOutpoint (OpenBolt), 36 bytes
|
|
5
|
+
// - the MINT output carries a null (36 zero bytes) field;
|
|
6
|
+
// - the GENESIS SPEND (the first spend of the mint) writes the mint outpoint it spends;
|
|
7
|
+
// - OpenBolt only: a MERGE COMMIT re-roots it to vin0's token outpoint (which is also the merge
|
|
8
|
+
// output's parentOutpoint);
|
|
9
|
+
// - every other hop copies it unchanged.
|
|
10
|
+
// field 1 mintData: the issuer's bytes (0..255) on the MINT only; OP_0 on every later output.
|
|
11
|
+
//
|
|
12
|
+
// The covenant enforces each rule; this computes the values a builder must write (the same rules the
|
|
13
|
+
// sibling toolchain's simulator stamps onto its reference chains).
|
|
14
|
+
import { Utils } from "@bsv/sdk";
|
|
15
|
+
export const NULL_OUTPOINT = Object.freeze(new Array(36).fill(0x00));
|
|
16
|
+
/** mintData is pushed with at most PUSHDATA1 (the covenant's canonical skip is capped there). */
|
|
17
|
+
export const MINT_DATA_MAX_BYTES = 255;
|
|
18
|
+
/** The 36-byte outpoint txid(LE) || vout(LE32). */
|
|
19
|
+
export const outpointOf = (tx, vout) => {
|
|
20
|
+
const w = new Utils.Writer();
|
|
21
|
+
w.write(tx.hash());
|
|
22
|
+
w.writeUInt32LE(vout);
|
|
23
|
+
return w.toArray();
|
|
24
|
+
};
|
|
25
|
+
const isNull = (b) => !b || b.length === 0 || b.every((x) => x === 0);
|
|
26
|
+
/** Field 0 (genesis / LMG) for a new token output. */
|
|
27
|
+
export function genesisFieldFor({ prevTx, prevVoutIdx = 0, parentIdx, reroot = false }) {
|
|
28
|
+
if (!prevTx)
|
|
29
|
+
return [...NULL_OUTPOINT]; // the mint
|
|
30
|
+
const prevLock = prevTx.outputs[prevVoutIdx].lockingScript;
|
|
31
|
+
const prevParent = prevLock.chunks[parentIdx]?.data;
|
|
32
|
+
if (isNull(prevParent))
|
|
33
|
+
return outpointOf(prevTx, prevVoutIdx); // genesis spend: the mint outpoint it spends
|
|
34
|
+
if (reroot)
|
|
35
|
+
return outpointOf(prevTx, prevVoutIdx); // OpenBolt merge commit: vin0's token outpoint
|
|
36
|
+
return [...prevLock.chunks[0].data]; // copied (a genesis-family token always carries the 36-byte field)
|
|
37
|
+
}
|
|
38
|
+
/** Field 1 (mintData) for a new token output: the issuer's bytes on the mint, empty (OP_0) after. */
|
|
39
|
+
export function mintDataFor(isMint, mintData = []) {
|
|
40
|
+
if (!isMint)
|
|
41
|
+
return [];
|
|
42
|
+
if (mintData.length > MINT_DATA_MAX_BYTES)
|
|
43
|
+
throw new Error(`mintData is ${mintData.length} bytes; at most ${MINT_DATA_MAX_BYTES} (PUSHDATA1)`);
|
|
44
|
+
return [...mintData];
|
|
45
|
+
}
|
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import { Transaction } from "@bsv/sdk";
|
|
2
|
+
/** How a fungible contract lays out its scriptSig ancestor pieces and its lock pushes. */
|
|
3
|
+
export interface MultiLayout {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
/** Ancestor piece names, per ancestor (TxA then TxB use the same list). */
|
|
6
|
+
readonly pieces: readonly string[];
|
|
7
|
+
/** Leading lock pushes before the SimpleMultiBolt fields (0 for SMB, 2 for the genesis family). */
|
|
8
|
+
readonly leading: number;
|
|
9
|
+
}
|
|
10
|
+
/** Unlock chunk index where a token spend's own (current-tx) args start = 2 x pieces. */
|
|
11
|
+
export declare const skipOf: (l: MultiLayout) => number;
|
|
12
|
+
/** Unlock chunk index of ctxHeader: skip + 5 interop + fund, change, pkh1, pkh2, nextBalanceCommit,
|
|
13
|
+
* nextTxoType, inputIndexN, sig, pubKey. */
|
|
14
|
+
export declare const args2ctxOf: (l: MultiLayout) => number;
|
|
15
|
+
/** Lock chunk index of txoType. */
|
|
16
|
+
export declare const txoTypeIdxOf: (l: MultiLayout) => number;
|
|
2
17
|
export declare const PIECE_NAMES: string[];
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
18
|
+
export declare const SIMPLE_MULTI_LAYOUT: MultiLayout;
|
|
19
|
+
/** FixedBolt: + the ancestor spent token's mintData after each CTXHeader (74 pieces, skip 148). */
|
|
20
|
+
export declare const FIXED_BOLT_LAYOUT: MultiLayout;
|
|
21
|
+
/** OpenBolt: + each spent token's LMG before its mintData, and the rebuilt output's LMG (77 pieces, skip 154). */
|
|
22
|
+
export declare const OPEN_BOLT_LAYOUT: MultiLayout;
|
|
23
|
+
export declare const ancestorPiece: (name: string, tx: Transaction, layout?: MultiLayout) => number[];
|
|
24
|
+
export declare const createEmptyFungibleAncestorChunksSMB: (layout?: MultiLayout) => any[];
|