39187 lines
1.2 MiB
39187 lines
1.2 MiB
let imports = {};
|
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
let wasm;
|
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
|
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
|
|
cachedTextDecoder.decode();
|
|
|
|
let cachedUint8Memory0 = null;
|
|
|
|
function getUint8Memory0() {
|
|
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
}
|
|
return cachedUint8Memory0;
|
|
}
|
|
|
|
function getStringFromWasm0(ptr, len) {
|
|
ptr = ptr >>> 0;
|
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
}
|
|
|
|
const heap = new Array(128).fill(undefined);
|
|
|
|
heap.push(undefined, null, true, false);
|
|
|
|
let heap_next = heap.length;
|
|
|
|
function addHeapObject(obj) {
|
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
const idx = heap_next;
|
|
heap_next = heap[idx];
|
|
|
|
heap[idx] = obj;
|
|
return idx;
|
|
}
|
|
|
|
function getObject(idx) { return heap[idx]; }
|
|
|
|
function dropObject(idx) {
|
|
if (idx < 132) return;
|
|
heap[idx] = heap_next;
|
|
heap_next = idx;
|
|
}
|
|
|
|
function takeObject(idx) {
|
|
const ret = getObject(idx);
|
|
dropObject(idx);
|
|
return ret;
|
|
}
|
|
|
|
let WASM_VECTOR_LEN = 0;
|
|
|
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
|
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
? function (arg, view) {
|
|
return cachedTextEncoder.encodeInto(arg, view);
|
|
}
|
|
: function (arg, view) {
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
view.set(buf);
|
|
return {
|
|
read: arg.length,
|
|
written: buf.length
|
|
};
|
|
});
|
|
|
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
|
|
if (realloc === undefined) {
|
|
const buf = cachedTextEncoder.encode(arg);
|
|
const ptr = malloc(buf.length, 1) >>> 0;
|
|
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
WASM_VECTOR_LEN = buf.length;
|
|
return ptr;
|
|
}
|
|
|
|
let len = arg.length;
|
|
let ptr = malloc(len, 1) >>> 0;
|
|
|
|
const mem = getUint8Memory0();
|
|
|
|
let offset = 0;
|
|
|
|
for (; offset < len; offset++) {
|
|
const code = arg.charCodeAt(offset);
|
|
if (code > 0x7F) break;
|
|
mem[ptr + offset] = code;
|
|
}
|
|
|
|
if (offset !== len) {
|
|
if (offset !== 0) {
|
|
arg = arg.slice(offset);
|
|
}
|
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
const ret = encodeString(arg, view);
|
|
|
|
offset += ret.written;
|
|
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
}
|
|
|
|
WASM_VECTOR_LEN = offset;
|
|
return ptr;
|
|
}
|
|
|
|
function isLikeNone(x) {
|
|
return x === undefined || x === null;
|
|
}
|
|
|
|
let cachedInt32Memory0 = null;
|
|
|
|
function getInt32Memory0() {
|
|
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
}
|
|
return cachedInt32Memory0;
|
|
}
|
|
|
|
function debugString(val) {
|
|
// primitive types
|
|
const type = typeof val;
|
|
if (type == 'number' || type == 'boolean' || val == null) {
|
|
return `${val}`;
|
|
}
|
|
if (type == 'string') {
|
|
return `"${val}"`;
|
|
}
|
|
if (type == 'symbol') {
|
|
const description = val.description;
|
|
if (description == null) {
|
|
return 'Symbol';
|
|
} else {
|
|
return `Symbol(${description})`;
|
|
}
|
|
}
|
|
if (type == 'function') {
|
|
const name = val.name;
|
|
if (typeof name == 'string' && name.length > 0) {
|
|
return `Function(${name})`;
|
|
} else {
|
|
return 'Function';
|
|
}
|
|
}
|
|
// objects
|
|
if (Array.isArray(val)) {
|
|
const length = val.length;
|
|
let debug = '[';
|
|
if (length > 0) {
|
|
debug += debugString(val[0]);
|
|
}
|
|
for(let i = 1; i < length; i++) {
|
|
debug += ', ' + debugString(val[i]);
|
|
}
|
|
debug += ']';
|
|
return debug;
|
|
}
|
|
// Test for built-in
|
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
let className;
|
|
if (builtInMatches.length > 1) {
|
|
className = builtInMatches[1];
|
|
} else {
|
|
// Failed to match the standard '[object ClassName]'
|
|
return toString.call(val);
|
|
}
|
|
if (className == 'Object') {
|
|
// we're a user defined class or Object
|
|
// JSON.stringify avoids problems with cycles, and is generally much
|
|
// easier than looping through ownProperties of `val`.
|
|
try {
|
|
return 'Object(' + JSON.stringify(val) + ')';
|
|
} catch (_) {
|
|
return 'Object';
|
|
}
|
|
}
|
|
// errors
|
|
if (val instanceof Error) {
|
|
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
}
|
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
return className;
|
|
}
|
|
|
|
function getArrayU8FromWasm0(ptr, len) {
|
|
ptr = ptr >>> 0;
|
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
}
|
|
|
|
function passArray8ToWasm0(arg, malloc) {
|
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
getUint8Memory0().set(arg, ptr / 1);
|
|
WASM_VECTOR_LEN = arg.length;
|
|
return ptr;
|
|
}
|
|
|
|
function _assertClass(instance, klass) {
|
|
if (!(instance instanceof klass)) {
|
|
throw new Error(`expected instance of ${klass.name}`);
|
|
}
|
|
return instance.ptr;
|
|
}
|
|
|
|
let cachedUint32Memory0 = null;
|
|
|
|
function getUint32Memory0() {
|
|
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
|
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
}
|
|
return cachedUint32Memory0;
|
|
}
|
|
|
|
function getArrayU32FromWasm0(ptr, len) {
|
|
ptr = ptr >>> 0;
|
|
return getUint32Memory0().subarray(ptr / 4, ptr / 4 + len);
|
|
}
|
|
|
|
function passArray32ToWasm0(arg, malloc) {
|
|
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
getUint32Memory0().set(arg, ptr / 4);
|
|
WASM_VECTOR_LEN = arg.length;
|
|
return ptr;
|
|
}
|
|
/**
|
|
* @param {Address} address
|
|
* @param {TransactionUnspentOutputs} utxos
|
|
* @param {TransactionBuilderConfig} config
|
|
* @returns {TransactionBatchList}
|
|
*/
|
|
module.exports.create_send_all = function(address, utxos, config) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, Address);
|
|
_assertClass(utxos, TransactionUnspentOutputs);
|
|
_assertClass(config, TransactionBuilderConfig);
|
|
wasm.create_send_all(retptr, address.__wbg_ptr, utxos.__wbg_ptr, config.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBatchList.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
module.exports.encode_arbitrary_bytes_as_metadatum = function(bytes) {
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ret = wasm.encode_arbitrary_bytes_as_metadatum(ptr0, len0);
|
|
return TransactionMetadatum.__wrap(ret);
|
|
};
|
|
|
|
/**
|
|
* @param {TransactionMetadatum} metadata
|
|
* @returns {Uint8Array}
|
|
*/
|
|
module.exports.decode_arbitrary_bytes_from_metadatum = function(metadata) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(metadata, TransactionMetadatum);
|
|
wasm.decode_arbitrary_bytes_from_metadatum(retptr, metadata.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
if (r3) {
|
|
throw takeObject(r2);
|
|
}
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} json
|
|
* @param {MetadataJsonSchema} schema
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
module.exports.encode_json_str_to_metadatum = function(json, schema) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.encode_json_str_to_metadatum(retptr, ptr0, len0, schema);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {TransactionMetadatum} metadatum
|
|
* @param {MetadataJsonSchema} schema
|
|
* @returns {string}
|
|
*/
|
|
module.exports.decode_metadatum_to_json_str = function(metadatum, schema) {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(metadatum, TransactionMetadatum);
|
|
wasm.decode_metadatum_to_json_str(retptr, metadatum.__wbg_ptr, schema);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} password
|
|
* @param {string} salt
|
|
* @param {string} nonce
|
|
* @param {string} data
|
|
* @returns {string}
|
|
*/
|
|
module.exports.encrypt_with_password = function(password, salt, nonce, data) {
|
|
let deferred6_0;
|
|
let deferred6_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(salt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passStringToWasm0(nonce, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
const ptr3 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len3 = WASM_VECTOR_LEN;
|
|
wasm.encrypt_with_password(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr5 = r0;
|
|
var len5 = r1;
|
|
if (r3) {
|
|
ptr5 = 0; len5 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred6_0 = ptr5;
|
|
deferred6_1 = len5;
|
|
return getStringFromWasm0(ptr5, len5);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} password
|
|
* @param {string} data
|
|
* @returns {string}
|
|
*/
|
|
module.exports.decrypt_with_password = function(password, data) {
|
|
let deferred4_0;
|
|
let deferred4_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.decrypt_with_password(retptr, ptr0, len0, ptr1, len1);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr3 = r0;
|
|
var len3 = r1;
|
|
if (r3) {
|
|
ptr3 = 0; len3 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred4_0 = ptr3;
|
|
deferred4_1 = len3;
|
|
return getStringFromWasm0(ptr3, len3);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {Transaction} tx
|
|
* @param {LinearFee} linear_fee
|
|
* @returns {BigNum}
|
|
*/
|
|
module.exports.min_fee = function(tx, linear_fee) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(tx, Transaction);
|
|
_assertClass(linear_fee, LinearFee);
|
|
wasm.min_fee(retptr, tx.__wbg_ptr, linear_fee.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {ExUnits} ex_units
|
|
* @param {ExUnitPrices} ex_unit_prices
|
|
* @returns {BigNum}
|
|
*/
|
|
module.exports.calculate_ex_units_ceil_cost = function(ex_units, ex_unit_prices) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(ex_units, ExUnits);
|
|
_assertClass(ex_unit_prices, ExUnitPrices);
|
|
wasm.calculate_ex_units_ceil_cost(retptr, ex_units.__wbg_ptr, ex_unit_prices.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {Transaction} tx
|
|
* @param {ExUnitPrices} ex_unit_prices
|
|
* @returns {BigNum}
|
|
*/
|
|
module.exports.min_script_fee = function(tx, ex_unit_prices) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(tx, Transaction);
|
|
_assertClass(ex_unit_prices, ExUnitPrices);
|
|
wasm.min_script_fee(retptr, tx.__wbg_ptr, ex_unit_prices.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {number} total_ref_scripts_size
|
|
* @param {UnitInterval} ref_script_coins_per_byte
|
|
* @returns {BigNum}
|
|
*/
|
|
module.exports.min_ref_script_fee = function(total_ref_scripts_size, ref_script_coins_per_byte) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(ref_script_coins_per_byte, UnitInterval);
|
|
wasm.min_ref_script_fee(retptr, total_ref_scripts_size, ref_script_coins_per_byte.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {string} json
|
|
* @param {PlutusDatumSchema} schema
|
|
* @returns {PlutusData}
|
|
*/
|
|
module.exports.encode_json_str_to_plutus_datum = function(json, schema) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.encode_json_str_to_plutus_datum(retptr, ptr0, len0, schema);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {PlutusData} datum
|
|
* @param {PlutusDatumSchema} schema
|
|
* @returns {string}
|
|
*/
|
|
module.exports.decode_plutus_datum_to_json_str = function(datum, schema) {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(datum, PlutusData);
|
|
wasm.decode_plutus_datum_to_json_str(retptr, datum.__wbg_ptr, schema);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {TransactionHash} tx_body_hash
|
|
* @param {ByronAddress} addr
|
|
* @param {LegacyDaedalusPrivateKey} key
|
|
* @returns {BootstrapWitness}
|
|
*/
|
|
module.exports.make_daedalus_bootstrap_witness = function(tx_body_hash, addr, key) {
|
|
_assertClass(tx_body_hash, TransactionHash);
|
|
_assertClass(addr, ByronAddress);
|
|
_assertClass(key, LegacyDaedalusPrivateKey);
|
|
const ret = wasm.make_daedalus_bootstrap_witness(tx_body_hash.__wbg_ptr, addr.__wbg_ptr, key.__wbg_ptr);
|
|
return BootstrapWitness.__wrap(ret);
|
|
};
|
|
|
|
/**
|
|
* @param {TransactionHash} tx_body_hash
|
|
* @param {ByronAddress} addr
|
|
* @param {Bip32PrivateKey} key
|
|
* @returns {BootstrapWitness}
|
|
*/
|
|
module.exports.make_icarus_bootstrap_witness = function(tx_body_hash, addr, key) {
|
|
_assertClass(tx_body_hash, TransactionHash);
|
|
_assertClass(addr, ByronAddress);
|
|
_assertClass(key, Bip32PrivateKey);
|
|
const ret = wasm.make_icarus_bootstrap_witness(tx_body_hash.__wbg_ptr, addr.__wbg_ptr, key.__wbg_ptr);
|
|
return BootstrapWitness.__wrap(ret);
|
|
};
|
|
|
|
/**
|
|
* @param {TransactionHash} tx_body_hash
|
|
* @param {PrivateKey} sk
|
|
* @returns {Vkeywitness}
|
|
*/
|
|
module.exports.make_vkey_witness = function(tx_body_hash, sk) {
|
|
_assertClass(tx_body_hash, TransactionHash);
|
|
_assertClass(sk, PrivateKey);
|
|
const ret = wasm.make_vkey_witness(tx_body_hash.__wbg_ptr, sk.__wbg_ptr);
|
|
return Vkeywitness.__wrap(ret);
|
|
};
|
|
|
|
/**
|
|
* @param {AuxiliaryData} auxiliary_data
|
|
* @returns {AuxiliaryDataHash}
|
|
*/
|
|
module.exports.hash_auxiliary_data = function(auxiliary_data) {
|
|
_assertClass(auxiliary_data, AuxiliaryData);
|
|
const ret = wasm.hash_auxiliary_data(auxiliary_data.__wbg_ptr);
|
|
return AuxiliaryDataHash.__wrap(ret);
|
|
};
|
|
|
|
/**
|
|
* @param {PlutusData} plutus_data
|
|
* @returns {DataHash}
|
|
*/
|
|
module.exports.hash_plutus_data = function(plutus_data) {
|
|
_assertClass(plutus_data, PlutusData);
|
|
const ret = wasm.hash_plutus_data(plutus_data.__wbg_ptr);
|
|
return DataHash.__wrap(ret);
|
|
};
|
|
|
|
/**
|
|
* @param {Redeemers} redeemers
|
|
* @param {Costmdls} cost_models
|
|
* @param {PlutusList | undefined} [datums]
|
|
* @returns {ScriptDataHash}
|
|
*/
|
|
module.exports.hash_script_data = function(redeemers, cost_models, datums) {
|
|
_assertClass(redeemers, Redeemers);
|
|
_assertClass(cost_models, Costmdls);
|
|
let ptr0 = 0;
|
|
if (!isLikeNone(datums)) {
|
|
_assertClass(datums, PlutusList);
|
|
ptr0 = datums.__destroy_into_raw();
|
|
}
|
|
const ret = wasm.hash_script_data(redeemers.__wbg_ptr, cost_models.__wbg_ptr, ptr0);
|
|
return ScriptDataHash.__wrap(ret);
|
|
};
|
|
|
|
/**
|
|
* @param {TransactionBody} txbody
|
|
* @param {BigNum} pool_deposit
|
|
* @param {BigNum} key_deposit
|
|
* @returns {Value}
|
|
*/
|
|
module.exports.get_implicit_input = function(txbody, pool_deposit, key_deposit) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(txbody, TransactionBody);
|
|
_assertClass(pool_deposit, BigNum);
|
|
_assertClass(key_deposit, BigNum);
|
|
wasm.get_implicit_input(retptr, txbody.__wbg_ptr, pool_deposit.__wbg_ptr, key_deposit.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {TransactionBody} txbody
|
|
* @param {BigNum} pool_deposit
|
|
* @param {BigNum} key_deposit
|
|
* @returns {BigNum}
|
|
*/
|
|
module.exports.get_deposit = function(txbody, pool_deposit, key_deposit) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(txbody, TransactionBody);
|
|
_assertClass(pool_deposit, BigNum);
|
|
_assertClass(key_deposit, BigNum);
|
|
wasm.get_deposit(retptr, txbody.__wbg_ptr, pool_deposit.__wbg_ptr, key_deposit.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
*returns minimal amount of ada for the output for case when the amount is included to the output
|
|
* @param {TransactionOutput} output
|
|
* @param {DataCost} data_cost
|
|
* @returns {BigNum}
|
|
*/
|
|
module.exports.min_ada_for_output = function(output, data_cost) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(output, TransactionOutput);
|
|
_assertClass(data_cost, DataCost);
|
|
wasm.min_ada_for_output(retptr, output.__wbg_ptr, data_cost.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Receives a script JSON string
|
|
* and returns a NativeScript.
|
|
* Cardano Wallet and Node styles are supported.
|
|
*
|
|
* * wallet: https://github.com/input-output-hk/cardano-wallet/blob/master/specifications/api/swagger.yaml
|
|
* * node: https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/simple-scripts.md
|
|
*
|
|
* self_xpub is expected to be a Bip32PublicKey as hex-encoded bytes
|
|
* @param {string} json
|
|
* @param {string} self_xpub
|
|
* @param {ScriptSchema} schema
|
|
* @returns {NativeScript}
|
|
*/
|
|
module.exports.encode_json_str_to_native_script = function(json, self_xpub, schema) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passStringToWasm0(self_xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.encode_json_str_to_native_script(retptr, ptr0, len0, ptr1, len1, schema);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NativeScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Returns the state of the transaction sets.
|
|
* If all sets have a tag, it returns AllSetsHaveTag.
|
|
* If all sets have no tag, it returns AllSetsHaveNoTag.
|
|
* If there is a mix of tagged and untagged sets, it returns MixedSets.
|
|
* This function is useful for checking if a transaction might be signed by a hardware wallet.
|
|
* And for checking which parameter should be used in a hardware wallet api.
|
|
* WARNING this function will be deleted after all tags for set types will be mandatory. Approx after next hf
|
|
* @param {Uint8Array} tx_bytes
|
|
* @returns {TransactionSetsState}
|
|
*/
|
|
module.exports.has_transaction_set_tag = function(tx_bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.has_transaction_set_tag(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
};
|
|
|
|
function handleError(f, args) {
|
|
try {
|
|
return f.apply(this, args);
|
|
} catch (e) {
|
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
}
|
|
}
|
|
/**
|
|
* Each new language uses a different namespace for hashing its script
|
|
* This is because you could have a language where the same bytes have different semantics
|
|
* So this avoids scripts in different languages mapping to the same hash
|
|
* Note that the enum value here is different than the enum value for deciding the cost model of a script
|
|
*/
|
|
module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
|
|
/**
|
|
* JSON <-> PlutusData conversion schemas.
|
|
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
*
|
|
* All methods here have the following restrictions due to limitations on dependencies:
|
|
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
* on either side when tested so proceed with caution
|
|
*/
|
|
module.exports.PlutusDatumSchema = Object.freeze({
|
|
/**
|
|
* ScriptDataJsonNoSchema in cardano-node.
|
|
*
|
|
* This is the format used by --script-data-value in cardano-cli
|
|
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
* From JSON:
|
|
* * null/true/false/floats NOT supported
|
|
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
* To JSON:
|
|
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
* * Lists not supported in keys
|
|
* * Maps not supported in keys
|
|
*/
|
|
BasicConversions:0,"0":"BasicConversions",
|
|
/**
|
|
* ScriptDataJsonDetailedSchema in cardano-node.
|
|
*
|
|
* This is the format used by --script-data-file in cardano-cli
|
|
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
* Integer's value is a JSON number e.g. {"int": 100}
|
|
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
* respectively with their values being the plutus datum encoded via this same schema
|
|
* e.g. {"map": [
|
|
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
* ]}
|
|
* From JSON:
|
|
* * null/true/false/floats NOT supported
|
|
* * the JSON must conform to a very specific schema
|
|
* To JSON:
|
|
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
*/
|
|
DetailedSchema:1,"1":"DetailedSchema", });
|
|
/**
|
|
*/
|
|
module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
|
|
/**
|
|
*/
|
|
module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
|
|
/**
|
|
*/
|
|
module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
|
|
/**
|
|
*/
|
|
module.exports.VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
|
|
/**
|
|
*/
|
|
module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
|
|
/**
|
|
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
*/
|
|
LargestFirst:0,"0":"LargestFirst",
|
|
/**
|
|
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
*/
|
|
RandomImprove:1,"1":"RandomImprove",
|
|
/**
|
|
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
*/
|
|
LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
|
|
/**
|
|
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
*/
|
|
RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
|
|
/**
|
|
*/
|
|
module.exports.NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
|
|
/**
|
|
*/
|
|
module.exports.BlockEra = Object.freeze({ Byron:0,"0":"Byron",Shelley:1,"1":"Shelley",Allegra:2,"2":"Allegra",Mary:3,"3":"Mary",Alonzo:4,"4":"Alonzo",Babbage:5,"5":"Babbage",Conway:6,"6":"Conway",Unknown:7,"7":"Unknown", });
|
|
/**
|
|
*/
|
|
module.exports.GovernanceActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidenceAction:3,"3":"NoConfidenceAction",UpdateCommitteeAction:4,"4":"UpdateCommitteeAction",NewConstitutionAction:5,"5":"NewConstitutionAction",InfoAction:6,"6":"InfoAction", });
|
|
/**
|
|
*/
|
|
module.exports.RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
|
|
/**
|
|
*/
|
|
module.exports.CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",GenesisKeyDelegation:5,"5":"GenesisKeyDelegation",MoveInstantaneousRewardsCert:6,"6":"MoveInstantaneousRewardsCert",CommitteeHotAuth:7,"7":"CommitteeHotAuth",CommitteeColdResign:8,"8":"CommitteeColdResign",DRepDeregistration:9,"9":"DRepDeregistration",DRepRegistration:10,"10":"DRepRegistration",DRepUpdate:11,"11":"DRepUpdate",StakeAndVoteDelegation:12,"12":"StakeAndVoteDelegation",StakeRegistrationAndDelegation:13,"13":"StakeRegistrationAndDelegation",StakeVoteRegistrationAndDelegation:14,"14":"StakeVoteRegistrationAndDelegation",VoteDelegation:15,"15":"VoteDelegation",VoteRegistrationAndDelegation:16,"16":"VoteRegistrationAndDelegation", });
|
|
/**
|
|
*/
|
|
module.exports.PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
|
|
/**
|
|
*/
|
|
module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
|
|
/**
|
|
*/
|
|
module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
|
|
/**
|
|
*/
|
|
module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
|
|
/**
|
|
*/
|
|
module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
|
|
/**
|
|
* Used to choosed the schema for a script JSON string
|
|
*/
|
|
module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
|
|
/**
|
|
*/
|
|
module.exports.AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
|
|
/**
|
|
*/
|
|
module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
|
|
/**
|
|
*/
|
|
module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
|
|
/**
|
|
*/
|
|
module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
|
|
/**
|
|
*/
|
|
module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
|
|
/**
|
|
*/
|
|
module.exports.TransactionMetadatumKind = Object.freeze({ MetadataMap:0,"0":"MetadataMap",MetadataList:1,"1":"MetadataList",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
|
|
/**
|
|
*/
|
|
module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
|
|
|
|
const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_address_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Address {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Address.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AddressFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_address_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} data
|
|
* @returns {Address}
|
|
*/
|
|
static from_bytes(data) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.address_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Address.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.address_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.address_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Address}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.address_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Address.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {AddressKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.address_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {Credential | undefined}
|
|
*/
|
|
payment_cred() {
|
|
const ret = wasm.address_payment_cred(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_malformed() {
|
|
const ret = wasm.address_is_malformed(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.address_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Address}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.address_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Address.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.address_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string | undefined} [prefix]
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
var ptr0 = isLikeNone(prefix) ? 0 : passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
var len0 = WASM_VECTOR_LEN;
|
|
wasm.address_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {Address}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.address_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Address.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
network_id() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.address_network_id(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Address = Address;
|
|
|
|
const AnchorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_anchor_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Anchor {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Anchor.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AnchorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AnchorFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_anchor_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchor_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Anchor}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchor_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Anchor.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchor_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Anchor}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchor_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Anchor.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchor_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchor_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Anchor}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchor_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Anchor.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {URL}
|
|
*/
|
|
url() {
|
|
const ret = wasm.anchor_url(this.__wbg_ptr);
|
|
return URL.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {AnchorDataHash}
|
|
*/
|
|
anchor_data_hash() {
|
|
const ret = wasm.anchor_anchor_data_hash(this.__wbg_ptr);
|
|
return AnchorDataHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {URL} anchor_url
|
|
* @param {AnchorDataHash} anchor_data_hash
|
|
* @returns {Anchor}
|
|
*/
|
|
static new(anchor_url, anchor_data_hash) {
|
|
_assertClass(anchor_url, URL);
|
|
_assertClass(anchor_data_hash, AnchorDataHash);
|
|
const ret = wasm.anchor_new(anchor_url.__wbg_ptr, anchor_data_hash.__wbg_ptr);
|
|
return Anchor.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Anchor = Anchor;
|
|
|
|
const AnchorDataHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_anchordatahash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class AnchorDataHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(AnchorDataHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AnchorDataHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AnchorDataHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_anchordatahash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {AnchorDataHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AnchorDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {AnchorDataHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AnchorDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {AnchorDataHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AnchorDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.AnchorDataHash = AnchorDataHash;
|
|
|
|
const AssetNameFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_assetname_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class AssetName {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(AssetName.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AssetNameFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AssetNameFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_assetname_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetname_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {AssetName}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assetname_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AssetName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetname_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {AssetName}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assetname_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AssetName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetname_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetname_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {AssetName}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assetname_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AssetName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} name
|
|
* @returns {AssetName}
|
|
*/
|
|
static new(name) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(name, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assetname_new(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AssetName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
name() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetname_name(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.AssetName = AssetName;
|
|
|
|
const AssetNamesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_assetnames_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class AssetNames {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(AssetNames.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AssetNamesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AssetNamesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_assetnames_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetnames_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {AssetNames}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assetnames_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AssetNames.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetnames_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {AssetNames}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assetnames_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AssetNames.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetnames_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetnames_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {AssetNames}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assetnames_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AssetNames.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {AssetNames}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.assetnames_new();
|
|
return AssetNames.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {AssetName}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.assetnames_get(this.__wbg_ptr, index);
|
|
return AssetName.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {AssetName} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, AssetName);
|
|
wasm.assetnames_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.AssetNames = AssetNames;
|
|
|
|
const AssetsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_assets_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Assets {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Assets.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AssetsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AssetsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_assets_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assets_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Assets}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assets_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Assets.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assets_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Assets}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assets_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Assets.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assets_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assets_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Assets}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.assets_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Assets.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Assets}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.assets_new();
|
|
return Assets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {AssetName} key
|
|
* @param {BigNum} value
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
insert(key, value) {
|
|
_assertClass(key, AssetName);
|
|
_assertClass(value, BigNum);
|
|
const ret = wasm.assets_insert(this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {AssetName} key
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, AssetName);
|
|
const ret = wasm.assets_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {AssetNames}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.assets_keys(this.__wbg_ptr);
|
|
return AssetNames.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Assets = Assets;
|
|
|
|
const AuxiliaryDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_auxiliarydata_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class AuxiliaryData {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(AuxiliaryData.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AuxiliaryDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AuxiliaryDataFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_auxiliarydata_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.auxiliarydata_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {AuxiliaryData}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.auxiliarydata_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AuxiliaryData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.auxiliarydata_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {AuxiliaryData}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.auxiliarydata_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AuxiliaryData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.auxiliarydata_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.auxiliarydata_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {AuxiliaryData}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.auxiliarydata_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AuxiliaryData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {AuxiliaryData}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.auxiliarydata_new();
|
|
return AuxiliaryData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {GeneralTransactionMetadata | undefined}
|
|
*/
|
|
metadata() {
|
|
const ret = wasm.auxiliarydata_metadata(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : GeneralTransactionMetadata.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GeneralTransactionMetadata} metadata
|
|
*/
|
|
set_metadata(metadata) {
|
|
_assertClass(metadata, GeneralTransactionMetadata);
|
|
wasm.auxiliarydata_set_metadata(this.__wbg_ptr, metadata.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {NativeScripts | undefined}
|
|
*/
|
|
native_scripts() {
|
|
const ret = wasm.auxiliarydata_native_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {NativeScripts} native_scripts
|
|
*/
|
|
set_native_scripts(native_scripts) {
|
|
_assertClass(native_scripts, NativeScripts);
|
|
wasm.auxiliarydata_set_native_scripts(this.__wbg_ptr, native_scripts.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {PlutusScripts | undefined}
|
|
*/
|
|
plutus_scripts() {
|
|
const ret = wasm.auxiliarydata_plutus_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusScripts} plutus_scripts
|
|
*/
|
|
set_plutus_scripts(plutus_scripts) {
|
|
_assertClass(plutus_scripts, PlutusScripts);
|
|
wasm.auxiliarydata_set_plutus_scripts(this.__wbg_ptr, plutus_scripts.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
prefer_alonzo_format() {
|
|
const ret = wasm.auxiliarydata_prefer_alonzo_format(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @param {boolean} prefer
|
|
*/
|
|
set_prefer_alonzo_format(prefer) {
|
|
wasm.auxiliarydata_set_prefer_alonzo_format(this.__wbg_ptr, prefer);
|
|
}
|
|
}
|
|
module.exports.AuxiliaryData = AuxiliaryData;
|
|
|
|
const AuxiliaryDataHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_auxiliarydatahash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class AuxiliaryDataHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(AuxiliaryDataHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AuxiliaryDataHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AuxiliaryDataHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_auxiliarydatahash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {AuxiliaryDataHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.auxiliarydatahash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AuxiliaryDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {AuxiliaryDataHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.auxiliarydatahash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AuxiliaryDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {AuxiliaryDataHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.auxiliarydatahash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return AuxiliaryDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.AuxiliaryDataHash = AuxiliaryDataHash;
|
|
|
|
const AuxiliaryDataSetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_auxiliarydataset_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class AuxiliaryDataSet {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(AuxiliaryDataSet.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
AuxiliaryDataSetFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
AuxiliaryDataSetFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_auxiliarydataset_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {AuxiliaryDataSet}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.auxiliarydataset_new();
|
|
return AuxiliaryDataSet.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.auxiliarydataset_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} tx_index
|
|
* @param {AuxiliaryData} data
|
|
* @returns {AuxiliaryData | undefined}
|
|
*/
|
|
insert(tx_index, data) {
|
|
_assertClass(data, AuxiliaryData);
|
|
const ret = wasm.auxiliarydataset_insert(this.__wbg_ptr, tx_index, data.__wbg_ptr);
|
|
return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} tx_index
|
|
* @returns {AuxiliaryData | undefined}
|
|
*/
|
|
get(tx_index) {
|
|
const ret = wasm.auxiliarydataset_get(this.__wbg_ptr, tx_index);
|
|
return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint32Array}
|
|
*/
|
|
indices() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.auxiliarydataset_indices(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.AuxiliaryDataSet = AuxiliaryDataSet;
|
|
|
|
const BaseAddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_baseaddress_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class BaseAddress {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(BaseAddress.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
BaseAddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
BaseAddressFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_baseaddress_free(ptr);
|
|
}
|
|
/**
|
|
* @param {number} network
|
|
* @param {Credential} payment
|
|
* @param {Credential} stake
|
|
* @returns {BaseAddress}
|
|
*/
|
|
static new(network, payment, stake) {
|
|
_assertClass(payment, Credential);
|
|
_assertClass(stake, Credential);
|
|
const ret = wasm.baseaddress_new(network, payment.__wbg_ptr, stake.__wbg_ptr);
|
|
return BaseAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
payment_cred() {
|
|
const ret = wasm.baseaddress_payment_cred(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_cred() {
|
|
const ret = wasm.baseaddress_stake_cred(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Address}
|
|
*/
|
|
to_address() {
|
|
const ret = wasm.baseaddress_to_address(this.__wbg_ptr);
|
|
return Address.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Address} addr
|
|
* @returns {BaseAddress | undefined}
|
|
*/
|
|
static from_address(addr) {
|
|
_assertClass(addr, Address);
|
|
const ret = wasm.baseaddress_from_address(addr.__wbg_ptr);
|
|
return ret === 0 ? undefined : BaseAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
network_id() {
|
|
const ret = wasm.baseaddress_network_id(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.BaseAddress = BaseAddress;
|
|
|
|
const BigIntFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_bigint_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class BigInt {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(BigInt.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
BigIntFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
BigIntFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_bigint_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bigint_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {BigInt}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bigint_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigInt.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bigint_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {BigInt}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bigint_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigInt.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bigint_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bigint_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {BigInt}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bigint_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigInt.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_zero() {
|
|
const ret = wasm.bigint_is_zero(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
as_u64() {
|
|
const ret = wasm.bigint_as_u64(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Int | undefined}
|
|
*/
|
|
as_int() {
|
|
const ret = wasm.bigint_as_int(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Int.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {string} text
|
|
* @returns {BigInt}
|
|
*/
|
|
static from_str(text) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bigint_from_str(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigInt.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_str() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bigint_to_str(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigInt} other
|
|
* @returns {BigInt}
|
|
*/
|
|
add(other) {
|
|
_assertClass(other, BigInt);
|
|
const ret = wasm.bigint_add(this.__wbg_ptr, other.__wbg_ptr);
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigInt} other
|
|
* @returns {BigInt}
|
|
*/
|
|
sub(other) {
|
|
_assertClass(other, BigInt);
|
|
const ret = wasm.bigint_sub(this.__wbg_ptr, other.__wbg_ptr);
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigInt} other
|
|
* @returns {BigInt}
|
|
*/
|
|
mul(other) {
|
|
_assertClass(other, BigInt);
|
|
const ret = wasm.bigint_mul(this.__wbg_ptr, other.__wbg_ptr);
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} exp
|
|
* @returns {BigInt}
|
|
*/
|
|
pow(exp) {
|
|
const ret = wasm.bigint_pow(this.__wbg_ptr, exp);
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigInt}
|
|
*/
|
|
static one() {
|
|
const ret = wasm.bigint_one();
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigInt}
|
|
*/
|
|
static zero() {
|
|
const ret = wasm.bigint_zero();
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigInt}
|
|
*/
|
|
abs() {
|
|
const ret = wasm.bigint_abs(this.__wbg_ptr);
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigInt}
|
|
*/
|
|
increment() {
|
|
const ret = wasm.bigint_increment(this.__wbg_ptr);
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigInt} other
|
|
* @returns {BigInt}
|
|
*/
|
|
div_ceil(other) {
|
|
_assertClass(other, BigInt);
|
|
const ret = wasm.bigint_div_ceil(this.__wbg_ptr, other.__wbg_ptr);
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigInt} other
|
|
* @returns {BigInt}
|
|
*/
|
|
div_floor(other) {
|
|
_assertClass(other, BigInt);
|
|
const ret = wasm.bigint_div_floor(this.__wbg_ptr, other.__wbg_ptr);
|
|
return BigInt.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.BigInt = BigInt;
|
|
|
|
const BigNumFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_bignum_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class BigNum {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(BigNum.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
BigNumFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
BigNumFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_bignum_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bignum_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {BigNum}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bignum_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bignum_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {BigNum}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bignum_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bignum_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bignum_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {BigNum}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bignum_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} string
|
|
* @returns {BigNum}
|
|
*/
|
|
static from_str(string) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bignum_from_str(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_str() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bignum_to_str(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
static zero() {
|
|
const ret = wasm.bignum_zero();
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
static one() {
|
|
const ret = wasm.bignum_one();
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_zero() {
|
|
const ret = wasm.bignum_is_zero(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @param {BigNum} other
|
|
* @returns {BigNum}
|
|
*/
|
|
div_floor(other) {
|
|
_assertClass(other, BigNum);
|
|
const ret = wasm.bignum_div_floor(this.__wbg_ptr, other.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} other
|
|
* @returns {BigNum}
|
|
*/
|
|
checked_mul(other) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(other, BigNum);
|
|
wasm.bignum_checked_mul(retptr, this.__wbg_ptr, other.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} other
|
|
* @returns {BigNum}
|
|
*/
|
|
checked_add(other) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(other, BigNum);
|
|
wasm.bignum_checked_add(retptr, this.__wbg_ptr, other.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} other
|
|
* @returns {BigNum}
|
|
*/
|
|
checked_sub(other) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(other, BigNum);
|
|
wasm.bignum_checked_sub(retptr, this.__wbg_ptr, other.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* returns 0 if it would otherwise underflow
|
|
* @param {BigNum} other
|
|
* @returns {BigNum}
|
|
*/
|
|
clamped_sub(other) {
|
|
_assertClass(other, BigNum);
|
|
const ret = wasm.bignum_clamped_sub(this.__wbg_ptr, other.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} rhs_value
|
|
* @returns {number}
|
|
*/
|
|
compare(rhs_value) {
|
|
_assertClass(rhs_value, BigNum);
|
|
const ret = wasm.bignum_compare(this.__wbg_ptr, rhs_value.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @param {BigNum} rhs_value
|
|
* @returns {boolean}
|
|
*/
|
|
less_than(rhs_value) {
|
|
_assertClass(rhs_value, BigNum);
|
|
const ret = wasm.bignum_less_than(this.__wbg_ptr, rhs_value.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
static max_value() {
|
|
const ret = wasm.bignum_max_value();
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} a
|
|
* @param {BigNum} b
|
|
* @returns {BigNum}
|
|
*/
|
|
static max(a, b) {
|
|
_assertClass(a, BigNum);
|
|
_assertClass(b, BigNum);
|
|
const ret = wasm.bignum_max(a.__wbg_ptr, b.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.BigNum = BigNum;
|
|
|
|
const Bip32PrivateKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_bip32privatekey_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Bip32PrivateKey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Bip32PrivateKey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
Bip32PrivateKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
Bip32PrivateKeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_bip32privatekey_free(ptr);
|
|
}
|
|
/**
|
|
* derive this private key with the given index.
|
|
*
|
|
* # Security considerations
|
|
*
|
|
* * hard derivation index cannot be soft derived with the public key
|
|
*
|
|
* # Hard derivation vs Soft derivation
|
|
*
|
|
* If you pass an index below 0x80000000 then it is a soft derivation.
|
|
* The advantage of soft derivation is that it is possible to derive the
|
|
* public key too. I.e. derivation the private key with a soft derivation
|
|
* index and then retrieving the associated public key is equivalent to
|
|
* deriving the public key associated to the parent private key.
|
|
*
|
|
* Hard derivation index does not allow public key derivation.
|
|
*
|
|
* This is why deriving the private key should not fail while deriving
|
|
* the public key may fail (if the derivation index is invalid).
|
|
* @param {number} index
|
|
* @returns {Bip32PrivateKey}
|
|
*/
|
|
derive(index) {
|
|
const ret = wasm.bip32privatekey_derive(this.__wbg_ptr, index);
|
|
return Bip32PrivateKey.__wrap(ret);
|
|
}
|
|
/**
|
|
* 128-byte xprv a key format in Cardano that some software still uses or requires
|
|
* the traditional 96-byte xprv is simply encoded as
|
|
* prv | chaincode
|
|
* however, because some software may not know how to compute a public key from a private key,
|
|
* the 128-byte inlines the public key in the following format
|
|
* prv | pub | chaincode
|
|
* so be careful if you see the term "xprv" as it could refer to either one
|
|
* our library does not require the pub (instead we compute the pub key when needed)
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Bip32PrivateKey}
|
|
*/
|
|
static from_128_xprv(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bip32privatekey_from_128_xprv(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* see from_128_xprv
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_128_xprv() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32privatekey_to_128_xprv(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Bip32PrivateKey}
|
|
*/
|
|
static generate_ed25519_bip32() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32privatekey_generate_ed25519_bip32(retptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PrivateKey}
|
|
*/
|
|
to_raw_key() {
|
|
const ret = wasm.bip32privatekey_to_raw_key(this.__wbg_ptr);
|
|
return PrivateKey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Bip32PublicKey}
|
|
*/
|
|
to_public() {
|
|
const ret = wasm.bip32privatekey_to_public(this.__wbg_ptr);
|
|
return Bip32PublicKey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Bip32PrivateKey}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bip32privatekey_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
as_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32privatekey_as_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech32_str
|
|
* @returns {Bip32PrivateKey}
|
|
*/
|
|
static from_bech32(bech32_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech32_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bip32privatekey_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_bech32() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32privatekey_to_bech32(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} entropy
|
|
* @param {Uint8Array} password
|
|
* @returns {Bip32PrivateKey}
|
|
*/
|
|
static from_bip39_entropy(entropy, password) {
|
|
const ptr0 = passArray8ToWasm0(entropy, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passArray8ToWasm0(password, wasm.__wbindgen_malloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ret = wasm.bip32privatekey_from_bip39_entropy(ptr0, len0, ptr1, len1);
|
|
return Bip32PrivateKey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
chaincode() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32privatekey_chaincode(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32privatekey_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Bip32PrivateKey}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bip32privatekey_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Bip32PrivateKey = Bip32PrivateKey;
|
|
|
|
const Bip32PublicKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_bip32publickey_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Bip32PublicKey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Bip32PublicKey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
Bip32PublicKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
Bip32PublicKeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_bip32publickey_free(ptr);
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Bip32PublicKey}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bip32publickey_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PublicKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32publickey_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
chaincode() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32publickey_chaincode(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_bech32() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32publickey_to_bech32(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech32_str
|
|
* @returns {Bip32PublicKey}
|
|
*/
|
|
static from_bech32(bech32_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech32_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bip32publickey_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PublicKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
as_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32publickey_as_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Bip32PublicKey}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bip32publickey_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PublicKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PublicKey}
|
|
*/
|
|
to_raw_key() {
|
|
const ret = wasm.bip32publickey_to_raw_key(this.__wbg_ptr);
|
|
return PublicKey.__wrap(ret);
|
|
}
|
|
/**
|
|
* derive this public key with the given index.
|
|
*
|
|
* # Errors
|
|
*
|
|
* If the index is not a soft derivation index (< 0x80000000) then
|
|
* calling this method will fail.
|
|
*
|
|
* # Security considerations
|
|
*
|
|
* * hard derivation index cannot be soft derived with the public key
|
|
*
|
|
* # Hard derivation vs Soft derivation
|
|
*
|
|
* If you pass an index below 0x80000000 then it is a soft derivation.
|
|
* The advantage of soft derivation is that it is possible to derive the
|
|
* public key too. I.e. derivation the private key with a soft derivation
|
|
* index and then retrieving the associated public key is equivalent to
|
|
* deriving the public key associated to the parent private key.
|
|
*
|
|
* Hard derivation index does not allow public key derivation.
|
|
*
|
|
* This is why deriving the private key should not fail while deriving
|
|
* the public key may fail (if the derivation index is invalid).
|
|
* @param {number} index
|
|
* @returns {Bip32PublicKey}
|
|
*/
|
|
derive(index) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32publickey_derive(retptr, this.__wbg_ptr, index);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Bip32PublicKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Bip32PublicKey = Bip32PublicKey;
|
|
|
|
const BlockFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_block_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Block {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Block.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
BlockFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
BlockFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_block_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.block_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Block}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.block_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Block.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.block_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Block}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.block_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Block.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.block_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.block_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Block}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.block_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Block.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Header}
|
|
*/
|
|
header() {
|
|
const ret = wasm.block_header(this.__wbg_ptr);
|
|
return Header.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionBodies}
|
|
*/
|
|
transaction_bodies() {
|
|
const ret = wasm.block_transaction_bodies(this.__wbg_ptr);
|
|
return TransactionBodies.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionWitnessSets}
|
|
*/
|
|
transaction_witness_sets() {
|
|
const ret = wasm.block_transaction_witness_sets(this.__wbg_ptr);
|
|
return TransactionWitnessSets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {AuxiliaryDataSet}
|
|
*/
|
|
auxiliary_data_set() {
|
|
const ret = wasm.block_auxiliary_data_set(this.__wbg_ptr);
|
|
return AuxiliaryDataSet.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint32Array}
|
|
*/
|
|
invalid_transactions() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.block_invalid_transactions(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Header} header
|
|
* @param {TransactionBodies} transaction_bodies
|
|
* @param {TransactionWitnessSets} transaction_witness_sets
|
|
* @param {AuxiliaryDataSet} auxiliary_data_set
|
|
* @param {Uint32Array} invalid_transactions
|
|
* @returns {Block}
|
|
*/
|
|
static new(header, transaction_bodies, transaction_witness_sets, auxiliary_data_set, invalid_transactions) {
|
|
_assertClass(header, Header);
|
|
_assertClass(transaction_bodies, TransactionBodies);
|
|
_assertClass(transaction_witness_sets, TransactionWitnessSets);
|
|
_assertClass(auxiliary_data_set, AuxiliaryDataSet);
|
|
const ptr0 = passArray32ToWasm0(invalid_transactions, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ret = wasm.block_new(header.__wbg_ptr, transaction_bodies.__wbg_ptr, transaction_witness_sets.__wbg_ptr, auxiliary_data_set.__wbg_ptr, ptr0, len0);
|
|
return Block.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Block = Block;
|
|
|
|
const BlockHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_blockhash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class BlockHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(BlockHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
BlockHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
BlockHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_blockhash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {BlockHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.blockhash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BlockHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {BlockHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.blockhash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BlockHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {BlockHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.blockhash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BlockHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.BlockHash = BlockHash;
|
|
|
|
const BootstrapWitnessFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_bootstrapwitness_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class BootstrapWitness {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(BootstrapWitness.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
BootstrapWitnessFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
BootstrapWitnessFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_bootstrapwitness_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitness_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {BootstrapWitness}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bootstrapwitness_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BootstrapWitness.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitness_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {BootstrapWitness}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bootstrapwitness_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BootstrapWitness.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitness_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitness_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {BootstrapWitness}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bootstrapwitness_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BootstrapWitness.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Vkey}
|
|
*/
|
|
vkey() {
|
|
const ret = wasm.bootstrapwitness_vkey(this.__wbg_ptr);
|
|
return Vkey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519Signature}
|
|
*/
|
|
signature() {
|
|
const ret = wasm.bootstrapwitness_signature(this.__wbg_ptr);
|
|
return Ed25519Signature.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
chain_code() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitness_chain_code(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
attributes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitness_attributes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Vkey} vkey
|
|
* @param {Ed25519Signature} signature
|
|
* @param {Uint8Array} chain_code
|
|
* @param {Uint8Array} attributes
|
|
* @returns {BootstrapWitness}
|
|
*/
|
|
static new(vkey, signature, chain_code, attributes) {
|
|
_assertClass(vkey, Vkey);
|
|
_assertClass(signature, Ed25519Signature);
|
|
const ptr0 = passArray8ToWasm0(chain_code, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passArray8ToWasm0(attributes, wasm.__wbindgen_malloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ret = wasm.bootstrapwitness_new(vkey.__wbg_ptr, signature.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
return BootstrapWitness.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.BootstrapWitness = BootstrapWitness;
|
|
|
|
const BootstrapWitnessesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_bootstrapwitnesses_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class BootstrapWitnesses {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(BootstrapWitnesses.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
BootstrapWitnessesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
BootstrapWitnessesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_bootstrapwitnesses_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitnesses_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {BootstrapWitnesses}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bootstrapwitnesses_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BootstrapWitnesses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitnesses_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {BootstrapWitnesses}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bootstrapwitnesses_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BootstrapWitnesses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitnesses_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitnesses_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {BootstrapWitnesses}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.bootstrapwitnesses_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BootstrapWitnesses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BootstrapWitnesses}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.bootstrapwitnesses_new();
|
|
return BootstrapWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.bootstrapwitnesses_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {BootstrapWitness}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.bootstrapwitnesses_get(this.__wbg_ptr, index);
|
|
return BootstrapWitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* Add a new `BootstrapWitness` to the set.
|
|
* Returns `true` if the element was not already present in the set.
|
|
* @param {BootstrapWitness} witness
|
|
* @returns {boolean}
|
|
*/
|
|
add(witness) {
|
|
_assertClass(witness, BootstrapWitness);
|
|
const ret = wasm.bootstrapwitnesses_add(this.__wbg_ptr, witness.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.BootstrapWitnesses = BootstrapWitnesses;
|
|
|
|
const ByronAddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_byronaddress_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ByronAddress {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ByronAddress.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ByronAddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ByronAddressFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_byronaddress_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_base58() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.byronaddress_to_base58(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.byronaddress_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ByronAddress}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.byronaddress_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ByronAddress.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* returns the byron protocol magic embedded in the address, or mainnet id if none is present
|
|
* note: for bech32 addresses, you need to use network_id instead
|
|
* @returns {number}
|
|
*/
|
|
byron_protocol_magic() {
|
|
const ret = wasm.byronaddress_byron_protocol_magic(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
attributes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.byronaddress_attributes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
network_id() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.byronaddress_network_id(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} s
|
|
* @returns {ByronAddress}
|
|
*/
|
|
static from_base58(s) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.byronaddress_from_base58(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ByronAddress.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Bip32PublicKey} key
|
|
* @param {number} protocol_magic
|
|
* @returns {ByronAddress}
|
|
*/
|
|
static icarus_from_key(key, protocol_magic) {
|
|
_assertClass(key, Bip32PublicKey);
|
|
const ret = wasm.byronaddress_icarus_from_key(key.__wbg_ptr, protocol_magic);
|
|
return ByronAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {string} s
|
|
* @returns {boolean}
|
|
*/
|
|
static is_valid(s) {
|
|
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ret = wasm.byronaddress_is_valid(ptr0, len0);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {Address}
|
|
*/
|
|
to_address() {
|
|
const ret = wasm.byronaddress_to_address(this.__wbg_ptr);
|
|
return Address.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Address} addr
|
|
* @returns {ByronAddress | undefined}
|
|
*/
|
|
static from_address(addr) {
|
|
_assertClass(addr, Address);
|
|
const ret = wasm.byronaddress_from_address(addr.__wbg_ptr);
|
|
return ret === 0 ? undefined : ByronAddress.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ByronAddress = ByronAddress;
|
|
|
|
const CertificateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_certificate_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Certificate {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Certificate.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CertificateFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CertificateFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_certificate_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.certificate_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Certificate}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.certificate_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Certificate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.certificate_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Certificate}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.certificate_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Certificate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.certificate_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.certificate_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Certificate}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.certificate_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Certificate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {StakeRegistration} stake_registration
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_stake_registration(stake_registration) {
|
|
_assertClass(stake_registration, StakeRegistration);
|
|
const ret = wasm.certificate_new_stake_registration(stake_registration.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* Since StakeRegistration can represent stake_registration certificate or reg_cert certificate, because both certificates have the same semantics.
|
|
* And in some cases you want to create a reg_cert, this function is used to create a reg_cert.
|
|
* The function will return an error if StakeRegistration represents a stake_registration certificate.
|
|
* @param {StakeRegistration} stake_registration
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_reg_cert(stake_registration) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(stake_registration, StakeRegistration);
|
|
wasm.certificate_new_reg_cert(retptr, stake_registration.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Certificate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {StakeDeregistration} stake_deregistration
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_stake_deregistration(stake_deregistration) {
|
|
_assertClass(stake_deregistration, StakeDeregistration);
|
|
const ret = wasm.certificate_new_stake_deregistration(stake_deregistration.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* Since StakeDeregistration can represent stake_deregistration certificate or unreg_cert certificate, because both certificates have the same semantics.
|
|
* And in some cases you want to create an unreg_cert, this function is used to create an unreg_cert.
|
|
* The function will return an error if StakeDeregistration represents a stake_deregistration certificate.
|
|
* @param {StakeDeregistration} stake_deregistration
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_unreg_cert(stake_deregistration) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(stake_deregistration, StakeDeregistration);
|
|
wasm.certificate_new_unreg_cert(retptr, stake_deregistration.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Certificate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {StakeDelegation} stake_delegation
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_stake_delegation(stake_delegation) {
|
|
_assertClass(stake_delegation, StakeDelegation);
|
|
const ret = wasm.certificate_new_stake_delegation(stake_delegation.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PoolRegistration} pool_registration
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_pool_registration(pool_registration) {
|
|
_assertClass(pool_registration, PoolRegistration);
|
|
const ret = wasm.certificate_new_pool_registration(pool_registration.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PoolRetirement} pool_retirement
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_pool_retirement(pool_retirement) {
|
|
_assertClass(pool_retirement, PoolRetirement);
|
|
const ret = wasm.certificate_new_pool_retirement(pool_retirement.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GenesisKeyDelegation} genesis_key_delegation
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_genesis_key_delegation(genesis_key_delegation) {
|
|
_assertClass(genesis_key_delegation, GenesisKeyDelegation);
|
|
const ret = wasm.certificate_new_genesis_key_delegation(genesis_key_delegation.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MoveInstantaneousRewardsCert} move_instantaneous_rewards_cert
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_move_instantaneous_rewards_cert(move_instantaneous_rewards_cert) {
|
|
_assertClass(move_instantaneous_rewards_cert, MoveInstantaneousRewardsCert);
|
|
const ret = wasm.certificate_new_move_instantaneous_rewards_cert(move_instantaneous_rewards_cert.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {CommitteeHotAuth} committee_hot_auth
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_committee_hot_auth(committee_hot_auth) {
|
|
_assertClass(committee_hot_auth, CommitteeHotAuth);
|
|
const ret = wasm.certificate_new_committee_hot_auth(committee_hot_auth.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {CommitteeColdResign} committee_cold_resign
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_committee_cold_resign(committee_cold_resign) {
|
|
_assertClass(committee_cold_resign, CommitteeColdResign);
|
|
const ret = wasm.certificate_new_committee_cold_resign(committee_cold_resign.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {DRepDeregistration} drep_deregistration
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_drep_deregistration(drep_deregistration) {
|
|
_assertClass(drep_deregistration, DRepDeregistration);
|
|
const ret = wasm.certificate_new_drep_deregistration(drep_deregistration.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {DRepRegistration} drep_registration
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_drep_registration(drep_registration) {
|
|
_assertClass(drep_registration, DRepRegistration);
|
|
const ret = wasm.certificate_new_drep_registration(drep_registration.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {DRepUpdate} drep_update
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_drep_update(drep_update) {
|
|
_assertClass(drep_update, DRepUpdate);
|
|
const ret = wasm.certificate_new_drep_update(drep_update.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {StakeAndVoteDelegation} stake_and_vote_delegation
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_stake_and_vote_delegation(stake_and_vote_delegation) {
|
|
_assertClass(stake_and_vote_delegation, StakeAndVoteDelegation);
|
|
const ret = wasm.certificate_new_stake_and_vote_delegation(stake_and_vote_delegation.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {StakeRegistrationAndDelegation} stake_registration_and_delegation
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_stake_registration_and_delegation(stake_registration_and_delegation) {
|
|
_assertClass(stake_registration_and_delegation, StakeRegistrationAndDelegation);
|
|
const ret = wasm.certificate_new_stake_registration_and_delegation(stake_registration_and_delegation.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {StakeVoteRegistrationAndDelegation} stake_vote_registration_and_delegation
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_stake_vote_registration_and_delegation(stake_vote_registration_and_delegation) {
|
|
_assertClass(stake_vote_registration_and_delegation, StakeVoteRegistrationAndDelegation);
|
|
const ret = wasm.certificate_new_stake_vote_registration_and_delegation(stake_vote_registration_and_delegation.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {VoteDelegation} vote_delegation
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_vote_delegation(vote_delegation) {
|
|
_assertClass(vote_delegation, VoteDelegation);
|
|
const ret = wasm.certificate_new_vote_delegation(vote_delegation.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {VoteRegistrationAndDelegation} vote_registration_and_delegation
|
|
* @returns {Certificate}
|
|
*/
|
|
static new_vote_registration_and_delegation(vote_registration_and_delegation) {
|
|
_assertClass(vote_registration_and_delegation, VoteRegistrationAndDelegation);
|
|
const ret = wasm.certificate_new_vote_registration_and_delegation(vote_registration_and_delegation.__wbg_ptr);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {CertificateKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.certificate_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {StakeRegistration | undefined}
|
|
*/
|
|
as_stake_registration() {
|
|
const ret = wasm.certificate_as_stake_registration(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : StakeRegistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* Since StakeRegistration can represent stake_registration certificate or reg_cert certificate, because both certificates have the same semantics.
|
|
* And in some cases you want to get a reg_cert, this function is used to get a reg_cert.
|
|
* The function will return None if StakeRegistration represents a stake_registration certificate or Certificate is not a StakeRegistration.
|
|
* @returns {StakeRegistration | undefined}
|
|
*/
|
|
as_reg_cert() {
|
|
const ret = wasm.certificate_as_reg_cert(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : StakeRegistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {StakeDeregistration | undefined}
|
|
*/
|
|
as_stake_deregistration() {
|
|
const ret = wasm.certificate_as_stake_deregistration(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : StakeDeregistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* Since StakeDeregistration can represent stake_deregistration certificate or unreg_cert certificate, because both certificates have the same semantics.
|
|
* And in some cases you want to get an unreg_cert, this function is used to get an unreg_cert.
|
|
* The function will return None if StakeDeregistration represents a stake_deregistration certificate or Certificate is not a StakeDeregistration.
|
|
* @returns {StakeDeregistration | undefined}
|
|
*/
|
|
as_unreg_cert() {
|
|
const ret = wasm.certificate_as_unreg_cert(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : StakeDeregistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {StakeDelegation | undefined}
|
|
*/
|
|
as_stake_delegation() {
|
|
const ret = wasm.certificate_as_stake_delegation(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : StakeDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PoolRegistration | undefined}
|
|
*/
|
|
as_pool_registration() {
|
|
const ret = wasm.certificate_as_pool_registration(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PoolRegistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PoolRetirement | undefined}
|
|
*/
|
|
as_pool_retirement() {
|
|
const ret = wasm.certificate_as_pool_retirement(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PoolRetirement.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {GenesisKeyDelegation | undefined}
|
|
*/
|
|
as_genesis_key_delegation() {
|
|
const ret = wasm.certificate_as_genesis_key_delegation(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : GenesisKeyDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {MoveInstantaneousRewardsCert | undefined}
|
|
*/
|
|
as_move_instantaneous_rewards_cert() {
|
|
const ret = wasm.certificate_as_move_instantaneous_rewards_cert(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : MoveInstantaneousRewardsCert.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {CommitteeHotAuth | undefined}
|
|
*/
|
|
as_committee_hot_auth() {
|
|
const ret = wasm.certificate_as_committee_hot_auth(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : CommitteeHotAuth.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {CommitteeColdResign | undefined}
|
|
*/
|
|
as_committee_cold_resign() {
|
|
const ret = wasm.certificate_as_committee_cold_resign(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : CommitteeColdResign.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRepDeregistration | undefined}
|
|
*/
|
|
as_drep_deregistration() {
|
|
const ret = wasm.certificate_as_drep_deregistration(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : DRepDeregistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRepRegistration | undefined}
|
|
*/
|
|
as_drep_registration() {
|
|
const ret = wasm.certificate_as_drep_registration(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : DRepRegistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRepUpdate | undefined}
|
|
*/
|
|
as_drep_update() {
|
|
const ret = wasm.certificate_as_drep_update(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : DRepUpdate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {StakeAndVoteDelegation | undefined}
|
|
*/
|
|
as_stake_and_vote_delegation() {
|
|
const ret = wasm.certificate_as_stake_and_vote_delegation(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : StakeAndVoteDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {StakeRegistrationAndDelegation | undefined}
|
|
*/
|
|
as_stake_registration_and_delegation() {
|
|
const ret = wasm.certificate_as_stake_registration_and_delegation(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : StakeRegistrationAndDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {StakeVoteRegistrationAndDelegation | undefined}
|
|
*/
|
|
as_stake_vote_registration_and_delegation() {
|
|
const ret = wasm.certificate_as_stake_vote_registration_and_delegation(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : StakeVoteRegistrationAndDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {VoteDelegation | undefined}
|
|
*/
|
|
as_vote_delegation() {
|
|
const ret = wasm.certificate_as_vote_delegation(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : VoteDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {VoteRegistrationAndDelegation | undefined}
|
|
*/
|
|
as_vote_registration_and_delegation() {
|
|
const ret = wasm.certificate_as_vote_registration_and_delegation(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : VoteRegistrationAndDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_required_script_witness() {
|
|
const ret = wasm.certificate_has_required_script_witness(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.Certificate = Certificate;
|
|
|
|
const CertificatesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_certificates_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Certificates {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Certificates.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CertificatesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CertificatesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_certificates_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.certificates_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Certificates}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.certificates_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Certificates.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.certificates_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Certificates}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.certificates_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Certificates.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.certificates_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.certificates_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Certificates}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.certificates_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Certificates.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Certificates}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.certificates_new();
|
|
return Certificates.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.certificates_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Certificate}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.certificates_get(this.__wbg_ptr, index);
|
|
return Certificate.__wrap(ret);
|
|
}
|
|
/**
|
|
* Add a new `Certificate` to the set.
|
|
* Returns `true` if the element was not already present in the set.
|
|
* @param {Certificate} elem
|
|
* @returns {boolean}
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, Certificate);
|
|
const ret = wasm.certificates_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.Certificates = Certificates;
|
|
|
|
const CertificatesBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_certificatesbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class CertificatesBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(CertificatesBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CertificatesBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CertificatesBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_certificatesbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {CertificatesBuilder}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.certificatesbuilder_new();
|
|
return CertificatesBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Certificate} cert
|
|
*/
|
|
add(cert) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(cert, Certificate);
|
|
wasm.certificatesbuilder_add(retptr, this.__wbg_ptr, cert.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Certificate} cert
|
|
* @param {PlutusWitness} witness
|
|
*/
|
|
add_with_plutus_witness(cert, witness) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(cert, Certificate);
|
|
_assertClass(witness, PlutusWitness);
|
|
wasm.certificatesbuilder_add_with_plutus_witness(retptr, this.__wbg_ptr, cert.__wbg_ptr, witness.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Certificate} cert
|
|
* @param {NativeScriptSource} native_script_source
|
|
*/
|
|
add_with_native_script(cert, native_script_source) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(cert, Certificate);
|
|
_assertClass(native_script_source, NativeScriptSource);
|
|
wasm.certificatesbuilder_add_with_native_script(retptr, this.__wbg_ptr, cert.__wbg_ptr, native_script_source.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PlutusWitnesses}
|
|
*/
|
|
get_plutus_witnesses() {
|
|
const ret = wasm.certificatesbuilder_get_plutus_witnesses(this.__wbg_ptr);
|
|
return PlutusWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
get_ref_inputs() {
|
|
const ret = wasm.certificatesbuilder_get_ref_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NativeScripts}
|
|
*/
|
|
get_native_scripts() {
|
|
const ret = wasm.certificatesbuilder_get_native_scripts(this.__wbg_ptr);
|
|
return NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} pool_deposit
|
|
* @param {BigNum} key_deposit
|
|
* @returns {Value}
|
|
*/
|
|
get_certificates_refund(pool_deposit, key_deposit) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(pool_deposit, BigNum);
|
|
_assertClass(key_deposit, BigNum);
|
|
wasm.certificatesbuilder_get_certificates_refund(retptr, this.__wbg_ptr, pool_deposit.__wbg_ptr, key_deposit.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} pool_deposit
|
|
* @param {BigNum} key_deposit
|
|
* @returns {BigNum}
|
|
*/
|
|
get_certificates_deposit(pool_deposit, key_deposit) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(pool_deposit, BigNum);
|
|
_assertClass(key_deposit, BigNum);
|
|
wasm.certificatesbuilder_get_certificates_deposit(retptr, this.__wbg_ptr, pool_deposit.__wbg_ptr, key_deposit.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_plutus_scripts() {
|
|
const ret = wasm.certificatesbuilder_has_plutus_scripts(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {Certificates}
|
|
*/
|
|
build() {
|
|
const ret = wasm.certificatesbuilder_build(this.__wbg_ptr);
|
|
return Certificates.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.CertificatesBuilder = CertificatesBuilder;
|
|
|
|
const ChangeConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_changeconfig_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ChangeConfig {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ChangeConfig.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ChangeConfigFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ChangeConfigFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_changeconfig_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Address} address
|
|
* @returns {ChangeConfig}
|
|
*/
|
|
static new(address) {
|
|
_assertClass(address, Address);
|
|
const ret = wasm.changeconfig_new(address.__wbg_ptr);
|
|
return ChangeConfig.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Address} address
|
|
* @returns {ChangeConfig}
|
|
*/
|
|
change_address(address) {
|
|
_assertClass(address, Address);
|
|
const ret = wasm.changeconfig_change_address(this.__wbg_ptr, address.__wbg_ptr);
|
|
return ChangeConfig.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {OutputDatum} plutus_data
|
|
* @returns {ChangeConfig}
|
|
*/
|
|
change_plutus_data(plutus_data) {
|
|
_assertClass(plutus_data, OutputDatum);
|
|
const ret = wasm.changeconfig_change_plutus_data(this.__wbg_ptr, plutus_data.__wbg_ptr);
|
|
return ChangeConfig.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptRef} script_ref
|
|
* @returns {ChangeConfig}
|
|
*/
|
|
change_script_ref(script_ref) {
|
|
_assertClass(script_ref, ScriptRef);
|
|
const ret = wasm.changeconfig_change_script_ref(this.__wbg_ptr, script_ref.__wbg_ptr);
|
|
return ChangeConfig.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ChangeConfig = ChangeConfig;
|
|
|
|
const CommitteeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_committee_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Committee {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Committee.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CommitteeFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CommitteeFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_committee_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committee_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Committee}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committee_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Committee.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committee_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Committee}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committee_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Committee.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committee_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committee_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Committee}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committee_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Committee.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {UnitInterval} quorum_threshold
|
|
* @returns {Committee}
|
|
*/
|
|
static new(quorum_threshold) {
|
|
_assertClass(quorum_threshold, UnitInterval);
|
|
const ret = wasm.committee_new(quorum_threshold.__wbg_ptr);
|
|
return Committee.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credentials}
|
|
*/
|
|
members_keys() {
|
|
const ret = wasm.committee_members_keys(this.__wbg_ptr);
|
|
return Credentials.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
quorum_threshold() {
|
|
const ret = wasm.committee_quorum_threshold(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} committee_cold_credential
|
|
* @param {number} epoch
|
|
*/
|
|
add_member(committee_cold_credential, epoch) {
|
|
_assertClass(committee_cold_credential, Credential);
|
|
wasm.committee_add_member(this.__wbg_ptr, committee_cold_credential.__wbg_ptr, epoch);
|
|
}
|
|
/**
|
|
* @param {Credential} committee_cold_credential
|
|
* @returns {number | undefined}
|
|
*/
|
|
get_member_epoch(committee_cold_credential) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(committee_cold_credential, Credential);
|
|
wasm.committee_get_member_epoch(retptr, this.__wbg_ptr, committee_cold_credential.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Committee = Committee;
|
|
|
|
const CommitteeColdResignFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_committeecoldresign_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class CommitteeColdResign {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(CommitteeColdResign.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CommitteeColdResignFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CommitteeColdResignFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_committeecoldresign_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committeecoldresign_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {CommitteeColdResign}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committeecoldresign_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CommitteeColdResign.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committeecoldresign_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {CommitteeColdResign}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committeecoldresign_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CommitteeColdResign.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committeecoldresign_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committeecoldresign_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {CommitteeColdResign}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committeecoldresign_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CommitteeColdResign.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
committee_cold_credential() {
|
|
const ret = wasm.committeecoldresign_committee_cold_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Anchor | undefined}
|
|
*/
|
|
anchor() {
|
|
const ret = wasm.committeecoldresign_anchor(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Anchor.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} committee_cold_credential
|
|
* @returns {CommitteeColdResign}
|
|
*/
|
|
static new(committee_cold_credential) {
|
|
_assertClass(committee_cold_credential, Credential);
|
|
const ret = wasm.committeecoldresign_new(committee_cold_credential.__wbg_ptr);
|
|
return CommitteeColdResign.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} committee_cold_credential
|
|
* @param {Anchor} anchor
|
|
* @returns {CommitteeColdResign}
|
|
*/
|
|
static new_with_anchor(committee_cold_credential, anchor) {
|
|
_assertClass(committee_cold_credential, Credential);
|
|
_assertClass(anchor, Anchor);
|
|
const ret = wasm.committeecoldresign_new_with_anchor(committee_cold_credential.__wbg_ptr, anchor.__wbg_ptr);
|
|
return CommitteeColdResign.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.committeecoldresign_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.CommitteeColdResign = CommitteeColdResign;
|
|
|
|
const CommitteeHotAuthFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_committeehotauth_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class CommitteeHotAuth {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(CommitteeHotAuth.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CommitteeHotAuthFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CommitteeHotAuthFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_committeehotauth_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committeehotauth_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {CommitteeHotAuth}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committeehotauth_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CommitteeHotAuth.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committeehotauth_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {CommitteeHotAuth}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committeehotauth_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CommitteeHotAuth.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committeehotauth_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.committeehotauth_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {CommitteeHotAuth}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.committeehotauth_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CommitteeHotAuth.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
committee_cold_credential() {
|
|
const ret = wasm.committeehotauth_committee_cold_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
committee_hot_credential() {
|
|
const ret = wasm.committeehotauth_committee_hot_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} committee_cold_credential
|
|
* @param {Credential} committee_hot_credential
|
|
* @returns {CommitteeHotAuth}
|
|
*/
|
|
static new(committee_cold_credential, committee_hot_credential) {
|
|
_assertClass(committee_cold_credential, Credential);
|
|
_assertClass(committee_hot_credential, Credential);
|
|
const ret = wasm.committeehotauth_new(committee_cold_credential.__wbg_ptr, committee_hot_credential.__wbg_ptr);
|
|
return CommitteeHotAuth.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.committeehotauth_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.CommitteeHotAuth = CommitteeHotAuth;
|
|
|
|
const ConstitutionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_constitution_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Constitution {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Constitution.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ConstitutionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ConstitutionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_constitution_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.constitution_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Constitution}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.constitution_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Constitution.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.constitution_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Constitution}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.constitution_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Constitution.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.constitution_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.constitution_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Constitution}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.constitution_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Constitution.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Anchor}
|
|
*/
|
|
anchor() {
|
|
const ret = wasm.constitution_anchor(this.__wbg_ptr);
|
|
return Anchor.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptHash | undefined}
|
|
*/
|
|
script_hash() {
|
|
const ret = wasm.constitution_script_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Anchor} anchor
|
|
* @returns {Constitution}
|
|
*/
|
|
static new(anchor) {
|
|
_assertClass(anchor, Anchor);
|
|
const ret = wasm.constitution_new(anchor.__wbg_ptr);
|
|
return Constitution.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Anchor} anchor
|
|
* @param {ScriptHash} script_hash
|
|
* @returns {Constitution}
|
|
*/
|
|
static new_with_script_hash(anchor, script_hash) {
|
|
_assertClass(anchor, Anchor);
|
|
_assertClass(script_hash, ScriptHash);
|
|
const ret = wasm.constitution_new_with_script_hash(anchor.__wbg_ptr, script_hash.__wbg_ptr);
|
|
return Constitution.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Constitution = Constitution;
|
|
|
|
const ConstrPlutusDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_constrplutusdata_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ConstrPlutusData {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ConstrPlutusData.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ConstrPlutusDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ConstrPlutusDataFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_constrplutusdata_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.constrplutusdata_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ConstrPlutusData}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.constrplutusdata_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ConstrPlutusData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.constrplutusdata_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ConstrPlutusData}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.constrplutusdata_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ConstrPlutusData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
alternative() {
|
|
const ret = wasm.constrplutusdata_alternative(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusList}
|
|
*/
|
|
data() {
|
|
const ret = wasm.constrplutusdata_data(this.__wbg_ptr);
|
|
return PlutusList.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} alternative
|
|
* @param {PlutusList} data
|
|
* @returns {ConstrPlutusData}
|
|
*/
|
|
static new(alternative, data) {
|
|
_assertClass(alternative, BigNum);
|
|
_assertClass(data, PlutusList);
|
|
const ret = wasm.constrplutusdata_new(alternative.__wbg_ptr, data.__wbg_ptr);
|
|
return ConstrPlutusData.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ConstrPlutusData = ConstrPlutusData;
|
|
|
|
const CostModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_costmodel_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class CostModel {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(CostModel.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CostModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CostModelFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_costmodel_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmodel_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {CostModel}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.costmodel_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CostModel.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmodel_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {CostModel}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.costmodel_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CostModel.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmodel_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmodel_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {CostModel}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.costmodel_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return CostModel.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Creates a new CostModels instance of an unrestricted length
|
|
* @returns {CostModel}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.costmodel_new();
|
|
return CostModel.__wrap(ret);
|
|
}
|
|
/**
|
|
* Sets the cost at the specified index to the specified value.
|
|
* In case the operation index is larger than the previous largest used index,
|
|
* it will fill any inbetween indexes with zeroes
|
|
* @param {number} operation
|
|
* @param {Int} cost
|
|
* @returns {Int}
|
|
*/
|
|
set(operation, cost) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(cost, Int);
|
|
wasm.costmodel_set(retptr, this.__wbg_ptr, operation, cost.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Int.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} operation
|
|
* @returns {Int}
|
|
*/
|
|
get(operation) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmodel_get(retptr, this.__wbg_ptr, operation);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Int.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.costmodel_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
}
|
|
module.exports.CostModel = CostModel;
|
|
|
|
const CostmdlsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_costmdls_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Costmdls {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Costmdls.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CostmdlsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CostmdlsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_costmdls_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmdls_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Costmdls}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.costmdls_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Costmdls.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmdls_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Costmdls}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.costmdls_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Costmdls.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmdls_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.costmdls_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Costmdls}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.costmdls_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Costmdls.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Costmdls}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.costmdls_new();
|
|
return Costmdls.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.costmdls_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {Language} key
|
|
* @param {CostModel} value
|
|
* @returns {CostModel | undefined}
|
|
*/
|
|
insert(key, value) {
|
|
_assertClass(key, Language);
|
|
_assertClass(value, CostModel);
|
|
const ret = wasm.costmdls_insert(this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : CostModel.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Language} key
|
|
* @returns {CostModel | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, Language);
|
|
const ret = wasm.costmdls_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : CostModel.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Languages}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.costmdls_keys(this.__wbg_ptr);
|
|
return Languages.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Languages} languages
|
|
* @returns {Costmdls}
|
|
*/
|
|
retain_language_versions(languages) {
|
|
_assertClass(languages, Languages);
|
|
const ret = wasm.costmdls_retain_language_versions(this.__wbg_ptr, languages.__wbg_ptr);
|
|
return Costmdls.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Costmdls = Costmdls;
|
|
|
|
const CredentialFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_credential_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Credential {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Credential.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CredentialFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CredentialFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_credential_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} hash
|
|
* @returns {Credential}
|
|
*/
|
|
static from_keyhash(hash) {
|
|
_assertClass(hash, Ed25519KeyHash);
|
|
const ret = wasm.credential_from_keyhash(hash.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptHash} hash
|
|
* @returns {Credential}
|
|
*/
|
|
static from_scripthash(hash) {
|
|
_assertClass(hash, ScriptHash);
|
|
const ret = wasm.credential_from_scripthash(hash.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash | undefined}
|
|
*/
|
|
to_keyhash() {
|
|
const ret = wasm.credential_to_keyhash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptHash | undefined}
|
|
*/
|
|
to_scripthash() {
|
|
const ret = wasm.credential_to_scripthash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {CredKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.credential_has_script_hash(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_hash() {
|
|
const ret = wasm.credential_has_script_hash(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.credential_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Credential}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.credential_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Credential.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.credential_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Credential}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.credential_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Credential.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.credential_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.credential_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Credential}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.credential_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Credential.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Credential = Credential;
|
|
|
|
const CredentialsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_credentials_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Credentials {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Credentials.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
CredentialsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
CredentialsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_credentials_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.credentials_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Credentials}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.credentials_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Credentials.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.credentials_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Credentials}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.credentials_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Credentials.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.credentials_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.credentials_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Credentials}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.credentials_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Credentials.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credentials}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.credentials_new();
|
|
return Credentials.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.credentials_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Credential}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.credentials_get(this.__wbg_ptr, index);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* Add a new `Credential` to the set.
|
|
* Returns `true` if the element was not already present in the set.
|
|
* @param {Credential} credential
|
|
* @returns {boolean}
|
|
*/
|
|
add(credential) {
|
|
_assertClass(credential, Credential);
|
|
const ret = wasm.credentials_add(this.__wbg_ptr, credential.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.Credentials = Credentials;
|
|
|
|
const DNSRecordAorAAAAFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_dnsrecordaoraaaa_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DNSRecordAorAAAA {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DNSRecordAorAAAA.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DNSRecordAorAAAAFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DNSRecordAorAAAAFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_dnsrecordaoraaaa_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {DNSRecordAorAAAA}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.dnsrecordaoraaaa_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DNSRecordAorAAAA.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {DNSRecordAorAAAA}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.dnsrecordaoraaaa_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DNSRecordAorAAAA.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {DNSRecordAorAAAA}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.dnsrecordaoraaaa_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DNSRecordAorAAAA.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} dns_name
|
|
* @returns {DNSRecordAorAAAA}
|
|
*/
|
|
static new(dns_name) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(dns_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.dnsrecordaoraaaa_new(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DNSRecordAorAAAA.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
record() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_record(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
}
|
|
module.exports.DNSRecordAorAAAA = DNSRecordAorAAAA;
|
|
|
|
const DNSRecordSRVFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_dnsrecordsrv_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DNSRecordSRV {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DNSRecordSRV.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DNSRecordSRVFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DNSRecordSRVFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_dnsrecordsrv_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordsrv_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {DNSRecordSRV}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.dnsrecordsrv_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DNSRecordSRV.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordsrv_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {DNSRecordSRV}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.dnsrecordsrv_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DNSRecordSRV.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {DNSRecordSRV}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.dnsrecordsrv_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DNSRecordSRV.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} dns_name
|
|
* @returns {DNSRecordSRV}
|
|
*/
|
|
static new(dns_name) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(dns_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.dnsrecordsrv_new(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DNSRecordSRV.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
record() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_record(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
}
|
|
module.exports.DNSRecordSRV = DNSRecordSRV;
|
|
|
|
const DRepFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_drep_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DRep {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DRep.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DRepFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DRepFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_drep_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drep_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {DRep}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drep_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRep.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drep_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {DRep}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drep_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRep.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drep_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drep_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {DRep}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drep_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRep.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} key_hash
|
|
* @returns {DRep}
|
|
*/
|
|
static new_key_hash(key_hash) {
|
|
_assertClass(key_hash, Ed25519KeyHash);
|
|
const ret = wasm.credential_from_keyhash(key_hash.__wbg_ptr);
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptHash} script_hash
|
|
* @returns {DRep}
|
|
*/
|
|
static new_script_hash(script_hash) {
|
|
_assertClass(script_hash, ScriptHash);
|
|
const ret = wasm.credential_from_scripthash(script_hash.__wbg_ptr);
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRep}
|
|
*/
|
|
static new_always_abstain() {
|
|
const ret = wasm.drep_new_always_abstain();
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRep}
|
|
*/
|
|
static new_always_no_confidence() {
|
|
const ret = wasm.drep_new_always_no_confidence();
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} cred
|
|
* @returns {DRep}
|
|
*/
|
|
static new_from_credential(cred) {
|
|
_assertClass(cred, Credential);
|
|
const ret = wasm.drep_new_from_credential(cred.__wbg_ptr);
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRepKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.drep_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash | undefined}
|
|
*/
|
|
to_key_hash() {
|
|
const ret = wasm.drep_to_key_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptHash | undefined}
|
|
*/
|
|
to_script_hash() {
|
|
const ret = wasm.drep_to_script_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_bech32() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drep_to_bech32(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech32_str
|
|
* @returns {DRep}
|
|
*/
|
|
static from_bech32(bech32_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech32_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drep_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRep.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.DRep = DRep;
|
|
|
|
const DRepDeregistrationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_drepderegistration_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DRepDeregistration {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DRepDeregistration.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DRepDeregistrationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DRepDeregistrationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_drepderegistration_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepderegistration_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {DRepDeregistration}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepderegistration_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepDeregistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepderegistration_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {DRepDeregistration}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepderegistration_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepDeregistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepderegistration_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepderegistration_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {DRepDeregistration}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepderegistration_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepDeregistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
voting_credential() {
|
|
const ret = wasm.drepderegistration_voting_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
coin() {
|
|
const ret = wasm.drepderegistration_coin(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} voting_credential
|
|
* @param {BigNum} coin
|
|
* @returns {DRepDeregistration}
|
|
*/
|
|
static new(voting_credential, coin) {
|
|
_assertClass(voting_credential, Credential);
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.drepderegistration_new(voting_credential.__wbg_ptr, coin.__wbg_ptr);
|
|
return DRepDeregistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.drepderegistration_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.DRepDeregistration = DRepDeregistration;
|
|
|
|
const DRepRegistrationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_drepregistration_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DRepRegistration {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DRepRegistration.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DRepRegistrationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DRepRegistrationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_drepregistration_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepregistration_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {DRepRegistration}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepregistration_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepregistration_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {DRepRegistration}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepregistration_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepregistration_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepregistration_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {DRepRegistration}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepregistration_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
voting_credential() {
|
|
const ret = wasm.drepregistration_voting_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
coin() {
|
|
const ret = wasm.drepregistration_coin(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Anchor | undefined}
|
|
*/
|
|
anchor() {
|
|
const ret = wasm.drepregistration_anchor(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Anchor.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} voting_credential
|
|
* @param {BigNum} coin
|
|
* @returns {DRepRegistration}
|
|
*/
|
|
static new(voting_credential, coin) {
|
|
_assertClass(voting_credential, Credential);
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.drepregistration_new(voting_credential.__wbg_ptr, coin.__wbg_ptr);
|
|
return DRepRegistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} voting_credential
|
|
* @param {BigNum} coin
|
|
* @param {Anchor} anchor
|
|
* @returns {DRepRegistration}
|
|
*/
|
|
static new_with_anchor(voting_credential, coin, anchor) {
|
|
_assertClass(voting_credential, Credential);
|
|
_assertClass(coin, BigNum);
|
|
_assertClass(anchor, Anchor);
|
|
const ret = wasm.drepregistration_new_with_anchor(voting_credential.__wbg_ptr, coin.__wbg_ptr, anchor.__wbg_ptr);
|
|
return DRepRegistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.drepregistration_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.DRepRegistration = DRepRegistration;
|
|
|
|
const DRepUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_drepupdate_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DRepUpdate {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DRepUpdate.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DRepUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DRepUpdateFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_drepupdate_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepupdate_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {DRepUpdate}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepupdate_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepUpdate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepupdate_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {DRepUpdate}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepupdate_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepUpdate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepupdate_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepupdate_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {DRepUpdate}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepupdate_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepUpdate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
voting_credential() {
|
|
const ret = wasm.drepupdate_voting_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Anchor | undefined}
|
|
*/
|
|
anchor() {
|
|
const ret = wasm.drepupdate_anchor(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Anchor.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} voting_credential
|
|
* @returns {DRepUpdate}
|
|
*/
|
|
static new(voting_credential) {
|
|
_assertClass(voting_credential, Credential);
|
|
const ret = wasm.drepupdate_new(voting_credential.__wbg_ptr);
|
|
return DRepUpdate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} voting_credential
|
|
* @param {Anchor} anchor
|
|
* @returns {DRepUpdate}
|
|
*/
|
|
static new_with_anchor(voting_credential, anchor) {
|
|
_assertClass(voting_credential, Credential);
|
|
_assertClass(anchor, Anchor);
|
|
const ret = wasm.drepupdate_new_with_anchor(voting_credential.__wbg_ptr, anchor.__wbg_ptr);
|
|
return DRepUpdate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.drepupdate_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.DRepUpdate = DRepUpdate;
|
|
|
|
const DRepVotingThresholdsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_drepvotingthresholds_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DRepVotingThresholds {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DRepVotingThresholds.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DRepVotingThresholdsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DRepVotingThresholdsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_drepvotingthresholds_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepvotingthresholds_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {DRepVotingThresholds}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepvotingthresholds_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepVotingThresholds.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepvotingthresholds_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {DRepVotingThresholds}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepvotingthresholds_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepVotingThresholds.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepvotingthresholds_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.drepvotingthresholds_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {DRepVotingThresholds}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.drepvotingthresholds_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DRepVotingThresholds.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {UnitInterval} motion_no_confidence
|
|
* @param {UnitInterval} committee_normal
|
|
* @param {UnitInterval} committee_no_confidence
|
|
* @param {UnitInterval} update_constitution
|
|
* @param {UnitInterval} hard_fork_initiation
|
|
* @param {UnitInterval} pp_network_group
|
|
* @param {UnitInterval} pp_economic_group
|
|
* @param {UnitInterval} pp_technical_group
|
|
* @param {UnitInterval} pp_governance_group
|
|
* @param {UnitInterval} treasury_withdrawal
|
|
* @returns {DRepVotingThresholds}
|
|
*/
|
|
static new(motion_no_confidence, committee_normal, committee_no_confidence, update_constitution, hard_fork_initiation, pp_network_group, pp_economic_group, pp_technical_group, pp_governance_group, treasury_withdrawal) {
|
|
_assertClass(motion_no_confidence, UnitInterval);
|
|
_assertClass(committee_normal, UnitInterval);
|
|
_assertClass(committee_no_confidence, UnitInterval);
|
|
_assertClass(update_constitution, UnitInterval);
|
|
_assertClass(hard_fork_initiation, UnitInterval);
|
|
_assertClass(pp_network_group, UnitInterval);
|
|
_assertClass(pp_economic_group, UnitInterval);
|
|
_assertClass(pp_technical_group, UnitInterval);
|
|
_assertClass(pp_governance_group, UnitInterval);
|
|
_assertClass(treasury_withdrawal, UnitInterval);
|
|
const ret = wasm.drepvotingthresholds_new(motion_no_confidence.__wbg_ptr, committee_normal.__wbg_ptr, committee_no_confidence.__wbg_ptr, update_constitution.__wbg_ptr, hard_fork_initiation.__wbg_ptr, pp_network_group.__wbg_ptr, pp_economic_group.__wbg_ptr, pp_technical_group.__wbg_ptr, pp_governance_group.__wbg_ptr, treasury_withdrawal.__wbg_ptr);
|
|
return DRepVotingThresholds.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} motion_no_confidence
|
|
*/
|
|
set_motion_no_confidence(motion_no_confidence) {
|
|
_assertClass(motion_no_confidence, UnitInterval);
|
|
wasm.drepvotingthresholds_set_motion_no_confidence(this.__wbg_ptr, motion_no_confidence.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} committee_normal
|
|
*/
|
|
set_committee_normal(committee_normal) {
|
|
_assertClass(committee_normal, UnitInterval);
|
|
wasm.drepvotingthresholds_set_committee_normal(this.__wbg_ptr, committee_normal.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} committee_no_confidence
|
|
*/
|
|
set_committee_no_confidence(committee_no_confidence) {
|
|
_assertClass(committee_no_confidence, UnitInterval);
|
|
wasm.drepvotingthresholds_set_committee_no_confidence(this.__wbg_ptr, committee_no_confidence.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} update_constitution
|
|
*/
|
|
set_update_constitution(update_constitution) {
|
|
_assertClass(update_constitution, UnitInterval);
|
|
wasm.drepvotingthresholds_set_update_constitution(this.__wbg_ptr, update_constitution.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} hard_fork_initiation
|
|
*/
|
|
set_hard_fork_initiation(hard_fork_initiation) {
|
|
_assertClass(hard_fork_initiation, UnitInterval);
|
|
wasm.drepvotingthresholds_set_hard_fork_initiation(this.__wbg_ptr, hard_fork_initiation.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} pp_network_group
|
|
*/
|
|
set_pp_network_group(pp_network_group) {
|
|
_assertClass(pp_network_group, UnitInterval);
|
|
wasm.drepvotingthresholds_set_pp_network_group(this.__wbg_ptr, pp_network_group.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} pp_economic_group
|
|
*/
|
|
set_pp_economic_group(pp_economic_group) {
|
|
_assertClass(pp_economic_group, UnitInterval);
|
|
wasm.drepvotingthresholds_set_pp_economic_group(this.__wbg_ptr, pp_economic_group.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} pp_technical_group
|
|
*/
|
|
set_pp_technical_group(pp_technical_group) {
|
|
_assertClass(pp_technical_group, UnitInterval);
|
|
wasm.drepvotingthresholds_set_pp_technical_group(this.__wbg_ptr, pp_technical_group.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} pp_governance_group
|
|
*/
|
|
set_pp_governance_group(pp_governance_group) {
|
|
_assertClass(pp_governance_group, UnitInterval);
|
|
wasm.drepvotingthresholds_set_pp_governance_group(this.__wbg_ptr, pp_governance_group.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} treasury_withdrawal
|
|
*/
|
|
set_treasury_withdrawal(treasury_withdrawal) {
|
|
_assertClass(treasury_withdrawal, UnitInterval);
|
|
wasm.drepvotingthresholds_set_treasury_withdrawal(this.__wbg_ptr, treasury_withdrawal.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
motion_no_confidence() {
|
|
const ret = wasm.committee_quorum_threshold(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
committee_normal() {
|
|
const ret = wasm.drepvotingthresholds_committee_normal(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
committee_no_confidence() {
|
|
const ret = wasm.drepvotingthresholds_committee_no_confidence(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
update_constitution() {
|
|
const ret = wasm.drepvotingthresholds_update_constitution(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
hard_fork_initiation() {
|
|
const ret = wasm.drepvotingthresholds_hard_fork_initiation(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
pp_network_group() {
|
|
const ret = wasm.drepvotingthresholds_pp_network_group(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
pp_economic_group() {
|
|
const ret = wasm.drepvotingthresholds_pp_economic_group(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
pp_technical_group() {
|
|
const ret = wasm.drepvotingthresholds_pp_technical_group(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
pp_governance_group() {
|
|
const ret = wasm.drepvotingthresholds_pp_governance_group(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
treasury_withdrawal() {
|
|
const ret = wasm.drepvotingthresholds_treasury_withdrawal(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.DRepVotingThresholds = DRepVotingThresholds;
|
|
|
|
const DataCostFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_datacost_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DataCost {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DataCost.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DataCostFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DataCostFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_datacost_free(ptr);
|
|
}
|
|
/**
|
|
* @param {BigNum} coins_per_byte
|
|
* @returns {DataCost}
|
|
*/
|
|
static new_coins_per_byte(coins_per_byte) {
|
|
_assertClass(coins_per_byte, BigNum);
|
|
const ret = wasm.datacost_new_coins_per_byte(coins_per_byte.__wbg_ptr);
|
|
return DataCost.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
coins_per_byte() {
|
|
const ret = wasm.datacost_coins_per_byte(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.DataCost = DataCost;
|
|
|
|
const DataHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_datahash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DataHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DataHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DataHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DataHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_datahash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {DataHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.datahash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {DataHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.datahash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {DataHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.datahash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return DataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.DataHash = DataHash;
|
|
|
|
const DatumSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_datumsource_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class DatumSource {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(DatumSource.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
DatumSourceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
DatumSourceFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_datumsource_free(ptr);
|
|
}
|
|
/**
|
|
* @param {PlutusData} datum
|
|
* @returns {DatumSource}
|
|
*/
|
|
static new(datum) {
|
|
_assertClass(datum, PlutusData);
|
|
const ret = wasm.datumsource_new(datum.__wbg_ptr);
|
|
return DatumSource.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionInput} input
|
|
* @returns {DatumSource}
|
|
*/
|
|
static new_ref_input(input) {
|
|
_assertClass(input, TransactionInput);
|
|
const ret = wasm.datumsource_new_ref_input(input.__wbg_ptr);
|
|
return DatumSource.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.DatumSource = DatumSource;
|
|
|
|
const Ed25519KeyHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_ed25519keyhash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Ed25519KeyHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Ed25519KeyHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
Ed25519KeyHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
Ed25519KeyHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_ed25519keyhash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519KeyHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519KeyHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519KeyHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Ed25519KeyHash = Ed25519KeyHash;
|
|
|
|
const Ed25519KeyHashesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_ed25519keyhashes_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Ed25519KeyHashes {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Ed25519KeyHashes.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
Ed25519KeyHashesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
Ed25519KeyHashesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_ed25519keyhashes_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhashes_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Ed25519KeyHashes}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhashes_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519KeyHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhashes_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Ed25519KeyHashes}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhashes_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519KeyHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhashes_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhashes_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Ed25519KeyHashes}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhashes_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519KeyHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHashes}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.credentials_new();
|
|
return Ed25519KeyHashes.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.credentials_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.ed25519keyhashes_get(this.__wbg_ptr, index);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* Add a new `Ed25519KeyHash` to the set.
|
|
* Returns `true` if the element was not already present in the set.
|
|
* @param {Ed25519KeyHash} keyhash
|
|
* @returns {boolean}
|
|
*/
|
|
add(keyhash) {
|
|
_assertClass(keyhash, Ed25519KeyHash);
|
|
const ret = wasm.ed25519keyhashes_add(this.__wbg_ptr, keyhash.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} elem
|
|
* @returns {boolean}
|
|
*/
|
|
contains(elem) {
|
|
_assertClass(elem, Ed25519KeyHash);
|
|
const ret = wasm.ed25519keyhashes_contains(this.__wbg_ptr, elem.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHashes | undefined}
|
|
*/
|
|
to_option() {
|
|
const ret = wasm.ed25519keyhashes_to_option(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Ed25519KeyHashes.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Ed25519KeyHashes = Ed25519KeyHashes;
|
|
|
|
const Ed25519SignatureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_ed25519signature_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Ed25519Signature {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Ed25519Signature.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
Ed25519SignatureFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
Ed25519SignatureFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_ed25519signature_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bip32publickey_as_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_bech32() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519signature_to_bech32(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519signature_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech32_str
|
|
* @returns {Ed25519Signature}
|
|
*/
|
|
static from_bech32(bech32_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech32_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519signature_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519Signature.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} input
|
|
* @returns {Ed25519Signature}
|
|
*/
|
|
static from_hex(input) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519signature_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519Signature.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Ed25519Signature}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519signature_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ed25519Signature.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Ed25519Signature = Ed25519Signature;
|
|
|
|
const EnterpriseAddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_enterpriseaddress_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class EnterpriseAddress {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(EnterpriseAddress.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
EnterpriseAddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
EnterpriseAddressFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_enterpriseaddress_free(ptr);
|
|
}
|
|
/**
|
|
* @param {number} network
|
|
* @param {Credential} payment
|
|
* @returns {EnterpriseAddress}
|
|
*/
|
|
static new(network, payment) {
|
|
_assertClass(payment, Credential);
|
|
const ret = wasm.enterpriseaddress_new(network, payment.__wbg_ptr);
|
|
return EnterpriseAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
payment_cred() {
|
|
const ret = wasm.baseaddress_payment_cred(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Address}
|
|
*/
|
|
to_address() {
|
|
const ret = wasm.enterpriseaddress_to_address(this.__wbg_ptr);
|
|
return Address.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Address} addr
|
|
* @returns {EnterpriseAddress | undefined}
|
|
*/
|
|
static from_address(addr) {
|
|
_assertClass(addr, Address);
|
|
const ret = wasm.enterpriseaddress_from_address(addr.__wbg_ptr);
|
|
return ret === 0 ? undefined : EnterpriseAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
network_id() {
|
|
const ret = wasm.enterpriseaddress_network_id(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.EnterpriseAddress = EnterpriseAddress;
|
|
|
|
const ExUnitPricesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_exunitprices_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ExUnitPrices {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ExUnitPrices.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ExUnitPricesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ExUnitPricesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_exunitprices_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.exunitprices_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ExUnitPrices}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.exunitprices_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ExUnitPrices.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.exunitprices_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ExUnitPrices}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.exunitprices_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ExUnitPrices.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.exunitprices_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.exunitprices_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ExUnitPrices}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.exunitprices_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ExUnitPrices.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
mem_price() {
|
|
const ret = wasm.committee_quorum_threshold(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
step_price() {
|
|
const ret = wasm.drepvotingthresholds_committee_normal(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} mem_price
|
|
* @param {UnitInterval} step_price
|
|
* @returns {ExUnitPrices}
|
|
*/
|
|
static new(mem_price, step_price) {
|
|
_assertClass(mem_price, UnitInterval);
|
|
_assertClass(step_price, UnitInterval);
|
|
const ret = wasm.exunitprices_new(mem_price.__wbg_ptr, step_price.__wbg_ptr);
|
|
return ExUnitPrices.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ExUnitPrices = ExUnitPrices;
|
|
|
|
const ExUnitsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_exunits_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ExUnits {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ExUnits.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ExUnitsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ExUnitsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_exunits_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.exunits_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ExUnits}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.exunits_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ExUnits.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.exunits_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ExUnits}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.exunits_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ExUnits.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.exunits_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.exunits_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ExUnits}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.exunits_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ExUnits.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
mem() {
|
|
const ret = wasm.exunits_mem(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
steps() {
|
|
const ret = wasm.exunits_steps(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} mem
|
|
* @param {BigNum} steps
|
|
* @returns {ExUnits}
|
|
*/
|
|
static new(mem, steps) {
|
|
_assertClass(mem, BigNum);
|
|
_assertClass(steps, BigNum);
|
|
const ret = wasm.exunits_new(mem.__wbg_ptr, steps.__wbg_ptr);
|
|
return ExUnits.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ExUnits = ExUnits;
|
|
|
|
const FixedBlockFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_fixedblock_free(ptr >>> 0));
|
|
/**
|
|
* Read only view of a block with more strict structs for hash sensitive structs.
|
|
* Warning: This is experimental and may be removed or changed in the future.
|
|
*/
|
|
class FixedBlock {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(FixedBlock.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
FixedBlockFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
FixedBlockFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_fixedblock_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {FixedBlock}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedblock_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedBlock.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {FixedBlock}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedblock_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedBlock.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Header}
|
|
*/
|
|
header() {
|
|
const ret = wasm.fixedblock_header(this.__wbg_ptr);
|
|
return Header.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {FixedTransactionBodies}
|
|
*/
|
|
transaction_bodies() {
|
|
const ret = wasm.fixedblock_transaction_bodies(this.__wbg_ptr);
|
|
return FixedTransactionBodies.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionWitnessSets}
|
|
*/
|
|
transaction_witness_sets() {
|
|
const ret = wasm.fixedblock_transaction_witness_sets(this.__wbg_ptr);
|
|
return TransactionWitnessSets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {AuxiliaryDataSet}
|
|
*/
|
|
auxiliary_data_set() {
|
|
const ret = wasm.fixedblock_auxiliary_data_set(this.__wbg_ptr);
|
|
return AuxiliaryDataSet.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint32Array}
|
|
*/
|
|
invalid_transactions() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.fixedblock_invalid_transactions(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BlockHash}
|
|
*/
|
|
block_hash() {
|
|
const ret = wasm.fixedblock_block_hash(this.__wbg_ptr);
|
|
return BlockHash.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.FixedBlock = FixedBlock;
|
|
|
|
const FixedTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_fixedtransaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class FixedTransaction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(FixedTransaction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
FixedTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
FixedTransactionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_fixedtransaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.fixedtransaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {FixedTransaction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.fixedtransaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {FixedTransaction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} raw_body
|
|
* @param {Uint8Array} raw_witness_set
|
|
* @param {boolean} is_valid
|
|
* @returns {FixedTransaction}
|
|
*/
|
|
static new(raw_body, raw_witness_set, is_valid) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(raw_body, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passArray8ToWasm0(raw_witness_set, wasm.__wbindgen_malloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransaction_new(retptr, ptr0, len0, ptr1, len1, is_valid);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} raw_body
|
|
* @param {Uint8Array} raw_witness_set
|
|
* @param {Uint8Array} raw_auxiliary_data
|
|
* @param {boolean} is_valid
|
|
* @returns {FixedTransaction}
|
|
*/
|
|
static new_with_auxiliary(raw_body, raw_witness_set, raw_auxiliary_data, is_valid) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(raw_body, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passArray8ToWasm0(raw_witness_set, wasm.__wbindgen_malloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
const ptr2 = passArray8ToWasm0(raw_auxiliary_data, wasm.__wbindgen_malloc);
|
|
const len2 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransaction_new_with_auxiliary(retptr, ptr0, len0, ptr1, len1, ptr2, len2, is_valid);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} raw_body
|
|
* @returns {FixedTransaction}
|
|
*/
|
|
static new_from_body_bytes(raw_body) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(raw_body, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransaction_new_from_body_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionBody}
|
|
*/
|
|
body() {
|
|
const ret = wasm.fixedtransaction_body(this.__wbg_ptr);
|
|
return TransactionBody.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
raw_body() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.fixedtransaction_raw_body(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} raw_body
|
|
*/
|
|
set_body(raw_body) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(raw_body, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransaction_set_body(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* We do not recommend using this function, since it might lead to script integrity hash.
|
|
* The only purpose of this struct is to sign the transaction from third-party sources.
|
|
* Use `.sign_and_add_vkey_signature` or `.sign_and_add_icarus_bootstrap_signature` or `.sign_and_add_daedalus_bootstrap_signature` instead.
|
|
* @param {Uint8Array} raw_witness_set
|
|
*/
|
|
set_witness_set(raw_witness_set) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(raw_witness_set, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransaction_set_witness_set(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionWitnessSet}
|
|
*/
|
|
witness_set() {
|
|
const ret = wasm.fixedtransaction_witness_set(this.__wbg_ptr);
|
|
return TransactionWitnessSet.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
raw_witness_set() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.fixedtransaction_raw_witness_set(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {boolean} valid
|
|
*/
|
|
set_is_valid(valid) {
|
|
wasm.fixedtransaction_set_is_valid(this.__wbg_ptr, valid);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_valid() {
|
|
const ret = wasm.fixedtransaction_is_valid(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @param {Uint8Array} raw_auxiliary_data
|
|
*/
|
|
set_auxiliary_data(raw_auxiliary_data) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(raw_auxiliary_data, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransaction_set_auxiliary_data(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {AuxiliaryData | undefined}
|
|
*/
|
|
auxiliary_data() {
|
|
const ret = wasm.fixedtransaction_auxiliary_data(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array | undefined}
|
|
*/
|
|
raw_auxiliary_data() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.fixedtransaction_raw_auxiliary_data(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
let v1;
|
|
if (r0 !== 0) {
|
|
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
}
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionHash}
|
|
*/
|
|
transaction_hash() {
|
|
const ret = wasm.fixedtransaction_transaction_hash(this.__wbg_ptr);
|
|
return TransactionHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Vkeywitness} vkey_witness
|
|
*/
|
|
add_vkey_witness(vkey_witness) {
|
|
_assertClass(vkey_witness, Vkeywitness);
|
|
wasm.fixedtransaction_add_vkey_witness(this.__wbg_ptr, vkey_witness.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {BootstrapWitness} bootstrap_witness
|
|
*/
|
|
add_bootstrap_witness(bootstrap_witness) {
|
|
_assertClass(bootstrap_witness, BootstrapWitness);
|
|
wasm.fixedtransaction_add_bootstrap_witness(this.__wbg_ptr, bootstrap_witness.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {PrivateKey} private_key
|
|
*/
|
|
sign_and_add_vkey_signature(private_key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(private_key, PrivateKey);
|
|
wasm.fixedtransaction_sign_and_add_vkey_signature(retptr, this.__wbg_ptr, private_key.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {ByronAddress} addr
|
|
* @param {Bip32PrivateKey} private_key
|
|
*/
|
|
sign_and_add_icarus_bootstrap_signature(addr, private_key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(addr, ByronAddress);
|
|
_assertClass(private_key, Bip32PrivateKey);
|
|
wasm.fixedtransaction_sign_and_add_icarus_bootstrap_signature(retptr, this.__wbg_ptr, addr.__wbg_ptr, private_key.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {ByronAddress} addr
|
|
* @param {LegacyDaedalusPrivateKey} private_key
|
|
*/
|
|
sign_and_add_daedalus_bootstrap_signature(addr, private_key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(addr, ByronAddress);
|
|
_assertClass(private_key, LegacyDaedalusPrivateKey);
|
|
wasm.fixedtransaction_sign_and_add_daedalus_bootstrap_signature(retptr, this.__wbg_ptr, addr.__wbg_ptr, private_key.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.FixedTransaction = FixedTransaction;
|
|
|
|
const FixedTransactionBodiesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_fixedtransactionbodies_free(ptr >>> 0));
|
|
/**
|
|
* Warning: This is experimental and may be removed or changed in the future.
|
|
*/
|
|
class FixedTransactionBodies {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(FixedTransactionBodies.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
FixedTransactionBodiesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
FixedTransactionBodiesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_fixedtransactionbodies_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {FixedTransactionBodies}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransactionbodies_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransactionBodies.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {FixedTransactionBodies}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransactionbodies_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransactionBodies.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {FixedTransactionBodies}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.fixedtransactionbodies_new();
|
|
return FixedTransactionBodies.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.fixedtransactionbodies_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {FixedTransactionBody}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.fixedtransactionbodies_get(this.__wbg_ptr, index);
|
|
return FixedTransactionBody.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {FixedTransactionBody} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, FixedTransactionBody);
|
|
wasm.fixedtransactionbodies_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.FixedTransactionBodies = FixedTransactionBodies;
|
|
|
|
const FixedTransactionBodyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_fixedtransactionbody_free(ptr >>> 0));
|
|
/**
|
|
* Read-only view of a transaction body. With correct hash and original bytes.
|
|
* Warning: This is experimental and may be removed in the future.
|
|
*/
|
|
class FixedTransactionBody {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(FixedTransactionBody.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
FixedTransactionBodyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
FixedTransactionBodyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_fixedtransactionbody_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {FixedTransactionBody}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransactionbody_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransactionBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {FixedTransactionBody}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtransactionbody_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTransactionBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionBody}
|
|
*/
|
|
transaction_body() {
|
|
const ret = wasm.fixedtransaction_body(this.__wbg_ptr);
|
|
return TransactionBody.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionHash}
|
|
*/
|
|
tx_hash() {
|
|
const ret = wasm.fixedtransactionbody_tx_hash(this.__wbg_ptr);
|
|
return TransactionHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
original_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.fixedtransactionbody_original_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.FixedTransactionBody = FixedTransactionBody;
|
|
|
|
const FixedTxWitnessesSetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_fixedtxwitnessesset_free(ptr >>> 0));
|
|
/**
|
|
* A set of witnesses for a transaction.
|
|
* Keeps original bytes to allow for safe roundtrip serialization.
|
|
* That helps to avoid incorrect script data hash after adding a vkey or bootstrap witness.
|
|
* You can add a vkey witness or a bootstrap witness to the set.
|
|
* Or get TransactionWitnessSet to read fields.
|
|
*/
|
|
class FixedTxWitnessesSet {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(FixedTxWitnessesSet.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
FixedTxWitnessesSetFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
FixedTxWitnessesSetFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_fixedtxwitnessesset_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {TransactionWitnessSet}
|
|
*/
|
|
tx_witnesses_set() {
|
|
const ret = wasm.fixedtxwitnessesset_tx_witnesses_set(this.__wbg_ptr);
|
|
return TransactionWitnessSet.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Vkeywitness} vkey_witness
|
|
*/
|
|
add_vkey_witness(vkey_witness) {
|
|
_assertClass(vkey_witness, Vkeywitness);
|
|
wasm.fixedtxwitnessesset_add_vkey_witness(this.__wbg_ptr, vkey_witness.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {BootstrapWitness} bootstrap_witness
|
|
*/
|
|
add_bootstrap_witness(bootstrap_witness) {
|
|
_assertClass(bootstrap_witness, BootstrapWitness);
|
|
wasm.fixedtxwitnessesset_add_bootstrap_witness(this.__wbg_ptr, bootstrap_witness.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.fixedtxwitnessesset_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} data
|
|
* @returns {FixedTxWitnessesSet}
|
|
*/
|
|
static from_bytes(data) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedtxwitnessesset_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedTxWitnessesSet.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.FixedTxWitnessesSet = FixedTxWitnessesSet;
|
|
|
|
const FixedVersionedBlockFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_fixedversionedblock_free(ptr >>> 0));
|
|
/**
|
|
* Warning: This is experimental and may be removed in the future.
|
|
*/
|
|
class FixedVersionedBlock {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(FixedVersionedBlock.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
FixedVersionedBlockFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
FixedVersionedBlockFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_fixedversionedblock_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {FixedVersionedBlock}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedversionedblock_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedVersionedBlock.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {FixedVersionedBlock}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.fixedversionedblock_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return FixedVersionedBlock.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {FixedBlock}
|
|
*/
|
|
block() {
|
|
const ret = wasm.fixedversionedblock_block(this.__wbg_ptr);
|
|
return FixedBlock.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BlockEra}
|
|
*/
|
|
era() {
|
|
const ret = wasm.fixedversionedblock_era(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.FixedVersionedBlock = FixedVersionedBlock;
|
|
|
|
const GeneralTransactionMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_generaltransactionmetadata_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class GeneralTransactionMetadata {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(GeneralTransactionMetadata.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
GeneralTransactionMetadataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
GeneralTransactionMetadataFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_generaltransactionmetadata_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.generaltransactionmetadata_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {GeneralTransactionMetadata}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.generaltransactionmetadata_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GeneralTransactionMetadata.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.generaltransactionmetadata_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {GeneralTransactionMetadata}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.generaltransactionmetadata_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GeneralTransactionMetadata.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.generaltransactionmetadata_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.generaltransactionmetadata_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {GeneralTransactionMetadata}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.generaltransactionmetadata_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GeneralTransactionMetadata.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GeneralTransactionMetadata}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.generaltransactionmetadata_new();
|
|
return GeneralTransactionMetadata.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.generaltransactionmetadata_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {BigNum} key
|
|
* @param {TransactionMetadatum} value
|
|
* @returns {TransactionMetadatum | undefined}
|
|
*/
|
|
insert(key, value) {
|
|
_assertClass(key, BigNum);
|
|
_assertClass(value, TransactionMetadatum);
|
|
const ret = wasm.generaltransactionmetadata_insert(this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionMetadatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} key
|
|
* @returns {TransactionMetadatum | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, BigNum);
|
|
const ret = wasm.generaltransactionmetadata_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionMetadatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionMetadatumLabels}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.generaltransactionmetadata_keys(this.__wbg_ptr);
|
|
return TransactionMetadatumLabels.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.GeneralTransactionMetadata = GeneralTransactionMetadata;
|
|
|
|
const GenesisDelegateHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_genesisdelegatehash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class GenesisDelegateHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(GenesisDelegateHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
GenesisDelegateHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
GenesisDelegateHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_genesisdelegatehash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {GenesisDelegateHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesisdelegatehash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisDelegateHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {GenesisDelegateHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesisdelegatehash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisDelegateHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {GenesisDelegateHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesisdelegatehash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisDelegateHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.GenesisDelegateHash = GenesisDelegateHash;
|
|
|
|
const GenesisHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_genesishash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class GenesisHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(GenesisHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
GenesisHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
GenesisHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_genesishash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {GenesisHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesishash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {GenesisHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesishash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {GenesisHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesishash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.GenesisHash = GenesisHash;
|
|
|
|
const GenesisHashesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_genesishashes_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class GenesisHashes {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(GenesisHashes.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
GenesisHashesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
GenesisHashesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_genesishashes_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.genesishashes_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {GenesisHashes}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesishashes_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.genesishashes_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {GenesisHashes}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesishashes_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.genesishashes_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.genesishashes_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {GenesisHashes}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesishashes_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GenesisHashes}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.genesishashes_new();
|
|
return GenesisHashes.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {GenesisHash}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.genesishashes_get(this.__wbg_ptr, index);
|
|
return GenesisHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GenesisHash} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, GenesisHash);
|
|
wasm.genesishashes_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.GenesisHashes = GenesisHashes;
|
|
|
|
const GenesisKeyDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_genesiskeydelegation_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class GenesisKeyDelegation {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(GenesisKeyDelegation.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
GenesisKeyDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
GenesisKeyDelegationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_genesiskeydelegation_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.genesiskeydelegation_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {GenesisKeyDelegation}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesiskeydelegation_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisKeyDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.genesiskeydelegation_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {GenesisKeyDelegation}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesiskeydelegation_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisKeyDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.genesiskeydelegation_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.genesiskeydelegation_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {GenesisKeyDelegation}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.genesiskeydelegation_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GenesisKeyDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GenesisHash}
|
|
*/
|
|
genesishash() {
|
|
const ret = wasm.genesiskeydelegation_genesishash(this.__wbg_ptr);
|
|
return GenesisHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {GenesisDelegateHash}
|
|
*/
|
|
genesis_delegate_hash() {
|
|
const ret = wasm.genesiskeydelegation_genesis_delegate_hash(this.__wbg_ptr);
|
|
return GenesisDelegateHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {VRFKeyHash}
|
|
*/
|
|
vrf_keyhash() {
|
|
const ret = wasm.genesiskeydelegation_vrf_keyhash(this.__wbg_ptr);
|
|
return VRFKeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GenesisHash} genesishash
|
|
* @param {GenesisDelegateHash} genesis_delegate_hash
|
|
* @param {VRFKeyHash} vrf_keyhash
|
|
* @returns {GenesisKeyDelegation}
|
|
*/
|
|
static new(genesishash, genesis_delegate_hash, vrf_keyhash) {
|
|
_assertClass(genesishash, GenesisHash);
|
|
_assertClass(genesis_delegate_hash, GenesisDelegateHash);
|
|
_assertClass(vrf_keyhash, VRFKeyHash);
|
|
const ret = wasm.genesiskeydelegation_new(genesishash.__wbg_ptr, genesis_delegate_hash.__wbg_ptr, vrf_keyhash.__wbg_ptr);
|
|
return GenesisKeyDelegation.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.GenesisKeyDelegation = GenesisKeyDelegation;
|
|
|
|
const GovernanceActionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_governanceaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class GovernanceAction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(GovernanceAction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
GovernanceActionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
GovernanceActionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_governanceaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.governanceaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GovernanceAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.governanceaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GovernanceAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceaction_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceaction_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.governanceaction_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GovernanceAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {ParameterChangeAction} parameter_change_action
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static new_parameter_change_action(parameter_change_action) {
|
|
_assertClass(parameter_change_action, ParameterChangeAction);
|
|
const ret = wasm.governanceaction_new_parameter_change_action(parameter_change_action.__wbg_ptr);
|
|
return GovernanceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {HardForkInitiationAction} hard_fork_initiation_action
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static new_hard_fork_initiation_action(hard_fork_initiation_action) {
|
|
_assertClass(hard_fork_initiation_action, HardForkInitiationAction);
|
|
const ret = wasm.governanceaction_new_hard_fork_initiation_action(hard_fork_initiation_action.__wbg_ptr);
|
|
return GovernanceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TreasuryWithdrawalsAction} treasury_withdrawals_action
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static new_treasury_withdrawals_action(treasury_withdrawals_action) {
|
|
_assertClass(treasury_withdrawals_action, TreasuryWithdrawalsAction);
|
|
const ret = wasm.governanceaction_new_treasury_withdrawals_action(treasury_withdrawals_action.__wbg_ptr);
|
|
return GovernanceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {NoConfidenceAction} no_confidence_action
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static new_no_confidence_action(no_confidence_action) {
|
|
_assertClass(no_confidence_action, NoConfidenceAction);
|
|
const ret = wasm.governanceaction_new_no_confidence_action(no_confidence_action.__wbg_ptr);
|
|
return GovernanceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {UpdateCommitteeAction} new_committee_action
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static new_new_committee_action(new_committee_action) {
|
|
_assertClass(new_committee_action, UpdateCommitteeAction);
|
|
const ret = wasm.governanceaction_new_new_committee_action(new_committee_action.__wbg_ptr);
|
|
return GovernanceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {NewConstitutionAction} new_constitution_action
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static new_new_constitution_action(new_constitution_action) {
|
|
_assertClass(new_constitution_action, NewConstitutionAction);
|
|
const ret = wasm.governanceaction_new_new_constitution_action(new_constitution_action.__wbg_ptr);
|
|
return GovernanceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {InfoAction} info_action
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
static new_info_action(info_action) {
|
|
_assertClass(info_action, InfoAction);
|
|
const ret = wasm.governanceaction_new_info_action(info_action.__wbg_ptr);
|
|
return GovernanceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {GovernanceActionKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.governanceaction_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {ParameterChangeAction | undefined}
|
|
*/
|
|
as_parameter_change_action() {
|
|
const ret = wasm.governanceaction_as_parameter_change_action(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ParameterChangeAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {HardForkInitiationAction | undefined}
|
|
*/
|
|
as_hard_fork_initiation_action() {
|
|
const ret = wasm.governanceaction_as_hard_fork_initiation_action(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : HardForkInitiationAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TreasuryWithdrawalsAction | undefined}
|
|
*/
|
|
as_treasury_withdrawals_action() {
|
|
const ret = wasm.governanceaction_as_treasury_withdrawals_action(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : TreasuryWithdrawalsAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NoConfidenceAction | undefined}
|
|
*/
|
|
as_no_confidence_action() {
|
|
const ret = wasm.governanceaction_as_no_confidence_action(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NoConfidenceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UpdateCommitteeAction | undefined}
|
|
*/
|
|
as_new_committee_action() {
|
|
const ret = wasm.governanceaction_as_new_committee_action(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : UpdateCommitteeAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NewConstitutionAction | undefined}
|
|
*/
|
|
as_new_constitution_action() {
|
|
const ret = wasm.governanceaction_as_new_constitution_action(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NewConstitutionAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {InfoAction | undefined}
|
|
*/
|
|
as_info_action() {
|
|
const ret = wasm.governanceaction_as_info_action(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : InfoAction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.GovernanceAction = GovernanceAction;
|
|
|
|
const GovernanceActionIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_governanceactionid_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class GovernanceActionId {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(GovernanceActionId.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
GovernanceActionIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
GovernanceActionIdFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_governanceactionid_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceactionid_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {GovernanceActionId}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.governanceactionid_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GovernanceActionId.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceactionid_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {GovernanceActionId}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.governanceactionid_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GovernanceActionId.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceactionid_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceactionid_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {GovernanceActionId}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.governanceactionid_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GovernanceActionId.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionHash}
|
|
*/
|
|
transaction_id() {
|
|
const ret = wasm.governanceactionid_transaction_id(this.__wbg_ptr);
|
|
return TransactionHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
index() {
|
|
const ret = wasm.governanceactionid_index(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {TransactionHash} transaction_id
|
|
* @param {number} index
|
|
* @returns {GovernanceActionId}
|
|
*/
|
|
static new(transaction_id, index) {
|
|
_assertClass(transaction_id, TransactionHash);
|
|
const ret = wasm.governanceactionid_new(transaction_id.__wbg_ptr, index);
|
|
return GovernanceActionId.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.GovernanceActionId = GovernanceActionId;
|
|
|
|
const GovernanceActionIdsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_governanceactionids_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class GovernanceActionIds {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(GovernanceActionIds.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
GovernanceActionIdsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
GovernanceActionIdsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_governanceactionids_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceactionids_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.governanceactionids_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {GovernanceActionIds}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.governanceactionids_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return GovernanceActionIds.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GovernanceActionIds}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.governanceactionids_new();
|
|
return GovernanceActionIds.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GovernanceActionId} governance_action_id
|
|
*/
|
|
add(governance_action_id) {
|
|
_assertClass(governance_action_id, GovernanceActionId);
|
|
wasm.governanceactionids_add(this.__wbg_ptr, governance_action_id.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {GovernanceActionId | undefined}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.governanceactionids_get(this.__wbg_ptr, index);
|
|
return ret === 0 ? undefined : GovernanceActionId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.governanceactionids_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
}
|
|
module.exports.GovernanceActionIds = GovernanceActionIds;
|
|
|
|
const HardForkInitiationActionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_hardforkinitiationaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class HardForkInitiationAction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(HardForkInitiationAction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
HardForkInitiationActionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
HardForkInitiationActionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_hardforkinitiationaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.hardforkinitiationaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {HardForkInitiationAction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.hardforkinitiationaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return HardForkInitiationAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.hardforkinitiationaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {HardForkInitiationAction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.hardforkinitiationaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return HardForkInitiationAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.hardforkinitiationaction_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.hardforkinitiationaction_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {HardForkInitiationAction}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.hardforkinitiationaction_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return HardForkInitiationAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GovernanceActionId | undefined}
|
|
*/
|
|
gov_action_id() {
|
|
const ret = wasm.hardforkinitiationaction_gov_action_id(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : GovernanceActionId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ProtocolVersion}
|
|
*/
|
|
protocol_version() {
|
|
const ret = wasm.hardforkinitiationaction_protocol_version(this.__wbg_ptr);
|
|
return ProtocolVersion.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ProtocolVersion} protocol_version
|
|
* @returns {HardForkInitiationAction}
|
|
*/
|
|
static new(protocol_version) {
|
|
_assertClass(protocol_version, ProtocolVersion);
|
|
const ret = wasm.hardforkinitiationaction_new(protocol_version.__wbg_ptr);
|
|
return HardForkInitiationAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @param {ProtocolVersion} protocol_version
|
|
* @returns {HardForkInitiationAction}
|
|
*/
|
|
static new_with_action_id(gov_action_id, protocol_version) {
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
_assertClass(protocol_version, ProtocolVersion);
|
|
const ret = wasm.hardforkinitiationaction_new_with_action_id(gov_action_id.__wbg_ptr, protocol_version.__wbg_ptr);
|
|
return HardForkInitiationAction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.HardForkInitiationAction = HardForkInitiationAction;
|
|
|
|
const HeaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_header_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Header {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Header.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
HeaderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
HeaderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_header_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.header_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Header}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.header_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Header.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.header_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Header}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.header_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Header.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.header_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.header_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Header}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.header_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Header.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {HeaderBody}
|
|
*/
|
|
header_body() {
|
|
const ret = wasm.header_header_body(this.__wbg_ptr);
|
|
return HeaderBody.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {KESSignature}
|
|
*/
|
|
body_signature() {
|
|
const ret = wasm.header_body_signature(this.__wbg_ptr);
|
|
return KESSignature.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {HeaderBody} header_body
|
|
* @param {KESSignature} body_signature
|
|
* @returns {Header}
|
|
*/
|
|
static new(header_body, body_signature) {
|
|
_assertClass(header_body, HeaderBody);
|
|
_assertClass(body_signature, KESSignature);
|
|
const ret = wasm.header_new(header_body.__wbg_ptr, body_signature.__wbg_ptr);
|
|
return Header.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Header = Header;
|
|
|
|
const HeaderBodyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_headerbody_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class HeaderBody {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(HeaderBody.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
HeaderBodyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
HeaderBodyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_headerbody_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.headerbody_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {HeaderBody}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.headerbody_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return HeaderBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.headerbody_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {HeaderBody}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.headerbody_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return HeaderBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.headerbody_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.headerbody_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {HeaderBody}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.headerbody_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return HeaderBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
block_number() {
|
|
const ret = wasm.headerbody_block_number(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Returns a Slot32 (u32) value in case the underlying original BigNum (u64) value is within the limits.
|
|
* Otherwise will just raise an error.
|
|
* @returns {number}
|
|
*/
|
|
slot() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.headerbody_slot(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
slot_bignum() {
|
|
const ret = wasm.headerbody_slot_bignum(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BlockHash | undefined}
|
|
*/
|
|
prev_hash() {
|
|
const ret = wasm.headerbody_prev_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BlockHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Vkey}
|
|
*/
|
|
issuer_vkey() {
|
|
const ret = wasm.headerbody_issuer_vkey(this.__wbg_ptr);
|
|
return Vkey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {VRFVKey}
|
|
*/
|
|
vrf_vkey() {
|
|
const ret = wasm.headerbody_vrf_vkey(this.__wbg_ptr);
|
|
return VRFVKey.__wrap(ret);
|
|
}
|
|
/**
|
|
* If this function returns true, the `.nonce_vrf_or_nothing`
|
|
* and the `.leader_vrf_or_nothing` functions will return
|
|
* non-empty results
|
|
* @returns {boolean}
|
|
*/
|
|
has_nonce_and_leader_vrf() {
|
|
const ret = wasm.headerbody_has_nonce_and_leader_vrf(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* Might return nothing in case `.has_nonce_and_leader_vrf` returns false
|
|
* @returns {VRFCert | undefined}
|
|
*/
|
|
nonce_vrf_or_nothing() {
|
|
const ret = wasm.headerbody_nonce_vrf_or_nothing(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : VRFCert.__wrap(ret);
|
|
}
|
|
/**
|
|
* Might return nothing in case `.has_nonce_and_leader_vrf` returns false
|
|
* @returns {VRFCert | undefined}
|
|
*/
|
|
leader_vrf_or_nothing() {
|
|
const ret = wasm.headerbody_leader_vrf_or_nothing(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : VRFCert.__wrap(ret);
|
|
}
|
|
/**
|
|
* If this function returns true, the `.vrf_result_or_nothing`
|
|
* function will return a non-empty result
|
|
* @returns {boolean}
|
|
*/
|
|
has_vrf_result() {
|
|
const ret = wasm.headerbody_has_vrf_result(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* Might return nothing in case `.has_vrf_result` returns false
|
|
* @returns {VRFCert | undefined}
|
|
*/
|
|
vrf_result_or_nothing() {
|
|
const ret = wasm.headerbody_vrf_result_or_nothing(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : VRFCert.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
block_body_size() {
|
|
const ret = wasm.headerbody_block_body_size(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @returns {BlockHash}
|
|
*/
|
|
block_body_hash() {
|
|
const ret = wasm.headerbody_block_body_hash(this.__wbg_ptr);
|
|
return BlockHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {OperationalCert}
|
|
*/
|
|
operational_cert() {
|
|
const ret = wasm.headerbody_operational_cert(this.__wbg_ptr);
|
|
return OperationalCert.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ProtocolVersion}
|
|
*/
|
|
protocol_version() {
|
|
const ret = wasm.headerbody_protocol_version(this.__wbg_ptr);
|
|
return ProtocolVersion.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* This constructor uses outdated slot number format.
|
|
* Use `.new_headerbody` instead
|
|
* @param {number} block_number
|
|
* @param {number} slot
|
|
* @param {BlockHash | undefined} prev_hash
|
|
* @param {Vkey} issuer_vkey
|
|
* @param {VRFVKey} vrf_vkey
|
|
* @param {VRFCert} vrf_result
|
|
* @param {number} block_body_size
|
|
* @param {BlockHash} block_body_hash
|
|
* @param {OperationalCert} operational_cert
|
|
* @param {ProtocolVersion} protocol_version
|
|
* @returns {HeaderBody}
|
|
*/
|
|
static new(block_number, slot, prev_hash, issuer_vkey, vrf_vkey, vrf_result, block_body_size, block_body_hash, operational_cert, protocol_version) {
|
|
let ptr0 = 0;
|
|
if (!isLikeNone(prev_hash)) {
|
|
_assertClass(prev_hash, BlockHash);
|
|
ptr0 = prev_hash.__destroy_into_raw();
|
|
}
|
|
_assertClass(issuer_vkey, Vkey);
|
|
_assertClass(vrf_vkey, VRFVKey);
|
|
_assertClass(vrf_result, VRFCert);
|
|
_assertClass(block_body_hash, BlockHash);
|
|
_assertClass(operational_cert, OperationalCert);
|
|
_assertClass(protocol_version, ProtocolVersion);
|
|
const ret = wasm.headerbody_new(block_number, slot, ptr0, issuer_vkey.__wbg_ptr, vrf_vkey.__wbg_ptr, vrf_result.__wbg_ptr, block_body_size, block_body_hash.__wbg_ptr, operational_cert.__wbg_ptr, protocol_version.__wbg_ptr);
|
|
return HeaderBody.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} block_number
|
|
* @param {BigNum} slot
|
|
* @param {BlockHash | undefined} prev_hash
|
|
* @param {Vkey} issuer_vkey
|
|
* @param {VRFVKey} vrf_vkey
|
|
* @param {VRFCert} vrf_result
|
|
* @param {number} block_body_size
|
|
* @param {BlockHash} block_body_hash
|
|
* @param {OperationalCert} operational_cert
|
|
* @param {ProtocolVersion} protocol_version
|
|
* @returns {HeaderBody}
|
|
*/
|
|
static new_headerbody(block_number, slot, prev_hash, issuer_vkey, vrf_vkey, vrf_result, block_body_size, block_body_hash, operational_cert, protocol_version) {
|
|
_assertClass(slot, BigNum);
|
|
let ptr0 = 0;
|
|
if (!isLikeNone(prev_hash)) {
|
|
_assertClass(prev_hash, BlockHash);
|
|
ptr0 = prev_hash.__destroy_into_raw();
|
|
}
|
|
_assertClass(issuer_vkey, Vkey);
|
|
_assertClass(vrf_vkey, VRFVKey);
|
|
_assertClass(vrf_result, VRFCert);
|
|
_assertClass(block_body_hash, BlockHash);
|
|
_assertClass(operational_cert, OperationalCert);
|
|
_assertClass(protocol_version, ProtocolVersion);
|
|
const ret = wasm.headerbody_new_headerbody(block_number, slot.__wbg_ptr, ptr0, issuer_vkey.__wbg_ptr, vrf_vkey.__wbg_ptr, vrf_result.__wbg_ptr, block_body_size, block_body_hash.__wbg_ptr, operational_cert.__wbg_ptr, protocol_version.__wbg_ptr);
|
|
return HeaderBody.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.HeaderBody = HeaderBody;
|
|
|
|
const InfoActionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_infoaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class InfoAction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(InfoAction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
InfoActionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
InfoActionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_infoaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {InfoAction}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.infoaction_new();
|
|
return InfoAction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.InfoAction = InfoAction;
|
|
|
|
const IntFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_int_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Int {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Int.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
IntFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
IntFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_int_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.int_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Int}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.int_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Int.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.int_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Int}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.int_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Int.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.int_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.int_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Int}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.int_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Int.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} x
|
|
* @returns {Int}
|
|
*/
|
|
static new(x) {
|
|
_assertClass(x, BigNum);
|
|
const ret = wasm.int_new(x.__wbg_ptr);
|
|
return Int.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} x
|
|
* @returns {Int}
|
|
*/
|
|
static new_negative(x) {
|
|
_assertClass(x, BigNum);
|
|
const ret = wasm.int_new_negative(x.__wbg_ptr);
|
|
return Int.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} x
|
|
* @returns {Int}
|
|
*/
|
|
static new_i32(x) {
|
|
const ret = wasm.int_new_i32(x);
|
|
return Int.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_positive() {
|
|
const ret = wasm.int_is_positive(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* BigNum can only contain unsigned u64 values
|
|
*
|
|
* This function will return the BigNum representation
|
|
* only in case the underlying i128 value is positive.
|
|
*
|
|
* Otherwise nothing will be returned (undefined).
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
as_positive() {
|
|
const ret = wasm.int_as_positive(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* BigNum can only contain unsigned u64 values
|
|
*
|
|
* This function will return the *absolute* BigNum representation
|
|
* only in case the underlying i128 value is negative.
|
|
*
|
|
* Otherwise nothing will be returned (undefined).
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
as_negative() {
|
|
const ret = wasm.int_as_negative(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Returns an i32 value in case the underlying original i128 value is within the limits.
|
|
* Otherwise will just return an empty value (undefined).
|
|
* @returns {number | undefined}
|
|
*/
|
|
as_i32() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.int_as_i32(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Returns the underlying value converted to i32 if possible (within limits)
|
|
* Otherwise will just return an empty value (undefined).
|
|
* @returns {number | undefined}
|
|
*/
|
|
as_i32_or_nothing() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.int_as_i32_or_nothing(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Returns the underlying value converted to i32 if possible (within limits)
|
|
* JsError in case of out of boundary overflow
|
|
* @returns {number}
|
|
*/
|
|
as_i32_or_fail() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.int_as_i32_or_fail(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Returns string representation of the underlying i128 value directly.
|
|
* Might contain the minus sign (-) in case of negative value.
|
|
* @returns {string}
|
|
*/
|
|
to_str() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.int_to_str(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} string
|
|
* @returns {Int}
|
|
*/
|
|
static from_str(string) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(string, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.int_from_str(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Int.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Int = Int;
|
|
|
|
const Ipv4Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_ipv4_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Ipv4 {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Ipv4.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
Ipv4Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
Ipv4Finalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_ipv4_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv4_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Ipv4}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ipv4_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ipv4.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv4_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Ipv4}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ipv4_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ipv4.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv4_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv4_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Ipv4}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ipv4_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ipv4.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} data
|
|
* @returns {Ipv4}
|
|
*/
|
|
static new(data) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ipv4_new(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ipv4.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
ip() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv4_ip(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Ipv4 = Ipv4;
|
|
|
|
const Ipv6Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_ipv6_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Ipv6 {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Ipv6.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
Ipv6Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
Ipv6Finalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_ipv6_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv6_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Ipv6}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ipv6_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ipv6.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv6_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Ipv6}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ipv6_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ipv6.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv6_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv6_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Ipv6}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ipv6_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ipv6.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} data
|
|
* @returns {Ipv6}
|
|
*/
|
|
static new(data) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ipv6_new(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Ipv6.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
ip() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ipv6_ip(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Ipv6 = Ipv6;
|
|
|
|
const KESSignatureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_kessignature_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class KESSignature {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(KESSignature.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
KESSignatureFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
KESSignatureFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_kessignature_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.kessignature_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {KESSignature}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.kessignature_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return KESSignature.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.KESSignature = KESSignature;
|
|
|
|
const KESVKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_kesvkey_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class KESVKey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(KESVKey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
KESVKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
KESVKeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_kesvkey_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {KESVKey}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.kesvkey_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return KESVKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {KESVKey}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.kesvkey_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return KESVKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {KESVKey}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.kesvkey_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return KESVKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.KESVKey = KESVKey;
|
|
|
|
const LanguageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_language_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Language {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Language.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
LanguageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
LanguageFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_language_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.language_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Language}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.language_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Language.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.language_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Language}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.language_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Language.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.language_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.language_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Language}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.language_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Language.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Language}
|
|
*/
|
|
static new_plutus_v1() {
|
|
const ret = wasm.language_new_plutus_v1();
|
|
return Language.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Language}
|
|
*/
|
|
static new_plutus_v2() {
|
|
const ret = wasm.language_new_plutus_v2();
|
|
return Language.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Language}
|
|
*/
|
|
static new_plutus_v3() {
|
|
const ret = wasm.language_new_plutus_v3();
|
|
return Language.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {LanguageKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.language_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.Language = Language;
|
|
|
|
const LanguagesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_languages_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Languages {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Languages.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
LanguagesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
LanguagesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_languages_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Languages}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.languages_new();
|
|
return Languages.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.costmdls_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Language}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.languages_get(this.__wbg_ptr, index);
|
|
return Language.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Language} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, Language);
|
|
var ptr0 = elem.__destroy_into_raw();
|
|
wasm.languages_add(this.__wbg_ptr, ptr0);
|
|
}
|
|
/**
|
|
* @returns {Languages}
|
|
*/
|
|
static list() {
|
|
const ret = wasm.languages_list();
|
|
return Languages.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Languages = Languages;
|
|
|
|
const LegacyDaedalusPrivateKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_legacydaedalusprivatekey_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class LegacyDaedalusPrivateKey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(LegacyDaedalusPrivateKey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
LegacyDaedalusPrivateKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
LegacyDaedalusPrivateKeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_legacydaedalusprivatekey_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {LegacyDaedalusPrivateKey}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.legacydaedalusprivatekey_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return LegacyDaedalusPrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
as_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.legacydaedalusprivatekey_as_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
chaincode() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.legacydaedalusprivatekey_chaincode(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.LegacyDaedalusPrivateKey = LegacyDaedalusPrivateKey;
|
|
|
|
const LinearFeeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_linearfee_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class LinearFee {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(LinearFee.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
LinearFeeFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
LinearFeeFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_linearfee_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
constant() {
|
|
const ret = wasm.linearfee_constant(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
coefficient() {
|
|
const ret = wasm.linearfee_coefficient(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} coefficient
|
|
* @param {BigNum} constant
|
|
* @returns {LinearFee}
|
|
*/
|
|
static new(coefficient, constant) {
|
|
_assertClass(coefficient, BigNum);
|
|
_assertClass(constant, BigNum);
|
|
const ret = wasm.linearfee_new(coefficient.__wbg_ptr, constant.__wbg_ptr);
|
|
return LinearFee.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.LinearFee = LinearFee;
|
|
|
|
const MIRToStakeCredentialsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_mirtostakecredentials_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MIRToStakeCredentials {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MIRToStakeCredentials.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MIRToStakeCredentialsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MIRToStakeCredentialsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_mirtostakecredentials_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mirtostakecredentials_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {MIRToStakeCredentials}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.mirtostakecredentials_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MIRToStakeCredentials.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mirtostakecredentials_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {MIRToStakeCredentials}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.mirtostakecredentials_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MIRToStakeCredentials.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mirtostakecredentials_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mirtostakecredentials_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {MIRToStakeCredentials}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.mirtostakecredentials_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MIRToStakeCredentials.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {MIRToStakeCredentials}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.mirtostakecredentials_new();
|
|
return MIRToStakeCredentials.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.mirtostakecredentials_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {Credential} cred
|
|
* @param {Int} delta
|
|
* @returns {Int | undefined}
|
|
*/
|
|
insert(cred, delta) {
|
|
_assertClass(cred, Credential);
|
|
_assertClass(delta, Int);
|
|
const ret = wasm.mirtostakecredentials_insert(this.__wbg_ptr, cred.__wbg_ptr, delta.__wbg_ptr);
|
|
return ret === 0 ? undefined : Int.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} cred
|
|
* @returns {Int | undefined}
|
|
*/
|
|
get(cred) {
|
|
_assertClass(cred, Credential);
|
|
const ret = wasm.mirtostakecredentials_get(this.__wbg_ptr, cred.__wbg_ptr);
|
|
return ret === 0 ? undefined : Int.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credentials}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.mirtostakecredentials_keys(this.__wbg_ptr);
|
|
return Credentials.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MIRToStakeCredentials = MIRToStakeCredentials;
|
|
|
|
const MalformedAddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_malformedaddress_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MalformedAddress {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MalformedAddress.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MalformedAddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MalformedAddressFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_malformedaddress_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
original_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitness_chain_code(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Address}
|
|
*/
|
|
to_address() {
|
|
const ret = wasm.malformedaddress_to_address(this.__wbg_ptr);
|
|
return Address.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Address} addr
|
|
* @returns {MalformedAddress | undefined}
|
|
*/
|
|
static from_address(addr) {
|
|
_assertClass(addr, Address);
|
|
const ret = wasm.malformedaddress_from_address(addr.__wbg_ptr);
|
|
return ret === 0 ? undefined : MalformedAddress.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MalformedAddress = MalformedAddress;
|
|
|
|
const MetadataListFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_metadatalist_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MetadataList {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MetadataList.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MetadataListFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MetadataListFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_metadatalist_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.metadatalist_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {MetadataList}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.metadatalist_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MetadataList.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.metadatalist_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {MetadataList}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.metadatalist_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MetadataList.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {MetadataList}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.fixedtransactionbodies_new();
|
|
return MetadataList.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.fixedtransactionbodies_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.metadatalist_get(this.__wbg_ptr, index);
|
|
return TransactionMetadatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionMetadatum} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, TransactionMetadatum);
|
|
wasm.metadatalist_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.MetadataList = MetadataList;
|
|
|
|
const MetadataMapFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_metadatamap_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MetadataMap {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MetadataMap.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MetadataMapFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MetadataMapFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_metadatamap_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.metadatamap_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {MetadataMap}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.metadatamap_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MetadataMap.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.metadatamap_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {MetadataMap}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.metadatamap_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MetadataMap.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {MetadataMap}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.generaltransactionmetadata_new();
|
|
return MetadataMap.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.generaltransactionmetadata_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {TransactionMetadatum} key
|
|
* @param {TransactionMetadatum} value
|
|
* @returns {TransactionMetadatum | undefined}
|
|
*/
|
|
insert(key, value) {
|
|
_assertClass(key, TransactionMetadatum);
|
|
_assertClass(value, TransactionMetadatum);
|
|
const ret = wasm.metadatamap_insert(this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionMetadatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {string} key
|
|
* @param {TransactionMetadatum} value
|
|
* @returns {TransactionMetadatum | undefined}
|
|
*/
|
|
insert_str(key, value) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
_assertClass(value, TransactionMetadatum);
|
|
wasm.metadatamap_insert_str(retptr, this.__wbg_ptr, ptr0, len0, value.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 === 0 ? undefined : TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} key
|
|
* @param {TransactionMetadatum} value
|
|
* @returns {TransactionMetadatum | undefined}
|
|
*/
|
|
insert_i32(key, value) {
|
|
_assertClass(value, TransactionMetadatum);
|
|
const ret = wasm.metadatamap_insert_i32(this.__wbg_ptr, key, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionMetadatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionMetadatum} key
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
get(key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(key, TransactionMetadatum);
|
|
wasm.metadatamap_get(retptr, this.__wbg_ptr, key.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} key
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
get_str(key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.metadatamap_get_str(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} key
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
get_i32(key) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.metadatamap_get_i32(retptr, this.__wbg_ptr, key);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {TransactionMetadatum} key
|
|
* @returns {boolean}
|
|
*/
|
|
has(key) {
|
|
_assertClass(key, TransactionMetadatum);
|
|
const ret = wasm.metadatamap_has(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {MetadataList}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.metadatamap_keys(this.__wbg_ptr);
|
|
return MetadataList.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MetadataMap = MetadataMap;
|
|
|
|
const MintFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_mint_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Mint {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Mint.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MintFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MintFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_mint_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mint_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Mint}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.mint_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Mint.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mint_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Mint}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.mint_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Mint.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mint_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mint_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Mint}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.mint_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Mint.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Mint}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.assetnames_new();
|
|
return Mint.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptHash} key
|
|
* @param {MintAssets} value
|
|
* @returns {Mint}
|
|
*/
|
|
static new_from_entry(key, value) {
|
|
_assertClass(key, ScriptHash);
|
|
_assertClass(value, MintAssets);
|
|
const ret = wasm.mint_new_from_entry(key.__wbg_ptr, value.__wbg_ptr);
|
|
return Mint.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {ScriptHash} key
|
|
* @param {MintAssets} value
|
|
* @returns {MintAssets | undefined}
|
|
*/
|
|
insert(key, value) {
|
|
_assertClass(key, ScriptHash);
|
|
_assertClass(value, MintAssets);
|
|
const ret = wasm.mint_insert(this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : MintAssets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptHash} key
|
|
* @returns {MintsAssets | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, ScriptHash);
|
|
const ret = wasm.mint_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : MintsAssets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptHashes}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.mint_keys(this.__wbg_ptr);
|
|
return ScriptHashes.__wrap(ret);
|
|
}
|
|
/**
|
|
* Returns the multiasset where only positive (minting) entries are present
|
|
* @returns {MultiAsset}
|
|
*/
|
|
as_positive_multiasset() {
|
|
const ret = wasm.mint_as_positive_multiasset(this.__wbg_ptr);
|
|
return MultiAsset.__wrap(ret);
|
|
}
|
|
/**
|
|
* Returns the multiasset where only negative (burning) entries are present
|
|
* @returns {MultiAsset}
|
|
*/
|
|
as_negative_multiasset() {
|
|
const ret = wasm.mint_as_negative_multiasset(this.__wbg_ptr);
|
|
return MultiAsset.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Mint = Mint;
|
|
|
|
const MintAssetsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_mintassets_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MintAssets {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MintAssets.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MintAssetsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MintAssetsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_mintassets_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {MintAssets}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.assets_new();
|
|
return MintAssets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {AssetName} key
|
|
* @param {Int} value
|
|
* @returns {MintAssets}
|
|
*/
|
|
static new_from_entry(key, value) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(key, AssetName);
|
|
_assertClass(value, Int);
|
|
wasm.mintassets_new_from_entry(retptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MintAssets.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {AssetName} key
|
|
* @param {Int} value
|
|
* @returns {Int | undefined}
|
|
*/
|
|
insert(key, value) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(key, AssetName);
|
|
_assertClass(value, Int);
|
|
wasm.mintassets_insert(retptr, this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 === 0 ? undefined : Int.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {AssetName} key
|
|
* @returns {Int | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, AssetName);
|
|
const ret = wasm.mintassets_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : Int.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {AssetNames}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.mintassets_keys(this.__wbg_ptr);
|
|
return AssetNames.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MintAssets = MintAssets;
|
|
|
|
const MintBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_mintbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MintBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MintBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MintBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MintBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_mintbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {MintBuilder}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.mintbuilder_new();
|
|
return MintBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MintWitness} mint
|
|
* @param {AssetName} asset_name
|
|
* @param {Int} amount
|
|
*/
|
|
add_asset(mint, asset_name, amount) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(mint, MintWitness);
|
|
_assertClass(asset_name, AssetName);
|
|
_assertClass(amount, Int);
|
|
wasm.mintbuilder_add_asset(retptr, this.__wbg_ptr, mint.__wbg_ptr, asset_name.__wbg_ptr, amount.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {MintWitness} mint
|
|
* @param {AssetName} asset_name
|
|
* @param {Int} amount
|
|
*/
|
|
set_asset(mint, asset_name, amount) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(mint, MintWitness);
|
|
_assertClass(asset_name, AssetName);
|
|
_assertClass(amount, Int);
|
|
wasm.mintbuilder_set_asset(retptr, this.__wbg_ptr, mint.__wbg_ptr, asset_name.__wbg_ptr, amount.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Mint}
|
|
*/
|
|
build() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mintbuilder_build(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Mint.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {NativeScripts}
|
|
*/
|
|
get_native_scripts() {
|
|
const ret = wasm.mintbuilder_get_native_scripts(this.__wbg_ptr);
|
|
return NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusWitnesses}
|
|
*/
|
|
get_plutus_witnesses() {
|
|
const ret = wasm.mintbuilder_get_plutus_witnesses(this.__wbg_ptr);
|
|
return PlutusWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
get_ref_inputs() {
|
|
const ret = wasm.mintbuilder_get_ref_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Redeemers}
|
|
*/
|
|
get_redeemers() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mintbuilder_get_redeemers(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Redeemers.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_plutus_scripts() {
|
|
const ret = wasm.mintbuilder_has_plutus_scripts(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_native_scripts() {
|
|
const ret = wasm.mintbuilder_has_native_scripts(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.MintBuilder = MintBuilder;
|
|
|
|
const MintWitnessFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_mintwitness_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MintWitness {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MintWitness.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MintWitnessFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MintWitnessFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_mintwitness_free(ptr);
|
|
}
|
|
/**
|
|
* @param {NativeScriptSource} native_script
|
|
* @returns {MintWitness}
|
|
*/
|
|
static new_native_script(native_script) {
|
|
_assertClass(native_script, NativeScriptSource);
|
|
const ret = wasm.mintwitness_new_native_script(native_script.__wbg_ptr);
|
|
return MintWitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusScriptSource} plutus_script
|
|
* @param {Redeemer} redeemer
|
|
* @returns {MintWitness}
|
|
*/
|
|
static new_plutus_script(plutus_script, redeemer) {
|
|
_assertClass(plutus_script, PlutusScriptSource);
|
|
_assertClass(redeemer, Redeemer);
|
|
const ret = wasm.mintwitness_new_plutus_script(plutus_script.__wbg_ptr, redeemer.__wbg_ptr);
|
|
return MintWitness.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MintWitness = MintWitness;
|
|
|
|
const MintsAssetsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_mintsassets_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MintsAssets {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MintsAssets.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MintsAssetsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MintsAssetsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_mintsassets_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mintsassets_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.mintsassets_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {MintsAssets}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.mintsassets_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MintsAssets.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {MintsAssets}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.assetnames_new();
|
|
return MintsAssets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MintAssets} mint_assets
|
|
*/
|
|
add(mint_assets) {
|
|
_assertClass(mint_assets, MintAssets);
|
|
wasm.mintsassets_add(this.__wbg_ptr, mint_assets.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {MintAssets | undefined}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.mintsassets_get(this.__wbg_ptr, index);
|
|
return ret === 0 ? undefined : MintAssets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
}
|
|
module.exports.MintsAssets = MintsAssets;
|
|
|
|
const MoveInstantaneousRewardFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_moveinstantaneousreward_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MoveInstantaneousReward {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MoveInstantaneousReward.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MoveInstantaneousRewardFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MoveInstantaneousRewardFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_moveinstantaneousreward_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.moveinstantaneousreward_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {MoveInstantaneousReward}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.moveinstantaneousreward_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MoveInstantaneousReward.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.moveinstantaneousreward_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {MoveInstantaneousReward}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.moveinstantaneousreward_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MoveInstantaneousReward.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.moveinstantaneousreward_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.moveinstantaneousreward_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {MoveInstantaneousReward}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.moveinstantaneousreward_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MoveInstantaneousReward.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {MIRPot} pot
|
|
* @param {BigNum} amount
|
|
* @returns {MoveInstantaneousReward}
|
|
*/
|
|
static new_to_other_pot(pot, amount) {
|
|
_assertClass(amount, BigNum);
|
|
const ret = wasm.moveinstantaneousreward_new_to_other_pot(pot, amount.__wbg_ptr);
|
|
return MoveInstantaneousReward.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MIRPot} pot
|
|
* @param {MIRToStakeCredentials} amounts
|
|
* @returns {MoveInstantaneousReward}
|
|
*/
|
|
static new_to_stake_creds(pot, amounts) {
|
|
_assertClass(amounts, MIRToStakeCredentials);
|
|
const ret = wasm.moveinstantaneousreward_new_to_stake_creds(pot, amounts.__wbg_ptr);
|
|
return MoveInstantaneousReward.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {MIRPot}
|
|
*/
|
|
pot() {
|
|
const ret = wasm.moveinstantaneousreward_pot(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {MIRKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.moveinstantaneousreward_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
as_to_other_pot() {
|
|
const ret = wasm.moveinstantaneousreward_as_to_other_pot(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {MIRToStakeCredentials | undefined}
|
|
*/
|
|
as_to_stake_creds() {
|
|
const ret = wasm.moveinstantaneousreward_as_to_stake_creds(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : MIRToStakeCredentials.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MoveInstantaneousReward = MoveInstantaneousReward;
|
|
|
|
const MoveInstantaneousRewardsCertFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_moveinstantaneousrewardscert_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MoveInstantaneousRewardsCert {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MoveInstantaneousRewardsCert.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MoveInstantaneousRewardsCertFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MoveInstantaneousRewardsCertFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_moveinstantaneousrewardscert_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.moveinstantaneousrewardscert_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {MoveInstantaneousRewardsCert}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.moveinstantaneousrewardscert_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MoveInstantaneousRewardsCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.moveinstantaneousrewardscert_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {MoveInstantaneousRewardsCert}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.moveinstantaneousrewardscert_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MoveInstantaneousRewardsCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.moveinstantaneousrewardscert_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.moveinstantaneousrewardscert_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {MoveInstantaneousRewardsCert}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.moveinstantaneousrewardscert_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MoveInstantaneousRewardsCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {MoveInstantaneousReward}
|
|
*/
|
|
move_instantaneous_reward() {
|
|
const ret = wasm.moveinstantaneousrewardscert_move_instantaneous_reward(this.__wbg_ptr);
|
|
return MoveInstantaneousReward.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MoveInstantaneousReward} move_instantaneous_reward
|
|
* @returns {MoveInstantaneousRewardsCert}
|
|
*/
|
|
static new(move_instantaneous_reward) {
|
|
_assertClass(move_instantaneous_reward, MoveInstantaneousReward);
|
|
const ret = wasm.moveinstantaneousrewardscert_new(move_instantaneous_reward.__wbg_ptr);
|
|
return MoveInstantaneousRewardsCert.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MoveInstantaneousRewardsCert = MoveInstantaneousRewardsCert;
|
|
|
|
const MultiAssetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_multiasset_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MultiAsset {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MultiAsset.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MultiAssetFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MultiAssetFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_multiasset_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.multiasset_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {MultiAsset}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.multiasset_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MultiAsset.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.multiasset_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {MultiAsset}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.multiasset_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MultiAsset.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.multiasset_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.multiasset_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {MultiAsset}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.multiasset_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MultiAsset.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {MultiAsset}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.assets_new();
|
|
return MultiAsset.__wrap(ret);
|
|
}
|
|
/**
|
|
* the number of unique policy IDs in the multiasset
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* set (and replace if it exists) all assets with policy {policy_id} to a copy of {assets}
|
|
* @param {ScriptHash} policy_id
|
|
* @param {Assets} assets
|
|
* @returns {Assets | undefined}
|
|
*/
|
|
insert(policy_id, assets) {
|
|
_assertClass(policy_id, ScriptHash);
|
|
_assertClass(assets, Assets);
|
|
const ret = wasm.multiasset_insert(this.__wbg_ptr, policy_id.__wbg_ptr, assets.__wbg_ptr);
|
|
return ret === 0 ? undefined : Assets.__wrap(ret);
|
|
}
|
|
/**
|
|
* all assets under {policy_id}, if any exist, or else None (undefined in JS)
|
|
* @param {ScriptHash} policy_id
|
|
* @returns {Assets | undefined}
|
|
*/
|
|
get(policy_id) {
|
|
_assertClass(policy_id, ScriptHash);
|
|
const ret = wasm.multiasset_get(this.__wbg_ptr, policy_id.__wbg_ptr);
|
|
return ret === 0 ? undefined : Assets.__wrap(ret);
|
|
}
|
|
/**
|
|
* sets the asset {asset_name} to {value} under policy {policy_id}
|
|
* returns the previous amount if it was set, or else None (undefined in JS)
|
|
* @param {ScriptHash} policy_id
|
|
* @param {AssetName} asset_name
|
|
* @param {BigNum} value
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
set_asset(policy_id, asset_name, value) {
|
|
_assertClass(policy_id, ScriptHash);
|
|
_assertClass(asset_name, AssetName);
|
|
_assertClass(value, BigNum);
|
|
const ret = wasm.multiasset_set_asset(this.__wbg_ptr, policy_id.__wbg_ptr, asset_name.__wbg_ptr, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* returns the amount of asset {asset_name} under policy {policy_id}
|
|
* If such an asset does not exist, 0 is returned.
|
|
* @param {ScriptHash} policy_id
|
|
* @param {AssetName} asset_name
|
|
* @returns {BigNum}
|
|
*/
|
|
get_asset(policy_id, asset_name) {
|
|
_assertClass(policy_id, ScriptHash);
|
|
_assertClass(asset_name, AssetName);
|
|
const ret = wasm.multiasset_get_asset(this.__wbg_ptr, policy_id.__wbg_ptr, asset_name.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* returns all policy IDs used by assets in this multiasset
|
|
* @returns {ScriptHashes}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.multiasset_keys(this.__wbg_ptr);
|
|
return ScriptHashes.__wrap(ret);
|
|
}
|
|
/**
|
|
* removes an asset from the list if the result is 0 or less
|
|
* does not modify this object, instead the result is returned
|
|
* @param {MultiAsset} rhs_ma
|
|
* @returns {MultiAsset}
|
|
*/
|
|
sub(rhs_ma) {
|
|
_assertClass(rhs_ma, MultiAsset);
|
|
const ret = wasm.multiasset_sub(this.__wbg_ptr, rhs_ma.__wbg_ptr);
|
|
return MultiAsset.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MultiAsset = MultiAsset;
|
|
|
|
const MultiHostNameFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_multihostname_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class MultiHostName {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(MultiHostName.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
MultiHostNameFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
MultiHostNameFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_multihostname_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.multihostname_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {MultiHostName}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.multihostname_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MultiHostName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.multihostname_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {MultiHostName}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.multihostname_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MultiHostName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.multihostname_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.multihostname_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {MultiHostName}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.multihostname_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MultiHostName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {DNSRecordSRV}
|
|
*/
|
|
dns_name() {
|
|
const ret = wasm.multihostname_dns_name(this.__wbg_ptr);
|
|
return DNSRecordSRV.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {DNSRecordSRV} dns_name
|
|
* @returns {MultiHostName}
|
|
*/
|
|
static new(dns_name) {
|
|
_assertClass(dns_name, DNSRecordSRV);
|
|
const ret = wasm.multihostname_dns_name(dns_name.__wbg_ptr);
|
|
return MultiHostName.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.MultiHostName = MultiHostName;
|
|
|
|
const NativeScriptFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_nativescript_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class NativeScript {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(NativeScript.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
NativeScriptFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
NativeScriptFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_nativescript_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescript_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {NativeScript}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nativescript_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NativeScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescript_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {NativeScript}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nativescript_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NativeScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescript_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescript_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {NativeScript}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nativescript_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NativeScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {ScriptHash}
|
|
*/
|
|
hash() {
|
|
const ret = wasm.nativescript_hash(this.__wbg_ptr);
|
|
return ScriptHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptPubkey} script_pubkey
|
|
* @returns {NativeScript}
|
|
*/
|
|
static new_script_pubkey(script_pubkey) {
|
|
_assertClass(script_pubkey, ScriptPubkey);
|
|
const ret = wasm.nativescript_new_script_pubkey(script_pubkey.__wbg_ptr);
|
|
return NativeScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptAll} script_all
|
|
* @returns {NativeScript}
|
|
*/
|
|
static new_script_all(script_all) {
|
|
_assertClass(script_all, ScriptAll);
|
|
const ret = wasm.nativescript_new_script_all(script_all.__wbg_ptr);
|
|
return NativeScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptAny} script_any
|
|
* @returns {NativeScript}
|
|
*/
|
|
static new_script_any(script_any) {
|
|
_assertClass(script_any, ScriptAny);
|
|
const ret = wasm.nativescript_new_script_any(script_any.__wbg_ptr);
|
|
return NativeScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptNOfK} script_n_of_k
|
|
* @returns {NativeScript}
|
|
*/
|
|
static new_script_n_of_k(script_n_of_k) {
|
|
_assertClass(script_n_of_k, ScriptNOfK);
|
|
const ret = wasm.nativescript_new_script_n_of_k(script_n_of_k.__wbg_ptr);
|
|
return NativeScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TimelockStart} timelock_start
|
|
* @returns {NativeScript}
|
|
*/
|
|
static new_timelock_start(timelock_start) {
|
|
_assertClass(timelock_start, TimelockStart);
|
|
const ret = wasm.nativescript_new_timelock_start(timelock_start.__wbg_ptr);
|
|
return NativeScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TimelockExpiry} timelock_expiry
|
|
* @returns {NativeScript}
|
|
*/
|
|
static new_timelock_expiry(timelock_expiry) {
|
|
_assertClass(timelock_expiry, TimelockExpiry);
|
|
const ret = wasm.nativescript_new_timelock_expiry(timelock_expiry.__wbg_ptr);
|
|
return NativeScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NativeScriptKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.nativescript_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {ScriptPubkey | undefined}
|
|
*/
|
|
as_script_pubkey() {
|
|
const ret = wasm.nativescript_as_script_pubkey(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptPubkey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptAll | undefined}
|
|
*/
|
|
as_script_all() {
|
|
const ret = wasm.nativescript_as_script_all(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptAll.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptAny | undefined}
|
|
*/
|
|
as_script_any() {
|
|
const ret = wasm.nativescript_as_script_any(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptAny.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptNOfK | undefined}
|
|
*/
|
|
as_script_n_of_k() {
|
|
const ret = wasm.nativescript_as_script_n_of_k(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptNOfK.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TimelockStart | undefined}
|
|
*/
|
|
as_timelock_start() {
|
|
const ret = wasm.nativescript_as_timelock_start(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : TimelockStart.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TimelockExpiry | undefined}
|
|
*/
|
|
as_timelock_expiry() {
|
|
const ret = wasm.nativescript_as_timelock_expiry(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : TimelockExpiry.__wrap(ret);
|
|
}
|
|
/**
|
|
* Returns a set of Ed25519KeyHashes
|
|
* contained within this script recursively on any depth level.
|
|
* The order of the keys in the result is not determined in any way.
|
|
* @returns {Ed25519KeyHashes}
|
|
*/
|
|
get_required_signers() {
|
|
const ret = wasm.nativescript_get_required_signers(this.__wbg_ptr);
|
|
return Ed25519KeyHashes.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.NativeScript = NativeScript;
|
|
|
|
const NativeScriptSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_nativescriptsource_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class NativeScriptSource {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(NativeScriptSource.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
NativeScriptSourceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
NativeScriptSourceFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_nativescriptsource_free(ptr);
|
|
}
|
|
/**
|
|
* @param {NativeScript} script
|
|
* @returns {NativeScriptSource}
|
|
*/
|
|
static new(script) {
|
|
_assertClass(script, NativeScript);
|
|
const ret = wasm.nativescriptsource_new(script.__wbg_ptr);
|
|
return NativeScriptSource.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptHash} script_hash
|
|
* @param {TransactionInput} input
|
|
* @param {number} script_size
|
|
* @returns {NativeScriptSource}
|
|
*/
|
|
static new_ref_input(script_hash, input, script_size) {
|
|
_assertClass(script_hash, ScriptHash);
|
|
_assertClass(input, TransactionInput);
|
|
const ret = wasm.nativescriptsource_new_ref_input(script_hash.__wbg_ptr, input.__wbg_ptr, script_size);
|
|
return NativeScriptSource.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHashes} key_hashes
|
|
*/
|
|
set_required_signers(key_hashes) {
|
|
_assertClass(key_hashes, Ed25519KeyHashes);
|
|
wasm.nativescriptsource_set_required_signers(this.__wbg_ptr, key_hashes.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
get_ref_script_size() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescriptsource_get_ref_script_size(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.NativeScriptSource = NativeScriptSource;
|
|
|
|
const NativeScriptsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_nativescripts_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class NativeScripts {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(NativeScripts.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
NativeScriptsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
NativeScriptsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_nativescripts_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {NativeScripts}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.nativescripts_new();
|
|
return NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.nativescripts_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {NativeScript}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.nativescripts_get(this.__wbg_ptr, index);
|
|
return NativeScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {NativeScript} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, NativeScript);
|
|
wasm.nativescripts_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescripts_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {NativeScripts}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nativescripts_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NativeScripts.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescripts_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {NativeScripts}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nativescripts_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NativeScripts.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescripts_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nativescripts_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {NativeScripts}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nativescripts_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NativeScripts.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.NativeScripts = NativeScripts;
|
|
|
|
const NetworkIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_networkid_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class NetworkId {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(NetworkId.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
NetworkIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
NetworkIdFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_networkid_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.networkid_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {NetworkId}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.networkid_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NetworkId.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.networkid_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {NetworkId}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.networkid_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NetworkId.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.networkid_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.networkid_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {NetworkId}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.networkid_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NetworkId.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {NetworkId}
|
|
*/
|
|
static testnet() {
|
|
const ret = wasm.networkid_testnet();
|
|
return NetworkId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NetworkId}
|
|
*/
|
|
static mainnet() {
|
|
const ret = wasm.networkid_mainnet();
|
|
return NetworkId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NetworkIdKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.networkid_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.NetworkId = NetworkId;
|
|
|
|
const NetworkInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_networkinfo_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class NetworkInfo {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(NetworkInfo.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
NetworkInfoFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
NetworkInfoFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_networkinfo_free(ptr);
|
|
}
|
|
/**
|
|
* @param {number} network_id
|
|
* @param {number} protocol_magic
|
|
* @returns {NetworkInfo}
|
|
*/
|
|
static new(network_id, protocol_magic) {
|
|
const ret = wasm.networkinfo_new(network_id, protocol_magic);
|
|
return NetworkInfo.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
network_id() {
|
|
const ret = wasm.networkinfo_network_id(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
protocol_magic() {
|
|
const ret = wasm.networkinfo_protocol_magic(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @returns {NetworkInfo}
|
|
*/
|
|
static testnet_preview() {
|
|
const ret = wasm.networkinfo_testnet_preview();
|
|
return NetworkInfo.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NetworkInfo}
|
|
*/
|
|
static testnet_preprod() {
|
|
const ret = wasm.networkinfo_testnet_preprod();
|
|
return NetworkInfo.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NetworkInfo}
|
|
*/
|
|
static mainnet() {
|
|
const ret = wasm.networkinfo_mainnet();
|
|
return NetworkInfo.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.NetworkInfo = NetworkInfo;
|
|
|
|
const NewConstitutionActionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_newconstitutionaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class NewConstitutionAction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(NewConstitutionAction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
NewConstitutionActionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
NewConstitutionActionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_newconstitutionaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.newconstitutionaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {NewConstitutionAction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.newconstitutionaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NewConstitutionAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.newconstitutionaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {NewConstitutionAction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.newconstitutionaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NewConstitutionAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.newconstitutionaction_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.newconstitutionaction_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {NewConstitutionAction}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.newconstitutionaction_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NewConstitutionAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GovernanceActionId | undefined}
|
|
*/
|
|
gov_action_id() {
|
|
const ret = wasm.hardforkinitiationaction_gov_action_id(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : GovernanceActionId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Constitution}
|
|
*/
|
|
constitution() {
|
|
const ret = wasm.newconstitutionaction_constitution(this.__wbg_ptr);
|
|
return Constitution.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Constitution} constitution
|
|
* @returns {NewConstitutionAction}
|
|
*/
|
|
static new(constitution) {
|
|
_assertClass(constitution, Constitution);
|
|
const ret = wasm.newconstitutionaction_new(constitution.__wbg_ptr);
|
|
return NewConstitutionAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @param {Constitution} constitution
|
|
* @returns {NewConstitutionAction}
|
|
*/
|
|
static new_with_action_id(gov_action_id, constitution) {
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
_assertClass(constitution, Constitution);
|
|
const ret = wasm.newconstitutionaction_new_with_action_id(gov_action_id.__wbg_ptr, constitution.__wbg_ptr);
|
|
return NewConstitutionAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_hash() {
|
|
const ret = wasm.newconstitutionaction_has_script_hash(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.NewConstitutionAction = NewConstitutionAction;
|
|
|
|
const NoConfidenceActionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_noconfidenceaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class NoConfidenceAction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(NoConfidenceAction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
NoConfidenceActionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
NoConfidenceActionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_noconfidenceaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.noconfidenceaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {NoConfidenceAction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.noconfidenceaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NoConfidenceAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.noconfidenceaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {NoConfidenceAction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.noconfidenceaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NoConfidenceAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.noconfidenceaction_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.noconfidenceaction_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {NoConfidenceAction}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.noconfidenceaction_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return NoConfidenceAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GovernanceActionId | undefined}
|
|
*/
|
|
gov_action_id() {
|
|
const ret = wasm.hardforkinitiationaction_gov_action_id(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : GovernanceActionId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NoConfidenceAction}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.noconfidenceaction_new();
|
|
return NoConfidenceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @returns {NoConfidenceAction}
|
|
*/
|
|
static new_with_action_id(gov_action_id) {
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
const ret = wasm.noconfidenceaction_new_with_action_id(gov_action_id.__wbg_ptr);
|
|
return NoConfidenceAction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.NoConfidenceAction = NoConfidenceAction;
|
|
|
|
const NonceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_nonce_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Nonce {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Nonce.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
NonceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
NonceFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_nonce_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nonce_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Nonce}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nonce_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Nonce.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nonce_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Nonce}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nonce_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Nonce.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nonce_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nonce_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Nonce}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nonce_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Nonce.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Nonce}
|
|
*/
|
|
static new_identity() {
|
|
const ret = wasm.nonce_new_identity();
|
|
return Nonce.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} hash
|
|
* @returns {Nonce}
|
|
*/
|
|
static new_from_hash(hash) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(hash, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.nonce_new_from_hash(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Nonce.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array | undefined}
|
|
*/
|
|
get_hash() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.nonce_get_hash(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
let v1;
|
|
if (r0 !== 0) {
|
|
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
}
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Nonce = Nonce;
|
|
|
|
const OperationalCertFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_operationalcert_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class OperationalCert {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(OperationalCert.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
OperationalCertFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
OperationalCertFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_operationalcert_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.operationalcert_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {OperationalCert}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.operationalcert_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return OperationalCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.operationalcert_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {OperationalCert}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.operationalcert_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return OperationalCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.operationalcert_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.operationalcert_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {OperationalCert}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.operationalcert_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return OperationalCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {KESVKey}
|
|
*/
|
|
hot_vkey() {
|
|
const ret = wasm.operationalcert_hot_vkey(this.__wbg_ptr);
|
|
return KESVKey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
sequence_number() {
|
|
const ret = wasm.operationalcert_sequence_number(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
kes_period() {
|
|
const ret = wasm.operationalcert_kes_period(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @returns {Ed25519Signature}
|
|
*/
|
|
sigma() {
|
|
const ret = wasm.operationalcert_sigma(this.__wbg_ptr);
|
|
return Ed25519Signature.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {KESVKey} hot_vkey
|
|
* @param {number} sequence_number
|
|
* @param {number} kes_period
|
|
* @param {Ed25519Signature} sigma
|
|
* @returns {OperationalCert}
|
|
*/
|
|
static new(hot_vkey, sequence_number, kes_period, sigma) {
|
|
_assertClass(hot_vkey, KESVKey);
|
|
_assertClass(sigma, Ed25519Signature);
|
|
const ret = wasm.operationalcert_new(hot_vkey.__wbg_ptr, sequence_number, kes_period, sigma.__wbg_ptr);
|
|
return OperationalCert.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.OperationalCert = OperationalCert;
|
|
|
|
const OutputDatumFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_outputdatum_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class OutputDatum {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(OutputDatum.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
OutputDatumFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
OutputDatumFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_outputdatum_free(ptr);
|
|
}
|
|
/**
|
|
* @param {DataHash} data_hash
|
|
* @returns {OutputDatum}
|
|
*/
|
|
static new_data_hash(data_hash) {
|
|
_assertClass(data_hash, DataHash);
|
|
const ret = wasm.outputdatum_new_data_hash(data_hash.__wbg_ptr);
|
|
return OutputDatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusData} data
|
|
* @returns {OutputDatum}
|
|
*/
|
|
static new_data(data) {
|
|
_assertClass(data, PlutusData);
|
|
const ret = wasm.outputdatum_new_data(data.__wbg_ptr);
|
|
return OutputDatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DataHash | undefined}
|
|
*/
|
|
data_hash() {
|
|
const ret = wasm.outputdatum_data_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : DataHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusData | undefined}
|
|
*/
|
|
data() {
|
|
const ret = wasm.outputdatum_data(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusData.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.OutputDatum = OutputDatum;
|
|
|
|
const ParameterChangeActionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_parameterchangeaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ParameterChangeAction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ParameterChangeAction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ParameterChangeActionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ParameterChangeActionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_parameterchangeaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.parameterchangeaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ParameterChangeAction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.parameterchangeaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ParameterChangeAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.parameterchangeaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ParameterChangeAction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.parameterchangeaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ParameterChangeAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.parameterchangeaction_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.parameterchangeaction_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ParameterChangeAction}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.parameterchangeaction_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ParameterChangeAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GovernanceActionId | undefined}
|
|
*/
|
|
gov_action_id() {
|
|
const ret = wasm.parameterchangeaction_gov_action_id(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : GovernanceActionId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ProtocolParamUpdate}
|
|
*/
|
|
protocol_param_updates() {
|
|
const ret = wasm.parameterchangeaction_protocol_param_updates(this.__wbg_ptr);
|
|
return ProtocolParamUpdate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptHash | undefined}
|
|
*/
|
|
policy_hash() {
|
|
const ret = wasm.parameterchangeaction_policy_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ProtocolParamUpdate} protocol_param_updates
|
|
* @returns {ParameterChangeAction}
|
|
*/
|
|
static new(protocol_param_updates) {
|
|
_assertClass(protocol_param_updates, ProtocolParamUpdate);
|
|
const ret = wasm.parameterchangeaction_new(protocol_param_updates.__wbg_ptr);
|
|
return ParameterChangeAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @param {ProtocolParamUpdate} protocol_param_updates
|
|
* @returns {ParameterChangeAction}
|
|
*/
|
|
static new_with_action_id(gov_action_id, protocol_param_updates) {
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
_assertClass(protocol_param_updates, ProtocolParamUpdate);
|
|
const ret = wasm.parameterchangeaction_new_with_action_id(gov_action_id.__wbg_ptr, protocol_param_updates.__wbg_ptr);
|
|
return ParameterChangeAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ProtocolParamUpdate} protocol_param_updates
|
|
* @param {ScriptHash} policy_hash
|
|
* @returns {ParameterChangeAction}
|
|
*/
|
|
static new_with_policy_hash(protocol_param_updates, policy_hash) {
|
|
_assertClass(protocol_param_updates, ProtocolParamUpdate);
|
|
_assertClass(policy_hash, ScriptHash);
|
|
const ret = wasm.parameterchangeaction_new_with_policy_hash(protocol_param_updates.__wbg_ptr, policy_hash.__wbg_ptr);
|
|
return ParameterChangeAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @param {ProtocolParamUpdate} protocol_param_updates
|
|
* @param {ScriptHash} policy_hash
|
|
* @returns {ParameterChangeAction}
|
|
*/
|
|
static new_with_policy_hash_and_action_id(gov_action_id, protocol_param_updates, policy_hash) {
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
_assertClass(protocol_param_updates, ProtocolParamUpdate);
|
|
_assertClass(policy_hash, ScriptHash);
|
|
const ret = wasm.parameterchangeaction_new_with_policy_hash_and_action_id(gov_action_id.__wbg_ptr, protocol_param_updates.__wbg_ptr, policy_hash.__wbg_ptr);
|
|
return ParameterChangeAction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ParameterChangeAction = ParameterChangeAction;
|
|
|
|
const PlutusDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutusdata_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusData {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusData.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusDataFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutusdata_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusdata_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusData}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusdata_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusdata_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PlutusData}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusdata_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {ConstrPlutusData} constr_plutus_data
|
|
* @returns {PlutusData}
|
|
*/
|
|
static new_constr_plutus_data(constr_plutus_data) {
|
|
_assertClass(constr_plutus_data, ConstrPlutusData);
|
|
const ret = wasm.plutusdata_new_constr_plutus_data(constr_plutus_data.__wbg_ptr);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* Same as `.new_constr_plutus_data` but creates constr with empty data list
|
|
* @param {BigNum} alternative
|
|
* @returns {PlutusData}
|
|
*/
|
|
static new_empty_constr_plutus_data(alternative) {
|
|
_assertClass(alternative, BigNum);
|
|
const ret = wasm.plutusdata_new_empty_constr_plutus_data(alternative.__wbg_ptr);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} alternative
|
|
* @param {PlutusData} plutus_data
|
|
* @returns {PlutusData}
|
|
*/
|
|
static new_single_value_constr_plutus_data(alternative, plutus_data) {
|
|
_assertClass(alternative, BigNum);
|
|
_assertClass(plutus_data, PlutusData);
|
|
const ret = wasm.plutusdata_new_single_value_constr_plutus_data(alternative.__wbg_ptr, plutus_data.__wbg_ptr);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusMap} map
|
|
* @returns {PlutusData}
|
|
*/
|
|
static new_map(map) {
|
|
_assertClass(map, PlutusMap);
|
|
const ret = wasm.plutusdata_new_map(map.__wbg_ptr);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusList} list
|
|
* @returns {PlutusData}
|
|
*/
|
|
static new_list(list) {
|
|
_assertClass(list, PlutusList);
|
|
const ret = wasm.plutusdata_new_list(list.__wbg_ptr);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigInt} integer
|
|
* @returns {PlutusData}
|
|
*/
|
|
static new_integer(integer) {
|
|
_assertClass(integer, BigInt);
|
|
const ret = wasm.plutusdata_new_integer(integer.__wbg_ptr);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusData}
|
|
*/
|
|
static new_bytes(bytes) {
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ret = wasm.plutusdata_new_bytes(ptr0, len0);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusDataKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.plutusdata_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {ConstrPlutusData | undefined}
|
|
*/
|
|
as_constr_plutus_data() {
|
|
const ret = wasm.plutusdata_as_constr_plutus_data(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ConstrPlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusMap | undefined}
|
|
*/
|
|
as_map() {
|
|
const ret = wasm.plutusdata_as_map(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusMap.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusList | undefined}
|
|
*/
|
|
as_list() {
|
|
const ret = wasm.plutusdata_as_list(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusList.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigInt | undefined}
|
|
*/
|
|
as_integer() {
|
|
const ret = wasm.plutusdata_as_integer(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigInt.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array | undefined}
|
|
*/
|
|
as_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusdata_as_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
let v1;
|
|
if (r0 !== 0) {
|
|
v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
}
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {PlutusDatumSchema} schema
|
|
* @returns {string}
|
|
*/
|
|
to_json(schema) {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.decode_plutus_datum_to_json_str(retptr, this.__wbg_ptr, schema);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @param {PlutusDatumSchema} schema
|
|
* @returns {PlutusData}
|
|
*/
|
|
static from_json(json, schema) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.encode_json_str_to_plutus_datum(retptr, ptr0, len0, schema);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Address} address
|
|
* @returns {PlutusData}
|
|
*/
|
|
static from_address(address) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, Address);
|
|
wasm.plutusdata_from_address(retptr, address.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusData.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {NetworkInfo} network
|
|
* @returns {Address}
|
|
*/
|
|
as_address(network) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(network, NetworkInfo);
|
|
wasm.plutusdata_as_address(retptr, this.__wbg_ptr, network.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Address.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.PlutusData = PlutusData;
|
|
|
|
const PlutusListFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutuslist_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusList {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusList.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusListFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusListFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutuslist_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutuslist_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusList}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutuslist_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusList.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutuslist_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PlutusList}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutuslist_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusList.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PlutusList}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.plutuslist_new();
|
|
return PlutusList.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.plutuslist_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {PlutusData}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.plutuslist_get(this.__wbg_ptr, index);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusData} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, PlutusData);
|
|
wasm.plutuslist_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.PlutusList = PlutusList;
|
|
|
|
const PlutusMapFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutusmap_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusMap {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusMap.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusMapFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusMapFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutusmap_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusmap_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusMap}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusmap_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusMap.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusmap_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PlutusMap}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusmap_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusMap.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PlutusMap}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.plutusmap_new();
|
|
return PlutusMap.__wrap(ret);
|
|
}
|
|
/**
|
|
* Return count ok different keys in the map.
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.plutusmap_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* Returns the previous value associated with the key, if any.
|
|
* Replace the values associated with the key.
|
|
* @param {PlutusData} key
|
|
* @param {PlutusMapValues} values
|
|
* @returns {PlutusMapValues | undefined}
|
|
*/
|
|
insert(key, values) {
|
|
_assertClass(key, PlutusData);
|
|
_assertClass(values, PlutusMapValues);
|
|
const ret = wasm.plutusmap_insert(this.__wbg_ptr, key.__wbg_ptr, values.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusMapValues.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusData} key
|
|
* @returns {PlutusMapValues | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, PlutusData);
|
|
const ret = wasm.plutusmap_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusMapValues.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusList}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.plutusmap_keys(this.__wbg_ptr);
|
|
return PlutusList.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PlutusMap = PlutusMap;
|
|
|
|
const PlutusMapValuesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutusmapvalues_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusMapValues {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusMapValues.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusMapValuesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusMapValuesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutusmapvalues_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {PlutusMapValues}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.plutusmapvalues_new();
|
|
return PlutusMapValues.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.plutuslist_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {PlutusData | undefined}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.plutusmapvalues_get(this.__wbg_ptr, index);
|
|
return ret === 0 ? undefined : PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusData} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, PlutusData);
|
|
wasm.plutusmapvalues_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.PlutusMapValues = PlutusMapValues;
|
|
|
|
const PlutusScriptFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutusscript_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusScript {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusScript.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusScriptFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusScriptFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutusscript_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusscript_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusscript_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusscript_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusscript_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
*
|
|
* * Creates a new Plutus script from the RAW bytes of the compiled script.
|
|
* * This does NOT include any CBOR encoding around these bytes (e.g. from "cborBytes" in cardano-cli)
|
|
* * If you creating this from those you should use PlutusScript::from_bytes() instead.
|
|
*
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static new(bytes) {
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ret = wasm.plutusscript_new(ptr0, len0);
|
|
return PlutusScript.__wrap(ret);
|
|
}
|
|
/**
|
|
*
|
|
* * Creates a new Plutus script from the RAW bytes of the compiled script.
|
|
* * This does NOT include any CBOR encoding around these bytes (e.g. from "cborBytes" in cardano-cli)
|
|
* * If you creating this from those you should use PlutusScript::from_bytes() instead.
|
|
*
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static new_v2(bytes) {
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ret = wasm.plutusscript_new_v2(ptr0, len0);
|
|
return PlutusScript.__wrap(ret);
|
|
}
|
|
/**
|
|
*
|
|
* * Creates a new Plutus script from the RAW bytes of the compiled script.
|
|
* * This does NOT include any CBOR encoding around these bytes (e.g. from "cborBytes" in cardano-cli)
|
|
* * If you creating this from those you should use PlutusScript::from_bytes() instead.
|
|
*
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static new_v3(bytes) {
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ret = wasm.plutusscript_new_v3(ptr0, len0);
|
|
return PlutusScript.__wrap(ret);
|
|
}
|
|
/**
|
|
*
|
|
* * Creates a new Plutus script from the RAW bytes of the compiled script.
|
|
* * This does NOT include any CBOR encoding around these bytes (e.g. from "cborBytes" in cardano-cli)
|
|
* * If you creating this from those you should use PlutusScript::from_bytes() instead.
|
|
*
|
|
* @param {Uint8Array} bytes
|
|
* @param {Language} language
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static new_with_version(bytes, language) {
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
_assertClass(language, Language);
|
|
const ret = wasm.plutusscript_new_with_version(ptr0, len0, language.__wbg_ptr);
|
|
return PlutusScript.__wrap(ret);
|
|
}
|
|
/**
|
|
*
|
|
* * The raw bytes of this compiled Plutus script.
|
|
* * If you need "cborBytes" for cardano-cli use PlutusScript::to_bytes() instead.
|
|
*
|
|
* @returns {Uint8Array}
|
|
*/
|
|
bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.bootstrapwitness_chain_code(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Same as `.from_bytes` but will consider the script as requiring the Plutus Language V2
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static from_bytes_v2(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusscript_from_bytes_v2(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Same as `.from_bytes` but will consider the script as requiring the Plutus Language V3
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static from_bytes_v3(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusscript_from_bytes_v3(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Same as `.from_bytes` but will consider the script as requiring the specified language version
|
|
* @param {Uint8Array} bytes
|
|
* @param {Language} language
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static from_bytes_with_version(bytes, language) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
_assertClass(language, Language);
|
|
wasm.plutusscript_from_bytes_with_version(retptr, ptr0, len0, language.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Same as .from_hex but will consider the script as requiring the specified language version
|
|
* @param {string} hex_str
|
|
* @param {Language} language
|
|
* @returns {PlutusScript}
|
|
*/
|
|
static from_hex_with_version(hex_str, language) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
_assertClass(language, Language);
|
|
wasm.plutusscript_from_hex_with_version(retptr, ptr0, len0, language.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScript.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {ScriptHash}
|
|
*/
|
|
hash() {
|
|
const ret = wasm.plutusscript_hash(this.__wbg_ptr);
|
|
return ScriptHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Language}
|
|
*/
|
|
language_version() {
|
|
const ret = wasm.plutusscript_language_version(this.__wbg_ptr);
|
|
return Language.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PlutusScript = PlutusScript;
|
|
|
|
const PlutusScriptSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutusscriptsource_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusScriptSource {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusScriptSource.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusScriptSourceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusScriptSourceFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutusscriptsource_free(ptr);
|
|
}
|
|
/**
|
|
* @param {PlutusScript} script
|
|
* @returns {PlutusScriptSource}
|
|
*/
|
|
static new(script) {
|
|
_assertClass(script, PlutusScript);
|
|
const ret = wasm.plutusscriptsource_new(script.__wbg_ptr);
|
|
return PlutusScriptSource.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptHash} script_hash
|
|
* @param {TransactionInput} input
|
|
* @param {Language} lang_ver
|
|
* @param {number} script_size
|
|
* @returns {PlutusScriptSource}
|
|
*/
|
|
static new_ref_input(script_hash, input, lang_ver, script_size) {
|
|
_assertClass(script_hash, ScriptHash);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(lang_ver, Language);
|
|
const ret = wasm.plutusscriptsource_new_ref_input(script_hash.__wbg_ptr, input.__wbg_ptr, lang_ver.__wbg_ptr, script_size);
|
|
return PlutusScriptSource.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHashes} key_hashes
|
|
*/
|
|
set_required_signers(key_hashes) {
|
|
_assertClass(key_hashes, Ed25519KeyHashes);
|
|
wasm.plutusscriptsource_set_required_signers(this.__wbg_ptr, key_hashes.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
get_ref_script_size() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusscriptsource_get_ref_script_size(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.PlutusScriptSource = PlutusScriptSource;
|
|
|
|
const PlutusScriptsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutusscripts_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusScripts {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusScripts.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusScriptsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusScriptsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutusscripts_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusscripts_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PlutusScripts}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusscripts_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScripts.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusscripts_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PlutusScripts}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusscripts_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScripts.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusscripts_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.plutusscripts_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {PlutusScripts}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.plutusscripts_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PlutusScripts.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PlutusScripts}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.plutusscripts_new();
|
|
return PlutusScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.plutusscripts_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {PlutusScript}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.plutusscripts_get(this.__wbg_ptr, index);
|
|
return PlutusScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusScript} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, PlutusScript);
|
|
wasm.plutusscripts_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.PlutusScripts = PlutusScripts;
|
|
|
|
const PlutusWitnessFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutuswitness_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusWitness {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusWitness.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusWitnessFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusWitnessFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutuswitness_free(ptr);
|
|
}
|
|
/**
|
|
* @param {PlutusScript} script
|
|
* @param {PlutusData} datum
|
|
* @param {Redeemer} redeemer
|
|
* @returns {PlutusWitness}
|
|
*/
|
|
static new(script, datum, redeemer) {
|
|
_assertClass(script, PlutusScript);
|
|
_assertClass(datum, PlutusData);
|
|
_assertClass(redeemer, Redeemer);
|
|
const ret = wasm.plutuswitness_new(script.__wbg_ptr, datum.__wbg_ptr, redeemer.__wbg_ptr);
|
|
return PlutusWitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusScriptSource} script
|
|
* @param {DatumSource} datum
|
|
* @param {Redeemer} redeemer
|
|
* @returns {PlutusWitness}
|
|
*/
|
|
static new_with_ref(script, datum, redeemer) {
|
|
_assertClass(script, PlutusScriptSource);
|
|
_assertClass(datum, DatumSource);
|
|
_assertClass(redeemer, Redeemer);
|
|
const ret = wasm.plutuswitness_new_with_ref(script.__wbg_ptr, datum.__wbg_ptr, redeemer.__wbg_ptr);
|
|
return PlutusWitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusScript} script
|
|
* @param {Redeemer} redeemer
|
|
* @returns {PlutusWitness}
|
|
*/
|
|
static new_without_datum(script, redeemer) {
|
|
_assertClass(script, PlutusScript);
|
|
_assertClass(redeemer, Redeemer);
|
|
const ret = wasm.plutuswitness_new_without_datum(script.__wbg_ptr, redeemer.__wbg_ptr);
|
|
return PlutusWitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusScriptSource} script
|
|
* @param {Redeemer} redeemer
|
|
* @returns {PlutusWitness}
|
|
*/
|
|
static new_with_ref_without_datum(script, redeemer) {
|
|
_assertClass(script, PlutusScriptSource);
|
|
_assertClass(redeemer, Redeemer);
|
|
const ret = wasm.plutuswitness_new_with_ref_without_datum(script.__wbg_ptr, redeemer.__wbg_ptr);
|
|
return PlutusWitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusScript | undefined}
|
|
*/
|
|
script() {
|
|
const ret = wasm.plutuswitness_script(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusData | undefined}
|
|
*/
|
|
datum() {
|
|
const ret = wasm.plutuswitness_datum(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Redeemer}
|
|
*/
|
|
redeemer() {
|
|
const ret = wasm.plutuswitness_redeemer(this.__wbg_ptr);
|
|
return Redeemer.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PlutusWitness = PlutusWitness;
|
|
|
|
const PlutusWitnessesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_plutuswitnesses_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PlutusWitnesses {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PlutusWitnesses.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PlutusWitnessesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PlutusWitnessesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_plutuswitnesses_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {PlutusWitnesses}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.plutuswitnesses_new();
|
|
return PlutusWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.governanceactionids_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {PlutusWitness}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.plutuswitnesses_get(this.__wbg_ptr, index);
|
|
return PlutusWitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusWitness} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, PlutusWitness);
|
|
wasm.plutuswitnesses_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.PlutusWitnesses = PlutusWitnesses;
|
|
|
|
const PointerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_pointer_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Pointer {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Pointer.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PointerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PointerFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_pointer_free(ptr);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* This constructor uses outdated slot number format for the ttl value, tx_index and cert_index.
|
|
* Use `.new_pointer` instead
|
|
* @param {number} slot
|
|
* @param {number} tx_index
|
|
* @param {number} cert_index
|
|
* @returns {Pointer}
|
|
*/
|
|
static new(slot, tx_index, cert_index) {
|
|
const ret = wasm.pointer_new(slot, tx_index, cert_index);
|
|
return Pointer.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} slot
|
|
* @param {BigNum} tx_index
|
|
* @param {BigNum} cert_index
|
|
* @returns {Pointer}
|
|
*/
|
|
static new_pointer(slot, tx_index, cert_index) {
|
|
_assertClass(slot, BigNum);
|
|
_assertClass(tx_index, BigNum);
|
|
_assertClass(cert_index, BigNum);
|
|
const ret = wasm.pointer_new_pointer(slot.__wbg_ptr, tx_index.__wbg_ptr, cert_index.__wbg_ptr);
|
|
return Pointer.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
slot() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.pointer_slot(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
tx_index() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.pointer_tx_index(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
cert_index() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.pointer_cert_index(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
slot_bignum() {
|
|
const ret = wasm.pointer_slot_bignum(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
tx_index_bignum() {
|
|
const ret = wasm.pointer_tx_index_bignum(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
cert_index_bignum() {
|
|
const ret = wasm.pointer_cert_index_bignum(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Pointer = Pointer;
|
|
|
|
const PointerAddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_pointeraddress_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PointerAddress {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PointerAddress.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PointerAddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PointerAddressFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_pointeraddress_free(ptr);
|
|
}
|
|
/**
|
|
* @param {number} network
|
|
* @param {Credential} payment
|
|
* @param {Pointer} stake
|
|
* @returns {PointerAddress}
|
|
*/
|
|
static new(network, payment, stake) {
|
|
_assertClass(payment, Credential);
|
|
_assertClass(stake, Pointer);
|
|
const ret = wasm.pointeraddress_new(network, payment.__wbg_ptr, stake.__wbg_ptr);
|
|
return PointerAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
payment_cred() {
|
|
const ret = wasm.pointeraddress_payment_cred(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Pointer}
|
|
*/
|
|
stake_pointer() {
|
|
const ret = wasm.pointeraddress_stake_pointer(this.__wbg_ptr);
|
|
return Pointer.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Address}
|
|
*/
|
|
to_address() {
|
|
const ret = wasm.pointeraddress_to_address(this.__wbg_ptr);
|
|
return Address.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Address} addr
|
|
* @returns {PointerAddress | undefined}
|
|
*/
|
|
static from_address(addr) {
|
|
_assertClass(addr, Address);
|
|
const ret = wasm.pointeraddress_from_address(addr.__wbg_ptr);
|
|
return ret === 0 ? undefined : PointerAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
network_id() {
|
|
const ret = wasm.pointeraddress_network_id(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.PointerAddress = PointerAddress;
|
|
|
|
const PoolMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_poolmetadata_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PoolMetadata {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PoolMetadata.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PoolMetadataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PoolMetadataFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_poolmetadata_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolmetadata_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PoolMetadata}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolmetadata_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolMetadata.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolmetadata_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PoolMetadata}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolmetadata_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolMetadata.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolmetadata_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolmetadata_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {PoolMetadata}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolmetadata_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolMetadata.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {URL}
|
|
*/
|
|
url() {
|
|
const ret = wasm.multihostname_dns_name(this.__wbg_ptr);
|
|
return URL.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PoolMetadataHash}
|
|
*/
|
|
pool_metadata_hash() {
|
|
const ret = wasm.poolmetadata_pool_metadata_hash(this.__wbg_ptr);
|
|
return PoolMetadataHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {URL} url
|
|
* @param {PoolMetadataHash} pool_metadata_hash
|
|
* @returns {PoolMetadata}
|
|
*/
|
|
static new(url, pool_metadata_hash) {
|
|
_assertClass(url, URL);
|
|
_assertClass(pool_metadata_hash, PoolMetadataHash);
|
|
const ret = wasm.poolmetadata_new(url.__wbg_ptr, pool_metadata_hash.__wbg_ptr);
|
|
return PoolMetadata.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PoolMetadata = PoolMetadata;
|
|
|
|
const PoolMetadataHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_poolmetadatahash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PoolMetadataHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PoolMetadataHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PoolMetadataHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PoolMetadataHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_poolmetadatahash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PoolMetadataHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolmetadatahash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolMetadataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {PoolMetadataHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolmetadatahash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolMetadataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {PoolMetadataHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolmetadatahash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolMetadataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.PoolMetadataHash = PoolMetadataHash;
|
|
|
|
const PoolParamsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_poolparams_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PoolParams {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PoolParams.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PoolParamsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PoolParamsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_poolparams_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolparams_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PoolParams}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolparams_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolParams.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolparams_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PoolParams}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolparams_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolParams.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolparams_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolparams_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {PoolParams}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolparams_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolParams.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
operator() {
|
|
const ret = wasm.poolparams_operator(this.__wbg_ptr);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {VRFKeyHash}
|
|
*/
|
|
vrf_keyhash() {
|
|
const ret = wasm.poolparams_vrf_keyhash(this.__wbg_ptr);
|
|
return VRFKeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
pledge() {
|
|
const ret = wasm.poolparams_pledge(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
cost() {
|
|
const ret = wasm.poolparams_cost(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
margin() {
|
|
const ret = wasm.poolparams_margin(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RewardAddress}
|
|
*/
|
|
reward_account() {
|
|
const ret = wasm.poolparams_reward_account(this.__wbg_ptr);
|
|
return RewardAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHashes}
|
|
*/
|
|
pool_owners() {
|
|
const ret = wasm.poolparams_pool_owners(this.__wbg_ptr);
|
|
return Ed25519KeyHashes.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Relays}
|
|
*/
|
|
relays() {
|
|
const ret = wasm.poolparams_relays(this.__wbg_ptr);
|
|
return Relays.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PoolMetadata | undefined}
|
|
*/
|
|
pool_metadata() {
|
|
const ret = wasm.poolparams_pool_metadata(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PoolMetadata.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} operator
|
|
* @param {VRFKeyHash} vrf_keyhash
|
|
* @param {BigNum} pledge
|
|
* @param {BigNum} cost
|
|
* @param {UnitInterval} margin
|
|
* @param {RewardAddress} reward_account
|
|
* @param {Ed25519KeyHashes} pool_owners
|
|
* @param {Relays} relays
|
|
* @param {PoolMetadata | undefined} [pool_metadata]
|
|
* @returns {PoolParams}
|
|
*/
|
|
static new(operator, vrf_keyhash, pledge, cost, margin, reward_account, pool_owners, relays, pool_metadata) {
|
|
_assertClass(operator, Ed25519KeyHash);
|
|
_assertClass(vrf_keyhash, VRFKeyHash);
|
|
_assertClass(pledge, BigNum);
|
|
_assertClass(cost, BigNum);
|
|
_assertClass(margin, UnitInterval);
|
|
_assertClass(reward_account, RewardAddress);
|
|
_assertClass(pool_owners, Ed25519KeyHashes);
|
|
_assertClass(relays, Relays);
|
|
let ptr0 = 0;
|
|
if (!isLikeNone(pool_metadata)) {
|
|
_assertClass(pool_metadata, PoolMetadata);
|
|
ptr0 = pool_metadata.__destroy_into_raw();
|
|
}
|
|
const ret = wasm.poolparams_new(operator.__wbg_ptr, vrf_keyhash.__wbg_ptr, pledge.__wbg_ptr, cost.__wbg_ptr, margin.__wbg_ptr, reward_account.__wbg_ptr, pool_owners.__wbg_ptr, relays.__wbg_ptr, ptr0);
|
|
return PoolParams.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PoolParams = PoolParams;
|
|
|
|
const PoolRegistrationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_poolregistration_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PoolRegistration {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PoolRegistration.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PoolRegistrationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PoolRegistrationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_poolregistration_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolregistration_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PoolRegistration}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolregistration_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolregistration_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PoolRegistration}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolregistration_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolregistration_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolregistration_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {PoolRegistration}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolregistration_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PoolParams}
|
|
*/
|
|
pool_params() {
|
|
const ret = wasm.poolregistration_pool_params(this.__wbg_ptr);
|
|
return PoolParams.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PoolParams} pool_params
|
|
* @returns {PoolRegistration}
|
|
*/
|
|
static new(pool_params) {
|
|
_assertClass(pool_params, PoolParams);
|
|
const ret = wasm.poolregistration_new(pool_params.__wbg_ptr);
|
|
return PoolRegistration.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PoolRegistration = PoolRegistration;
|
|
|
|
const PoolRetirementFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_poolretirement_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PoolRetirement {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PoolRetirement.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PoolRetirementFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PoolRetirementFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_poolretirement_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolretirement_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PoolRetirement}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolretirement_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolRetirement.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolretirement_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PoolRetirement}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolretirement_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolRetirement.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolretirement_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolretirement_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {PoolRetirement}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolretirement_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolRetirement.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
pool_keyhash() {
|
|
const ret = wasm.poolretirement_pool_keyhash(this.__wbg_ptr);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
epoch() {
|
|
const ret = wasm.poolretirement_epoch(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} pool_keyhash
|
|
* @param {number} epoch
|
|
* @returns {PoolRetirement}
|
|
*/
|
|
static new(pool_keyhash, epoch) {
|
|
_assertClass(pool_keyhash, Ed25519KeyHash);
|
|
const ret = wasm.poolretirement_new(pool_keyhash.__wbg_ptr, epoch);
|
|
return PoolRetirement.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PoolRetirement = PoolRetirement;
|
|
|
|
const PoolVotingThresholdsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_poolvotingthresholds_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PoolVotingThresholds {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PoolVotingThresholds.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PoolVotingThresholdsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PoolVotingThresholdsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_poolvotingthresholds_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolvotingthresholds_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PoolVotingThresholds}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolvotingthresholds_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolVotingThresholds.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolvotingthresholds_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PoolVotingThresholds}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolvotingthresholds_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolVotingThresholds.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolvotingthresholds_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.poolvotingthresholds_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {PoolVotingThresholds}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.poolvotingthresholds_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PoolVotingThresholds.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {UnitInterval} motion_no_confidence
|
|
* @param {UnitInterval} committee_normal
|
|
* @param {UnitInterval} committee_no_confidence
|
|
* @param {UnitInterval} hard_fork_initiation
|
|
* @param {UnitInterval} security_relevant_threshold
|
|
* @returns {PoolVotingThresholds}
|
|
*/
|
|
static new(motion_no_confidence, committee_normal, committee_no_confidence, hard_fork_initiation, security_relevant_threshold) {
|
|
_assertClass(motion_no_confidence, UnitInterval);
|
|
_assertClass(committee_normal, UnitInterval);
|
|
_assertClass(committee_no_confidence, UnitInterval);
|
|
_assertClass(hard_fork_initiation, UnitInterval);
|
|
_assertClass(security_relevant_threshold, UnitInterval);
|
|
const ret = wasm.poolvotingthresholds_new(motion_no_confidence.__wbg_ptr, committee_normal.__wbg_ptr, committee_no_confidence.__wbg_ptr, hard_fork_initiation.__wbg_ptr, security_relevant_threshold.__wbg_ptr);
|
|
return PoolVotingThresholds.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
motion_no_confidence() {
|
|
const ret = wasm.committee_quorum_threshold(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
committee_normal() {
|
|
const ret = wasm.drepvotingthresholds_committee_normal(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
committee_no_confidence() {
|
|
const ret = wasm.drepvotingthresholds_committee_no_confidence(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
hard_fork_initiation() {
|
|
const ret = wasm.drepvotingthresholds_update_constitution(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval}
|
|
*/
|
|
security_relevant_threshold() {
|
|
const ret = wasm.drepvotingthresholds_hard_fork_initiation(this.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PoolVotingThresholds = PoolVotingThresholds;
|
|
|
|
const PrivateKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_privatekey_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PrivateKey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PrivateKey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PrivateKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PrivateKeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_privatekey_free(ptr);
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PrivateKey}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.privatekey_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.privatekey_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} message
|
|
* @returns {Ed25519Signature}
|
|
*/
|
|
sign(message) {
|
|
const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ret = wasm.privatekey_sign(this.__wbg_ptr, ptr0, len0);
|
|
return Ed25519Signature.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PrivateKey}
|
|
*/
|
|
static from_normal_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.privatekey_from_normal_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PrivateKey}
|
|
*/
|
|
static from_extended_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.privatekey_from_extended_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
as_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.privatekey_as_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_bech32() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.privatekey_to_bech32(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* Get private key from its bech32 representation
|
|
* ```javascript
|
|
* PrivateKey.from_bech32('ed25519_sk1ahfetf02qwwg4dkq7mgp4a25lx5vh9920cr5wnxmpzz9906qvm8qwvlts0');
|
|
* ```
|
|
* For an extended 25519 key
|
|
* ```javascript
|
|
* PrivateKey.from_bech32('ed25519e_sk1gqwl4szuwwh6d0yk3nsqcc6xxc3fpvjlevgwvt60df59v8zd8f8prazt8ln3lmz096ux3xvhhvm3ca9wj2yctdh3pnw0szrma07rt5gl748fp');
|
|
* ```
|
|
* @param {string} bech32_str
|
|
* @returns {PrivateKey}
|
|
*/
|
|
static from_bech32(bech32_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech32_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.privatekey_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PrivateKey}
|
|
*/
|
|
static generate_ed25519extended() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.privatekey_generate_ed25519extended(retptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PrivateKey}
|
|
*/
|
|
static generate_ed25519() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.privatekey_generate_ed25519(retptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PrivateKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PublicKey}
|
|
*/
|
|
to_public() {
|
|
const ret = wasm.privatekey_to_public(this.__wbg_ptr);
|
|
return PublicKey.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.PrivateKey = PrivateKey;
|
|
|
|
const ProposedProtocolParameterUpdatesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_proposedprotocolparameterupdates_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ProposedProtocolParameterUpdates {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ProposedProtocolParameterUpdates.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ProposedProtocolParameterUpdatesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ProposedProtocolParameterUpdatesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_proposedprotocolparameterupdates_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.proposedprotocolparameterupdates_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ProposedProtocolParameterUpdates}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.proposedprotocolparameterupdates_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProposedProtocolParameterUpdates.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.proposedprotocolparameterupdates_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ProposedProtocolParameterUpdates}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.proposedprotocolparameterupdates_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProposedProtocolParameterUpdates.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.proposedprotocolparameterupdates_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.proposedprotocolparameterupdates_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ProposedProtocolParameterUpdates}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.proposedprotocolparameterupdates_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProposedProtocolParameterUpdates.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {ProposedProtocolParameterUpdates}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.auxiliarydataset_new();
|
|
return ProposedProtocolParameterUpdates.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.auxiliarydataset_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {GenesisHash} key
|
|
* @param {ProtocolParamUpdate} value
|
|
* @returns {ProtocolParamUpdate | undefined}
|
|
*/
|
|
insert(key, value) {
|
|
_assertClass(key, GenesisHash);
|
|
_assertClass(value, ProtocolParamUpdate);
|
|
const ret = wasm.proposedprotocolparameterupdates_insert(this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : ProtocolParamUpdate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GenesisHash} key
|
|
* @returns {ProtocolParamUpdate | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, GenesisHash);
|
|
const ret = wasm.proposedprotocolparameterupdates_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : ProtocolParamUpdate.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {GenesisHashes}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.proposedprotocolparameterupdates_keys(this.__wbg_ptr);
|
|
return GenesisHashes.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ProposedProtocolParameterUpdates = ProposedProtocolParameterUpdates;
|
|
|
|
const ProtocolParamUpdateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_protocolparamupdate_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ProtocolParamUpdate {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ProtocolParamUpdate.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ProtocolParamUpdateFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ProtocolParamUpdateFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_protocolparamupdate_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ProtocolParamUpdate}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.protocolparamupdate_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProtocolParamUpdate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ProtocolParamUpdate}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.protocolparamupdate_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProtocolParamUpdate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ProtocolParamUpdate}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.protocolparamupdate_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProtocolParamUpdate.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} minfee_a
|
|
*/
|
|
set_minfee_a(minfee_a) {
|
|
_assertClass(minfee_a, BigNum);
|
|
wasm.protocolparamupdate_set_minfee_a(this.__wbg_ptr, minfee_a.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
minfee_a() {
|
|
const ret = wasm.protocolparamupdate_minfee_a(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} minfee_b
|
|
*/
|
|
set_minfee_b(minfee_b) {
|
|
_assertClass(minfee_b, BigNum);
|
|
wasm.protocolparamupdate_set_minfee_b(this.__wbg_ptr, minfee_b.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
minfee_b() {
|
|
const ret = wasm.protocolparamupdate_minfee_b(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} max_block_body_size
|
|
*/
|
|
set_max_block_body_size(max_block_body_size) {
|
|
wasm.protocolparamupdate_set_max_block_body_size(this.__wbg_ptr, max_block_body_size);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
max_block_body_size() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_max_block_body_size(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} max_tx_size
|
|
*/
|
|
set_max_tx_size(max_tx_size) {
|
|
wasm.protocolparamupdate_set_max_tx_size(this.__wbg_ptr, max_tx_size);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
max_tx_size() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_max_tx_size(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} max_block_header_size
|
|
*/
|
|
set_max_block_header_size(max_block_header_size) {
|
|
wasm.protocolparamupdate_set_max_block_header_size(this.__wbg_ptr, max_block_header_size);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
max_block_header_size() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_max_block_header_size(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} key_deposit
|
|
*/
|
|
set_key_deposit(key_deposit) {
|
|
_assertClass(key_deposit, BigNum);
|
|
wasm.protocolparamupdate_set_key_deposit(this.__wbg_ptr, key_deposit.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
key_deposit() {
|
|
const ret = wasm.protocolparamupdate_key_deposit(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} pool_deposit
|
|
*/
|
|
set_pool_deposit(pool_deposit) {
|
|
_assertClass(pool_deposit, BigNum);
|
|
wasm.protocolparamupdate_set_pool_deposit(this.__wbg_ptr, pool_deposit.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
pool_deposit() {
|
|
const ret = wasm.protocolparamupdate_pool_deposit(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} max_epoch
|
|
*/
|
|
set_max_epoch(max_epoch) {
|
|
wasm.protocolparamupdate_set_max_epoch(this.__wbg_ptr, max_epoch);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
max_epoch() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_max_epoch(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} n_opt
|
|
*/
|
|
set_n_opt(n_opt) {
|
|
wasm.protocolparamupdate_set_n_opt(this.__wbg_ptr, n_opt);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
n_opt() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_n_opt(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {UnitInterval} pool_pledge_influence
|
|
*/
|
|
set_pool_pledge_influence(pool_pledge_influence) {
|
|
_assertClass(pool_pledge_influence, UnitInterval);
|
|
wasm.protocolparamupdate_set_pool_pledge_influence(this.__wbg_ptr, pool_pledge_influence.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval | undefined}
|
|
*/
|
|
pool_pledge_influence() {
|
|
const ret = wasm.protocolparamupdate_pool_pledge_influence(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} expansion_rate
|
|
*/
|
|
set_expansion_rate(expansion_rate) {
|
|
_assertClass(expansion_rate, UnitInterval);
|
|
wasm.protocolparamupdate_set_expansion_rate(this.__wbg_ptr, expansion_rate.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval | undefined}
|
|
*/
|
|
expansion_rate() {
|
|
const ret = wasm.protocolparamupdate_expansion_rate(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} treasury_growth_rate
|
|
*/
|
|
set_treasury_growth_rate(treasury_growth_rate) {
|
|
_assertClass(treasury_growth_rate, UnitInterval);
|
|
wasm.protocolparamupdate_set_treasury_growth_rate(this.__wbg_ptr, treasury_growth_rate.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval | undefined}
|
|
*/
|
|
treasury_growth_rate() {
|
|
const ret = wasm.protocolparamupdate_treasury_growth_rate(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Since babbage era this param is outdated. But this param you can meet in a pre-babbage block.
|
|
* @returns {UnitInterval | undefined}
|
|
*/
|
|
d() {
|
|
const ret = wasm.protocolparamupdate_d(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Since babbage era this param is outdated. But this param you can meet in a pre-babbage block.
|
|
* @returns {Nonce | undefined}
|
|
*/
|
|
extra_entropy() {
|
|
const ret = wasm.protocolparamupdate_extra_entropy(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Nonce.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Since conway era this param is outdated. But this param you can meet in a pre-conway block.
|
|
* @param {ProtocolVersion} protocol_version
|
|
*/
|
|
set_protocol_version(protocol_version) {
|
|
_assertClass(protocol_version, ProtocolVersion);
|
|
wasm.protocolparamupdate_set_protocol_version(this.__wbg_ptr, protocol_version.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {ProtocolVersion | undefined}
|
|
*/
|
|
protocol_version() {
|
|
const ret = wasm.protocolparamupdate_protocol_version(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ProtocolVersion.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} min_pool_cost
|
|
*/
|
|
set_min_pool_cost(min_pool_cost) {
|
|
_assertClass(min_pool_cost, BigNum);
|
|
wasm.protocolparamupdate_set_min_pool_cost(this.__wbg_ptr, min_pool_cost.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
min_pool_cost() {
|
|
const ret = wasm.protocolparamupdate_min_pool_cost(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} ada_per_utxo_byte
|
|
*/
|
|
set_ada_per_utxo_byte(ada_per_utxo_byte) {
|
|
_assertClass(ada_per_utxo_byte, BigNum);
|
|
wasm.protocolparamupdate_set_ada_per_utxo_byte(this.__wbg_ptr, ada_per_utxo_byte.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
ada_per_utxo_byte() {
|
|
const ret = wasm.protocolparamupdate_ada_per_utxo_byte(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Costmdls} cost_models
|
|
*/
|
|
set_cost_models(cost_models) {
|
|
_assertClass(cost_models, Costmdls);
|
|
wasm.protocolparamupdate_set_cost_models(this.__wbg_ptr, cost_models.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Costmdls | undefined}
|
|
*/
|
|
cost_models() {
|
|
const ret = wasm.protocolparamupdate_cost_models(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Costmdls.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ExUnitPrices} execution_costs
|
|
*/
|
|
set_execution_costs(execution_costs) {
|
|
_assertClass(execution_costs, ExUnitPrices);
|
|
wasm.protocolparamupdate_set_execution_costs(this.__wbg_ptr, execution_costs.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {ExUnitPrices | undefined}
|
|
*/
|
|
execution_costs() {
|
|
const ret = wasm.protocolparamupdate_execution_costs(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ExUnitPrices.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ExUnits} max_tx_ex_units
|
|
*/
|
|
set_max_tx_ex_units(max_tx_ex_units) {
|
|
_assertClass(max_tx_ex_units, ExUnits);
|
|
wasm.protocolparamupdate_set_max_tx_ex_units(this.__wbg_ptr, max_tx_ex_units.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {ExUnits | undefined}
|
|
*/
|
|
max_tx_ex_units() {
|
|
const ret = wasm.protocolparamupdate_max_tx_ex_units(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ExUnits.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ExUnits} max_block_ex_units
|
|
*/
|
|
set_max_block_ex_units(max_block_ex_units) {
|
|
_assertClass(max_block_ex_units, ExUnits);
|
|
wasm.protocolparamupdate_set_max_block_ex_units(this.__wbg_ptr, max_block_ex_units.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {ExUnits | undefined}
|
|
*/
|
|
max_block_ex_units() {
|
|
const ret = wasm.protocolparamupdate_max_block_ex_units(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ExUnits.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} max_value_size
|
|
*/
|
|
set_max_value_size(max_value_size) {
|
|
wasm.protocolparamupdate_set_max_value_size(this.__wbg_ptr, max_value_size);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
max_value_size() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_max_value_size(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} collateral_percentage
|
|
*/
|
|
set_collateral_percentage(collateral_percentage) {
|
|
wasm.protocolparamupdate_set_collateral_percentage(this.__wbg_ptr, collateral_percentage);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
collateral_percentage() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_collateral_percentage(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} max_collateral_inputs
|
|
*/
|
|
set_max_collateral_inputs(max_collateral_inputs) {
|
|
wasm.protocolparamupdate_set_max_collateral_inputs(this.__wbg_ptr, max_collateral_inputs);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
max_collateral_inputs() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_max_collateral_inputs(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {PoolVotingThresholds} pool_voting_thresholds
|
|
*/
|
|
set_pool_voting_thresholds(pool_voting_thresholds) {
|
|
_assertClass(pool_voting_thresholds, PoolVotingThresholds);
|
|
wasm.protocolparamupdate_set_pool_voting_thresholds(this.__wbg_ptr, pool_voting_thresholds.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {PoolVotingThresholds | undefined}
|
|
*/
|
|
pool_voting_thresholds() {
|
|
const ret = wasm.protocolparamupdate_pool_voting_thresholds(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PoolVotingThresholds.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {DRepVotingThresholds} drep_voting_thresholds
|
|
*/
|
|
set_drep_voting_thresholds(drep_voting_thresholds) {
|
|
_assertClass(drep_voting_thresholds, DRepVotingThresholds);
|
|
wasm.protocolparamupdate_set_drep_voting_thresholds(this.__wbg_ptr, drep_voting_thresholds.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {DRepVotingThresholds | undefined}
|
|
*/
|
|
drep_voting_thresholds() {
|
|
const ret = wasm.protocolparamupdate_drep_voting_thresholds(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : DRepVotingThresholds.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} min_committee_size
|
|
*/
|
|
set_min_committee_size(min_committee_size) {
|
|
wasm.protocolparamupdate_set_min_committee_size(this.__wbg_ptr, min_committee_size);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
min_committee_size() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_min_committee_size(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} committee_term_limit
|
|
*/
|
|
set_committee_term_limit(committee_term_limit) {
|
|
wasm.protocolparamupdate_set_committee_term_limit(this.__wbg_ptr, committee_term_limit);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
committee_term_limit() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_committee_term_limit(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {number} governance_action_validity_period
|
|
*/
|
|
set_governance_action_validity_period(governance_action_validity_period) {
|
|
wasm.protocolparamupdate_set_governance_action_validity_period(this.__wbg_ptr, governance_action_validity_period);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
governance_action_validity_period() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_governance_action_validity_period(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} governance_action_deposit
|
|
*/
|
|
set_governance_action_deposit(governance_action_deposit) {
|
|
_assertClass(governance_action_deposit, BigNum);
|
|
wasm.protocolparamupdate_set_governance_action_deposit(this.__wbg_ptr, governance_action_deposit.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
governance_action_deposit() {
|
|
const ret = wasm.protocolparamupdate_governance_action_deposit(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} drep_deposit
|
|
*/
|
|
set_drep_deposit(drep_deposit) {
|
|
_assertClass(drep_deposit, BigNum);
|
|
wasm.protocolparamupdate_set_drep_deposit(this.__wbg_ptr, drep_deposit.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
drep_deposit() {
|
|
const ret = wasm.protocolparamupdate_drep_deposit(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} drep_inactivity_period
|
|
*/
|
|
set_drep_inactivity_period(drep_inactivity_period) {
|
|
wasm.protocolparamupdate_set_drep_inactivity_period(this.__wbg_ptr, drep_inactivity_period);
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
drep_inactivity_period() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolparamupdate_drep_inactivity_period(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {UnitInterval} ref_script_coins_per_byte
|
|
*/
|
|
set_ref_script_coins_per_byte(ref_script_coins_per_byte) {
|
|
_assertClass(ref_script_coins_per_byte, UnitInterval);
|
|
wasm.protocolparamupdate_set_ref_script_coins_per_byte(this.__wbg_ptr, ref_script_coins_per_byte.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {UnitInterval | undefined}
|
|
*/
|
|
ref_script_coins_per_byte() {
|
|
const ret = wasm.protocolparamupdate_ref_script_coins_per_byte(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : UnitInterval.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ProtocolParamUpdate}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.protocolparamupdate_new();
|
|
return ProtocolParamUpdate.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ProtocolParamUpdate = ProtocolParamUpdate;
|
|
|
|
const ProtocolVersionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_protocolversion_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ProtocolVersion {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ProtocolVersion.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ProtocolVersionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ProtocolVersionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_protocolversion_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolversion_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ProtocolVersion}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.protocolversion_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProtocolVersion.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolversion_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ProtocolVersion}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.protocolversion_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProtocolVersion.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolversion_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.protocolversion_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ProtocolVersion}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.protocolversion_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ProtocolVersion.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
major() {
|
|
const ret = wasm.protocolversion_major(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
minor() {
|
|
const ret = wasm.protocolversion_minor(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} major
|
|
* @param {number} minor
|
|
* @returns {ProtocolVersion}
|
|
*/
|
|
static new(major, minor) {
|
|
const ret = wasm.protocolversion_new(major, minor);
|
|
return ProtocolVersion.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ProtocolVersion = ProtocolVersion;
|
|
|
|
const PublicKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_publickey_free(ptr >>> 0));
|
|
/**
|
|
* ED25519 key used as public key
|
|
*/
|
|
class PublicKey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(PublicKey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
PublicKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PublicKeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_publickey_free(ptr);
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {PublicKey}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.publickey_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PublicKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.publickey_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
hash() {
|
|
const ret = wasm.publickey_hash(this.__wbg_ptr);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} data
|
|
* @param {Ed25519Signature} signature
|
|
* @returns {boolean}
|
|
*/
|
|
verify(data, signature) {
|
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
_assertClass(signature, Ed25519Signature);
|
|
const ret = wasm.publickey_verify(this.__wbg_ptr, ptr0, len0, signature.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {PublicKey}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.publickey_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PublicKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
as_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.publickey_as_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_bech32() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.publickey_to_bech32(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* Get public key from its bech32 representation
|
|
* Example:
|
|
* ```javascript
|
|
* const pkey = PublicKey.from_bech32('ed25519_pk1dgaagyh470y66p899txcl3r0jaeaxu6yd7z2dxyk55qcycdml8gszkxze2');
|
|
* ```
|
|
* @param {string} bech32_str
|
|
* @returns {PublicKey}
|
|
*/
|
|
static from_bech32(bech32_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech32_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.publickey_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return PublicKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.PublicKey = PublicKey;
|
|
|
|
const PublicKeysFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_publickeys_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class PublicKeys {
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
PublicKeysFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_publickeys_free(ptr);
|
|
}
|
|
/**
|
|
*/
|
|
constructor() {
|
|
const ret = wasm.publickeys_new();
|
|
this.__wbg_ptr = ret >>> 0;
|
|
return this;
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
size() {
|
|
const ret = wasm.publickeys_size(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {PublicKey}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.publickeys_get(this.__wbg_ptr, index);
|
|
return PublicKey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PublicKey} key
|
|
*/
|
|
add(key) {
|
|
_assertClass(key, PublicKey);
|
|
wasm.publickeys_add(this.__wbg_ptr, key.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.PublicKeys = PublicKeys;
|
|
|
|
const RedeemerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_redeemer_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Redeemer {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Redeemer.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
RedeemerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
RedeemerFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_redeemer_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemer_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Redeemer}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemer_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Redeemer.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemer_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Redeemer}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemer_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Redeemer.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemer_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemer_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Redeemer}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemer_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Redeemer.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
tag() {
|
|
const ret = wasm.redeemer_tag(this.__wbg_ptr);
|
|
return RedeemerTag.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
index() {
|
|
const ret = wasm.redeemer_index(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusData}
|
|
*/
|
|
data() {
|
|
const ret = wasm.redeemer_data(this.__wbg_ptr);
|
|
return PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ExUnits}
|
|
*/
|
|
ex_units() {
|
|
const ret = wasm.redeemer_ex_units(this.__wbg_ptr);
|
|
return ExUnits.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {RedeemerTag} tag
|
|
* @param {BigNum} index
|
|
* @param {PlutusData} data
|
|
* @param {ExUnits} ex_units
|
|
* @returns {Redeemer}
|
|
*/
|
|
static new(tag, index, data, ex_units) {
|
|
_assertClass(tag, RedeemerTag);
|
|
_assertClass(index, BigNum);
|
|
_assertClass(data, PlutusData);
|
|
_assertClass(ex_units, ExUnits);
|
|
const ret = wasm.redeemer_new(tag.__wbg_ptr, index.__wbg_ptr, data.__wbg_ptr, ex_units.__wbg_ptr);
|
|
return Redeemer.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Redeemer = Redeemer;
|
|
|
|
const RedeemerTagFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_redeemertag_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class RedeemerTag {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(RedeemerTag.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
RedeemerTagFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
RedeemerTagFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_redeemertag_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemertag_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemertag_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return RedeemerTag.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemertag_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemertag_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return RedeemerTag.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemertag_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemertag_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemertag_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return RedeemerTag.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static new_spend() {
|
|
const ret = wasm.redeemertag_new_spend();
|
|
return RedeemerTag.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static new_mint() {
|
|
const ret = wasm.redeemertag_new_mint();
|
|
return RedeemerTag.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static new_cert() {
|
|
const ret = wasm.redeemertag_new_cert();
|
|
return RedeemerTag.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static new_reward() {
|
|
const ret = wasm.redeemertag_new_reward();
|
|
return RedeemerTag.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static new_vote() {
|
|
const ret = wasm.redeemertag_new_vote();
|
|
return RedeemerTag.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RedeemerTag}
|
|
*/
|
|
static new_voting_proposal() {
|
|
const ret = wasm.redeemertag_new_voting_proposal();
|
|
return RedeemerTag.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RedeemerTagKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.redeemertag_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.RedeemerTag = RedeemerTag;
|
|
|
|
const RedeemersFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_redeemers_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Redeemers {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Redeemers.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
RedeemersFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
RedeemersFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_redeemers_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemers_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Redeemers}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemers_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Redeemers.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemers_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Redeemers}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemers_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Redeemers.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemers_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemers_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Redeemers}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.redeemers_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Redeemers.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Redeemers}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.nativescripts_new();
|
|
return Redeemers.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.nativescripts_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Redeemer}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.redeemers_get(this.__wbg_ptr, index);
|
|
return Redeemer.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Redeemer} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, Redeemer);
|
|
wasm.redeemers_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
/**
|
|
* WARNING: This function will be removed in after next hard fork
|
|
* @returns {CborContainerType}
|
|
*/
|
|
get_container_type() {
|
|
const ret = wasm.redeemers_get_container_type(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {ExUnits}
|
|
*/
|
|
total_ex_units() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.redeemers_total_ex_units(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ExUnits.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.Redeemers = Redeemers;
|
|
|
|
const RelayFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_relay_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Relay {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Relay.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
RelayFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
RelayFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_relay_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.relay_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Relay}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.relay_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Relay.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.relay_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Relay}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.relay_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Relay.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.relay_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.relay_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Relay}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.relay_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Relay.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {SingleHostAddr} single_host_addr
|
|
* @returns {Relay}
|
|
*/
|
|
static new_single_host_addr(single_host_addr) {
|
|
_assertClass(single_host_addr, SingleHostAddr);
|
|
const ret = wasm.relay_new_single_host_addr(single_host_addr.__wbg_ptr);
|
|
return Relay.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {SingleHostName} single_host_name
|
|
* @returns {Relay}
|
|
*/
|
|
static new_single_host_name(single_host_name) {
|
|
_assertClass(single_host_name, SingleHostName);
|
|
const ret = wasm.relay_new_single_host_name(single_host_name.__wbg_ptr);
|
|
return Relay.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MultiHostName} multi_host_name
|
|
* @returns {Relay}
|
|
*/
|
|
static new_multi_host_name(multi_host_name) {
|
|
_assertClass(multi_host_name, MultiHostName);
|
|
const ret = wasm.relay_new_multi_host_name(multi_host_name.__wbg_ptr);
|
|
return Relay.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RelayKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.relay_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {SingleHostAddr | undefined}
|
|
*/
|
|
as_single_host_addr() {
|
|
const ret = wasm.relay_as_single_host_addr(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : SingleHostAddr.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {SingleHostName | undefined}
|
|
*/
|
|
as_single_host_name() {
|
|
const ret = wasm.relay_as_single_host_name(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : SingleHostName.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {MultiHostName | undefined}
|
|
*/
|
|
as_multi_host_name() {
|
|
const ret = wasm.relay_as_multi_host_name(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : MultiHostName.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Relay = Relay;
|
|
|
|
const RelaysFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_relays_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Relays {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Relays.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
RelaysFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
RelaysFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_relays_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.relays_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Relays}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.relays_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Relays.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.relays_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Relays}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.relays_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Relays.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.relays_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.relays_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Relays}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.relays_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Relays.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Relays}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.relays_new();
|
|
return Relays.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.publickeys_size(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Relay}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.relays_get(this.__wbg_ptr, index);
|
|
return Relay.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Relay} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, Relay);
|
|
wasm.relays_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.Relays = Relays;
|
|
|
|
const RewardAddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_rewardaddress_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class RewardAddress {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(RewardAddress.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
RewardAddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
RewardAddressFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_rewardaddress_free(ptr);
|
|
}
|
|
/**
|
|
* @param {number} network
|
|
* @param {Credential} payment
|
|
* @returns {RewardAddress}
|
|
*/
|
|
static new(network, payment) {
|
|
_assertClass(payment, Credential);
|
|
const ret = wasm.enterpriseaddress_new(network, payment.__wbg_ptr);
|
|
return RewardAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
payment_cred() {
|
|
const ret = wasm.baseaddress_payment_cred(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Address}
|
|
*/
|
|
to_address() {
|
|
const ret = wasm.rewardaddress_to_address(this.__wbg_ptr);
|
|
return Address.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Address} addr
|
|
* @returns {RewardAddress | undefined}
|
|
*/
|
|
static from_address(addr) {
|
|
_assertClass(addr, Address);
|
|
const ret = wasm.rewardaddress_from_address(addr.__wbg_ptr);
|
|
return ret === 0 ? undefined : RewardAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
network_id() {
|
|
const ret = wasm.enterpriseaddress_network_id(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.RewardAddress = RewardAddress;
|
|
|
|
const RewardAddressesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_rewardaddresses_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class RewardAddresses {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(RewardAddresses.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
RewardAddressesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
RewardAddressesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_rewardaddresses_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.rewardaddresses_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {RewardAddresses}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.rewardaddresses_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return RewardAddresses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.rewardaddresses_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {RewardAddresses}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.rewardaddresses_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return RewardAddresses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.rewardaddresses_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.rewardaddresses_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {RewardAddresses}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.rewardaddresses_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return RewardAddresses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {RewardAddresses}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.genesishashes_new();
|
|
return RewardAddresses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {RewardAddress}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.rewardaddresses_get(this.__wbg_ptr, index);
|
|
return RewardAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {RewardAddress} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, RewardAddress);
|
|
wasm.rewardaddresses_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.RewardAddresses = RewardAddresses;
|
|
|
|
const ScriptAllFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_scriptall_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ScriptAll {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ScriptAll.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ScriptAllFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ScriptAllFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_scriptall_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptall_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ScriptAll}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptall_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptAll.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptall_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ScriptAll}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptall_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptAll.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptall_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptall_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ScriptAll}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptall_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptAll.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {NativeScripts}
|
|
*/
|
|
native_scripts() {
|
|
const ret = wasm.scriptall_native_scripts(this.__wbg_ptr);
|
|
return NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {NativeScripts} native_scripts
|
|
* @returns {ScriptAll}
|
|
*/
|
|
static new(native_scripts) {
|
|
_assertClass(native_scripts, NativeScripts);
|
|
const ret = wasm.scriptall_new(native_scripts.__wbg_ptr);
|
|
return ScriptAll.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ScriptAll = ScriptAll;
|
|
|
|
const ScriptAnyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_scriptany_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ScriptAny {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ScriptAny.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ScriptAnyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ScriptAnyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_scriptany_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptany_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ScriptAny}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptany_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptAny.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptany_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ScriptAny}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptany_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptAny.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptany_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptany_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ScriptAny}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptany_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptAny.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {NativeScripts}
|
|
*/
|
|
native_scripts() {
|
|
const ret = wasm.scriptall_native_scripts(this.__wbg_ptr);
|
|
return NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {NativeScripts} native_scripts
|
|
* @returns {ScriptAny}
|
|
*/
|
|
static new(native_scripts) {
|
|
_assertClass(native_scripts, NativeScripts);
|
|
const ret = wasm.scriptall_new(native_scripts.__wbg_ptr);
|
|
return ScriptAny.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ScriptAny = ScriptAny;
|
|
|
|
const ScriptDataHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_scriptdatahash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ScriptDataHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ScriptDataHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ScriptDataHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ScriptDataHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_scriptdatahash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ScriptDataHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptdatahash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {ScriptDataHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptdatahash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {ScriptDataHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptdatahash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptDataHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.ScriptDataHash = ScriptDataHash;
|
|
|
|
const ScriptHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_scripthash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ScriptHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ScriptHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ScriptHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ScriptHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_scripthash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ScriptHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scripthash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.ed25519keyhash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {ScriptHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scripthash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.ed25519keyhash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {ScriptHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scripthash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.ScriptHash = ScriptHash;
|
|
|
|
const ScriptHashesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_scripthashes_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ScriptHashes {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ScriptHashes.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ScriptHashesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ScriptHashesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_scripthashes_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scripthashes_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ScriptHashes}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scripthashes_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scripthashes_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ScriptHashes}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scripthashes_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scripthashes_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scripthashes_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ScriptHashes}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scripthashes_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptHashes.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {ScriptHashes}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.genesishashes_new();
|
|
return ScriptHashes.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {ScriptHash}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.scripthashes_get(this.__wbg_ptr, index);
|
|
return ScriptHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptHash} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, ScriptHash);
|
|
wasm.scripthashes_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.ScriptHashes = ScriptHashes;
|
|
|
|
const ScriptNOfKFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_scriptnofk_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ScriptNOfK {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ScriptNOfK.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ScriptNOfKFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ScriptNOfKFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_scriptnofk_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptnofk_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ScriptNOfK}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptnofk_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptNOfK.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptnofk_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ScriptNOfK}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptnofk_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptNOfK.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptnofk_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptnofk_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ScriptNOfK}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptnofk_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptNOfK.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
n() {
|
|
const ret = wasm.scriptnofk_n(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @returns {NativeScripts}
|
|
*/
|
|
native_scripts() {
|
|
const ret = wasm.scriptall_native_scripts(this.__wbg_ptr);
|
|
return NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} n
|
|
* @param {NativeScripts} native_scripts
|
|
* @returns {ScriptNOfK}
|
|
*/
|
|
static new(n, native_scripts) {
|
|
_assertClass(native_scripts, NativeScripts);
|
|
const ret = wasm.scriptnofk_new(n, native_scripts.__wbg_ptr);
|
|
return ScriptNOfK.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ScriptNOfK = ScriptNOfK;
|
|
|
|
const ScriptPubkeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_scriptpubkey_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ScriptPubkey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ScriptPubkey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ScriptPubkeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ScriptPubkeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_scriptpubkey_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptpubkey_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ScriptPubkey}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptpubkey_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptPubkey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptpubkey_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ScriptPubkey}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptpubkey_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptPubkey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptpubkey_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptpubkey_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ScriptPubkey}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptpubkey_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptPubkey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
addr_keyhash() {
|
|
const ret = wasm.scriptpubkey_addr_keyhash(this.__wbg_ptr);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} addr_keyhash
|
|
* @returns {ScriptPubkey}
|
|
*/
|
|
static new(addr_keyhash) {
|
|
_assertClass(addr_keyhash, Ed25519KeyHash);
|
|
const ret = wasm.scriptpubkey_new(addr_keyhash.__wbg_ptr);
|
|
return ScriptPubkey.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.ScriptPubkey = ScriptPubkey;
|
|
|
|
const ScriptRefFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_scriptref_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class ScriptRef {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(ScriptRef.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ScriptRefFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ScriptRefFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_scriptref_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptref_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {ScriptRef}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptref_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptRef.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptref_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {ScriptRef}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptref_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptRef.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptref_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptref_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {ScriptRef}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.scriptref_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return ScriptRef.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {NativeScript} native_script
|
|
* @returns {ScriptRef}
|
|
*/
|
|
static new_native_script(native_script) {
|
|
_assertClass(native_script, NativeScript);
|
|
const ret = wasm.scriptref_new_native_script(native_script.__wbg_ptr);
|
|
return ScriptRef.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusScript} plutus_script
|
|
* @returns {ScriptRef}
|
|
*/
|
|
static new_plutus_script(plutus_script) {
|
|
_assertClass(plutus_script, PlutusScript);
|
|
const ret = wasm.scriptref_new_plutus_script(plutus_script.__wbg_ptr);
|
|
return ScriptRef.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_native_script() {
|
|
const ret = wasm.scriptref_is_native_script(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_plutus_script() {
|
|
const ret = wasm.scriptref_is_plutus_script(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {NativeScript | undefined}
|
|
*/
|
|
native_script() {
|
|
const ret = wasm.scriptref_native_script(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NativeScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusScript | undefined}
|
|
*/
|
|
plutus_script() {
|
|
const ret = wasm.scriptref_plutus_script(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusScript.__wrap(ret);
|
|
}
|
|
/**
|
|
* Return bytes array of script ref struct but without wrapping into CBOR array under the tag
|
|
* to_bytes returns "#6.24(bytes .cbor script)" from CDDL
|
|
* to_unwrapped_bytes return "script" from CDDL
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_unwrapped_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.scriptref_to_unwrapped_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.ScriptRef = ScriptRef;
|
|
|
|
const SingleHostAddrFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_singlehostaddr_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class SingleHostAddr {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(SingleHostAddr.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
SingleHostAddrFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
SingleHostAddrFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_singlehostaddr_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.singlehostaddr_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {SingleHostAddr}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.singlehostaddr_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return SingleHostAddr.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.singlehostaddr_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {SingleHostAddr}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.singlehostaddr_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return SingleHostAddr.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.singlehostaddr_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.singlehostaddr_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {SingleHostAddr}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.singlehostaddr_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return SingleHostAddr.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
port() {
|
|
const ret = wasm.singlehostaddr_port(this.__wbg_ptr);
|
|
return ret === 0xFFFFFF ? undefined : ret;
|
|
}
|
|
/**
|
|
* @returns {Ipv4 | undefined}
|
|
*/
|
|
ipv4() {
|
|
const ret = wasm.singlehostaddr_ipv4(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Ipv4.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ipv6 | undefined}
|
|
*/
|
|
ipv6() {
|
|
const ret = wasm.singlehostaddr_ipv6(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Ipv6.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number | undefined} [port]
|
|
* @param {Ipv4 | undefined} [ipv4]
|
|
* @param {Ipv6 | undefined} [ipv6]
|
|
* @returns {SingleHostAddr}
|
|
*/
|
|
static new(port, ipv4, ipv6) {
|
|
let ptr0 = 0;
|
|
if (!isLikeNone(ipv4)) {
|
|
_assertClass(ipv4, Ipv4);
|
|
ptr0 = ipv4.__destroy_into_raw();
|
|
}
|
|
let ptr1 = 0;
|
|
if (!isLikeNone(ipv6)) {
|
|
_assertClass(ipv6, Ipv6);
|
|
ptr1 = ipv6.__destroy_into_raw();
|
|
}
|
|
const ret = wasm.singlehostaddr_new(isLikeNone(port) ? 0xFFFFFF : port, ptr0, ptr1);
|
|
return SingleHostAddr.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.SingleHostAddr = SingleHostAddr;
|
|
|
|
const SingleHostNameFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_singlehostname_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class SingleHostName {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(SingleHostName.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
SingleHostNameFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
SingleHostNameFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_singlehostname_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.singlehostname_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {SingleHostName}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.singlehostname_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return SingleHostName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.singlehostname_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {SingleHostName}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.singlehostname_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return SingleHostName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.singlehostname_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.singlehostname_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {SingleHostName}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.singlehostname_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return SingleHostName.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number | undefined}
|
|
*/
|
|
port() {
|
|
const ret = wasm.singlehostname_port(this.__wbg_ptr);
|
|
return ret === 0xFFFFFF ? undefined : ret;
|
|
}
|
|
/**
|
|
* @returns {DNSRecordAorAAAA}
|
|
*/
|
|
dns_name() {
|
|
const ret = wasm.multihostname_dns_name(this.__wbg_ptr);
|
|
return DNSRecordAorAAAA.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number | undefined} port
|
|
* @param {DNSRecordAorAAAA} dns_name
|
|
* @returns {SingleHostName}
|
|
*/
|
|
static new(port, dns_name) {
|
|
_assertClass(dns_name, DNSRecordAorAAAA);
|
|
const ret = wasm.singlehostname_new(isLikeNone(port) ? 0xFFFFFF : port, dns_name.__wbg_ptr);
|
|
return SingleHostName.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.SingleHostName = SingleHostName;
|
|
|
|
const StakeAndVoteDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_stakeandvotedelegation_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class StakeAndVoteDelegation {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(StakeAndVoteDelegation.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
StakeAndVoteDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
StakeAndVoteDelegationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_stakeandvotedelegation_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeandvotedelegation_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {StakeAndVoteDelegation}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeandvotedelegation_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeAndVoteDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeandvotedelegation_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {StakeAndVoteDelegation}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeandvotedelegation_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeAndVoteDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeandvotedelegation_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeandvotedelegation_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {StakeAndVoteDelegation}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeandvotedelegation_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeAndVoteDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_credential() {
|
|
const ret = wasm.stakeandvotedelegation_stake_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
pool_keyhash() {
|
|
const ret = wasm.stakeandvotedelegation_pool_keyhash(this.__wbg_ptr);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRep}
|
|
*/
|
|
drep() {
|
|
const ret = wasm.stakeandvotedelegation_drep(this.__wbg_ptr);
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @param {Ed25519KeyHash} pool_keyhash
|
|
* @param {DRep} drep
|
|
* @returns {StakeAndVoteDelegation}
|
|
*/
|
|
static new(stake_credential, pool_keyhash, drep) {
|
|
_assertClass(stake_credential, Credential);
|
|
_assertClass(pool_keyhash, Ed25519KeyHash);
|
|
_assertClass(drep, DRep);
|
|
const ret = wasm.stakeandvotedelegation_new(stake_credential.__wbg_ptr, pool_keyhash.__wbg_ptr, drep.__wbg_ptr);
|
|
return StakeAndVoteDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.stakeandvotedelegation_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.StakeAndVoteDelegation = StakeAndVoteDelegation;
|
|
|
|
const StakeDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_stakedelegation_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class StakeDelegation {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(StakeDelegation.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
StakeDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
StakeDelegationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_stakedelegation_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakedelegation_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {StakeDelegation}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakedelegation_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakedelegation_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {StakeDelegation}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakedelegation_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakedelegation_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakedelegation_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {StakeDelegation}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakedelegation_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_credential() {
|
|
const ret = wasm.stakeandvotedelegation_stake_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
pool_keyhash() {
|
|
const ret = wasm.stakedelegation_pool_keyhash(this.__wbg_ptr);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @param {Ed25519KeyHash} pool_keyhash
|
|
* @returns {StakeDelegation}
|
|
*/
|
|
static new(stake_credential, pool_keyhash) {
|
|
_assertClass(stake_credential, Credential);
|
|
_assertClass(pool_keyhash, Ed25519KeyHash);
|
|
const ret = wasm.stakedelegation_new(stake_credential.__wbg_ptr, pool_keyhash.__wbg_ptr);
|
|
return StakeDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.stakeandvotedelegation_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.StakeDelegation = StakeDelegation;
|
|
|
|
const StakeDeregistrationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_stakederegistration_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class StakeDeregistration {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(StakeDeregistration.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
StakeDeregistrationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
StakeDeregistrationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_stakederegistration_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakederegistration_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {StakeDeregistration}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakederegistration_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeDeregistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakederegistration_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {StakeDeregistration}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakederegistration_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeDeregistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakederegistration_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakederegistration_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {StakeDeregistration}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakederegistration_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeDeregistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_credential() {
|
|
const ret = wasm.stakederegistration_stake_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
coin() {
|
|
const ret = wasm.stakederegistration_coin(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @returns {StakeDeregistration}
|
|
*/
|
|
static new(stake_credential) {
|
|
_assertClass(stake_credential, Credential);
|
|
const ret = wasm.stakederegistration_new(stake_credential.__wbg_ptr);
|
|
return StakeDeregistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @param {BigNum} coin
|
|
* @returns {StakeDeregistration}
|
|
*/
|
|
static new_with_explicit_refund(stake_credential, coin) {
|
|
_assertClass(stake_credential, Credential);
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.stakederegistration_new_with_explicit_refund(stake_credential.__wbg_ptr, coin.__wbg_ptr);
|
|
return StakeDeregistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.stakederegistration_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.StakeDeregistration = StakeDeregistration;
|
|
|
|
const StakeRegistrationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_stakeregistration_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class StakeRegistration {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(StakeRegistration.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
StakeRegistrationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
StakeRegistrationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_stakeregistration_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeregistration_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {StakeRegistration}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeregistration_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeregistration_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {StakeRegistration}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeregistration_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeregistration_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeregistration_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {StakeRegistration}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeregistration_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeRegistration.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_credential() {
|
|
const ret = wasm.stakeregistration_stake_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
coin() {
|
|
const ret = wasm.stakeregistration_coin(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @returns {StakeRegistration}
|
|
*/
|
|
static new(stake_credential) {
|
|
_assertClass(stake_credential, Credential);
|
|
const ret = wasm.stakeregistration_new(stake_credential.__wbg_ptr);
|
|
return StakeRegistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @param {BigNum} coin
|
|
* @returns {StakeRegistration}
|
|
*/
|
|
static new_with_explicit_deposit(stake_credential, coin) {
|
|
_assertClass(stake_credential, Credential);
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.stakeregistration_new_with_explicit_deposit(stake_credential.__wbg_ptr, coin.__wbg_ptr);
|
|
return StakeRegistration.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.stakeregistration_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.StakeRegistration = StakeRegistration;
|
|
|
|
const StakeRegistrationAndDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_stakeregistrationanddelegation_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class StakeRegistrationAndDelegation {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(StakeRegistrationAndDelegation.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
StakeRegistrationAndDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
StakeRegistrationAndDelegationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_stakeregistrationanddelegation_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeregistrationanddelegation_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {StakeRegistrationAndDelegation}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeregistrationanddelegation_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeregistrationanddelegation_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {StakeRegistrationAndDelegation}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeregistrationanddelegation_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeregistrationanddelegation_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakeregistrationanddelegation_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {StakeRegistrationAndDelegation}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakeregistrationanddelegation_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_credential() {
|
|
const ret = wasm.stakeregistrationanddelegation_stake_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
pool_keyhash() {
|
|
const ret = wasm.stakeregistrationanddelegation_pool_keyhash(this.__wbg_ptr);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
coin() {
|
|
const ret = wasm.drepderegistration_coin(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @param {Ed25519KeyHash} pool_keyhash
|
|
* @param {BigNum} coin
|
|
* @returns {StakeRegistrationAndDelegation}
|
|
*/
|
|
static new(stake_credential, pool_keyhash, coin) {
|
|
_assertClass(stake_credential, Credential);
|
|
_assertClass(pool_keyhash, Ed25519KeyHash);
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.stakeregistrationanddelegation_new(stake_credential.__wbg_ptr, pool_keyhash.__wbg_ptr, coin.__wbg_ptr);
|
|
return StakeRegistrationAndDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.stakeregistrationanddelegation_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.StakeRegistrationAndDelegation = StakeRegistrationAndDelegation;
|
|
|
|
const StakeVoteRegistrationAndDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_stakevoteregistrationanddelegation_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class StakeVoteRegistrationAndDelegation {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(StakeVoteRegistrationAndDelegation.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
StakeVoteRegistrationAndDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
StakeVoteRegistrationAndDelegationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_stakevoteregistrationanddelegation_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakevoteregistrationanddelegation_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {StakeVoteRegistrationAndDelegation}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakevoteregistrationanddelegation_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeVoteRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakevoteregistrationanddelegation_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {StakeVoteRegistrationAndDelegation}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakevoteregistrationanddelegation_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeVoteRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakevoteregistrationanddelegation_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.stakevoteregistrationanddelegation_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {StakeVoteRegistrationAndDelegation}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.stakevoteregistrationanddelegation_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return StakeVoteRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_credential() {
|
|
const ret = wasm.stakevoteregistrationanddelegation_stake_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash}
|
|
*/
|
|
pool_keyhash() {
|
|
const ret = wasm.stakeregistrationanddelegation_pool_keyhash(this.__wbg_ptr);
|
|
return Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRep}
|
|
*/
|
|
drep() {
|
|
const ret = wasm.stakevoteregistrationanddelegation_drep(this.__wbg_ptr);
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
coin() {
|
|
const ret = wasm.drepderegistration_coin(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @param {Ed25519KeyHash} pool_keyhash
|
|
* @param {DRep} drep
|
|
* @param {BigNum} coin
|
|
* @returns {StakeVoteRegistrationAndDelegation}
|
|
*/
|
|
static new(stake_credential, pool_keyhash, drep, coin) {
|
|
_assertClass(stake_credential, Credential);
|
|
_assertClass(pool_keyhash, Ed25519KeyHash);
|
|
_assertClass(drep, DRep);
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.stakevoteregistrationanddelegation_new(stake_credential.__wbg_ptr, pool_keyhash.__wbg_ptr, drep.__wbg_ptr, coin.__wbg_ptr);
|
|
return StakeVoteRegistrationAndDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.stakevoteregistrationanddelegation_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.StakeVoteRegistrationAndDelegation = StakeVoteRegistrationAndDelegation;
|
|
|
|
const StringsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_strings_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Strings {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Strings.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
StringsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
StringsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_strings_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Strings}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.strings_new();
|
|
return Strings.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.costmdls_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {string}
|
|
*/
|
|
get(index) {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.strings_get(retptr, this.__wbg_ptr, index);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} elem
|
|
*/
|
|
add(elem) {
|
|
const ptr0 = passStringToWasm0(elem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.strings_add(this.__wbg_ptr, ptr0, len0);
|
|
}
|
|
}
|
|
module.exports.Strings = Strings;
|
|
|
|
const TimelockExpiryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_timelockexpiry_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TimelockExpiry {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TimelockExpiry.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TimelockExpiryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TimelockExpiryFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_timelockexpiry_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockexpiry_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TimelockExpiry}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.timelockexpiry_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TimelockExpiry.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockexpiry_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TimelockExpiry}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.timelockexpiry_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TimelockExpiry.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockexpiry_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockexpiry_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TimelockExpiry}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.timelockexpiry_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TimelockExpiry.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
slot() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockexpiry_slot(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
slot_bignum() {
|
|
const ret = wasm.timelockexpiry_slot_bignum(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* This constructor uses outdated slot number format.
|
|
* Use `.new_timelockexpiry` instead
|
|
* @param {number} slot
|
|
* @returns {TimelockExpiry}
|
|
*/
|
|
static new(slot) {
|
|
const ret = wasm.timelockexpiry_new(slot);
|
|
return TimelockExpiry.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} slot
|
|
* @returns {TimelockExpiry}
|
|
*/
|
|
static new_timelockexpiry(slot) {
|
|
_assertClass(slot, BigNum);
|
|
const ret = wasm.timelockexpiry_new_timelockexpiry(slot.__wbg_ptr);
|
|
return TimelockExpiry.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TimelockExpiry = TimelockExpiry;
|
|
|
|
const TimelockStartFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_timelockstart_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TimelockStart {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TimelockStart.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TimelockStartFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TimelockStartFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_timelockstart_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockstart_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TimelockStart}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.timelockstart_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TimelockStart.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockstart_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TimelockStart}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.timelockstart_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TimelockStart.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockstart_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockstart_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TimelockStart}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.timelockstart_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TimelockStart.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Returns a Slot32 (u32) value in case the underlying original BigNum (u64) value is within the limits.
|
|
* Otherwise will just raise an error.
|
|
* Use `.slot_bignum` instead
|
|
* @returns {number}
|
|
*/
|
|
slot() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.timelockexpiry_slot(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
slot_bignum() {
|
|
const ret = wasm.timelockexpiry_slot_bignum(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* This constructor uses outdated slot number format.
|
|
* Use `.new_timelockstart` instead.
|
|
* @param {number} slot
|
|
* @returns {TimelockStart}
|
|
*/
|
|
static new(slot) {
|
|
const ret = wasm.timelockexpiry_new(slot);
|
|
return TimelockStart.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} slot
|
|
* @returns {TimelockStart}
|
|
*/
|
|
static new_timelockstart(slot) {
|
|
_assertClass(slot, BigNum);
|
|
const ret = wasm.timelockexpiry_new_timelockexpiry(slot.__wbg_ptr);
|
|
return TimelockStart.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TimelockStart = TimelockStart;
|
|
|
|
const TransactionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Transaction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Transaction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Transaction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Transaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Transaction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Transaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transaction_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transaction_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Transaction}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transaction_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Transaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionBody}
|
|
*/
|
|
body() {
|
|
const ret = wasm.transaction_body(this.__wbg_ptr);
|
|
return TransactionBody.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionWitnessSet}
|
|
*/
|
|
witness_set() {
|
|
const ret = wasm.transaction_witness_set(this.__wbg_ptr);
|
|
return TransactionWitnessSet.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_valid() {
|
|
const ret = wasm.transaction_is_valid(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {AuxiliaryData | undefined}
|
|
*/
|
|
auxiliary_data() {
|
|
const ret = wasm.transaction_auxiliary_data(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {boolean} valid
|
|
*/
|
|
set_is_valid(valid) {
|
|
wasm.transaction_set_is_valid(this.__wbg_ptr, valid);
|
|
}
|
|
/**
|
|
* @param {TransactionBody} body
|
|
* @param {TransactionWitnessSet} witness_set
|
|
* @param {AuxiliaryData | undefined} [auxiliary_data]
|
|
* @returns {Transaction}
|
|
*/
|
|
static new(body, witness_set, auxiliary_data) {
|
|
_assertClass(body, TransactionBody);
|
|
_assertClass(witness_set, TransactionWitnessSet);
|
|
let ptr0 = 0;
|
|
if (!isLikeNone(auxiliary_data)) {
|
|
_assertClass(auxiliary_data, AuxiliaryData);
|
|
ptr0 = auxiliary_data.__destroy_into_raw();
|
|
}
|
|
const ret = wasm.transaction_new(body.__wbg_ptr, witness_set.__wbg_ptr, ptr0);
|
|
return Transaction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Transaction = Transaction;
|
|
|
|
const TransactionBatchFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionbatch_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionBatch {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionBatch.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionBatchFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionBatchFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionbatch_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.fixedtransactionbodies_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Transaction}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.transactionbatch_get(this.__wbg_ptr, index);
|
|
return Transaction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TransactionBatch = TransactionBatch;
|
|
|
|
const TransactionBatchListFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionbatchlist_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionBatchList {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionBatchList.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionBatchListFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionBatchListFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionbatchlist_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.fixedtransactionbodies_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {TransactionBatch}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.transactionbatchlist_get(this.__wbg_ptr, index);
|
|
return TransactionBatch.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TransactionBatchList = TransactionBatchList;
|
|
|
|
const TransactionBodiesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionbodies_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionBodies {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionBodies.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionBodiesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionBodiesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionbodies_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbodies_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionBodies}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionbodies_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBodies.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbodies_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionBodies}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionbodies_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBodies.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbodies_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbodies_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionBodies}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionbodies_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBodies.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionBodies}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.fixedtransactionbodies_new();
|
|
return TransactionBodies.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.fixedtransactionbodies_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {TransactionBody}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.transactionbodies_get(this.__wbg_ptr, index);
|
|
return TransactionBody.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionBody} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, TransactionBody);
|
|
wasm.transactionbodies_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.TransactionBodies = TransactionBodies;
|
|
|
|
const TransactionBodyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionbody_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionBody {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionBody.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionBodyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionBodyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionbody_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbody_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionBody}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionbody_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbody_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionBody}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionbody_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbody_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbody_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionBody}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionbody_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
inputs() {
|
|
const ret = wasm.transactionbody_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionOutputs}
|
|
*/
|
|
outputs() {
|
|
const ret = wasm.transactionbody_outputs(this.__wbg_ptr);
|
|
return TransactionOutputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
fee() {
|
|
const ret = wasm.transactionbody_fee(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Returns a Slot32 (u32) value in case the underlying original BigNum (u64) value is within the limits.
|
|
* Otherwise will just raise an error.
|
|
* @returns {number | undefined}
|
|
*/
|
|
ttl() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbody_ttl(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
if (r3) {
|
|
throw takeObject(r2);
|
|
}
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
ttl_bignum() {
|
|
const ret = wasm.transactionbody_ttl_bignum(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} ttl
|
|
*/
|
|
set_ttl(ttl) {
|
|
_assertClass(ttl, BigNum);
|
|
wasm.protocolparamupdate_set_minfee_a(this.__wbg_ptr, ttl.__wbg_ptr);
|
|
}
|
|
/**
|
|
*/
|
|
remove_ttl() {
|
|
wasm.transactionbody_remove_ttl(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {Certificates} certs
|
|
*/
|
|
set_certs(certs) {
|
|
_assertClass(certs, Certificates);
|
|
wasm.transactionbody_set_certs(this.__wbg_ptr, certs.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Certificates | undefined}
|
|
*/
|
|
certs() {
|
|
const ret = wasm.transactionbody_certs(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Certificates.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Withdrawals} withdrawals
|
|
*/
|
|
set_withdrawals(withdrawals) {
|
|
_assertClass(withdrawals, Withdrawals);
|
|
wasm.transactionbody_set_withdrawals(this.__wbg_ptr, withdrawals.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Withdrawals | undefined}
|
|
*/
|
|
withdrawals() {
|
|
const ret = wasm.transactionbody_withdrawals(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Withdrawals.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Update} update
|
|
*/
|
|
set_update(update) {
|
|
_assertClass(update, Update);
|
|
wasm.transactionbody_set_update(this.__wbg_ptr, update.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Update | undefined}
|
|
*/
|
|
update() {
|
|
const ret = wasm.transactionbody_update(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Update.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {AuxiliaryDataHash} auxiliary_data_hash
|
|
*/
|
|
set_auxiliary_data_hash(auxiliary_data_hash) {
|
|
_assertClass(auxiliary_data_hash, AuxiliaryDataHash);
|
|
wasm.transactionbody_set_auxiliary_data_hash(this.__wbg_ptr, auxiliary_data_hash.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {AuxiliaryDataHash | undefined}
|
|
*/
|
|
auxiliary_data_hash() {
|
|
const ret = wasm.transactionbody_auxiliary_data_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : AuxiliaryDataHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Uses outdated slot number format.
|
|
* @param {number} validity_start_interval
|
|
*/
|
|
set_validity_start_interval(validity_start_interval) {
|
|
wasm.transactionbody_set_validity_start_interval(this.__wbg_ptr, validity_start_interval);
|
|
}
|
|
/**
|
|
* @param {BigNum} validity_start_interval
|
|
*/
|
|
set_validity_start_interval_bignum(validity_start_interval) {
|
|
_assertClass(validity_start_interval, BigNum);
|
|
wasm.protocolparamupdate_set_minfee_b(this.__wbg_ptr, validity_start_interval.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
validity_start_interval_bignum() {
|
|
const ret = wasm.protocolparamupdate_minfee_b(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Returns a Option<Slot32> (u32) value in case the underlying original Option<BigNum> (u64) value is within the limits.
|
|
* Otherwise will just raise an error.
|
|
* Use `.validity_start_interval_bignum` instead.
|
|
* @returns {number | undefined}
|
|
*/
|
|
validity_start_interval() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbody_validity_start_interval(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
if (r3) {
|
|
throw takeObject(r2);
|
|
}
|
|
return r0 === 0 ? undefined : r1 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Mint} mint
|
|
*/
|
|
set_mint(mint) {
|
|
_assertClass(mint, Mint);
|
|
wasm.transactionbody_set_mint(this.__wbg_ptr, mint.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Mint | undefined}
|
|
*/
|
|
mint() {
|
|
const ret = wasm.transactionbody_mint(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Mint.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionInputs} reference_inputs
|
|
*/
|
|
set_reference_inputs(reference_inputs) {
|
|
_assertClass(reference_inputs, TransactionInputs);
|
|
wasm.transactionbody_set_reference_inputs(this.__wbg_ptr, reference_inputs.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs | undefined}
|
|
*/
|
|
reference_inputs() {
|
|
const ret = wasm.transactionbody_reference_inputs(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptDataHash} script_data_hash
|
|
*/
|
|
set_script_data_hash(script_data_hash) {
|
|
_assertClass(script_data_hash, ScriptDataHash);
|
|
wasm.transactionbody_set_script_data_hash(this.__wbg_ptr, script_data_hash.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {ScriptDataHash | undefined}
|
|
*/
|
|
script_data_hash() {
|
|
const ret = wasm.transactionbody_script_data_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptDataHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionInputs} collateral
|
|
*/
|
|
set_collateral(collateral) {
|
|
_assertClass(collateral, TransactionInputs);
|
|
wasm.transactionbody_set_collateral(this.__wbg_ptr, collateral.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs | undefined}
|
|
*/
|
|
collateral() {
|
|
const ret = wasm.transactionbody_collateral(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHashes} required_signers
|
|
*/
|
|
set_required_signers(required_signers) {
|
|
_assertClass(required_signers, Ed25519KeyHashes);
|
|
wasm.transactionbody_set_required_signers(this.__wbg_ptr, required_signers.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHashes | undefined}
|
|
*/
|
|
required_signers() {
|
|
const ret = wasm.transactionbody_required_signers(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Ed25519KeyHashes.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {NetworkId} network_id
|
|
*/
|
|
set_network_id(network_id) {
|
|
_assertClass(network_id, NetworkId);
|
|
wasm.transactionbody_set_network_id(this.__wbg_ptr, network_id.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {NetworkId | undefined}
|
|
*/
|
|
network_id() {
|
|
const ret = wasm.transactionbody_network_id(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NetworkId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionOutput} collateral_return
|
|
*/
|
|
set_collateral_return(collateral_return) {
|
|
_assertClass(collateral_return, TransactionOutput);
|
|
wasm.transactionbody_set_collateral_return(this.__wbg_ptr, collateral_return.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {TransactionOutput | undefined}
|
|
*/
|
|
collateral_return() {
|
|
const ret = wasm.transactionbody_collateral_return(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionOutput.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} total_collateral
|
|
*/
|
|
set_total_collateral(total_collateral) {
|
|
_assertClass(total_collateral, BigNum);
|
|
wasm.protocolparamupdate_set_key_deposit(this.__wbg_ptr, total_collateral.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
total_collateral() {
|
|
const ret = wasm.protocolparamupdate_key_deposit(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {VotingProcedures} voting_procedures
|
|
*/
|
|
set_voting_procedures(voting_procedures) {
|
|
_assertClass(voting_procedures, VotingProcedures);
|
|
wasm.transactionbody_set_voting_procedures(this.__wbg_ptr, voting_procedures.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {VotingProcedures | undefined}
|
|
*/
|
|
voting_procedures() {
|
|
const ret = wasm.transactionbody_voting_procedures(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : VotingProcedures.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {VotingProposals} voting_proposals
|
|
*/
|
|
set_voting_proposals(voting_proposals) {
|
|
_assertClass(voting_proposals, VotingProposals);
|
|
wasm.transactionbody_set_voting_proposals(this.__wbg_ptr, voting_proposals.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {VotingProposals | undefined}
|
|
*/
|
|
voting_proposals() {
|
|
const ret = wasm.transactionbody_voting_proposals(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : VotingProposals.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} donation
|
|
*/
|
|
set_donation(donation) {
|
|
_assertClass(donation, BigNum);
|
|
wasm.protocolparamupdate_set_pool_deposit(this.__wbg_ptr, donation.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
donation() {
|
|
const ret = wasm.protocolparamupdate_pool_deposit(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} current_treasury_value
|
|
*/
|
|
set_current_treasury_value(current_treasury_value) {
|
|
_assertClass(current_treasury_value, BigNum);
|
|
wasm.transactionbody_set_current_treasury_value(this.__wbg_ptr, current_treasury_value.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
current_treasury_value() {
|
|
const ret = wasm.transactionbody_current_treasury_value(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* This constructor uses outdated slot number format for the ttl value.
|
|
* Use `.new_tx_body` and then `.set_ttl` instead
|
|
* @param {TransactionInputs} inputs
|
|
* @param {TransactionOutputs} outputs
|
|
* @param {BigNum} fee
|
|
* @param {number | undefined} [ttl]
|
|
* @returns {TransactionBody}
|
|
*/
|
|
static new(inputs, outputs, fee, ttl) {
|
|
_assertClass(inputs, TransactionInputs);
|
|
_assertClass(outputs, TransactionOutputs);
|
|
_assertClass(fee, BigNum);
|
|
const ret = wasm.transactionbody_new(inputs.__wbg_ptr, outputs.__wbg_ptr, fee.__wbg_ptr, !isLikeNone(ttl), isLikeNone(ttl) ? 0 : ttl);
|
|
return TransactionBody.__wrap(ret);
|
|
}
|
|
/**
|
|
* Returns a new TransactionBody.
|
|
* In the new version of "new" we removed optional ttl for support it by wasm_bingen.
|
|
* Your can use "set_ttl" and "remove_ttl" to set a new value for ttl or set it as None.
|
|
* @param {TransactionInputs} inputs
|
|
* @param {TransactionOutputs} outputs
|
|
* @param {BigNum} fee
|
|
* @returns {TransactionBody}
|
|
*/
|
|
static new_tx_body(inputs, outputs, fee) {
|
|
_assertClass(inputs, TransactionInputs);
|
|
_assertClass(outputs, TransactionOutputs);
|
|
_assertClass(fee, BigNum);
|
|
const ret = wasm.transactionbody_new_tx_body(inputs.__wbg_ptr, outputs.__wbg_ptr, fee.__wbg_ptr);
|
|
return TransactionBody.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TransactionBody = TransactionBody;
|
|
|
|
const TransactionBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* This automatically selects and adds inputs from {inputs} consisting of just enough to cover
|
|
* the outputs that have already been added.
|
|
* This should be called after adding all certs/outputs/etc and will be an error otherwise.
|
|
* Uses CIP2: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0002/CIP-0002.md
|
|
* Adding a change output must be called after via TransactionBuilder::add_change_if_needed()
|
|
* This function, diverging from CIP2, takes into account fees and will attempt to add additional
|
|
* inputs to cover the minimum fees. This does not, however, set the txbuilder's fee.
|
|
* @param {TransactionUnspentOutputs} inputs
|
|
* @param {CoinSelectionStrategyCIP2} strategy
|
|
*/
|
|
add_inputs_from(inputs, strategy) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(inputs, TransactionUnspentOutputs);
|
|
wasm.transactionbuilder_add_inputs_from(retptr, this.__wbg_ptr, inputs.__wbg_ptr, strategy);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {TxInputsBuilder} inputs
|
|
*/
|
|
set_inputs(inputs) {
|
|
_assertClass(inputs, TxInputsBuilder);
|
|
wasm.transactionbuilder_set_inputs(this.__wbg_ptr, inputs.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {TxInputsBuilder} collateral
|
|
*/
|
|
set_collateral(collateral) {
|
|
_assertClass(collateral, TxInputsBuilder);
|
|
wasm.transactionbuilder_set_collateral(this.__wbg_ptr, collateral.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {TransactionOutput} collateral_return
|
|
*/
|
|
set_collateral_return(collateral_return) {
|
|
_assertClass(collateral_return, TransactionOutput);
|
|
wasm.transactionbuilder_set_collateral_return(this.__wbg_ptr, collateral_return.__wbg_ptr);
|
|
}
|
|
/**
|
|
*/
|
|
remove_collateral_return() {
|
|
wasm.transactionbuilder_remove_collateral_return(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* This function will set the collateral-return value and then auto-calculate and assign
|
|
* the total collateral coin value. Will raise an error in case no collateral inputs are set
|
|
* or in case the total collateral value will have any assets in it except coin.
|
|
* @param {TransactionOutput} collateral_return
|
|
*/
|
|
set_collateral_return_and_total(collateral_return) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(collateral_return, TransactionOutput);
|
|
wasm.transactionbuilder_set_collateral_return_and_total(retptr, this.__wbg_ptr, collateral_return.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} total_collateral
|
|
*/
|
|
set_total_collateral(total_collateral) {
|
|
_assertClass(total_collateral, BigNum);
|
|
wasm.transactionbuilder_set_total_collateral(this.__wbg_ptr, total_collateral.__wbg_ptr);
|
|
}
|
|
/**
|
|
*/
|
|
remove_total_collateral() {
|
|
wasm.transactionbuilder_remove_total_collateral(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* This function will set the total-collateral coin and then auto-calculate and assign
|
|
* the collateral return value. Will raise an error in case no collateral inputs are set.
|
|
* The specified address will be the received of the collateral return
|
|
* @param {BigNum} total_collateral
|
|
* @param {Address} return_address
|
|
*/
|
|
set_total_collateral_and_return(total_collateral, return_address) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(total_collateral, BigNum);
|
|
_assertClass(return_address, Address);
|
|
wasm.transactionbuilder_set_total_collateral_and_return(retptr, this.__wbg_ptr, total_collateral.__wbg_ptr, return_address.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {TransactionInput} reference_input
|
|
*/
|
|
add_reference_input(reference_input) {
|
|
_assertClass(reference_input, TransactionInput);
|
|
wasm.transactionbuilder_add_reference_input(this.__wbg_ptr, reference_input.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {TransactionInput} reference_input
|
|
* @param {number} script_size
|
|
*/
|
|
add_script_reference_input(reference_input, script_size) {
|
|
_assertClass(reference_input, TransactionInput);
|
|
wasm.transactionbuilder_add_script_reference_input(this.__wbg_ptr, reference_input.__wbg_ptr, script_size);
|
|
}
|
|
/**
|
|
* We have to know what kind of inputs these are to know what kind of mock witnesses to create since
|
|
* 1) mock witnesses have different lengths depending on the type which changes the expecting fee
|
|
* 2) Witnesses are a set so we need to get rid of duplicates to avoid over-estimating the fee
|
|
* @param {Ed25519KeyHash} hash
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_key_input(hash, input, amount) {
|
|
_assertClass(hash, Ed25519KeyHash);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.transactionbuilder_add_key_input(this.__wbg_ptr, hash.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
}
|
|
/**
|
|
* This method will add the input to the builder and also register the required native script witness
|
|
* @param {NativeScript} script
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_native_script_input(script, input, amount) {
|
|
_assertClass(script, NativeScript);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.transactionbuilder_add_native_script_input(this.__wbg_ptr, script.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
}
|
|
/**
|
|
* This method will add the input to the builder and also register the required plutus witness
|
|
* @param {PlutusWitness} witness
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_plutus_script_input(witness, input, amount) {
|
|
_assertClass(witness, PlutusWitness);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.transactionbuilder_add_plutus_script_input(this.__wbg_ptr, witness.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {ByronAddress} hash
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_bootstrap_input(hash, input, amount) {
|
|
_assertClass(hash, ByronAddress);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.transactionbuilder_add_bootstrap_input(this.__wbg_ptr, hash.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
}
|
|
/**
|
|
* This function is replace for previous one add_input.
|
|
* The functions adds a non script input, if it is a script input it returns an error.
|
|
* To add script input you need to use add_native_script_input or add_plutus_script_input.
|
|
* Also we recommend to use TxInputsBuilder and .set_inputs, because all add_*_input functions might be removed from transaction builder.
|
|
* @param {Address} address
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_regular_input(address, input, amount) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, Address);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.transactionbuilder_add_regular_input(retptr, this.__wbg_ptr, address.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {TransactionUnspentOutputs} inputs
|
|
* @param {CoinSelectionStrategyCIP2} strategy
|
|
* @param {ChangeConfig} change_config
|
|
* @returns {boolean}
|
|
*/
|
|
add_inputs_from_and_change(inputs, strategy, change_config) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(inputs, TransactionUnspentOutputs);
|
|
_assertClass(change_config, ChangeConfig);
|
|
wasm.transactionbuilder_add_inputs_from_and_change(retptr, this.__wbg_ptr, inputs.__wbg_ptr, strategy, change_config.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 !== 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {TransactionUnspentOutputs} inputs
|
|
* @param {CoinSelectionStrategyCIP2} strategy
|
|
* @param {ChangeConfig} change_config
|
|
* @param {BigNum} collateral_percentage
|
|
*/
|
|
add_inputs_from_and_change_with_collateral_return(inputs, strategy, change_config, collateral_percentage) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(inputs, TransactionUnspentOutputs);
|
|
_assertClass(change_config, ChangeConfig);
|
|
_assertClass(collateral_percentage, BigNum);
|
|
wasm.transactionbuilder_add_inputs_from_and_change_with_collateral_return(retptr, this.__wbg_ptr, inputs.__wbg_ptr, strategy, change_config.__wbg_ptr, collateral_percentage.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Returns a copy of the current script input witness scripts in the builder
|
|
* @returns {NativeScripts | undefined}
|
|
*/
|
|
get_native_input_scripts() {
|
|
const ret = wasm.transactionbuilder_get_native_input_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* Returns a copy of the current plutus input witness scripts in the builder.
|
|
* NOTE: each plutus witness will be cloned with a specific corresponding input index
|
|
* @returns {PlutusWitnesses | undefined}
|
|
*/
|
|
get_plutus_input_scripts() {
|
|
const ret = wasm.transactionbuilder_get_plutus_input_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* calculates how much the fee would increase if you added a given output
|
|
* @param {Address} address
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
* @returns {BigNum}
|
|
*/
|
|
fee_for_input(address, input, amount) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, Address);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.transactionbuilder_fee_for_input(retptr, this.__wbg_ptr, address.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Add explicit output via a TransactionOutput object
|
|
* @param {TransactionOutput} output
|
|
*/
|
|
add_output(output) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(output, TransactionOutput);
|
|
wasm.transactionbuilder_add_output(retptr, this.__wbg_ptr, output.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* calculates how much the fee would increase if you added a given output
|
|
* @param {TransactionOutput} output
|
|
* @returns {BigNum}
|
|
*/
|
|
fee_for_output(output) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(output, TransactionOutput);
|
|
wasm.transactionbuilder_fee_for_output(retptr, this.__wbg_ptr, output.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
*Set exact fee for the transaction. If the real fee will be bigger then the set value, the transaction will not be created on .build_tx()
|
|
* @param {BigNum} fee
|
|
*/
|
|
set_fee(fee) {
|
|
_assertClass(fee, BigNum);
|
|
wasm.transactionbuilder_set_fee(this.__wbg_ptr, fee.__wbg_ptr);
|
|
}
|
|
/**
|
|
*Set minimal fee for the transaction. If the real fee will be bigger then the set value, the transaction will be created with the real fee.
|
|
* @param {BigNum} fee
|
|
*/
|
|
set_min_fee(fee) {
|
|
_assertClass(fee, BigNum);
|
|
wasm.transactionbuilder_set_min_fee(this.__wbg_ptr, fee.__wbg_ptr);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Set ttl value.
|
|
* @param {number} ttl
|
|
*/
|
|
set_ttl(ttl) {
|
|
wasm.transactionbuilder_set_ttl(this.__wbg_ptr, ttl);
|
|
}
|
|
/**
|
|
* @param {BigNum} ttl
|
|
*/
|
|
set_ttl_bignum(ttl) {
|
|
_assertClass(ttl, BigNum);
|
|
wasm.transactionbuilder_set_ttl_bignum(this.__wbg_ptr, ttl.__wbg_ptr);
|
|
}
|
|
/**
|
|
*/
|
|
remove_ttl() {
|
|
wasm.transactionbuilder_remove_ttl(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Uses outdated slot number format.
|
|
* @param {number} validity_start_interval
|
|
*/
|
|
set_validity_start_interval(validity_start_interval) {
|
|
wasm.transactionbuilder_set_validity_start_interval(this.__wbg_ptr, validity_start_interval);
|
|
}
|
|
/**
|
|
* @param {BigNum} validity_start_interval
|
|
*/
|
|
set_validity_start_interval_bignum(validity_start_interval) {
|
|
_assertClass(validity_start_interval, BigNum);
|
|
var ptr0 = validity_start_interval.__destroy_into_raw();
|
|
wasm.transactionbuilder_set_validity_start_interval_bignum(this.__wbg_ptr, ptr0);
|
|
}
|
|
/**
|
|
*/
|
|
remove_validity_start_interval() {
|
|
wasm.transactionbuilder_remove_validity_start_interval(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Can emit error if add a cert with script credential.
|
|
* Use set_certs_builder instead.
|
|
* @param {Certificates} certs
|
|
*/
|
|
set_certs(certs) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(certs, Certificates);
|
|
wasm.transactionbuilder_set_certs(retptr, this.__wbg_ptr, certs.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
*/
|
|
remove_certs() {
|
|
wasm.transactionbuilder_remove_certs(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {CertificatesBuilder} certs
|
|
*/
|
|
set_certs_builder(certs) {
|
|
_assertClass(certs, CertificatesBuilder);
|
|
wasm.transactionbuilder_set_certs_builder(this.__wbg_ptr, certs.__wbg_ptr);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Can emit error if add a withdrawal with script credential.
|
|
* Use set_withdrawals_builder instead.
|
|
* @param {Withdrawals} withdrawals
|
|
*/
|
|
set_withdrawals(withdrawals) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(withdrawals, Withdrawals);
|
|
wasm.transactionbuilder_set_withdrawals(retptr, this.__wbg_ptr, withdrawals.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {WithdrawalsBuilder} withdrawals
|
|
*/
|
|
set_withdrawals_builder(withdrawals) {
|
|
_assertClass(withdrawals, WithdrawalsBuilder);
|
|
wasm.transactionbuilder_set_withdrawals_builder(this.__wbg_ptr, withdrawals.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {VotingBuilder} voting_builder
|
|
*/
|
|
set_voting_builder(voting_builder) {
|
|
_assertClass(voting_builder, VotingBuilder);
|
|
wasm.transactionbuilder_set_voting_builder(this.__wbg_ptr, voting_builder.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {VotingProposalBuilder} voting_proposal_builder
|
|
*/
|
|
set_voting_proposal_builder(voting_proposal_builder) {
|
|
_assertClass(voting_proposal_builder, VotingProposalBuilder);
|
|
wasm.transactionbuilder_set_voting_proposal_builder(this.__wbg_ptr, voting_proposal_builder.__wbg_ptr);
|
|
}
|
|
/**
|
|
*/
|
|
remove_withdrawals() {
|
|
wasm.transactionbuilder_remove_withdrawals(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {AuxiliaryData | undefined}
|
|
*/
|
|
get_auxiliary_data() {
|
|
const ret = wasm.transactionbuilder_get_auxiliary_data(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
|
|
}
|
|
/**
|
|
* Set explicit auxiliary data via an AuxiliaryData object
|
|
* It might contain some metadata plus native or Plutus scripts
|
|
* @param {AuxiliaryData} auxiliary_data
|
|
*/
|
|
set_auxiliary_data(auxiliary_data) {
|
|
_assertClass(auxiliary_data, AuxiliaryData);
|
|
wasm.transactionbuilder_set_auxiliary_data(this.__wbg_ptr, auxiliary_data.__wbg_ptr);
|
|
}
|
|
/**
|
|
*/
|
|
remove_auxiliary_data() {
|
|
wasm.transactionbuilder_remove_auxiliary_data(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* Set metadata using a GeneralTransactionMetadata object
|
|
* It will be set to the existing or new auxiliary data in this builder
|
|
* @param {GeneralTransactionMetadata} metadata
|
|
*/
|
|
set_metadata(metadata) {
|
|
_assertClass(metadata, GeneralTransactionMetadata);
|
|
wasm.transactionbuilder_set_metadata(this.__wbg_ptr, metadata.__wbg_ptr);
|
|
}
|
|
/**
|
|
* Add a single metadatum using TransactionMetadatumLabel and TransactionMetadatum objects
|
|
* It will be securely added to existing or new metadata in this builder
|
|
* @param {BigNum} key
|
|
* @param {TransactionMetadatum} val
|
|
*/
|
|
add_metadatum(key, val) {
|
|
_assertClass(key, BigNum);
|
|
_assertClass(val, TransactionMetadatum);
|
|
wasm.transactionbuilder_add_metadatum(this.__wbg_ptr, key.__wbg_ptr, val.__wbg_ptr);
|
|
}
|
|
/**
|
|
* Add a single JSON metadatum using a TransactionMetadatumLabel and a String
|
|
* It will be securely added to existing or new metadata in this builder
|
|
* @param {BigNum} key
|
|
* @param {string} val
|
|
*/
|
|
add_json_metadatum(key, val) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(key, BigNum);
|
|
const ptr0 = passStringToWasm0(val, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionbuilder_add_json_metadatum(retptr, this.__wbg_ptr, key.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Add a single JSON metadatum using a TransactionMetadatumLabel, a String, and a MetadataJsonSchema object
|
|
* It will be securely added to existing or new metadata in this builder
|
|
* @param {BigNum} key
|
|
* @param {string} val
|
|
* @param {MetadataJsonSchema} schema
|
|
*/
|
|
add_json_metadatum_with_schema(key, val, schema) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(key, BigNum);
|
|
const ptr0 = passStringToWasm0(val, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionbuilder_add_json_metadatum_with_schema(retptr, this.__wbg_ptr, key.__wbg_ptr, ptr0, len0, schema);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {MintBuilder} mint_builder
|
|
*/
|
|
set_mint_builder(mint_builder) {
|
|
_assertClass(mint_builder, MintBuilder);
|
|
wasm.transactionbuilder_set_mint_builder(this.__wbg_ptr, mint_builder.__wbg_ptr);
|
|
}
|
|
/**
|
|
*/
|
|
remove_mint_builder() {
|
|
wasm.transactionbuilder_remove_mint_builder(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {MintBuilder | undefined}
|
|
*/
|
|
get_mint_builder() {
|
|
const ret = wasm.transactionbuilder_get_mint_builder(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : MintBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Mints are defining by MintBuilder now.
|
|
* Use `.set_mint_builder()` and `MintBuilder` instead.
|
|
* Set explicit Mint object and the required witnesses to this builder
|
|
* it will replace any previously existing mint and mint scripts
|
|
* NOTE! Error will be returned in case a mint policy does not have a matching script
|
|
* @param {Mint} mint
|
|
* @param {NativeScripts} mint_scripts
|
|
*/
|
|
set_mint(mint, mint_scripts) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(mint, Mint);
|
|
_assertClass(mint_scripts, NativeScripts);
|
|
wasm.transactionbuilder_set_mint(retptr, this.__wbg_ptr, mint.__wbg_ptr, mint_scripts.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Mints are defining by MintBuilder now.
|
|
* Use `.get_mint_builder()` and `.build()` instead.
|
|
* Returns a copy of the current mint state in the builder
|
|
* @returns {Mint | undefined}
|
|
*/
|
|
get_mint() {
|
|
const ret = wasm.transactionbuilder_get_mint(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Mint.__wrap(ret);
|
|
}
|
|
/**
|
|
* Returns a copy of the current mint witness scripts in the builder
|
|
* @returns {NativeScripts | undefined}
|
|
*/
|
|
get_mint_scripts() {
|
|
const ret = wasm.transactionbuilder_get_mint_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Mints are defining by MintBuilder now.
|
|
* Use `.set_mint_builder()` and `MintBuilder` instead.
|
|
* Add a mint entry to this builder using a PolicyID and MintAssets object
|
|
* It will be securely added to existing or new Mint in this builder
|
|
* It will replace any existing mint assets with the same PolicyID
|
|
* @param {NativeScript} policy_script
|
|
* @param {MintAssets} mint_assets
|
|
*/
|
|
set_mint_asset(policy_script, mint_assets) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(policy_script, NativeScript);
|
|
_assertClass(mint_assets, MintAssets);
|
|
wasm.transactionbuilder_set_mint_asset(retptr, this.__wbg_ptr, policy_script.__wbg_ptr, mint_assets.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* !!! DEPRECATED !!!
|
|
* Mints are defining by MintBuilder now.
|
|
* Use `.set_mint_builder()` and `MintBuilder` instead.
|
|
* Add a mint entry to this builder using a PolicyID, AssetName, and Int object for amount
|
|
* It will be securely added to existing or new Mint in this builder
|
|
* It will replace any previous existing amount same PolicyID and AssetName
|
|
* @param {NativeScript} policy_script
|
|
* @param {AssetName} asset_name
|
|
* @param {Int} amount
|
|
*/
|
|
add_mint_asset(policy_script, asset_name, amount) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(policy_script, NativeScript);
|
|
_assertClass(asset_name, AssetName);
|
|
_assertClass(amount, Int);
|
|
wasm.transactionbuilder_add_mint_asset(retptr, this.__wbg_ptr, policy_script.__wbg_ptr, asset_name.__wbg_ptr, amount.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Add a mint entry together with an output to this builder
|
|
* Using a PolicyID, AssetName, Int for amount, Address, and Coin (BigNum) objects
|
|
* The asset will be securely added to existing or new Mint in this builder
|
|
* A new output will be added with the specified Address, the Coin value, and the minted asset
|
|
* @param {NativeScript} policy_script
|
|
* @param {AssetName} asset_name
|
|
* @param {Int} amount
|
|
* @param {TransactionOutputAmountBuilder} output_builder
|
|
* @param {BigNum} output_coin
|
|
*/
|
|
add_mint_asset_and_output(policy_script, asset_name, amount, output_builder, output_coin) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(policy_script, NativeScript);
|
|
_assertClass(asset_name, AssetName);
|
|
_assertClass(amount, Int);
|
|
_assertClass(output_builder, TransactionOutputAmountBuilder);
|
|
_assertClass(output_coin, BigNum);
|
|
wasm.transactionbuilder_add_mint_asset_and_output(retptr, this.__wbg_ptr, policy_script.__wbg_ptr, asset_name.__wbg_ptr, amount.__wbg_ptr, output_builder.__wbg_ptr, output_coin.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Add a mint entry together with an output to this builder
|
|
* Using a PolicyID, AssetName, Int for amount, and Address objects
|
|
* The asset will be securely added to existing or new Mint in this builder
|
|
* A new output will be added with the specified Address and the minted asset
|
|
* The output will be set to contain the minimum required amount of Coin
|
|
* @param {NativeScript} policy_script
|
|
* @param {AssetName} asset_name
|
|
* @param {Int} amount
|
|
* @param {TransactionOutputAmountBuilder} output_builder
|
|
*/
|
|
add_mint_asset_and_output_min_required_coin(policy_script, asset_name, amount, output_builder) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(policy_script, NativeScript);
|
|
_assertClass(asset_name, AssetName);
|
|
_assertClass(amount, Int);
|
|
_assertClass(output_builder, TransactionOutputAmountBuilder);
|
|
wasm.transactionbuilder_add_mint_asset_and_output_min_required_coin(retptr, this.__wbg_ptr, policy_script.__wbg_ptr, asset_name.__wbg_ptr, amount.__wbg_ptr, output_builder.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {PlutusData} datum
|
|
*/
|
|
add_extra_witness_datum(datum) {
|
|
_assertClass(datum, PlutusData);
|
|
wasm.transactionbuilder_add_extra_witness_datum(this.__wbg_ptr, datum.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {PlutusList | undefined}
|
|
*/
|
|
get_extra_witness_datums() {
|
|
const ret = wasm.transactionbuilder_get_extra_witness_datums(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusList.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} donation
|
|
*/
|
|
set_donation(donation) {
|
|
_assertClass(donation, BigNum);
|
|
wasm.transactionbuilder_set_donation(this.__wbg_ptr, donation.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
get_donation() {
|
|
const ret = wasm.transactionbuilder_get_donation(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} current_treasury_value
|
|
*/
|
|
set_current_treasury_value(current_treasury_value) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(current_treasury_value, BigNum);
|
|
wasm.transactionbuilder_set_current_treasury_value(retptr, this.__wbg_ptr, current_treasury_value.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
get_current_treasury_value() {
|
|
const ret = wasm.transactionbuilder_get_current_treasury_value(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionBuilderConfig} cfg
|
|
* @returns {TransactionBuilder}
|
|
*/
|
|
static new(cfg) {
|
|
_assertClass(cfg, TransactionBuilderConfig);
|
|
const ret = wasm.transactionbuilder_new(cfg.__wbg_ptr);
|
|
return TransactionBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
get_reference_inputs() {
|
|
const ret = wasm.transactionbuilder_get_reference_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* does not include refunds or withdrawals
|
|
* @returns {Value}
|
|
*/
|
|
get_explicit_input() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_get_explicit_input(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* withdrawals and refunds
|
|
* @returns {Value}
|
|
*/
|
|
get_implicit_input() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_get_implicit_input(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Return explicit input plus implicit input plus mint
|
|
* @returns {Value}
|
|
*/
|
|
get_total_input() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_get_total_input(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Return explicit output plus deposit plus burn
|
|
* @returns {Value}
|
|
*/
|
|
get_total_output() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_get_total_output(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* does not include fee
|
|
* @returns {Value}
|
|
*/
|
|
get_explicit_output() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_get_explicit_output(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
get_deposit() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_get_deposit(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
get_fee_if_set() {
|
|
const ret = wasm.transactionbuilder_get_fee_if_set(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* Warning: this function will mutate the /fee/ field
|
|
* Make sure to call this function last after setting all other tx-body properties
|
|
* Editing inputs, outputs, mint, etc. after change been calculated
|
|
* might cause a mismatch in calculated fee versus the required fee
|
|
* @param {Address} address
|
|
* @returns {boolean}
|
|
*/
|
|
add_change_if_needed(address) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, Address);
|
|
wasm.transactionbuilder_add_change_if_needed(retptr, this.__wbg_ptr, address.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 !== 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Address} address
|
|
* @param {OutputDatum} plutus_data
|
|
* @returns {boolean}
|
|
*/
|
|
add_change_if_needed_with_datum(address, plutus_data) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, Address);
|
|
_assertClass(plutus_data, OutputDatum);
|
|
wasm.transactionbuilder_add_change_if_needed_with_datum(retptr, this.__wbg_ptr, address.__wbg_ptr, plutus_data.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 !== 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* This method will calculate the script hash data
|
|
* using the plutus datums and redeemers already present in the builder
|
|
* along with the provided cost model, and will register the calculated value
|
|
* in the builder to be used when building the tx body.
|
|
* In case there are no plutus input witnesses present - nothing will change
|
|
* You can set specific hash value using `.set_script_data_hash`
|
|
* NOTE: this function will check which language versions are used in the present scripts
|
|
* and will assert and require for a corresponding cost-model to be present in the passed map.
|
|
* Only the cost-models for the present language versions will be used in the hash calculation.
|
|
* @param {Costmdls} cost_models
|
|
*/
|
|
calc_script_data_hash(cost_models) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(cost_models, Costmdls);
|
|
wasm.transactionbuilder_calc_script_data_hash(retptr, this.__wbg_ptr, cost_models.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Sets the specified hash value.
|
|
* Alternatively you can use `.calc_script_data_hash` to calculate the hash automatically.
|
|
* Or use `.remove_script_data_hash` to delete the previously set value
|
|
* @param {ScriptDataHash} hash
|
|
*/
|
|
set_script_data_hash(hash) {
|
|
_assertClass(hash, ScriptDataHash);
|
|
wasm.transactionbuilder_set_script_data_hash(this.__wbg_ptr, hash.__wbg_ptr);
|
|
}
|
|
/**
|
|
* Deletes any previously set plutus data hash value.
|
|
* Use `.set_script_data_hash` or `.calc_script_data_hash` to set it.
|
|
*/
|
|
remove_script_data_hash() {
|
|
wasm.transactionbuilder_remove_script_data_hash(this.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} key
|
|
*/
|
|
add_required_signer(key) {
|
|
_assertClass(key, Ed25519KeyHash);
|
|
wasm.transactionbuilder_add_required_signer(this.__wbg_ptr, key.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
full_size() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_full_size(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return r0 >>> 0;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint32Array}
|
|
*/
|
|
output_sizes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_output_sizes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Returns object the body of the new transaction
|
|
* Auxiliary data itself is not included
|
|
* You can use `get_auxiliary_data` or `build_tx`
|
|
* @returns {TransactionBody}
|
|
*/
|
|
build() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_build(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBody.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Returns full Transaction object with the body and the auxiliary data
|
|
* NOTE: witness_set will contain all mint_scripts if any been added or set
|
|
* NOTE: is_valid set to true
|
|
* NOTE: Will fail in case there are any script inputs added with no corresponding witness
|
|
* @returns {Transaction}
|
|
*/
|
|
build_tx() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_build_tx(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Transaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* Similar to `.build_tx()` but will NOT fail in case there are missing script witnesses
|
|
* @returns {Transaction}
|
|
*/
|
|
build_tx_unsafe() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_build_tx_unsafe(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Transaction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* warning: sum of all parts of a transaction must equal 0. You cannot just set the fee to the min value and forget about it
|
|
* warning: min_fee may be slightly larger than the actual minimum fee (ex: a few lovelaces)
|
|
* this is done to simplify the library code, but can be fixed later
|
|
* @returns {BigNum}
|
|
*/
|
|
min_fee() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilder_min_fee(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return BigNum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.TransactionBuilder = TransactionBuilder;
|
|
|
|
const TransactionBuilderConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionbuilderconfig_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionBuilderConfig {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionBuilderConfig.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionBuilderConfigFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionBuilderConfigFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionbuilderconfig_free(ptr);
|
|
}
|
|
}
|
|
module.exports.TransactionBuilderConfig = TransactionBuilderConfig;
|
|
|
|
const TransactionBuilderConfigBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionbuilderconfigbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionBuilderConfigBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionBuilderConfigBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionBuilderConfigBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionBuilderConfigBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionbuilderconfigbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.transactionbuilderconfigbuilder_new();
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {LinearFee} fee_algo
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
fee_algo(fee_algo) {
|
|
_assertClass(fee_algo, LinearFee);
|
|
const ret = wasm.transactionbuilderconfigbuilder_fee_algo(this.__wbg_ptr, fee_algo.__wbg_ptr);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} coins_per_utxo_byte
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
coins_per_utxo_byte(coins_per_utxo_byte) {
|
|
_assertClass(coins_per_utxo_byte, BigNum);
|
|
const ret = wasm.transactionbuilderconfigbuilder_coins_per_utxo_byte(this.__wbg_ptr, coins_per_utxo_byte.__wbg_ptr);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ExUnitPrices} ex_unit_prices
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
ex_unit_prices(ex_unit_prices) {
|
|
_assertClass(ex_unit_prices, ExUnitPrices);
|
|
const ret = wasm.transactionbuilderconfigbuilder_ex_unit_prices(this.__wbg_ptr, ex_unit_prices.__wbg_ptr);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} pool_deposit
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
pool_deposit(pool_deposit) {
|
|
_assertClass(pool_deposit, BigNum);
|
|
const ret = wasm.transactionbuilderconfigbuilder_pool_deposit(this.__wbg_ptr, pool_deposit.__wbg_ptr);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} key_deposit
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
key_deposit(key_deposit) {
|
|
_assertClass(key_deposit, BigNum);
|
|
const ret = wasm.transactionbuilderconfigbuilder_key_deposit(this.__wbg_ptr, key_deposit.__wbg_ptr);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} max_value_size
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
max_value_size(max_value_size) {
|
|
const ret = wasm.transactionbuilderconfigbuilder_max_value_size(this.__wbg_ptr, max_value_size);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {number} max_tx_size
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
max_tx_size(max_tx_size) {
|
|
const ret = wasm.transactionbuilderconfigbuilder_max_tx_size(this.__wbg_ptr, max_tx_size);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {UnitInterval} ref_script_coins_per_byte
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
ref_script_coins_per_byte(ref_script_coins_per_byte) {
|
|
_assertClass(ref_script_coins_per_byte, UnitInterval);
|
|
const ret = wasm.transactionbuilderconfigbuilder_ref_script_coins_per_byte(this.__wbg_ptr, ref_script_coins_per_byte.__wbg_ptr);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {boolean} prefer_pure_change
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
prefer_pure_change(prefer_pure_change) {
|
|
const ret = wasm.transactionbuilderconfigbuilder_prefer_pure_change(this.__wbg_ptr, prefer_pure_change);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
*Removes a ref input (that was set via set_reference_inputs) if the ref inputs was presented in regular tx inputs
|
|
* @param {boolean} deduplicate_explicit_ref_inputs_with_regular_inputs
|
|
* @returns {TransactionBuilderConfigBuilder}
|
|
*/
|
|
deduplicate_explicit_ref_inputs_with_regular_inputs(deduplicate_explicit_ref_inputs_with_regular_inputs) {
|
|
const ret = wasm.transactionbuilderconfigbuilder_deduplicate_explicit_ref_inputs_with_regular_inputs(this.__wbg_ptr, deduplicate_explicit_ref_inputs_with_regular_inputs);
|
|
return TransactionBuilderConfigBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionBuilderConfig}
|
|
*/
|
|
build() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionbuilderconfigbuilder_build(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionBuilderConfig.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.TransactionBuilderConfigBuilder = TransactionBuilderConfigBuilder;
|
|
|
|
const TransactionHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionhash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionhash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionhash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {TransactionHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionhash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {TransactionHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionhash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.TransactionHash = TransactionHash;
|
|
|
|
const TransactionInputFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactioninput_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionInput {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionInput.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionInputFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionInputFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactioninput_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactioninput_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionInput}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactioninput_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionInput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactioninput_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionInput}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactioninput_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionInput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactioninput_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactioninput_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionInput}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactioninput_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionInput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionHash}
|
|
*/
|
|
transaction_id() {
|
|
const ret = wasm.transactioninput_transaction_id(this.__wbg_ptr);
|
|
return TransactionHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
index() {
|
|
const ret = wasm.transactioninput_index(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {TransactionHash} transaction_id
|
|
* @param {number} index
|
|
* @returns {TransactionInput}
|
|
*/
|
|
static new(transaction_id, index) {
|
|
_assertClass(transaction_id, TransactionHash);
|
|
const ret = wasm.transactioninput_new(transaction_id.__wbg_ptr, index);
|
|
return TransactionInput.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TransactionInput = TransactionInput;
|
|
|
|
const TransactionInputsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactioninputs_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionInputs {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionInputs.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionInputsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionInputsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactioninputs_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactioninputs_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactioninputs_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionInputs.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactioninputs_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactioninputs_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionInputs.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactioninputs_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactioninputs_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactioninputs_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionInputs.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.transactioninputs_new();
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.costmdls_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {TransactionInput}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.transactioninputs_get(this.__wbg_ptr, index);
|
|
return TransactionInput.__wrap(ret);
|
|
}
|
|
/**
|
|
* Add a new `TransactionInput` to the set.
|
|
* Returns `true` if the element was not already present in the set.
|
|
* @param {TransactionInput} input
|
|
* @returns {boolean}
|
|
*/
|
|
add(input) {
|
|
_assertClass(input, TransactionInput);
|
|
const ret = wasm.transactioninputs_add(this.__wbg_ptr, input.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs | undefined}
|
|
*/
|
|
to_option() {
|
|
const ret = wasm.transactioninputs_to_option(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionInputs.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TransactionInputs = TransactionInputs;
|
|
|
|
const TransactionMetadatumFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionmetadatum_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionMetadatum {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionMetadatum.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionMetadatumFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionMetadatumFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionmetadatum_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatum_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionmetadatum_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatum_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionmetadatum_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {MetadataMap} map
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
static new_map(map) {
|
|
_assertClass(map, MetadataMap);
|
|
const ret = wasm.transactionmetadatum_new_map(map.__wbg_ptr);
|
|
return TransactionMetadatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MetadataList} list
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
static new_list(list) {
|
|
_assertClass(list, MetadataList);
|
|
const ret = wasm.transactionmetadatum_new_list(list.__wbg_ptr);
|
|
return TransactionMetadatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Int} int
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
static new_int(int) {
|
|
_assertClass(int, Int);
|
|
const ret = wasm.transactionmetadatum_new_int(int.__wbg_ptr);
|
|
return TransactionMetadatum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
static new_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionmetadatum_new_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} text
|
|
* @returns {TransactionMetadatum}
|
|
*/
|
|
static new_text(text) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionmetadatum_new_text(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatum.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionMetadatumKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.transactionmetadatum_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {MetadataMap}
|
|
*/
|
|
as_map() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatum_as_map(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MetadataMap.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {MetadataList}
|
|
*/
|
|
as_list() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatum_as_list(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return MetadataList.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Int}
|
|
*/
|
|
as_int() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatum_as_int(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Int.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
as_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatum_as_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
if (r3) {
|
|
throw takeObject(r2);
|
|
}
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
as_text() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatum_as_text(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
}
|
|
module.exports.TransactionMetadatum = TransactionMetadatum;
|
|
|
|
const TransactionMetadatumLabelsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionmetadatumlabels_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionMetadatumLabels {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionMetadatumLabels.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionMetadatumLabelsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionMetadatumLabelsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionmetadatumlabels_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatumlabels_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionMetadatumLabels}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionmetadatumlabels_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatumLabels.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionmetadatumlabels_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionMetadatumLabels}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionmetadatumlabels_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionMetadatumLabels.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionMetadatumLabels}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.fixedtransactionbodies_new();
|
|
return TransactionMetadatumLabels.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.fixedtransactionbodies_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {BigNum}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.transactionmetadatumlabels_get(this.__wbg_ptr, index);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, BigNum);
|
|
wasm.transactionmetadatumlabels_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.TransactionMetadatumLabels = TransactionMetadatumLabels;
|
|
|
|
const TransactionOutputFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionoutput_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionOutput {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionOutput.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionOutputFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionOutputFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionoutput_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutput_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionOutput}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionoutput_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutput_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionOutput}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionoutput_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutput_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutput_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionOutput}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionoutput_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Address}
|
|
*/
|
|
address() {
|
|
const ret = wasm.transactionoutput_address(this.__wbg_ptr);
|
|
return Address.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Value}
|
|
*/
|
|
amount() {
|
|
const ret = wasm.transactionoutput_amount(this.__wbg_ptr);
|
|
return Value.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DataHash | undefined}
|
|
*/
|
|
data_hash() {
|
|
const ret = wasm.transactionoutput_data_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : DataHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PlutusData | undefined}
|
|
*/
|
|
plutus_data() {
|
|
const ret = wasm.transactionoutput_plutus_data(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusData.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptRef | undefined}
|
|
*/
|
|
script_ref() {
|
|
const ret = wasm.transactionoutput_script_ref(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptRef.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptRef} script_ref
|
|
*/
|
|
set_script_ref(script_ref) {
|
|
_assertClass(script_ref, ScriptRef);
|
|
wasm.transactionoutput_set_script_ref(this.__wbg_ptr, script_ref.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {PlutusData} data
|
|
*/
|
|
set_plutus_data(data) {
|
|
_assertClass(data, PlutusData);
|
|
wasm.transactionoutput_set_plutus_data(this.__wbg_ptr, data.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {DataHash} data_hash
|
|
*/
|
|
set_data_hash(data_hash) {
|
|
_assertClass(data_hash, DataHash);
|
|
wasm.transactionoutput_set_data_hash(this.__wbg_ptr, data_hash.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_plutus_data() {
|
|
const ret = wasm.transactionoutput_has_plutus_data(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_data_hash() {
|
|
const ret = wasm.transactionoutput_has_data_hash(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_ref() {
|
|
const ret = wasm.transactionoutput_has_script_ref(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @param {Address} address
|
|
* @param {Value} amount
|
|
* @returns {TransactionOutput}
|
|
*/
|
|
static new(address, amount) {
|
|
_assertClass(address, Address);
|
|
_assertClass(amount, Value);
|
|
const ret = wasm.transactionoutput_new(address.__wbg_ptr, amount.__wbg_ptr);
|
|
return TransactionOutput.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {CborContainerType | undefined}
|
|
*/
|
|
serialization_format() {
|
|
const ret = wasm.transactionoutput_serialization_format(this.__wbg_ptr);
|
|
return ret === 2 ? undefined : ret;
|
|
}
|
|
}
|
|
module.exports.TransactionOutput = TransactionOutput;
|
|
|
|
const TransactionOutputAmountBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionoutputamountbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionOutputAmountBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionOutputAmountBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionOutputAmountBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionOutputAmountBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionoutputamountbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Value} amount
|
|
* @returns {TransactionOutputAmountBuilder}
|
|
*/
|
|
with_value(amount) {
|
|
_assertClass(amount, Value);
|
|
const ret = wasm.transactionoutputamountbuilder_with_value(this.__wbg_ptr, amount.__wbg_ptr);
|
|
return TransactionOutputAmountBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} coin
|
|
* @returns {TransactionOutputAmountBuilder}
|
|
*/
|
|
with_coin(coin) {
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.transactionoutputamountbuilder_with_coin(this.__wbg_ptr, coin.__wbg_ptr);
|
|
return TransactionOutputAmountBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} coin
|
|
* @param {MultiAsset} multiasset
|
|
* @returns {TransactionOutputAmountBuilder}
|
|
*/
|
|
with_coin_and_asset(coin, multiasset) {
|
|
_assertClass(coin, BigNum);
|
|
_assertClass(multiasset, MultiAsset);
|
|
const ret = wasm.transactionoutputamountbuilder_with_coin_and_asset(this.__wbg_ptr, coin.__wbg_ptr, multiasset.__wbg_ptr);
|
|
return TransactionOutputAmountBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MultiAsset} multiasset
|
|
* @param {DataCost} data_cost
|
|
* @returns {TransactionOutputAmountBuilder}
|
|
*/
|
|
with_asset_and_min_required_coin_by_utxo_cost(multiasset, data_cost) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(multiasset, MultiAsset);
|
|
_assertClass(data_cost, DataCost);
|
|
wasm.transactionoutputamountbuilder_with_asset_and_min_required_coin_by_utxo_cost(retptr, this.__wbg_ptr, multiasset.__wbg_ptr, data_cost.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutputAmountBuilder.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionOutput}
|
|
*/
|
|
build() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutputamountbuilder_build(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.TransactionOutputAmountBuilder = TransactionOutputAmountBuilder;
|
|
|
|
const TransactionOutputBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionoutputbuilder_free(ptr >>> 0));
|
|
/**
|
|
* We introduce a builder-pattern format for creating transaction outputs
|
|
* This is because:
|
|
* 1. Some fields (i.e. data hash) are optional, and we can't easily expose Option<> in WASM
|
|
* 2. Some fields like amounts have many ways it could be set (some depending on other field values being known)
|
|
* 3. Easier to adapt as the output format gets more complicated in future Cardano releases
|
|
*/
|
|
class TransactionOutputBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionOutputBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionOutputBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionOutputBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionoutputbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {TransactionOutputBuilder}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.transactionoutputbuilder_new();
|
|
return TransactionOutputBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Address} address
|
|
* @returns {TransactionOutputBuilder}
|
|
*/
|
|
with_address(address) {
|
|
_assertClass(address, Address);
|
|
const ret = wasm.transactionoutputbuilder_with_address(this.__wbg_ptr, address.__wbg_ptr);
|
|
return TransactionOutputBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {DataHash} data_hash
|
|
* @returns {TransactionOutputBuilder}
|
|
*/
|
|
with_data_hash(data_hash) {
|
|
_assertClass(data_hash, DataHash);
|
|
const ret = wasm.transactionoutputbuilder_with_data_hash(this.__wbg_ptr, data_hash.__wbg_ptr);
|
|
return TransactionOutputBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusData} data
|
|
* @returns {TransactionOutputBuilder}
|
|
*/
|
|
with_plutus_data(data) {
|
|
_assertClass(data, PlutusData);
|
|
const ret = wasm.transactionoutputbuilder_with_plutus_data(this.__wbg_ptr, data.__wbg_ptr);
|
|
return TransactionOutputBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {ScriptRef} script_ref
|
|
* @returns {TransactionOutputBuilder}
|
|
*/
|
|
with_script_ref(script_ref) {
|
|
_assertClass(script_ref, ScriptRef);
|
|
const ret = wasm.transactionoutputbuilder_with_script_ref(this.__wbg_ptr, script_ref.__wbg_ptr);
|
|
return TransactionOutputBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionOutputAmountBuilder}
|
|
*/
|
|
next() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutputbuilder_next(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutputAmountBuilder.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.TransactionOutputBuilder = TransactionOutputBuilder;
|
|
|
|
const TransactionOutputsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionoutputs_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionOutputs {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionOutputs.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionOutputsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionOutputsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionoutputs_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutputs_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionOutputs}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionoutputs_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutputs.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutputs_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionOutputs}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionoutputs_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutputs.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutputs_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionoutputs_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionOutputs}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionoutputs_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionOutputs.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionOutputs}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.transactionoutputs_new();
|
|
return TransactionOutputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.assetnames_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {TransactionOutput}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.transactionoutputs_get(this.__wbg_ptr, index);
|
|
return TransactionOutput.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionOutput} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, TransactionOutput);
|
|
wasm.transactionoutputs_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.TransactionOutputs = TransactionOutputs;
|
|
|
|
const TransactionUnspentOutputFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionunspentoutput_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionUnspentOutput {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionUnspentOutput.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionUnspentOutputFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionUnspentOutputFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionunspentoutput_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionunspentoutput_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionUnspentOutput}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionunspentoutput_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionUnspentOutput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionunspentoutput_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionUnspentOutput}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionunspentoutput_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionUnspentOutput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionunspentoutput_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionunspentoutput_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionUnspentOutput}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionunspentoutput_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionUnspentOutput.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {TransactionInput} input
|
|
* @param {TransactionOutput} output
|
|
* @returns {TransactionUnspentOutput}
|
|
*/
|
|
static new(input, output) {
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(output, TransactionOutput);
|
|
const ret = wasm.transactionunspentoutput_new(input.__wbg_ptr, output.__wbg_ptr);
|
|
return TransactionUnspentOutput.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionInput}
|
|
*/
|
|
input() {
|
|
const ret = wasm.transactionunspentoutput_input(this.__wbg_ptr);
|
|
return TransactionInput.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionOutput}
|
|
*/
|
|
output() {
|
|
const ret = wasm.transactionunspentoutput_output(this.__wbg_ptr);
|
|
return TransactionOutput.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TransactionUnspentOutput = TransactionUnspentOutput;
|
|
|
|
const TransactionUnspentOutputsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionunspentoutputs_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionUnspentOutputs {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionUnspentOutputs.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionUnspentOutputsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionUnspentOutputsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionunspentoutputs_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionunspentoutputs_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionunspentoutputs_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionUnspentOutputs}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionunspentoutputs_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionUnspentOutputs.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionUnspentOutputs}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.plutusmapvalues_new();
|
|
return TransactionUnspentOutputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.plutuslist_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {TransactionUnspentOutput}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.transactionunspentoutputs_get(this.__wbg_ptr, index);
|
|
return TransactionUnspentOutput.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionUnspentOutput} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, TransactionUnspentOutput);
|
|
wasm.transactionunspentoutputs_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.TransactionUnspentOutputs = TransactionUnspentOutputs;
|
|
|
|
const TransactionWitnessSetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionwitnessset_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionWitnessSet {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionWitnessSet.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionWitnessSetFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionWitnessSetFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionwitnessset_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionwitnessset_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionWitnessSet}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionwitnessset_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionWitnessSet.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionwitnessset_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionWitnessSet}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionwitnessset_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionWitnessSet.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionwitnessset_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionwitnessset_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionWitnessSet}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionwitnessset_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionWitnessSet.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Vkeywitnesses} vkeys
|
|
*/
|
|
set_vkeys(vkeys) {
|
|
_assertClass(vkeys, Vkeywitnesses);
|
|
wasm.transactionwitnessset_set_vkeys(this.__wbg_ptr, vkeys.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Vkeywitnesses | undefined}
|
|
*/
|
|
vkeys() {
|
|
const ret = wasm.transactionwitnessset_vkeys(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Vkeywitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {NativeScripts} native_scripts
|
|
*/
|
|
set_native_scripts(native_scripts) {
|
|
_assertClass(native_scripts, NativeScripts);
|
|
wasm.transactionwitnessset_set_native_scripts(this.__wbg_ptr, native_scripts.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {NativeScripts | undefined}
|
|
*/
|
|
native_scripts() {
|
|
const ret = wasm.transactionwitnessset_native_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BootstrapWitnesses} bootstraps
|
|
*/
|
|
set_bootstraps(bootstraps) {
|
|
_assertClass(bootstraps, BootstrapWitnesses);
|
|
wasm.transactionwitnessset_set_bootstraps(this.__wbg_ptr, bootstraps.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {BootstrapWitnesses | undefined}
|
|
*/
|
|
bootstraps() {
|
|
const ret = wasm.transactionwitnessset_bootstraps(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : BootstrapWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusScripts} plutus_scripts
|
|
*/
|
|
set_plutus_scripts(plutus_scripts) {
|
|
_assertClass(plutus_scripts, PlutusScripts);
|
|
wasm.transactionwitnessset_set_plutus_scripts(this.__wbg_ptr, plutus_scripts.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {PlutusScripts | undefined}
|
|
*/
|
|
plutus_scripts() {
|
|
const ret = wasm.transactionwitnessset_plutus_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {PlutusList} plutus_data
|
|
*/
|
|
set_plutus_data(plutus_data) {
|
|
_assertClass(plutus_data, PlutusList);
|
|
wasm.transactionwitnessset_set_plutus_data(this.__wbg_ptr, plutus_data.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {PlutusList | undefined}
|
|
*/
|
|
plutus_data() {
|
|
const ret = wasm.transactionwitnessset_plutus_data(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusList.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Redeemers} redeemers
|
|
*/
|
|
set_redeemers(redeemers) {
|
|
_assertClass(redeemers, Redeemers);
|
|
wasm.transactionwitnessset_set_redeemers(this.__wbg_ptr, redeemers.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Redeemers | undefined}
|
|
*/
|
|
redeemers() {
|
|
const ret = wasm.transactionwitnessset_redeemers(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Redeemers.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionWitnessSet}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.transactionwitnessset_new();
|
|
return TransactionWitnessSet.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TransactionWitnessSet = TransactionWitnessSet;
|
|
|
|
const TransactionWitnessSetsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_transactionwitnesssets_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TransactionWitnessSets {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TransactionWitnessSets.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TransactionWitnessSetsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TransactionWitnessSetsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_transactionwitnesssets_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionwitnesssets_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TransactionWitnessSets}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionwitnesssets_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionWitnessSets.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionwitnesssets_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TransactionWitnessSets}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionwitnesssets_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionWitnessSets.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionwitnesssets_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.transactionwitnesssets_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TransactionWitnessSets}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.transactionwitnesssets_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TransactionWitnessSets.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionWitnessSets}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.transactionwitnesssets_new();
|
|
return TransactionWitnessSets.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.nativescripts_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {TransactionWitnessSet}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.transactionwitnesssets_get(this.__wbg_ptr, index);
|
|
return TransactionWitnessSet.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TransactionWitnessSet} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, TransactionWitnessSet);
|
|
wasm.transactionwitnesssets_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.TransactionWitnessSets = TransactionWitnessSets;
|
|
|
|
const TreasuryWithdrawalsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_treasurywithdrawals_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TreasuryWithdrawals {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TreasuryWithdrawals.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TreasuryWithdrawalsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TreasuryWithdrawalsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_treasurywithdrawals_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.treasurywithdrawals_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.treasurywithdrawals_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TreasuryWithdrawals}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.treasurywithdrawals_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TreasuryWithdrawals.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TreasuryWithdrawals}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.treasurywithdrawals_new();
|
|
return TreasuryWithdrawals.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {RewardAddress} key
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, RewardAddress);
|
|
const ret = wasm.treasurywithdrawals_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {RewardAddress} key
|
|
* @param {BigNum} value
|
|
*/
|
|
insert(key, value) {
|
|
_assertClass(key, RewardAddress);
|
|
_assertClass(value, BigNum);
|
|
wasm.treasurywithdrawals_insert(this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {RewardAddresses}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.treasurywithdrawals_keys(this.__wbg_ptr);
|
|
return RewardAddresses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.governanceactionids_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
}
|
|
module.exports.TreasuryWithdrawals = TreasuryWithdrawals;
|
|
|
|
const TreasuryWithdrawalsActionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_treasurywithdrawalsaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TreasuryWithdrawalsAction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TreasuryWithdrawalsAction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TreasuryWithdrawalsActionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TreasuryWithdrawalsActionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_treasurywithdrawalsaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.treasurywithdrawalsaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {TreasuryWithdrawalsAction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.treasurywithdrawalsaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TreasuryWithdrawalsAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.treasurywithdrawalsaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {TreasuryWithdrawalsAction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.treasurywithdrawalsaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TreasuryWithdrawalsAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.treasurywithdrawalsaction_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.treasurywithdrawalsaction_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {TreasuryWithdrawalsAction}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.treasurywithdrawalsaction_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return TreasuryWithdrawalsAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TreasuryWithdrawals}
|
|
*/
|
|
withdrawals() {
|
|
const ret = wasm.treasurywithdrawalsaction_withdrawals(this.__wbg_ptr);
|
|
return TreasuryWithdrawals.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {ScriptHash | undefined}
|
|
*/
|
|
policy_hash() {
|
|
const ret = wasm.treasurywithdrawalsaction_policy_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : ScriptHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TreasuryWithdrawals} withdrawals
|
|
* @returns {TreasuryWithdrawalsAction}
|
|
*/
|
|
static new(withdrawals) {
|
|
_assertClass(withdrawals, TreasuryWithdrawals);
|
|
const ret = wasm.treasurywithdrawalsaction_new(withdrawals.__wbg_ptr);
|
|
return TreasuryWithdrawalsAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {TreasuryWithdrawals} withdrawals
|
|
* @param {ScriptHash} policy_hash
|
|
* @returns {TreasuryWithdrawalsAction}
|
|
*/
|
|
static new_with_policy_hash(withdrawals, policy_hash) {
|
|
_assertClass(withdrawals, TreasuryWithdrawals);
|
|
_assertClass(policy_hash, ScriptHash);
|
|
const ret = wasm.treasurywithdrawalsaction_new_with_policy_hash(withdrawals.__wbg_ptr, policy_hash.__wbg_ptr);
|
|
return TreasuryWithdrawalsAction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TreasuryWithdrawalsAction = TreasuryWithdrawalsAction;
|
|
|
|
const TxBuilderConstantsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_txbuilderconstants_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TxBuilderConstants {
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TxBuilderConstantsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_txbuilderconstants_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Costmdls}
|
|
*/
|
|
static plutus_default_cost_models() {
|
|
const ret = wasm.txbuilderconstants_plutus_default_cost_models();
|
|
return Costmdls.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Costmdls}
|
|
*/
|
|
static plutus_alonzo_cost_models() {
|
|
const ret = wasm.txbuilderconstants_plutus_alonzo_cost_models();
|
|
return Costmdls.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Costmdls}
|
|
*/
|
|
static plutus_vasil_cost_models() {
|
|
const ret = wasm.txbuilderconstants_plutus_default_cost_models();
|
|
return Costmdls.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Costmdls}
|
|
*/
|
|
static plutus_conway_cost_models() {
|
|
const ret = wasm.txbuilderconstants_plutus_conway_cost_models();
|
|
return Costmdls.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TxBuilderConstants = TxBuilderConstants;
|
|
|
|
const TxInputsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_txinputsbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class TxInputsBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(TxInputsBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
TxInputsBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
TxInputsBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_txinputsbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {TxInputsBuilder}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.txinputsbuilder_new();
|
|
return TxInputsBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* We have to know what kind of inputs these are to know what kind of mock witnesses to create since
|
|
* 1) mock witnesses have different lengths depending on the type which changes the expecting fee
|
|
* 2) Witnesses are a set so we need to get rid of duplicates to avoid over-estimating the fee
|
|
* @param {Ed25519KeyHash} hash
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_key_input(hash, input, amount) {
|
|
_assertClass(hash, Ed25519KeyHash);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.txinputsbuilder_add_key_input(this.__wbg_ptr, hash.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
}
|
|
/**
|
|
* This method will add the input to the builder and also register the required native script witness
|
|
* @param {NativeScriptSource} script
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_native_script_input(script, input, amount) {
|
|
_assertClass(script, NativeScriptSource);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.txinputsbuilder_add_native_script_input(this.__wbg_ptr, script.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
}
|
|
/**
|
|
* This method will add the input to the builder and also register the required plutus witness
|
|
* @param {PlutusWitness} witness
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_plutus_script_input(witness, input, amount) {
|
|
_assertClass(witness, PlutusWitness);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.txinputsbuilder_add_plutus_script_input(this.__wbg_ptr, witness.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {ByronAddress} address
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_bootstrap_input(address, input, amount) {
|
|
_assertClass(address, ByronAddress);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.txinputsbuilder_add_bootstrap_input(this.__wbg_ptr, address.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
}
|
|
/**
|
|
* Adds non script input, in case of script or reward address input it will return an error
|
|
* @param {Address} address
|
|
* @param {TransactionInput} input
|
|
* @param {Value} amount
|
|
*/
|
|
add_regular_input(address, input, amount) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, Address);
|
|
_assertClass(input, TransactionInput);
|
|
_assertClass(amount, Value);
|
|
wasm.txinputsbuilder_add_regular_input(retptr, this.__wbg_ptr, address.__wbg_ptr, input.__wbg_ptr, amount.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
get_ref_inputs() {
|
|
const ret = wasm.txinputsbuilder_get_ref_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* Returns a copy of the current script input witness scripts in the builder
|
|
* @returns {NativeScripts | undefined}
|
|
*/
|
|
get_native_input_scripts() {
|
|
const ret = wasm.txinputsbuilder_get_native_input_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* Returns a copy of the current plutus input witness scripts in the builder.
|
|
* NOTE: each plutus witness will be cloned with a specific corresponding input index
|
|
* @returns {PlutusWitnesses | undefined}
|
|
*/
|
|
get_plutus_input_scripts() {
|
|
const ret = wasm.txinputsbuilder_get_plutus_input_scripts(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : PlutusWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.txinputsbuilder_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} key
|
|
*/
|
|
add_required_signer(key) {
|
|
_assertClass(key, Ed25519KeyHash);
|
|
wasm.txinputsbuilder_add_required_signer(this.__wbg_ptr, key.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHashes} keys
|
|
*/
|
|
add_required_signers(keys) {
|
|
_assertClass(keys, Ed25519KeyHashes);
|
|
wasm.txinputsbuilder_add_required_signers(this.__wbg_ptr, keys.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {Value}
|
|
*/
|
|
total_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.txinputsbuilder_total_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
inputs() {
|
|
const ret = wasm.txinputsbuilder_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs | undefined}
|
|
*/
|
|
inputs_option() {
|
|
const ret = wasm.txinputsbuilder_inputs_option(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : TransactionInputs.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.TxInputsBuilder = TxInputsBuilder;
|
|
|
|
const URLFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_url_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class URL {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(URL.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
URLFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
URLFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_url_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.url_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {URL}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.url_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return URL.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.url_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {URL}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.url_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return URL.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {URL}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.url_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return URL.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} url
|
|
* @returns {URL}
|
|
*/
|
|
static new(url) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.url_new(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return URL.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
url() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.dnsrecordaoraaaa_record(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
}
|
|
module.exports.URL = URL;
|
|
|
|
const UnitIntervalFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_unitinterval_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class UnitInterval {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(UnitInterval.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
UnitIntervalFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
UnitIntervalFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_unitinterval_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.unitinterval_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {UnitInterval}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.unitinterval_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return UnitInterval.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.unitinterval_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {UnitInterval}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.unitinterval_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return UnitInterval.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.unitinterval_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.unitinterval_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {UnitInterval}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.unitinterval_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return UnitInterval.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
numerator() {
|
|
const ret = wasm.datacost_coins_per_byte(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
denominator() {
|
|
const ret = wasm.unitinterval_denominator(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} numerator
|
|
* @param {BigNum} denominator
|
|
* @returns {UnitInterval}
|
|
*/
|
|
static new(numerator, denominator) {
|
|
_assertClass(numerator, BigNum);
|
|
_assertClass(denominator, BigNum);
|
|
const ret = wasm.unitinterval_new(numerator.__wbg_ptr, denominator.__wbg_ptr);
|
|
return UnitInterval.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.UnitInterval = UnitInterval;
|
|
|
|
const UpdateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_update_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Update {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Update.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
UpdateFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
UpdateFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_update_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.update_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Update}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.update_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Update.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.update_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Update}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.update_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Update.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.update_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.update_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Update}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.update_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Update.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {ProposedProtocolParameterUpdates}
|
|
*/
|
|
proposed_protocol_parameter_updates() {
|
|
const ret = wasm.update_proposed_protocol_parameter_updates(this.__wbg_ptr);
|
|
return ProposedProtocolParameterUpdates.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
epoch() {
|
|
const ret = wasm.update_epoch(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {ProposedProtocolParameterUpdates} proposed_protocol_parameter_updates
|
|
* @param {number} epoch
|
|
* @returns {Update}
|
|
*/
|
|
static new(proposed_protocol_parameter_updates, epoch) {
|
|
_assertClass(proposed_protocol_parameter_updates, ProposedProtocolParameterUpdates);
|
|
const ret = wasm.update_new(proposed_protocol_parameter_updates.__wbg_ptr, epoch);
|
|
return Update.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Update = Update;
|
|
|
|
const UpdateCommitteeActionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_updatecommitteeaction_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class UpdateCommitteeAction {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(UpdateCommitteeAction.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
UpdateCommitteeActionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
UpdateCommitteeActionFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_updatecommitteeaction_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.updatecommitteeaction_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {UpdateCommitteeAction}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.updatecommitteeaction_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return UpdateCommitteeAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.updatecommitteeaction_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {UpdateCommitteeAction}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.updatecommitteeaction_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return UpdateCommitteeAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.updatecommitteeaction_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.updatecommitteeaction_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {UpdateCommitteeAction}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.updatecommitteeaction_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return UpdateCommitteeAction.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GovernanceActionId | undefined}
|
|
*/
|
|
gov_action_id() {
|
|
const ret = wasm.updatecommitteeaction_gov_action_id(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : GovernanceActionId.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Committee}
|
|
*/
|
|
committee() {
|
|
const ret = wasm.updatecommitteeaction_committee(this.__wbg_ptr);
|
|
return Committee.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credentials}
|
|
*/
|
|
members_to_remove() {
|
|
const ret = wasm.updatecommitteeaction_members_to_remove(this.__wbg_ptr);
|
|
return Credentials.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Committee} committee
|
|
* @param {Credentials} members_to_remove
|
|
* @returns {UpdateCommitteeAction}
|
|
*/
|
|
static new(committee, members_to_remove) {
|
|
_assertClass(committee, Committee);
|
|
_assertClass(members_to_remove, Credentials);
|
|
const ret = wasm.updatecommitteeaction_new(committee.__wbg_ptr, members_to_remove.__wbg_ptr);
|
|
return UpdateCommitteeAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @param {Committee} committee
|
|
* @param {Credentials} members_to_remove
|
|
* @returns {UpdateCommitteeAction}
|
|
*/
|
|
static new_with_action_id(gov_action_id, committee, members_to_remove) {
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
_assertClass(committee, Committee);
|
|
_assertClass(members_to_remove, Credentials);
|
|
const ret = wasm.updatecommitteeaction_new_with_action_id(gov_action_id.__wbg_ptr, committee.__wbg_ptr, members_to_remove.__wbg_ptr);
|
|
return UpdateCommitteeAction.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.UpdateCommitteeAction = UpdateCommitteeAction;
|
|
|
|
const VRFCertFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_vrfcert_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VRFCert {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VRFCert.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VRFCertFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VRFCertFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_vrfcert_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vrfcert_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VRFCert}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfcert_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vrfcert_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {VRFCert}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfcert_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vrfcert_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vrfcert_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {VRFCert}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfcert_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
output() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.assetname_name(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
proof() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vrfcert_proof(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} output
|
|
* @param {Uint8Array} proof
|
|
* @returns {VRFCert}
|
|
*/
|
|
static new(output, proof) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(output, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
const ptr1 = passArray8ToWasm0(proof, wasm.__wbindgen_malloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
wasm.vrfcert_new(retptr, ptr0, len0, ptr1, len1);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFCert.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.VRFCert = VRFCert;
|
|
|
|
const VRFKeyHashFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_vrfkeyhash_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VRFKeyHash {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VRFKeyHash.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VRFKeyHashFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VRFKeyHashFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_vrfkeyhash_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VRFKeyHash}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfkeyhash_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFKeyHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {VRFKeyHash}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfkeyhash_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFKeyHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {VRFKeyHash}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfkeyhash_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFKeyHash.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.VRFKeyHash = VRFKeyHash;
|
|
|
|
const VRFVKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_vrfvkey_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VRFVKey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VRFVKey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VRFVKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VRFVKeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_vrfvkey_free(ptr);
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VRFVKey}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfvkey_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFVKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} prefix
|
|
* @returns {string}
|
|
*/
|
|
to_bech32(prefix) {
|
|
let deferred3_0;
|
|
let deferred3_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.anchordatahash_to_bech32(retptr, this.__wbg_ptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr2 = r0;
|
|
var len2 = r1;
|
|
if (r3) {
|
|
ptr2 = 0; len2 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred3_0 = ptr2;
|
|
deferred3_1 = len2;
|
|
return getStringFromWasm0(ptr2, len2);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} bech_str
|
|
* @returns {VRFVKey}
|
|
*/
|
|
static from_bech32(bech_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(bech_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfvkey_from_bech32(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFVKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.anchordatahash_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex
|
|
* @returns {VRFVKey}
|
|
*/
|
|
static from_hex(hex) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vrfvkey_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VRFVKey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
}
|
|
module.exports.VRFVKey = VRFVKey;
|
|
|
|
const ValueFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_value_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Value {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Value.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
ValueFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
ValueFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_value_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.value_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Value}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.value_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.value_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Value}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.value_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.value_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.value_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Value}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.value_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {BigNum} coin
|
|
* @returns {Value}
|
|
*/
|
|
static new(coin) {
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.value_new(coin.__wbg_ptr);
|
|
return Value.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MultiAsset} multiasset
|
|
* @returns {Value}
|
|
*/
|
|
static new_from_assets(multiasset) {
|
|
_assertClass(multiasset, MultiAsset);
|
|
const ret = wasm.value_new_from_assets(multiasset.__wbg_ptr);
|
|
return Value.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} coin
|
|
* @param {MultiAsset} multiasset
|
|
* @returns {Value}
|
|
*/
|
|
static new_with_assets(coin, multiasset) {
|
|
_assertClass(coin, BigNum);
|
|
_assertClass(multiasset, MultiAsset);
|
|
const ret = wasm.value_new_with_assets(coin.__wbg_ptr, multiasset.__wbg_ptr);
|
|
return Value.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Value}
|
|
*/
|
|
static zero() {
|
|
const ret = wasm.value_zero();
|
|
return Value.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
is_zero() {
|
|
const ret = wasm.value_is_zero(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
coin() {
|
|
const ret = wasm.value_coin(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {BigNum} coin
|
|
*/
|
|
set_coin(coin) {
|
|
_assertClass(coin, BigNum);
|
|
wasm.value_set_coin(this.__wbg_ptr, coin.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @returns {MultiAsset | undefined}
|
|
*/
|
|
multiasset() {
|
|
const ret = wasm.value_multiasset(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : MultiAsset.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {MultiAsset} multiasset
|
|
*/
|
|
set_multiasset(multiasset) {
|
|
_assertClass(multiasset, MultiAsset);
|
|
wasm.value_set_multiasset(this.__wbg_ptr, multiasset.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {Value} rhs
|
|
* @returns {Value}
|
|
*/
|
|
checked_add(rhs) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(rhs, Value);
|
|
wasm.value_checked_add(retptr, this.__wbg_ptr, rhs.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Value} rhs_value
|
|
* @returns {Value}
|
|
*/
|
|
checked_sub(rhs_value) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(rhs_value, Value);
|
|
wasm.value_checked_sub(retptr, this.__wbg_ptr, rhs_value.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Value} rhs_value
|
|
* @returns {Value}
|
|
*/
|
|
clamped_sub(rhs_value) {
|
|
_assertClass(rhs_value, Value);
|
|
const ret = wasm.value_clamped_sub(this.__wbg_ptr, rhs_value.__wbg_ptr);
|
|
return Value.__wrap(ret);
|
|
}
|
|
/**
|
|
* note: values are only partially comparable
|
|
* @param {Value} rhs_value
|
|
* @returns {number | undefined}
|
|
*/
|
|
compare(rhs_value) {
|
|
_assertClass(rhs_value, Value);
|
|
const ret = wasm.value_compare(this.__wbg_ptr, rhs_value.__wbg_ptr);
|
|
return ret === 0xFFFFFF ? undefined : ret;
|
|
}
|
|
}
|
|
module.exports.Value = Value;
|
|
|
|
const VersionedBlockFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_versionedblock_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VersionedBlock {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VersionedBlock.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VersionedBlockFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VersionedBlockFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_versionedblock_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.versionedblock_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VersionedBlock}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.versionedblock_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VersionedBlock.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.versionedblock_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {VersionedBlock}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.versionedblock_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VersionedBlock.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.versionedblock_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.versionedblock_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {VersionedBlock}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.versionedblock_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VersionedBlock.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Block} block
|
|
* @param {number} era_code
|
|
* @returns {VersionedBlock}
|
|
*/
|
|
static new(block, era_code) {
|
|
_assertClass(block, Block);
|
|
var ptr0 = block.__destroy_into_raw();
|
|
const ret = wasm.versionedblock_new(ptr0, era_code);
|
|
return VersionedBlock.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Block}
|
|
*/
|
|
block() {
|
|
const ret = wasm.versionedblock_block(this.__wbg_ptr);
|
|
return Block.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BlockEra}
|
|
*/
|
|
era() {
|
|
const ret = wasm.versionedblock_era(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
}
|
|
module.exports.VersionedBlock = VersionedBlock;
|
|
|
|
const VkeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_vkey_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Vkey {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Vkey.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VkeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VkeyFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_vkey_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkey_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Vkey}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkey_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkey_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Vkey}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkey_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkey_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkey_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Vkey}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkey_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkey.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {PublicKey} pk
|
|
* @returns {Vkey}
|
|
*/
|
|
static new(pk) {
|
|
_assertClass(pk, PublicKey);
|
|
const ret = wasm.vkey_new(pk.__wbg_ptr);
|
|
return Vkey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {PublicKey}
|
|
*/
|
|
public_key() {
|
|
const ret = wasm.vkey_public_key(this.__wbg_ptr);
|
|
return PublicKey.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Vkey = Vkey;
|
|
|
|
const VkeysFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_vkeys_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Vkeys {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Vkeys.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VkeysFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VkeysFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_vkeys_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Vkeys}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.vkeys_new();
|
|
return Vkeys.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.vkeys_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Vkey}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.vkeys_get(this.__wbg_ptr, index);
|
|
return Vkey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Vkey} elem
|
|
*/
|
|
add(elem) {
|
|
_assertClass(elem, Vkey);
|
|
wasm.vkeys_add(this.__wbg_ptr, elem.__wbg_ptr);
|
|
}
|
|
}
|
|
module.exports.Vkeys = Vkeys;
|
|
|
|
const VkeywitnessFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_vkeywitness_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Vkeywitness {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Vkeywitness.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VkeywitnessFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VkeywitnessFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_vkeywitness_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkeywitness_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Vkeywitness}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkeywitness_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkeywitness.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkeywitness_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Vkeywitness}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkeywitness_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkeywitness.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkeywitness_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkeywitness_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Vkeywitness}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkeywitness_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkeywitness.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Vkey} vkey
|
|
* @param {Ed25519Signature} signature
|
|
* @returns {Vkeywitness}
|
|
*/
|
|
static new(vkey, signature) {
|
|
_assertClass(vkey, Vkey);
|
|
_assertClass(signature, Ed25519Signature);
|
|
const ret = wasm.vkeywitness_new(vkey.__wbg_ptr, signature.__wbg_ptr);
|
|
return Vkeywitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Vkey}
|
|
*/
|
|
vkey() {
|
|
const ret = wasm.vkeywitness_vkey(this.__wbg_ptr);
|
|
return Vkey.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519Signature}
|
|
*/
|
|
signature() {
|
|
const ret = wasm.vkeywitness_signature(this.__wbg_ptr);
|
|
return Ed25519Signature.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Vkeywitness = Vkeywitness;
|
|
|
|
const VkeywitnessesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_vkeywitnesses_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Vkeywitnesses {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Vkeywitnesses.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VkeywitnessesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VkeywitnessesFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_vkeywitnesses_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkeywitnesses_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Vkeywitnesses}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkeywitnesses_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkeywitnesses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkeywitnesses_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Vkeywitnesses}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkeywitnesses_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkeywitnesses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkeywitnesses_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.vkeywitnesses_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Vkeywitnesses}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.vkeywitnesses_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Vkeywitnesses.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Vkeywitnesses}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.bootstrapwitnesses_new();
|
|
return Vkeywitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.bootstrapwitnesses_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Vkeywitness}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.vkeywitnesses_get(this.__wbg_ptr, index);
|
|
return Vkeywitness.__wrap(ret);
|
|
}
|
|
/**
|
|
* Add a new `Vkeywitness` to the set.
|
|
* Returns `true` if the element was not already present in the set.
|
|
* @param {Vkeywitness} witness
|
|
* @returns {boolean}
|
|
*/
|
|
add(witness) {
|
|
_assertClass(witness, Vkeywitness);
|
|
const ret = wasm.vkeywitnesses_add(this.__wbg_ptr, witness.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.Vkeywitnesses = Vkeywitnesses;
|
|
|
|
const VoteDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_votedelegation_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VoteDelegation {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VoteDelegation.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VoteDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VoteDelegationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_votedelegation_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votedelegation_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VoteDelegation}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votedelegation_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VoteDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votedelegation_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {VoteDelegation}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votedelegation_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VoteDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votedelegation_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votedelegation_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {VoteDelegation}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votedelegation_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VoteDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_credential() {
|
|
const ret = wasm.stakeandvotedelegation_stake_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRep}
|
|
*/
|
|
drep() {
|
|
const ret = wasm.stakeandvotedelegation_drep(this.__wbg_ptr);
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @param {DRep} drep
|
|
* @returns {VoteDelegation}
|
|
*/
|
|
static new(stake_credential, drep) {
|
|
_assertClass(stake_credential, Credential);
|
|
_assertClass(drep, DRep);
|
|
const ret = wasm.votedelegation_new(stake_credential.__wbg_ptr, drep.__wbg_ptr);
|
|
return VoteDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.stakeandvotedelegation_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.VoteDelegation = VoteDelegation;
|
|
|
|
const VoteRegistrationAndDelegationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_voteregistrationanddelegation_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VoteRegistrationAndDelegation {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VoteRegistrationAndDelegation.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VoteRegistrationAndDelegationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VoteRegistrationAndDelegationFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_voteregistrationanddelegation_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voteregistrationanddelegation_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VoteRegistrationAndDelegation}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.voteregistrationanddelegation_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VoteRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voteregistrationanddelegation_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {VoteRegistrationAndDelegation}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.voteregistrationanddelegation_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VoteRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voteregistrationanddelegation_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voteregistrationanddelegation_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {VoteRegistrationAndDelegation}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.voteregistrationanddelegation_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VoteRegistrationAndDelegation.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Credential}
|
|
*/
|
|
stake_credential() {
|
|
const ret = wasm.drepderegistration_voting_credential(this.__wbg_ptr);
|
|
return Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {DRep}
|
|
*/
|
|
drep() {
|
|
const ret = wasm.voteregistrationanddelegation_drep(this.__wbg_ptr);
|
|
return DRep.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
coin() {
|
|
const ret = wasm.drepderegistration_coin(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} stake_credential
|
|
* @param {DRep} drep
|
|
* @param {BigNum} coin
|
|
* @returns {VoteRegistrationAndDelegation}
|
|
*/
|
|
static new(stake_credential, drep, coin) {
|
|
_assertClass(stake_credential, Credential);
|
|
_assertClass(drep, DRep);
|
|
_assertClass(coin, BigNum);
|
|
const ret = wasm.voteregistrationanddelegation_new(stake_credential.__wbg_ptr, drep.__wbg_ptr, coin.__wbg_ptr);
|
|
return VoteRegistrationAndDelegation.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.drepderegistration_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
}
|
|
module.exports.VoteRegistrationAndDelegation = VoteRegistrationAndDelegation;
|
|
|
|
const VoterFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_voter_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Voter {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Voter.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VoterFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VoterFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_voter_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voter_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Voter}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.voter_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Voter.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voter_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Voter}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.voter_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Voter.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voter_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voter_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Voter}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.voter_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Voter.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Credential} cred
|
|
* @returns {Voter}
|
|
*/
|
|
static new_constitutional_committee_hot_credential(cred) {
|
|
_assertClass(cred, Credential);
|
|
const ret = wasm.voter_new_constitutional_committee_hot_credential(cred.__wbg_ptr);
|
|
return Voter.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Credential} cred
|
|
* @returns {Voter}
|
|
*/
|
|
static new_drep_credential(cred) {
|
|
_assertClass(cred, Credential);
|
|
const ret = wasm.voter_new_drep_credential(cred.__wbg_ptr);
|
|
return Voter.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Ed25519KeyHash} key_hash
|
|
* @returns {Voter}
|
|
*/
|
|
static new_stake_pool_key_hash(key_hash) {
|
|
_assertClass(key_hash, Ed25519KeyHash);
|
|
const ret = wasm.voter_new_stake_pool_key_hash(key_hash.__wbg_ptr);
|
|
return Voter.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {VoterKind}
|
|
*/
|
|
kind() {
|
|
const ret = wasm.voter_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {Credential | undefined}
|
|
*/
|
|
to_constitutional_committee_hot_credential() {
|
|
const ret = wasm.voter_to_constitutional_committee_hot_credential(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Credential | undefined}
|
|
*/
|
|
to_drep_credential() {
|
|
const ret = wasm.voter_to_drep_credential(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Credential.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash | undefined}
|
|
*/
|
|
to_stake_pool_key_hash() {
|
|
const ret = wasm.voter_to_stake_pool_key_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_script_credentials() {
|
|
const ret = wasm.voter_has_script_credentials(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {Ed25519KeyHash | undefined}
|
|
*/
|
|
to_key_hash() {
|
|
const ret = wasm.voter_to_key_hash(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Voter = Voter;
|
|
|
|
const VotersFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_voters_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Voters {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Voters.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VotersFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VotersFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_voters_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voters_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.voters_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Voters}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.voters_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Voters.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Voters}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.languages_new();
|
|
return Voters.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Voter} voter
|
|
*/
|
|
add(voter) {
|
|
_assertClass(voter, Voter);
|
|
wasm.voters_add(this.__wbg_ptr, voter.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {Voter | undefined}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.voters_get(this.__wbg_ptr, index);
|
|
return ret === 0 ? undefined : Voter.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.costmdls_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
}
|
|
module.exports.Voters = Voters;
|
|
|
|
const VotingBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_votingbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VotingBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VotingBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VotingBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VotingBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_votingbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {VotingBuilder}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.votingbuilder_new();
|
|
return VotingBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Voter} voter
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @param {VotingProcedure} voting_procedure
|
|
*/
|
|
add(voter, gov_action_id, voting_procedure) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(voter, Voter);
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
_assertClass(voting_procedure, VotingProcedure);
|
|
wasm.votingbuilder_add(retptr, this.__wbg_ptr, voter.__wbg_ptr, gov_action_id.__wbg_ptr, voting_procedure.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Voter} voter
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @param {VotingProcedure} voting_procedure
|
|
* @param {PlutusWitness} witness
|
|
*/
|
|
add_with_plutus_witness(voter, gov_action_id, voting_procedure, witness) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(voter, Voter);
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
_assertClass(voting_procedure, VotingProcedure);
|
|
_assertClass(witness, PlutusWitness);
|
|
wasm.votingbuilder_add_with_plutus_witness(retptr, this.__wbg_ptr, voter.__wbg_ptr, gov_action_id.__wbg_ptr, voting_procedure.__wbg_ptr, witness.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Voter} voter
|
|
* @param {GovernanceActionId} gov_action_id
|
|
* @param {VotingProcedure} voting_procedure
|
|
* @param {NativeScriptSource} native_script_source
|
|
*/
|
|
add_with_native_script(voter, gov_action_id, voting_procedure, native_script_source) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(voter, Voter);
|
|
_assertClass(gov_action_id, GovernanceActionId);
|
|
_assertClass(voting_procedure, VotingProcedure);
|
|
_assertClass(native_script_source, NativeScriptSource);
|
|
wasm.votingbuilder_add_with_native_script(retptr, this.__wbg_ptr, voter.__wbg_ptr, gov_action_id.__wbg_ptr, voting_procedure.__wbg_ptr, native_script_source.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PlutusWitnesses}
|
|
*/
|
|
get_plutus_witnesses() {
|
|
const ret = wasm.votingbuilder_get_plutus_witnesses(this.__wbg_ptr);
|
|
return PlutusWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
get_ref_inputs() {
|
|
const ret = wasm.votingbuilder_get_ref_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NativeScripts}
|
|
*/
|
|
get_native_scripts() {
|
|
const ret = wasm.votingbuilder_get_native_scripts(this.__wbg_ptr);
|
|
return NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_plutus_scripts() {
|
|
const ret = wasm.votingbuilder_has_plutus_scripts(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {VotingProcedures}
|
|
*/
|
|
build() {
|
|
const ret = wasm.votingbuilder_build(this.__wbg_ptr);
|
|
return VotingProcedures.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.VotingBuilder = VotingBuilder;
|
|
|
|
const VotingProcedureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_votingprocedure_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VotingProcedure {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VotingProcedure.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VotingProcedureFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VotingProcedureFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_votingprocedure_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingprocedure_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VotingProcedure}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingprocedure_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProcedure.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingprocedure_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {VotingProcedure}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingprocedure_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProcedure.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingprocedure_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingprocedure_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {VotingProcedure}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingprocedure_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProcedure.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {VoteKind} vote
|
|
* @returns {VotingProcedure}
|
|
*/
|
|
static new(vote) {
|
|
const ret = wasm.votingprocedure_new(vote);
|
|
return VotingProcedure.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {VoteKind} vote
|
|
* @param {Anchor} anchor
|
|
* @returns {VotingProcedure}
|
|
*/
|
|
static new_with_anchor(vote, anchor) {
|
|
_assertClass(anchor, Anchor);
|
|
const ret = wasm.votingprocedure_new_with_anchor(vote, anchor.__wbg_ptr);
|
|
return VotingProcedure.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {VoteKind}
|
|
*/
|
|
vote_kind() {
|
|
const ret = wasm.votingprocedure_vote_kind(this.__wbg_ptr);
|
|
return ret;
|
|
}
|
|
/**
|
|
* @returns {Anchor | undefined}
|
|
*/
|
|
anchor() {
|
|
const ret = wasm.drepupdate_anchor(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : Anchor.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.VotingProcedure = VotingProcedure;
|
|
|
|
const VotingProceduresFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_votingprocedures_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VotingProcedures {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VotingProcedures.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VotingProceduresFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VotingProceduresFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_votingprocedures_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingprocedures_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VotingProcedures}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingprocedures_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProcedures.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingprocedures_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {VotingProcedures}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingprocedures_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProcedures.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingprocedures_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingprocedures_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {VotingProcedures}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingprocedures_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProcedures.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {VotingProcedures}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.votingprocedures_new();
|
|
return VotingProcedures.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Voter} voter
|
|
* @param {GovernanceActionId} governance_action_id
|
|
* @param {VotingProcedure} voting_procedure
|
|
*/
|
|
insert(voter, governance_action_id, voting_procedure) {
|
|
_assertClass(voter, Voter);
|
|
_assertClass(governance_action_id, GovernanceActionId);
|
|
_assertClass(voting_procedure, VotingProcedure);
|
|
wasm.votingprocedures_insert(this.__wbg_ptr, voter.__wbg_ptr, governance_action_id.__wbg_ptr, voting_procedure.__wbg_ptr);
|
|
}
|
|
/**
|
|
* @param {Voter} voter
|
|
* @param {GovernanceActionId} governance_action_id
|
|
* @returns {VotingProcedure | undefined}
|
|
*/
|
|
get(voter, governance_action_id) {
|
|
_assertClass(voter, Voter);
|
|
_assertClass(governance_action_id, GovernanceActionId);
|
|
const ret = wasm.votingprocedures_get(this.__wbg_ptr, voter.__wbg_ptr, governance_action_id.__wbg_ptr);
|
|
return ret === 0 ? undefined : VotingProcedure.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Voters}
|
|
*/
|
|
get_voters() {
|
|
const ret = wasm.votingprocedures_get_voters(this.__wbg_ptr);
|
|
return Voters.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {Voter} voter
|
|
* @returns {GovernanceActionIds}
|
|
*/
|
|
get_governance_action_ids_by_voter(voter) {
|
|
_assertClass(voter, Voter);
|
|
const ret = wasm.votingprocedures_get_governance_action_ids_by_voter(this.__wbg_ptr, voter.__wbg_ptr);
|
|
return GovernanceActionIds.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.VotingProcedures = VotingProcedures;
|
|
|
|
const VotingProposalFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_votingproposal_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VotingProposal {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VotingProposal.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VotingProposalFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VotingProposalFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_votingproposal_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingproposal_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VotingProposal}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingproposal_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProposal.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingproposal_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {VotingProposal}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingproposal_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProposal.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingproposal_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingproposal_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {VotingProposal}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingproposal_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProposal.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {GovernanceAction}
|
|
*/
|
|
governance_action() {
|
|
const ret = wasm.votingproposal_governance_action(this.__wbg_ptr);
|
|
return GovernanceAction.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Anchor}
|
|
*/
|
|
anchor() {
|
|
const ret = wasm.votingproposal_anchor(this.__wbg_ptr);
|
|
return Anchor.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RewardAddress}
|
|
*/
|
|
reward_account() {
|
|
const ret = wasm.votingproposal_reward_account(this.__wbg_ptr);
|
|
return RewardAddress.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {BigNum}
|
|
*/
|
|
deposit() {
|
|
const ret = wasm.votingproposal_deposit(this.__wbg_ptr);
|
|
return BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {GovernanceAction} governance_action
|
|
* @param {Anchor} anchor
|
|
* @param {RewardAddress} reward_account
|
|
* @param {BigNum} deposit
|
|
* @returns {VotingProposal}
|
|
*/
|
|
static new(governance_action, anchor, reward_account, deposit) {
|
|
_assertClass(governance_action, GovernanceAction);
|
|
_assertClass(anchor, Anchor);
|
|
_assertClass(reward_account, RewardAddress);
|
|
_assertClass(deposit, BigNum);
|
|
const ret = wasm.votingproposal_new(governance_action.__wbg_ptr, anchor.__wbg_ptr, reward_account.__wbg_ptr, deposit.__wbg_ptr);
|
|
return VotingProposal.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.VotingProposal = VotingProposal;
|
|
|
|
const VotingProposalBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_votingproposalbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VotingProposalBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VotingProposalBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VotingProposalBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VotingProposalBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_votingproposalbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {VotingProposalBuilder}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.votingbuilder_new();
|
|
return VotingProposalBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {VotingProposal} proposal
|
|
*/
|
|
add(proposal) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(proposal, VotingProposal);
|
|
wasm.votingproposalbuilder_add(retptr, this.__wbg_ptr, proposal.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {VotingProposal} proposal
|
|
* @param {PlutusWitness} witness
|
|
*/
|
|
add_with_plutus_witness(proposal, witness) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(proposal, VotingProposal);
|
|
_assertClass(witness, PlutusWitness);
|
|
wasm.votingproposalbuilder_add_with_plutus_witness(retptr, this.__wbg_ptr, proposal.__wbg_ptr, witness.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PlutusWitnesses}
|
|
*/
|
|
get_plutus_witnesses() {
|
|
const ret = wasm.votingproposalbuilder_get_plutus_witnesses(this.__wbg_ptr);
|
|
return PlutusWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
get_ref_inputs() {
|
|
const ret = wasm.votingproposalbuilder_get_ref_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_plutus_scripts() {
|
|
const ret = wasm.votingproposalbuilder_has_plutus_scripts(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {VotingProposals}
|
|
*/
|
|
build() {
|
|
const ret = wasm.votingproposalbuilder_build(this.__wbg_ptr);
|
|
return VotingProposals.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.VotingProposalBuilder = VotingProposalBuilder;
|
|
|
|
const VotingProposalsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_votingproposals_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class VotingProposals {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(VotingProposals.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
VotingProposalsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
VotingProposalsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_votingproposals_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingproposals_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {VotingProposals}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingproposals_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProposals.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingproposals_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {VotingProposals}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingproposals_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProposals.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingproposals_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.votingproposals_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {VotingProposals}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.votingproposals_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return VotingProposals.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {VotingProposals}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.credentials_new();
|
|
return VotingProposals.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.credentials_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {number} index
|
|
* @returns {VotingProposal}
|
|
*/
|
|
get(index) {
|
|
const ret = wasm.votingproposals_get(this.__wbg_ptr, index);
|
|
return VotingProposal.__wrap(ret);
|
|
}
|
|
/**
|
|
* Add a new `VotingProposal` to the set.
|
|
* Returns `true` if the element was not already present in the set.
|
|
* @param {VotingProposal} proposal
|
|
* @returns {boolean}
|
|
*/
|
|
add(proposal) {
|
|
_assertClass(proposal, VotingProposal);
|
|
const ret = wasm.votingproposals_add(this.__wbg_ptr, proposal.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @param {VotingProposal} elem
|
|
* @returns {boolean}
|
|
*/
|
|
contains(elem) {
|
|
_assertClass(elem, VotingProposal);
|
|
const ret = wasm.votingproposals_contains(this.__wbg_ptr, elem.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {VotingProposals | undefined}
|
|
*/
|
|
to_option() {
|
|
const ret = wasm.votingproposals_to_option(this.__wbg_ptr);
|
|
return ret === 0 ? undefined : VotingProposals.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.VotingProposals = VotingProposals;
|
|
|
|
const WithdrawalsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_withdrawals_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class Withdrawals {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(Withdrawals.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
WithdrawalsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
WithdrawalsFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_withdrawals_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {Uint8Array}
|
|
*/
|
|
to_bytes() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.withdrawals_to_bytes(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
return v1;
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {Uint8Array} bytes
|
|
* @returns {Withdrawals}
|
|
*/
|
|
static from_bytes(bytes) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.withdrawals_from_bytes(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Withdrawals.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_hex() {
|
|
let deferred1_0;
|
|
let deferred1_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.withdrawals_to_hex(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
deferred1_0 = r0;
|
|
deferred1_1 = r1;
|
|
return getStringFromWasm0(r0, r1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} hex_str
|
|
* @returns {Withdrawals}
|
|
*/
|
|
static from_hex(hex_str) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.withdrawals_from_hex(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Withdrawals.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {string}
|
|
*/
|
|
to_json() {
|
|
let deferred2_0;
|
|
let deferred2_1;
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.withdrawals_to_json(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
var ptr1 = r0;
|
|
var len1 = r1;
|
|
if (r3) {
|
|
ptr1 = 0; len1 = 0;
|
|
throw takeObject(r2);
|
|
}
|
|
deferred2_0 = ptr1;
|
|
deferred2_1 = len1;
|
|
return getStringFromWasm0(ptr1, len1);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {any}
|
|
*/
|
|
to_js_value() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.withdrawals_to_js_value(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return takeObject(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {string} json
|
|
* @returns {Withdrawals}
|
|
*/
|
|
static from_json(json) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len0 = WASM_VECTOR_LEN;
|
|
wasm.withdrawals_from_json(retptr, ptr0, len0);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Withdrawals.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {Withdrawals}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.auxiliarydataset_new();
|
|
return Withdrawals.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {number}
|
|
*/
|
|
len() {
|
|
const ret = wasm.auxiliarydataset_len(this.__wbg_ptr);
|
|
return ret >>> 0;
|
|
}
|
|
/**
|
|
* @param {RewardAddress} key
|
|
* @param {BigNum} value
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
insert(key, value) {
|
|
_assertClass(key, RewardAddress);
|
|
_assertClass(value, BigNum);
|
|
const ret = wasm.withdrawals_insert(this.__wbg_ptr, key.__wbg_ptr, value.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {RewardAddress} key
|
|
* @returns {BigNum | undefined}
|
|
*/
|
|
get(key) {
|
|
_assertClass(key, RewardAddress);
|
|
const ret = wasm.withdrawals_get(this.__wbg_ptr, key.__wbg_ptr);
|
|
return ret === 0 ? undefined : BigNum.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {RewardAddresses}
|
|
*/
|
|
keys() {
|
|
const ret = wasm.withdrawals_keys(this.__wbg_ptr);
|
|
return RewardAddresses.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.Withdrawals = Withdrawals;
|
|
|
|
const WithdrawalsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
? { register: () => {}, unregister: () => {} }
|
|
: new FinalizationRegistry(ptr => wasm.__wbg_withdrawalsbuilder_free(ptr >>> 0));
|
|
/**
|
|
*/
|
|
class WithdrawalsBuilder {
|
|
|
|
static __wrap(ptr) {
|
|
ptr = ptr >>> 0;
|
|
const obj = Object.create(WithdrawalsBuilder.prototype);
|
|
obj.__wbg_ptr = ptr;
|
|
WithdrawalsBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
return obj;
|
|
}
|
|
|
|
__destroy_into_raw() {
|
|
const ptr = this.__wbg_ptr;
|
|
this.__wbg_ptr = 0;
|
|
WithdrawalsBuilderFinalization.unregister(this);
|
|
return ptr;
|
|
}
|
|
|
|
free() {
|
|
const ptr = this.__destroy_into_raw();
|
|
wasm.__wbg_withdrawalsbuilder_free(ptr);
|
|
}
|
|
/**
|
|
* @returns {WithdrawalsBuilder}
|
|
*/
|
|
static new() {
|
|
const ret = wasm.certificatesbuilder_new();
|
|
return WithdrawalsBuilder.__wrap(ret);
|
|
}
|
|
/**
|
|
* @param {RewardAddress} address
|
|
* @param {BigNum} coin
|
|
*/
|
|
add(address, coin) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, RewardAddress);
|
|
_assertClass(coin, BigNum);
|
|
wasm.withdrawalsbuilder_add(retptr, this.__wbg_ptr, address.__wbg_ptr, coin.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {RewardAddress} address
|
|
* @param {BigNum} coin
|
|
* @param {PlutusWitness} witness
|
|
*/
|
|
add_with_plutus_witness(address, coin, witness) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, RewardAddress);
|
|
_assertClass(coin, BigNum);
|
|
_assertClass(witness, PlutusWitness);
|
|
wasm.withdrawalsbuilder_add_with_plutus_witness(retptr, this.__wbg_ptr, address.__wbg_ptr, coin.__wbg_ptr, witness.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @param {RewardAddress} address
|
|
* @param {BigNum} coin
|
|
* @param {NativeScriptSource} native_script_source
|
|
*/
|
|
add_with_native_script(address, coin, native_script_source) {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
_assertClass(address, RewardAddress);
|
|
_assertClass(coin, BigNum);
|
|
_assertClass(native_script_source, NativeScriptSource);
|
|
wasm.withdrawalsbuilder_add_with_native_script(retptr, this.__wbg_ptr, address.__wbg_ptr, coin.__wbg_ptr, native_script_source.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
if (r1) {
|
|
throw takeObject(r0);
|
|
}
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {PlutusWitnesses}
|
|
*/
|
|
get_plutus_witnesses() {
|
|
const ret = wasm.withdrawalsbuilder_get_plutus_witnesses(this.__wbg_ptr);
|
|
return PlutusWitnesses.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {TransactionInputs}
|
|
*/
|
|
get_ref_inputs() {
|
|
const ret = wasm.withdrawalsbuilder_get_ref_inputs(this.__wbg_ptr);
|
|
return TransactionInputs.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {NativeScripts}
|
|
*/
|
|
get_native_scripts() {
|
|
const ret = wasm.withdrawalsbuilder_get_native_scripts(this.__wbg_ptr);
|
|
return NativeScripts.__wrap(ret);
|
|
}
|
|
/**
|
|
* @returns {Value}
|
|
*/
|
|
get_total_withdrawals() {
|
|
try {
|
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
wasm.withdrawalsbuilder_get_total_withdrawals(retptr, this.__wbg_ptr);
|
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
if (r2) {
|
|
throw takeObject(r1);
|
|
}
|
|
return Value.__wrap(r0);
|
|
} finally {
|
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
}
|
|
}
|
|
/**
|
|
* @returns {boolean}
|
|
*/
|
|
has_plutus_scripts() {
|
|
const ret = wasm.withdrawalsbuilder_has_plutus_scripts(this.__wbg_ptr);
|
|
return ret !== 0;
|
|
}
|
|
/**
|
|
* @returns {Withdrawals}
|
|
*/
|
|
build() {
|
|
const ret = wasm.withdrawalsbuilder_build(this.__wbg_ptr);
|
|
return Withdrawals.__wrap(ret);
|
|
}
|
|
}
|
|
module.exports.WithdrawalsBuilder = WithdrawalsBuilder;
|
|
|
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
takeObject(arg0);
|
|
};
|
|
|
|
module.exports.__wbindgen_number_new = function(arg0) {
|
|
const ret = arg0;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
const obj = getObject(arg1);
|
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
var len1 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
};
|
|
|
|
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
const ret = getObject(arg0);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_is_object = function(arg0) {
|
|
const val = getObject(arg0);
|
|
const ret = typeof(val) === 'object' && val !== null;
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
|
|
const ret = String(getObject(arg1));
|
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
};
|
|
|
|
module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
|
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
};
|
|
|
|
module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
const ret = getObject(arg0).crypto;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_process_4a72847cc503995b = function(arg0) {
|
|
const ret = getObject(arg0).process;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_versions_f686565e586dd935 = function(arg0) {
|
|
const ret = getObject(arg0).versions;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
|
const ret = getObject(arg0).node;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_is_string = function(arg0) {
|
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
|
const ret = module.require;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
|
const ret = getObject(arg0).msCrypto;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
|
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
|
getObject(arg0).getRandomValues(getObject(arg1));
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_new_16b304a2cfa7ff4a = function() {
|
|
const ret = new Array();
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_is_function = function(arg0) {
|
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_new_d9bc3a0147634640 = function() {
|
|
const ret = new Map();
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_new_72fb9a18b5ae2624 = function() {
|
|
const ret = new Object();
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
|
|
const ret = self.self;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
|
|
const ret = window.window;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
|
|
const ret = globalThis.globalThis;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_global_207b558942527489 = function() { return handleError(function () {
|
|
const ret = global.global;
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
const ret = getObject(arg0) === undefined;
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_set_d4638f722068f043 = function(arg0, arg1, arg2) {
|
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
};
|
|
|
|
module.exports.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
return addHeapObject(ret);
|
|
}, arguments) };
|
|
|
|
module.exports.__wbg_set_8417257aaedc936b = function(arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
const ret = getObject(arg0).buffer;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
const ret = new Uint8Array(getObject(arg0));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
};
|
|
|
|
module.exports.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
|
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_new_d87f272aec784ec0 = function(arg0, arg1) {
|
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_call_eae29933372a39be = function(arg0, arg1) {
|
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
const ret = getObject(arg0) === getObject(arg1);
|
|
return ret;
|
|
};
|
|
|
|
module.exports.__wbg_self_e0b3266d2d9eba1a = function(arg0) {
|
|
const ret = getObject(arg0).self;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_require_0993fe224bf8e202 = function(arg0, arg1) {
|
|
const ret = require(getStringFromWasm0(arg0, arg1));
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_crypto_e95a6e54c5c2e37f = function(arg0) {
|
|
const ret = getObject(arg0).crypto;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_getRandomValues_dc67302a7bd1aec5 = function(arg0) {
|
|
const ret = getObject(arg0).getRandomValues;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
module.exports.__wbg_randomFillSync_dd2297de5917c74e = function(arg0, arg1, arg2) {
|
|
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
};
|
|
|
|
module.exports.__wbg_getRandomValues_02639197c8166a96 = function(arg0, arg1, arg2) {
|
|
getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2));
|
|
};
|
|
|
|
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
const ret = debugString(getObject(arg1));
|
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
const len1 = WASM_VECTOR_LEN;
|
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
};
|
|
|
|
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
};
|
|
|
|
module.exports.__wbindgen_memory = function() {
|
|
const ret = wasm.memory;
|
|
return addHeapObject(ret);
|
|
};
|
|
|
|
const path = require('path').join(__dirname, 'cardano_serialization_lib_bg.wasm');
|
|
const bytes = require('fs').readFileSync(path);
|
|
|
|
const wasmModule = new WebAssembly.Module(bytes);
|
|
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
wasm = wasmInstance.exports;
|
|
module.exports.__wasm = wasm;
|
|
|