Expand description
Pass 6: Emit – converts Stack IR to Bitcoin Script bytes (hex string).
Walks the StackOp list and encodes each operation as one or more Bitcoin Script opcodes, producing both a hex-encoded script and a human-readable ASM representation.
Structs§
- Constructor
Slot - Records the byte offset of a constructor parameter placeholder in the emitted script. The SDK uses these offsets to splice in real values at deployment time.
- Emit
Result - The output of the emission pass.
Functions§
- emit
- Emit a slice of StackMethods as Bitcoin Script hex and ASM.
- emit_
method - Emit a single method’s ops. Useful for testing.
- encode_
push_ data - Encode raw bytes as a Bitcoin Script push-data operation.
- encode_
push_ int - Encode an integer push, using small-integer opcodes where possible.
- encode_
script_ number - Encode an i128 as a Bitcoin Script number (little-endian, sign-magnitude). Bitcoin Script numbers can be up to 2^252, so i128 is needed.