UNPKG

@muirglacier/jellyfish-transaction

Version:

A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin

176 lines 4.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OP_TUCK = exports.OP_SWAP = exports.OP_ROT = exports.OP_ROLL = exports.OP_PICK = exports.OP_OVER = exports.OP_NIP = exports.OP_DUP = exports.OP_DROP = exports.OP_DEPTH = exports.OP_IFDUP = exports.OP_2SWAP = exports.OP_2ROT = exports.OP_2OVER = exports.OP_3DUP = exports.OP_2DUP = exports.OP_2DROP = exports.OP_FROMALTSTACK = exports.OP_TOALTSTACK = void 0; const opcode_1 = require("./opcode"); /** * Puts the input onto the top of the alt stack. Removes it from the main stack. */ class OP_TOALTSTACK extends opcode_1.StaticCode { constructor() { super(0x6b, 'OP_TOALTSTACK'); } } exports.OP_TOALTSTACK = OP_TOALTSTACK; /** * Puts the input onto the top of the main stack. Removes it from the alt stack. */ class OP_FROMALTSTACK extends opcode_1.StaticCode { constructor() { super(0x6c, 'OP_FROMALTSTACK'); } } exports.OP_FROMALTSTACK = OP_FROMALTSTACK; /** * Removes the top two stack items. */ class OP_2DROP extends opcode_1.StaticCode { constructor() { super(0x6d, 'OP_2DROP'); } } exports.OP_2DROP = OP_2DROP; /** * Duplicates the top two stack items. */ class OP_2DUP extends opcode_1.StaticCode { constructor() { super(0x6e, 'OP_2DUP'); } } exports.OP_2DUP = OP_2DUP; /** * Duplicates the top three stack items. */ class OP_3DUP extends opcode_1.StaticCode { constructor() { super(0x6f, 'OP_3DUP'); } } exports.OP_3DUP = OP_3DUP; /** * Copies the pair of items two spaces back in the stack to the front. */ class OP_2OVER extends opcode_1.StaticCode { constructor() { super(0x70, 'OP_2OVER'); } } exports.OP_2OVER = OP_2OVER; /** * The fifth and sixth items back are moved to the top of the stack. */ class OP_2ROT extends opcode_1.StaticCode { constructor() { super(0x71, 'OP_2ROT'); } } exports.OP_2ROT = OP_2ROT; /** * Swaps the top two pairs of items. */ class OP_2SWAP extends opcode_1.StaticCode { constructor() { super(0x72, 'OP_2SWAP'); } } exports.OP_2SWAP = OP_2SWAP; /** * If the top stack value is not 0, duplicate it. */ class OP_IFDUP extends opcode_1.StaticCode { constructor() { super(0x73, 'OP_IFDUP'); } } exports.OP_IFDUP = OP_IFDUP; /** * Puts the number of stack items onto the stack. */ class OP_DEPTH extends opcode_1.StaticCode { constructor() { super(0x74, 'OP_DEPTH'); } } exports.OP_DEPTH = OP_DEPTH; /** * Removes the top stack item. */ class OP_DROP extends opcode_1.StaticCode { constructor() { super(0x75, 'OP_DROP'); } } exports.OP_DROP = OP_DROP; /** * Duplicates the top stack item. */ class OP_DUP extends opcode_1.StaticCode { constructor() { super(0x76, 'OP_DUP'); } } exports.OP_DUP = OP_DUP; /** * Removes the second-to-top stack item. */ class OP_NIP extends opcode_1.StaticCode { constructor() { super(0x77, 'OP_NIP'); } } exports.OP_NIP = OP_NIP; /** * Copies the second-to-top stack item to the top. */ class OP_OVER extends opcode_1.StaticCode { constructor() { super(0x78, 'OP_OVER'); } } exports.OP_OVER = OP_OVER; /** * The item n back in the stack is copied to the top. */ class OP_PICK extends opcode_1.StaticCode { constructor() { super(0x79, 'OP_PICK'); } } exports.OP_PICK = OP_PICK; /** * The item n back in the stack is moved to the top. */ class OP_ROLL extends opcode_1.StaticCode { constructor() { super(0x7a, 'OP_ROLL'); } } exports.OP_ROLL = OP_ROLL; /** * The 3rd item down the stack is moved to the top. */ class OP_ROT extends opcode_1.StaticCode { constructor() { super(0x7b, 'OP_ROT'); } } exports.OP_ROT = OP_ROT; /** * The top two items on the stack are swapped. */ class OP_SWAP extends opcode_1.StaticCode { constructor() { super(0x7c, 'OP_SWAP'); } } exports.OP_SWAP = OP_SWAP; /** * The item at the top of the stack is copied and inserted before the second-to-top item. */ class OP_TUCK extends opcode_1.StaticCode { constructor() { super(0x7d, 'OP_TUCK'); } } exports.OP_TUCK = OP_TUCK; //# sourceMappingURL=stack.js.map