@neuraiproject/neurai-scripts 0.3.0 → 0.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"NeuraiScripts.global.js","sources":["../build/core/bytes.js","../build/core/opcodes.js","../build/core/script-builder.js","../build/standard/p2pkh.js","../build/standard/p2wpkh.js","../build/standard/p2wsh.js","../build/standard/authscript.js","../build/standard/nulldata.js","../build/standard/multisig.js","../node_modules/@neuraiproject/neurai-create-transaction/dist/index.js","../build/address.js","../build/asset-wrapper.js","../build/covenants/partial-fill/script.js","../build/covenants/partial-fill/script-pq.js","../build/covenants/partial-fill/spend.js","../build/covenants/partial-fill/spend-pq.js","../build/core/script-parser.js","../build/covenants/partial-fill/parse.js","../build/covenants/partial-fill/parse-pq.js","../build/index.js","../build/entries/global.js"],"sourcesContent":["/**\n * Minimal byte helpers. A subset of what `neurai-create-transaction` exposes,\n * duplicated here to keep this package free of runtime coupling beyond its\n * declared `dependencies` field. All sizes are little-endian, per Neurai.\n */\nexport function ensureHex(hex, label = 'hex') {\n const normalized = String(hex || '').trim().toLowerCase();\n if (!/^[0-9a-f]*$/.test(normalized) || normalized.length % 2 !== 0) {\n throw new Error(`Invalid ${label}: expected even-length hex string`);\n }\n return normalized;\n}\nexport function hexToBytes(hex) {\n const normalized = ensureHex(hex);\n const bytes = new Uint8Array(normalized.length / 2);\n for (let i = 0; i < normalized.length; i += 2) {\n bytes[i / 2] = Number.parseInt(normalized.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function bytesToHex(bytes) {\n return Array.from(bytes, (value) => value.toString(16).padStart(2, '0')).join('');\n}\nexport function concatBytes(...parts) {\n const total = parts.reduce((sum, part) => sum + part.length, 0);\n const out = new Uint8Array(total);\n let offset = 0;\n for (const part of parts) {\n out.set(part, offset);\n offset += part.length;\n }\n return out;\n}\nexport function bytesEqual(a, b) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i += 1) {\n if (a[i] !== b[i])\n return false;\n }\n return true;\n}\n","/**\n * Opcode constants for Neurai Script.\n *\n * Covers:\n * - Classic Script opcodes used by covenants.\n * - New opcodes activated in the `DePIN-Test` branch (BIP 119, BIP 347 and\n * Neurai-specific introspection / asset / arithmetic additions).\n *\n * Authority: `src/script/script.h` (enum `opcodetype`) in the Neurai repo.\n * Reference: `doc/new-opcodes-depin-branch.md`.\n *\n * Disabled in consensus and intentionally omitted: OP_SUBSTR, OP_LEFT,\n * OP_RIGHT, OP_INVERT, OP_AND, OP_OR, OP_XOR, OP_2MUL, OP_2DIV, OP_LSHIFT,\n * OP_RSHIFT. Also omitted: OP_VER / OP_VERIF / OP_VERNOTIF (reserved), the\n * template-matching pseudo-opcodes (OP_SMALLINTEGER, OP_PUBKEYS,\n * OP_PUBKEYHASH, OP_PUBKEY) and OP_INVALIDOPCODE.\n */\n// ---------- Push values ----------\nexport const OP_0 = 0x00;\nexport const OP_FALSE = OP_0;\nexport const OP_PUSHDATA1 = 0x4c;\nexport const OP_PUSHDATA2 = 0x4d;\nexport const OP_PUSHDATA4 = 0x4e;\nexport const OP_1NEGATE = 0x4f;\nexport const OP_RESERVED = 0x50;\nexport const OP_1 = 0x51;\nexport const OP_TRUE = OP_1;\nexport const OP_2 = 0x52;\nexport const OP_3 = 0x53;\nexport const OP_4 = 0x54;\nexport const OP_5 = 0x55;\nexport const OP_6 = 0x56;\nexport const OP_7 = 0x57;\nexport const OP_8 = 0x58;\nexport const OP_9 = 0x59;\nexport const OP_10 = 0x5a;\nexport const OP_11 = 0x5b;\nexport const OP_12 = 0x5c;\nexport const OP_13 = 0x5d;\nexport const OP_14 = 0x5e;\nexport const OP_15 = 0x5f;\nexport const OP_16 = 0x60;\n// ---------- Control flow ----------\nexport const OP_NOP = 0x61;\nexport const OP_IF = 0x63;\nexport const OP_NOTIF = 0x64;\nexport const OP_ELSE = 0x67;\nexport const OP_ENDIF = 0x68;\nexport const OP_VERIFY = 0x69;\nexport const OP_RETURN = 0x6a;\n// ---------- Stack ----------\nexport const OP_TOALTSTACK = 0x6b;\nexport const OP_FROMALTSTACK = 0x6c;\nexport const OP_2DROP = 0x6d;\nexport const OP_2DUP = 0x6e;\nexport const OP_3DUP = 0x6f;\nexport const OP_2OVER = 0x70;\nexport const OP_2ROT = 0x71;\nexport const OP_2SWAP = 0x72;\nexport const OP_IFDUP = 0x73;\nexport const OP_DEPTH = 0x74;\nexport const OP_DROP = 0x75;\nexport const OP_DUP = 0x76;\nexport const OP_NIP = 0x77;\nexport const OP_OVER = 0x78;\nexport const OP_PICK = 0x79;\nexport const OP_ROLL = 0x7a;\nexport const OP_ROT = 0x7b;\nexport const OP_SWAP = 0x7c;\nexport const OP_TUCK = 0x7d;\n// ---------- Splice ----------\nexport const OP_SIZE = 0x82;\n// ---------- Bitwise / comparison ----------\nexport const OP_EQUAL = 0x87;\nexport const OP_EQUALVERIFY = 0x88;\n// ---------- Unary numeric ----------\nexport const OP_1ADD = 0x8b;\nexport const OP_1SUB = 0x8c;\nexport const OP_NEGATE = 0x8f;\nexport const OP_ABS = 0x90;\nexport const OP_NOT = 0x91;\nexport const OP_0NOTEQUAL = 0x92;\n// ---------- Arithmetic (64-bit after SCRIPT_VERIFY_64BIT_INTEGERS) ----------\nexport const OP_ADD = 0x93;\nexport const OP_SUB = 0x94;\nexport const OP_MUL = 0x95;\nexport const OP_DIV = 0x96;\nexport const OP_MOD = 0x97;\n// ---------- Boolean / numeric comparison ----------\nexport const OP_BOOLAND = 0x9a;\nexport const OP_BOOLOR = 0x9b;\nexport const OP_NUMEQUAL = 0x9c;\nexport const OP_NUMEQUALVERIFY = 0x9d;\nexport const OP_NUMNOTEQUAL = 0x9e;\nexport const OP_LESSTHAN = 0x9f;\nexport const OP_GREATERTHAN = 0xa0;\nexport const OP_LESSTHANOREQUAL = 0xa1;\nexport const OP_GREATERTHANOREQUAL = 0xa2;\nexport const OP_MIN = 0xa3;\nexport const OP_MAX = 0xa4;\nexport const OP_WITHIN = 0xa5;\n// ---------- Crypto ----------\nexport const OP_RIPEMD160 = 0xa6;\nexport const OP_SHA1 = 0xa7;\nexport const OP_SHA256 = 0xa8;\nexport const OP_HASH160 = 0xa9;\nexport const OP_HASH256 = 0xaa;\nexport const OP_CODESEPARATOR = 0xab;\nexport const OP_CHECKSIG = 0xac;\nexport const OP_CHECKSIGVERIFY = 0xad;\nexport const OP_CHECKMULTISIG = 0xae;\nexport const OP_CHECKMULTISIGVERIFY = 0xaf;\n// ---------- Expansion / NOPs ----------\n// Only the NOPs not aliased by DePIN-Test opcodes are exported as NOPs.\n// OP_NOP2 == OP_CHECKLOCKTIMEVERIFY (0xb1)\n// OP_NOP3 == OP_CHECKSEQUENCEVERIFY (0xb2)\n// OP_NOP4 == OP_CHECKTEMPLATEVERIFY (0xb3)\n// OP_NOP5 == OP_CHECKSIGFROMSTACK (0xb4)\n// OP_NOP6 == OP_TXHASH (0xb5)\n// OP_NOP7 == OP_TXFIELD (0xb6)\n// OP_NOP8 == OP_SPLIT (0xb7)\nexport const OP_NOP1 = 0xb0;\nexport const OP_NOP9 = 0xb8;\nexport const OP_NOP10 = 0xb9;\n// ---------- Locktime ----------\nexport const OP_CHECKLOCKTIMEVERIFY = 0xb1;\nexport const OP_CHECKSEQUENCEVERIFY = 0xb2;\n// ---------- Covenants & templates (DePIN-Test) ----------\nexport const OP_CHECKTEMPLATEVERIFY = 0xb3; // BIP 119\nexport const OP_CHECKSIGFROMSTACK = 0xb4;\n// ---------- Transaction introspection (DePIN-Test) ----------\nexport const OP_TXHASH = 0xb5;\nexport const OP_TXFIELD = 0xb6;\nexport const OP_TXLOCKTIME = 0xc5;\nexport const OP_OUTPUTVALUE = 0xcc;\nexport const OP_OUTPUTSCRIPT = 0xcd;\nexport const OP_INPUTCOUNT = 0xd0;\nexport const OP_OUTPUTCOUNT = 0xd1;\n// ---------- Asset introspection (DePIN-Test) ----------\nexport const OP_OUTPUTASSETFIELD = 0xce;\nexport const OP_INPUTASSETFIELD = 0xcf;\nexport const OP_XNA_ASSET = 0xc0;\n// ---------- Reference inputs (DePIN-Test, NIP-017) ----------\nexport const OP_REFINPUTFIELD = 0xd2;\nexport const OP_REFINPUTASSETFIELD = 0xd3;\nexport const OP_REFINPUTCOUNT = 0xd4;\n// ---------- Byte manipulation (DePIN-Test) ----------\nexport const OP_CAT = 0x7e;\nexport const OP_SPLIT = 0xb7;\nexport const OP_REVERSEBYTES = 0xbc;\n// ---------- Selectors for OP_TXFIELD / OP_REFINPUTFIELD ----------\n// Both opcodes share the same selector table (OP_TXFIELD on the spent UTXO,\n// OP_REFINPUTFIELD on an output referenced via vrefin). Valid: 0x01..0x03.\nexport const TXFIELD_VALUE = 0x01;\nexport const TXFIELD_AUTHSCRIPT_COMMITMENT = 0x02;\nexport const TXFIELD_SCRIPTPUBKEY = 0x03;\n// ---------- Bitmask selectors for OP_TXHASH ----------\n// The selector is a single byte where each bit selects which transaction\n// field to include in the double-SHA256. Selector 0x00 is invalid; any\n// non-zero combination is valid. 0xff = all eight fields.\nexport const TXHASH_VERSION = 0x01;\nexport const TXHASH_LOCKTIME = 0x02;\nexport const TXHASH_INPUT_PREVOUTS = 0x04;\nexport const TXHASH_INPUT_SEQUENCES = 0x08;\nexport const TXHASH_OUTPUTS = 0x10;\nexport const TXHASH_CURRENT_PREVOUT = 0x20;\nexport const TXHASH_CURRENT_SEQUENCE = 0x40;\nexport const TXHASH_CURRENT_INDEX = 0x80;\nexport const TXHASH_ALL = 0xff;\n// ---------- Selectors for OP_OUTPUTASSETFIELD / OP_INPUTASSETFIELD / OP_REFINPUTASSETFIELD ----------\n// All three opcodes share the same selector table. Valid range: 0x01..0x07.\n// Selector 0x05 is the boolean \"has IPFS\" flag; 0x06 is the IPFS hash\n// payload; 0x07 is the asset operation type. (This matches the asset-op\n// encoding in `src/assets/assets.cpp` and the NIP spec §3.1.)\nexport const ASSETFIELD_NAME = 0x01;\nexport const ASSETFIELD_AMOUNT = 0x02;\nexport const ASSETFIELD_UNITS = 0x03;\nexport const ASSETFIELD_REISSUABLE = 0x04;\nexport const ASSETFIELD_HAS_IPFS = 0x05;\nexport const ASSETFIELD_IPFS_HASH = 0x06;\nexport const ASSETFIELD_TYPE = 0x07;\n","/**\n * Low-level Script assembler. Emits the exact byte layout expected by the\n * Neurai interpreter: pushdata prefixes follow the same rules as Bitcoin\n * (direct push for 1..75 bytes, OP_PUSHDATA1/2/4 otherwise), and integers\n * are minimally-encoded as CScriptNum.\n */\nimport { bytesToHex, concatBytes, hexToBytes } from './bytes.js';\nimport { OP_0, OP_1NEGATE, OP_1 } from './opcodes.js';\n/**\n * Minimal CScriptNum encoding (Bitcoin consensus rules).\n *\n * - 0 → empty vector\n * - 1..16 → single opcode OP_1..OP_16 (handled in `pushInt`, not here)\n * - -1 → OP_1NEGATE (handled in `pushInt`)\n * - otherwise: sign-magnitude little-endian, with a sign bit on the last byte\n */\nexport function encodeScriptNum(value) {\n let n = typeof value === 'bigint' ? value : BigInt(value);\n if (n === 0n)\n return new Uint8Array();\n const negative = n < 0n;\n if (negative)\n n = -n;\n const result = [];\n while (n > 0n) {\n result.push(Number(n & 0xffn));\n n >>= 8n;\n }\n // If the most-significant bit is set, add a padding byte so the sign bit\n // is unambiguous. If negative, flip that sign bit instead.\n if (result[result.length - 1] & 0x80) {\n result.push(negative ? 0x80 : 0x00);\n }\n else if (negative) {\n result[result.length - 1] |= 0x80;\n }\n return Uint8Array.from(result);\n}\n/**\n * Emit a pushdata opcode followed by the payload. Chooses the shortest\n * valid encoding.\n *\n * Neurai Script caps stack elements at `MAX_SCRIPT_ELEMENT_SIZE = 520`\n * bytes by default, but NIP-18 raises the cap to\n * `MAX_PQ_SCRIPT_ELEMENT_SIZE = 3072` whenever\n * `SCRIPT_VERIFY_CHECKSIGFROMSTACK` is active (testnet today, mainnet once\n * the CSFS fork lands). The builder here emits pushes up to 3072 bytes so\n * it can target either regime; legacy scripts should stay under 520 bytes\n * per push, and the node will reject anything larger if the CSFS flag is\n * not set during evaluation.\n */\nexport function pushBytes(data) {\n if (data.length === 0) {\n return Uint8Array.of(OP_0);\n }\n if (data.length <= 75) {\n return concatBytes(Uint8Array.of(data.length), data);\n }\n if (data.length <= 0xff) {\n return concatBytes(Uint8Array.of(0x4c, data.length), data);\n }\n if (data.length <= 3072) {\n return concatBytes(Uint8Array.of(0x4d, data.length & 0xff, (data.length >> 8) & 0xff), data);\n }\n throw new Error(`pushBytes: element of ${data.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (3072)`);\n}\n/**\n * Emit a minimally-encoded integer push. Uses OP_1NEGATE, OP_0 and OP_1..OP_16\n * when available to match how the node's own templates look on the wire.\n */\nexport function pushInt(value) {\n const n = typeof value === 'bigint' ? value : BigInt(value);\n if (n === -1n)\n return Uint8Array.of(OP_1NEGATE);\n if (n === 0n)\n return Uint8Array.of(OP_0);\n if (n >= 1n && n <= 16n) {\n return Uint8Array.of(OP_1 + Number(n) - 1);\n }\n return pushBytes(encodeScriptNum(n));\n}\nexport function pushHex(hex) {\n return pushBytes(hexToBytes(hex));\n}\n/** Fluent assembler for readable script definitions. */\nexport class ScriptBuilder {\n parts = [];\n op(...opcodes) {\n for (const op of opcodes) {\n if (!Number.isInteger(op) || op < 0 || op > 0xff) {\n throw new Error(`Invalid opcode byte: ${op}`);\n }\n this.parts.push(Uint8Array.of(op));\n }\n return this;\n }\n pushInt(value) {\n this.parts.push(pushInt(value));\n return this;\n }\n pushBytes(data) {\n this.parts.push(pushBytes(data));\n return this;\n }\n pushHex(hex) {\n this.parts.push(pushHex(hex));\n return this;\n }\n raw(bytes) {\n this.parts.push(bytes);\n return this;\n }\n build() {\n return concatBytes(...this.parts);\n }\n buildHex() {\n return bytesToHex(this.build());\n }\n}\n","/**\n * Pay-to-Public-Key-Hash (P2PKH) scriptPubKey.\n * Layout: OP_DUP OP_HASH160 0x14 <20-byte PKH> OP_EQUALVERIFY OP_CHECKSIG\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, OP_HASH160 } from '../core/opcodes.js';\nexport function encodeP2PKHScriptPubKey(pubKeyHash) {\n if (!(pubKeyHash instanceof Uint8Array) || pubKeyHash.length !== 20) {\n throw new Error('P2PKH pubKeyHash must be a 20-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_DUP, OP_HASH160, 0x14), pubKeyHash, Uint8Array.of(OP_EQUALVERIFY, OP_CHECKSIG));\n}\n","/**\n * Native segwit v0 Pay-to-Witness-Public-Key-Hash (P2WPKH) scriptPubKey.\n * Layout: OP_0 0x14 <20-byte HASH160(pubKey)>\n *\n * Callers compute HASH160 externally (e.g. via neurai-key / their crypto\n * stack). This helper only encodes the scriptPubKey once the hash is known.\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { OP_0 } from '../core/opcodes.js';\nexport function encodeP2WPKHScriptPubKey(pubKeyHash) {\n if (!(pubKeyHash instanceof Uint8Array) || pubKeyHash.length !== 20) {\n throw new Error('P2WPKH pubKeyHash must be a 20-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_0, 0x14), pubKeyHash);\n}\n","/**\n * Native segwit v0 Pay-to-Witness-Script-Hash (P2WSH) scriptPubKey.\n * Layout: OP_0 0x20 <32-byte SHA256(witnessScript)>\n *\n * This helper takes the SHA256 digest of the witness script directly. The\n * SHA256 is computed externally by the caller's crypto stack (kept out of\n * this library to avoid a hash dependency).\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { OP_0 } from '../core/opcodes.js';\nexport function encodeP2WSHScriptPubKey(witnessScriptSha256) {\n if (!(witnessScriptSha256 instanceof Uint8Array) || witnessScriptSha256.length !== 32) {\n throw new Error('P2WSH witnessScriptSha256 must be a 32-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_0, 0x20), witnessScriptSha256);\n}\n","/**\n * AuthScript (witness v1) scriptPubKey + witness-stack builders.\n *\n * AuthScript outputs encode a 32-byte commitment in a witness v1 program:\n * scriptPubKey = OP_1 0x20 <32-byte program>\n *\n * The program is `HASH160`/`SHA256` over a descriptor that depends on the\n * `auth_type` byte carried as the first witness-stack element at spend time.\n * This library only assembles the stack; computing the descriptor/commitment\n * and producing the signature live in neurai-key / neurai-sign-transaction.\n *\n * Auth type values (authoritative: Neurai `src/script/interpreter.cpp`,\n * cross-checked against `lib/neurai-key/src/shared/address.ts`):\n *\n * 0x00 NoAuth — no signature; spend gated only by witnessScript\n * 0x01 PQ — ML-DSA-44 signature (post-quantum)\n * 0x02 Legacy — secp256k1 ECDSA signature (classic)\n * 0x03 RefScript — NIP-015 reference-script spend (future)\n *\n * Witness stack (exact order consumed by the interpreter):\n * [ auth_type, sig, pubkey, arg0, ..., argN, witnessScript ]\n *\n * NoAuth and RefScript spends omit the `sig`/`pubkey` items.\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { OP_1 } from '../core/opcodes.js';\nexport const AUTHSCRIPT_NOAUTH = 0x00;\nexport const AUTHSCRIPT_PQ = 0x01;\nexport const AUTHSCRIPT_LEGACY = 0x02;\n/** NIP-015: reference-script spend mode. Not yet activated in consensus. */\nexport const AUTHSCRIPT_REF = 0x03;\n/** Cap for PQ signature / pubkey pushes under NIP-018 (3072 B). */\nconst MAX_PQ_PUSH = 3072;\nexport function encodeAuthScriptScriptPubKey(program) {\n if (!(program instanceof Uint8Array) || program.length !== 32) {\n throw new Error('AuthScript program must be a 32-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_1, 0x20), program);\n}\nfunction assertWitnessScript(ws) {\n if (!(ws instanceof Uint8Array) || ws.length === 0) {\n throw new Error('witnessScript must be a non-empty Uint8Array');\n }\n}\nfunction assertArgs(args) {\n if (args == null)\n return;\n if (!Array.isArray(args)) {\n throw new Error('args must be an array of Uint8Array');\n }\n for (let i = 0; i < args.length; i += 1) {\n if (!(args[i] instanceof Uint8Array)) {\n throw new Error(`args[${i}] must be a Uint8Array`);\n }\n }\n}\n/**\n * Build the witness stack for a legacy ECDSA AuthScript spend.\n *\n * Returns an array of raw stack elements. Serialization of the witness\n * (compact-size item count + per-item length-prefixes) is the caller's\n * responsibility — neurai-create-transaction handles it at tx-assembly time.\n */\nexport function buildAuthScriptWitnessLegacy(input) {\n if (!(input.signature instanceof Uint8Array) || input.signature.length === 0) {\n throw new Error('signature must be a non-empty Uint8Array');\n }\n if (!(input.pubKey instanceof Uint8Array) ||\n (input.pubKey.length !== 33 && input.pubKey.length !== 65)) {\n throw new Error('pubKey must be a compressed (33B) or uncompressed (65B) secp256k1 key');\n }\n assertArgs(input.args);\n assertWitnessScript(input.witnessScript);\n return [\n Uint8Array.of(AUTHSCRIPT_LEGACY),\n input.signature,\n input.pubKey,\n ...(input.args ?? []),\n input.witnessScript\n ];\n}\n/**\n * Build the witness stack for a PQ (ML-DSA-44) AuthScript spend.\n * NIP-018 must be active: both signature and pubKey are pushed as single\n * stack elements and may each be up to 3072 B.\n */\nexport function buildAuthScriptWitnessPQ(input) {\n if (!(input.signature instanceof Uint8Array) || input.signature.length === 0) {\n throw new Error('signature must be a non-empty Uint8Array');\n }\n if (input.signature.length > MAX_PQ_PUSH) {\n throw new Error(`signature of ${input.signature.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (${MAX_PQ_PUSH})`);\n }\n if (!(input.pubKey instanceof Uint8Array) || input.pubKey.length === 0) {\n throw new Error('pubKey must be a non-empty Uint8Array');\n }\n if (input.pubKey.length > MAX_PQ_PUSH) {\n throw new Error(`pubKey of ${input.pubKey.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (${MAX_PQ_PUSH})`);\n }\n assertArgs(input.args);\n assertWitnessScript(input.witnessScript);\n return [\n Uint8Array.of(AUTHSCRIPT_PQ),\n input.signature,\n input.pubKey,\n ...(input.args ?? []),\n input.witnessScript\n ];\n}\n/**\n * Build the witness stack for a NoAuth AuthScript spend. The spend is gated\n * by the witnessScript alone (covenants, hash-locks, time-locks, ...); no\n * signature or public key is carried.\n */\nexport function buildAuthScriptWitnessNoAuth(input) {\n assertArgs(input.args);\n assertWitnessScript(input.witnessScript);\n return [\n Uint8Array.of(AUTHSCRIPT_NOAUTH),\n ...(input.args ?? []),\n input.witnessScript\n ];\n}\n/**\n * Build the witness stack for a NIP-015 reference-script spend. The last\n * item is the 4-byte little-endian index into `tx.vrefin` that locates the\n * reference-script carrier output; the interpreter resolves the `refScript`\n * from that carrier at validation time.\n *\n * NOTE: NIP-015 is not yet activated in consensus. This builder emits the\n * spec-conformant witness for forward compatibility and testnet experiments.\n */\nexport function buildAuthScriptWitnessRef(input) {\n if (!Number.isInteger(input.refIndex) || input.refIndex < 0 || input.refIndex > 0xffffffff) {\n throw new Error('refIndex must be a uint32 (0 .. 2^32 - 1)');\n }\n assertArgs(input.args);\n const refLocator = new Uint8Array(4);\n const dv = new DataView(refLocator.buffer);\n dv.setUint32(0, input.refIndex, /* little-endian */ true);\n return [\n Uint8Array.of(AUTHSCRIPT_REF),\n ...(input.args ?? []),\n refLocator\n ];\n}\n","/**\n * Provably-unspendable OP_RETURN (null-data) output scripts.\n * Layout: OP_RETURN <push> [<push> ...]\n *\n * Neurai inherits the Bitcoin Core standard policy cap of 80 bytes of\n * payload for a relayed null-data output. Outputs over that cap are still\n * consensus-valid but will not be relayed by default mempool policy; use\n * the `allowNonStandard` option to opt in explicitly.\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { pushBytes } from '../core/script-builder.js';\nimport { OP_RETURN } from '../core/opcodes.js';\nexport const NULLDATA_STANDARD_MAX_SIZE = 80;\nexport function encodeNullDataScript(payload, options = {}) {\n const payloads = payload instanceof Uint8Array ? [payload] : payload;\n if (!Array.isArray(payloads) || payloads.length === 0) {\n throw new Error('payload must be a Uint8Array or a non-empty array of Uint8Array');\n }\n let totalPayload = 0;\n for (let i = 0; i < payloads.length; i += 1) {\n const p = payloads[i];\n if (!(p instanceof Uint8Array)) {\n throw new Error(`payload[${i}] must be a Uint8Array`);\n }\n totalPayload += p.length;\n }\n if (!options.allowNonStandard && totalPayload > NULLDATA_STANDARD_MAX_SIZE) {\n throw new Error(`nulldata payload of ${totalPayload} bytes exceeds standard cap ${NULLDATA_STANDARD_MAX_SIZE}; set allowNonStandard=true to override`);\n }\n const parts = [Uint8Array.of(OP_RETURN)];\n for (const p of payloads)\n parts.push(pushBytes(p));\n return concatBytes(...parts);\n}\n","/**\n * Classic bare m-of-n multisig via OP_CHECKMULTISIG, plus the P2SH wrapper\n * that is normally used in practice.\n *\n * redeemScript = <m> <pubkey_1> ... <pubkey_n> <n> OP_CHECKMULTISIG\n * P2SH spk = OP_HASH160 0x14 <HASH160(redeemScript)> OP_EQUAL\n *\n * OP_CHECKMULTISIG caps n at 20 pubkeys (see `MAX_PUBKEYS_PER_MULTISIG` in\n * the Neurai interpreter). Bare multisig outputs are still consensus-valid\n * but non-standard for relay; the P2SH wrapping is what mempool accepts.\n */\nimport { bytesToHex, concatBytes } from '../core/bytes.js';\nimport { pushBytes, pushInt } from '../core/script-builder.js';\nimport { OP_CHECKMULTISIG, OP_EQUAL, OP_HASH160 } from '../core/opcodes.js';\nexport const MULTISIG_MAX_PUBKEYS = 20;\nfunction assertPubKey(pk, idx) {\n if (!(pk instanceof Uint8Array) || (pk.length !== 33 && pk.length !== 65)) {\n throw new Error(`pubKey[${idx}] must be 33 or 65 bytes (got ${pk?.length})`);\n }\n}\nexport function encodeMultisigRedeemScript({ m, pubKeys }) {\n if (!Array.isArray(pubKeys) || pubKeys.length === 0) {\n throw new Error('pubKeys must be a non-empty array');\n }\n if (pubKeys.length > MULTISIG_MAX_PUBKEYS) {\n throw new Error(`pubKeys length ${pubKeys.length} exceeds OP_CHECKMULTISIG cap (${MULTISIG_MAX_PUBKEYS})`);\n }\n if (!Number.isInteger(m) || m < 1 || m > pubKeys.length) {\n throw new Error(`m must be an integer in [1, ${pubKeys.length}] (got ${m})`);\n }\n for (let i = 0; i < pubKeys.length; i += 1)\n assertPubKey(pubKeys[i], i);\n const parts = [pushInt(m)];\n for (const pk of pubKeys)\n parts.push(pushBytes(pk));\n parts.push(pushInt(pubKeys.length));\n parts.push(Uint8Array.of(OP_CHECKMULTISIG));\n return concatBytes(...parts);\n}\nexport function encodeMultisigRedeemScriptHex(params) {\n return bytesToHex(encodeMultisigRedeemScript(params));\n}\n/**\n * P2SH scriptPubKey wrapping any redeem script. Pass the 20-byte HASH160 of\n * the redeem script (RIPEMD160(SHA256(redeemScript))) — compute it\n * externally via the caller's crypto stack.\n */\nexport function encodeP2SHScriptPubKey(redeemScriptHash160) {\n if (!(redeemScriptHash160 instanceof Uint8Array) || redeemScriptHash160.length !== 20) {\n throw new Error('redeemScriptHash160 must be a 20-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_HASH160, 0x14), redeemScriptHash160, Uint8Array.of(OP_EQUAL));\n}\n","function ensureHex(hex, label = 'hex') {\n const normalized = String(hex || '').trim().toLowerCase();\n if (!/^[0-9a-f]*$/.test(normalized) || normalized.length % 2 !== 0) {\n throw new Error(`Invalid ${label}: expected even-length hex string`);\n }\n return normalized;\n}\nfunction hexToBytes(hex) {\n const normalized = ensureHex(hex);\n const bytes = new Uint8Array(normalized.length / 2);\n for (let i = 0; i < normalized.length; i += 2) {\n bytes[i / 2] = Number.parseInt(normalized.slice(i, i + 2), 16);\n }\n return bytes;\n}\nfunction bytesToHex(bytes) {\n return Array.from(bytes, (value) => value.toString(16).padStart(2, '0')).join('');\n}\nfunction concatBytes(...parts) {\n const total = parts.reduce((sum, part) => sum + part.length, 0);\n const out = new Uint8Array(total);\n let offset = 0;\n for (const part of parts) {\n out.set(part, offset);\n offset += part.length;\n }\n return out;\n}\nfunction asciiBytes(text) {\n return Uint8Array.from(Array.from(text, (char) => char.charCodeAt(0)));\n}\nfunction serializeString(text) {\n const bytes = asciiBytes(text);\n return concatBytes(compactSize(bytes.length), bytes);\n}\nfunction reverseBytes(bytes) {\n return Uint8Array.from(Array.from(bytes).reverse());\n}\nfunction u32LE(value) {\n if (!Number.isInteger(value) || value < 0 || value > 0xffffffff) {\n throw new Error(`uint32 out of range: ${value}`);\n }\n const out = new Uint8Array(4);\n const view = new DataView(out.buffer);\n view.setUint32(0, value, true);\n return out;\n}\nfunction u64LE(value) {\n const bigintValue = typeof value === 'bigint' ? value : BigInt(value);\n if (bigintValue < 0n || bigintValue > 0xffffffffffffffffn) {\n throw new Error(`uint64 out of range: ${bigintValue}`);\n }\n const out = new Uint8Array(8);\n let remaining = bigintValue;\n for (let i = 0; i < 8; i += 1) {\n out[i] = Number(remaining & 0xffn);\n remaining >>= 8n;\n }\n return out;\n}\nfunction i64LE(value) {\n const bigintValue = typeof value === 'bigint' ? value : BigInt(value);\n if (bigintValue < -0x8000000000000000n || bigintValue > 0x7fffffffffffffffn) {\n throw new Error(`int64 out of range: ${bigintValue}`);\n }\n const out = new Uint8Array(8);\n const view = new DataView(out.buffer);\n view.setBigInt64(0, bigintValue, true);\n return out;\n}\nfunction compactSize(value) {\n const bigintValue = typeof value === 'bigint' ? value : BigInt(value);\n if (bigintValue < 0n)\n throw new Error('CompactSize cannot encode negative numbers');\n if (bigintValue < 253n) {\n return Uint8Array.of(Number(bigintValue));\n }\n if (bigintValue <= 0xffffn) {\n return concatBytes(Uint8Array.of(0xfd), u16LE(Number(bigintValue)));\n }\n if (bigintValue <= 0xffffffffn) {\n return concatBytes(Uint8Array.of(0xfe), u32LE(Number(bigintValue)));\n }\n return concatBytes(Uint8Array.of(0xff), u64LE(bigintValue));\n}\nfunction u16LE(value) {\n if (!Number.isInteger(value) || value < 0 || value > 0xffff) {\n throw new Error(`uint16 out of range: ${value}`);\n }\n const out = new Uint8Array(2);\n const view = new DataView(out.buffer);\n view.setUint16(0, value, true);\n return out;\n}\nfunction pushData(data) {\n if (data.length > 0xffff) {\n throw new Error(`Pushdata too large for current implementation: ${data.length} bytes`);\n }\n if (data.length < 0x4c) {\n return concatBytes(Uint8Array.of(data.length), data);\n }\n if (data.length <= 0xff) {\n return concatBytes(Uint8Array.of(0x4c, data.length), data);\n }\n return concatBytes(Uint8Array.of(0x4d), u16LE(data.length), data);\n}\n\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfunction base (ALPHABET) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n const BASE_MAP = new Uint8Array(256);\n for (let j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (let i = 0; i < ALPHABET.length; i++) {\n const x = ALPHABET.charAt(i);\n const xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i;\n }\n const BASE = ALPHABET.length;\n const LEADER = ALPHABET.charAt(0);\n const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up\n const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up\n function encode (source) {\n // eslint-disable-next-line no-empty\n if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n let zeroes = 0;\n let length = 0;\n let pbegin = 0;\n const pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n // Allocate enough space in big-endian base58 representation.\n const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;\n const b58 = new Uint8Array(size);\n // Process the bytes.\n while (pbegin !== pend) {\n let carry = source[pbegin];\n // Apply \"b58 = b58 * 256 + ch\".\n let i = 0;\n for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0;\n b58[it1] = (carry % BASE) >>> 0;\n carry = (carry / BASE) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n pbegin++;\n }\n // Skip leading zeroes in base58 result.\n let it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n // Translate the result into a string.\n let str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n let psz = 0;\n // Skip and count leading '1's.\n let zeroes = 0;\n let length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n // Allocate enough space in big-endian base256 representation.\n const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.\n const b256 = new Uint8Array(size);\n // Process the characters.\n while (psz < source.length) {\n // Find code of next character\n const charCode = source.charCodeAt(psz);\n // Base map can not be indexed using char code\n if (charCode > 255) { return }\n // Decode character\n let carry = BASE_MAP[charCode];\n // Invalid character\n if (carry === 255) { return }\n let i = 0;\n for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0;\n b256[it3] = (carry % 256) >>> 0;\n carry = (carry / 256) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n psz++;\n }\n // Skip leading zeroes in b256.\n let it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n const vch = new Uint8Array(zeroes + (size - it4));\n let j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch\n }\n function decode (string) {\n const buffer = decodeUnsafe(string);\n if (buffer) { return buffer }\n throw new Error('Non-base' + BASE + ' character')\n }\n return {\n encode,\n decodeUnsafe,\n decode\n }\n}\n\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\nvar base58 = base(ALPHABET);\n\nconst IPFS_LENGTH = 0x20;\nconst TXID_PREFIX = 0x54;\nfunction encodeAssetDataReference(value) {\n const normalized = String(value || '').trim();\n if (!normalized) {\n return new Uint8Array();\n }\n if (normalized.startsWith('Qm') && normalized.length === 46) {\n const decoded = Uint8Array.from(base58.decode(normalized));\n if (decoded.length !== 34) {\n throw new Error(`Invalid CIDv0 length for asset data: ${decoded.length}`);\n }\n return decoded;\n }\n if (normalized.length === 64 && /^[0-9a-fA-F]+$/.test(normalized)) {\n const txidBytes = hexToBytes(normalized);\n return Uint8Array.of(TXID_PREFIX, IPFS_LENGTH, ...txidBytes);\n }\n if (normalized.length === 68 && /^[0-9a-fA-F]+$/.test(normalized)) {\n const raw = hexToBytes(normalized);\n if (raw[1] !== IPFS_LENGTH) {\n throw new Error('Invalid raw asset data reference length prefix');\n }\n return raw;\n }\n throw new Error('Unsupported asset data reference. Expected CIDv0 (Qm...), 64-char txid, or 68-char raw hex');\n}\nfunction decodeAssetDataReferenceHex(value) {\n return bytesToHex(encodeAssetDataReference(value));\n}\nfunction isEncodedAssetDataReferenceHex(hex) {\n const normalized = ensureHex(hex);\n return normalized.length === 68 || normalized.length === 0;\n}\nfunction isCidV0AssetReference(value) {\n const normalized = String(value || '').trim();\n return normalized.startsWith('Qm') && normalized.length === 46;\n}\nfunction isTxidAssetReference(value) {\n const normalized = String(value || '').trim();\n return normalized.length === 64 && /^[0-9a-fA-F]+$/.test(normalized);\n}\nfunction isRawAssetDataReferenceHex(value) {\n const normalized = String(value || '').trim();\n return normalized.length === 68 && /^[0-9a-fA-F]+$/.test(normalized);\n}\nfunction formatAssetDataReferenceHex(value) {\n return bytesToHex(encodeAssetDataReference(value));\n}\n\nvar dist = {};\n\nvar hasRequiredDist;\n\nfunction requireDist () {\n\tif (hasRequiredDist) return dist;\n\thasRequiredDist = 1;\n\tObject.defineProperty(dist, \"__esModule\", { value: true });\n\tdist.bech32m = dist.bech32 = void 0;\n\tconst ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';\n\tconst ALPHABET_MAP = {};\n\tfor (let z = 0; z < ALPHABET.length; z++) {\n\t const x = ALPHABET.charAt(z);\n\t ALPHABET_MAP[x] = z;\n\t}\n\tfunction polymodStep(pre) {\n\t const b = pre >> 25;\n\t return (((pre & 0x1ffffff) << 5) ^\n\t (-((b >> 0) & 1) & 0x3b6a57b2) ^\n\t (-((b >> 1) & 1) & 0x26508e6d) ^\n\t (-((b >> 2) & 1) & 0x1ea119fa) ^\n\t (-((b >> 3) & 1) & 0x3d4233dd) ^\n\t (-((b >> 4) & 1) & 0x2a1462b3));\n\t}\n\tfunction prefixChk(prefix) {\n\t let chk = 1;\n\t for (let i = 0; i < prefix.length; ++i) {\n\t const c = prefix.charCodeAt(i);\n\t if (c < 33 || c > 126)\n\t return 'Invalid prefix (' + prefix + ')';\n\t chk = polymodStep(chk) ^ (c >> 5);\n\t }\n\t chk = polymodStep(chk);\n\t for (let i = 0; i < prefix.length; ++i) {\n\t const v = prefix.charCodeAt(i);\n\t chk = polymodStep(chk) ^ (v & 0x1f);\n\t }\n\t return chk;\n\t}\n\tfunction convert(data, inBits, outBits, pad) {\n\t let value = 0;\n\t let bits = 0;\n\t const maxV = (1 << outBits) - 1;\n\t const result = [];\n\t for (let i = 0; i < data.length; ++i) {\n\t value = (value << inBits) | data[i];\n\t bits += inBits;\n\t while (bits >= outBits) {\n\t bits -= outBits;\n\t result.push((value >> bits) & maxV);\n\t }\n\t }\n\t if (pad) {\n\t if (bits > 0) {\n\t result.push((value << (outBits - bits)) & maxV);\n\t }\n\t }\n\t else {\n\t if (bits >= inBits)\n\t return 'Excess padding';\n\t if ((value << (outBits - bits)) & maxV)\n\t return 'Non-zero padding';\n\t }\n\t return result;\n\t}\n\tfunction toWords(bytes) {\n\t return convert(bytes, 8, 5, true);\n\t}\n\tfunction fromWordsUnsafe(words) {\n\t const res = convert(words, 5, 8, false);\n\t if (Array.isArray(res))\n\t return res;\n\t}\n\tfunction fromWords(words) {\n\t const res = convert(words, 5, 8, false);\n\t if (Array.isArray(res))\n\t return res;\n\t throw new Error(res);\n\t}\n\tfunction getLibraryFromEncoding(encoding) {\n\t let ENCODING_CONST;\n\t if (encoding === 'bech32') {\n\t ENCODING_CONST = 1;\n\t }\n\t else {\n\t ENCODING_CONST = 0x2bc830a3;\n\t }\n\t function encode(prefix, words, LIMIT) {\n\t LIMIT = LIMIT || 90;\n\t if (prefix.length + 7 + words.length > LIMIT)\n\t throw new TypeError('Exceeds length limit');\n\t prefix = prefix.toLowerCase();\n\t // determine chk mod\n\t let chk = prefixChk(prefix);\n\t if (typeof chk === 'string')\n\t throw new Error(chk);\n\t let result = prefix + '1';\n\t for (let i = 0; i < words.length; ++i) {\n\t const x = words[i];\n\t if (x >> 5 !== 0)\n\t throw new Error('Non 5-bit word');\n\t chk = polymodStep(chk) ^ x;\n\t result += ALPHABET.charAt(x);\n\t }\n\t for (let i = 0; i < 6; ++i) {\n\t chk = polymodStep(chk);\n\t }\n\t chk ^= ENCODING_CONST;\n\t for (let i = 0; i < 6; ++i) {\n\t const v = (chk >> ((5 - i) * 5)) & 0x1f;\n\t result += ALPHABET.charAt(v);\n\t }\n\t return result;\n\t }\n\t function __decode(str, LIMIT) {\n\t LIMIT = LIMIT || 90;\n\t if (str.length < 8)\n\t return str + ' too short';\n\t if (str.length > LIMIT)\n\t return 'Exceeds length limit';\n\t // don't allow mixed case\n\t const lowered = str.toLowerCase();\n\t const uppered = str.toUpperCase();\n\t if (str !== lowered && str !== uppered)\n\t return 'Mixed-case string ' + str;\n\t str = lowered;\n\t const split = str.lastIndexOf('1');\n\t if (split === -1)\n\t return 'No separator character for ' + str;\n\t if (split === 0)\n\t return 'Missing prefix for ' + str;\n\t const prefix = str.slice(0, split);\n\t const wordChars = str.slice(split + 1);\n\t if (wordChars.length < 6)\n\t return 'Data too short';\n\t let chk = prefixChk(prefix);\n\t if (typeof chk === 'string')\n\t return chk;\n\t const words = [];\n\t for (let i = 0; i < wordChars.length; ++i) {\n\t const c = wordChars.charAt(i);\n\t const v = ALPHABET_MAP[c];\n\t if (v === undefined)\n\t return 'Unknown character ' + c;\n\t chk = polymodStep(chk) ^ v;\n\t // not in the checksum?\n\t if (i + 6 >= wordChars.length)\n\t continue;\n\t words.push(v);\n\t }\n\t if (chk !== ENCODING_CONST)\n\t return 'Invalid checksum for ' + str;\n\t return { prefix, words };\n\t }\n\t function decodeUnsafe(str, LIMIT) {\n\t const res = __decode(str, LIMIT);\n\t if (typeof res === 'object')\n\t return res;\n\t }\n\t function decode(str, LIMIT) {\n\t const res = __decode(str, LIMIT);\n\t if (typeof res === 'object')\n\t return res;\n\t throw new Error(res);\n\t }\n\t return {\n\t decodeUnsafe,\n\t decode,\n\t encode,\n\t toWords,\n\t fromWordsUnsafe,\n\t fromWords,\n\t };\n\t}\n\tdist.bech32 = getLibraryFromEncoding('bech32');\n\tdist.bech32m = getLibraryFromEncoding('bech32m');\n\treturn dist;\n}\n\nvar distExports = requireDist();\n\n/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nfunction isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is Uint8Array. */\nfunction abytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nfunction aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nfunction aoutput(out, instance) {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nfunction clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nfunction createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nfunction rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nfunction utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nfunction toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n/** For runtime check if class implements interface */\nclass Hash {\n}\n/** Wraps hash function, creating an interface on top of it */\nfunction createHasher(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\n\n/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nfunction setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n/** Choice: a ? b : c */\nfunction Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/** Majority function, true if any two inputs is true. */\nfunction Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nclass HashMD extends Hash {\n constructor(blockLen, outputLen, padOffset, isLE) {\n super();\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to || (to = new this.constructor());\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nconst SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n\n/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nclass SHA256 extends HashMD {\n constructor(outputLen = 32) {\n super(64, outputLen, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = SHA256_IV[0] | 0;\n this.B = SHA256_IV[1] | 0;\n this.C = SHA256_IV[2] | 0;\n this.D = SHA256_IV[3] | 0;\n this.E = SHA256_IV[4] | 0;\n this.F = SHA256_IV[5] | 0;\n this.G = SHA256_IV[6] | 0;\n this.H = SHA256_IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n clean(SHA256_W);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nconst sha256$1 = /* @__PURE__ */ createHasher(() => new SHA256());\n\n/**\n * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.\n *\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n *\n * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n * @deprecated\n */\n/** @deprecated Use import from `noble/hashes/sha2` module */\nconst sha256 = sha256$1;\n\nfunction bs58checkBase (checksumFn) {\n // Encode a buffer as a base58-check encoded string\n function encode(payload) {\n var payloadU8 = Uint8Array.from(payload);\n var checksum = checksumFn(payloadU8);\n var length = payloadU8.length + 4;\n var both = new Uint8Array(length);\n both.set(payloadU8, 0);\n both.set(checksum.subarray(0, 4), payloadU8.length);\n return base58.encode(both);\n }\n function decodeRaw(buffer) {\n var payload = buffer.slice(0, -4);\n var checksum = buffer.slice(-4);\n var newChecksum = checksumFn(payload);\n // eslint-disable-next-line\n if (checksum[0] ^ newChecksum[0] |\n checksum[1] ^ newChecksum[1] |\n checksum[2] ^ newChecksum[2] |\n checksum[3] ^ newChecksum[3])\n return;\n return payload;\n }\n // Decode a base58-check encoded string to a buffer, no result if checksum is wrong\n function decodeUnsafe(str) {\n var buffer = base58.decodeUnsafe(str);\n if (buffer == null)\n return;\n return decodeRaw(buffer);\n }\n function decode(str) {\n var buffer = base58.decode(str);\n var payload = decodeRaw(buffer);\n if (payload == null)\n throw new Error('Invalid checksum');\n return payload;\n }\n return {\n encode: encode,\n decode: decode,\n decodeUnsafe: decodeUnsafe\n };\n}\n\n// SHA256(SHA256(buffer))\nfunction sha256x2(buffer) {\n return sha256(sha256(buffer));\n}\nvar bs58check = bs58checkBase(sha256x2);\n\nfunction resolveAddressInput(address) {\n if (typeof address === 'string') {\n return String(address).trim();\n }\n if (address && typeof address.address === 'string') {\n return String(address.address).trim();\n }\n throw new Error('Address must be a string or an object with an address field');\n}\n\nconst LEGACY_MAINNET_PREFIX = 53;\nconst LEGACY_TESTNET_PREFIX = 127;\nconst PQ_MAINNET_HRP = 'nq';\nconst PQ_TESTNET_HRP = 'tnq';\nconst OP_XNA_ASSET = 0xc0;\nconst OP_DROP = 0x75;\nconst OP_1 = 0x51;\nconst OP_RESERVED = 0x50;\nconst XNA_TRANSFER_PREFIX = new Uint8Array([\n 0x72, 0x76, 0x6e, 0x74\n]);\nconst XNA_ISSUE_PREFIX = new Uint8Array([\n 0x72, 0x76, 0x6e, 0x71\n]);\nconst XNA_OWNER_PREFIX = new Uint8Array([\n 0x72, 0x76, 0x6e, 0x6f\n]);\nconst XNA_REISSUE_PREFIX = new Uint8Array([\n 0x72, 0x76, 0x6e, 0x72\n]);\nfunction inferNetworkFromAddress(address) {\n const normalized = resolveAddressInput(address).toLowerCase();\n if (normalized.startsWith(PQ_MAINNET_HRP + '1'))\n return 'xna-pq';\n if (normalized.startsWith(PQ_TESTNET_HRP + '1'))\n return 'xna-pq-test';\n if (normalized.startsWith('n'))\n return 'xna';\n if (normalized.startsWith('t'))\n return 'xna-test';\n throw new Error(`Unsupported Neurai address: ${address}`);\n}\n\nfunction decodeAddress(address) {\n const normalized = resolveAddressInput(address);\n const lowered = normalized.toLowerCase();\n if (!normalized)\n throw new Error('Address is required');\n if (lowered.startsWith(PQ_MAINNET_HRP + '1') || lowered.startsWith(PQ_TESTNET_HRP + '1')) {\n const decoded = distExports.bech32m.decode(normalized);\n const version = decoded.words[0];\n const program = Uint8Array.from(distExports.bech32m.fromWords(decoded.words.slice(1)));\n if (version !== 1 || program.length !== 32) {\n throw new Error(`Unsupported AuthScript address program for ${address}`);\n }\n const network = lowered.startsWith(PQ_TESTNET_HRP + '1') ? 'xna-pq-test' : 'xna-pq';\n return { address: normalized, type: 'authscript', network, program, commitment: program };\n }\n const payload = Uint8Array.from(bs58check.decode(normalized));\n if (payload.length !== 21) {\n throw new Error(`Unsupported legacy address payload length for ${address}`);\n }\n const prefix = payload[0];\n if (prefix !== LEGACY_MAINNET_PREFIX && prefix !== LEGACY_TESTNET_PREFIX) {\n throw new Error(`Unsupported legacy address prefix ${prefix} for ${address}`);\n }\n return {\n address: normalized,\n type: 'p2pkh',\n network: inferNetworkFromAddress(normalized),\n program: payload.slice(1),\n hash: payload.slice(1)\n };\n}\nfunction encodeP2PKHScript(address) {\n const destination = decodeAddress(address);\n if (destination.type !== 'p2pkh') {\n throw new Error(`Address ${address} is not legacy P2PKH`);\n }\n return Uint8Array.of(0x76, 0xa9, 0x14, ...destination.hash, 0x88, 0xac);\n}\nfunction encodeAuthScriptDestinationScript(address) {\n const destination = decodeAddress(address);\n if (destination.type !== 'authscript') {\n throw new Error(`Address ${address} is not AuthScript witness v1`);\n }\n return concatBytes(Uint8Array.of(OP_1), pushData(destination.commitment));\n}\nfunction encodeDestinationScript(address) {\n const destination = decodeAddress(address);\n return destination.type === 'authscript'\n ? encodeAuthScriptDestinationScript(address)\n : encodeP2PKHScript(address);\n}\nfunction encodeNullAssetDestinationScript(address, mode = 'strict') {\n const destination = decodeAddress(address);\n if (destination.type === 'authscript') {\n if (mode === 'hash20') {\n throw new Error('hash20 null-asset mode is not supported for AuthScript destinations');\n }\n return concatBytes(Uint8Array.of(OP_XNA_ASSET, OP_1), pushData(destination.commitment));\n }\n return concatBytes(Uint8Array.of(OP_XNA_ASSET), pushData(destination.hash));\n}\nconst encodePQWitnessScript = encodeAuthScriptDestinationScript;\n\nconst OWNER_ASSET_AMOUNT = 100000000n;\nconst UNIQUE_ASSET_AMOUNT = 100000000n;\nconst UNIQUE_ASSET_UNITS = 0;\nconst UNIQUE_ASSETS_REISSUABLE = false;\nconst MAINNET_BURN_ADDRESSES = {\n ISSUE_ROOT: 'NbURNXXXXXXXXXXXXXXXXXXXXXXXT65Gdr',\n ISSUE_SUB: 'NXissueSubAssetXXXXXXXXXXXXXX6B2JF',\n ISSUE_UNIQUE: 'NXissueUniqueAssetXXXXXXXXXXUBzP4Z',\n ISSUE_DEPIN: 'NXissueUniqueAssetXXXXXXXXXXUBzP4Z',\n ISSUE_MSGCHANNEL: 'NXissueMsgChanneLAssetXXXXXXTUzrtJ',\n REISSUE: 'NXReissueAssetXXXXXXXXXXXXXXWLe4Ao',\n REISSUE_RESTRICTED: 'NXReissueAssetXXXXXXXXXXXXXXWLe4Ao',\n ISSUE_RESTRICTED: 'NXissueRestrictedXXXXXXXXXXXWpXx4H',\n ISSUE_QUALIFIER: 'NXissueQuaLifierXXXXXXXXXXXXWurNcU',\n ISSUE_SUB_QUALIFIER: 'NXissueSubQuaLifierXXXXXXXXXV71vM3',\n TAG_ADDRESS: 'NXaddTagBurnXXXXXXXXXXXXXXXXWucUTr',\n UNTAG_ADDRESS: 'NXaddTagBurnXXXXXXXXXXXXXXXXWucUTr'\n};\nconst TESTNET_BURN_ADDRESSES = {\n ISSUE_ROOT: 'tBURNXXXXXXXXXXXXXXXXXXXXXXXVZLroy',\n ISSUE_SUB: 'tSubAssetXXXXXXXXXXXXXXXXXXXXGTvF4',\n ISSUE_UNIQUE: 'tUniqueAssetXXXXXXXXXXXXXXXXVCgpLs',\n ISSUE_DEPIN: 'tUniqueAssetXXXXXXXXXXXXXXXXVCgpLs',\n ISSUE_MSGCHANNEL: 'tMsgChanneLAssetXXXXXXXXXXXXVsJoya',\n REISSUE: 'tAssetXXXXXXXXXXXXXXXXXXXXXXas6pz8',\n REISSUE_RESTRICTED: 'tAssetXXXXXXXXXXXXXXXXXXXXXXas6pz8',\n ISSUE_RESTRICTED: 'tRestrictedXXXXXXXXXXXXXXXXXVyPBEK',\n ISSUE_QUALIFIER: 'tQuaLifierXXXXXXXXXXXXXXXXXXT5czoV',\n ISSUE_SUB_QUALIFIER: 'tSubQuaLifierXXXXXXXXXXXXXXXW5MmGk',\n TAG_ADDRESS: 'tTagBurnXXXXXXXXXXXXXXXXXXXXYm6pxA',\n UNTAG_ADDRESS: 'tTagBurnXXXXXXXXXXXXXXXXXXXXYm6pxA'\n};\nconst BURN_COSTS_XNA = {\n ISSUE_ROOT: 1000,\n ISSUE_SUB: 200,\n ISSUE_UNIQUE: 10,\n ISSUE_DEPIN: 10,\n ISSUE_MSGCHANNEL: 200,\n ISSUE_QUALIFIER: 2000,\n ISSUE_SUB_QUALIFIER: 200,\n ISSUE_RESTRICTED: 3000,\n REISSUE: 200,\n REISSUE_RESTRICTED: 200,\n TAG_ADDRESS: 0.2,\n UNTAG_ADDRESS: 0.2\n};\nfunction resolveNetworkFamily(network) {\n return network === 'xna' || network === 'xna-pq' ? 'mainnet' : 'testnet';\n}\nfunction getBurnAddressForOperation(network, operation) {\n const byFamily = resolveNetworkFamily(network) === 'mainnet'\n ? MAINNET_BURN_ADDRESSES\n : TESTNET_BURN_ADDRESSES;\n return byFamily[operation];\n}\nfunction getBurnAmountXna(operation, multiplier = 1) {\n return BURN_COSTS_XNA[operation] * multiplier;\n}\nfunction getBurnAmountSats(operation, multiplier = 1) {\n return BigInt(Math.round(getBurnAmountXna(operation, multiplier) * 1e8));\n}\nfunction inferNetworkFromAnyAddress(address) {\n return inferNetworkFromAddress(address);\n}\nfunction getOwnerTokenName(assetName) {\n if (assetName.startsWith('$')) {\n return `${assetName.slice(1)}!`;\n }\n return `${assetName}!`;\n}\nfunction getParentAssetName(assetName) {\n const slashIndex = assetName.indexOf('/');\n if (slashIndex === -1) {\n return null;\n }\n return assetName.slice(0, slashIndex);\n}\nfunction getUniqueAssetName(rootName, tag) {\n return `${rootName}#${tag}`;\n}\nfunction normalizeVerifierString(verifierString) {\n return String(verifierString || '')\n .replace(/\\s+/g, '')\n .replace(/#/g, '');\n}\nfunction isDepinAssetName(assetName) {\n const normalized = String(assetName || '').trim();\n return /^&[A-Z0-9._]{3,}$/.test(normalized) || /^&[A-Z0-9._]+\\/[A-Z0-9._/]+$/.test(normalized);\n}\nfunction assertDepinAssetName(assetName) {\n if (!isDepinAssetName(assetName)) {\n throw new Error(`Invalid DEPIN asset name: ${assetName}`);\n }\n}\n\nfunction xnaToSatoshis(amount) {\n return BigInt(Math.round(Number(amount || 0) * 1e8));\n}\nfunction assetUnitsToRaw(amount) {\n return xnaToSatoshis(amount);\n}\nfunction encodeAssetTransferPayload(assetName, amountRaw, message, expireTime) {\n const payload = [\n XNA_TRANSFER_PREFIX,\n serializeString(assetName),\n u64LE(amountRaw)\n ];\n const encodedMessage = encodeAssetDataReference(message);\n if (encodedMessage.length > 0) {\n payload.push(encodedMessage);\n if (expireTime !== undefined && BigInt(expireTime) !== 0n) {\n payload.push(i64LE(expireTime));\n }\n }\n return concatBytes(...payload);\n}\nfunction encodeAssetTransferScript(address, assetName, amountRaw, message, expireTime) {\n return concatBytes(encodeDestinationScript(address), Uint8Array.of(OP_XNA_ASSET), pushData(encodeAssetTransferPayload(assetName, amountRaw, message, expireTime)), Uint8Array.of(OP_DROP));\n}\nfunction encodeNewAssetPayload(assetName, quantityRaw, units = 0, reissuable = true, ipfsHash) {\n const encodedIpfs = encodeAssetDataReference(ipfsHash);\n return concatBytes(XNA_ISSUE_PREFIX, serializeString(assetName), u64LE(quantityRaw), Uint8Array.of(units & 0xff, reissuable ? 1 : 0, encodedIpfs.length > 0 ? 1 : 0), encodedIpfs);\n}\nfunction encodeNewAssetScript(address, assetName, quantityRaw, units = 0, reissuable = true, ipfsHash) {\n return concatBytes(encodeDestinationScript(address), Uint8Array.of(OP_XNA_ASSET), pushData(encodeNewAssetPayload(assetName, quantityRaw, units, reissuable, ipfsHash)), Uint8Array.of(OP_DROP));\n}\nfunction encodeOwnerAssetPayload(ownerTokenName) {\n return concatBytes(XNA_OWNER_PREFIX, serializeString(ownerTokenName));\n}\nfunction encodeOwnerAssetScript(address, ownerTokenName) {\n return concatBytes(encodeDestinationScript(address), Uint8Array.of(OP_XNA_ASSET), pushData(encodeOwnerAssetPayload(ownerTokenName)), Uint8Array.of(OP_DROP));\n}\nfunction encodeReissueAssetPayload(assetName, quantityRaw, units = 0, reissuable = true, ipfsHash) {\n return concatBytes(XNA_REISSUE_PREFIX, serializeString(assetName), u64LE(quantityRaw), Uint8Array.of(units & 0xff, reissuable ? 1 : 0), encodeAssetDataReference(ipfsHash));\n}\nfunction encodeReissueAssetScript(address, assetName, quantityRaw, units = 0, reissuable = true, ipfsHash) {\n return concatBytes(encodeDestinationScript(address), Uint8Array.of(OP_XNA_ASSET), pushData(encodeReissueAssetPayload(assetName, quantityRaw, units, reissuable, ipfsHash)), Uint8Array.of(OP_DROP));\n}\nfunction encodeNullAssetDataPayload(assetName, flag) {\n const nameBytes = asciiBytes(assetName);\n return concatBytes(compactSize(nameBytes.length), nameBytes, Uint8Array.of(flag & 0xff));\n}\nfunction encodeNullAssetTagPayload(qualifierName, operation) {\n return encodeNullAssetDataPayload(qualifierName, operation === 'tag' ? 1 : 0);\n}\nfunction encodeNullAssetTagScript(address, qualifierName, operation, mode = 'strict') {\n return concatBytes(encodeNullAssetDestinationScript(address, mode), pushData(encodeNullAssetTagPayload(qualifierName, operation)));\n}\nfunction encodeNullAssetRestrictionScript(address, assetName, freezeFlag, mode = 'strict') {\n return concatBytes(encodeNullAssetDestinationScript(address, mode), pushData(encodeNullAssetDataPayload(assetName, freezeFlag)));\n}\nfunction encodeVerifierStringPayload(verifierString) {\n return serializeString(verifierString);\n}\nfunction encodeVerifierStringScript(verifierString) {\n return concatBytes(Uint8Array.of(OP_XNA_ASSET, OP_RESERVED), pushData(encodeVerifierStringPayload(verifierString)));\n}\nfunction encodeGlobalRestrictionScript(assetName, freezeFlag) {\n return concatBytes(Uint8Array.of(OP_XNA_ASSET, OP_RESERVED, OP_RESERVED), pushData(encodeNullAssetDataPayload(assetName, freezeFlag)));\n}\nfunction createXnaOutput(address, valueSats) {\n return {\n valueSats: typeof valueSats === 'bigint' ? valueSats : BigInt(valueSats),\n scriptPubKeyHex: bytesToHex(encodeDestinationScript(address))\n };\n}\nfunction createAssetTransferOutput(address, assetName, amountRaw) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeAssetTransferScript(address, assetName, amountRaw))\n };\n}\nfunction createTransferWithMessageOutput(params) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeAssetTransferScript(params.address, params.assetName, params.amountRaw, params.message, params.expireTime))\n };\n}\nfunction createOwnerAssetIssueOutput(address, ownerTokenName) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeOwnerAssetScript(address, ownerTokenName))\n };\n}\nfunction createOwnerAssetTransferOutput(address, ownerTokenName) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeAssetTransferScript(address, ownerTokenName, OWNER_ASSET_AMOUNT))\n };\n}\nfunction createIssueAssetOutput(params) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeNewAssetScript(params.address, params.assetName, params.quantityRaw, params.units ?? 0, params.reissuable ?? true, params.ipfsHash))\n };\n}\nfunction createReissueAssetOutput(params) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeReissueAssetScript(params.address, params.assetName, params.quantityRaw, params.units ?? 0, params.reissuable ?? true, params.ipfsHash))\n };\n}\nfunction createNullAssetTagOutput(address, qualifierName, operation, mode = 'strict') {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeNullAssetTagScript(address, qualifierName, operation, mode))\n };\n}\nfunction createNullAssetRestrictionOutput(address, assetName, freezeFlag, mode = 'strict') {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeNullAssetRestrictionScript(address, assetName, freezeFlag, mode))\n };\n}\nfunction createVerifierStringOutput(verifierString) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeVerifierStringScript(verifierString))\n };\n}\nfunction createGlobalRestrictionOutput(assetName, freezeFlag) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeGlobalRestrictionScript(assetName, freezeFlag))\n };\n}\nfunction createTransferOutput(params) {\n return createAssetTransferOutput(params.address, params.assetName, params.amountRaw);\n}\n\nfunction serializeInput(input) {\n const txidBytes = reverseBytes(hexToBytes(input.txid));\n const scriptSig = input.scriptSigHex ? hexToBytes(input.scriptSigHex) : new Uint8Array();\n return concatBytes(txidBytes, u32LE(input.vout), compactSize(scriptSig.length), scriptSig, u32LE(input.sequence ?? 0xffffffff));\n}\nfunction serializeOutput(output) {\n const scriptPubKey = hexToBytes(ensureHex(output.scriptPubKeyHex, 'scriptPubKeyHex'));\n return concatBytes(u64LE(output.valueSats), compactSize(scriptPubKey.length), scriptPubKey);\n}\nfunction createUnsignedTransaction(tx) {\n const version = tx.version ?? 2;\n const locktime = tx.locktime ?? 0;\n const inputs = tx.inputs.map(serializeInput);\n const outputs = tx.outputs.map(serializeOutput);\n const bytes = concatBytes(u32LE(version), compactSize(inputs.length), ...inputs, compactSize(outputs.length), ...outputs, u32LE(locktime));\n return Array.from(bytes, (value) => value.toString(16).padStart(2, '0')).join('');\n}\n\nfunction buildTransaction(version, locktime, inputs, outputs) {\n return {\n rawTx: createUnsignedTransaction({\n version: version ?? 2,\n locktime: locktime ?? 0,\n inputs,\n outputs\n }),\n outputs\n };\n}\nfunction appendXnaEnvelope(outputs, burnAddress, burnAmountSats, changeAddress, changeSats) {\n if (burnAddress && burnAmountSats !== undefined && BigInt(burnAmountSats) > 0n) {\n outputs.push(createXnaOutput(burnAddress, burnAmountSats));\n }\n if (changeAddress && changeSats !== undefined && BigInt(changeSats) > 0n) {\n outputs.push(createXnaOutput(changeAddress, changeSats));\n }\n}\nfunction appendExtraOutputs(outputs, extraOutputs) {\n if (extraOutputs?.length) {\n outputs.push(...extraOutputs);\n }\n}\nfunction freezeFlagFromOperation(operation) {\n return operation === 'freeze' ? 1 : 0;\n}\nfunction createPaymentTransaction(params) {\n const outputs = [\n ...params.payments.map((payment) => createXnaOutput(payment.address, payment.valueSats)),\n ...(params.extraOutputs ?? [])\n ];\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createStandardAssetTransferTransaction(params) {\n const outputs = [];\n for (const payment of params.payments ?? []) {\n outputs.push(createXnaOutput(payment.address, payment.valueSats));\n }\n for (const transfer of params.transfers ?? []) {\n outputs.push(createTransferOutput(transfer));\n }\n for (const transfer of params.transferMessages ?? []) {\n outputs.push(createTransferWithMessageOutput(transfer));\n }\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueAssetTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n if (params.includeOwnerOutput ?? true) {\n outputs.push(createOwnerAssetIssueOutput(params.ownerTokenAddress ?? params.toAddress, params.ownerTokenName ?? getOwnerTokenName(params.assetName)));\n }\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueSubAssetTransaction(params) {\n const parentAssetName = getParentAssetName(params.assetName);\n if (!parentAssetName) {\n throw new Error(`Sub-asset name must contain '/': ${params.assetName}`);\n }\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.parentOwnerAddress ?? params.xnaChangeAddress ?? params.toAddress, getOwnerTokenName(parentAssetName)));\n outputs.push(createOwnerAssetIssueOutput(params.ownerTokenAddress ?? params.toAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueDepinTransaction(params) {\n assertDepinAssetName(params.assetName);\n if (params.reissuable !== undefined && typeof params.reissuable !== 'boolean') {\n throw new Error('DEPIN reissuable must be boolean when provided');\n }\n return createIssueAssetTransaction({\n ...params,\n units: 0,\n includeOwnerOutput: true,\n ownerTokenAddress: params.ownerTokenAddress ?? params.toAddress,\n reissuable: params.reissuable ?? true\n });\n}\nfunction createIssueUniqueAssetTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.ownerTokenAddress ?? params.toAddress, getOwnerTokenName(params.rootName)));\n for (let index = 0; index < params.assetTags.length; index += 1) {\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: getUniqueAssetName(params.rootName, params.assetTags[index]),\n quantityRaw: UNIQUE_ASSET_AMOUNT,\n units: UNIQUE_ASSET_UNITS,\n reissuable: UNIQUE_ASSETS_REISSUABLE,\n ipfsHash: params.ipfsHashes?.[index]\n }));\n }\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueQualifierTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n const parentQualifier = getParentAssetName(params.assetName);\n if (parentQualifier) {\n outputs.push(createAssetTransferOutput(params.rootChangeAddress ?? params.xnaChangeAddress ?? params.toAddress, parentQualifier, params.changeQuantityRaw ?? OWNER_ASSET_AMOUNT));\n }\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: 0,\n reissuable: false,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueRestrictedTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createVerifierStringOutput(normalizeVerifierString(params.verifierString)));\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress ?? params.toAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createReissueTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress ?? params.toAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createReissueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createReissueRestrictedTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n if (params.verifierString) {\n outputs.push(createVerifierStringOutput(normalizeVerifierString(params.verifierString)));\n }\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress ?? params.toAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createReissueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createQualifierTagTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createAssetTransferOutput(params.qualifierChangeAddress, params.qualifierName, params.qualifierChangeAmountRaw));\n for (const address of params.targetAddresses) {\n outputs.push(createNullAssetTagOutput(address, params.qualifierName, params.operation, params.nullAssetDestinationMode ?? 'strict'));\n }\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createFreezeAddressesTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, undefined, undefined, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress, getOwnerTokenName(params.assetName)));\n for (const address of params.targetAddresses) {\n outputs.push(createNullAssetRestrictionOutput(address, params.assetName, freezeFlagFromOperation(params.operation), params.nullAssetDestinationMode ?? 'strict'));\n }\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createFreezeAssetTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, undefined, undefined, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createGlobalRestrictionOutput(params.assetName, freezeFlagFromOperation(params.operation) + 2));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createFromOperation(build) {\n switch (build.operationType) {\n case 'STANDARD_PAYMENT':\n return createPaymentTransaction(build.params);\n case 'STANDARD_TRANSFER':\n return createStandardAssetTransferTransaction(build.params);\n case 'ISSUE_ROOT':\n case 'ISSUE_MSGCHANNEL':\n return createIssueAssetTransaction(build.params);\n case 'ISSUE_SUB':\n return createIssueSubAssetTransaction(build.params);\n case 'ISSUE_UNIQUE':\n return createIssueUniqueAssetTransaction(build.params);\n case 'ISSUE_DEPIN':\n return createIssueDepinTransaction(build.params);\n case 'ISSUE_QUALIFIER':\n case 'ISSUE_SUB_QUALIFIER':\n return createIssueQualifierTransaction(build.params);\n case 'ISSUE_RESTRICTED':\n return createIssueRestrictedTransaction(build.params);\n case 'REISSUE':\n return createReissueTransaction(build.params);\n case 'REISSUE_RESTRICTED':\n return createReissueRestrictedTransaction(build.params);\n case 'TAG_ADDRESSES':\n return createQualifierTagTransaction({\n ...build.params,\n operation: 'tag'\n });\n case 'UNTAG_ADDRESSES':\n return createQualifierTagTransaction({\n ...build.params,\n operation: 'untag'\n });\n case 'FREEZE_ADDRESSES':\n return createFreezeAddressesTransaction({\n ...build.params,\n operation: 'freeze'\n });\n case 'UNFREEZE_ADDRESSES':\n return createFreezeAddressesTransaction({\n ...build.params,\n operation: 'unfreeze'\n });\n case 'FREEZE_ASSET':\n return createFreezeAssetTransaction({\n ...build.params,\n operation: 'freeze'\n });\n case 'UNFREEZE_ASSET':\n return createFreezeAssetTransaction({\n ...build.params,\n operation: 'unfreeze'\n });\n default: {\n const unsupported = build;\n throw new Error(`Unsupported operation type: ${JSON.stringify(unsupported)}`);\n }\n }\n}\n\nexport { OWNER_ASSET_AMOUNT, UNIQUE_ASSETS_REISSUABLE, UNIQUE_ASSET_AMOUNT, UNIQUE_ASSET_UNITS, assertDepinAssetName, assetUnitsToRaw, createAssetTransferOutput, createFreezeAddressesTransaction, createFreezeAssetTransaction, createFromOperation, createGlobalRestrictionOutput, createIssueAssetOutput, createIssueAssetTransaction, createIssueDepinTransaction, createIssueQualifierTransaction, createIssueRestrictedTransaction, createIssueSubAssetTransaction, createIssueUniqueAssetTransaction, createNullAssetRestrictionOutput, createNullAssetTagOutput, createOwnerAssetIssueOutput, createOwnerAssetTransferOutput, createPaymentTransaction, createQualifierTagTransaction, createReissueAssetOutput, createReissueRestrictedTransaction, createReissueTransaction, createStandardAssetTransferTransaction, createTransferOutput, createTransferWithMessageOutput, createUnsignedTransaction, createVerifierStringOutput, createXnaOutput, decodeAddress, decodeAssetDataReferenceHex, encodeAssetDataReference, encodeAssetTransferPayload, encodeAssetTransferScript, encodeAuthScriptDestinationScript, encodeDestinationScript, encodeGlobalRestrictionScript, encodeNewAssetPayload, encodeNewAssetScript, encodeNullAssetDataPayload, encodeNullAssetDestinationScript, encodeNullAssetRestrictionScript, encodeNullAssetTagPayload, encodeNullAssetTagScript, encodeOwnerAssetPayload, encodeOwnerAssetScript, encodeP2PKHScript, encodePQWitnessScript, encodeReissueAssetPayload, encodeReissueAssetScript, encodeVerifierStringPayload, encodeVerifierStringScript, formatAssetDataReferenceHex, getBurnAddressForOperation, getBurnAmountSats, getBurnAmountXna, getOwnerTokenName, getParentAssetName, getUniqueAssetName, inferNetworkFromAnyAddress, isCidV0AssetReference, isDepinAssetName, isEncodedAssetDataReferenceHex, isRawAssetDataReferenceHex, isTxidAssetReference, normalizeVerifierString, resolveAddressInput, serializeInput, serializeOutput, xnaToSatoshis };\n//# sourceMappingURL=index.js.map\n","/**\n * Address helpers. Wraps `decodeAddress` from\n * `@neuraiproject/neurai-create-transaction` to produce the exact\n * scriptPubKey bytes a covenant needs to hardcode. The actual\n * scriptPubKey encoders live in `./standard/*`; this module delegates.\n *\n * Two destination types are supported for the payment output (output[0]):\n * - Legacy P2PKH (base58check)\n * - AuthScript witness v1 (bech32m)\n */\nimport { decodeAddress } from '@neuraiproject/neurai-create-transaction';\nimport { encodeP2PKHScriptPubKey } from './standard/p2pkh.js';\nimport { encodeAuthScriptScriptPubKey } from './standard/authscript.js';\n// Re-export for callers that imported these from `address` pre-refactor. The\n// canonical path going forward is `./standard/p2pkh` / `./standard/authscript`.\nexport { encodeP2PKHScriptPubKey, encodeAuthScriptScriptPubKey };\n/**\n * Resolve any accepted seller address string into its scriptPubKey.\n * The returned bytes are what the covenant will hardcode and later verify\n * via `OP_OUTPUTSCRIPT == <bytes>`.\n */\nexport function encodeSellerScriptPubKey(address) {\n const decoded = decodeAddress(address);\n if (decoded.type === 'p2pkh') {\n const hash = Uint8Array.from(decoded.hash);\n return {\n kind: 'p2pkh',\n bytes: encodeP2PKHScriptPubKey(hash),\n hash\n };\n }\n if (decoded.type === 'authscript') {\n const program = Uint8Array.from(decoded.program);\n return {\n kind: 'authscript',\n bytes: encodeAuthScriptScriptPubKey(program),\n hash: program\n };\n }\n throw new Error(`Unsupported seller address type for \"${address}\"`);\n}\n","/**\n * Asset-transfer wrapper split helper.\n *\n * Neurai asset UTXOs have a scriptPubKey of the form\n *\n * <prefix scriptPubKey bytes> OP_XNA_ASSET <pushdata(payload)> OP_DROP\n *\n * where `prefix` is the recipient's standard script (typically a P2PKH, an\n * AuthScript witness v1, or a bare covenant such as the partial-fill sell\n * order), and `payload` serializes a `CAssetTransfer`:\n *\n * payload = rvn_prefix (0x72 0x76 0x6e) || type_marker (0x74 transfer)\n * || VarStr(assetName)\n * || int64LE(amountRaw)\n * [ || messageRef (optional) || int64LE(expireTime) (optional) ]\n *\n * This helper separates the two halves so consumers can validate the prefix\n * (e.g. feed it to `parsePartialFillScript`) while independently reading the\n * asset data displayed to the user. The optional payload tail\n * (`message` + `expireTime`) is tolerated but not exposed — the first\n * version only needs `assetName` and `amountRaw`.\n *\n * Bare (non-wrapped) scriptPubKeys round-trip through this helper by\n * returning `prefixHex === input` and `assetTransfer === null`.\n */\nimport { bytesToHex, hexToBytes, ensureHex } from './core/bytes.js';\nimport { OP_DROP, OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, OP_XNA_ASSET } from './core/opcodes.js';\nconst RVN_MAGIC = Uint8Array.from([0x72, 0x76, 0x6e]); // \"rvn\"\nconst TRANSFER_TYPE = 0x74;\n/**\n * Walk the script one opcode at a time, skipping pushdata payload bytes,\n * until either OP_XNA_ASSET is reached at top level or the end of the\n * script. Returns the byte offset of OP_XNA_ASSET, or -1 if not found.\n * Throws on truncated pushdata.\n */\nfunction findTopLevelAssetOpcode(bytes) {\n let i = 0;\n while (i < bytes.length) {\n const op = bytes[i];\n if (op === OP_XNA_ASSET)\n return i;\n // Short direct push: 0x01..0x4b\n if (op >= 0x01 && op <= 0x4b) {\n const len = op;\n const next = i + 1 + len;\n if (next > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: short push of ${len} bytes at offset ${i} exceeds script length`);\n }\n i = next;\n continue;\n }\n if (op === OP_PUSHDATA1) {\n if (i + 1 >= bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: truncated PUSHDATA1 length at offset ${i}`);\n }\n const len = bytes[i + 1];\n const next = i + 2 + len;\n if (next > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: PUSHDATA1 of ${len} bytes at offset ${i} exceeds script length`);\n }\n i = next;\n continue;\n }\n if (op === OP_PUSHDATA2) {\n if (i + 2 >= bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: truncated PUSHDATA2 length at offset ${i}`);\n }\n const len = bytes[i + 1] | (bytes[i + 2] << 8);\n const next = i + 3 + len;\n if (next > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: PUSHDATA2 of ${len} bytes at offset ${i} exceeds script length`);\n }\n i = next;\n continue;\n }\n if (op === OP_PUSHDATA4) {\n if (i + 4 >= bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: truncated PUSHDATA4 length at offset ${i}`);\n }\n const len = (bytes[i + 1] |\n (bytes[i + 2] << 8) |\n (bytes[i + 3] << 16) |\n (bytes[i + 4] << 24)) >>>\n 0;\n const next = i + 5 + len;\n if (next > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: PUSHDATA4 of ${len} bytes at offset ${i} exceeds script length`);\n }\n i = next;\n continue;\n }\n // Any other opcode (including OP_1..OP_16, OP_DUP, OP_HASH160, etc.) is\n // one byte wide in Neurai Script. Advance.\n i += 1;\n }\n return -1;\n}\n/**\n * Read the pushdata element that sits immediately after OP_XNA_ASSET and\n * return its payload bytes together with the cursor position after the\n * element. Only direct pushes (1..75) and PUSHDATA1 are accepted — a\n * well-formed asset transfer payload fits within 75 bytes for the common\n * case and comfortably within 255 bytes even with long names and tails.\n * PUSHDATA2 and PUSHDATA4 would signal a malformed or adversarial wrapper.\n */\nfunction readPayloadPush(bytes, start) {\n if (start >= bytes.length) {\n throw new Error('splitAssetWrappedScriptPubKey: truncated wrapper — missing payload push');\n }\n const op = bytes[start];\n if (op >= 0x01 && op <= 0x4b) {\n const len = op;\n const dataStart = start + 1;\n const dataEnd = dataStart + len;\n if (dataEnd > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload short push of ${len} bytes exceeds script length`);\n }\n return { payload: bytes.slice(dataStart, dataEnd), after: dataEnd };\n }\n if (op === OP_PUSHDATA1) {\n if (start + 1 >= bytes.length) {\n throw new Error('splitAssetWrappedScriptPubKey: truncated PUSHDATA1 in asset payload');\n }\n const len = bytes[start + 1];\n const dataStart = start + 2;\n const dataEnd = dataStart + len;\n if (dataEnd > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload PUSHDATA1 of ${len} bytes exceeds script length`);\n }\n return { payload: bytes.slice(dataStart, dataEnd), after: dataEnd };\n }\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload push opcode 0x${op.toString(16)} not accepted (expected 0x01..0x4b or PUSHDATA1)`);\n}\nfunction parseAssetTransferPayload(payload) {\n if (payload.length < 4 + 1 + 8) {\n // 4 magic+type, 1 varstr length, 8 int64LE amount\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload of ${payload.length} bytes is too short`);\n }\n for (let i = 0; i < 3; i += 1) {\n if (payload[i] !== RVN_MAGIC[i]) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload magic mismatch — expected \"rvn\" got 0x${payload[0].toString(16)} 0x${payload[1].toString(16)} 0x${payload[2].toString(16)}`);\n }\n }\n if (payload[3] !== TRANSFER_TYPE) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload type marker 0x${payload[3].toString(16)} is not a transfer (0x74)`);\n }\n const nameLen = payload[4];\n const nameStart = 5;\n const nameEnd = nameStart + nameLen;\n if (nameEnd + 8 > payload.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload truncated — name length ${nameLen} does not leave room for amount`);\n }\n let assetName = '';\n for (let i = nameStart; i < nameEnd; i += 1) {\n assetName += String.fromCharCode(payload[i]);\n }\n let amountRaw = 0n;\n for (let i = 0; i < 8; i += 1) {\n amountRaw |= BigInt(payload[nameEnd + i]) << BigInt(8 * i);\n }\n // Any bytes after nameEnd + 8 form the optional tail (message +\n // expireTime). We intentionally ignore them in this first version; the\n // raw payload remains available via `payloadHex` if a consumer later\n // needs to inspect them.\n return { assetName, amountRaw };\n}\n/**\n * Parse an asset-transfer-wrapped scriptPubKey. Accepts both wrapped and\n * bare forms. Throws on structural malformation (truncated pushdata,\n * missing OP_DROP after payload, bad magic, unsupported pushdata width).\n */\nexport function splitAssetWrappedScriptPubKey(spkHex) {\n const normalized = ensureHex(spkHex, 'scriptPubKey');\n const bytes = hexToBytes(normalized);\n const assetOpAt = findTopLevelAssetOpcode(bytes);\n if (assetOpAt < 0) {\n return { prefixHex: normalized, assetTransfer: null };\n }\n const prefix = bytes.slice(0, assetOpAt);\n const { payload, after } = readPayloadPush(bytes, assetOpAt + 1);\n if (after >= bytes.length) {\n throw new Error('splitAssetWrappedScriptPubKey: asset wrapper missing trailing OP_DROP');\n }\n if (bytes[after] !== OP_DROP) {\n throw new Error(`splitAssetWrappedScriptPubKey: expected OP_DROP at offset ${after}, got 0x${bytes[after].toString(16)}`);\n }\n if (after + 1 !== bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: ${bytes.length - after - 1} trailing bytes after OP_DROP`);\n }\n const { assetName, amountRaw } = parseAssetTransferPayload(payload);\n return {\n prefixHex: bytesToHex(prefix),\n assetTransfer: {\n assetName,\n amountRaw,\n payloadHex: bytesToHex(payload),\n },\n };\n}\n","/**\n * Partial-Fill Sell Order covenant script.\n *\n * The covenant has two branches selected by the top of the unlock stack:\n *\n * OP_IF (unlock pushed 1) → Cancel: seller signs, recovers remainder.\n * OP_ELSE (unlock pushed 0) → Public partial fill: buyer provides the\n * fill amount `N` and the tx layout is\n * validated byte by byte.\n *\n * The partial-fill branch enforces a fixed output layout so that the script\n * stays compact and parseable:\n *\n * output[0] = XNA payment to seller (value >= N * unitPriceSats)\n * output[1] = asset to buyer (tokenId, amount == N)\n * output[2] = covenant remainder (same scriptPubKey, amount == in - N)\n * output[3+] = optional buyer change (not constrained by the covenant)\n *\n * The remainder UTXO reuses the spent scriptPubKey via\n * `OP_OUTPUTSCRIPT == OP_TXFIELD 0x03`, so the covenant is self-replicating\n * without hardcoding its own hash.\n *\n * The cancel branch uses classical ECDSA (`OP_HASH160 + OP_CHECKSIG`) and\n * commits to a 20-byte PKH. As a consequence this variant only accepts\n * legacy P2PKH addresses as the seller destination. For AuthScript bech32m\n * destinations and post-quantum signing, use `buildPartialFillScriptPQ`.\n */\nimport { decodeAddress } from '@neuraiproject/neurai-create-transaction';\nimport { bytesToHex } from '../../core/bytes.js';\nimport { encodeP2PKHScriptPubKey } from '../../standard/p2pkh.js';\nimport { ASSETFIELD_AMOUNT, ASSETFIELD_NAME, OP_CHECKSIG, OP_DROP, OP_DUP, OP_ELSE, OP_ENDIF, OP_EQUALVERIFY, OP_GREATERTHANOREQUAL, OP_HASH160, OP_IF, OP_INPUTASSETFIELD, OP_MUL, OP_OUTPUTASSETFIELD, OP_OUTPUTSCRIPT, OP_OUTPUTVALUE, OP_OVER, OP_SUB, OP_SWAP, OP_TXFIELD, OP_VERIFY, TXFIELD_SCRIPTPUBKEY } from '../../core/opcodes.js';\nimport { ScriptBuilder } from '../../core/script-builder.js';\nexport { encodeP2PKHScriptPubKey } from '../../standard/p2pkh.js';\nconst ASSET_NAME_MAX = 32;\nfunction decodeSellerAddress(sellerAddress) {\n if (typeof sellerAddress !== 'string' || sellerAddress.length === 0) {\n throw new Error('sellerAddress is required');\n }\n const decoded = decodeAddress(sellerAddress);\n if (decoded.type !== 'p2pkh') {\n throw new Error(`sellerAddress must be a legacy P2PKH address (the legacy partial-fill covenant uses OP_HASH160 + OP_CHECKSIG); ` +\n `got ${decoded.type}. Use buildPartialFillScriptPQ for AuthScript destinations.`);\n }\n const pkh = Uint8Array.from(decoded.hash);\n if (pkh.length !== 20) {\n throw new Error(`decoded sellerAddress produced a ${pkh.length}-byte hash, expected 20`);\n }\n return pkh;\n}\nfunction assertTokenId(tokenId) {\n if (typeof tokenId !== 'string' || tokenId.length === 0) {\n throw new Error('tokenId is required');\n }\n if (!/^[A-Z0-9._]+$/.test(tokenId)) {\n throw new Error(`tokenId \"${tokenId}\" is not a valid Neurai asset name`);\n }\n if (tokenId.length > ASSET_NAME_MAX) {\n throw new Error(`tokenId exceeds ${ASSET_NAME_MAX} bytes`);\n }\n}\nfunction assertPrice(priceSats) {\n if (typeof priceSats !== 'bigint') {\n throw new Error('unitPriceSats must be a bigint (satoshis per indivisible unit)');\n }\n if (priceSats <= 0n) {\n throw new Error('unitPriceSats must be > 0');\n }\n // 8-byte signed int ceiling: values beyond this cannot be produced by OP_MUL\n // inside the covenant without overflow (CScriptNum is int64).\n if (priceSats > 0x7fffffffffffffffn) {\n throw new Error('unitPriceSats exceeds int64 range');\n }\n}\n/**\n * Build the `scriptPubKey` of a Partial-Fill Sell Order covenant UTXO.\n * Returns raw bytes; wrap with `bytesToHex` for wire format.\n */\nexport function buildPartialFillScript(params) {\n const { sellerAddress, tokenId, unitPriceSats } = params;\n const sellerPubKeyHash = decodeSellerAddress(sellerAddress);\n assertTokenId(tokenId);\n assertPrice(unitPriceSats);\n const sellerScriptPubKey = encodeP2PKHScriptPubKey(sellerPubKeyHash);\n const tokenIdBytes = new TextEncoder().encode(tokenId);\n const b = new ScriptBuilder();\n // ───────── Cancel branch (IF) ─────────\n // scriptSig expected: <sig> <pubkey> OP_1\n b.op(OP_IF)\n .op(OP_DUP, OP_HASH160)\n .pushBytes(sellerPubKeyHash)\n .op(OP_EQUALVERIFY, OP_CHECKSIG)\n .op(OP_ELSE);\n // ───────── Partial-fill branch (ELSE) ─────────\n // scriptSig expected: <N> OP_0\n //\n // Stack invariant entering the ELSE branch: [ N ]\n // 1. Payment value to seller (output 0)\n // require outputValue(0) >= N * unitPriceSats\n b.op(OP_DUP) // [ N, N ]\n .pushInt(unitPriceSats) // [ N, N, price ]\n .op(OP_MUL) // [ N, N*price ]\n .pushInt(0) // [ N, N*price, 0 ]\n .op(OP_OUTPUTVALUE) // [ N, N*price, value ]\n .op(OP_SWAP) // [ N, value, N*price ]\n .op(OP_GREATERTHANOREQUAL)\n .op(OP_VERIFY); // [ N ]\n // 2. Payment scriptPubKey must equal Alice's (output 0)\n b.pushInt(0)\n .op(OP_OUTPUTSCRIPT) // [ N, scriptPubKey_out0 ]\n .pushBytes(sellerScriptPubKey)\n .op(OP_EQUALVERIFY); // [ N ]\n // 3. Asset delivered to buyer (output 1): amount == N\n b.op(OP_DUP) // [ N, N ]\n .pushInt(1) // [ N, N, 1 ]\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_OUTPUTASSETFIELD) // [ N, N, amount_out1 ]\n .op(OP_EQUALVERIFY); // [ N ]\n // 4. Asset delivered to buyer (output 1): name == tokenId\n b.pushInt(1)\n .pushInt(ASSETFIELD_NAME)\n .op(OP_OUTPUTASSETFIELD) // [ N, name_out1 ]\n .pushBytes(tokenIdBytes)\n .op(OP_EQUALVERIFY); // [ N ]\n // 5. Remainder covenant continuity (output 2): same scriptPubKey as spent\n b.pushInt(2)\n .op(OP_OUTPUTSCRIPT) // [ N, spk_out2 ]\n .pushInt(TXFIELD_SCRIPTPUBKEY)\n .op(OP_TXFIELD) // [ N, spk_out2, spent_spk ]\n .op(OP_EQUALVERIFY); // [ N ]\n // 6. Remainder output: same tokenId\n b.pushInt(2)\n .pushInt(ASSETFIELD_NAME)\n .op(OP_OUTPUTASSETFIELD) // [ N, name_out2 ]\n .pushBytes(tokenIdBytes)\n .op(OP_EQUALVERIFY); // [ N ]\n // 7. Remainder output: amount == inputAssetAmount - N\n b.pushInt(2)\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_OUTPUTASSETFIELD) // [ N, rem_amount ]\n .op(OP_OVER) // [ N, rem_amount, N ] -- copy N under top\n .pushInt(0) // [ N, rem_amount, N, 0 ]\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_INPUTASSETFIELD) // [ N, rem_amount, N, in_amount ]\n .op(OP_SWAP) // [ N, rem_amount, in_amount, N ]\n .op(OP_SUB) // [ N, rem_amount, in_amount - N ]\n .op(OP_EQUALVERIFY); // [ N ]\n // Drop N, leave TRUE on the stack so the ELSE branch evaluates as success.\n b.op(OP_DROP).pushInt(1);\n b.op(OP_ENDIF);\n return b.build();\n}\n/** Hex convenience wrapper for `buildPartialFillScript`. */\nexport function buildPartialFillScriptHex(params) {\n return bytesToHex(buildPartialFillScript(params));\n}\n// Re-export atomic helpers so parse.ts and callers can reuse them.\nexport { pushBytes, pushInt } from '../../core/script-builder.js';\n","/**\n * PQ (post-quantum) variant of the Partial-Fill Sell Order covenant.\n *\n * Identical partial-fill branch to the legacy covenant, but the **cancel**\n * branch accepts an ML-DSA-44 signature instead of an ECDSA one. This\n * requires:\n * - `SCRIPT_VERIFY_CHECKSIGFROMSTACK` (for OP_CSFS) active\n * - `SCRIPT_VERIFY_TXHASH` (for OP_TXHASH) active\n * - NIP-18 (`MAX_PQ_SCRIPT_ELEMENT_SIZE = 3072`) active, so the ~2.4 KB\n * signature and ~1.3 KB pubkey can be pushed to the script stack\n *\n * All three are active on DePIN-Test testnet.\n *\n * Cancel-branch flow (scriptSig pushes `<sig> <pubkey> OP_1`):\n *\n * 1. OP_DUP OP_SHA256 <commitment> OP_EQUALVERIFY → pubkey matches\n * 2. <selector> OP_TXHASH → message = H(tx)\n * 3. OP_SWAP OP_CHECKSIGFROMSTACK → CSFS verifies sig\n *\n * The message that gets signed is **SHA256(OP_TXHASH(selector))** — CSFS\n * single-SHA256s its message argument before verification, and OP_TXHASH\n * produces its own 32-byte hash, so the seller computes:\n * `sign(pqSeckey, SHA256(doubleSHA256(selected_tx_fields)))`\n */\nimport { bytesToHex } from '../../core/bytes.js';\nimport { encodeSellerScriptPubKey } from '../../address.js';\nimport { ASSETFIELD_AMOUNT, ASSETFIELD_NAME, OP_CHECKSIGFROMSTACK, OP_DROP, OP_DUP, OP_ELSE, OP_ENDIF, OP_EQUALVERIFY, OP_GREATERTHANOREQUAL, OP_IF, OP_INPUTASSETFIELD, OP_MUL, OP_OUTPUTASSETFIELD, OP_OUTPUTSCRIPT, OP_OUTPUTVALUE, OP_OVER, OP_SHA256, OP_SUB, OP_SWAP, OP_TXFIELD, OP_TXHASH, OP_VERIFY, TXFIELD_SCRIPTPUBKEY } from '../../core/opcodes.js';\nimport { ScriptBuilder } from '../../core/script-builder.js';\nconst ASSET_NAME_MAX = 32;\nexport const DEFAULT_PQ_TXHASH_SELECTOR = 0xff;\nfunction assertCommitment(commitment) {\n if (!(commitment instanceof Uint8Array) || commitment.length !== 32) {\n throw new Error('pubKeyCommitment must be a 32-byte Uint8Array (SHA256 of pubKey)');\n }\n}\nfunction assertTokenId(tokenId) {\n if (typeof tokenId !== 'string' || tokenId.length === 0) {\n throw new Error('tokenId is required');\n }\n if (!/^[A-Z0-9._]+$/.test(tokenId)) {\n throw new Error(`tokenId \"${tokenId}\" is not a valid Neurai asset name`);\n }\n if (tokenId.length > ASSET_NAME_MAX) {\n throw new Error(`tokenId exceeds ${ASSET_NAME_MAX} bytes`);\n }\n}\nfunction assertPrice(priceSats) {\n if (typeof priceSats !== 'bigint') {\n throw new Error('unitPriceSats must be a bigint');\n }\n if (priceSats <= 0n) {\n throw new Error('unitPriceSats must be > 0');\n }\n if (priceSats > 0x7fffffffffffffffn) {\n throw new Error('unitPriceSats exceeds int64 range');\n }\n}\nfunction assertSelector(selector) {\n if (!Number.isInteger(selector) || selector < 0 || selector > 0xff) {\n throw new Error('txHashSelector must be a single byte (0x00..0xff)');\n }\n if (selector === 0) {\n throw new Error('txHashSelector 0x00 is rejected by OP_TXHASH');\n }\n}\n/**\n * Build the scriptPubKey of a PQ Partial-Fill Sell Order covenant UTXO.\n */\nexport function buildPartialFillScriptPQ(params) {\n const { paymentAddress, pubKeyCommitment, tokenId, unitPriceSats, txHashSelector = DEFAULT_PQ_TXHASH_SELECTOR } = params;\n assertCommitment(pubKeyCommitment);\n assertTokenId(tokenId);\n assertPrice(unitPriceSats);\n assertSelector(txHashSelector);\n const payment = encodeSellerScriptPubKey(paymentAddress);\n const tokenIdBytes = new TextEncoder().encode(tokenId);\n const b = new ScriptBuilder();\n // ───────── Cancel branch (PQ via OP_CHECKSIGFROMSTACK) ─────────\n // scriptSig expected: <sigPQ> <pubKeyPQ> OP_1\n // After OP_IF consumes the flag: [ sig, pubKey ]\n //\n // The selector MUST be pushed as a raw 1-byte element — consensus\n // (`interpreter.cpp` OP_TXHASH case) rejects any stack item of\n // size ≠ 1. Using `pushInt(selector)` would work for 1..127 but emit a\n // 2-byte CScriptNum for 0x80..0xff (the sign-disambiguation pad), which\n // makes OP_TXHASH fail with SCRIPT_ERR_TXHASH. See\n // `memory/project_covenant_v3_findings.md` bug B for details.\n b.op(OP_IF)\n .op(OP_DUP) // [ sig, pubKey, pubKey ]\n .op(OP_SHA256) // [ sig, pubKey, H(pubKey) ]\n .pushBytes(pubKeyCommitment) // [ sig, pubKey, H(pubKey), commitment ]\n .op(OP_EQUALVERIFY) // [ sig, pubKey ]\n .pushBytes(Uint8Array.of(txHashSelector)) // [ sig, pubKey, selector ] — always 1-byte stack item\n .op(OP_TXHASH) // [ sig, pubKey, txHash ]\n .op(OP_SWAP) // [ sig, txHash, pubKey ]\n .op(OP_CHECKSIGFROMSTACK) // [ 1 | 0 ]\n .op(OP_ELSE);\n // ───────── Partial-fill branch (identical layout to legacy) ─────────\n // scriptSig expected: <N> OP_0\n // Stack entering ELSE: [ N ]\n // 1. Payment value (output 0) >= N * unitPriceSats\n b.op(OP_DUP)\n .pushInt(unitPriceSats)\n .op(OP_MUL)\n .pushInt(0)\n .op(OP_OUTPUTVALUE)\n .op(OP_SWAP)\n .op(OP_GREATERTHANOREQUAL)\n .op(OP_VERIFY);\n // 2. Payment scriptPubKey (output 0) == payment.bytes\n b.pushInt(0)\n .op(OP_OUTPUTSCRIPT)\n .pushBytes(payment.bytes)\n .op(OP_EQUALVERIFY);\n // 3. Asset to buyer (output 1) amount == N\n b.op(OP_DUP)\n .pushInt(1)\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_OUTPUTASSETFIELD)\n .op(OP_EQUALVERIFY);\n // 4. Asset to buyer (output 1) name == tokenId\n b.pushInt(1)\n .pushInt(ASSETFIELD_NAME)\n .op(OP_OUTPUTASSETFIELD)\n .pushBytes(tokenIdBytes)\n .op(OP_EQUALVERIFY);\n // 5. Remainder continuity (output 2) — same scriptPubKey as spent\n b.pushInt(2)\n .op(OP_OUTPUTSCRIPT)\n .pushInt(TXFIELD_SCRIPTPUBKEY)\n .op(OP_TXFIELD)\n .op(OP_EQUALVERIFY);\n // 6. Remainder tokenId\n b.pushInt(2)\n .pushInt(ASSETFIELD_NAME)\n .op(OP_OUTPUTASSETFIELD)\n .pushBytes(tokenIdBytes)\n .op(OP_EQUALVERIFY);\n // 7. Remainder amount == inputAssetAmount - N\n b.pushInt(2)\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_OUTPUTASSETFIELD)\n .op(OP_OVER)\n .pushInt(0)\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_INPUTASSETFIELD)\n .op(OP_SWAP)\n .op(OP_SUB)\n .op(OP_EQUALVERIFY);\n b.op(OP_DROP).pushInt(1);\n b.op(OP_ENDIF);\n return b.build();\n}\nexport function buildPartialFillScriptPQHex(params) {\n return bytesToHex(buildPartialFillScriptPQ(params));\n}\n","/**\n * scriptSig builders for the Partial-Fill Sell Order covenant.\n *\n * These return the raw scriptSig bytes that unlock the covenant UTXO. The\n * surrounding transaction (inputs, outputs, fees, signatures on the buyer's\n * own inputs, etc.) is the caller's responsibility — stitch them together\n * with `@neuraiproject/neurai-create-transaction`.\n */\nimport { bytesToHex } from '../../core/bytes.js';\nimport { ScriptBuilder } from '../../core/script-builder.js';\n/**\n * Unlock the covenant via the public partial-fill branch.\n *\n * Layout on the stack before OP_IF executes (top → bottom):\n * 0 ← selects the OP_ELSE (fill) branch\n * N ← amount of asset the buyer is taking from this order\n *\n * so the scriptSig pushes `<N>` then `<0>`.\n *\n * @param amount units of the asset the buyer is taking. Must be > 0 and\n * strictly less than the amount locked in the order UTXO\n * (equal would leave a zero-asset remainder, which isn't a\n * valid Neurai transfer output).\n */\nexport function buildFillScriptSig(amount) {\n if (typeof amount !== 'bigint') {\n throw new Error('amount must be a bigint');\n }\n if (amount <= 0n) {\n throw new Error('fill amount must be > 0');\n }\n return new ScriptBuilder()\n .pushInt(amount)\n .pushInt(0)\n .build();\n}\nexport function buildFillScriptSigHex(amount) {\n return bytesToHex(buildFillScriptSig(amount));\n}\n/**\n * Unlock the covenant via the seller's cancel branch.\n *\n * Stack before OP_IF (top → bottom):\n * 1 ← selects the OP_IF branch\n * pubkey ← consumed by OP_DUP OP_HASH160 … OP_EQUALVERIFY\n * sig ← consumed by OP_CHECKSIG\n *\n * so the scriptSig pushes `<sig> <pubkey> <1>`.\n *\n * The signature is on whatever sighash the caller picked; this builder does\n * not hash or sign, it only assembles the unlock script once a signature is\n * available.\n */\nexport function buildCancelScriptSig(signatureDer, pubKey) {\n if (!(signatureDer instanceof Uint8Array) || signatureDer.length === 0) {\n throw new Error('signatureDer must be a non-empty Uint8Array');\n }\n if (!(pubKey instanceof Uint8Array) || (pubKey.length !== 33 && pubKey.length !== 65)) {\n throw new Error('pubKey must be a compressed (33B) or uncompressed (65B) secp256k1 key');\n }\n return new ScriptBuilder()\n .pushBytes(signatureDer)\n .pushBytes(pubKey)\n .pushInt(1)\n .build();\n}\nexport function buildCancelScriptSigHex(signatureDer, pubKey) {\n return bytesToHex(buildCancelScriptSig(signatureDer, pubKey));\n}\n","/**\n * scriptSig builders for the PQ Partial-Fill Sell Order covenant.\n *\n * The fill branch is identical to the legacy variant (just pushes `<N> <0>`),\n * so callers reuse `buildFillScriptSig` from `./spend.ts`. Only the cancel\n * branch is different: it carries a full PQ pubkey (~1313 B) and signature\n * (~2421 B), which requires NIP-18's expanded element-size cap.\n */\nimport { bytesToHex } from '../../core/bytes.js';\nimport { ScriptBuilder } from '../../core/script-builder.js';\n/**\n * Build the scriptSig that unlocks the PQ cancel branch.\n *\n * Stack ordering pushed (bottom → top): `sig, pubkey, 1`.\n *\n * @param sigPQ ML-DSA-44 signature over `SHA256(OP_TXHASH(selector))`,\n * **with trailing sighash byte appended** (same convention as\n * OP_CHECKSIG — CSFS strips it before verification). Expected\n * length 2421 bytes for ML-DSA-44.\n * @param pubKey Versioned PQ public key bytes, 1313 bytes (1-byte prefix\n * + 1312-byte ML-DSA-44 key). Must hash (via SHA256) to the\n * `pubKeyCommitment` embedded in the covenant scriptPubKey.\n */\nexport function buildCancelScriptSigPQ(sigPQ, pubKey) {\n if (!(sigPQ instanceof Uint8Array) || sigPQ.length === 0) {\n throw new Error('sigPQ must be a non-empty Uint8Array');\n }\n if (sigPQ.length > 3072) {\n throw new Error(`sigPQ of ${sigPQ.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (3072)`);\n }\n if (!(pubKey instanceof Uint8Array) || pubKey.length === 0) {\n throw new Error('pubKey must be a non-empty Uint8Array');\n }\n if (pubKey.length > 3072) {\n throw new Error(`pubKey of ${pubKey.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (3072)`);\n }\n return new ScriptBuilder()\n .pushBytes(sigPQ)\n .pushBytes(pubKey)\n .pushInt(1)\n .build();\n}\nexport function buildCancelScriptSigPQHex(sigPQ, pubKey) {\n return bytesToHex(buildCancelScriptSigPQ(sigPQ, pubKey));\n}\n","/**\n * Shared parsing primitives for strict covenant parsers. Each covenant\n * parser walks the exact byte layout emitted by its builder and fails on\n * any deviation; the primitives here centralize the cursor arithmetic,\n * pushdata decoding, and CScriptNum decoding so the legacy and PQ parsers\n * (and future covenant parsers) cannot drift in rigor.\n */\nimport { OP_1 } from './opcodes.js';\nexport function makeCursor(bytes) {\n return { bytes, pos: 0 };\n}\n/** Consume one byte and verify it equals `expected`. */\nexport function expectByte(c, expected, label) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: unexpected end of script while reading ${label}`);\n }\n const got = c.bytes[c.pos];\n if (got !== expected) {\n throw new Error(`parse: expected ${label} = 0x${expected.toString(16)} at offset ${c.pos}, got 0x${got.toString(16)}`);\n }\n c.pos += 1;\n}\n/** Fail if the cursor has not consumed every byte of the script. */\nexport function assertTrailing(c) {\n if (c.pos !== c.bytes.length) {\n throw new Error(`parse: ${c.bytes.length - c.pos} trailing bytes after end of script`);\n }\n}\n/**\n * Read one pushdata element from the cursor. Supports direct pushes\n * (1..75 bytes), `OP_PUSHDATA1` and `OP_PUSHDATA2`. `OP_PUSHDATA4` is not\n * supported by any current covenant script and would overflow the\n * per-element cap anyway. Truncation is checked for all length fields\n * and payload ranges.\n */\nexport function readPush(c, label) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: unexpected end of script while reading push for ${label}`);\n }\n const opcode = c.bytes[c.pos];\n c.pos += 1;\n // Short direct push: 1..75 bytes\n if (opcode >= 0x01 && opcode <= 0x4b) {\n const len = opcode;\n if (c.pos + len > c.bytes.length) {\n throw new Error(`parse: short push of ${len} bytes exceeds script length at ${label}`);\n }\n const data = c.bytes.slice(c.pos, c.pos + len);\n c.pos += len;\n return data;\n }\n // OP_PUSHDATA1\n if (opcode === 0x4c) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: truncated PUSHDATA1 length at ${label}`);\n }\n const len = c.bytes[c.pos];\n c.pos += 1;\n if (c.pos + len > c.bytes.length) {\n throw new Error(`parse: PUSHDATA1 of ${len} bytes exceeds script length at ${label}`);\n }\n const data = c.bytes.slice(c.pos, c.pos + len);\n c.pos += len;\n return data;\n }\n // OP_PUSHDATA2\n if (opcode === 0x4d) {\n if (c.pos + 2 > c.bytes.length) {\n throw new Error(`parse: truncated PUSHDATA2 length at ${label}`);\n }\n const len = c.bytes[c.pos] | (c.bytes[c.pos + 1] << 8);\n c.pos += 2;\n if (c.pos + len > c.bytes.length) {\n throw new Error(`parse: PUSHDATA2 of ${len} bytes exceeds script length at ${label}`);\n }\n const data = c.bytes.slice(c.pos, c.pos + len);\n c.pos += len;\n return data;\n }\n throw new Error(`parse: expected a pushdata opcode at ${label}, got 0x${opcode.toString(16)} at offset ${c.pos - 1}`);\n}\n/**\n * Decode a `CScriptNum` byte vector (little-endian sign-magnitude, up to\n * 8 bytes) into a BigInt. Empty vector encodes 0.\n */\nexport function decodeScriptNum(data, label) {\n if (data.length === 0)\n return 0n;\n if (data.length > 8) {\n throw new Error(`parse: CScriptNum at ${label} exceeds 8 bytes`);\n }\n let n = 0n;\n for (let i = 0; i < data.length - 1; i += 1) {\n n |= BigInt(data[i]) << BigInt(8 * i);\n }\n const last = data[data.length - 1];\n n |= BigInt(last & 0x7f) << BigInt(8 * (data.length - 1));\n if (last & 0x80) {\n n = -n;\n }\n return n;\n}\n/**\n * Read a push as a non-negative CScriptNum. Recognises OP_1..OP_16\n * shorthand. `OP_0` is not accepted because the covenant callers use this\n * only for values that are strictly positive (prices, selectors, indices).\n */\nexport function readPushPositiveInt(c, label) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: end of script at ${label}`);\n }\n const opcode = c.bytes[c.pos];\n if (opcode >= OP_1 && opcode <= 0x60) {\n c.pos += 1;\n return BigInt(opcode - OP_1 + 1);\n }\n const data = readPush(c, label);\n return decodeScriptNum(data, label);\n}\n/**\n * Read a 1-byte selector as an UNSIGNED 8-bit integer (0..255). Accepts\n * two on-wire encodings, because old vs new covenant builders differ:\n * - `OP_1..OP_16` shorthand (single opcode) → values 1..16.\n * - `0x01 <byte>` raw 1-byte push → any value 1..255.\n *\n * Values 0x80..0xff MUST use the raw-push form; the CScriptNum encoding\n * would need a 0x00 padding byte and become 2 bytes on-stack, which\n * consensus `OP_TXHASH` rejects. The builder in `script-pq.ts` emits the\n * raw-push form unconditionally; the parser stays lenient so covenants\n * built by older tools (using OP_N for small values) still round-trip.\n */\nexport function readPushUint8(c, label) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: end of script at ${label}`);\n }\n const opcode = c.bytes[c.pos];\n if (opcode >= OP_1 && opcode <= 0x60) {\n c.pos += 1;\n return opcode - OP_1 + 1;\n }\n const data = readPush(c, label);\n if (data.length !== 1) {\n throw new Error(`parse: ${label} must be a single-byte push, got ${data.length} bytes`);\n }\n return data[0];\n}\n","/**\n * Parser for the Partial-Fill Sell Order covenant.\n *\n * Extracts `(sellerPubKeyHash, unitPriceSats, tokenId)` from a scriptPubKey\n * that was produced by `buildPartialFillScript`. The parser walks the exact\n * byte layout emitted by the builder and fails on any deviation — this is\n * deliberate, so a downstream indexer can unambiguously classify a UTXO as\n * \"partial-fill order\" or \"unknown script\" with no false positives.\n */\nimport { bytesEqual, bytesToHex, hexToBytes } from '../../core/bytes.js';\nimport { ASSETFIELD_AMOUNT, ASSETFIELD_NAME, OP_0, OP_1, OP_2, OP_3, OP_CHECKSIG, OP_DROP, OP_DUP, OP_ELSE, OP_ENDIF, OP_EQUALVERIFY, OP_GREATERTHANOREQUAL, OP_HASH160, OP_IF, OP_INPUTASSETFIELD, OP_MUL, OP_OUTPUTASSETFIELD, OP_OUTPUTSCRIPT, OP_OUTPUTVALUE, OP_OVER, OP_SUB, OP_SWAP, OP_TXFIELD, OP_VERIFY, TXFIELD_SCRIPTPUBKEY } from '../../core/opcodes.js';\nimport { assertTrailing, expectByte, makeCursor, readPush, readPushPositiveInt } from '../../core/script-parser.js';\n/**\n * Parse a covenant scriptPubKey and extract its parameters. Throws with a\n * descriptive message if the bytes don't match the partial-fill template.\n */\nexport function parsePartialFillScript(script, network = 'xna-test') {\n const bytes = typeof script === 'string' ? hexToBytes(script) : script;\n const c = makeCursor(bytes);\n // ───── Cancel branch prefix ─────\n expectByte(c, OP_IF, 'OP_IF');\n expectByte(c, OP_DUP, 'OP_DUP (cancel)');\n expectByte(c, OP_HASH160, 'OP_HASH160');\n const sellerPubKeyHash = readPush(c, 'sellerPubKeyHash');\n if (sellerPubKeyHash.length !== 20) {\n throw new Error(`parse: sellerPubKeyHash is ${sellerPubKeyHash.length} bytes, expected 20`);\n }\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (cancel)');\n expectByte(c, OP_CHECKSIG, 'OP_CHECKSIG (cancel)');\n expectByte(c, OP_ELSE, 'OP_ELSE');\n // ───── Payment value check ─────\n expectByte(c, OP_DUP, 'OP_DUP (price)');\n const unitPriceSats = readPushPositiveInt(c, 'unitPriceSats');\n expectByte(c, OP_MUL, 'OP_MUL');\n expectByte(c, OP_0, 'OP_0 (payment idx)');\n expectByte(c, OP_OUTPUTVALUE, 'OP_OUTPUTVALUE');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_GREATERTHANOREQUAL, 'OP_GREATERTHANOREQUAL');\n expectByte(c, OP_VERIFY, 'OP_VERIFY (payment)');\n // ───── Payment scriptPubKey check ─────\n expectByte(c, OP_0, 'OP_0 (spk idx)');\n expectByte(c, OP_OUTPUTSCRIPT, 'OP_OUTPUTSCRIPT (payment)');\n const sellerSpk = readPush(c, 'sellerScriptPubKey');\n // Must be P2PKH with our PKH.\n const expectedSpk = new Uint8Array([\n OP_DUP, OP_HASH160, 0x14, ...sellerPubKeyHash, OP_EQUALVERIFY, OP_CHECKSIG\n ]);\n if (!bytesEqual(sellerSpk, expectedSpk)) {\n throw new Error('parse: embedded seller scriptPubKey does not match the cancel PKH');\n }\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (payment spk)');\n // ───── Buyer asset amount check (output 1) ─────\n expectByte(c, OP_DUP, 'OP_DUP (buyer amount)');\n expectByte(c, OP_1, 'OP_1 (buyer idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n if (ASSETFIELD_AMOUNT !== 0x02)\n throw new Error('unexpected AMOUNT selector constant');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (buyer amount)');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (buyer amount)');\n // ───── Buyer asset name check (output 1) ─────\n expectByte(c, OP_1, 'OP_1 (buyer idx)');\n expectByte(c, OP_1, 'OP_1 (NAME selector)');\n if (ASSETFIELD_NAME !== 0x01)\n throw new Error('unexpected NAME selector constant');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (buyer name)');\n const tokenIdBytes1 = readPush(c, 'tokenId #1');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (buyer name)');\n // ───── Remainder continuity: same scriptPubKey ─────\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_OUTPUTSCRIPT, 'OP_OUTPUTSCRIPT (remainder)');\n expectByte(c, OP_3, 'OP_3 (TXFIELD selector)');\n if (TXFIELD_SCRIPTPUBKEY !== 0x03)\n throw new Error('unexpected TXFIELD selector constant');\n expectByte(c, OP_TXFIELD, 'OP_TXFIELD');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder spk)');\n // ───── Remainder tokenId check ─────\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_1, 'OP_1 (NAME selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (remainder name)');\n const tokenIdBytes2 = readPush(c, 'tokenId #2');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder name)');\n // ───── Remainder amount == input amount - N ─────\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (remainder amount)');\n expectByte(c, OP_OVER, 'OP_OVER');\n expectByte(c, OP_0, 'OP_0 (input idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_INPUTASSETFIELD, 'OP_INPUTASSETFIELD');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_SUB, 'OP_SUB');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder amount)');\n // ───── Tail ─────\n expectByte(c, OP_DROP, 'OP_DROP');\n expectByte(c, OP_1, 'OP_1 (true)');\n expectByte(c, OP_ENDIF, 'OP_ENDIF');\n assertTrailing(c);\n if (!bytesEqual(tokenIdBytes1, tokenIdBytes2)) {\n throw new Error('parse: tokenId bytes differ between buyer and remainder checks');\n }\n const tokenId = new TextDecoder('utf-8', { fatal: true }).decode(tokenIdBytes1);\n return {\n network,\n sellerPubKeyHash,\n unitPriceSats,\n tokenId,\n scriptHex: bytesToHex(bytes)\n };\n}\n","/**\n * Parser for the PQ Partial-Fill Sell Order covenant. Returns the same\n * economic parameters as the legacy parser, plus the payment scriptPubKey\n * bytes (which may be P2PKH or AuthScript) and the configured TXHASH\n * selector.\n */\nimport { bytesEqual, bytesToHex, hexToBytes } from '../../core/bytes.js';\nimport { OP_0, OP_1, OP_2, OP_3, OP_CHECKSIGFROMSTACK, OP_DROP, OP_DUP, OP_ELSE, OP_ENDIF, OP_EQUALVERIFY, OP_GREATERTHANOREQUAL, OP_IF, OP_INPUTASSETFIELD, OP_MUL, OP_OUTPUTASSETFIELD, OP_OUTPUTSCRIPT, OP_OUTPUTVALUE, OP_OVER, OP_SHA256, OP_SUB, OP_SWAP, OP_TXFIELD, OP_TXHASH, OP_VERIFY } from '../../core/opcodes.js';\nimport { assertTrailing, expectByte, makeCursor, readPush, readPushPositiveInt, readPushUint8 } from '../../core/script-parser.js';\n/** Quick discriminator without throwing — useful for indexers. */\nexport function isPartialFillScriptPQ(script) {\n const bytes = typeof script === 'string' ? hexToBytes(script) : script;\n // PQ cancel starts with: OP_IF OP_DUP OP_SHA256\n return (bytes.length > 3 &&\n bytes[0] === OP_IF &&\n bytes[1] === OP_DUP &&\n bytes[2] === OP_SHA256);\n}\n/**\n * Parse a PQ partial-fill covenant. Throws if the bytes do not match the\n * exact layout produced by `buildPartialFillScriptPQ`.\n */\nexport function parsePartialFillScriptPQ(script, network = 'xna-test') {\n const bytes = typeof script === 'string' ? hexToBytes(script) : script;\n const c = makeCursor(bytes);\n // ───── Cancel branch (PQ) ─────\n expectByte(c, OP_IF, 'OP_IF');\n expectByte(c, OP_DUP, 'OP_DUP (cancel)');\n expectByte(c, OP_SHA256, 'OP_SHA256');\n const pubKeyCommitment = readPush(c, 'pubKeyCommitment');\n if (pubKeyCommitment.length !== 32) {\n throw new Error(`parse-pq: pubKeyCommitment must be 32 bytes, got ${pubKeyCommitment.length}`);\n }\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (cancel)');\n // Selector is read as an unsigned byte — consensus OP_TXHASH treats the\n // on-stack element as uint8, and the builder emits a raw 1-byte push so\n // selectors 0x80..0xff round-trip correctly (plan v3 bug B).\n const txHashSelector = readPushUint8(c, 'txHashSelector');\n if (txHashSelector < 1) {\n throw new Error(`parse-pq: txHashSelector 0x00 is rejected by OP_TXHASH`);\n }\n expectByte(c, OP_TXHASH, 'OP_TXHASH');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_CHECKSIGFROMSTACK, 'OP_CHECKSIGFROMSTACK');\n expectByte(c, OP_ELSE, 'OP_ELSE');\n // ───── Fill branch ─────\n expectByte(c, OP_DUP, 'OP_DUP (price)');\n const unitPriceSats = readPushPositiveInt(c, 'unitPriceSats');\n expectByte(c, OP_MUL, 'OP_MUL');\n expectByte(c, OP_0, 'OP_0 (payment idx)');\n expectByte(c, OP_OUTPUTVALUE, 'OP_OUTPUTVALUE');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_GREATERTHANOREQUAL, 'OP_GE');\n expectByte(c, OP_VERIFY, 'OP_VERIFY');\n expectByte(c, OP_0, 'OP_0 (payment spk idx)');\n expectByte(c, OP_OUTPUTSCRIPT, 'OP_OUTPUTSCRIPT (payment)');\n const paymentScriptPubKey = readPush(c, 'paymentScriptPubKey');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (payment)');\n expectByte(c, OP_DUP, 'OP_DUP (buyer amount)');\n expectByte(c, OP_1, 'OP_1 (buyer idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (buyer amount)');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (buyer amount)');\n expectByte(c, OP_1, 'OP_1 (buyer idx)');\n expectByte(c, OP_1, 'OP_1 (NAME selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (buyer name)');\n const tokenIdBytes1 = readPush(c, 'tokenId #1');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (buyer name)');\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_OUTPUTSCRIPT, 'OP_OUTPUTSCRIPT (remainder)');\n expectByte(c, OP_3, 'OP_3 (TXFIELD selector)');\n expectByte(c, OP_TXFIELD, 'OP_TXFIELD');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder spk)');\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_1, 'OP_1 (NAME selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (remainder name)');\n const tokenIdBytes2 = readPush(c, 'tokenId #2');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder name)');\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (remainder amount)');\n expectByte(c, OP_OVER, 'OP_OVER');\n expectByte(c, OP_0, 'OP_0 (input idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_INPUTASSETFIELD, 'OP_INPUTASSETFIELD');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_SUB, 'OP_SUB');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder amount)');\n expectByte(c, OP_DROP, 'OP_DROP');\n expectByte(c, OP_1, 'OP_1 (true)');\n expectByte(c, OP_ENDIF, 'OP_ENDIF');\n assertTrailing(c);\n if (!bytesEqual(tokenIdBytes1, tokenIdBytes2)) {\n throw new Error('parse-pq: tokenId differs between buyer and remainder checks');\n }\n const tokenId = new TextDecoder('utf-8', { fatal: true }).decode(tokenIdBytes1);\n return {\n network,\n pubKeyCommitment,\n tokenId,\n unitPriceSats,\n txHashSelector,\n paymentScriptPubKey,\n scriptHex: bytesToHex(bytes)\n };\n}\n","// ---------- Core primitives ----------\nexport { bytesToHex, hexToBytes, concatBytes, bytesEqual, ensureHex } from './core/bytes.js';\nexport { ScriptBuilder, encodeScriptNum, pushBytes, pushInt, pushHex } from './core/script-builder.js';\nexport * as opcodes from './core/opcodes.js';\n// ---------- Standard scripts ----------\nexport { encodeP2PKHScriptPubKey, encodeP2WPKHScriptPubKey, encodeP2WSHScriptPubKey, encodeAuthScriptScriptPubKey, buildAuthScriptWitnessLegacy, buildAuthScriptWitnessPQ, buildAuthScriptWitnessNoAuth, buildAuthScriptWitnessRef, AUTHSCRIPT_NOAUTH, AUTHSCRIPT_PQ, AUTHSCRIPT_LEGACY, AUTHSCRIPT_REF, encodeNullDataScript, NULLDATA_STANDARD_MAX_SIZE, encodeMultisigRedeemScript, encodeMultisigRedeemScriptHex, encodeP2SHScriptPubKey, MULTISIG_MAX_PUBKEYS } from './standard/index.js';\n// ---------- Address helpers (thin wrapper around standard/*) ----------\nexport { encodeSellerScriptPubKey } from './address.js';\n// ---------- Asset-transfer wrapper ----------\nexport { splitAssetWrappedScriptPubKey } from './asset-wrapper.js';\n// ---------- Covenants ----------\nexport { \n// Legacy (ECDSA cancel)\nbuildPartialFillScript, buildPartialFillScriptHex, buildFillScriptSig, buildFillScriptSigHex, buildCancelScriptSig, buildCancelScriptSigHex, parsePartialFillScript, \n// PQ (ML-DSA-44 cancel via OP_CHECKSIGFROMSTACK + NIP-18)\nbuildPartialFillScriptPQ, buildPartialFillScriptPQHex, buildCancelScriptSigPQ, buildCancelScriptSigPQHex, parsePartialFillScriptPQ, isPartialFillScriptPQ, DEFAULT_PQ_TXHASH_SELECTOR } from './covenants/index.js';\n","import * as NeuraiScripts from '../index.js';\nconst globalTarget = globalThis;\nglobalTarget.NeuraiScripts = NeuraiScripts;\nexport { NeuraiScripts };\n"],"names":["ASSET_NAME_MAX","assertTokenId","assertPrice"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACO,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,GAAG,KAAK,EAAE;IAC9C,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;IAC7D,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE;IACxE,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC5E,IAAI;IACJ,IAAI,OAAO,UAAU;IACrB;IACO,SAAS,UAAU,CAAC,GAAG,EAAE;IAChC,IAAI,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC;IACrC,IAAI,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACvD,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;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,gBAAgB;IACxB,QAAQ,OAAO;IACf,QAAQ,aAAa;IACrB,QAAQ,cAAc;IACtB,QAAQ,mBAAmB;IAC3B,QAAQ,SAAS,EAAE,UAAU,CAAC,KAAK;IACnC,KAAK;IACL;;ICzGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICCA,MAAM,YAAY,GAAG,UAAU;IAC/B,YAAY,CAAC,aAAa,GAAG,aAAa;;;;;;;;;;","x_google_ignoreList":[9]}
1
+ {"version":3,"file":"NeuraiScripts.global.js","sources":["../build/core/bytes.js","../build/core/opcodes.js","../build/core/script-builder.js","../build/standard/p2pkh.js","../build/standard/p2wpkh.js","../build/standard/p2wsh.js","../build/standard/authscript.js","../build/standard/nulldata.js","../build/standard/multisig.js","../node_modules/@neuraiproject/neurai-create-transaction/dist/index.js","../build/address.js","../build/asset-wrapper.js","../build/covenants/partial-fill/script.js","../build/covenants/partial-fill/script-pq.js","../build/covenants/partial-fill/spend.js","../build/covenants/partial-fill/spend-pq.js","../build/core/script-parser.js","../build/covenants/partial-fill/parse.js","../build/covenants/partial-fill/parse-pq.js","../build/index.js","../build/entries/global.js"],"sourcesContent":["/**\n * Minimal byte helpers. A subset of what `neurai-create-transaction` exposes,\n * duplicated here to keep this package free of runtime coupling beyond its\n * declared `dependencies` field. All sizes are little-endian, per Neurai.\n */\nexport function ensureHex(hex, label = 'hex') {\n const normalized = String(hex || '').trim().toLowerCase();\n if (!/^[0-9a-f]*$/.test(normalized) || normalized.length % 2 !== 0) {\n throw new Error(`Invalid ${label}: expected even-length hex string`);\n }\n return normalized;\n}\nexport function hexToBytes(hex) {\n const normalized = ensureHex(hex);\n const bytes = new Uint8Array(normalized.length / 2);\n for (let i = 0; i < normalized.length; i += 2) {\n bytes[i / 2] = Number.parseInt(normalized.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function bytesToHex(bytes) {\n return Array.from(bytes, (value) => value.toString(16).padStart(2, '0')).join('');\n}\nexport function concatBytes(...parts) {\n const total = parts.reduce((sum, part) => sum + part.length, 0);\n const out = new Uint8Array(total);\n let offset = 0;\n for (const part of parts) {\n out.set(part, offset);\n offset += part.length;\n }\n return out;\n}\nexport function bytesEqual(a, b) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i += 1) {\n if (a[i] !== b[i])\n return false;\n }\n return true;\n}\n","/**\n * Opcode constants for Neurai Script.\n *\n * Covers:\n * - Classic Script opcodes used by covenants.\n * - New opcodes activated in the `DePIN-Test` branch (BIP 119, BIP 347 and\n * Neurai-specific introspection / asset / arithmetic additions).\n *\n * Authority: `src/script/script.h` (enum `opcodetype`) in the Neurai repo.\n * Reference: `doc/new-opcodes-depin-branch.md`.\n *\n * Disabled in consensus and intentionally omitted: OP_SUBSTR, OP_LEFT,\n * OP_RIGHT, OP_INVERT, OP_AND, OP_OR, OP_XOR, OP_2MUL, OP_2DIV, OP_LSHIFT,\n * OP_RSHIFT. Also omitted: OP_VER / OP_VERIF / OP_VERNOTIF (reserved), the\n * template-matching pseudo-opcodes (OP_SMALLINTEGER, OP_PUBKEYS,\n * OP_PUBKEYHASH, OP_PUBKEY) and OP_INVALIDOPCODE.\n */\n// ---------- Push values ----------\nexport const OP_0 = 0x00;\nexport const OP_FALSE = OP_0;\nexport const OP_PUSHDATA1 = 0x4c;\nexport const OP_PUSHDATA2 = 0x4d;\nexport const OP_PUSHDATA4 = 0x4e;\nexport const OP_1NEGATE = 0x4f;\nexport const OP_RESERVED = 0x50;\nexport const OP_1 = 0x51;\nexport const OP_TRUE = OP_1;\nexport const OP_2 = 0x52;\nexport const OP_3 = 0x53;\nexport const OP_4 = 0x54;\nexport const OP_5 = 0x55;\nexport const OP_6 = 0x56;\nexport const OP_7 = 0x57;\nexport const OP_8 = 0x58;\nexport const OP_9 = 0x59;\nexport const OP_10 = 0x5a;\nexport const OP_11 = 0x5b;\nexport const OP_12 = 0x5c;\nexport const OP_13 = 0x5d;\nexport const OP_14 = 0x5e;\nexport const OP_15 = 0x5f;\nexport const OP_16 = 0x60;\n// ---------- Control flow ----------\nexport const OP_NOP = 0x61;\nexport const OP_IF = 0x63;\nexport const OP_NOTIF = 0x64;\nexport const OP_ELSE = 0x67;\nexport const OP_ENDIF = 0x68;\nexport const OP_VERIFY = 0x69;\nexport const OP_RETURN = 0x6a;\n// ---------- Stack ----------\nexport const OP_TOALTSTACK = 0x6b;\nexport const OP_FROMALTSTACK = 0x6c;\nexport const OP_2DROP = 0x6d;\nexport const OP_2DUP = 0x6e;\nexport const OP_3DUP = 0x6f;\nexport const OP_2OVER = 0x70;\nexport const OP_2ROT = 0x71;\nexport const OP_2SWAP = 0x72;\nexport const OP_IFDUP = 0x73;\nexport const OP_DEPTH = 0x74;\nexport const OP_DROP = 0x75;\nexport const OP_DUP = 0x76;\nexport const OP_NIP = 0x77;\nexport const OP_OVER = 0x78;\nexport const OP_PICK = 0x79;\nexport const OP_ROLL = 0x7a;\nexport const OP_ROT = 0x7b;\nexport const OP_SWAP = 0x7c;\nexport const OP_TUCK = 0x7d;\n// ---------- Splice ----------\nexport const OP_SIZE = 0x82;\n// ---------- Bitwise / comparison ----------\nexport const OP_EQUAL = 0x87;\nexport const OP_EQUALVERIFY = 0x88;\n// ---------- Unary numeric ----------\nexport const OP_1ADD = 0x8b;\nexport const OP_1SUB = 0x8c;\nexport const OP_NEGATE = 0x8f;\nexport const OP_ABS = 0x90;\nexport const OP_NOT = 0x91;\nexport const OP_0NOTEQUAL = 0x92;\n// ---------- Arithmetic (64-bit after SCRIPT_VERIFY_64BIT_INTEGERS) ----------\nexport const OP_ADD = 0x93;\nexport const OP_SUB = 0x94;\nexport const OP_MUL = 0x95;\nexport const OP_DIV = 0x96;\nexport const OP_MOD = 0x97;\n// ---------- Boolean / numeric comparison ----------\nexport const OP_BOOLAND = 0x9a;\nexport const OP_BOOLOR = 0x9b;\nexport const OP_NUMEQUAL = 0x9c;\nexport const OP_NUMEQUALVERIFY = 0x9d;\nexport const OP_NUMNOTEQUAL = 0x9e;\nexport const OP_LESSTHAN = 0x9f;\nexport const OP_GREATERTHAN = 0xa0;\nexport const OP_LESSTHANOREQUAL = 0xa1;\nexport const OP_GREATERTHANOREQUAL = 0xa2;\nexport const OP_MIN = 0xa3;\nexport const OP_MAX = 0xa4;\nexport const OP_WITHIN = 0xa5;\n// ---------- Crypto ----------\nexport const OP_RIPEMD160 = 0xa6;\nexport const OP_SHA1 = 0xa7;\nexport const OP_SHA256 = 0xa8;\nexport const OP_HASH160 = 0xa9;\nexport const OP_HASH256 = 0xaa;\nexport const OP_CODESEPARATOR = 0xab;\nexport const OP_CHECKSIG = 0xac;\nexport const OP_CHECKSIGVERIFY = 0xad;\nexport const OP_CHECKMULTISIG = 0xae;\nexport const OP_CHECKMULTISIGVERIFY = 0xaf;\n// ---------- Expansion / NOPs ----------\n// Only the NOPs not aliased by DePIN-Test opcodes are exported as NOPs.\n// OP_NOP2 == OP_CHECKLOCKTIMEVERIFY (0xb1)\n// OP_NOP3 == OP_CHECKSEQUENCEVERIFY (0xb2)\n// OP_NOP4 == OP_CHECKTEMPLATEVERIFY (0xb3)\n// OP_NOP5 == OP_CHECKSIGFROMSTACK (0xb4)\n// OP_NOP6 == OP_TXHASH (0xb5)\n// OP_NOP7 == OP_TXFIELD (0xb6)\n// OP_NOP8 == OP_SPLIT (0xb7)\nexport const OP_NOP1 = 0xb0;\nexport const OP_NOP9 = 0xb8;\nexport const OP_NOP10 = 0xb9;\n// ---------- Locktime ----------\nexport const OP_CHECKLOCKTIMEVERIFY = 0xb1;\nexport const OP_CHECKSEQUENCEVERIFY = 0xb2;\n// ---------- Covenants & templates (DePIN-Test) ----------\nexport const OP_CHECKTEMPLATEVERIFY = 0xb3; // BIP 119\nexport const OP_CHECKSIGFROMSTACK = 0xb4;\n// ---------- Transaction introspection (DePIN-Test) ----------\nexport const OP_TXHASH = 0xb5;\nexport const OP_TXFIELD = 0xb6;\nexport const OP_TXLOCKTIME = 0xc5;\nexport const OP_OUTPUTVALUE = 0xcc;\nexport const OP_OUTPUTSCRIPT = 0xcd;\nexport const OP_INPUTCOUNT = 0xd0;\nexport const OP_OUTPUTCOUNT = 0xd1;\n// ---------- Asset introspection (DePIN-Test) ----------\nexport const OP_OUTPUTASSETFIELD = 0xce;\nexport const OP_INPUTASSETFIELD = 0xcf;\nexport const OP_XNA_ASSET = 0xc0;\n// ---------- Reference inputs (DePIN-Test, NIP-017) ----------\nexport const OP_REFINPUTFIELD = 0xd2;\nexport const OP_REFINPUTASSETFIELD = 0xd3;\nexport const OP_REFINPUTCOUNT = 0xd4;\n// ---------- Output auth commitment introspection (NIP-023) ----------\n// Pushes the 32-byte AuthScript v1 commitment of a selected output's\n// scriptPubKey. Symmetric to TXFIELD_AUTHSCRIPT_COMMITMENT for inputs;\n// ignores any trailing OP_XNA_ASSET asset wrapper bytes.\nexport const OP_OUTPUTAUTHCOMMITMENT = 0xd5;\n// ---------- Byte manipulation (DePIN-Test) ----------\nexport const OP_CAT = 0x7e;\nexport const OP_SPLIT = 0xb7;\nexport const OP_REVERSEBYTES = 0xbc;\n// ---------- Selectors for OP_TXFIELD / OP_REFINPUTFIELD ----------\n// Both opcodes share the same selector table (OP_TXFIELD on the spent UTXO,\n// OP_REFINPUTFIELD on an output referenced via vrefin). Valid: 0x01..0x03.\nexport const TXFIELD_VALUE = 0x01;\nexport const TXFIELD_AUTHSCRIPT_COMMITMENT = 0x02;\nexport const TXFIELD_SCRIPTPUBKEY = 0x03;\n// ---------- Bitmask selectors for OP_TXHASH ----------\n// The selector is a single byte where each bit selects which transaction\n// field to include in the double-SHA256. Selector 0x00 is invalid; any\n// non-zero combination is valid. 0xff = all eight fields.\nexport const TXHASH_VERSION = 0x01;\nexport const TXHASH_LOCKTIME = 0x02;\nexport const TXHASH_INPUT_PREVOUTS = 0x04;\nexport const TXHASH_INPUT_SEQUENCES = 0x08;\nexport const TXHASH_OUTPUTS = 0x10;\nexport const TXHASH_CURRENT_PREVOUT = 0x20;\nexport const TXHASH_CURRENT_SEQUENCE = 0x40;\nexport const TXHASH_CURRENT_INDEX = 0x80;\nexport const TXHASH_ALL = 0xff;\n// ---------- Selectors for OP_OUTPUTASSETFIELD / OP_INPUTASSETFIELD / OP_REFINPUTASSETFIELD ----------\n// All three opcodes share the same selector table. Valid range: 0x01..0x07.\n// Selector 0x05 is the boolean \"has IPFS\" flag; 0x06 is the IPFS hash\n// payload; 0x07 is the asset operation type. (This matches the asset-op\n// encoding in `src/assets/assets.cpp` and the NIP spec §3.1.)\nexport const ASSETFIELD_NAME = 0x01;\nexport const ASSETFIELD_AMOUNT = 0x02;\nexport const ASSETFIELD_UNITS = 0x03;\nexport const ASSETFIELD_REISSUABLE = 0x04;\nexport const ASSETFIELD_HAS_IPFS = 0x05;\nexport const ASSETFIELD_IPFS_HASH = 0x06;\nexport const ASSETFIELD_TYPE = 0x07;\n","/**\n * Low-level Script assembler. Emits the exact byte layout expected by the\n * Neurai interpreter: pushdata prefixes follow the same rules as Bitcoin\n * (direct push for 1..75 bytes, OP_PUSHDATA1/2/4 otherwise), and integers\n * are minimally-encoded as CScriptNum.\n */\nimport { bytesToHex, concatBytes, hexToBytes } from './bytes.js';\nimport { OP_0, OP_1NEGATE, OP_1 } from './opcodes.js';\n/**\n * Minimal CScriptNum encoding (Bitcoin consensus rules).\n *\n * - 0 → empty vector\n * - 1..16 → single opcode OP_1..OP_16 (handled in `pushInt`, not here)\n * - -1 → OP_1NEGATE (handled in `pushInt`)\n * - otherwise: sign-magnitude little-endian, with a sign bit on the last byte\n */\nexport function encodeScriptNum(value) {\n let n = typeof value === 'bigint' ? value : BigInt(value);\n if (n === 0n)\n return new Uint8Array();\n const negative = n < 0n;\n if (negative)\n n = -n;\n const result = [];\n while (n > 0n) {\n result.push(Number(n & 0xffn));\n n >>= 8n;\n }\n // If the most-significant bit is set, add a padding byte so the sign bit\n // is unambiguous. If negative, flip that sign bit instead.\n if (result[result.length - 1] & 0x80) {\n result.push(negative ? 0x80 : 0x00);\n }\n else if (negative) {\n result[result.length - 1] |= 0x80;\n }\n return Uint8Array.from(result);\n}\n/**\n * Emit a pushdata opcode followed by the payload. Chooses the shortest\n * valid encoding.\n *\n * Neurai Script caps stack elements at `MAX_SCRIPT_ELEMENT_SIZE = 520`\n * bytes by default, but NIP-18 raises the cap to\n * `MAX_PQ_SCRIPT_ELEMENT_SIZE = 3072` whenever\n * `SCRIPT_VERIFY_CHECKSIGFROMSTACK` is active (testnet today, mainnet once\n * the CSFS fork lands). The builder here emits pushes up to 3072 bytes so\n * it can target either regime; legacy scripts should stay under 520 bytes\n * per push, and the node will reject anything larger if the CSFS flag is\n * not set during evaluation.\n */\nexport function pushBytes(data) {\n if (data.length === 0) {\n return Uint8Array.of(OP_0);\n }\n if (data.length <= 75) {\n return concatBytes(Uint8Array.of(data.length), data);\n }\n if (data.length <= 0xff) {\n return concatBytes(Uint8Array.of(0x4c, data.length), data);\n }\n if (data.length <= 3072) {\n return concatBytes(Uint8Array.of(0x4d, data.length & 0xff, (data.length >> 8) & 0xff), data);\n }\n throw new Error(`pushBytes: element of ${data.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (3072)`);\n}\n/**\n * Emit a minimally-encoded integer push. Uses OP_1NEGATE, OP_0 and OP_1..OP_16\n * when available to match how the node's own templates look on the wire.\n */\nexport function pushInt(value) {\n const n = typeof value === 'bigint' ? value : BigInt(value);\n if (n === -1n)\n return Uint8Array.of(OP_1NEGATE);\n if (n === 0n)\n return Uint8Array.of(OP_0);\n if (n >= 1n && n <= 16n) {\n return Uint8Array.of(OP_1 + Number(n) - 1);\n }\n return pushBytes(encodeScriptNum(n));\n}\nexport function pushHex(hex) {\n return pushBytes(hexToBytes(hex));\n}\n/** Fluent assembler for readable script definitions. */\nexport class ScriptBuilder {\n parts = [];\n op(...opcodes) {\n for (const op of opcodes) {\n if (!Number.isInteger(op) || op < 0 || op > 0xff) {\n throw new Error(`Invalid opcode byte: ${op}`);\n }\n this.parts.push(Uint8Array.of(op));\n }\n return this;\n }\n pushInt(value) {\n this.parts.push(pushInt(value));\n return this;\n }\n pushBytes(data) {\n this.parts.push(pushBytes(data));\n return this;\n }\n pushHex(hex) {\n this.parts.push(pushHex(hex));\n return this;\n }\n raw(bytes) {\n this.parts.push(bytes);\n return this;\n }\n build() {\n return concatBytes(...this.parts);\n }\n buildHex() {\n return bytesToHex(this.build());\n }\n}\n","/**\n * Pay-to-Public-Key-Hash (P2PKH) scriptPubKey.\n * Layout: OP_DUP OP_HASH160 0x14 <20-byte PKH> OP_EQUALVERIFY OP_CHECKSIG\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, OP_HASH160 } from '../core/opcodes.js';\nexport function encodeP2PKHScriptPubKey(pubKeyHash) {\n if (!(pubKeyHash instanceof Uint8Array) || pubKeyHash.length !== 20) {\n throw new Error('P2PKH pubKeyHash must be a 20-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_DUP, OP_HASH160, 0x14), pubKeyHash, Uint8Array.of(OP_EQUALVERIFY, OP_CHECKSIG));\n}\n","/**\n * Native segwit v0 Pay-to-Witness-Public-Key-Hash (P2WPKH) scriptPubKey.\n * Layout: OP_0 0x14 <20-byte HASH160(pubKey)>\n *\n * Callers compute HASH160 externally (e.g. via neurai-key / their crypto\n * stack). This helper only encodes the scriptPubKey once the hash is known.\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { OP_0 } from '../core/opcodes.js';\nexport function encodeP2WPKHScriptPubKey(pubKeyHash) {\n if (!(pubKeyHash instanceof Uint8Array) || pubKeyHash.length !== 20) {\n throw new Error('P2WPKH pubKeyHash must be a 20-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_0, 0x14), pubKeyHash);\n}\n","/**\n * Native segwit v0 Pay-to-Witness-Script-Hash (P2WSH) scriptPubKey.\n * Layout: OP_0 0x20 <32-byte SHA256(witnessScript)>\n *\n * This helper takes the SHA256 digest of the witness script directly. The\n * SHA256 is computed externally by the caller's crypto stack (kept out of\n * this library to avoid a hash dependency).\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { OP_0 } from '../core/opcodes.js';\nexport function encodeP2WSHScriptPubKey(witnessScriptSha256) {\n if (!(witnessScriptSha256 instanceof Uint8Array) || witnessScriptSha256.length !== 32) {\n throw new Error('P2WSH witnessScriptSha256 must be a 32-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_0, 0x20), witnessScriptSha256);\n}\n","/**\n * AuthScript (witness v1) scriptPubKey + witness-stack builders.\n *\n * AuthScript outputs encode a 32-byte commitment in a witness v1 program:\n * scriptPubKey = OP_1 0x20 <32-byte program>\n *\n * The program is `HASH160`/`SHA256` over a descriptor that depends on the\n * `auth_type` byte carried as the first witness-stack element at spend time.\n * This library only assembles the stack; computing the descriptor/commitment\n * and producing the signature live in neurai-key / neurai-sign-transaction.\n *\n * Auth type values (authoritative: Neurai `src/script/interpreter.cpp`,\n * cross-checked against `lib/neurai-key/src/shared/address.ts`):\n *\n * 0x00 NoAuth — no signature; spend gated only by witnessScript\n * 0x01 PQ — ML-DSA-44 signature (post-quantum)\n * 0x02 Legacy — secp256k1 ECDSA signature (classic)\n * 0x03 RefScript — NIP-015 reference-script spend (future)\n *\n * Witness stack (exact order consumed by the interpreter):\n * [ auth_type, sig, pubkey, arg0, ..., argN, witnessScript ]\n *\n * NoAuth and RefScript spends omit the `sig`/`pubkey` items.\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { OP_1 } from '../core/opcodes.js';\nexport const AUTHSCRIPT_NOAUTH = 0x00;\nexport const AUTHSCRIPT_PQ = 0x01;\nexport const AUTHSCRIPT_LEGACY = 0x02;\n/** NIP-015: reference-script spend mode. Not yet activated in consensus. */\nexport const AUTHSCRIPT_REF = 0x03;\n/** Cap for PQ signature / pubkey pushes under NIP-018 (3072 B). */\nconst MAX_PQ_PUSH = 3072;\nexport function encodeAuthScriptScriptPubKey(program) {\n if (!(program instanceof Uint8Array) || program.length !== 32) {\n throw new Error('AuthScript program must be a 32-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_1, 0x20), program);\n}\nfunction assertWitnessScript(ws) {\n if (!(ws instanceof Uint8Array) || ws.length === 0) {\n throw new Error('witnessScript must be a non-empty Uint8Array');\n }\n}\nfunction assertArgs(args) {\n if (args == null)\n return;\n if (!Array.isArray(args)) {\n throw new Error('args must be an array of Uint8Array');\n }\n for (let i = 0; i < args.length; i += 1) {\n if (!(args[i] instanceof Uint8Array)) {\n throw new Error(`args[${i}] must be a Uint8Array`);\n }\n }\n}\n/**\n * Build the witness stack for a legacy ECDSA AuthScript spend.\n *\n * Returns an array of raw stack elements. Serialization of the witness\n * (compact-size item count + per-item length-prefixes) is the caller's\n * responsibility — neurai-create-transaction handles it at tx-assembly time.\n */\nexport function buildAuthScriptWitnessLegacy(input) {\n if (!(input.signature instanceof Uint8Array) || input.signature.length === 0) {\n throw new Error('signature must be a non-empty Uint8Array');\n }\n if (!(input.pubKey instanceof Uint8Array) ||\n (input.pubKey.length !== 33 && input.pubKey.length !== 65)) {\n throw new Error('pubKey must be a compressed (33B) or uncompressed (65B) secp256k1 key');\n }\n assertArgs(input.args);\n assertWitnessScript(input.witnessScript);\n return [\n Uint8Array.of(AUTHSCRIPT_LEGACY),\n input.signature,\n input.pubKey,\n ...(input.args ?? []),\n input.witnessScript\n ];\n}\n/**\n * Build the witness stack for a PQ (ML-DSA-44) AuthScript spend.\n * NIP-018 must be active: both signature and pubKey are pushed as single\n * stack elements and may each be up to 3072 B.\n */\nexport function buildAuthScriptWitnessPQ(input) {\n if (!(input.signature instanceof Uint8Array) || input.signature.length === 0) {\n throw new Error('signature must be a non-empty Uint8Array');\n }\n if (input.signature.length > MAX_PQ_PUSH) {\n throw new Error(`signature of ${input.signature.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (${MAX_PQ_PUSH})`);\n }\n if (!(input.pubKey instanceof Uint8Array) || input.pubKey.length === 0) {\n throw new Error('pubKey must be a non-empty Uint8Array');\n }\n if (input.pubKey.length > MAX_PQ_PUSH) {\n throw new Error(`pubKey of ${input.pubKey.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (${MAX_PQ_PUSH})`);\n }\n assertArgs(input.args);\n assertWitnessScript(input.witnessScript);\n return [\n Uint8Array.of(AUTHSCRIPT_PQ),\n input.signature,\n input.pubKey,\n ...(input.args ?? []),\n input.witnessScript\n ];\n}\n/**\n * Build the witness stack for a NoAuth AuthScript spend. The spend is gated\n * by the witnessScript alone (covenants, hash-locks, time-locks, ...); no\n * signature or public key is carried.\n */\nexport function buildAuthScriptWitnessNoAuth(input) {\n assertArgs(input.args);\n assertWitnessScript(input.witnessScript);\n return [\n Uint8Array.of(AUTHSCRIPT_NOAUTH),\n ...(input.args ?? []),\n input.witnessScript\n ];\n}\n/**\n * Build the witness stack for a NIP-015 reference-script spend. The last\n * item is the 4-byte little-endian index into `tx.vrefin` that locates the\n * reference-script carrier output; the interpreter resolves the `refScript`\n * from that carrier at validation time.\n *\n * NOTE: NIP-015 is not yet activated in consensus. This builder emits the\n * spec-conformant witness for forward compatibility and testnet experiments.\n */\nexport function buildAuthScriptWitnessRef(input) {\n if (!Number.isInteger(input.refIndex) || input.refIndex < 0 || input.refIndex > 0xffffffff) {\n throw new Error('refIndex must be a uint32 (0 .. 2^32 - 1)');\n }\n assertArgs(input.args);\n const refLocator = new Uint8Array(4);\n const dv = new DataView(refLocator.buffer);\n dv.setUint32(0, input.refIndex, /* little-endian */ true);\n return [\n Uint8Array.of(AUTHSCRIPT_REF),\n ...(input.args ?? []),\n refLocator\n ];\n}\n","/**\n * Provably-unspendable OP_RETURN (null-data) output scripts.\n * Layout: OP_RETURN <push> [<push> ...]\n *\n * Neurai inherits the Bitcoin Core standard policy cap of 80 bytes of\n * payload for a relayed null-data output. Outputs over that cap are still\n * consensus-valid but will not be relayed by default mempool policy; use\n * the `allowNonStandard` option to opt in explicitly.\n */\nimport { concatBytes } from '../core/bytes.js';\nimport { pushBytes } from '../core/script-builder.js';\nimport { OP_RETURN } from '../core/opcodes.js';\nexport const NULLDATA_STANDARD_MAX_SIZE = 80;\nexport function encodeNullDataScript(payload, options = {}) {\n const payloads = payload instanceof Uint8Array ? [payload] : payload;\n if (!Array.isArray(payloads) || payloads.length === 0) {\n throw new Error('payload must be a Uint8Array or a non-empty array of Uint8Array');\n }\n let totalPayload = 0;\n for (let i = 0; i < payloads.length; i += 1) {\n const p = payloads[i];\n if (!(p instanceof Uint8Array)) {\n throw new Error(`payload[${i}] must be a Uint8Array`);\n }\n totalPayload += p.length;\n }\n if (!options.allowNonStandard && totalPayload > NULLDATA_STANDARD_MAX_SIZE) {\n throw new Error(`nulldata payload of ${totalPayload} bytes exceeds standard cap ${NULLDATA_STANDARD_MAX_SIZE}; set allowNonStandard=true to override`);\n }\n const parts = [Uint8Array.of(OP_RETURN)];\n for (const p of payloads)\n parts.push(pushBytes(p));\n return concatBytes(...parts);\n}\n","/**\n * Classic bare m-of-n multisig via OP_CHECKMULTISIG, plus the P2SH wrapper\n * that is normally used in practice.\n *\n * redeemScript = <m> <pubkey_1> ... <pubkey_n> <n> OP_CHECKMULTISIG\n * P2SH spk = OP_HASH160 0x14 <HASH160(redeemScript)> OP_EQUAL\n *\n * OP_CHECKMULTISIG caps n at 20 pubkeys (see `MAX_PUBKEYS_PER_MULTISIG` in\n * the Neurai interpreter). Bare multisig outputs are still consensus-valid\n * but non-standard for relay; the P2SH wrapping is what mempool accepts.\n */\nimport { bytesToHex, concatBytes } from '../core/bytes.js';\nimport { pushBytes, pushInt } from '../core/script-builder.js';\nimport { OP_CHECKMULTISIG, OP_EQUAL, OP_HASH160 } from '../core/opcodes.js';\nexport const MULTISIG_MAX_PUBKEYS = 20;\nfunction assertPubKey(pk, idx) {\n if (!(pk instanceof Uint8Array) || (pk.length !== 33 && pk.length !== 65)) {\n throw new Error(`pubKey[${idx}] must be 33 or 65 bytes (got ${pk?.length})`);\n }\n}\nexport function encodeMultisigRedeemScript({ m, pubKeys }) {\n if (!Array.isArray(pubKeys) || pubKeys.length === 0) {\n throw new Error('pubKeys must be a non-empty array');\n }\n if (pubKeys.length > MULTISIG_MAX_PUBKEYS) {\n throw new Error(`pubKeys length ${pubKeys.length} exceeds OP_CHECKMULTISIG cap (${MULTISIG_MAX_PUBKEYS})`);\n }\n if (!Number.isInteger(m) || m < 1 || m > pubKeys.length) {\n throw new Error(`m must be an integer in [1, ${pubKeys.length}] (got ${m})`);\n }\n for (let i = 0; i < pubKeys.length; i += 1)\n assertPubKey(pubKeys[i], i);\n const parts = [pushInt(m)];\n for (const pk of pubKeys)\n parts.push(pushBytes(pk));\n parts.push(pushInt(pubKeys.length));\n parts.push(Uint8Array.of(OP_CHECKMULTISIG));\n return concatBytes(...parts);\n}\nexport function encodeMultisigRedeemScriptHex(params) {\n return bytesToHex(encodeMultisigRedeemScript(params));\n}\n/**\n * P2SH scriptPubKey wrapping any redeem script. Pass the 20-byte HASH160 of\n * the redeem script (RIPEMD160(SHA256(redeemScript))) — compute it\n * externally via the caller's crypto stack.\n */\nexport function encodeP2SHScriptPubKey(redeemScriptHash160) {\n if (!(redeemScriptHash160 instanceof Uint8Array) || redeemScriptHash160.length !== 20) {\n throw new Error('redeemScriptHash160 must be a 20-byte Uint8Array');\n }\n return concatBytes(Uint8Array.of(OP_HASH160, 0x14), redeemScriptHash160, Uint8Array.of(OP_EQUAL));\n}\n","function ensureHex(hex, label = 'hex') {\n const normalized = String(hex || '').trim().toLowerCase();\n if (!/^[0-9a-f]*$/.test(normalized) || normalized.length % 2 !== 0) {\n throw new Error(`Invalid ${label}: expected even-length hex string`);\n }\n return normalized;\n}\nfunction hexToBytes(hex) {\n const normalized = ensureHex(hex);\n const bytes = new Uint8Array(normalized.length / 2);\n for (let i = 0; i < normalized.length; i += 2) {\n bytes[i / 2] = Number.parseInt(normalized.slice(i, i + 2), 16);\n }\n return bytes;\n}\nfunction bytesToHex(bytes) {\n return Array.from(bytes, (value) => value.toString(16).padStart(2, '0')).join('');\n}\nfunction concatBytes(...parts) {\n const total = parts.reduce((sum, part) => sum + part.length, 0);\n const out = new Uint8Array(total);\n let offset = 0;\n for (const part of parts) {\n out.set(part, offset);\n offset += part.length;\n }\n return out;\n}\nfunction asciiBytes(text) {\n return Uint8Array.from(Array.from(text, (char) => char.charCodeAt(0)));\n}\nfunction serializeString(text) {\n const bytes = asciiBytes(text);\n return concatBytes(compactSize(bytes.length), bytes);\n}\nfunction reverseBytes(bytes) {\n return Uint8Array.from(Array.from(bytes).reverse());\n}\nfunction u32LE(value) {\n if (!Number.isInteger(value) || value < 0 || value > 0xffffffff) {\n throw new Error(`uint32 out of range: ${value}`);\n }\n const out = new Uint8Array(4);\n const view = new DataView(out.buffer);\n view.setUint32(0, value, true);\n return out;\n}\nfunction u64LE(value) {\n const bigintValue = typeof value === 'bigint' ? value : BigInt(value);\n if (bigintValue < 0n || bigintValue > 0xffffffffffffffffn) {\n throw new Error(`uint64 out of range: ${bigintValue}`);\n }\n const out = new Uint8Array(8);\n let remaining = bigintValue;\n for (let i = 0; i < 8; i += 1) {\n out[i] = Number(remaining & 0xffn);\n remaining >>= 8n;\n }\n return out;\n}\nfunction i64LE(value) {\n const bigintValue = typeof value === 'bigint' ? value : BigInt(value);\n if (bigintValue < -0x8000000000000000n || bigintValue > 0x7fffffffffffffffn) {\n throw new Error(`int64 out of range: ${bigintValue}`);\n }\n const out = new Uint8Array(8);\n const view = new DataView(out.buffer);\n view.setBigInt64(0, bigintValue, true);\n return out;\n}\nfunction compactSize(value) {\n const bigintValue = typeof value === 'bigint' ? value : BigInt(value);\n if (bigintValue < 0n)\n throw new Error('CompactSize cannot encode negative numbers');\n if (bigintValue < 253n) {\n return Uint8Array.of(Number(bigintValue));\n }\n if (bigintValue <= 0xffffn) {\n return concatBytes(Uint8Array.of(0xfd), u16LE(Number(bigintValue)));\n }\n if (bigintValue <= 0xffffffffn) {\n return concatBytes(Uint8Array.of(0xfe), u32LE(Number(bigintValue)));\n }\n return concatBytes(Uint8Array.of(0xff), u64LE(bigintValue));\n}\nfunction u16LE(value) {\n if (!Number.isInteger(value) || value < 0 || value > 0xffff) {\n throw new Error(`uint16 out of range: ${value}`);\n }\n const out = new Uint8Array(2);\n const view = new DataView(out.buffer);\n view.setUint16(0, value, true);\n return out;\n}\nfunction pushData(data) {\n if (data.length > 0xffff) {\n throw new Error(`Pushdata too large for current implementation: ${data.length} bytes`);\n }\n if (data.length < 0x4c) {\n return concatBytes(Uint8Array.of(data.length), data);\n }\n if (data.length <= 0xff) {\n return concatBytes(Uint8Array.of(0x4c, data.length), data);\n }\n return concatBytes(Uint8Array.of(0x4d), u16LE(data.length), data);\n}\n\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfunction base (ALPHABET) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n const BASE_MAP = new Uint8Array(256);\n for (let j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (let i = 0; i < ALPHABET.length; i++) {\n const x = ALPHABET.charAt(i);\n const xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i;\n }\n const BASE = ALPHABET.length;\n const LEADER = ALPHABET.charAt(0);\n const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up\n const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up\n function encode (source) {\n // eslint-disable-next-line no-empty\n if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n let zeroes = 0;\n let length = 0;\n let pbegin = 0;\n const pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n // Allocate enough space in big-endian base58 representation.\n const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;\n const b58 = new Uint8Array(size);\n // Process the bytes.\n while (pbegin !== pend) {\n let carry = source[pbegin];\n // Apply \"b58 = b58 * 256 + ch\".\n let i = 0;\n for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0;\n b58[it1] = (carry % BASE) >>> 0;\n carry = (carry / BASE) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n pbegin++;\n }\n // Skip leading zeroes in base58 result.\n let it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n // Translate the result into a string.\n let str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n let psz = 0;\n // Skip and count leading '1's.\n let zeroes = 0;\n let length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n // Allocate enough space in big-endian base256 representation.\n const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.\n const b256 = new Uint8Array(size);\n // Process the characters.\n while (psz < source.length) {\n // Find code of next character\n const charCode = source.charCodeAt(psz);\n // Base map can not be indexed using char code\n if (charCode > 255) { return }\n // Decode character\n let carry = BASE_MAP[charCode];\n // Invalid character\n if (carry === 255) { return }\n let i = 0;\n for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0;\n b256[it3] = (carry % 256) >>> 0;\n carry = (carry / 256) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n psz++;\n }\n // Skip leading zeroes in b256.\n let it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n const vch = new Uint8Array(zeroes + (size - it4));\n let j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch\n }\n function decode (string) {\n const buffer = decodeUnsafe(string);\n if (buffer) { return buffer }\n throw new Error('Non-base' + BASE + ' character')\n }\n return {\n encode,\n decodeUnsafe,\n decode\n }\n}\n\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\nvar base58 = base(ALPHABET);\n\nconst IPFS_LENGTH = 0x20;\nconst TXID_PREFIX = 0x54;\nfunction encodeAssetDataReference(value) {\n const normalized = String(value || '').trim();\n if (!normalized) {\n return new Uint8Array();\n }\n if (normalized.startsWith('Qm') && normalized.length === 46) {\n const decoded = Uint8Array.from(base58.decode(normalized));\n if (decoded.length !== 34) {\n throw new Error(`Invalid CIDv0 length for asset data: ${decoded.length}`);\n }\n return decoded;\n }\n if (normalized.length === 64 && /^[0-9a-fA-F]+$/.test(normalized)) {\n const txidBytes = hexToBytes(normalized);\n return Uint8Array.of(TXID_PREFIX, IPFS_LENGTH, ...txidBytes);\n }\n if (normalized.length === 68 && /^[0-9a-fA-F]+$/.test(normalized)) {\n const raw = hexToBytes(normalized);\n if (raw[1] !== IPFS_LENGTH) {\n throw new Error('Invalid raw asset data reference length prefix');\n }\n return raw;\n }\n throw new Error('Unsupported asset data reference. Expected CIDv0 (Qm...), 64-char txid, or 68-char raw hex');\n}\nfunction decodeAssetDataReferenceHex(value) {\n return bytesToHex(encodeAssetDataReference(value));\n}\nfunction isEncodedAssetDataReferenceHex(hex) {\n const normalized = ensureHex(hex);\n return normalized.length === 68 || normalized.length === 0;\n}\nfunction isCidV0AssetReference(value) {\n const normalized = String(value || '').trim();\n return normalized.startsWith('Qm') && normalized.length === 46;\n}\nfunction isTxidAssetReference(value) {\n const normalized = String(value || '').trim();\n return normalized.length === 64 && /^[0-9a-fA-F]+$/.test(normalized);\n}\nfunction isRawAssetDataReferenceHex(value) {\n const normalized = String(value || '').trim();\n return normalized.length === 68 && /^[0-9a-fA-F]+$/.test(normalized);\n}\nfunction formatAssetDataReferenceHex(value) {\n return bytesToHex(encodeAssetDataReference(value));\n}\n\nvar dist = {};\n\nvar hasRequiredDist;\n\nfunction requireDist () {\n\tif (hasRequiredDist) return dist;\n\thasRequiredDist = 1;\n\tObject.defineProperty(dist, \"__esModule\", { value: true });\n\tdist.bech32m = dist.bech32 = void 0;\n\tconst ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';\n\tconst ALPHABET_MAP = {};\n\tfor (let z = 0; z < ALPHABET.length; z++) {\n\t const x = ALPHABET.charAt(z);\n\t ALPHABET_MAP[x] = z;\n\t}\n\tfunction polymodStep(pre) {\n\t const b = pre >> 25;\n\t return (((pre & 0x1ffffff) << 5) ^\n\t (-((b >> 0) & 1) & 0x3b6a57b2) ^\n\t (-((b >> 1) & 1) & 0x26508e6d) ^\n\t (-((b >> 2) & 1) & 0x1ea119fa) ^\n\t (-((b >> 3) & 1) & 0x3d4233dd) ^\n\t (-((b >> 4) & 1) & 0x2a1462b3));\n\t}\n\tfunction prefixChk(prefix) {\n\t let chk = 1;\n\t for (let i = 0; i < prefix.length; ++i) {\n\t const c = prefix.charCodeAt(i);\n\t if (c < 33 || c > 126)\n\t return 'Invalid prefix (' + prefix + ')';\n\t chk = polymodStep(chk) ^ (c >> 5);\n\t }\n\t chk = polymodStep(chk);\n\t for (let i = 0; i < prefix.length; ++i) {\n\t const v = prefix.charCodeAt(i);\n\t chk = polymodStep(chk) ^ (v & 0x1f);\n\t }\n\t return chk;\n\t}\n\tfunction convert(data, inBits, outBits, pad) {\n\t let value = 0;\n\t let bits = 0;\n\t const maxV = (1 << outBits) - 1;\n\t const result = [];\n\t for (let i = 0; i < data.length; ++i) {\n\t value = (value << inBits) | data[i];\n\t bits += inBits;\n\t while (bits >= outBits) {\n\t bits -= outBits;\n\t result.push((value >> bits) & maxV);\n\t }\n\t }\n\t if (pad) {\n\t if (bits > 0) {\n\t result.push((value << (outBits - bits)) & maxV);\n\t }\n\t }\n\t else {\n\t if (bits >= inBits)\n\t return 'Excess padding';\n\t if ((value << (outBits - bits)) & maxV)\n\t return 'Non-zero padding';\n\t }\n\t return result;\n\t}\n\tfunction toWords(bytes) {\n\t return convert(bytes, 8, 5, true);\n\t}\n\tfunction fromWordsUnsafe(words) {\n\t const res = convert(words, 5, 8, false);\n\t if (Array.isArray(res))\n\t return res;\n\t}\n\tfunction fromWords(words) {\n\t const res = convert(words, 5, 8, false);\n\t if (Array.isArray(res))\n\t return res;\n\t throw new Error(res);\n\t}\n\tfunction getLibraryFromEncoding(encoding) {\n\t let ENCODING_CONST;\n\t if (encoding === 'bech32') {\n\t ENCODING_CONST = 1;\n\t }\n\t else {\n\t ENCODING_CONST = 0x2bc830a3;\n\t }\n\t function encode(prefix, words, LIMIT) {\n\t LIMIT = LIMIT || 90;\n\t if (prefix.length + 7 + words.length > LIMIT)\n\t throw new TypeError('Exceeds length limit');\n\t prefix = prefix.toLowerCase();\n\t // determine chk mod\n\t let chk = prefixChk(prefix);\n\t if (typeof chk === 'string')\n\t throw new Error(chk);\n\t let result = prefix + '1';\n\t for (let i = 0; i < words.length; ++i) {\n\t const x = words[i];\n\t if (x >> 5 !== 0)\n\t throw new Error('Non 5-bit word');\n\t chk = polymodStep(chk) ^ x;\n\t result += ALPHABET.charAt(x);\n\t }\n\t for (let i = 0; i < 6; ++i) {\n\t chk = polymodStep(chk);\n\t }\n\t chk ^= ENCODING_CONST;\n\t for (let i = 0; i < 6; ++i) {\n\t const v = (chk >> ((5 - i) * 5)) & 0x1f;\n\t result += ALPHABET.charAt(v);\n\t }\n\t return result;\n\t }\n\t function __decode(str, LIMIT) {\n\t LIMIT = LIMIT || 90;\n\t if (str.length < 8)\n\t return str + ' too short';\n\t if (str.length > LIMIT)\n\t return 'Exceeds length limit';\n\t // don't allow mixed case\n\t const lowered = str.toLowerCase();\n\t const uppered = str.toUpperCase();\n\t if (str !== lowered && str !== uppered)\n\t return 'Mixed-case string ' + str;\n\t str = lowered;\n\t const split = str.lastIndexOf('1');\n\t if (split === -1)\n\t return 'No separator character for ' + str;\n\t if (split === 0)\n\t return 'Missing prefix for ' + str;\n\t const prefix = str.slice(0, split);\n\t const wordChars = str.slice(split + 1);\n\t if (wordChars.length < 6)\n\t return 'Data too short';\n\t let chk = prefixChk(prefix);\n\t if (typeof chk === 'string')\n\t return chk;\n\t const words = [];\n\t for (let i = 0; i < wordChars.length; ++i) {\n\t const c = wordChars.charAt(i);\n\t const v = ALPHABET_MAP[c];\n\t if (v === undefined)\n\t return 'Unknown character ' + c;\n\t chk = polymodStep(chk) ^ v;\n\t // not in the checksum?\n\t if (i + 6 >= wordChars.length)\n\t continue;\n\t words.push(v);\n\t }\n\t if (chk !== ENCODING_CONST)\n\t return 'Invalid checksum for ' + str;\n\t return { prefix, words };\n\t }\n\t function decodeUnsafe(str, LIMIT) {\n\t const res = __decode(str, LIMIT);\n\t if (typeof res === 'object')\n\t return res;\n\t }\n\t function decode(str, LIMIT) {\n\t const res = __decode(str, LIMIT);\n\t if (typeof res === 'object')\n\t return res;\n\t throw new Error(res);\n\t }\n\t return {\n\t decodeUnsafe,\n\t decode,\n\t encode,\n\t toWords,\n\t fromWordsUnsafe,\n\t fromWords,\n\t };\n\t}\n\tdist.bech32 = getLibraryFromEncoding('bech32');\n\tdist.bech32m = getLibraryFromEncoding('bech32m');\n\treturn dist;\n}\n\nvar distExports = requireDist();\n\n/**\n * Utilities for hex, bytes, CSPRNG.\n * @module\n */\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\nfunction isBytes(a) {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n/** Asserts something is Uint8Array. */\nfunction abytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length);\n}\n/** Asserts a hash instance has not been destroyed / finished */\nfunction aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/** Asserts output is properly-sized byte array */\nfunction aoutput(out, instance) {\n abytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error('digestInto() expects output buffer of length at least ' + min);\n }\n}\n/** Zeroize a byte array. Warning: JS provides no guarantees. */\nfunction clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/** Create DataView of an array for easy byte-level manipulation. */\nfunction createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/** The rotate right (circular right shift) operation for uint32 */\nfunction rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99])\n */\nfunction utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nfunction toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n abytes(data);\n return data;\n}\n/** For runtime check if class implements interface */\nclass Hash {\n}\n/** Wraps hash function, creating an interface on top of it */\nfunction createHasher(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\n\n/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\n/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */\nfunction setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n/** Choice: a ? b : c */\nfunction Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/** Majority function, true if any two inputs is true. */\nfunction Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n */\nclass HashMD extends Hash {\n constructor(blockLen, outputLen, padOffset, isLE) {\n super();\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n clean(this.buffer.subarray(pos));\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to || (to = new this.constructor());\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nconst SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n\n/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and\n * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n */\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n/** Reusable temporary buffer. \"W\" comes straight from spec. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\nclass SHA256 extends HashMD {\n constructor(outputLen = 32) {\n super(64, outputLen, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = SHA256_IV[0] | 0;\n this.B = SHA256_IV[1] | 0;\n this.C = SHA256_IV[2] | 0;\n this.D = SHA256_IV[3] | 0;\n this.E = SHA256_IV[4] | 0;\n this.F = SHA256_IV[5] | 0;\n this.G = SHA256_IV[6] | 0;\n this.H = SHA256_IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n clean(SHA256_W);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634.\n *\n * It is the fastest JS hash, even faster than Blake3.\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n */\nconst sha256$1 = /* @__PURE__ */ createHasher(() => new SHA256());\n\n/**\n * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3.\n *\n * To break sha256 using birthday attack, attackers need to try 2^128 hashes.\n * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n *\n * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).\n * @module\n * @deprecated\n */\n/** @deprecated Use import from `noble/hashes/sha2` module */\nconst sha256 = sha256$1;\n\nfunction bs58checkBase (checksumFn) {\n // Encode a buffer as a base58-check encoded string\n function encode(payload) {\n var payloadU8 = Uint8Array.from(payload);\n var checksum = checksumFn(payloadU8);\n var length = payloadU8.length + 4;\n var both = new Uint8Array(length);\n both.set(payloadU8, 0);\n both.set(checksum.subarray(0, 4), payloadU8.length);\n return base58.encode(both);\n }\n function decodeRaw(buffer) {\n var payload = buffer.slice(0, -4);\n var checksum = buffer.slice(-4);\n var newChecksum = checksumFn(payload);\n // eslint-disable-next-line\n if (checksum[0] ^ newChecksum[0] |\n checksum[1] ^ newChecksum[1] |\n checksum[2] ^ newChecksum[2] |\n checksum[3] ^ newChecksum[3])\n return;\n return payload;\n }\n // Decode a base58-check encoded string to a buffer, no result if checksum is wrong\n function decodeUnsafe(str) {\n var buffer = base58.decodeUnsafe(str);\n if (buffer == null)\n return;\n return decodeRaw(buffer);\n }\n function decode(str) {\n var buffer = base58.decode(str);\n var payload = decodeRaw(buffer);\n if (payload == null)\n throw new Error('Invalid checksum');\n return payload;\n }\n return {\n encode: encode,\n decode: decode,\n decodeUnsafe: decodeUnsafe\n };\n}\n\n// SHA256(SHA256(buffer))\nfunction sha256x2(buffer) {\n return sha256(sha256(buffer));\n}\nvar bs58check = bs58checkBase(sha256x2);\n\nfunction resolveAddressInput(address) {\n if (typeof address === 'string') {\n return String(address).trim();\n }\n if (address && typeof address.address === 'string') {\n return String(address.address).trim();\n }\n throw new Error('Address must be a string or an object with an address field');\n}\n\nconst LEGACY_MAINNET_PREFIX = 53;\nconst LEGACY_TESTNET_PREFIX = 127;\nconst PQ_MAINNET_HRP = 'nq';\nconst PQ_TESTNET_HRP = 'tnq';\nconst OP_XNA_ASSET = 0xc0;\nconst OP_DROP = 0x75;\nconst OP_1 = 0x51;\nconst OP_RESERVED = 0x50;\nconst XNA_TRANSFER_PREFIX = new Uint8Array([\n 0x72, 0x76, 0x6e, 0x74\n]);\nconst XNA_ISSUE_PREFIX = new Uint8Array([\n 0x72, 0x76, 0x6e, 0x71\n]);\nconst XNA_OWNER_PREFIX = new Uint8Array([\n 0x72, 0x76, 0x6e, 0x6f\n]);\nconst XNA_REISSUE_PREFIX = new Uint8Array([\n 0x72, 0x76, 0x6e, 0x72\n]);\nfunction inferNetworkFromAddress(address) {\n const normalized = resolveAddressInput(address).toLowerCase();\n if (normalized.startsWith(PQ_MAINNET_HRP + '1'))\n return 'xna-pq';\n if (normalized.startsWith(PQ_TESTNET_HRP + '1'))\n return 'xna-pq-test';\n if (normalized.startsWith('n'))\n return 'xna';\n if (normalized.startsWith('t'))\n return 'xna-test';\n throw new Error(`Unsupported Neurai address: ${address}`);\n}\n\nfunction decodeAddress(address) {\n const normalized = resolveAddressInput(address);\n const lowered = normalized.toLowerCase();\n if (!normalized)\n throw new Error('Address is required');\n if (lowered.startsWith(PQ_MAINNET_HRP + '1') || lowered.startsWith(PQ_TESTNET_HRP + '1')) {\n const decoded = distExports.bech32m.decode(normalized);\n const version = decoded.words[0];\n const program = Uint8Array.from(distExports.bech32m.fromWords(decoded.words.slice(1)));\n if (version !== 1 || program.length !== 32) {\n throw new Error(`Unsupported AuthScript address program for ${address}`);\n }\n const network = lowered.startsWith(PQ_TESTNET_HRP + '1') ? 'xna-pq-test' : 'xna-pq';\n return { address: normalized, type: 'authscript', network, program, commitment: program };\n }\n const payload = Uint8Array.from(bs58check.decode(normalized));\n if (payload.length !== 21) {\n throw new Error(`Unsupported legacy address payload length for ${address}`);\n }\n const prefix = payload[0];\n if (prefix !== LEGACY_MAINNET_PREFIX && prefix !== LEGACY_TESTNET_PREFIX) {\n throw new Error(`Unsupported legacy address prefix ${prefix} for ${address}`);\n }\n return {\n address: normalized,\n type: 'p2pkh',\n network: inferNetworkFromAddress(normalized),\n program: payload.slice(1),\n hash: payload.slice(1)\n };\n}\nfunction encodeP2PKHScript(address) {\n const destination = decodeAddress(address);\n if (destination.type !== 'p2pkh') {\n throw new Error(`Address ${address} is not legacy P2PKH`);\n }\n return Uint8Array.of(0x76, 0xa9, 0x14, ...destination.hash, 0x88, 0xac);\n}\nfunction encodeAuthScriptDestinationScript(address) {\n const destination = decodeAddress(address);\n if (destination.type !== 'authscript') {\n throw new Error(`Address ${address} is not AuthScript witness v1`);\n }\n return concatBytes(Uint8Array.of(OP_1), pushData(destination.commitment));\n}\nfunction encodeDestinationScript(address) {\n const destination = decodeAddress(address);\n return destination.type === 'authscript'\n ? encodeAuthScriptDestinationScript(address)\n : encodeP2PKHScript(address);\n}\nfunction encodeNullAssetDestinationScript(address, mode = 'strict') {\n const destination = decodeAddress(address);\n if (destination.type === 'authscript') {\n if (mode === 'hash20') {\n throw new Error('hash20 null-asset mode is not supported for AuthScript destinations');\n }\n return concatBytes(Uint8Array.of(OP_XNA_ASSET, OP_1), pushData(destination.commitment));\n }\n return concatBytes(Uint8Array.of(OP_XNA_ASSET), pushData(destination.hash));\n}\nconst encodePQWitnessScript = encodeAuthScriptDestinationScript;\n\nconst OWNER_ASSET_AMOUNT = 100000000n;\nconst UNIQUE_ASSET_AMOUNT = 100000000n;\nconst UNIQUE_ASSET_UNITS = 0;\nconst UNIQUE_ASSETS_REISSUABLE = false;\nconst MAINNET_BURN_ADDRESSES = {\n ISSUE_ROOT: 'NbURNXXXXXXXXXXXXXXXXXXXXXXXT65Gdr',\n ISSUE_SUB: 'NXissueSubAssetXXXXXXXXXXXXXX6B2JF',\n ISSUE_UNIQUE: 'NXissueUniqueAssetXXXXXXXXXXUBzP4Z',\n ISSUE_DEPIN: 'NXissueUniqueAssetXXXXXXXXXXUBzP4Z',\n ISSUE_MSGCHANNEL: 'NXissueMsgChanneLAssetXXXXXXTUzrtJ',\n REISSUE: 'NXReissueAssetXXXXXXXXXXXXXXWLe4Ao',\n REISSUE_RESTRICTED: 'NXReissueAssetXXXXXXXXXXXXXXWLe4Ao',\n ISSUE_RESTRICTED: 'NXissueRestrictedXXXXXXXXXXXWpXx4H',\n ISSUE_QUALIFIER: 'NXissueQuaLifierXXXXXXXXXXXXWurNcU',\n ISSUE_SUB_QUALIFIER: 'NXissueSubQuaLifierXXXXXXXXXV71vM3',\n TAG_ADDRESS: 'NXaddTagBurnXXXXXXXXXXXXXXXXWucUTr',\n UNTAG_ADDRESS: 'NXaddTagBurnXXXXXXXXXXXXXXXXWucUTr'\n};\nconst TESTNET_BURN_ADDRESSES = {\n ISSUE_ROOT: 'tBURNXXXXXXXXXXXXXXXXXXXXXXXVZLroy',\n ISSUE_SUB: 'tSubAssetXXXXXXXXXXXXXXXXXXXXGTvF4',\n ISSUE_UNIQUE: 'tUniqueAssetXXXXXXXXXXXXXXXXVCgpLs',\n ISSUE_DEPIN: 'tUniqueAssetXXXXXXXXXXXXXXXXVCgpLs',\n ISSUE_MSGCHANNEL: 'tMsgChanneLAssetXXXXXXXXXXXXVsJoya',\n REISSUE: 'tAssetXXXXXXXXXXXXXXXXXXXXXXas6pz8',\n REISSUE_RESTRICTED: 'tAssetXXXXXXXXXXXXXXXXXXXXXXas6pz8',\n ISSUE_RESTRICTED: 'tRestrictedXXXXXXXXXXXXXXXXXVyPBEK',\n ISSUE_QUALIFIER: 'tQuaLifierXXXXXXXXXXXXXXXXXXT5czoV',\n ISSUE_SUB_QUALIFIER: 'tSubQuaLifierXXXXXXXXXXXXXXXW5MmGk',\n TAG_ADDRESS: 'tTagBurnXXXXXXXXXXXXXXXXXXXXYm6pxA',\n UNTAG_ADDRESS: 'tTagBurnXXXXXXXXXXXXXXXXXXXXYm6pxA'\n};\nconst BURN_COSTS_XNA = {\n ISSUE_ROOT: 1000,\n ISSUE_SUB: 200,\n ISSUE_UNIQUE: 10,\n ISSUE_DEPIN: 10,\n ISSUE_MSGCHANNEL: 200,\n ISSUE_QUALIFIER: 2000,\n ISSUE_SUB_QUALIFIER: 200,\n ISSUE_RESTRICTED: 3000,\n REISSUE: 200,\n REISSUE_RESTRICTED: 200,\n TAG_ADDRESS: 0.2,\n UNTAG_ADDRESS: 0.2\n};\nfunction resolveNetworkFamily(network) {\n return network === 'xna' || network === 'xna-pq' ? 'mainnet' : 'testnet';\n}\nfunction getBurnAddressForOperation(network, operation) {\n const byFamily = resolveNetworkFamily(network) === 'mainnet'\n ? MAINNET_BURN_ADDRESSES\n : TESTNET_BURN_ADDRESSES;\n return byFamily[operation];\n}\nfunction getBurnAmountXna(operation, multiplier = 1) {\n return BURN_COSTS_XNA[operation] * multiplier;\n}\nfunction getBurnAmountSats(operation, multiplier = 1) {\n return BigInt(Math.round(getBurnAmountXna(operation, multiplier) * 1e8));\n}\nfunction inferNetworkFromAnyAddress(address) {\n return inferNetworkFromAddress(address);\n}\nfunction getOwnerTokenName(assetName) {\n if (assetName.startsWith('$')) {\n return `${assetName.slice(1)}!`;\n }\n return `${assetName}!`;\n}\nfunction getParentAssetName(assetName) {\n const slashIndex = assetName.indexOf('/');\n if (slashIndex === -1) {\n return null;\n }\n return assetName.slice(0, slashIndex);\n}\nfunction getUniqueAssetName(rootName, tag) {\n return `${rootName}#${tag}`;\n}\nfunction normalizeVerifierString(verifierString) {\n return String(verifierString || '')\n .replace(/\\s+/g, '')\n .replace(/#/g, '');\n}\nfunction isDepinAssetName(assetName) {\n const normalized = String(assetName || '').trim();\n return /^&[A-Z0-9._]{3,}$/.test(normalized) || /^&[A-Z0-9._]+\\/[A-Z0-9._/]+$/.test(normalized);\n}\nfunction assertDepinAssetName(assetName) {\n if (!isDepinAssetName(assetName)) {\n throw new Error(`Invalid DEPIN asset name: ${assetName}`);\n }\n}\n\nfunction xnaToSatoshis(amount) {\n return BigInt(Math.round(Number(amount || 0) * 1e8));\n}\nfunction assetUnitsToRaw(amount) {\n return xnaToSatoshis(amount);\n}\nfunction encodeAssetTransferPayload(assetName, amountRaw, message, expireTime) {\n const payload = [\n XNA_TRANSFER_PREFIX,\n serializeString(assetName),\n u64LE(amountRaw)\n ];\n const encodedMessage = encodeAssetDataReference(message);\n if (encodedMessage.length > 0) {\n payload.push(encodedMessage);\n if (expireTime !== undefined && BigInt(expireTime) !== 0n) {\n payload.push(i64LE(expireTime));\n }\n }\n return concatBytes(...payload);\n}\nfunction encodeAssetTransferScript(address, assetName, amountRaw, message, expireTime) {\n return concatBytes(encodeDestinationScript(address), Uint8Array.of(OP_XNA_ASSET), pushData(encodeAssetTransferPayload(assetName, amountRaw, message, expireTime)), Uint8Array.of(OP_DROP));\n}\nfunction encodeNewAssetPayload(assetName, quantityRaw, units = 0, reissuable = true, ipfsHash) {\n const encodedIpfs = encodeAssetDataReference(ipfsHash);\n return concatBytes(XNA_ISSUE_PREFIX, serializeString(assetName), u64LE(quantityRaw), Uint8Array.of(units & 0xff, reissuable ? 1 : 0, encodedIpfs.length > 0 ? 1 : 0), encodedIpfs);\n}\nfunction encodeNewAssetScript(address, assetName, quantityRaw, units = 0, reissuable = true, ipfsHash) {\n return concatBytes(encodeDestinationScript(address), Uint8Array.of(OP_XNA_ASSET), pushData(encodeNewAssetPayload(assetName, quantityRaw, units, reissuable, ipfsHash)), Uint8Array.of(OP_DROP));\n}\nfunction encodeOwnerAssetPayload(ownerTokenName) {\n return concatBytes(XNA_OWNER_PREFIX, serializeString(ownerTokenName));\n}\nfunction encodeOwnerAssetScript(address, ownerTokenName) {\n return concatBytes(encodeDestinationScript(address), Uint8Array.of(OP_XNA_ASSET), pushData(encodeOwnerAssetPayload(ownerTokenName)), Uint8Array.of(OP_DROP));\n}\nfunction encodeReissueAssetPayload(assetName, quantityRaw, units = 0, reissuable = true, ipfsHash) {\n return concatBytes(XNA_REISSUE_PREFIX, serializeString(assetName), u64LE(quantityRaw), Uint8Array.of(units & 0xff, reissuable ? 1 : 0), encodeAssetDataReference(ipfsHash));\n}\nfunction encodeReissueAssetScript(address, assetName, quantityRaw, units = 0, reissuable = true, ipfsHash) {\n return concatBytes(encodeDestinationScript(address), Uint8Array.of(OP_XNA_ASSET), pushData(encodeReissueAssetPayload(assetName, quantityRaw, units, reissuable, ipfsHash)), Uint8Array.of(OP_DROP));\n}\nfunction encodeNullAssetDataPayload(assetName, flag) {\n const nameBytes = asciiBytes(assetName);\n return concatBytes(compactSize(nameBytes.length), nameBytes, Uint8Array.of(flag & 0xff));\n}\nfunction encodeNullAssetTagPayload(qualifierName, operation) {\n return encodeNullAssetDataPayload(qualifierName, operation === 'tag' ? 1 : 0);\n}\nfunction encodeNullAssetTagScript(address, qualifierName, operation, mode = 'strict') {\n return concatBytes(encodeNullAssetDestinationScript(address, mode), pushData(encodeNullAssetTagPayload(qualifierName, operation)));\n}\nfunction encodeNullAssetRestrictionScript(address, assetName, freezeFlag, mode = 'strict') {\n return concatBytes(encodeNullAssetDestinationScript(address, mode), pushData(encodeNullAssetDataPayload(assetName, freezeFlag)));\n}\nfunction encodeVerifierStringPayload(verifierString) {\n return serializeString(verifierString);\n}\nfunction encodeVerifierStringScript(verifierString) {\n return concatBytes(Uint8Array.of(OP_XNA_ASSET, OP_RESERVED), pushData(encodeVerifierStringPayload(verifierString)));\n}\nfunction encodeGlobalRestrictionScript(assetName, freezeFlag) {\n return concatBytes(Uint8Array.of(OP_XNA_ASSET, OP_RESERVED, OP_RESERVED), pushData(encodeNullAssetDataPayload(assetName, freezeFlag)));\n}\nfunction createXnaOutput(address, valueSats) {\n return {\n valueSats: typeof valueSats === 'bigint' ? valueSats : BigInt(valueSats),\n scriptPubKeyHex: bytesToHex(encodeDestinationScript(address))\n };\n}\nfunction createAssetTransferOutput(address, assetName, amountRaw) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeAssetTransferScript(address, assetName, amountRaw))\n };\n}\nfunction createTransferWithMessageOutput(params) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeAssetTransferScript(params.address, params.assetName, params.amountRaw, params.message, params.expireTime))\n };\n}\nfunction createOwnerAssetIssueOutput(address, ownerTokenName) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeOwnerAssetScript(address, ownerTokenName))\n };\n}\nfunction createOwnerAssetTransferOutput(address, ownerTokenName) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeAssetTransferScript(address, ownerTokenName, OWNER_ASSET_AMOUNT))\n };\n}\nfunction createIssueAssetOutput(params) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeNewAssetScript(params.address, params.assetName, params.quantityRaw, params.units ?? 0, params.reissuable ?? true, params.ipfsHash))\n };\n}\nfunction createReissueAssetOutput(params) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeReissueAssetScript(params.address, params.assetName, params.quantityRaw, params.units ?? 0, params.reissuable ?? true, params.ipfsHash))\n };\n}\nfunction createNullAssetTagOutput(address, qualifierName, operation, mode = 'strict') {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeNullAssetTagScript(address, qualifierName, operation, mode))\n };\n}\nfunction createNullAssetRestrictionOutput(address, assetName, freezeFlag, mode = 'strict') {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeNullAssetRestrictionScript(address, assetName, freezeFlag, mode))\n };\n}\nfunction createVerifierStringOutput(verifierString) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeVerifierStringScript(verifierString))\n };\n}\nfunction createGlobalRestrictionOutput(assetName, freezeFlag) {\n return {\n valueSats: 0n,\n scriptPubKeyHex: bytesToHex(encodeGlobalRestrictionScript(assetName, freezeFlag))\n };\n}\nfunction createTransferOutput(params) {\n return createAssetTransferOutput(params.address, params.assetName, params.amountRaw);\n}\n\nfunction serializeInput(input) {\n const txidBytes = reverseBytes(hexToBytes(input.txid));\n const scriptSig = input.scriptSigHex ? hexToBytes(input.scriptSigHex) : new Uint8Array();\n return concatBytes(txidBytes, u32LE(input.vout), compactSize(scriptSig.length), scriptSig, u32LE(input.sequence ?? 0xffffffff));\n}\nfunction serializeOutput(output) {\n const scriptPubKey = hexToBytes(ensureHex(output.scriptPubKeyHex, 'scriptPubKeyHex'));\n return concatBytes(u64LE(output.valueSats), compactSize(scriptPubKey.length), scriptPubKey);\n}\nfunction createUnsignedTransaction(tx) {\n const version = tx.version ?? 2;\n const locktime = tx.locktime ?? 0;\n const inputs = tx.inputs.map(serializeInput);\n const outputs = tx.outputs.map(serializeOutput);\n const bytes = concatBytes(u32LE(version), compactSize(inputs.length), ...inputs, compactSize(outputs.length), ...outputs, u32LE(locktime));\n return Array.from(bytes, (value) => value.toString(16).padStart(2, '0')).join('');\n}\n\nfunction buildTransaction(version, locktime, inputs, outputs) {\n return {\n rawTx: createUnsignedTransaction({\n version: version ?? 2,\n locktime: locktime ?? 0,\n inputs,\n outputs\n }),\n outputs\n };\n}\nfunction appendXnaEnvelope(outputs, burnAddress, burnAmountSats, changeAddress, changeSats) {\n if (burnAddress && burnAmountSats !== undefined && BigInt(burnAmountSats) > 0n) {\n outputs.push(createXnaOutput(burnAddress, burnAmountSats));\n }\n if (changeAddress && changeSats !== undefined && BigInt(changeSats) > 0n) {\n outputs.push(createXnaOutput(changeAddress, changeSats));\n }\n}\nfunction appendExtraOutputs(outputs, extraOutputs) {\n if (extraOutputs?.length) {\n outputs.push(...extraOutputs);\n }\n}\nfunction freezeFlagFromOperation(operation) {\n return operation === 'freeze' ? 1 : 0;\n}\nfunction createPaymentTransaction(params) {\n const outputs = [\n ...params.payments.map((payment) => createXnaOutput(payment.address, payment.valueSats)),\n ...(params.extraOutputs ?? [])\n ];\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createStandardAssetTransferTransaction(params) {\n const outputs = [];\n for (const payment of params.payments ?? []) {\n outputs.push(createXnaOutput(payment.address, payment.valueSats));\n }\n for (const transfer of params.transfers ?? []) {\n outputs.push(createTransferOutput(transfer));\n }\n for (const transfer of params.transferMessages ?? []) {\n outputs.push(createTransferWithMessageOutput(transfer));\n }\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueAssetTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n if (params.includeOwnerOutput ?? true) {\n outputs.push(createOwnerAssetIssueOutput(params.ownerTokenAddress ?? params.toAddress, params.ownerTokenName ?? getOwnerTokenName(params.assetName)));\n }\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueSubAssetTransaction(params) {\n const parentAssetName = getParentAssetName(params.assetName);\n if (!parentAssetName) {\n throw new Error(`Sub-asset name must contain '/': ${params.assetName}`);\n }\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.parentOwnerAddress ?? params.xnaChangeAddress ?? params.toAddress, getOwnerTokenName(parentAssetName)));\n outputs.push(createOwnerAssetIssueOutput(params.ownerTokenAddress ?? params.toAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueDepinTransaction(params) {\n assertDepinAssetName(params.assetName);\n if (params.reissuable !== undefined && typeof params.reissuable !== 'boolean') {\n throw new Error('DEPIN reissuable must be boolean when provided');\n }\n return createIssueAssetTransaction({\n ...params,\n units: 0,\n includeOwnerOutput: true,\n ownerTokenAddress: params.ownerTokenAddress ?? params.toAddress,\n reissuable: params.reissuable ?? true\n });\n}\nfunction createIssueUniqueAssetTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.ownerTokenAddress ?? params.toAddress, getOwnerTokenName(params.rootName)));\n for (let index = 0; index < params.assetTags.length; index += 1) {\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: getUniqueAssetName(params.rootName, params.assetTags[index]),\n quantityRaw: UNIQUE_ASSET_AMOUNT,\n units: UNIQUE_ASSET_UNITS,\n reissuable: UNIQUE_ASSETS_REISSUABLE,\n ipfsHash: params.ipfsHashes?.[index]\n }));\n }\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueQualifierTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n const parentQualifier = getParentAssetName(params.assetName);\n if (parentQualifier) {\n outputs.push(createAssetTransferOutput(params.rootChangeAddress ?? params.xnaChangeAddress ?? params.toAddress, parentQualifier, params.changeQuantityRaw ?? OWNER_ASSET_AMOUNT));\n }\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: 0,\n reissuable: false,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createIssueRestrictedTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createVerifierStringOutput(normalizeVerifierString(params.verifierString)));\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress ?? params.toAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createIssueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createReissueTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress ?? params.toAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createReissueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createReissueRestrictedTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n if (params.verifierString) {\n outputs.push(createVerifierStringOutput(normalizeVerifierString(params.verifierString)));\n }\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress ?? params.toAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createReissueAssetOutput({\n address: params.toAddress,\n assetName: params.assetName,\n quantityRaw: params.quantityRaw,\n units: params.units ?? 0,\n reissuable: params.reissuable ?? true,\n ipfsHash: params.ipfsHash\n }));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createQualifierTagTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, params.burnAddress, params.burnAmountSats, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createAssetTransferOutput(params.qualifierChangeAddress, params.qualifierName, params.qualifierChangeAmountRaw));\n for (const address of params.targetAddresses) {\n outputs.push(createNullAssetTagOutput(address, params.qualifierName, params.operation, params.nullAssetDestinationMode ?? 'strict'));\n }\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createFreezeAddressesTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, undefined, undefined, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress, getOwnerTokenName(params.assetName)));\n for (const address of params.targetAddresses) {\n outputs.push(createNullAssetRestrictionOutput(address, params.assetName, freezeFlagFromOperation(params.operation), params.nullAssetDestinationMode ?? 'strict'));\n }\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createFreezeAssetTransaction(params) {\n const outputs = [];\n appendXnaEnvelope(outputs, undefined, undefined, params.xnaChangeAddress, params.xnaChangeSats);\n outputs.push(createOwnerAssetTransferOutput(params.ownerChangeAddress, getOwnerTokenName(params.assetName)));\n outputs.push(createGlobalRestrictionOutput(params.assetName, freezeFlagFromOperation(params.operation) + 2));\n appendExtraOutputs(outputs, params.extraOutputs);\n return buildTransaction(params.version, params.locktime, params.inputs, outputs);\n}\nfunction createFromOperation(build) {\n switch (build.operationType) {\n case 'STANDARD_PAYMENT':\n return createPaymentTransaction(build.params);\n case 'STANDARD_TRANSFER':\n return createStandardAssetTransferTransaction(build.params);\n case 'ISSUE_ROOT':\n case 'ISSUE_MSGCHANNEL':\n return createIssueAssetTransaction(build.params);\n case 'ISSUE_SUB':\n return createIssueSubAssetTransaction(build.params);\n case 'ISSUE_UNIQUE':\n return createIssueUniqueAssetTransaction(build.params);\n case 'ISSUE_DEPIN':\n return createIssueDepinTransaction(build.params);\n case 'ISSUE_QUALIFIER':\n case 'ISSUE_SUB_QUALIFIER':\n return createIssueQualifierTransaction(build.params);\n case 'ISSUE_RESTRICTED':\n return createIssueRestrictedTransaction(build.params);\n case 'REISSUE':\n return createReissueTransaction(build.params);\n case 'REISSUE_RESTRICTED':\n return createReissueRestrictedTransaction(build.params);\n case 'TAG_ADDRESSES':\n return createQualifierTagTransaction({\n ...build.params,\n operation: 'tag'\n });\n case 'UNTAG_ADDRESSES':\n return createQualifierTagTransaction({\n ...build.params,\n operation: 'untag'\n });\n case 'FREEZE_ADDRESSES':\n return createFreezeAddressesTransaction({\n ...build.params,\n operation: 'freeze'\n });\n case 'UNFREEZE_ADDRESSES':\n return createFreezeAddressesTransaction({\n ...build.params,\n operation: 'unfreeze'\n });\n case 'FREEZE_ASSET':\n return createFreezeAssetTransaction({\n ...build.params,\n operation: 'freeze'\n });\n case 'UNFREEZE_ASSET':\n return createFreezeAssetTransaction({\n ...build.params,\n operation: 'unfreeze'\n });\n default: {\n const unsupported = build;\n throw new Error(`Unsupported operation type: ${JSON.stringify(unsupported)}`);\n }\n }\n}\n\nexport { OWNER_ASSET_AMOUNT, UNIQUE_ASSETS_REISSUABLE, UNIQUE_ASSET_AMOUNT, UNIQUE_ASSET_UNITS, assertDepinAssetName, assetUnitsToRaw, createAssetTransferOutput, createFreezeAddressesTransaction, createFreezeAssetTransaction, createFromOperation, createGlobalRestrictionOutput, createIssueAssetOutput, createIssueAssetTransaction, createIssueDepinTransaction, createIssueQualifierTransaction, createIssueRestrictedTransaction, createIssueSubAssetTransaction, createIssueUniqueAssetTransaction, createNullAssetRestrictionOutput, createNullAssetTagOutput, createOwnerAssetIssueOutput, createOwnerAssetTransferOutput, createPaymentTransaction, createQualifierTagTransaction, createReissueAssetOutput, createReissueRestrictedTransaction, createReissueTransaction, createStandardAssetTransferTransaction, createTransferOutput, createTransferWithMessageOutput, createUnsignedTransaction, createVerifierStringOutput, createXnaOutput, decodeAddress, decodeAssetDataReferenceHex, encodeAssetDataReference, encodeAssetTransferPayload, encodeAssetTransferScript, encodeAuthScriptDestinationScript, encodeDestinationScript, encodeGlobalRestrictionScript, encodeNewAssetPayload, encodeNewAssetScript, encodeNullAssetDataPayload, encodeNullAssetDestinationScript, encodeNullAssetRestrictionScript, encodeNullAssetTagPayload, encodeNullAssetTagScript, encodeOwnerAssetPayload, encodeOwnerAssetScript, encodeP2PKHScript, encodePQWitnessScript, encodeReissueAssetPayload, encodeReissueAssetScript, encodeVerifierStringPayload, encodeVerifierStringScript, formatAssetDataReferenceHex, getBurnAddressForOperation, getBurnAmountSats, getBurnAmountXna, getOwnerTokenName, getParentAssetName, getUniqueAssetName, inferNetworkFromAnyAddress, isCidV0AssetReference, isDepinAssetName, isEncodedAssetDataReferenceHex, isRawAssetDataReferenceHex, isTxidAssetReference, normalizeVerifierString, resolveAddressInput, serializeInput, serializeOutput, xnaToSatoshis };\n//# sourceMappingURL=index.js.map\n","/**\n * Address helpers. Wraps `decodeAddress` from\n * `@neuraiproject/neurai-create-transaction` to produce the exact\n * scriptPubKey bytes a covenant needs to hardcode. The actual\n * scriptPubKey encoders live in `./standard/*`; this module delegates.\n *\n * Two destination types are supported for the payment output (output[0]):\n * - Legacy P2PKH (base58check)\n * - AuthScript witness v1 (bech32m)\n */\nimport { decodeAddress } from '@neuraiproject/neurai-create-transaction';\nimport { encodeP2PKHScriptPubKey } from './standard/p2pkh.js';\nimport { encodeAuthScriptScriptPubKey } from './standard/authscript.js';\n// Re-export for callers that imported these from `address` pre-refactor. The\n// canonical path going forward is `./standard/p2pkh` / `./standard/authscript`.\nexport { encodeP2PKHScriptPubKey, encodeAuthScriptScriptPubKey };\n/**\n * Resolve any accepted seller address string into its scriptPubKey.\n * The returned bytes are what the covenant will hardcode and later verify\n * via `OP_OUTPUTSCRIPT == <bytes>`.\n */\nexport function encodeSellerScriptPubKey(address) {\n const decoded = decodeAddress(address);\n if (decoded.type === 'p2pkh') {\n const hash = Uint8Array.from(decoded.hash);\n return {\n kind: 'p2pkh',\n bytes: encodeP2PKHScriptPubKey(hash),\n hash\n };\n }\n if (decoded.type === 'authscript') {\n const program = Uint8Array.from(decoded.program);\n return {\n kind: 'authscript',\n bytes: encodeAuthScriptScriptPubKey(program),\n hash: program\n };\n }\n throw new Error(`Unsupported seller address type for \"${address}\"`);\n}\n","/**\n * Asset-transfer wrapper split helper.\n *\n * Neurai asset UTXOs have a scriptPubKey of the form\n *\n * <prefix scriptPubKey bytes> OP_XNA_ASSET <pushdata(payload)> OP_DROP\n *\n * where `prefix` is the recipient's standard script (typically a P2PKH, an\n * AuthScript witness v1, or a bare covenant such as the partial-fill sell\n * order), and `payload` serializes a `CAssetTransfer`:\n *\n * payload = rvn_prefix (0x72 0x76 0x6e) || type_marker (0x74 transfer)\n * || VarStr(assetName)\n * || int64LE(amountRaw)\n * [ || messageRef (optional) || int64LE(expireTime) (optional) ]\n *\n * This helper separates the two halves so consumers can validate the prefix\n * (e.g. feed it to `parsePartialFillScript`) while independently reading the\n * asset data displayed to the user. The optional payload tail\n * (`message` + `expireTime`) is tolerated but not exposed — the first\n * version only needs `assetName` and `amountRaw`.\n *\n * Bare (non-wrapped) scriptPubKeys round-trip through this helper by\n * returning `prefixHex === input` and `assetTransfer === null`.\n */\nimport { bytesToHex, hexToBytes, ensureHex } from './core/bytes.js';\nimport { OP_DROP, OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, OP_XNA_ASSET } from './core/opcodes.js';\nconst RVN_MAGIC = Uint8Array.from([0x72, 0x76, 0x6e]); // \"rvn\"\nconst TRANSFER_TYPE = 0x74;\n/**\n * Walk the script one opcode at a time, skipping pushdata payload bytes,\n * until either OP_XNA_ASSET is reached at top level or the end of the\n * script. Returns the byte offset of OP_XNA_ASSET, or -1 if not found.\n * Throws on truncated pushdata.\n */\nfunction findTopLevelAssetOpcode(bytes) {\n let i = 0;\n while (i < bytes.length) {\n const op = bytes[i];\n if (op === OP_XNA_ASSET)\n return i;\n // Short direct push: 0x01..0x4b\n if (op >= 0x01 && op <= 0x4b) {\n const len = op;\n const next = i + 1 + len;\n if (next > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: short push of ${len} bytes at offset ${i} exceeds script length`);\n }\n i = next;\n continue;\n }\n if (op === OP_PUSHDATA1) {\n if (i + 1 >= bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: truncated PUSHDATA1 length at offset ${i}`);\n }\n const len = bytes[i + 1];\n const next = i + 2 + len;\n if (next > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: PUSHDATA1 of ${len} bytes at offset ${i} exceeds script length`);\n }\n i = next;\n continue;\n }\n if (op === OP_PUSHDATA2) {\n if (i + 2 >= bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: truncated PUSHDATA2 length at offset ${i}`);\n }\n const len = bytes[i + 1] | (bytes[i + 2] << 8);\n const next = i + 3 + len;\n if (next > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: PUSHDATA2 of ${len} bytes at offset ${i} exceeds script length`);\n }\n i = next;\n continue;\n }\n if (op === OP_PUSHDATA4) {\n if (i + 4 >= bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: truncated PUSHDATA4 length at offset ${i}`);\n }\n const len = (bytes[i + 1] |\n (bytes[i + 2] << 8) |\n (bytes[i + 3] << 16) |\n (bytes[i + 4] << 24)) >>>\n 0;\n const next = i + 5 + len;\n if (next > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: PUSHDATA4 of ${len} bytes at offset ${i} exceeds script length`);\n }\n i = next;\n continue;\n }\n // Any other opcode (including OP_1..OP_16, OP_DUP, OP_HASH160, etc.) is\n // one byte wide in Neurai Script. Advance.\n i += 1;\n }\n return -1;\n}\n/**\n * Read the pushdata element that sits immediately after OP_XNA_ASSET and\n * return its payload bytes together with the cursor position after the\n * element. Only direct pushes (1..75) and PUSHDATA1 are accepted — a\n * well-formed asset transfer payload fits within 75 bytes for the common\n * case and comfortably within 255 bytes even with long names and tails.\n * PUSHDATA2 and PUSHDATA4 would signal a malformed or adversarial wrapper.\n */\nfunction readPayloadPush(bytes, start) {\n if (start >= bytes.length) {\n throw new Error('splitAssetWrappedScriptPubKey: truncated wrapper — missing payload push');\n }\n const op = bytes[start];\n if (op >= 0x01 && op <= 0x4b) {\n const len = op;\n const dataStart = start + 1;\n const dataEnd = dataStart + len;\n if (dataEnd > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload short push of ${len} bytes exceeds script length`);\n }\n return { payload: bytes.slice(dataStart, dataEnd), after: dataEnd };\n }\n if (op === OP_PUSHDATA1) {\n if (start + 1 >= bytes.length) {\n throw new Error('splitAssetWrappedScriptPubKey: truncated PUSHDATA1 in asset payload');\n }\n const len = bytes[start + 1];\n const dataStart = start + 2;\n const dataEnd = dataStart + len;\n if (dataEnd > bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload PUSHDATA1 of ${len} bytes exceeds script length`);\n }\n return { payload: bytes.slice(dataStart, dataEnd), after: dataEnd };\n }\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload push opcode 0x${op.toString(16)} not accepted (expected 0x01..0x4b or PUSHDATA1)`);\n}\nfunction parseAssetTransferPayload(payload) {\n if (payload.length < 4 + 1 + 8) {\n // 4 magic+type, 1 varstr length, 8 int64LE amount\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload of ${payload.length} bytes is too short`);\n }\n for (let i = 0; i < 3; i += 1) {\n if (payload[i] !== RVN_MAGIC[i]) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload magic mismatch — expected \"rvn\" got 0x${payload[0].toString(16)} 0x${payload[1].toString(16)} 0x${payload[2].toString(16)}`);\n }\n }\n if (payload[3] !== TRANSFER_TYPE) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload type marker 0x${payload[3].toString(16)} is not a transfer (0x74)`);\n }\n const nameLen = payload[4];\n const nameStart = 5;\n const nameEnd = nameStart + nameLen;\n if (nameEnd + 8 > payload.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: asset payload truncated — name length ${nameLen} does not leave room for amount`);\n }\n let assetName = '';\n for (let i = nameStart; i < nameEnd; i += 1) {\n assetName += String.fromCharCode(payload[i]);\n }\n let amountRaw = 0n;\n for (let i = 0; i < 8; i += 1) {\n amountRaw |= BigInt(payload[nameEnd + i]) << BigInt(8 * i);\n }\n // Any bytes after nameEnd + 8 form the optional tail (message +\n // expireTime). We intentionally ignore them in this first version; the\n // raw payload remains available via `payloadHex` if a consumer later\n // needs to inspect them.\n return { assetName, amountRaw };\n}\n/**\n * Parse an asset-transfer-wrapped scriptPubKey. Accepts both wrapped and\n * bare forms. Throws on structural malformation (truncated pushdata,\n * missing OP_DROP after payload, bad magic, unsupported pushdata width).\n */\nexport function splitAssetWrappedScriptPubKey(spkHex) {\n const normalized = ensureHex(spkHex, 'scriptPubKey');\n const bytes = hexToBytes(normalized);\n const assetOpAt = findTopLevelAssetOpcode(bytes);\n if (assetOpAt < 0) {\n return { prefixHex: normalized, assetTransfer: null };\n }\n const prefix = bytes.slice(0, assetOpAt);\n const { payload, after } = readPayloadPush(bytes, assetOpAt + 1);\n if (after >= bytes.length) {\n throw new Error('splitAssetWrappedScriptPubKey: asset wrapper missing trailing OP_DROP');\n }\n if (bytes[after] !== OP_DROP) {\n throw new Error(`splitAssetWrappedScriptPubKey: expected OP_DROP at offset ${after}, got 0x${bytes[after].toString(16)}`);\n }\n if (after + 1 !== bytes.length) {\n throw new Error(`splitAssetWrappedScriptPubKey: ${bytes.length - after - 1} trailing bytes after OP_DROP`);\n }\n const { assetName, amountRaw } = parseAssetTransferPayload(payload);\n return {\n prefixHex: bytesToHex(prefix),\n assetTransfer: {\n assetName,\n amountRaw,\n payloadHex: bytesToHex(payload),\n },\n };\n}\n","/**\n * Partial-Fill Sell Order covenant script.\n *\n * The covenant has two branches selected by the top of the unlock stack:\n *\n * OP_IF (unlock pushed 1) → Cancel: seller signs, recovers remainder.\n * OP_ELSE (unlock pushed 0) → Public partial fill: buyer provides the\n * fill amount `N` and the tx layout is\n * validated byte by byte.\n *\n * The partial-fill branch enforces a fixed output layout so that the script\n * stays compact and parseable:\n *\n * output[0] = XNA payment to seller (value >= N * unitPriceSats)\n * output[1] = asset to buyer (tokenId, amount == N)\n * output[2] = covenant remainder (same AuthScript commitment, amount == in - N)\n * output[3+] = optional buyer change (not constrained by the covenant)\n *\n * The remainder UTXO reuses the spent covenant's AuthScript v1 commitment\n * via `OP_OUTPUTAUTHCOMMITMENT(2) == OP_TXFIELD(0x02)` (NIP-023). Comparing\n * commitments rather than full scriptPubKeys is mandatory here: the\n * remainder output's asset wrapper (`OP_XNA_ASSET ... OP_DROP`) encodes a\n * smaller `amountRaw` than the spent UTXO's wrapper, so the full-spk\n * equality used by earlier drafts was vacuously unsatisfiable on any\n * asset-wrapped covenant UTXO.\n *\n * The cancel branch uses classical ECDSA (`OP_HASH160 + OP_CHECKSIG`) and\n * commits to a 20-byte PKH. As a consequence this variant only accepts\n * legacy P2PKH addresses as the seller destination. For AuthScript bech32m\n * destinations and post-quantum signing, use `buildPartialFillScriptPQ`.\n */\nimport { decodeAddress } from '@neuraiproject/neurai-create-transaction';\nimport { bytesToHex } from '../../core/bytes.js';\nimport { encodeP2PKHScriptPubKey } from '../../standard/p2pkh.js';\nimport { ASSETFIELD_AMOUNT, ASSETFIELD_NAME, OP_CHECKSIG, OP_DROP, OP_DUP, OP_ELSE, OP_ENDIF, OP_EQUALVERIFY, OP_GREATERTHANOREQUAL, OP_HASH160, OP_IF, OP_INPUTASSETFIELD, OP_MUL, OP_OUTPUTASSETFIELD, OP_OUTPUTAUTHCOMMITMENT, OP_OUTPUTSCRIPT, OP_OUTPUTVALUE, OP_OVER, OP_SUB, OP_SWAP, OP_TXFIELD, OP_VERIFY, TXFIELD_AUTHSCRIPT_COMMITMENT } from '../../core/opcodes.js';\nimport { ScriptBuilder } from '../../core/script-builder.js';\nexport { encodeP2PKHScriptPubKey } from '../../standard/p2pkh.js';\nconst ASSET_NAME_MAX = 32;\nfunction decodeSellerAddress(sellerAddress) {\n if (typeof sellerAddress !== 'string' || sellerAddress.length === 0) {\n throw new Error('sellerAddress is required');\n }\n const decoded = decodeAddress(sellerAddress);\n if (decoded.type !== 'p2pkh') {\n throw new Error(`sellerAddress must be a legacy P2PKH address (the legacy partial-fill covenant uses OP_HASH160 + OP_CHECKSIG); ` +\n `got ${decoded.type}. Use buildPartialFillScriptPQ for AuthScript destinations.`);\n }\n const pkh = Uint8Array.from(decoded.hash);\n if (pkh.length !== 20) {\n throw new Error(`decoded sellerAddress produced a ${pkh.length}-byte hash, expected 20`);\n }\n return pkh;\n}\nfunction assertTokenId(tokenId) {\n if (typeof tokenId !== 'string' || tokenId.length === 0) {\n throw new Error('tokenId is required');\n }\n if (!/^[A-Z0-9._]+$/.test(tokenId)) {\n throw new Error(`tokenId \"${tokenId}\" is not a valid Neurai asset name`);\n }\n if (tokenId.length > ASSET_NAME_MAX) {\n throw new Error(`tokenId exceeds ${ASSET_NAME_MAX} bytes`);\n }\n}\nfunction assertPrice(priceSats) {\n if (typeof priceSats !== 'bigint') {\n throw new Error('unitPriceSats must be a bigint (satoshis per indivisible unit)');\n }\n if (priceSats <= 0n) {\n throw new Error('unitPriceSats must be > 0');\n }\n // 8-byte signed int ceiling: values beyond this cannot be produced by OP_MUL\n // inside the covenant without overflow (CScriptNum is int64).\n if (priceSats > 0x7fffffffffffffffn) {\n throw new Error('unitPriceSats exceeds int64 range');\n }\n}\n/**\n * Build the `scriptPubKey` of a Partial-Fill Sell Order covenant UTXO.\n * Returns raw bytes; wrap with `bytesToHex` for wire format.\n */\nexport function buildPartialFillScript(params) {\n const { sellerAddress, tokenId, unitPriceSats } = params;\n const sellerPubKeyHash = decodeSellerAddress(sellerAddress);\n assertTokenId(tokenId);\n assertPrice(unitPriceSats);\n const sellerScriptPubKey = encodeP2PKHScriptPubKey(sellerPubKeyHash);\n const tokenIdBytes = new TextEncoder().encode(tokenId);\n const b = new ScriptBuilder();\n // ───────── Cancel branch (IF) ─────────\n // scriptSig expected: <sig> <pubkey> OP_1\n b.op(OP_IF)\n .op(OP_DUP, OP_HASH160)\n .pushBytes(sellerPubKeyHash)\n .op(OP_EQUALVERIFY, OP_CHECKSIG)\n .op(OP_ELSE);\n // ───────── Partial-fill branch (ELSE) ─────────\n // scriptSig expected: <N> OP_0\n //\n // Stack invariant entering the ELSE branch: [ N ]\n // 1. Payment value to seller (output 0)\n // require outputValue(0) >= N * unitPriceSats\n b.op(OP_DUP) // [ N, N ]\n .pushInt(unitPriceSats) // [ N, N, price ]\n .op(OP_MUL) // [ N, N*price ]\n .pushInt(0) // [ N, N*price, 0 ]\n .op(OP_OUTPUTVALUE) // [ N, N*price, value ]\n .op(OP_SWAP) // [ N, value, N*price ]\n .op(OP_GREATERTHANOREQUAL)\n .op(OP_VERIFY); // [ N ]\n // 2. Payment scriptPubKey must equal Alice's (output 0)\n b.pushInt(0)\n .op(OP_OUTPUTSCRIPT) // [ N, scriptPubKey_out0 ]\n .pushBytes(sellerScriptPubKey)\n .op(OP_EQUALVERIFY); // [ N ]\n // 3. Asset delivered to buyer (output 1): amount == N\n b.op(OP_DUP) // [ N, N ]\n .pushInt(1) // [ N, N, 1 ]\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_OUTPUTASSETFIELD) // [ N, N, amount_out1 ]\n .op(OP_EQUALVERIFY); // [ N ]\n // 4. Asset delivered to buyer (output 1): name == tokenId\n b.pushInt(1)\n .pushInt(ASSETFIELD_NAME)\n .op(OP_OUTPUTASSETFIELD) // [ N, name_out1 ]\n .pushBytes(tokenIdBytes)\n .op(OP_EQUALVERIFY); // [ N ]\n // 5. Remainder covenant continuity (output 2): same AuthScript commitment\n // as spent. NIP-023: comparing 32-byte commitments rather than full\n // scriptPubKeys, because the remainder's asset wrapper carries a\n // different `amountRaw` than the spent UTXO's wrapper.\n b.pushInt(2)\n .op(OP_OUTPUTAUTHCOMMITMENT) // [ N, auth_out2 ]\n .pushInt(TXFIELD_AUTHSCRIPT_COMMITMENT)\n .op(OP_TXFIELD) // [ N, auth_out2, spent_auth ]\n .op(OP_EQUALVERIFY); // [ N ]\n // 6. Remainder output: same tokenId\n b.pushInt(2)\n .pushInt(ASSETFIELD_NAME)\n .op(OP_OUTPUTASSETFIELD) // [ N, name_out2 ]\n .pushBytes(tokenIdBytes)\n .op(OP_EQUALVERIFY); // [ N ]\n // 7. Remainder output: amount == inputAssetAmount - N\n b.pushInt(2)\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_OUTPUTASSETFIELD) // [ N, rem_amount ]\n .op(OP_OVER) // [ N, rem_amount, N ] -- copy N under top\n .pushInt(0) // [ N, rem_amount, N, 0 ]\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_INPUTASSETFIELD) // [ N, rem_amount, N, in_amount ]\n .op(OP_SWAP) // [ N, rem_amount, in_amount, N ]\n .op(OP_SUB) // [ N, rem_amount, in_amount - N ]\n .op(OP_EQUALVERIFY); // [ N ]\n // Drop N, leave TRUE on the stack so the ELSE branch evaluates as success.\n b.op(OP_DROP).pushInt(1);\n b.op(OP_ENDIF);\n return b.build();\n}\n/** Hex convenience wrapper for `buildPartialFillScript`. */\nexport function buildPartialFillScriptHex(params) {\n return bytesToHex(buildPartialFillScript(params));\n}\n// Re-export atomic helpers so parse.ts and callers can reuse them.\nexport { pushBytes, pushInt } from '../../core/script-builder.js';\n","/**\n * PQ (post-quantum) variant of the Partial-Fill Sell Order covenant.\n *\n * Identical partial-fill branch to the legacy covenant, but the **cancel**\n * branch accepts an ML-DSA-44 signature instead of an ECDSA one. This\n * requires:\n * - `SCRIPT_VERIFY_CHECKSIGFROMSTACK` (for OP_CSFS) active\n * - `SCRIPT_VERIFY_TXHASH` (for OP_TXHASH) active\n * - NIP-18 (`MAX_PQ_SCRIPT_ELEMENT_SIZE = 3072`) active, so the ~2.4 KB\n * signature and ~1.3 KB pubkey can be pushed to the script stack\n *\n * All three are active on DePIN-Test testnet.\n *\n * Cancel-branch flow (scriptSig pushes `<sig> <pubkey> OP_1`):\n *\n * 1. OP_DUP OP_SHA256 <commitment> OP_EQUALVERIFY → pubkey matches\n * 2. <selector> OP_TXHASH → message = H(tx)\n * 3. OP_SWAP OP_CHECKSIGFROMSTACK → CSFS verifies sig\n *\n * The message that gets signed is **SHA256(OP_TXHASH(selector))** — CSFS\n * single-SHA256s its message argument before verification, and OP_TXHASH\n * produces its own 32-byte hash, so the seller computes:\n * `sign(pqSeckey, SHA256(doubleSHA256(selected_tx_fields)))`\n */\nimport { bytesToHex } from '../../core/bytes.js';\nimport { encodeSellerScriptPubKey } from '../../address.js';\nimport { ASSETFIELD_AMOUNT, ASSETFIELD_NAME, OP_CHECKSIGFROMSTACK, OP_DROP, OP_DUP, OP_ELSE, OP_ENDIF, OP_EQUALVERIFY, OP_GREATERTHANOREQUAL, OP_IF, OP_INPUTASSETFIELD, OP_MUL, OP_OUTPUTASSETFIELD, OP_OUTPUTAUTHCOMMITMENT, OP_OUTPUTSCRIPT, OP_OUTPUTVALUE, OP_OVER, OP_SHA256, OP_SUB, OP_SWAP, OP_TXFIELD, OP_TXHASH, OP_VERIFY, TXFIELD_AUTHSCRIPT_COMMITMENT } from '../../core/opcodes.js';\nimport { ScriptBuilder } from '../../core/script-builder.js';\nconst ASSET_NAME_MAX = 32;\nexport const DEFAULT_PQ_TXHASH_SELECTOR = 0xff;\nfunction assertCommitment(commitment) {\n if (!(commitment instanceof Uint8Array) || commitment.length !== 32) {\n throw new Error('pubKeyCommitment must be a 32-byte Uint8Array (SHA256 of pubKey)');\n }\n}\nfunction assertTokenId(tokenId) {\n if (typeof tokenId !== 'string' || tokenId.length === 0) {\n throw new Error('tokenId is required');\n }\n if (!/^[A-Z0-9._]+$/.test(tokenId)) {\n throw new Error(`tokenId \"${tokenId}\" is not a valid Neurai asset name`);\n }\n if (tokenId.length > ASSET_NAME_MAX) {\n throw new Error(`tokenId exceeds ${ASSET_NAME_MAX} bytes`);\n }\n}\nfunction assertPrice(priceSats) {\n if (typeof priceSats !== 'bigint') {\n throw new Error('unitPriceSats must be a bigint');\n }\n if (priceSats <= 0n) {\n throw new Error('unitPriceSats must be > 0');\n }\n if (priceSats > 0x7fffffffffffffffn) {\n throw new Error('unitPriceSats exceeds int64 range');\n }\n}\nfunction assertSelector(selector) {\n if (!Number.isInteger(selector) || selector < 0 || selector > 0xff) {\n throw new Error('txHashSelector must be a single byte (0x00..0xff)');\n }\n if (selector === 0) {\n throw new Error('txHashSelector 0x00 is rejected by OP_TXHASH');\n }\n}\n/**\n * Build the scriptPubKey of a PQ Partial-Fill Sell Order covenant UTXO.\n */\nexport function buildPartialFillScriptPQ(params) {\n const { paymentAddress, pubKeyCommitment, tokenId, unitPriceSats, txHashSelector = DEFAULT_PQ_TXHASH_SELECTOR } = params;\n assertCommitment(pubKeyCommitment);\n assertTokenId(tokenId);\n assertPrice(unitPriceSats);\n assertSelector(txHashSelector);\n const payment = encodeSellerScriptPubKey(paymentAddress);\n const tokenIdBytes = new TextEncoder().encode(tokenId);\n const b = new ScriptBuilder();\n // ───────── Cancel branch (PQ via OP_CHECKSIGFROMSTACK) ─────────\n // scriptSig expected: <sigPQ> <pubKeyPQ> OP_1\n // After OP_IF consumes the flag: [ sig, pubKey ]\n //\n // The selector MUST be pushed as a raw 1-byte element — consensus\n // (`interpreter.cpp` OP_TXHASH case) rejects any stack item of\n // size ≠ 1. Using `pushInt(selector)` would work for 1..127 but emit a\n // 2-byte CScriptNum for 0x80..0xff (the sign-disambiguation pad), which\n // makes OP_TXHASH fail with SCRIPT_ERR_TXHASH. See\n // `memory/project_covenant_v3_findings.md` bug B for details.\n b.op(OP_IF)\n .op(OP_DUP) // [ sig, pubKey, pubKey ]\n .op(OP_SHA256) // [ sig, pubKey, H(pubKey) ]\n .pushBytes(pubKeyCommitment) // [ sig, pubKey, H(pubKey), commitment ]\n .op(OP_EQUALVERIFY) // [ sig, pubKey ]\n .pushBytes(Uint8Array.of(txHashSelector)) // [ sig, pubKey, selector ] — always 1-byte stack item\n .op(OP_TXHASH) // [ sig, pubKey, txHash ]\n .op(OP_SWAP) // [ sig, txHash, pubKey ]\n .op(OP_CHECKSIGFROMSTACK) // [ 1 | 0 ]\n .op(OP_ELSE);\n // ───────── Partial-fill branch (identical layout to legacy) ─────────\n // scriptSig expected: <N> OP_0\n // Stack entering ELSE: [ N ]\n // 1. Payment value (output 0) >= N * unitPriceSats\n b.op(OP_DUP)\n .pushInt(unitPriceSats)\n .op(OP_MUL)\n .pushInt(0)\n .op(OP_OUTPUTVALUE)\n .op(OP_SWAP)\n .op(OP_GREATERTHANOREQUAL)\n .op(OP_VERIFY);\n // 2. Payment scriptPubKey (output 0) == payment.bytes\n b.pushInt(0)\n .op(OP_OUTPUTSCRIPT)\n .pushBytes(payment.bytes)\n .op(OP_EQUALVERIFY);\n // 3. Asset to buyer (output 1) amount == N\n b.op(OP_DUP)\n .pushInt(1)\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_OUTPUTASSETFIELD)\n .op(OP_EQUALVERIFY);\n // 4. Asset to buyer (output 1) name == tokenId\n b.pushInt(1)\n .pushInt(ASSETFIELD_NAME)\n .op(OP_OUTPUTASSETFIELD)\n .pushBytes(tokenIdBytes)\n .op(OP_EQUALVERIFY);\n // 5. Remainder continuity (output 2) — same AuthScript commitment as spent\n // (NIP-023; see script.ts for why full-spk equality is unsatisfiable on\n // asset-wrapped covenant UTXOs).\n b.pushInt(2)\n .op(OP_OUTPUTAUTHCOMMITMENT)\n .pushInt(TXFIELD_AUTHSCRIPT_COMMITMENT)\n .op(OP_TXFIELD)\n .op(OP_EQUALVERIFY);\n // 6. Remainder tokenId\n b.pushInt(2)\n .pushInt(ASSETFIELD_NAME)\n .op(OP_OUTPUTASSETFIELD)\n .pushBytes(tokenIdBytes)\n .op(OP_EQUALVERIFY);\n // 7. Remainder amount == inputAssetAmount - N\n b.pushInt(2)\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_OUTPUTASSETFIELD)\n .op(OP_OVER)\n .pushInt(0)\n .pushInt(ASSETFIELD_AMOUNT)\n .op(OP_INPUTASSETFIELD)\n .op(OP_SWAP)\n .op(OP_SUB)\n .op(OP_EQUALVERIFY);\n b.op(OP_DROP).pushInt(1);\n b.op(OP_ENDIF);\n return b.build();\n}\nexport function buildPartialFillScriptPQHex(params) {\n return bytesToHex(buildPartialFillScriptPQ(params));\n}\n","/**\n * scriptSig builders for the Partial-Fill Sell Order covenant.\n *\n * These return the raw scriptSig bytes that unlock the covenant UTXO. The\n * surrounding transaction (inputs, outputs, fees, signatures on the buyer's\n * own inputs, etc.) is the caller's responsibility — stitch them together\n * with `@neuraiproject/neurai-create-transaction`.\n */\nimport { bytesToHex } from '../../core/bytes.js';\nimport { ScriptBuilder } from '../../core/script-builder.js';\n/**\n * Unlock the covenant via the public partial-fill branch.\n *\n * Layout on the stack before OP_IF executes (top → bottom):\n * 0 ← selects the OP_ELSE (fill) branch\n * N ← amount of asset the buyer is taking from this order\n *\n * so the scriptSig pushes `<N>` then `<0>`.\n *\n * @param amount units of the asset the buyer is taking. Must be > 0 and\n * strictly less than the amount locked in the order UTXO\n * (equal would leave a zero-asset remainder, which isn't a\n * valid Neurai transfer output).\n */\nexport function buildFillScriptSig(amount) {\n if (typeof amount !== 'bigint') {\n throw new Error('amount must be a bigint');\n }\n if (amount <= 0n) {\n throw new Error('fill amount must be > 0');\n }\n return new ScriptBuilder()\n .pushInt(amount)\n .pushInt(0)\n .build();\n}\nexport function buildFillScriptSigHex(amount) {\n return bytesToHex(buildFillScriptSig(amount));\n}\n/**\n * Unlock the covenant via the seller's cancel branch.\n *\n * Stack before OP_IF (top → bottom):\n * 1 ← selects the OP_IF branch\n * pubkey ← consumed by OP_DUP OP_HASH160 … OP_EQUALVERIFY\n * sig ← consumed by OP_CHECKSIG\n *\n * so the scriptSig pushes `<sig> <pubkey> <1>`.\n *\n * The signature is on whatever sighash the caller picked; this builder does\n * not hash or sign, it only assembles the unlock script once a signature is\n * available.\n */\nexport function buildCancelScriptSig(signatureDer, pubKey) {\n if (!(signatureDer instanceof Uint8Array) || signatureDer.length === 0) {\n throw new Error('signatureDer must be a non-empty Uint8Array');\n }\n if (!(pubKey instanceof Uint8Array) || (pubKey.length !== 33 && pubKey.length !== 65)) {\n throw new Error('pubKey must be a compressed (33B) or uncompressed (65B) secp256k1 key');\n }\n return new ScriptBuilder()\n .pushBytes(signatureDer)\n .pushBytes(pubKey)\n .pushInt(1)\n .build();\n}\nexport function buildCancelScriptSigHex(signatureDer, pubKey) {\n return bytesToHex(buildCancelScriptSig(signatureDer, pubKey));\n}\n","/**\n * scriptSig builders for the PQ Partial-Fill Sell Order covenant.\n *\n * The fill branch is identical to the legacy variant (just pushes `<N> <0>`),\n * so callers reuse `buildFillScriptSig` from `./spend.ts`. Only the cancel\n * branch is different: it carries a full PQ pubkey (~1313 B) and signature\n * (~2421 B), which requires NIP-18's expanded element-size cap.\n */\nimport { bytesToHex } from '../../core/bytes.js';\nimport { ScriptBuilder } from '../../core/script-builder.js';\n/**\n * Build the scriptSig that unlocks the PQ cancel branch.\n *\n * Stack ordering pushed (bottom → top): `sig, pubkey, 1`.\n *\n * @param sigPQ ML-DSA-44 signature over `SHA256(OP_TXHASH(selector))`,\n * **with trailing sighash byte appended** (same convention as\n * OP_CHECKSIG — CSFS strips it before verification). Expected\n * length 2421 bytes for ML-DSA-44.\n * @param pubKey Versioned PQ public key bytes, 1313 bytes (1-byte prefix\n * + 1312-byte ML-DSA-44 key). Must hash (via SHA256) to the\n * `pubKeyCommitment` embedded in the covenant scriptPubKey.\n */\nexport function buildCancelScriptSigPQ(sigPQ, pubKey) {\n if (!(sigPQ instanceof Uint8Array) || sigPQ.length === 0) {\n throw new Error('sigPQ must be a non-empty Uint8Array');\n }\n if (sigPQ.length > 3072) {\n throw new Error(`sigPQ of ${sigPQ.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (3072)`);\n }\n if (!(pubKey instanceof Uint8Array) || pubKey.length === 0) {\n throw new Error('pubKey must be a non-empty Uint8Array');\n }\n if (pubKey.length > 3072) {\n throw new Error(`pubKey of ${pubKey.length} bytes exceeds MAX_PQ_SCRIPT_ELEMENT_SIZE (3072)`);\n }\n return new ScriptBuilder()\n .pushBytes(sigPQ)\n .pushBytes(pubKey)\n .pushInt(1)\n .build();\n}\nexport function buildCancelScriptSigPQHex(sigPQ, pubKey) {\n return bytesToHex(buildCancelScriptSigPQ(sigPQ, pubKey));\n}\n","/**\n * Shared parsing primitives for strict covenant parsers. Each covenant\n * parser walks the exact byte layout emitted by its builder and fails on\n * any deviation; the primitives here centralize the cursor arithmetic,\n * pushdata decoding, and CScriptNum decoding so the legacy and PQ parsers\n * (and future covenant parsers) cannot drift in rigor.\n */\nimport { OP_1 } from './opcodes.js';\nexport function makeCursor(bytes) {\n return { bytes, pos: 0 };\n}\n/** Consume one byte and verify it equals `expected`. */\nexport function expectByte(c, expected, label) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: unexpected end of script while reading ${label}`);\n }\n const got = c.bytes[c.pos];\n if (got !== expected) {\n throw new Error(`parse: expected ${label} = 0x${expected.toString(16)} at offset ${c.pos}, got 0x${got.toString(16)}`);\n }\n c.pos += 1;\n}\n/** Fail if the cursor has not consumed every byte of the script. */\nexport function assertTrailing(c) {\n if (c.pos !== c.bytes.length) {\n throw new Error(`parse: ${c.bytes.length - c.pos} trailing bytes after end of script`);\n }\n}\n/**\n * Read one pushdata element from the cursor. Supports direct pushes\n * (1..75 bytes), `OP_PUSHDATA1` and `OP_PUSHDATA2`. `OP_PUSHDATA4` is not\n * supported by any current covenant script and would overflow the\n * per-element cap anyway. Truncation is checked for all length fields\n * and payload ranges.\n */\nexport function readPush(c, label) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: unexpected end of script while reading push for ${label}`);\n }\n const opcode = c.bytes[c.pos];\n c.pos += 1;\n // Short direct push: 1..75 bytes\n if (opcode >= 0x01 && opcode <= 0x4b) {\n const len = opcode;\n if (c.pos + len > c.bytes.length) {\n throw new Error(`parse: short push of ${len} bytes exceeds script length at ${label}`);\n }\n const data = c.bytes.slice(c.pos, c.pos + len);\n c.pos += len;\n return data;\n }\n // OP_PUSHDATA1\n if (opcode === 0x4c) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: truncated PUSHDATA1 length at ${label}`);\n }\n const len = c.bytes[c.pos];\n c.pos += 1;\n if (c.pos + len > c.bytes.length) {\n throw new Error(`parse: PUSHDATA1 of ${len} bytes exceeds script length at ${label}`);\n }\n const data = c.bytes.slice(c.pos, c.pos + len);\n c.pos += len;\n return data;\n }\n // OP_PUSHDATA2\n if (opcode === 0x4d) {\n if (c.pos + 2 > c.bytes.length) {\n throw new Error(`parse: truncated PUSHDATA2 length at ${label}`);\n }\n const len = c.bytes[c.pos] | (c.bytes[c.pos + 1] << 8);\n c.pos += 2;\n if (c.pos + len > c.bytes.length) {\n throw new Error(`parse: PUSHDATA2 of ${len} bytes exceeds script length at ${label}`);\n }\n const data = c.bytes.slice(c.pos, c.pos + len);\n c.pos += len;\n return data;\n }\n throw new Error(`parse: expected a pushdata opcode at ${label}, got 0x${opcode.toString(16)} at offset ${c.pos - 1}`);\n}\n/**\n * Decode a `CScriptNum` byte vector (little-endian sign-magnitude, up to\n * 8 bytes) into a BigInt. Empty vector encodes 0.\n */\nexport function decodeScriptNum(data, label) {\n if (data.length === 0)\n return 0n;\n if (data.length > 8) {\n throw new Error(`parse: CScriptNum at ${label} exceeds 8 bytes`);\n }\n let n = 0n;\n for (let i = 0; i < data.length - 1; i += 1) {\n n |= BigInt(data[i]) << BigInt(8 * i);\n }\n const last = data[data.length - 1];\n n |= BigInt(last & 0x7f) << BigInt(8 * (data.length - 1));\n if (last & 0x80) {\n n = -n;\n }\n return n;\n}\n/**\n * Read a push as a non-negative CScriptNum. Recognises OP_1..OP_16\n * shorthand. `OP_0` is not accepted because the covenant callers use this\n * only for values that are strictly positive (prices, selectors, indices).\n */\nexport function readPushPositiveInt(c, label) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: end of script at ${label}`);\n }\n const opcode = c.bytes[c.pos];\n if (opcode >= OP_1 && opcode <= 0x60) {\n c.pos += 1;\n return BigInt(opcode - OP_1 + 1);\n }\n const data = readPush(c, label);\n return decodeScriptNum(data, label);\n}\n/**\n * Read a 1-byte selector as an UNSIGNED 8-bit integer (0..255). Accepts\n * two on-wire encodings, because old vs new covenant builders differ:\n * - `OP_1..OP_16` shorthand (single opcode) → values 1..16.\n * - `0x01 <byte>` raw 1-byte push → any value 1..255.\n *\n * Values 0x80..0xff MUST use the raw-push form; the CScriptNum encoding\n * would need a 0x00 padding byte and become 2 bytes on-stack, which\n * consensus `OP_TXHASH` rejects. The builder in `script-pq.ts` emits the\n * raw-push form unconditionally; the parser stays lenient so covenants\n * built by older tools (using OP_N for small values) still round-trip.\n */\nexport function readPushUint8(c, label) {\n if (c.pos >= c.bytes.length) {\n throw new Error(`parse: end of script at ${label}`);\n }\n const opcode = c.bytes[c.pos];\n if (opcode >= OP_1 && opcode <= 0x60) {\n c.pos += 1;\n return opcode - OP_1 + 1;\n }\n const data = readPush(c, label);\n if (data.length !== 1) {\n throw new Error(`parse: ${label} must be a single-byte push, got ${data.length} bytes`);\n }\n return data[0];\n}\n","/**\n * Parser for the Partial-Fill Sell Order covenant.\n *\n * Extracts `(sellerPubKeyHash, unitPriceSats, tokenId)` from a scriptPubKey\n * that was produced by `buildPartialFillScript`. The parser walks the exact\n * byte layout emitted by the builder and fails on any deviation — this is\n * deliberate, so a downstream indexer can unambiguously classify a UTXO as\n * \"partial-fill order\" or \"unknown script\" with no false positives.\n */\nimport { bytesEqual, bytesToHex, hexToBytes } from '../../core/bytes.js';\nimport { ASSETFIELD_AMOUNT, ASSETFIELD_NAME, OP_0, OP_1, OP_2, OP_CHECKSIG, OP_DROP, OP_DUP, OP_ELSE, OP_ENDIF, OP_EQUALVERIFY, OP_GREATERTHANOREQUAL, OP_HASH160, OP_IF, OP_INPUTASSETFIELD, OP_MUL, OP_OUTPUTASSETFIELD, OP_OUTPUTAUTHCOMMITMENT, OP_OUTPUTSCRIPT, OP_OUTPUTVALUE, OP_OVER, OP_SUB, OP_SWAP, OP_TXFIELD, OP_VERIFY, TXFIELD_AUTHSCRIPT_COMMITMENT } from '../../core/opcodes.js';\nimport { assertTrailing, expectByte, makeCursor, readPush, readPushPositiveInt } from '../../core/script-parser.js';\n/**\n * Parse a covenant scriptPubKey and extract its parameters. Throws with a\n * descriptive message if the bytes don't match the partial-fill template.\n */\nexport function parsePartialFillScript(script, network = 'xna-test') {\n const bytes = typeof script === 'string' ? hexToBytes(script) : script;\n const c = makeCursor(bytes);\n // ───── Cancel branch prefix ─────\n expectByte(c, OP_IF, 'OP_IF');\n expectByte(c, OP_DUP, 'OP_DUP (cancel)');\n expectByte(c, OP_HASH160, 'OP_HASH160');\n const sellerPubKeyHash = readPush(c, 'sellerPubKeyHash');\n if (sellerPubKeyHash.length !== 20) {\n throw new Error(`parse: sellerPubKeyHash is ${sellerPubKeyHash.length} bytes, expected 20`);\n }\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (cancel)');\n expectByte(c, OP_CHECKSIG, 'OP_CHECKSIG (cancel)');\n expectByte(c, OP_ELSE, 'OP_ELSE');\n // ───── Payment value check ─────\n expectByte(c, OP_DUP, 'OP_DUP (price)');\n const unitPriceSats = readPushPositiveInt(c, 'unitPriceSats');\n expectByte(c, OP_MUL, 'OP_MUL');\n expectByte(c, OP_0, 'OP_0 (payment idx)');\n expectByte(c, OP_OUTPUTVALUE, 'OP_OUTPUTVALUE');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_GREATERTHANOREQUAL, 'OP_GREATERTHANOREQUAL');\n expectByte(c, OP_VERIFY, 'OP_VERIFY (payment)');\n // ───── Payment scriptPubKey check ─────\n expectByte(c, OP_0, 'OP_0 (spk idx)');\n expectByte(c, OP_OUTPUTSCRIPT, 'OP_OUTPUTSCRIPT (payment)');\n const sellerSpk = readPush(c, 'sellerScriptPubKey');\n // Must be P2PKH with our PKH.\n const expectedSpk = new Uint8Array([\n OP_DUP, OP_HASH160, 0x14, ...sellerPubKeyHash, OP_EQUALVERIFY, OP_CHECKSIG\n ]);\n if (!bytesEqual(sellerSpk, expectedSpk)) {\n throw new Error('parse: embedded seller scriptPubKey does not match the cancel PKH');\n }\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (payment spk)');\n // ───── Buyer asset amount check (output 1) ─────\n expectByte(c, OP_DUP, 'OP_DUP (buyer amount)');\n expectByte(c, OP_1, 'OP_1 (buyer idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n if (ASSETFIELD_AMOUNT !== 0x02)\n throw new Error('unexpected AMOUNT selector constant');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (buyer amount)');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (buyer amount)');\n // ───── Buyer asset name check (output 1) ─────\n expectByte(c, OP_1, 'OP_1 (buyer idx)');\n expectByte(c, OP_1, 'OP_1 (NAME selector)');\n if (ASSETFIELD_NAME !== 0x01)\n throw new Error('unexpected NAME selector constant');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (buyer name)');\n const tokenIdBytes1 = readPush(c, 'tokenId #1');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (buyer name)');\n // ───── Remainder continuity: same AuthScript commitment (NIP-023) ─────\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_OUTPUTAUTHCOMMITMENT, 'OP_OUTPUTAUTHCOMMITMENT (remainder)');\n expectByte(c, OP_2, 'OP_2 (TXFIELD selector: AUTHSCRIPT_COMMITMENT)');\n if (TXFIELD_AUTHSCRIPT_COMMITMENT !== 0x02)\n throw new Error('unexpected TXFIELD selector constant');\n expectByte(c, OP_TXFIELD, 'OP_TXFIELD');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder auth)');\n // ───── Remainder tokenId check ─────\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_1, 'OP_1 (NAME selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (remainder name)');\n const tokenIdBytes2 = readPush(c, 'tokenId #2');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder name)');\n // ───── Remainder amount == input amount - N ─────\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (remainder amount)');\n expectByte(c, OP_OVER, 'OP_OVER');\n expectByte(c, OP_0, 'OP_0 (input idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_INPUTASSETFIELD, 'OP_INPUTASSETFIELD');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_SUB, 'OP_SUB');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder amount)');\n // ───── Tail ─────\n expectByte(c, OP_DROP, 'OP_DROP');\n expectByte(c, OP_1, 'OP_1 (true)');\n expectByte(c, OP_ENDIF, 'OP_ENDIF');\n assertTrailing(c);\n if (!bytesEqual(tokenIdBytes1, tokenIdBytes2)) {\n throw new Error('parse: tokenId bytes differ between buyer and remainder checks');\n }\n const tokenId = new TextDecoder('utf-8', { fatal: true }).decode(tokenIdBytes1);\n return {\n network,\n sellerPubKeyHash,\n unitPriceSats,\n tokenId,\n scriptHex: bytesToHex(bytes)\n };\n}\n","/**\n * Parser for the PQ Partial-Fill Sell Order covenant. Returns the same\n * economic parameters as the legacy parser, plus the payment scriptPubKey\n * bytes (which may be P2PKH or AuthScript) and the configured TXHASH\n * selector.\n */\nimport { bytesEqual, bytesToHex, hexToBytes } from '../../core/bytes.js';\nimport { OP_0, OP_1, OP_2, OP_CHECKSIGFROMSTACK, OP_DROP, OP_DUP, OP_ELSE, OP_ENDIF, OP_EQUALVERIFY, OP_GREATERTHANOREQUAL, OP_IF, OP_INPUTASSETFIELD, OP_MUL, OP_OUTPUTASSETFIELD, OP_OUTPUTAUTHCOMMITMENT, OP_OUTPUTSCRIPT, OP_OUTPUTVALUE, OP_OVER, OP_SHA256, OP_SUB, OP_SWAP, OP_TXFIELD, OP_TXHASH, OP_VERIFY, TXFIELD_AUTHSCRIPT_COMMITMENT } from '../../core/opcodes.js';\nimport { assertTrailing, expectByte, makeCursor, readPush, readPushPositiveInt, readPushUint8 } from '../../core/script-parser.js';\n/** Quick discriminator without throwing — useful for indexers. */\nexport function isPartialFillScriptPQ(script) {\n const bytes = typeof script === 'string' ? hexToBytes(script) : script;\n // PQ cancel starts with: OP_IF OP_DUP OP_SHA256\n return (bytes.length > 3 &&\n bytes[0] === OP_IF &&\n bytes[1] === OP_DUP &&\n bytes[2] === OP_SHA256);\n}\n/**\n * Parse a PQ partial-fill covenant. Throws if the bytes do not match the\n * exact layout produced by `buildPartialFillScriptPQ`.\n */\nexport function parsePartialFillScriptPQ(script, network = 'xna-test') {\n const bytes = typeof script === 'string' ? hexToBytes(script) : script;\n const c = makeCursor(bytes);\n // ───── Cancel branch (PQ) ─────\n expectByte(c, OP_IF, 'OP_IF');\n expectByte(c, OP_DUP, 'OP_DUP (cancel)');\n expectByte(c, OP_SHA256, 'OP_SHA256');\n const pubKeyCommitment = readPush(c, 'pubKeyCommitment');\n if (pubKeyCommitment.length !== 32) {\n throw new Error(`parse-pq: pubKeyCommitment must be 32 bytes, got ${pubKeyCommitment.length}`);\n }\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (cancel)');\n // Selector is read as an unsigned byte — consensus OP_TXHASH treats the\n // on-stack element as uint8, and the builder emits a raw 1-byte push so\n // selectors 0x80..0xff round-trip correctly (plan v3 bug B).\n const txHashSelector = readPushUint8(c, 'txHashSelector');\n if (txHashSelector < 1) {\n throw new Error(`parse-pq: txHashSelector 0x00 is rejected by OP_TXHASH`);\n }\n expectByte(c, OP_TXHASH, 'OP_TXHASH');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_CHECKSIGFROMSTACK, 'OP_CHECKSIGFROMSTACK');\n expectByte(c, OP_ELSE, 'OP_ELSE');\n // ───── Fill branch ─────\n expectByte(c, OP_DUP, 'OP_DUP (price)');\n const unitPriceSats = readPushPositiveInt(c, 'unitPriceSats');\n expectByte(c, OP_MUL, 'OP_MUL');\n expectByte(c, OP_0, 'OP_0 (payment idx)');\n expectByte(c, OP_OUTPUTVALUE, 'OP_OUTPUTVALUE');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_GREATERTHANOREQUAL, 'OP_GE');\n expectByte(c, OP_VERIFY, 'OP_VERIFY');\n expectByte(c, OP_0, 'OP_0 (payment spk idx)');\n expectByte(c, OP_OUTPUTSCRIPT, 'OP_OUTPUTSCRIPT (payment)');\n const paymentScriptPubKey = readPush(c, 'paymentScriptPubKey');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (payment)');\n expectByte(c, OP_DUP, 'OP_DUP (buyer amount)');\n expectByte(c, OP_1, 'OP_1 (buyer idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (buyer amount)');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (buyer amount)');\n expectByte(c, OP_1, 'OP_1 (buyer idx)');\n expectByte(c, OP_1, 'OP_1 (NAME selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (buyer name)');\n const tokenIdBytes1 = readPush(c, 'tokenId #1');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (buyer name)');\n // Remainder continuity: same AuthScript commitment (NIP-023)\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_OUTPUTAUTHCOMMITMENT, 'OP_OUTPUTAUTHCOMMITMENT (remainder)');\n expectByte(c, OP_2, 'OP_2 (TXFIELD selector: AUTHSCRIPT_COMMITMENT)');\n if (TXFIELD_AUTHSCRIPT_COMMITMENT !== 0x02)\n throw new Error('unexpected TXFIELD selector constant');\n expectByte(c, OP_TXFIELD, 'OP_TXFIELD');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder auth)');\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_1, 'OP_1 (NAME selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (remainder name)');\n const tokenIdBytes2 = readPush(c, 'tokenId #2');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder name)');\n expectByte(c, OP_2, 'OP_2 (remainder idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_OUTPUTASSETFIELD, 'OP_OUTPUTASSETFIELD (remainder amount)');\n expectByte(c, OP_OVER, 'OP_OVER');\n expectByte(c, OP_0, 'OP_0 (input idx)');\n expectByte(c, OP_2, 'OP_2 (AMOUNT selector)');\n expectByte(c, OP_INPUTASSETFIELD, 'OP_INPUTASSETFIELD');\n expectByte(c, OP_SWAP, 'OP_SWAP');\n expectByte(c, OP_SUB, 'OP_SUB');\n expectByte(c, OP_EQUALVERIFY, 'OP_EQUALVERIFY (remainder amount)');\n expectByte(c, OP_DROP, 'OP_DROP');\n expectByte(c, OP_1, 'OP_1 (true)');\n expectByte(c, OP_ENDIF, 'OP_ENDIF');\n assertTrailing(c);\n if (!bytesEqual(tokenIdBytes1, tokenIdBytes2)) {\n throw new Error('parse-pq: tokenId differs between buyer and remainder checks');\n }\n const tokenId = new TextDecoder('utf-8', { fatal: true }).decode(tokenIdBytes1);\n return {\n network,\n pubKeyCommitment,\n tokenId,\n unitPriceSats,\n txHashSelector,\n paymentScriptPubKey,\n scriptHex: bytesToHex(bytes)\n };\n}\n","// ---------- Core primitives ----------\nexport { bytesToHex, hexToBytes, concatBytes, bytesEqual, ensureHex } from './core/bytes.js';\nexport { ScriptBuilder, encodeScriptNum, pushBytes, pushInt, pushHex } from './core/script-builder.js';\nexport * as opcodes from './core/opcodes.js';\n// ---------- Standard scripts ----------\nexport { encodeP2PKHScriptPubKey, encodeP2WPKHScriptPubKey, encodeP2WSHScriptPubKey, encodeAuthScriptScriptPubKey, buildAuthScriptWitnessLegacy, buildAuthScriptWitnessPQ, buildAuthScriptWitnessNoAuth, buildAuthScriptWitnessRef, AUTHSCRIPT_NOAUTH, AUTHSCRIPT_PQ, AUTHSCRIPT_LEGACY, AUTHSCRIPT_REF, encodeNullDataScript, NULLDATA_STANDARD_MAX_SIZE, encodeMultisigRedeemScript, encodeMultisigRedeemScriptHex, encodeP2SHScriptPubKey, MULTISIG_MAX_PUBKEYS } from './standard/index.js';\n// ---------- Address helpers (thin wrapper around standard/*) ----------\nexport { encodeSellerScriptPubKey } from './address.js';\n// ---------- Asset-transfer wrapper ----------\nexport { splitAssetWrappedScriptPubKey } from './asset-wrapper.js';\n// ---------- Covenants ----------\nexport { \n// Legacy (ECDSA cancel)\nbuildPartialFillScript, buildPartialFillScriptHex, buildFillScriptSig, buildFillScriptSigHex, buildCancelScriptSig, buildCancelScriptSigHex, parsePartialFillScript, \n// PQ (ML-DSA-44 cancel via OP_CHECKSIGFROMSTACK + NIP-18)\nbuildPartialFillScriptPQ, buildPartialFillScriptPQHex, buildCancelScriptSigPQ, buildCancelScriptSigPQHex, parsePartialFillScriptPQ, isPartialFillScriptPQ, DEFAULT_PQ_TXHASH_SELECTOR } from './covenants/index.js';\n","import * as NeuraiScripts from '../index.js';\nconst globalTarget = globalThis;\nglobalTarget.NeuraiScripts = NeuraiScripts;\nexport { NeuraiScripts };\n"],"names":["ASSET_NAME_MAX","assertTokenId","assertPrice"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACO,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,GAAG,KAAK,EAAE;IAC9C,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE;IAC7D,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE;IACxE,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC5E,IAAI;IACJ,IAAI,OAAO,UAAU;IACrB;IACO,SAAS,UAAU,CAAC,GAAG,EAAE;IAChC,IAAI,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC;IACrC,IAAI,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACvD,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IACnD,QAAQ,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,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