UNPKG

fuels

Version:

Fuel TS SDK

1,504 lines (1,502 loc) • 1.87 MB
"use strict"; (() => { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod2) => function __require2() { return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, mod2 )); var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); // ../../node_modules/.pnpm/@fuels+vm-asm@0.60.2/node_modules/@fuels/vm-asm/dist/node/index.cjs var require_node = __commonJS({ "../../node_modules/.pnpm/@fuels+vm-asm@0.60.2/node_modules/@fuels/vm-asm/dist/node/index.cjs"(exports) { "use strict"; var wasm$1; var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: /* @__PURE__ */ __name(() => { throw Error("TextDecoder not available"); }, "decode") }; if (typeof TextDecoder !== "undefined") { cachedTextDecoder.decode(); } var cachedUint8ArrayMemory0 = null; function getUint8ArrayMemory0() { if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { cachedUint8ArrayMemory0 = new Uint8Array(wasm$1.memory.buffer); } return cachedUint8ArrayMemory0; } __name(getUint8ArrayMemory0, "getUint8ArrayMemory0"); function getStringFromWasm0(ptr, len) { ptr = ptr >>> 0; return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } __name(getStringFromWasm0, "getStringFromWasm0"); function _assertClass(instance, klass) { if (!(instance instanceof klass)) { throw new Error(`expected instance of ${klass.name}`); } } __name(_assertClass, "_assertClass"); function gm_args(ra, args) { const ret4 = wasm$1.gm_args(ra, args); return Instruction2.__wrap(ret4); } __name(gm_args, "gm_args"); function gtf_args(ra, rb, args) { const ret4 = wasm$1.gtf_args(ra, rb, args); return Instruction2.__wrap(ret4); } __name(gtf_args, "gtf_args"); function wdcm_args(ra, rb, rc, args) { _assertClass(args, CompareArgs); var ptr0 = args.__destroy_into_raw(); const ret4 = wasm$1.wdcm_args(ra, rb, rc, ptr0); return Instruction2.__wrap(ret4); } __name(wdcm_args, "wdcm_args"); function wqcm_args(ra, rb, rc, args) { _assertClass(args, CompareArgs); var ptr0 = args.__destroy_into_raw(); const ret4 = wasm$1.wqcm_args(ra, rb, rc, ptr0); return Instruction2.__wrap(ret4); } __name(wqcm_args, "wqcm_args"); function wdop_args(ra, rb, rc, args) { _assertClass(args, MathArgs); var ptr0 = args.__destroy_into_raw(); const ret4 = wasm$1.wdop_args(ra, rb, rc, ptr0); return Instruction2.__wrap(ret4); } __name(wdop_args, "wdop_args"); function wqop_args(ra, rb, rc, args) { _assertClass(args, MathArgs); var ptr0 = args.__destroy_into_raw(); const ret4 = wasm$1.wqop_args(ra, rb, rc, ptr0); return Instruction2.__wrap(ret4); } __name(wqop_args, "wqop_args"); function wdml_args(ra, rb, rc, args) { _assertClass(args, MulArgs); var ptr0 = args.__destroy_into_raw(); const ret4 = wasm$1.wdml_args(ra, rb, rc, ptr0); return Instruction2.__wrap(ret4); } __name(wdml_args, "wdml_args"); function wqml_args(ra, rb, rc, args) { _assertClass(args, MulArgs); var ptr0 = args.__destroy_into_raw(); const ret4 = wasm$1.wqml_args(ra, rb, rc, ptr0); return Instruction2.__wrap(ret4); } __name(wqml_args, "wqml_args"); function wddv_args(ra, rb, rc, args) { _assertClass(args, DivArgs); var ptr0 = args.__destroy_into_raw(); const ret4 = wasm$1.wddv_args(ra, rb, rc, ptr0); return Instruction2.__wrap(ret4); } __name(wddv_args, "wddv_args"); function wqdv_args(ra, rb, rc, args) { _assertClass(args, DivArgs); var ptr0 = args.__destroy_into_raw(); const ret4 = wasm$1.wqdv_args(ra, rb, rc, ptr0); return Instruction2.__wrap(ret4); } __name(wqdv_args, "wqdv_args"); function add(dst, lhs, rhs) { const ret4 = wasm$1.add(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(add, "add"); function and(dst, lhs, rhs) { const ret4 = wasm$1.and(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(and, "and"); function div(dst, lhs, rhs) { const ret4 = wasm$1.div(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(div, "div"); function eq2(dst, lhs, rhs) { const ret4 = wasm$1.eq(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(eq2, "eq"); function exp(dst, lhs, rhs) { const ret4 = wasm$1.exp(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(exp, "exp"); function gt2(dst, lhs, rhs) { const ret4 = wasm$1.gt(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(gt2, "gt"); function lt(dst, lhs, rhs) { const ret4 = wasm$1.lt(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(lt, "lt"); function mlog(dst, lhs, rhs) { const ret4 = wasm$1.mlog(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(mlog, "mlog"); function mroo(dst, lhs, rhs) { const ret4 = wasm$1.mroo(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(mroo, "mroo"); function mod_(dst, lhs, rhs) { const ret4 = wasm$1.mod_(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(mod_, "mod_"); function move_3(dst, src) { const ret4 = wasm$1.move_(dst, src); return Instruction2.__wrap(ret4); } __name(move_3, "move_"); function mul(dst, lhs, rhs) { const ret4 = wasm$1.mul(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(mul, "mul"); function not(dst, arg) { const ret4 = wasm$1.not(dst, arg); return Instruction2.__wrap(ret4); } __name(not, "not"); function or(dst, lhs, rhs) { const ret4 = wasm$1.or(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(or, "or"); function sll(dst, lhs, rhs) { const ret4 = wasm$1.sll(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(sll, "sll"); function srl(dst, lhs, rhs) { const ret4 = wasm$1.srl(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(srl, "srl"); function sub3(dst, lhs, rhs) { const ret4 = wasm$1.sub(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(sub3, "sub"); function xor(dst, lhs, rhs) { const ret4 = wasm$1.xor(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(xor, "xor"); function mldv(dst, mul_lhs, mul_rhs, divisor) { const ret4 = wasm$1.mldv(dst, mul_lhs, mul_rhs, divisor); return Instruction2.__wrap(ret4); } __name(mldv, "mldv"); function ret3(value) { const ret4 = wasm$1.ret(value); return Instruction2.__wrap(ret4); } __name(ret3, "ret"); function retd(addr, len) { const ret4 = wasm$1.retd(addr, len); return Instruction2.__wrap(ret4); } __name(retd, "retd"); function aloc(bytes) { const ret4 = wasm$1.aloc(bytes); return Instruction2.__wrap(ret4); } __name(aloc, "aloc"); function mcl(dst_addr, len) { const ret4 = wasm$1.mcl(dst_addr, len); return Instruction2.__wrap(ret4); } __name(mcl, "mcl"); function mcp(dst_addr, src_addr, len) { const ret4 = wasm$1.mcp(dst_addr, src_addr, len); return Instruction2.__wrap(ret4); } __name(mcp, "mcp"); function meq(result, lhs_addr, rhs_addr, len) { const ret4 = wasm$1.meq(result, lhs_addr, rhs_addr, len); return Instruction2.__wrap(ret4); } __name(meq, "meq"); function bhsh(dst, heigth) { const ret4 = wasm$1.bhsh(dst, heigth); return Instruction2.__wrap(ret4); } __name(bhsh, "bhsh"); function bhei(dst) { const ret4 = wasm$1.bhei(dst); return Instruction2.__wrap(ret4); } __name(bhei, "bhei"); function burn(amount, sub_id_addr) { const ret4 = wasm$1.burn(amount, sub_id_addr); return Instruction2.__wrap(ret4); } __name(burn, "burn"); function call2(target_struct, fwd_coins, asset_id_addr, fwd_gas) { const ret4 = wasm$1.call(target_struct, fwd_coins, asset_id_addr, fwd_gas); return Instruction2.__wrap(ret4); } __name(call2, "call"); function ccp(dst_addr, contract_id_addr, offset, len) { const ret4 = wasm$1.ccp(dst_addr, contract_id_addr, offset, len); return Instruction2.__wrap(ret4); } __name(ccp, "ccp"); function croo(dst_addr, contract_id_addr) { const ret4 = wasm$1.croo(dst_addr, contract_id_addr); return Instruction2.__wrap(ret4); } __name(croo, "croo"); function csiz(dst, contract_id_addr) { const ret4 = wasm$1.csiz(dst, contract_id_addr); return Instruction2.__wrap(ret4); } __name(csiz, "csiz"); function cb(dst) { const ret4 = wasm$1.cb(dst); return Instruction2.__wrap(ret4); } __name(cb, "cb"); function ldc3(src_addr, offset, len, mode) { const ret4 = wasm$1.ldc(src_addr, offset, len, mode); return Instruction2.__wrap(ret4); } __name(ldc3, "ldc"); function log(a, b, c, d) { const ret4 = wasm$1.log(a, b, c, d); return Instruction2.__wrap(ret4); } __name(log, "log"); function logd(a, b, addr, len) { const ret4 = wasm$1.logd(a, b, addr, len); return Instruction2.__wrap(ret4); } __name(logd, "logd"); function mint(amount, sub_id_addr) { const ret4 = wasm$1.mint(amount, sub_id_addr); return Instruction2.__wrap(ret4); } __name(mint, "mint"); function rvrt(value) { const ret4 = wasm$1.rvrt(value); return Instruction2.__wrap(ret4); } __name(rvrt, "rvrt"); function scwq(key_addr, status, lenq) { const ret4 = wasm$1.scwq(key_addr, status, lenq); return Instruction2.__wrap(ret4); } __name(scwq, "scwq"); function srw(dst, status, key_addr) { const ret4 = wasm$1.srw(dst, status, key_addr); return Instruction2.__wrap(ret4); } __name(srw, "srw"); function srwq(dst_addr, status, key_addr, lenq) { const ret4 = wasm$1.srwq(dst_addr, status, key_addr, lenq); return Instruction2.__wrap(ret4); } __name(srwq, "srwq"); function sww(key_addr, status, value) { const ret4 = wasm$1.sww(key_addr, status, value); return Instruction2.__wrap(ret4); } __name(sww, "sww"); function swwq(key_addr, status, src_addr, lenq) { const ret4 = wasm$1.swwq(key_addr, status, src_addr, lenq); return Instruction2.__wrap(ret4); } __name(swwq, "swwq"); function tr2(contract_id_addr, amount, asset_id_addr) { const ret4 = wasm$1.tr(contract_id_addr, amount, asset_id_addr); return Instruction2.__wrap(ret4); } __name(tr2, "tr"); function tro(contract_id_addr, output_index, amount, asset_id_addr) { const ret4 = wasm$1.tro(contract_id_addr, output_index, amount, asset_id_addr); return Instruction2.__wrap(ret4); } __name(tro, "tro"); function eck1(dst_addr, sig_addr, msg_hash_addr) { const ret4 = wasm$1.eck1(dst_addr, sig_addr, msg_hash_addr); return Instruction2.__wrap(ret4); } __name(eck1, "eck1"); function ecr1(dst_addr, sig_addr, msg_hash_addr) { const ret4 = wasm$1.ecr1(dst_addr, sig_addr, msg_hash_addr); return Instruction2.__wrap(ret4); } __name(ecr1, "ecr1"); function ed19(pub_key_addr, sig_addr, msg_addr, msg_len) { const ret4 = wasm$1.ed19(pub_key_addr, sig_addr, msg_addr, msg_len); return Instruction2.__wrap(ret4); } __name(ed19, "ed19"); function k256(dst_addr, src_addr, len) { const ret4 = wasm$1.k256(dst_addr, src_addr, len); return Instruction2.__wrap(ret4); } __name(k256, "k256"); function s256(dst_addr, src_addr, len) { const ret4 = wasm$1.s256(dst_addr, src_addr, len); return Instruction2.__wrap(ret4); } __name(s256, "s256"); function time(dst, heigth) { const ret4 = wasm$1.time(dst, heigth); return Instruction2.__wrap(ret4); } __name(time, "time"); function noop() { const ret4 = wasm$1.noop(); return Instruction2.__wrap(ret4); } __name(noop, "noop"); function flag(value) { const ret4 = wasm$1.flag(value); return Instruction2.__wrap(ret4); } __name(flag, "flag"); function bal(dst, asset_id_addr, contract_id_addr) { const ret4 = wasm$1.bal(dst, asset_id_addr, contract_id_addr); return Instruction2.__wrap(ret4); } __name(bal, "bal"); function jmp3(abs_target) { const ret4 = wasm$1.jmp(abs_target); return Instruction2.__wrap(ret4); } __name(jmp3, "jmp"); function jne(abs_target, lhs, rhs) { const ret4 = wasm$1.jne(abs_target, lhs, rhs); return Instruction2.__wrap(ret4); } __name(jne, "jne"); function smo(recipient_addr, data_addr, data_len, coins) { const ret4 = wasm$1.smo(recipient_addr, data_addr, data_len, coins); return Instruction2.__wrap(ret4); } __name(smo, "smo"); function addi4(dst, lhs, rhs) { const ret4 = wasm$1.addi(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(addi4, "addi"); function andi(dst, lhs, rhs) { const ret4 = wasm$1.andi(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(andi, "andi"); function divi3(dst, lhs, rhs) { const ret4 = wasm$1.divi(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(divi3, "divi"); function expi(dst, lhs, rhs) { const ret4 = wasm$1.expi(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(expi, "expi"); function modi(dst, lhs, rhs) { const ret4 = wasm$1.modi(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(modi, "modi"); function muli(dst, lhs, rhs) { const ret4 = wasm$1.muli(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(muli, "muli"); function ori(dst, lhs, rhs) { const ret4 = wasm$1.ori(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(ori, "ori"); function slli(dst, lhs, rhs) { const ret4 = wasm$1.slli(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(slli, "slli"); function srli(dst, lhs, rhs) { const ret4 = wasm$1.srli(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(srli, "srli"); function subi2(dst, lhs, rhs) { const ret4 = wasm$1.subi(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(subi2, "subi"); function xori(dst, lhs, rhs) { const ret4 = wasm$1.xori(dst, lhs, rhs); return Instruction2.__wrap(ret4); } __name(xori, "xori"); function jnei(cond_lhs, cond_rhs, abs_target) { const ret4 = wasm$1.jnei(cond_lhs, cond_rhs, abs_target); return Instruction2.__wrap(ret4); } __name(jnei, "jnei"); function lb(dst, addr, offset) { const ret4 = wasm$1.lb(dst, addr, offset); return Instruction2.__wrap(ret4); } __name(lb, "lb"); function lw4(dst, addr, offset) { const ret4 = wasm$1.lw(dst, addr, offset); return Instruction2.__wrap(ret4); } __name(lw4, "lw"); function sb(addr, value, offset) { const ret4 = wasm$1.sb(addr, value, offset); return Instruction2.__wrap(ret4); } __name(sb, "sb"); function sw(addr, value, offset) { const ret4 = wasm$1.sw(addr, value, offset); return Instruction2.__wrap(ret4); } __name(sw, "sw"); function mcpi(dst_addr, src_addr, len) { const ret4 = wasm$1.mcpi(dst_addr, src_addr, len); return Instruction2.__wrap(ret4); } __name(mcpi, "mcpi"); function gtf2(dst, arg, selector) { const ret4 = wasm$1.gtf(dst, arg, selector); return Instruction2.__wrap(ret4); } __name(gtf2, "gtf"); function mcli(addr, count) { const ret4 = wasm$1.mcli(addr, count); return Instruction2.__wrap(ret4); } __name(mcli, "mcli"); function gm(dst, selector) { const ret4 = wasm$1.gm(dst, selector); return Instruction2.__wrap(ret4); } __name(gm, "gm"); function movi3(dst, val) { const ret4 = wasm$1.movi(dst, val); return Instruction2.__wrap(ret4); } __name(movi3, "movi"); function jnzi(cond_nz, abs_target) { const ret4 = wasm$1.jnzi(cond_nz, abs_target); return Instruction2.__wrap(ret4); } __name(jnzi, "jnzi"); function jmpf(dynamic, fixed) { const ret4 = wasm$1.jmpf(dynamic, fixed); return Instruction2.__wrap(ret4); } __name(jmpf, "jmpf"); function jmpb(dynamic, fixed) { const ret4 = wasm$1.jmpb(dynamic, fixed); return Instruction2.__wrap(ret4); } __name(jmpb, "jmpb"); function jnzf(cond_nz, dynamic, fixed) { const ret4 = wasm$1.jnzf(cond_nz, dynamic, fixed); return Instruction2.__wrap(ret4); } __name(jnzf, "jnzf"); function jnzb2(cond_nz, dynamic, fixed) { const ret4 = wasm$1.jnzb(cond_nz, dynamic, fixed); return Instruction2.__wrap(ret4); } __name(jnzb2, "jnzb"); function jnef(cond_lhs, cond_rhs, dynamic, fixed) { const ret4 = wasm$1.jnef(cond_lhs, cond_rhs, dynamic, fixed); return Instruction2.__wrap(ret4); } __name(jnef, "jnef"); function jneb(cond_lhs, cond_rhs, dynamic, fixed) { const ret4 = wasm$1.jneb(cond_lhs, cond_rhs, dynamic, fixed); return Instruction2.__wrap(ret4); } __name(jneb, "jneb"); function ji(abs_target) { const ret4 = wasm$1.ji(abs_target); return Instruction2.__wrap(ret4); } __name(ji, "ji"); function cfei(amount) { const ret4 = wasm$1.cfei(amount); return Instruction2.__wrap(ret4); } __name(cfei, "cfei"); function cfsi(amount) { const ret4 = wasm$1.cfsi(amount); return Instruction2.__wrap(ret4); } __name(cfsi, "cfsi"); function cfe(amount) { const ret4 = wasm$1.cfe(amount); return Instruction2.__wrap(ret4); } __name(cfe, "cfe"); function cfs(amount) { const ret4 = wasm$1.cfs(amount); return Instruction2.__wrap(ret4); } __name(cfs, "cfs"); function pshl(bitmask) { const ret4 = wasm$1.pshl(bitmask); return Instruction2.__wrap(ret4); } __name(pshl, "pshl"); function pshh(bitmask) { const ret4 = wasm$1.pshh(bitmask); return Instruction2.__wrap(ret4); } __name(pshh, "pshh"); function popl(bitmask) { const ret4 = wasm$1.popl(bitmask); return Instruction2.__wrap(ret4); } __name(popl, "popl"); function poph(bitmask) { const ret4 = wasm$1.poph(bitmask); return Instruction2.__wrap(ret4); } __name(poph, "poph"); function wdcm(dst, lhs, rhs, flags) { const ret4 = wasm$1.wdcm(dst, lhs, rhs, flags); return Instruction2.__wrap(ret4); } __name(wdcm, "wdcm"); function wqcm(dst, lhs, rhs, flags) { const ret4 = wasm$1.wqcm(dst, lhs, rhs, flags); return Instruction2.__wrap(ret4); } __name(wqcm, "wqcm"); function wdop(dst, lhs, rhs, flags) { const ret4 = wasm$1.wdop(dst, lhs, rhs, flags); return Instruction2.__wrap(ret4); } __name(wdop, "wdop"); function wqop(dst, lhs, rhs, flags) { const ret4 = wasm$1.wqop(dst, lhs, rhs, flags); return Instruction2.__wrap(ret4); } __name(wqop, "wqop"); function wdml(dst, lhs, rhs, flags) { const ret4 = wasm$1.wdml(dst, lhs, rhs, flags); return Instruction2.__wrap(ret4); } __name(wdml, "wdml"); function wqml(dst, lhs, rhs, flags) { const ret4 = wasm$1.wqml(dst, lhs, rhs, flags); return Instruction2.__wrap(ret4); } __name(wqml, "wqml"); function wddv(dst, lhs, rhs, flags) { const ret4 = wasm$1.wddv(dst, lhs, rhs, flags); return Instruction2.__wrap(ret4); } __name(wddv, "wddv"); function wqdv(dst, lhs, rhs, flags) { const ret4 = wasm$1.wqdv(dst, lhs, rhs, flags); return Instruction2.__wrap(ret4); } __name(wqdv, "wqdv"); function wdmd(dst, mul_lhs, mul_rhs, divisor) { const ret4 = wasm$1.wdmd(dst, mul_lhs, mul_rhs, divisor); return Instruction2.__wrap(ret4); } __name(wdmd, "wdmd"); function wqmd(dst, mul_lhs, mul_rhs, divisor) { const ret4 = wasm$1.wqmd(dst, mul_lhs, mul_rhs, divisor); return Instruction2.__wrap(ret4); } __name(wqmd, "wqmd"); function wdam(dst, add_lhs, add_rhs, modulo) { const ret4 = wasm$1.wdam(dst, add_lhs, add_rhs, modulo); return Instruction2.__wrap(ret4); } __name(wdam, "wdam"); function wqam(dst, add_lhs, add_rhs, modulo) { const ret4 = wasm$1.wqam(dst, add_lhs, add_rhs, modulo); return Instruction2.__wrap(ret4); } __name(wqam, "wqam"); function wdmm(dst, mul_lhs, mul_rhs, modulo) { const ret4 = wasm$1.wdmm(dst, mul_lhs, mul_rhs, modulo); return Instruction2.__wrap(ret4); } __name(wdmm, "wdmm"); function wqmm(dst, mul_lhs, mul_rhs, modulo) { const ret4 = wasm$1.wqmm(dst, mul_lhs, mul_rhs, modulo); return Instruction2.__wrap(ret4); } __name(wqmm, "wqmm"); function ecal(a, b, c, d) { const ret4 = wasm$1.ecal(a, b, c, d); return Instruction2.__wrap(ret4); } __name(ecal, "ecal"); function bsiz3(dst, blob_id_ptr) { const ret4 = wasm$1.bsiz(dst, blob_id_ptr); return Instruction2.__wrap(ret4); } __name(bsiz3, "bsiz"); function bldd(dst_ptr, blob_id_ptr, offset, len) { const ret4 = wasm$1.bldd(dst_ptr, blob_id_ptr, offset, len); return Instruction2.__wrap(ret4); } __name(bldd, "bldd"); function ecop(dst, curve_id, operation_type, points_ptr) { const ret4 = wasm$1.ecop(dst, curve_id, operation_type, points_ptr); return Instruction2.__wrap(ret4); } __name(ecop, "ecop"); function epar(success, curve_id, number_elements, points_ptr) { const ret4 = wasm$1.epar(success, curve_id, number_elements, points_ptr); return Instruction2.__wrap(ret4); } __name(epar, "epar"); var cachedDataViewMemory0 = null; function getDataViewMemory0() { if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm$1.memory.buffer) { cachedDataViewMemory0 = new DataView(wasm$1.memory.buffer); } return cachedDataViewMemory0; } __name(getDataViewMemory0, "getDataViewMemory0"); function getArrayU8FromWasm0(ptr, len) { ptr = ptr >>> 0; return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); } __name(getArrayU8FromWasm0, "getArrayU8FromWasm0"); var CompareMode = Object.freeze({ /** * Equality (`==`) */ EQ: 0, "0": "EQ", /** * Inequality (`!=`) */ NE: 1, "1": "NE", /** * Less than (`<`) */ LT: 2, "2": "LT", /** * Greater than (`>`) */ GT: 3, "3": "GT", /** * Less than or equals (`>=`) */ LTE: 4, "4": "LTE", /** * Greater than or equals (`>=`) */ GTE: 5, "5": "GTE", /** * Number of leading zeroes in lhs (`lzcnt`) (discards rhs) */ LZC: 6, "6": "LZC" }); var GMArgs = Object.freeze({ /** * r" Get if caller is external. */ IsCallerExternal: 1, "1": "IsCallerExternal", /** * r" Get caller's contract ID. */ GetCaller: 2, "2": "GetCaller", /** * r" Get index of current predicate. */ GetVerifyingPredicate: 3, "3": "GetVerifyingPredicate", /** * r" Get the Chain ID this VM is operating within */ GetChainId: 4, "4": "GetChainId", /** * r" Get memory address where the transaction is located */ TxStart: 5, "5": "TxStart", /** * r" Get memory address of base asset ID */ BaseAssetId: 6, "6": "BaseAssetId", /** * r" Get gas price for block */ GetGasPrice: 7, "7": "GetGasPrice" }); var GTFArgs2 = Object.freeze({ /** * r" Set `$rA` to `tx.type` */ Type: 1, "1": "Type", /** * r" Set `$rA` to `tx.scriptGasLimit` */ ScriptGasLimit: 2, "2": "ScriptGasLimit", /** * r" Set `$rA` to `tx.scriptLength` */ ScriptLength: 3, "3": "ScriptLength", /** * r" Set `$rA` to `tx.scriptDataLength` */ ScriptDataLength: 4, "4": "ScriptDataLength", /** * r" Set `$rA` to `tx.inputsCount` */ ScriptInputsCount: 5, "5": "ScriptInputsCount", /** * r" Set `$rA` to `tx.outputsCount` */ ScriptOutputsCount: 6, "6": "ScriptOutputsCount", /** * r" Set `$rA` to `tx.witnessesCount` */ ScriptWitnessesCount: 7, "7": "ScriptWitnessesCount", /** * r" Set `$rA` to `Memory address of tx.script` */ Script: 9, "9": "Script", /** * r" Set `$rA` to `Memory address of tx.scriptData` */ ScriptData: 10, "10": "ScriptData", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB]` */ ScriptInputAtIndex: 11, "11": "ScriptInputAtIndex", /** * r" Set `$rA` to `Memory address of t.outputs[$rB]` */ ScriptOutputAtIndex: 12, "12": "ScriptOutputAtIndex", /** * r" Set `$rA` to `Memory address of tx.witnesses[$rB]` */ ScriptWitnessAtIndex: 13, "13": "ScriptWitnessAtIndex", /** * r" Set `$rA` to size of the transaction in memory, in bytes */ TxLength: 14, "14": "TxLength", /** * r" Set `$rA` to `tx.bytecodeWitnessIndex` */ CreateBytecodeWitnessIndex: 257, "257": "CreateBytecodeWitnessIndex", /** * r" Set `$rA` to `tx.storageSlotsCount` */ CreateStorageSlotsCount: 258, "258": "CreateStorageSlotsCount", /** * r" Set `$rA` to `tx.inputsCount` */ CreateInputsCount: 259, "259": "CreateInputsCount", /** * r" Set `$rA` to `tx.outputsCount` */ CreateOutputsCount: 260, "260": "CreateOutputsCount", /** * r" Set `$rA` to `tx.witnessesCount` */ CreateWitnessesCount: 261, "261": "CreateWitnessesCount", /** * r" Set `$rA` to `Memory address of tx.salt` */ CreateSalt: 262, "262": "CreateSalt", /** * r" Set `$rA` to `Memory address of tx.storageSlots[$rB]` */ CreateStorageSlotAtIndex: 263, "263": "CreateStorageSlotAtIndex", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB]` */ CreateInputAtIndex: 264, "264": "CreateInputAtIndex", /** * r" Set `$rA` to `Memory address of t.outputs[$rB]` */ CreateOutputAtIndex: 265, "265": "CreateOutputAtIndex", /** * r" Set `$rA` to `Memory address of tx.witnesses[$rB]` */ CreateWitnessAtIndex: 266, "266": "CreateWitnessAtIndex", /** * r" Set `$rA` to `tx.inputs[$rB].type` */ InputType: 512, "512": "InputType", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].txID` */ InputCoinTxId: 513, "513": "InputCoinTxId", /** * r" Set `$rA` to `tx.inputs[$rB].outputIndex` */ InputCoinOutputIndex: 514, "514": "InputCoinOutputIndex", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].owner` */ InputCoinOwner: 515, "515": "InputCoinOwner", /** * r" Set `$rA` to `tx.inputs[$rB].amount` */ InputCoinAmount: 516, "516": "InputCoinAmount", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].asset_id` */ InputCoinAssetId: 517, "517": "InputCoinAssetId", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].txPointer` */ InputCoinTxPointer: 518, "518": "InputCoinTxPointer", /** * r" Set `$rA` to `tx.inputs[$rB].witnessIndex` */ InputCoinWitnessIndex: 519, "519": "InputCoinWitnessIndex", /** * r" Set `$rA` to `tx.inputs[$rB].predicateLength` */ InputCoinPredicateLength: 521, "521": "InputCoinPredicateLength", /** * r" Set `$rA` to `tx.inputs[$rB].predicateDataLength` */ InputCoinPredicateDataLength: 522, "522": "InputCoinPredicateDataLength", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].predicate` */ InputCoinPredicate: 523, "523": "InputCoinPredicate", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].predicateData` */ InputCoinPredicateData: 524, "524": "InputCoinPredicateData", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].predicateGasUsed` */ InputCoinPredicateGasUsed: 525, "525": "InputCoinPredicateGasUsed", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].txID` */ InputContractTxId: 544, "544": "InputContractTxId", /** * r" Set `$rA` to `tx.inputs[$rB].outputIndex` */ InputContractOutputIndex: 545, "545": "InputContractOutputIndex", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].contractID` */ InputContractId: 549, "549": "InputContractId", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].sender` */ InputMessageSender: 576, "576": "InputMessageSender", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].recipient` */ InputMessageRecipient: 577, "577": "InputMessageRecipient", /** * r" Set `$rA` to `tx.inputs[$rB].amount` */ InputMessageAmount: 578, "578": "InputMessageAmount", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].nonce` */ InputMessageNonce: 579, "579": "InputMessageNonce", /** * r" Set `$rA` to `tx.inputs[$rB].witnessIndex` */ InputMessageWitnessIndex: 580, "580": "InputMessageWitnessIndex", /** * r" Set `$rA` to `tx.inputs[$rB].dataLength` */ InputMessageDataLength: 581, "581": "InputMessageDataLength", /** * r" Set `$rA` to `tx.inputs[$rB].predicateLength` */ InputMessagePredicateLength: 582, "582": "InputMessagePredicateLength", /** * r" Set `$rA` to `tx.inputs[$rB].predicateDataLength` */ InputMessagePredicateDataLength: 583, "583": "InputMessagePredicateDataLength", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].data` */ InputMessageData: 584, "584": "InputMessageData", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].predicate` */ InputMessagePredicate: 585, "585": "InputMessagePredicate", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].predicateData` */ InputMessagePredicateData: 586, "586": "InputMessagePredicateData", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB].predicateGasUsed` */ InputMessagePredicateGasUsed: 587, "587": "InputMessagePredicateGasUsed", /** * r" Set `$rA` to `tx.outputs[$rB].type` */ OutputType: 768, "768": "OutputType", /** * r" Set `$rA` to `Memory address of tx.outputs[$rB].to` */ OutputCoinTo: 769, "769": "OutputCoinTo", /** * r" Set `$rA` to `tx.outputs[$rB].amount` */ OutputCoinAmount: 770, "770": "OutputCoinAmount", /** * r" Set `$rA` to `Memory address of tx.outputs[$rB].asset_id` */ OutputCoinAssetId: 771, "771": "OutputCoinAssetId", /** * r" Set `$rA` to `tx.outputs[$rB].inputIndex` */ OutputContractInputIndex: 772, "772": "OutputContractInputIndex", /** * r" Set `$rA` to `Memory address of tx.outputs[$rB].contractID` */ OutputContractCreatedContractId: 775, "775": "OutputContractCreatedContractId", /** * r" Set `$rA` to `Memory address of tx.outputs[$rB].stateRoot` */ OutputContractCreatedStateRoot: 776, "776": "OutputContractCreatedStateRoot", /** * r" Set `$rA` to `tx.witnesses[$rB].dataLength` */ WitnessDataLength: 1024, "1024": "WitnessDataLength", /** * r" Set `$rA` to `Memory address of tx.witnesses[$rB].data` */ WitnessData: 1025, "1025": "WitnessData", /** * r" Set `$rA` to `tx.policyTypes` */ PolicyTypes: 1280, "1280": "PolicyTypes", /** * r" Set `$rA` to `tx.policies[0x00].gasPrice` */ PolicyTip: 1281, "1281": "PolicyTip", /** * r" Set `$rA` to `tx.policies[count_ones(0b11 & tx.policyTypes) - 1].witnessLimit` */ PolicyWitnessLimit: 1282, "1282": "PolicyWitnessLimit", /** * r" Set `$rA` to `tx.policies[count_ones(0b111 & tx.policyTypes) - 1].maturity` */ PolicyMaturity: 1283, "1283": "PolicyMaturity", /** * r" Set `$rA` to `tx.policies[count_ones(0b1111 & tx.policyTypes) - 1].maxFee` */ PolicyMaxFee: 1284, "1284": "PolicyMaxFee", /** * r" Set `$rA` to `tx.policies[count_ones(0b11111 & tx.policyTypes) - 1].expiration` */ PolicyExpiration: 1285, "1285": "PolicyExpiration", /** * r" Set `$rA` to `Memory address of tx.root` */ UploadRoot: 1536, "1536": "UploadRoot", /** * r" Set `$rA` to `tx.witnessIndex` */ UploadWitnessIndex: 1537, "1537": "UploadWitnessIndex", /** * r" Set `$rA` to `tx.subsectionIndex` */ UploadSubsectionIndex: 1538, "1538": "UploadSubsectionIndex", /** * r" Set `$rA` to `tx.subsectionsNumber` */ UploadSubsectionsCount: 1539, "1539": "UploadSubsectionsCount", /** * r" Set `$rA` to `tx.proofSetCount` */ UploadProofSetCount: 1540, "1540": "UploadProofSetCount", /** * r" Set `$rA` to `Memory address of tx.proofSet[$rB]` */ UploadProofSetAtIndex: 1541, "1541": "UploadProofSetAtIndex", /** * r" Set `$rA` to `Memory address of tx.id` */ BlobId: 1792, "1792": "BlobId", /** * r" Set `$rA` to `tx.witnessIndex` */ BlobWitnessIndex: 1793, "1793": "BlobWitnessIndex", /** * r" Set `$rA` to `Memory address of tx.purpose` */ UpgradePurpose: 2048, "2048": "UpgradePurpose", /** * r" Set `$rA` to `tx.inputsCount` */ TxInputsCount: 2304, "2304": "TxInputsCount", /** * r" Set `$rA` to `tx.outputsCount` */ TxOutputsCount: 2305, "2305": "TxOutputsCount", /** * r" Set `$rA` to `tx.witnessesCount` */ TxWitnessesCount: 2306, "2306": "TxWitnessesCount", /** * r" Set `$rA` to `Memory address of tx.inputs[$rB]` */ TxInputAtIndex: 2307, "2307": "TxInputAtIndex", /** * r" Set `$rA` to `Memory address of t.outputs[$rB]` */ TxOutputAtIndex: 2308, "2308": "TxOutputAtIndex", /** * r" Set `$rA` to `Memory address of tx.witnesses[$rB]` */ TxWitnessAtIndex: 2309, "2309": "TxWitnessAtIndex" }); var MathOp = Object.freeze({ /** * Add */ ADD: 0, "0": "ADD", /** * Subtract */ SUB: 1, "1": "SUB", /** * Invert bits (discards rhs) */ NOT: 2, "2": "NOT", /** * Bitwise or */ OR: 3, "3": "OR", /** * Bitwise exclusive or */ XOR: 4, "4": "XOR", /** * Bitwise and */ AND: 5, "5": "AND", /** * Shift left */ SHL: 6, "6": "SHL", /** * Shift right */ SHR: 7, "7": "SHR" }); var PanicReason = Object.freeze({ /** * r" The byte can't be mapped to any known `PanicReason`. */ UnknownPanicReason: 0, "0": "UnknownPanicReason", /** * r" Found `RVRT` instruction. */ Revert: 1, "1": "Revert", /** * r" Execution ran out of gas. */ OutOfGas: 2, "2": "OutOfGas", /** * r" The transaction validity is violated. */ TransactionValidity: 3, "3": "TransactionValidity", /** * r" Attempt to write outside interpreter memory boundaries. */ MemoryOverflow: 4, "4": "MemoryOverflow", /** * r" Overflow while executing arithmetic operation. * r" These errors are ignored using the WRAPPING flag. */ ArithmeticOverflow: 5, "5": "ArithmeticOverflow", /** * r" Designed contract was not found in the storage. */ ContractNotFound: 6, "6": "ContractNotFound", /** * r" Memory ownership rules are violated. */ MemoryOwnership: 7, "7": "MemoryOwnership", /** * r" The asset ID balance isn't enough for the instruction. */ NotEnoughBalance: 8, "8": "NotEnoughBalance", /** * r" The interpreter is expected to be in internal context. */ ExpectedInternalContext: 9, "9": "ExpectedInternalContext", /** * r" The queried asset ID was not found in the state. */ AssetIdNotFound: 10, "10": "AssetIdNotFound", /** * r" The provided input is not found in the transaction. */ InputNotFound: 11, "11": "InputNotFound", /** * r" The provided output is not found in the transaction. */ OutputNotFound: 12, "12": "OutputNotFound", /** * r" The provided witness is not found in the transaction. */ WitnessNotFound: 13, "13": "WitnessNotFound", /** * r" The transaction maturity is not valid for this request. */ TransactionMaturity: 14, "14": "TransactionMaturity", /** * r" The metadata identifier is invalid. */ InvalidMetadataIdentifier: 15, "15": "InvalidMetadataIdentifier", /** * r" The call structure is not valid. */ MalformedCallStructure: 16, "16": "MalformedCallStructure", /** * r" The provided register does not allow write operations. */ ReservedRegisterNotWritable: 17, "17": "ReservedRegisterNotWritable", /** * r" The execution resulted in an erroneous state of the interpreter. */ InvalidFlags: 18, "18": "InvalidFlags", /** * r" The provided immediate value is not valid for this instruction. */ InvalidImmediateValue: 19, "19": "InvalidImmediateValue", /** * r" The provided transaction input is not of type `Coin`. */ ExpectedCoinInput: 20, "20": "ExpectedCoinInput", /** * r" `ECAL` instruction failed. */ EcalError: 21, "21": "EcalError", /** * r" Two segments of the interpreter memory should not intersect for write operations. */ MemoryWriteOverlap: 22, "22": "MemoryWriteOverlap", /** * r" The requested contract is not listed in the transaction inputs. */ ContractNotInInputs: 23, "23": "ContractNotInInputs", /** * r" The internal asset ID balance overflowed with the provided instruction. */ InternalBalanceOverflow: 24, "24": "InternalBalanceOverflow", /** * r" The maximum allowed contract size is violated. */ ContractMaxSize: 25, "25": "ContractMaxSize", /** * r" This instruction expects the stack area to be unallocated for this call. */ ExpectedUnallocatedStack: 26, "26": "ExpectedUnallocatedStack", /** * r" The maximum allowed number of static contracts was reached for this transaction. */ MaxStaticContractsReached: 27, "27": "MaxStaticContractsReached", /** * r" The requested transfer amount cannot be zero. */ TransferAmountCannotBeZero: 28, "28": "TransferAmountCannotBeZero", /** * r" The provided transaction output should be of type `Variable`. */ ExpectedOutputVariable: 29, "29": "ExpectedOutputVariable", /** * r" The expected context of the stack parent is internal. */ ExpectedParentInternalContext: 30, "30": "ExpectedParentInternalContext", /** * r" The predicate returned non `1`. The `1` means successful verification * r" of the predicate, all other values means unsuccessful. */ PredicateReturnedNonOne: 31, "31": "PredicateReturnedNonOne", /** * r" The contract ID is already deployed and can't be overwritten. */ ContractIdAlreadyDeployed: 32, "32": "ContractIdAlreadyDeployed", /** * r" The loaded contract mismatch expectations. */ ContractMismatch: 33, "33": "ContractMismatch", /** * r" Attempting to send message data longer than `MAX_MESSAGE_DATA_LENGTH` */ MessageDataTooLong: 34, "34": "MessageDataTooLong", /** * r" Mathematically invalid arguments where given to an arithmetic instruction. * r" For instance, division by zero produces this. * r" These errors are ignored using the UNSAFEMATH flag. */ ArithmeticError: 35, "35": "ArithmeticError", /** * r" The contract instruction is not allowed in predicates. */ ContractInstructionNotAllowed: 36, "36": "ContractInstructionNotAllowed", /** * r" Transfer of zero coins is not allowed. */ TransferZeroCoins: 37, "37": "TransferZeroCoins", /** * r" Attempted to execute an invalid instruction */ InvalidInstruction: 38, "38": "InvalidInstruction", /** * r" Memory outside $is..$ssp range is not executable */ MemoryNotExecutable: 39, "39": "MemoryNotExecutable", /** * r" The policy is not set. */ PolicyIsNotSet: 40, "40": "PolicyIsNotSet", /** * r" The policy is not found across policies. */ PolicyNotFound: 41, "41": "PolicyNotFound", /** * r" Receipt context is full */ TooManyReceipts: 42, "42": "TooManyReceipts", /** * r" Balance of a contract overflowed */ BalanceOverflow: 43, "43": "BalanceOverflow", /** * r" Block height value is invalid, typically because it is too large */ InvalidBlockHeight: 44, "44": "InvalidBlockHeight", /** * r" Attempt to use sequential memory instructions with too large slot count, * r" typically because it cannot fit into usize */ TooManySlots: 45, "45": "TooManySlots", /** * r" Caller of this internal context is also expected to be internal, * r" i.e. $fp->$fp must be non-zero. */ ExpectedNestedCaller: 46, "46": "ExpectedNestedCaller", /** * r" During memory growth, the stack overlapped with the heap */ MemoryGrowthOverlap: 47, "47": "MemoryGrowthOverlap", /** * r" Attempting to read or write uninitialized memory. * r" Also occurs when boundary crosses from stack to heap. */ UninitalizedMemoryAccess: 48, "48": "UninitalizedMemoryAccess", /** * r" Overriding consensus parameters is not allowed. */ OverridingConsensusParameters: 49, "49": "OverridingConsensusParameters", /** * r" The storage doesn't know about the hash of the state transition bytecode. */ UnknownStateTransactionBytecodeRoot: 50, "50": "UnknownStateTransactionBytecodeRoot",