diff --git a/dist/.npmignore b/dist/.npmignore
new file mode 100644
index 00000000..d54ff4ec
--- /dev/null
+++ b/dist/.npmignore
@@ -0,0 +1,4 @@
+src/
+test_runner.js
+yarn.lock
+pnpm-lock.yaml
diff --git a/dist/LICENSE b/dist/LICENSE
new file mode 100644
index 00000000..ed8b5346
--- /dev/null
+++ b/dist/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Alessandro Konrad
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/dist/README.md b/dist/README.md
new file mode 100644
index 00000000..260c4c84
--- /dev/null
+++ b/dist/README.md
@@ -0,0 +1,157 @@
+
+
+
Lucid
+ Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+### Get started
+
+#### NPM
+
+```
+npm install lucid-cardano
+```
+
+#### Deno 🦕
+
+For JavaScript and TypeScript
+
+```js
+import { Lucid } from "https://deno.land/x/lucid@0.10.10/mod.ts";
+```
+
+#### Web
+
+```html
+
+```
+
+###
+
+### Build from source
+
+Build NPM and Web target
+
+```
+deno task build
+```
+
+Outputs a `dist` folder
+
+### Examples
+
+- [Basic examples](./src/examples/)
+- [Next.js Blockfrost Proxy API Example](https://github.com/GGAlanSmithee/cardano-lucid-blockfrost-proxy-example)
+
+### Basic usage
+
+```js
+// import { Blockfrost, Lucid } from "https://deno.land/x/lucid@0.10.10/mod.ts"; Deno
+import { Blockfrost, Lucid } from "lucid-cardano"; // NPM
+
+const lucid = await Lucid.new(
+ new Blockfrost("https://cardano-preview.blockfrost.io/api/v0", ""),
+ "Preview",
+);
+
+// Assumes you are in a browser environment
+const api = await window.cardano.nami.enable();
+lucid.selectWallet(api);
+
+const tx = await lucid.newTx()
+ .payToAddress("addr...", { lovelace: 5000000n })
+ .complete();
+
+const signedTx = await tx.sign().complete();
+
+const txHash = await signedTx.submit();
+
+console.log(txHash);
+```
+
+### Test
+
+```
+deno task test
+```
+
+### Build Core
+
+This library is built on top of a customized version of the serialization-lib
+(cardano-multiplatform-lib) and on top of the message-signing library, which are
+written in Rust.
+
+```
+deno task build:core
+```
+
+### Test Core
+
+```
+deno task test:core
+```
+
+### Docs
+
+[View docs](https://doc.deno.land/https://deno.land/x/lucid/mod.ts) 📖
+
+You can generate documentation with:
+
+```
+deno doc
+```
+
+### Compatibility
+
+Lucid is an ES Module, so to run it in the browser any bundler which allows for
+top level await and WebAssembly is recommended. If you use Webpack 5 enable in
+the `webpack.config.js`:
+
+```
+experiments: {
+ asyncWebAssembly: true,
+ topLevelAwait: true,
+ layers: true // optional, with some bundlers/frameworks it doesn't work without
+ }
+```
+
+To run the library in Node.js you need to set `{"type" : "module"}` in your
+project's `package.json`. Otherwise you will get import issues.
+
+### Contributing
+
+Contributions and PRs are welcome!\
+The [contribution instructions](./CONTRIBUTING.md).
+
+Join us on [Discord](https://discord.gg/82MWs63Tdm)!
+
+### Use Lucid with React
+
+[use-cardano](https://use-cardano.alangaming.com/) a React context, hook and set
+of components built on top of Lucid.
+
+### Use Lucid with Next.js
+
+[Cardano Starter Kit](https://cardano-starter-kit.alangaming.com/) a Next.js
+starter kit for building Cardano dApps.
diff --git a/dist/esm/_dnt.polyfills.d.ts b/dist/esm/_dnt.polyfills.d.ts
new file mode 100644
index 00000000..9a171b1b
--- /dev/null
+++ b/dist/esm/_dnt.polyfills.d.ts
@@ -0,0 +1,11 @@
+declare global {
+ interface Object {
+ /**
+ * Determines whether an object has a property with the specified name.
+ * @param o An object.
+ * @param v A property name.
+ */
+ hasOwn(o: object, v: PropertyKey): boolean;
+ }
+}
+export {};
diff --git a/dist/esm/_dnt.polyfills.js b/dist/esm/_dnt.polyfills.js
new file mode 100644
index 00000000..8df970a0
--- /dev/null
+++ b/dist/esm/_dnt.polyfills.js
@@ -0,0 +1,15 @@
+// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
+if (!Object.hasOwn) {
+ Object.defineProperty(Object, "hasOwn", {
+ value: function (object, property) {
+ if (object == null) {
+ throw new TypeError("Cannot convert undefined or null to object");
+ }
+ return Object.prototype.hasOwnProperty.call(Object(object), property);
+ },
+ configurable: true,
+ enumerable: false,
+ writable: true,
+ });
+}
+export {};
diff --git a/dist/esm/deps/deno.land/std@0.100.0/encoding/hex.d.ts b/dist/esm/deps/deno.land/std@0.100.0/encoding/hex.d.ts
new file mode 100644
index 00000000..a5140ff1
--- /dev/null
+++ b/dist/esm/deps/deno.land/std@0.100.0/encoding/hex.d.ts
@@ -0,0 +1,44 @@
+/**
+ * ErrInvalidByte takes an invalid byte and returns an Error.
+ * @param byte
+ */
+export declare function errInvalidByte(byte: number): Error;
+/** ErrLength returns an error about odd string length. */
+export declare function errLength(): Error;
+/**
+ * EncodedLen returns the length of an encoding of n source bytes. Specifically,
+ * it returns n * 2.
+ * @param n
+ */
+export declare function encodedLen(n: number): number;
+/**
+ * Encode encodes `src` into `encodedLen(src.length)` bytes.
+ * @param src
+ */
+export declare function encode(src: Uint8Array): Uint8Array;
+/**
+ * EncodeToString returns the hexadecimal encoding of `src`.
+ * @param src
+ */
+export declare function encodeToString(src: Uint8Array): string;
+/**
+ * Decode decodes `src` into `decodedLen(src.length)` bytes
+ * If the input is malformed an error will be thrown
+ * the error.
+ * @param src
+ */
+export declare function decode(src: Uint8Array): Uint8Array;
+/**
+ * DecodedLen returns the length of decoding `x` source bytes.
+ * Specifically, it returns `x / 2`.
+ * @param x
+ */
+export declare function decodedLen(x: number): number;
+/**
+ * DecodeString returns the bytes represented by the hexadecimal string `s`.
+ * DecodeString expects that src contains only hexadecimal characters and that
+ * src has even length.
+ * If the input is malformed, DecodeString will throw an error.
+ * @param s the `string` to decode to `Uint8Array`
+ */
+export declare function decodeString(s: string): Uint8Array;
diff --git a/dist/esm/deps/deno.land/std@0.100.0/encoding/hex.js b/dist/esm/deps/deno.land/std@0.100.0/encoding/hex.js
new file mode 100644
index 00000000..fdc0137d
--- /dev/null
+++ b/dist/esm/deps/deno.land/std@0.100.0/encoding/hex.js
@@ -0,0 +1,99 @@
+// Ported from Go
+// https://github.com/golang/go/blob/go1.12.5/src/encoding/hex/hex.go
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+const hexTable = new TextEncoder().encode("0123456789abcdef");
+/**
+ * ErrInvalidByte takes an invalid byte and returns an Error.
+ * @param byte
+ */
+export function errInvalidByte(byte) {
+ return new Error("encoding/hex: invalid byte: " +
+ new TextDecoder().decode(new Uint8Array([byte])));
+}
+/** ErrLength returns an error about odd string length. */
+export function errLength() {
+ return new Error("encoding/hex: odd length hex string");
+}
+// fromHexChar converts a hex character into its value.
+function fromHexChar(byte) {
+ // '0' <= byte && byte <= '9'
+ if (48 <= byte && byte <= 57)
+ return byte - 48;
+ // 'a' <= byte && byte <= 'f'
+ if (97 <= byte && byte <= 102)
+ return byte - 97 + 10;
+ // 'A' <= byte && byte <= 'F'
+ if (65 <= byte && byte <= 70)
+ return byte - 65 + 10;
+ throw errInvalidByte(byte);
+}
+/**
+ * EncodedLen returns the length of an encoding of n source bytes. Specifically,
+ * it returns n * 2.
+ * @param n
+ */
+export function encodedLen(n) {
+ return n * 2;
+}
+/**
+ * Encode encodes `src` into `encodedLen(src.length)` bytes.
+ * @param src
+ */
+export function encode(src) {
+ const dst = new Uint8Array(encodedLen(src.length));
+ for (let i = 0; i < dst.length; i++) {
+ const v = src[i];
+ dst[i * 2] = hexTable[v >> 4];
+ dst[i * 2 + 1] = hexTable[v & 0x0f];
+ }
+ return dst;
+}
+/**
+ * EncodeToString returns the hexadecimal encoding of `src`.
+ * @param src
+ */
+export function encodeToString(src) {
+ return new TextDecoder().decode(encode(src));
+}
+/**
+ * Decode decodes `src` into `decodedLen(src.length)` bytes
+ * If the input is malformed an error will be thrown
+ * the error.
+ * @param src
+ */
+export function decode(src) {
+ const dst = new Uint8Array(decodedLen(src.length));
+ for (let i = 0; i < dst.length; i++) {
+ const a = fromHexChar(src[i * 2]);
+ const b = fromHexChar(src[i * 2 + 1]);
+ dst[i] = (a << 4) | b;
+ }
+ if (src.length % 2 == 1) {
+ // Check for invalid char before reporting bad length,
+ // since the invalid char (if present) is an earlier problem.
+ fromHexChar(src[dst.length * 2]);
+ throw errLength();
+ }
+ return dst;
+}
+/**
+ * DecodedLen returns the length of decoding `x` source bytes.
+ * Specifically, it returns `x / 2`.
+ * @param x
+ */
+export function decodedLen(x) {
+ return x >>> 1;
+}
+/**
+ * DecodeString returns the bytes represented by the hexadecimal string `s`.
+ * DecodeString expects that src contains only hexadecimal characters and that
+ * src has even length.
+ * If the input is malformed, DecodeString will throw an error.
+ * @param s the `string` to decode to `Uint8Array`
+ */
+export function decodeString(s) {
+ return decode(new TextEncoder().encode(s));
+}
diff --git a/dist/esm/deps/deno.land/std@0.148.0/bytes/equals.d.ts b/dist/esm/deps/deno.land/std@0.148.0/bytes/equals.d.ts
new file mode 100644
index 00000000..f1132d28
--- /dev/null
+++ b/dist/esm/deps/deno.land/std@0.148.0/bytes/equals.d.ts
@@ -0,0 +1,17 @@
+/** Check whether binary arrays are equal to each other using 8-bit comparisons.
+ * @private
+ * @param a first array to check equality
+ * @param b second array to check equality
+ */
+export declare function equalsNaive(a: Uint8Array, b: Uint8Array): boolean;
+/** Check whether binary arrays are equal to each other using 32-bit comparisons.
+ * @private
+ * @param a first array to check equality
+ * @param b second array to check equality
+ */
+export declare function equals32Bit(a: Uint8Array, b: Uint8Array): boolean;
+/** Check whether binary arrays are equal to each other.
+ * @param a first array to check equality
+ * @param b second array to check equality
+ */
+export declare function equals(a: Uint8Array, b: Uint8Array): boolean;
diff --git a/dist/esm/deps/deno.land/std@0.148.0/bytes/equals.js b/dist/esm/deps/deno.land/std@0.148.0/bytes/equals.js
new file mode 100644
index 00000000..78849358
--- /dev/null
+++ b/dist/esm/deps/deno.land/std@0.148.0/bytes/equals.js
@@ -0,0 +1,47 @@
+// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+// This module is browser compatible.
+/** Check whether binary arrays are equal to each other using 8-bit comparisons.
+ * @private
+ * @param a first array to check equality
+ * @param b second array to check equality
+ */
+export function equalsNaive(a, b) {
+ if (a.length !== b.length)
+ return false;
+ for (let i = 0; i < b.length; i++) {
+ if (a[i] !== b[i])
+ return false;
+ }
+ return true;
+}
+/** Check whether binary arrays are equal to each other using 32-bit comparisons.
+ * @private
+ * @param a first array to check equality
+ * @param b second array to check equality
+ */
+export function equals32Bit(a, b) {
+ if (a.length !== b.length)
+ return false;
+ const len = a.length;
+ const compressable = Math.floor(len / 4);
+ const compressedA = new Uint32Array(a.buffer, 0, compressable);
+ const compressedB = new Uint32Array(b.buffer, 0, compressable);
+ for (let i = compressable * 4; i < len; i++) {
+ if (a[i] !== b[i])
+ return false;
+ }
+ for (let i = 0; i < compressedA.length; i++) {
+ if (compressedA[i] !== compressedB[i])
+ return false;
+ }
+ return true;
+}
+/** Check whether binary arrays are equal to each other.
+ * @param a first array to check equality
+ * @param b second array to check equality
+ */
+export function equals(a, b) {
+ if (a.length < 1000)
+ return equalsNaive(a, b);
+ return equals32Bit(a, b);
+}
diff --git a/dist/esm/deps/deno.land/std@0.148.0/bytes/mod.d.ts b/dist/esm/deps/deno.land/std@0.148.0/bytes/mod.d.ts
new file mode 100644
index 00000000..85434da7
--- /dev/null
+++ b/dist/esm/deps/deno.land/std@0.148.0/bytes/mod.d.ts
@@ -0,0 +1,133 @@
+/**
+ * Provides helper functions to manipulate `Uint8Array` byte slices that are not
+ * included on the `Uint8Array` prototype.
+ *
+ * @module
+ */
+/** Returns the index of the first occurrence of the needle array in the source
+ * array, or -1 if it is not present.
+ *
+ * A start index can be specified as the third argument that begins the search
+ * at that given index. The start index defaults to the start of the array.
+ *
+ * The complexity of this function is O(source.lenth * needle.length).
+ *
+ * ```ts
+ * import { indexOfNeedle } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const needle = new Uint8Array([1, 2]);
+ * console.log(indexOfNeedle(source, needle)); // 1
+ * console.log(indexOfNeedle(source, needle, 2)); // 3
+ * ```
+ */
+export declare function indexOfNeedle(source: Uint8Array, needle: Uint8Array, start?: number): number;
+/** Returns the index of the last occurrence of the needle array in the source
+ * array, or -1 if it is not present.
+ *
+ * A start index can be specified as the third argument that begins the search
+ * at that given index. The start index defaults to the end of the array.
+ *
+ * The complexity of this function is O(source.lenth * needle.length).
+ *
+ * ```ts
+ * import { lastIndexOfNeedle } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const needle = new Uint8Array([1, 2]);
+ * console.log(lastIndexOfNeedle(source, needle)); // 5
+ * console.log(lastIndexOfNeedle(source, needle, 4)); // 3
+ * ```
+ */
+export declare function lastIndexOfNeedle(source: Uint8Array, needle: Uint8Array, start?: number): number;
+/** Returns true if the prefix array appears at the start of the source array,
+ * false otherwise.
+ *
+ * The complexity of this function is O(prefix.length).
+ *
+ * ```ts
+ * import { startsWith } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const prefix = new Uint8Array([0, 1, 2]);
+ * console.log(startsWith(source, prefix)); // true
+ * ```
+ */
+export declare function startsWith(source: Uint8Array, prefix: Uint8Array): boolean;
+/** Returns true if the suffix array appears at the end of the source array,
+ * false otherwise.
+ *
+ * The complexity of this function is O(suffix.length).
+ *
+ * ```ts
+ * import { endsWith } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const suffix = new Uint8Array([1, 2, 3]);
+ * console.log(endsWith(source, suffix)); // true
+ * ```
+ */
+export declare function endsWith(source: Uint8Array, suffix: Uint8Array): boolean;
+/** Returns a new Uint8Array composed of `count` repetitions of the `source`
+ * array.
+ *
+ * If `count` is negative, a `RangeError` is thrown.
+ *
+ * ```ts
+ * import { repeat } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2]);
+ * console.log(repeat(source, 3)); // [0, 1, 2, 0, 1, 2, 0, 1, 2]
+ * console.log(repeat(source, 0)); // []
+ * console.log(repeat(source, -1)); // RangeError
+ * ```
+ */
+export declare function repeat(source: Uint8Array, count: number): Uint8Array;
+/** Concatenate the given arrays into a new Uint8Array.
+ *
+ * ```ts
+ * import { concat } from "./mod.ts";
+ * const a = new Uint8Array([0, 1, 2]);
+ * const b = new Uint8Array([3, 4, 5]);
+ * console.log(concat(a, b)); // [0, 1, 2, 3, 4, 5]
+ */
+export declare function concat(...buf: Uint8Array[]): Uint8Array;
+/** Returns true if the source array contains the needle array, false otherwise.
+ *
+ * A start index can be specified as the third argument that begins the search
+ * at that given index. The start index defaults to the beginning of the array.
+ *
+ * The complexity of this function is O(source.length * needle.length).
+ *
+ * ```ts
+ * import { includesNeedle } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const needle = new Uint8Array([1, 2]);
+ * console.log(includesNeedle(source, needle)); // true
+ * console.log(includesNeedle(source, needle, 6)); // false
+ * ```
+ */
+export declare function includesNeedle(source: Uint8Array, needle: Uint8Array, start?: number): boolean;
+/** Copy bytes from the `src` array to the `dst` array. Returns the number of
+ * bytes copied.
+ *
+ * If the `src` array is larger than what the `dst` array can hold, only the
+ * amount of bytes that fit in the `dst` array are copied.
+ *
+ * An offset can be specified as the third argument that begins the copy at
+ * that given index in the `dst` array. The offset defaults to the beginning of
+ * the array.
+ *
+ * ```ts
+ * import { copy } from "./mod.ts";
+ * const src = new Uint8Array([9, 8, 7]);
+ * const dst = new Uint8Array([0, 1, 2, 3, 4, 5]);
+ * console.log(copy(src, dst)); // 3
+ * console.log(dst); // [9, 8, 7, 3, 4, 5]
+ * ```
+ *
+ * ```ts
+ * import { copy } from "./mod.ts";
+ * const src = new Uint8Array([1, 1, 1, 1]);
+ * const dst = new Uint8Array([0, 0, 0, 0]);
+ * console.log(copy(src, dst, 1)); // 3
+ * console.log(dst); // [0, 1, 1, 1]
+ * ```
+ */
+export declare function copy(src: Uint8Array, dst: Uint8Array, off?: number): number;
+export { equals } from "./equals.js";
diff --git a/dist/esm/deps/deno.land/std@0.148.0/bytes/mod.js b/dist/esm/deps/deno.land/std@0.148.0/bytes/mod.js
new file mode 100644
index 00000000..d56e6fb4
--- /dev/null
+++ b/dist/esm/deps/deno.land/std@0.148.0/bytes/mod.js
@@ -0,0 +1,241 @@
+// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+// This module is browser compatible.
+/**
+ * Provides helper functions to manipulate `Uint8Array` byte slices that are not
+ * included on the `Uint8Array` prototype.
+ *
+ * @module
+ */
+/** Returns the index of the first occurrence of the needle array in the source
+ * array, or -1 if it is not present.
+ *
+ * A start index can be specified as the third argument that begins the search
+ * at that given index. The start index defaults to the start of the array.
+ *
+ * The complexity of this function is O(source.lenth * needle.length).
+ *
+ * ```ts
+ * import { indexOfNeedle } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const needle = new Uint8Array([1, 2]);
+ * console.log(indexOfNeedle(source, needle)); // 1
+ * console.log(indexOfNeedle(source, needle, 2)); // 3
+ * ```
+ */
+export function indexOfNeedle(source, needle, start = 0) {
+ if (start >= source.length) {
+ return -1;
+ }
+ if (start < 0) {
+ start = Math.max(0, source.length + start);
+ }
+ const s = needle[0];
+ for (let i = start; i < source.length; i++) {
+ if (source[i] !== s)
+ continue;
+ const pin = i;
+ let matched = 1;
+ let j = i;
+ while (matched < needle.length) {
+ j++;
+ if (source[j] !== needle[j - pin]) {
+ break;
+ }
+ matched++;
+ }
+ if (matched === needle.length) {
+ return pin;
+ }
+ }
+ return -1;
+}
+/** Returns the index of the last occurrence of the needle array in the source
+ * array, or -1 if it is not present.
+ *
+ * A start index can be specified as the third argument that begins the search
+ * at that given index. The start index defaults to the end of the array.
+ *
+ * The complexity of this function is O(source.lenth * needle.length).
+ *
+ * ```ts
+ * import { lastIndexOfNeedle } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const needle = new Uint8Array([1, 2]);
+ * console.log(lastIndexOfNeedle(source, needle)); // 5
+ * console.log(lastIndexOfNeedle(source, needle, 4)); // 3
+ * ```
+ */
+export function lastIndexOfNeedle(source, needle, start = source.length - 1) {
+ if (start < 0) {
+ return -1;
+ }
+ if (start >= source.length) {
+ start = source.length - 1;
+ }
+ const e = needle[needle.length - 1];
+ for (let i = start; i >= 0; i--) {
+ if (source[i] !== e)
+ continue;
+ const pin = i;
+ let matched = 1;
+ let j = i;
+ while (matched < needle.length) {
+ j--;
+ if (source[j] !== needle[needle.length - 1 - (pin - j)]) {
+ break;
+ }
+ matched++;
+ }
+ if (matched === needle.length) {
+ return pin - needle.length + 1;
+ }
+ }
+ return -1;
+}
+/** Returns true if the prefix array appears at the start of the source array,
+ * false otherwise.
+ *
+ * The complexity of this function is O(prefix.length).
+ *
+ * ```ts
+ * import { startsWith } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const prefix = new Uint8Array([0, 1, 2]);
+ * console.log(startsWith(source, prefix)); // true
+ * ```
+ */
+export function startsWith(source, prefix) {
+ for (let i = 0, max = prefix.length; i < max; i++) {
+ if (source[i] !== prefix[i])
+ return false;
+ }
+ return true;
+}
+/** Returns true if the suffix array appears at the end of the source array,
+ * false otherwise.
+ *
+ * The complexity of this function is O(suffix.length).
+ *
+ * ```ts
+ * import { endsWith } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const suffix = new Uint8Array([1, 2, 3]);
+ * console.log(endsWith(source, suffix)); // true
+ * ```
+ */
+export function endsWith(source, suffix) {
+ for (let srci = source.length - 1, sfxi = suffix.length - 1; sfxi >= 0; srci--, sfxi--) {
+ if (source[srci] !== suffix[sfxi])
+ return false;
+ }
+ return true;
+}
+/** Returns a new Uint8Array composed of `count` repetitions of the `source`
+ * array.
+ *
+ * If `count` is negative, a `RangeError` is thrown.
+ *
+ * ```ts
+ * import { repeat } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2]);
+ * console.log(repeat(source, 3)); // [0, 1, 2, 0, 1, 2, 0, 1, 2]
+ * console.log(repeat(source, 0)); // []
+ * console.log(repeat(source, -1)); // RangeError
+ * ```
+ */
+export function repeat(source, count) {
+ if (count === 0) {
+ return new Uint8Array();
+ }
+ if (count < 0) {
+ throw new RangeError("bytes: negative repeat count");
+ }
+ else if ((source.length * count) / count !== source.length) {
+ throw new Error("bytes: repeat count causes overflow");
+ }
+ const int = Math.floor(count);
+ if (int !== count) {
+ throw new Error("bytes: repeat count must be an integer");
+ }
+ const nb = new Uint8Array(source.length * count);
+ let bp = copy(source, nb);
+ for (; bp < nb.length; bp *= 2) {
+ copy(nb.slice(0, bp), nb, bp);
+ }
+ return nb;
+}
+/** Concatenate the given arrays into a new Uint8Array.
+ *
+ * ```ts
+ * import { concat } from "./mod.ts";
+ * const a = new Uint8Array([0, 1, 2]);
+ * const b = new Uint8Array([3, 4, 5]);
+ * console.log(concat(a, b)); // [0, 1, 2, 3, 4, 5]
+ */
+export function concat(...buf) {
+ let length = 0;
+ for (const b of buf) {
+ length += b.length;
+ }
+ const output = new Uint8Array(length);
+ let index = 0;
+ for (const b of buf) {
+ output.set(b, index);
+ index += b.length;
+ }
+ return output;
+}
+/** Returns true if the source array contains the needle array, false otherwise.
+ *
+ * A start index can be specified as the third argument that begins the search
+ * at that given index. The start index defaults to the beginning of the array.
+ *
+ * The complexity of this function is O(source.length * needle.length).
+ *
+ * ```ts
+ * import { includesNeedle } from "./mod.ts";
+ * const source = new Uint8Array([0, 1, 2, 1, 2, 1, 2, 3]);
+ * const needle = new Uint8Array([1, 2]);
+ * console.log(includesNeedle(source, needle)); // true
+ * console.log(includesNeedle(source, needle, 6)); // false
+ * ```
+ */
+export function includesNeedle(source, needle, start = 0) {
+ return indexOfNeedle(source, needle, start) !== -1;
+}
+/** Copy bytes from the `src` array to the `dst` array. Returns the number of
+ * bytes copied.
+ *
+ * If the `src` array is larger than what the `dst` array can hold, only the
+ * amount of bytes that fit in the `dst` array are copied.
+ *
+ * An offset can be specified as the third argument that begins the copy at
+ * that given index in the `dst` array. The offset defaults to the beginning of
+ * the array.
+ *
+ * ```ts
+ * import { copy } from "./mod.ts";
+ * const src = new Uint8Array([9, 8, 7]);
+ * const dst = new Uint8Array([0, 1, 2, 3, 4, 5]);
+ * console.log(copy(src, dst)); // 3
+ * console.log(dst); // [9, 8, 7, 3, 4, 5]
+ * ```
+ *
+ * ```ts
+ * import { copy } from "./mod.ts";
+ * const src = new Uint8Array([1, 1, 1, 1]);
+ * const dst = new Uint8Array([0, 0, 0, 0]);
+ * console.log(copy(src, dst, 1)); // 3
+ * console.log(dst); // [0, 1, 1, 1]
+ * ```
+ */
+export function copy(src, dst, off = 0) {
+ off = Math.max(0, Math.min(off, dst.byteLength));
+ const dstBytesAvailable = dst.byteLength - off;
+ if (src.byteLength > dstBytesAvailable) {
+ src = src.subarray(0, dstBytesAvailable);
+ }
+ dst.set(src, off);
+ return src.byteLength;
+}
+export { equals } from "./equals.js";
diff --git a/dist/esm/deps/deno.land/std@0.153.0/hash/sha256.d.ts b/dist/esm/deps/deno.land/std@0.153.0/hash/sha256.d.ts
new file mode 100644
index 00000000..701bce78
--- /dev/null
+++ b/dist/esm/deps/deno.land/std@0.153.0/hash/sha256.d.ts
@@ -0,0 +1,28 @@
+export type Message = string | number[] | ArrayBuffer;
+export declare class Sha256 {
+ #private;
+ constructor(is224?: boolean, sharedMemory?: boolean);
+ protected init(is224: boolean, sharedMemory: boolean): void;
+ /** Update hash
+ *
+ * @param message The message you want to hash.
+ */
+ update(message: Message): this;
+ protected finalize(): void;
+ protected hash(): void;
+ /** Return hash in hex string. */
+ hex(): string;
+ /** Return hash in hex string. */
+ toString(): string;
+ /** Return hash in integer array. */
+ digest(): number[];
+ /** Return hash in integer array. */
+ array(): number[];
+ /** Return hash in ArrayBuffer. */
+ arrayBuffer(): ArrayBuffer;
+}
+export declare class HmacSha256 extends Sha256 {
+ #private;
+ constructor(secretKey: Message, is224?: boolean, sharedMemory?: boolean);
+ protected finalize(): void;
+}
diff --git a/dist/esm/deps/deno.land/std@0.153.0/hash/sha256.js b/dist/esm/deps/deno.land/std@0.153.0/hash/sha256.js
new file mode 100644
index 00000000..80ea6d41
--- /dev/null
+++ b/dist/esm/deps/deno.land/std@0.153.0/hash/sha256.js
@@ -0,0 +1,619 @@
+// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+// This module is browser compatible.
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _Sha256_block, _Sha256_blocks, _Sha256_bytes, _Sha256_finalized, _Sha256_first, _Sha256_h0, _Sha256_h1, _Sha256_h2, _Sha256_h3, _Sha256_h4, _Sha256_h5, _Sha256_h6, _Sha256_h7, _Sha256_hashed, _Sha256_hBytes, _Sha256_is224, _Sha256_lastByteIndex, _Sha256_start, _HmacSha256_inner, _HmacSha256_is224, _HmacSha256_oKeyPad, _HmacSha256_sharedMemory;
+const HEX_CHARS = "0123456789abcdef".split("");
+const EXTRA = [-2147483648, 8388608, 32768, 128];
+const SHIFT = [24, 16, 8, 0];
+const K = [
+ 0x428a2f98,
+ 0x71374491,
+ 0xb5c0fbcf,
+ 0xe9b5dba5,
+ 0x3956c25b,
+ 0x59f111f1,
+ 0x923f82a4,
+ 0xab1c5ed5,
+ 0xd807aa98,
+ 0x12835b01,
+ 0x243185be,
+ 0x550c7dc3,
+ 0x72be5d74,
+ 0x80deb1fe,
+ 0x9bdc06a7,
+ 0xc19bf174,
+ 0xe49b69c1,
+ 0xefbe4786,
+ 0x0fc19dc6,
+ 0x240ca1cc,
+ 0x2de92c6f,
+ 0x4a7484aa,
+ 0x5cb0a9dc,
+ 0x76f988da,
+ 0x983e5152,
+ 0xa831c66d,
+ 0xb00327c8,
+ 0xbf597fc7,
+ 0xc6e00bf3,
+ 0xd5a79147,
+ 0x06ca6351,
+ 0x14292967,
+ 0x27b70a85,
+ 0x2e1b2138,
+ 0x4d2c6dfc,
+ 0x53380d13,
+ 0x650a7354,
+ 0x766a0abb,
+ 0x81c2c92e,
+ 0x92722c85,
+ 0xa2bfe8a1,
+ 0xa81a664b,
+ 0xc24b8b70,
+ 0xc76c51a3,
+ 0xd192e819,
+ 0xd6990624,
+ 0xf40e3585,
+ 0x106aa070,
+ 0x19a4c116,
+ 0x1e376c08,
+ 0x2748774c,
+ 0x34b0bcb5,
+ 0x391c0cb3,
+ 0x4ed8aa4a,
+ 0x5b9cca4f,
+ 0x682e6ff3,
+ 0x748f82ee,
+ 0x78a5636f,
+ 0x84c87814,
+ 0x8cc70208,
+ 0x90befffa,
+ 0xa4506ceb,
+ 0xbef9a3f7,
+ 0xc67178f2,
+];
+const blocks = [];
+export class Sha256 {
+ constructor(is224 = false, sharedMemory = false) {
+ _Sha256_block.set(this, void 0);
+ _Sha256_blocks.set(this, void 0);
+ _Sha256_bytes.set(this, void 0);
+ _Sha256_finalized.set(this, void 0);
+ _Sha256_first.set(this, void 0);
+ _Sha256_h0.set(this, void 0);
+ _Sha256_h1.set(this, void 0);
+ _Sha256_h2.set(this, void 0);
+ _Sha256_h3.set(this, void 0);
+ _Sha256_h4.set(this, void 0);
+ _Sha256_h5.set(this, void 0);
+ _Sha256_h6.set(this, void 0);
+ _Sha256_h7.set(this, void 0);
+ _Sha256_hashed.set(this, void 0);
+ _Sha256_hBytes.set(this, void 0);
+ _Sha256_is224.set(this, void 0);
+ _Sha256_lastByteIndex.set(this, 0);
+ _Sha256_start.set(this, void 0);
+ this.init(is224, sharedMemory);
+ }
+ init(is224, sharedMemory) {
+ if (sharedMemory) {
+ blocks[0] =
+ blocks[16] =
+ blocks[1] =
+ blocks[2] =
+ blocks[3] =
+ blocks[4] =
+ blocks[5] =
+ blocks[6] =
+ blocks[7] =
+ blocks[8] =
+ blocks[9] =
+ blocks[10] =
+ blocks[11] =
+ blocks[12] =
+ blocks[13] =
+ blocks[14] =
+ blocks[15] =
+ 0;
+ __classPrivateFieldSet(this, _Sha256_blocks, blocks, "f");
+ }
+ else {
+ __classPrivateFieldSet(this, _Sha256_blocks, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "f");
+ }
+ if (is224) {
+ __classPrivateFieldSet(this, _Sha256_h0, 0xc1059ed8, "f");
+ __classPrivateFieldSet(this, _Sha256_h1, 0x367cd507, "f");
+ __classPrivateFieldSet(this, _Sha256_h2, 0x3070dd17, "f");
+ __classPrivateFieldSet(this, _Sha256_h3, 0xf70e5939, "f");
+ __classPrivateFieldSet(this, _Sha256_h4, 0xffc00b31, "f");
+ __classPrivateFieldSet(this, _Sha256_h5, 0x68581511, "f");
+ __classPrivateFieldSet(this, _Sha256_h6, 0x64f98fa7, "f");
+ __classPrivateFieldSet(this, _Sha256_h7, 0xbefa4fa4, "f");
+ }
+ else {
+ // 256
+ __classPrivateFieldSet(this, _Sha256_h0, 0x6a09e667, "f");
+ __classPrivateFieldSet(this, _Sha256_h1, 0xbb67ae85, "f");
+ __classPrivateFieldSet(this, _Sha256_h2, 0x3c6ef372, "f");
+ __classPrivateFieldSet(this, _Sha256_h3, 0xa54ff53a, "f");
+ __classPrivateFieldSet(this, _Sha256_h4, 0x510e527f, "f");
+ __classPrivateFieldSet(this, _Sha256_h5, 0x9b05688c, "f");
+ __classPrivateFieldSet(this, _Sha256_h6, 0x1f83d9ab, "f");
+ __classPrivateFieldSet(this, _Sha256_h7, 0x5be0cd19, "f");
+ }
+ __classPrivateFieldSet(this, _Sha256_block, __classPrivateFieldSet(this, _Sha256_start, __classPrivateFieldSet(this, _Sha256_bytes, __classPrivateFieldSet(this, _Sha256_hBytes, 0, "f"), "f"), "f"), "f");
+ __classPrivateFieldSet(this, _Sha256_finalized, __classPrivateFieldSet(this, _Sha256_hashed, false, "f"), "f");
+ __classPrivateFieldSet(this, _Sha256_first, true, "f");
+ __classPrivateFieldSet(this, _Sha256_is224, is224, "f");
+ }
+ /** Update hash
+ *
+ * @param message The message you want to hash.
+ */
+ update(message) {
+ if (__classPrivateFieldGet(this, _Sha256_finalized, "f")) {
+ return this;
+ }
+ let msg;
+ if (message instanceof ArrayBuffer) {
+ msg = new Uint8Array(message);
+ }
+ else {
+ msg = message;
+ }
+ let index = 0;
+ const length = msg.length;
+ const blocks = __classPrivateFieldGet(this, _Sha256_blocks, "f");
+ while (index < length) {
+ let i;
+ if (__classPrivateFieldGet(this, _Sha256_hashed, "f")) {
+ __classPrivateFieldSet(this, _Sha256_hashed, false, "f");
+ blocks[0] = __classPrivateFieldGet(this, _Sha256_block, "f");
+ blocks[16] =
+ blocks[1] =
+ blocks[2] =
+ blocks[3] =
+ blocks[4] =
+ blocks[5] =
+ blocks[6] =
+ blocks[7] =
+ blocks[8] =
+ blocks[9] =
+ blocks[10] =
+ blocks[11] =
+ blocks[12] =
+ blocks[13] =
+ blocks[14] =
+ blocks[15] =
+ 0;
+ }
+ if (typeof msg !== "string") {
+ for (i = __classPrivateFieldGet(this, _Sha256_start, "f"); index < length && i < 64; ++index) {
+ blocks[i >> 2] |= msg[index] << SHIFT[i++ & 3];
+ }
+ }
+ else {
+ for (i = __classPrivateFieldGet(this, _Sha256_start, "f"); index < length && i < 64; ++index) {
+ let code = msg.charCodeAt(index);
+ if (code < 0x80) {
+ blocks[i >> 2] |= code << SHIFT[i++ & 3];
+ }
+ else if (code < 0x800) {
+ blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+ }
+ else if (code < 0xd800 || code >= 0xe000) {
+ blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
+ blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+ }
+ else {
+ code = 0x10000 +
+ (((code & 0x3ff) << 10) | (msg.charCodeAt(++index) & 0x3ff));
+ blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
+ blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
+ blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
+ }
+ }
+ }
+ __classPrivateFieldSet(this, _Sha256_lastByteIndex, i, "f");
+ __classPrivateFieldSet(this, _Sha256_bytes, __classPrivateFieldGet(this, _Sha256_bytes, "f") + (i - __classPrivateFieldGet(this, _Sha256_start, "f")), "f");
+ if (i >= 64) {
+ __classPrivateFieldSet(this, _Sha256_block, blocks[16], "f");
+ __classPrivateFieldSet(this, _Sha256_start, i - 64, "f");
+ this.hash();
+ __classPrivateFieldSet(this, _Sha256_hashed, true, "f");
+ }
+ else {
+ __classPrivateFieldSet(this, _Sha256_start, i, "f");
+ }
+ }
+ if (__classPrivateFieldGet(this, _Sha256_bytes, "f") > 4294967295) {
+ __classPrivateFieldSet(this, _Sha256_hBytes, __classPrivateFieldGet(this, _Sha256_hBytes, "f") + ((__classPrivateFieldGet(this, _Sha256_bytes, "f") / 4294967296) << 0), "f");
+ __classPrivateFieldSet(this, _Sha256_bytes, __classPrivateFieldGet(this, _Sha256_bytes, "f") % 4294967296, "f");
+ }
+ return this;
+ }
+ finalize() {
+ if (__classPrivateFieldGet(this, _Sha256_finalized, "f")) {
+ return;
+ }
+ __classPrivateFieldSet(this, _Sha256_finalized, true, "f");
+ const blocks = __classPrivateFieldGet(this, _Sha256_blocks, "f");
+ const i = __classPrivateFieldGet(this, _Sha256_lastByteIndex, "f");
+ blocks[16] = __classPrivateFieldGet(this, _Sha256_block, "f");
+ blocks[i >> 2] |= EXTRA[i & 3];
+ __classPrivateFieldSet(this, _Sha256_block, blocks[16], "f");
+ if (i >= 56) {
+ if (!__classPrivateFieldGet(this, _Sha256_hashed, "f")) {
+ this.hash();
+ }
+ blocks[0] = __classPrivateFieldGet(this, _Sha256_block, "f");
+ blocks[16] =
+ blocks[1] =
+ blocks[2] =
+ blocks[3] =
+ blocks[4] =
+ blocks[5] =
+ blocks[6] =
+ blocks[7] =
+ blocks[8] =
+ blocks[9] =
+ blocks[10] =
+ blocks[11] =
+ blocks[12] =
+ blocks[13] =
+ blocks[14] =
+ blocks[15] =
+ 0;
+ }
+ blocks[14] = (__classPrivateFieldGet(this, _Sha256_hBytes, "f") << 3) | (__classPrivateFieldGet(this, _Sha256_bytes, "f") >>> 29);
+ blocks[15] = __classPrivateFieldGet(this, _Sha256_bytes, "f") << 3;
+ this.hash();
+ }
+ hash() {
+ let a = __classPrivateFieldGet(this, _Sha256_h0, "f");
+ let b = __classPrivateFieldGet(this, _Sha256_h1, "f");
+ let c = __classPrivateFieldGet(this, _Sha256_h2, "f");
+ let d = __classPrivateFieldGet(this, _Sha256_h3, "f");
+ let e = __classPrivateFieldGet(this, _Sha256_h4, "f");
+ let f = __classPrivateFieldGet(this, _Sha256_h5, "f");
+ let g = __classPrivateFieldGet(this, _Sha256_h6, "f");
+ let h = __classPrivateFieldGet(this, _Sha256_h7, "f");
+ const blocks = __classPrivateFieldGet(this, _Sha256_blocks, "f");
+ let s0;
+ let s1;
+ let maj;
+ let t1;
+ let t2;
+ let ch;
+ let ab;
+ let da;
+ let cd;
+ let bc;
+ for (let j = 16; j < 64; ++j) {
+ // rightrotate
+ t1 = blocks[j - 15];
+ s0 = ((t1 >>> 7) | (t1 << 25)) ^ ((t1 >>> 18) | (t1 << 14)) ^ (t1 >>> 3);
+ t1 = blocks[j - 2];
+ s1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^
+ (t1 >>> 10);
+ blocks[j] = (blocks[j - 16] + s0 + blocks[j - 7] + s1) << 0;
+ }
+ bc = b & c;
+ for (let j = 0; j < 64; j += 4) {
+ if (__classPrivateFieldGet(this, _Sha256_first, "f")) {
+ if (__classPrivateFieldGet(this, _Sha256_is224, "f")) {
+ ab = 300032;
+ t1 = blocks[0] - 1413257819;
+ h = (t1 - 150054599) << 0;
+ d = (t1 + 24177077) << 0;
+ }
+ else {
+ ab = 704751109;
+ t1 = blocks[0] - 210244248;
+ h = (t1 - 1521486534) << 0;
+ d = (t1 + 143694565) << 0;
+ }
+ __classPrivateFieldSet(this, _Sha256_first, false, "f");
+ }
+ else {
+ s0 = ((a >>> 2) | (a << 30)) ^
+ ((a >>> 13) | (a << 19)) ^
+ ((a >>> 22) | (a << 10));
+ s1 = ((e >>> 6) | (e << 26)) ^
+ ((e >>> 11) | (e << 21)) ^
+ ((e >>> 25) | (e << 7));
+ ab = a & b;
+ maj = ab ^ (a & c) ^ bc;
+ ch = (e & f) ^ (~e & g);
+ t1 = h + s1 + ch + K[j] + blocks[j];
+ t2 = s0 + maj;
+ h = (d + t1) << 0;
+ d = (t1 + t2) << 0;
+ }
+ s0 = ((d >>> 2) | (d << 30)) ^
+ ((d >>> 13) | (d << 19)) ^
+ ((d >>> 22) | (d << 10));
+ s1 = ((h >>> 6) | (h << 26)) ^
+ ((h >>> 11) | (h << 21)) ^
+ ((h >>> 25) | (h << 7));
+ da = d & a;
+ maj = da ^ (d & b) ^ ab;
+ ch = (h & e) ^ (~h & f);
+ t1 = g + s1 + ch + K[j + 1] + blocks[j + 1];
+ t2 = s0 + maj;
+ g = (c + t1) << 0;
+ c = (t1 + t2) << 0;
+ s0 = ((c >>> 2) | (c << 30)) ^
+ ((c >>> 13) | (c << 19)) ^
+ ((c >>> 22) | (c << 10));
+ s1 = ((g >>> 6) | (g << 26)) ^
+ ((g >>> 11) | (g << 21)) ^
+ ((g >>> 25) | (g << 7));
+ cd = c & d;
+ maj = cd ^ (c & a) ^ da;
+ ch = (g & h) ^ (~g & e);
+ t1 = f + s1 + ch + K[j + 2] + blocks[j + 2];
+ t2 = s0 + maj;
+ f = (b + t1) << 0;
+ b = (t1 + t2) << 0;
+ s0 = ((b >>> 2) | (b << 30)) ^
+ ((b >>> 13) | (b << 19)) ^
+ ((b >>> 22) | (b << 10));
+ s1 = ((f >>> 6) | (f << 26)) ^
+ ((f >>> 11) | (f << 21)) ^
+ ((f >>> 25) | (f << 7));
+ bc = b & c;
+ maj = bc ^ (b & d) ^ cd;
+ ch = (f & g) ^ (~f & h);
+ t1 = e + s1 + ch + K[j + 3] + blocks[j + 3];
+ t2 = s0 + maj;
+ e = (a + t1) << 0;
+ a = (t1 + t2) << 0;
+ }
+ __classPrivateFieldSet(this, _Sha256_h0, (__classPrivateFieldGet(this, _Sha256_h0, "f") + a) << 0, "f");
+ __classPrivateFieldSet(this, _Sha256_h1, (__classPrivateFieldGet(this, _Sha256_h1, "f") + b) << 0, "f");
+ __classPrivateFieldSet(this, _Sha256_h2, (__classPrivateFieldGet(this, _Sha256_h2, "f") + c) << 0, "f");
+ __classPrivateFieldSet(this, _Sha256_h3, (__classPrivateFieldGet(this, _Sha256_h3, "f") + d) << 0, "f");
+ __classPrivateFieldSet(this, _Sha256_h4, (__classPrivateFieldGet(this, _Sha256_h4, "f") + e) << 0, "f");
+ __classPrivateFieldSet(this, _Sha256_h5, (__classPrivateFieldGet(this, _Sha256_h5, "f") + f) << 0, "f");
+ __classPrivateFieldSet(this, _Sha256_h6, (__classPrivateFieldGet(this, _Sha256_h6, "f") + g) << 0, "f");
+ __classPrivateFieldSet(this, _Sha256_h7, (__classPrivateFieldGet(this, _Sha256_h7, "f") + h) << 0, "f");
+ }
+ /** Return hash in hex string. */
+ hex() {
+ this.finalize();
+ const h0 = __classPrivateFieldGet(this, _Sha256_h0, "f");
+ const h1 = __classPrivateFieldGet(this, _Sha256_h1, "f");
+ const h2 = __classPrivateFieldGet(this, _Sha256_h2, "f");
+ const h3 = __classPrivateFieldGet(this, _Sha256_h3, "f");
+ const h4 = __classPrivateFieldGet(this, _Sha256_h4, "f");
+ const h5 = __classPrivateFieldGet(this, _Sha256_h5, "f");
+ const h6 = __classPrivateFieldGet(this, _Sha256_h6, "f");
+ const h7 = __classPrivateFieldGet(this, _Sha256_h7, "f");
+ let hex = HEX_CHARS[(h0 >> 28) & 0x0f] +
+ HEX_CHARS[(h0 >> 24) & 0x0f] +
+ HEX_CHARS[(h0 >> 20) & 0x0f] +
+ HEX_CHARS[(h0 >> 16) & 0x0f] +
+ HEX_CHARS[(h0 >> 12) & 0x0f] +
+ HEX_CHARS[(h0 >> 8) & 0x0f] +
+ HEX_CHARS[(h0 >> 4) & 0x0f] +
+ HEX_CHARS[h0 & 0x0f] +
+ HEX_CHARS[(h1 >> 28) & 0x0f] +
+ HEX_CHARS[(h1 >> 24) & 0x0f] +
+ HEX_CHARS[(h1 >> 20) & 0x0f] +
+ HEX_CHARS[(h1 >> 16) & 0x0f] +
+ HEX_CHARS[(h1 >> 12) & 0x0f] +
+ HEX_CHARS[(h1 >> 8) & 0x0f] +
+ HEX_CHARS[(h1 >> 4) & 0x0f] +
+ HEX_CHARS[h1 & 0x0f] +
+ HEX_CHARS[(h2 >> 28) & 0x0f] +
+ HEX_CHARS[(h2 >> 24) & 0x0f] +
+ HEX_CHARS[(h2 >> 20) & 0x0f] +
+ HEX_CHARS[(h2 >> 16) & 0x0f] +
+ HEX_CHARS[(h2 >> 12) & 0x0f] +
+ HEX_CHARS[(h2 >> 8) & 0x0f] +
+ HEX_CHARS[(h2 >> 4) & 0x0f] +
+ HEX_CHARS[h2 & 0x0f] +
+ HEX_CHARS[(h3 >> 28) & 0x0f] +
+ HEX_CHARS[(h3 >> 24) & 0x0f] +
+ HEX_CHARS[(h3 >> 20) & 0x0f] +
+ HEX_CHARS[(h3 >> 16) & 0x0f] +
+ HEX_CHARS[(h3 >> 12) & 0x0f] +
+ HEX_CHARS[(h3 >> 8) & 0x0f] +
+ HEX_CHARS[(h3 >> 4) & 0x0f] +
+ HEX_CHARS[h3 & 0x0f] +
+ HEX_CHARS[(h4 >> 28) & 0x0f] +
+ HEX_CHARS[(h4 >> 24) & 0x0f] +
+ HEX_CHARS[(h4 >> 20) & 0x0f] +
+ HEX_CHARS[(h4 >> 16) & 0x0f] +
+ HEX_CHARS[(h4 >> 12) & 0x0f] +
+ HEX_CHARS[(h4 >> 8) & 0x0f] +
+ HEX_CHARS[(h4 >> 4) & 0x0f] +
+ HEX_CHARS[h4 & 0x0f] +
+ HEX_CHARS[(h5 >> 28) & 0x0f] +
+ HEX_CHARS[(h5 >> 24) & 0x0f] +
+ HEX_CHARS[(h5 >> 20) & 0x0f] +
+ HEX_CHARS[(h5 >> 16) & 0x0f] +
+ HEX_CHARS[(h5 >> 12) & 0x0f] +
+ HEX_CHARS[(h5 >> 8) & 0x0f] +
+ HEX_CHARS[(h5 >> 4) & 0x0f] +
+ HEX_CHARS[h5 & 0x0f] +
+ HEX_CHARS[(h6 >> 28) & 0x0f] +
+ HEX_CHARS[(h6 >> 24) & 0x0f] +
+ HEX_CHARS[(h6 >> 20) & 0x0f] +
+ HEX_CHARS[(h6 >> 16) & 0x0f] +
+ HEX_CHARS[(h6 >> 12) & 0x0f] +
+ HEX_CHARS[(h6 >> 8) & 0x0f] +
+ HEX_CHARS[(h6 >> 4) & 0x0f] +
+ HEX_CHARS[h6 & 0x0f];
+ if (!__classPrivateFieldGet(this, _Sha256_is224, "f")) {
+ hex += HEX_CHARS[(h7 >> 28) & 0x0f] +
+ HEX_CHARS[(h7 >> 24) & 0x0f] +
+ HEX_CHARS[(h7 >> 20) & 0x0f] +
+ HEX_CHARS[(h7 >> 16) & 0x0f] +
+ HEX_CHARS[(h7 >> 12) & 0x0f] +
+ HEX_CHARS[(h7 >> 8) & 0x0f] +
+ HEX_CHARS[(h7 >> 4) & 0x0f] +
+ HEX_CHARS[h7 & 0x0f];
+ }
+ return hex;
+ }
+ /** Return hash in hex string. */
+ toString() {
+ return this.hex();
+ }
+ /** Return hash in integer array. */
+ digest() {
+ this.finalize();
+ const h0 = __classPrivateFieldGet(this, _Sha256_h0, "f");
+ const h1 = __classPrivateFieldGet(this, _Sha256_h1, "f");
+ const h2 = __classPrivateFieldGet(this, _Sha256_h2, "f");
+ const h3 = __classPrivateFieldGet(this, _Sha256_h3, "f");
+ const h4 = __classPrivateFieldGet(this, _Sha256_h4, "f");
+ const h5 = __classPrivateFieldGet(this, _Sha256_h5, "f");
+ const h6 = __classPrivateFieldGet(this, _Sha256_h6, "f");
+ const h7 = __classPrivateFieldGet(this, _Sha256_h7, "f");
+ const arr = [
+ (h0 >> 24) & 0xff,
+ (h0 >> 16) & 0xff,
+ (h0 >> 8) & 0xff,
+ h0 & 0xff,
+ (h1 >> 24) & 0xff,
+ (h1 >> 16) & 0xff,
+ (h1 >> 8) & 0xff,
+ h1 & 0xff,
+ (h2 >> 24) & 0xff,
+ (h2 >> 16) & 0xff,
+ (h2 >> 8) & 0xff,
+ h2 & 0xff,
+ (h3 >> 24) & 0xff,
+ (h3 >> 16) & 0xff,
+ (h3 >> 8) & 0xff,
+ h3 & 0xff,
+ (h4 >> 24) & 0xff,
+ (h4 >> 16) & 0xff,
+ (h4 >> 8) & 0xff,
+ h4 & 0xff,
+ (h5 >> 24) & 0xff,
+ (h5 >> 16) & 0xff,
+ (h5 >> 8) & 0xff,
+ h5 & 0xff,
+ (h6 >> 24) & 0xff,
+ (h6 >> 16) & 0xff,
+ (h6 >> 8) & 0xff,
+ h6 & 0xff,
+ ];
+ if (!__classPrivateFieldGet(this, _Sha256_is224, "f")) {
+ arr.push((h7 >> 24) & 0xff, (h7 >> 16) & 0xff, (h7 >> 8) & 0xff, h7 & 0xff);
+ }
+ return arr;
+ }
+ /** Return hash in integer array. */
+ array() {
+ return this.digest();
+ }
+ /** Return hash in ArrayBuffer. */
+ arrayBuffer() {
+ this.finalize();
+ const buffer = new ArrayBuffer(__classPrivateFieldGet(this, _Sha256_is224, "f") ? 28 : 32);
+ const dataView = new DataView(buffer);
+ dataView.setUint32(0, __classPrivateFieldGet(this, _Sha256_h0, "f"));
+ dataView.setUint32(4, __classPrivateFieldGet(this, _Sha256_h1, "f"));
+ dataView.setUint32(8, __classPrivateFieldGet(this, _Sha256_h2, "f"));
+ dataView.setUint32(12, __classPrivateFieldGet(this, _Sha256_h3, "f"));
+ dataView.setUint32(16, __classPrivateFieldGet(this, _Sha256_h4, "f"));
+ dataView.setUint32(20, __classPrivateFieldGet(this, _Sha256_h5, "f"));
+ dataView.setUint32(24, __classPrivateFieldGet(this, _Sha256_h6, "f"));
+ if (!__classPrivateFieldGet(this, _Sha256_is224, "f")) {
+ dataView.setUint32(28, __classPrivateFieldGet(this, _Sha256_h7, "f"));
+ }
+ return buffer;
+ }
+}
+_Sha256_block = new WeakMap(), _Sha256_blocks = new WeakMap(), _Sha256_bytes = new WeakMap(), _Sha256_finalized = new WeakMap(), _Sha256_first = new WeakMap(), _Sha256_h0 = new WeakMap(), _Sha256_h1 = new WeakMap(), _Sha256_h2 = new WeakMap(), _Sha256_h3 = new WeakMap(), _Sha256_h4 = new WeakMap(), _Sha256_h5 = new WeakMap(), _Sha256_h6 = new WeakMap(), _Sha256_h7 = new WeakMap(), _Sha256_hashed = new WeakMap(), _Sha256_hBytes = new WeakMap(), _Sha256_is224 = new WeakMap(), _Sha256_lastByteIndex = new WeakMap(), _Sha256_start = new WeakMap();
+export class HmacSha256 extends Sha256 {
+ constructor(secretKey, is224 = false, sharedMemory = false) {
+ super(is224, sharedMemory);
+ _HmacSha256_inner.set(this, void 0);
+ _HmacSha256_is224.set(this, void 0);
+ _HmacSha256_oKeyPad.set(this, void 0);
+ _HmacSha256_sharedMemory.set(this, void 0);
+ let key;
+ if (typeof secretKey === "string") {
+ const bytes = [];
+ const length = secretKey.length;
+ let index = 0;
+ for (let i = 0; i < length; ++i) {
+ let code = secretKey.charCodeAt(i);
+ if (code < 0x80) {
+ bytes[index++] = code;
+ }
+ else if (code < 0x800) {
+ bytes[index++] = 0xc0 | (code >> 6);
+ bytes[index++] = 0x80 | (code & 0x3f);
+ }
+ else if (code < 0xd800 || code >= 0xe000) {
+ bytes[index++] = 0xe0 | (code >> 12);
+ bytes[index++] = 0x80 | ((code >> 6) & 0x3f);
+ bytes[index++] = 0x80 | (code & 0x3f);
+ }
+ else {
+ code = 0x10000 +
+ (((code & 0x3ff) << 10) | (secretKey.charCodeAt(++i) & 0x3ff));
+ bytes[index++] = 0xf0 | (code >> 18);
+ bytes[index++] = 0x80 | ((code >> 12) & 0x3f);
+ bytes[index++] = 0x80 | ((code >> 6) & 0x3f);
+ bytes[index++] = 0x80 | (code & 0x3f);
+ }
+ }
+ key = bytes;
+ }
+ else {
+ if (secretKey instanceof ArrayBuffer) {
+ key = new Uint8Array(secretKey);
+ }
+ else {
+ key = secretKey;
+ }
+ }
+ if (key.length > 64) {
+ key = new Sha256(is224, true).update(key).array();
+ }
+ const oKeyPad = [];
+ const iKeyPad = [];
+ for (let i = 0; i < 64; ++i) {
+ const b = key[i] || 0;
+ oKeyPad[i] = 0x5c ^ b;
+ iKeyPad[i] = 0x36 ^ b;
+ }
+ this.update(iKeyPad);
+ __classPrivateFieldSet(this, _HmacSha256_oKeyPad, oKeyPad, "f");
+ __classPrivateFieldSet(this, _HmacSha256_inner, true, "f");
+ __classPrivateFieldSet(this, _HmacSha256_is224, is224, "f");
+ __classPrivateFieldSet(this, _HmacSha256_sharedMemory, sharedMemory, "f");
+ }
+ finalize() {
+ super.finalize();
+ if (__classPrivateFieldGet(this, _HmacSha256_inner, "f")) {
+ __classPrivateFieldSet(this, _HmacSha256_inner, false, "f");
+ const innerHash = this.array();
+ super.init(__classPrivateFieldGet(this, _HmacSha256_is224, "f"), __classPrivateFieldGet(this, _HmacSha256_sharedMemory, "f"));
+ this.update(__classPrivateFieldGet(this, _HmacSha256_oKeyPad, "f"));
+ this.update(innerHash);
+ super.finalize();
+ }
+ }
+}
+_HmacSha256_inner = new WeakMap(), _HmacSha256_is224 = new WeakMap(), _HmacSha256_oKeyPad = new WeakMap(), _HmacSha256_sharedMemory = new WeakMap();
diff --git a/dist/esm/deps/deno.land/x/typebox@0.25.13/src/typebox.d.ts b/dist/esm/deps/deno.land/x/typebox@0.25.13/src/typebox.d.ts
new file mode 100644
index 00000000..87b2c264
--- /dev/null
+++ b/dist/esm/deps/deno.land/x/typebox@0.25.13/src/typebox.d.ts
@@ -0,0 +1,427 @@
+export declare const Kind: unique symbol;
+export declare const Hint: unique symbol;
+export declare const Modifier: unique symbol;
+export type TModifier = TReadonlyOptional | TOptional | TReadonly;
+export type TReadonly = T & {
+ [Modifier]: 'Readonly';
+};
+export type TOptional = T & {
+ [Modifier]: 'Optional';
+};
+export type TReadonlyOptional = T & {
+ [Modifier]: 'ReadonlyOptional';
+};
+export interface SchemaOptions {
+ $schema?: string;
+ /** Id for this schema */
+ $id?: string;
+ /** Title of this schema */
+ title?: string;
+ /** Description of this schema */
+ description?: string;
+ /** Default value for this schema */
+ default?: any;
+ /** Example values matching this schema. */
+ examples?: any;
+ [prop: string]: any;
+}
+export interface TSchema extends SchemaOptions {
+ [Kind]: string;
+ [Hint]?: string;
+ [Modifier]?: string;
+ params: unknown[];
+ static: unknown;
+}
+export type TAnySchema = TSchema | TAny | TArray | TBoolean | TConstructor | TDate | TEnum | TFunction | TInteger | TLiteral | TNull | TNumber | TObject | TPromise | TRecord | TSelf | TRef | TString | TTuple | TUndefined | TUnion | TUint8Array | TUnknown | TVoid;
+export interface NumericOptions extends SchemaOptions {
+ exclusiveMaximum?: number;
+ exclusiveMinimum?: number;
+ maximum?: number;
+ minimum?: number;
+ multipleOf?: number;
+}
+export type TNumeric = TInteger | TNumber;
+export interface TAny extends TSchema {
+ [Kind]: 'Any';
+ static: any;
+}
+export interface ArrayOptions extends SchemaOptions {
+ uniqueItems?: boolean;
+ minItems?: number;
+ maxItems?: number;
+}
+export interface TArray extends TSchema, ArrayOptions {
+ [Kind]: 'Array';
+ static: Array>;
+ type: 'array';
+ items: T;
+}
+export interface TBoolean extends TSchema {
+ [Kind]: 'Boolean';
+ static: boolean;
+ type: 'boolean';
+}
+export type TConstructorParameters> = TTuple;
+export type TInstanceType> = T['returns'];
+export type StaticContructorParameters = [...{
+ [K in keyof T]: T[K] extends TSchema ? Static : never;
+}];
+export interface TConstructor extends TSchema {
+ [Kind]: 'Constructor';
+ static: new (...param: StaticContructorParameters) => Static;
+ type: 'object';
+ instanceOf: 'Constructor';
+ parameters: T;
+ returns: U;
+}
+export interface DateOptions extends SchemaOptions {
+ exclusiveMaximumTimestamp?: number;
+ exclusiveMinimumTimestamp?: number;
+ maximumTimestamp?: number;
+ minimumTimestamp?: number;
+}
+export interface TDate extends TSchema, DateOptions {
+ [Kind]: 'Date';
+ static: Date;
+ type: 'object';
+ instanceOf: 'Date';
+}
+export interface TEnumOption {
+ type: 'number' | 'string';
+ const: T;
+}
+export interface TEnum = Record> extends TSchema {
+ [Kind]: 'Union';
+ static: T[keyof T];
+ anyOf: TLiteral[];
+}
+export type TParameters = TTuple;
+export type TReturnType = T['returns'];
+export type StaticFunctionParameters = [...{
+ [K in keyof T]: T[K] extends TSchema ? Static : never;
+}];
+export interface TFunction extends TSchema {
+ [Kind]: 'Function';
+ static: (...param: StaticFunctionParameters) => Static;
+ type: 'object';
+ instanceOf: 'Function';
+ parameters: T;
+ returns: U;
+}
+export interface TInteger extends TSchema, NumericOptions {
+ [Kind]: 'Integer';
+ static: number;
+ type: 'integer';
+}
+export type IntersectReduce = T extends [infer A, ...infer B] ? IntersectReduce : I extends object ? I : {};
+export type IntersectEvaluate = {
+ [K in keyof T]: T[K] extends TSchema ? Static : never;
+};
+export type IntersectProperties = {
+ [K in keyof T]: T[K] extends TObject ? P : {};
+};
+export interface TIntersect extends TObject {
+ static: IntersectReduce>;
+ properties: IntersectReduce>;
+}
+export type UnionToIntersect = (U extends unknown ? (arg: U) => 0 : never) extends (arg: infer I) => 0 ? I : never;
+export type UnionLast = UnionToIntersect 0 : never> extends (x: infer L) => 0 ? L : never;
+export type UnionToTuple> = [U] extends [never] ? [] : [...UnionToTuple>, L];
+export type UnionStringLiteralToTuple = T extends TUnion ? {
+ [I in keyof L]: L[I] extends TLiteral ? C : never;
+} : never;
+export type UnionLiteralsFromObject = {
+ [K in ObjectPropertyKeys]: TLiteral;
+} extends infer R ? UnionToTuple : never;
+export interface TKeyOf extends TUnion> {
+}
+export type TLiteralValue = string | number | boolean;
+export interface TLiteral extends TSchema {
+ [Kind]: 'Literal';
+ static: T;
+ const: T;
+}
+export interface TNever extends TSchema {
+ [Kind]: 'Never';
+ static: never;
+ allOf: [{
+ type: 'boolean';
+ const: false;
+ }, {
+ type: 'boolean';
+ const: true;
+ }];
+}
+export interface TNull extends TSchema {
+ [Kind]: 'Null';
+ static: null;
+ type: 'null';
+}
+export interface TNumber extends TSchema, NumericOptions {
+ [Kind]: 'Number';
+ static: number;
+ type: 'number';
+}
+export type ReadonlyOptionalPropertyKeys = {
+ [K in keyof T]: T[K] extends TReadonlyOptional ? K : never;
+}[keyof T];
+export type ReadonlyPropertyKeys = {
+ [K in keyof T]: T[K] extends TReadonly ? K : never;
+}[keyof T];
+export type OptionalPropertyKeys = {
+ [K in keyof T]: T[K] extends TOptional ? K : never;
+}[keyof T];
+export type RequiredPropertyKeys = keyof Omit | ReadonlyPropertyKeys | OptionalPropertyKeys>;
+export type PropertiesReduce = {
+ readonly [K in ReadonlyOptionalPropertyKeys]?: Static;
+} & {
+ readonly [K in ReadonlyPropertyKeys]: Static;
+} & {
+ [K in OptionalPropertyKeys]?: Static;
+} & {
+ [K in RequiredPropertyKeys]: Static;
+} extends infer R ? {
+ [K in keyof R]: R[K];
+} : never;
+export type TRecordProperties, T extends TSchema> = Static extends string ? {
+ [X in Static]: T;
+} : never;
+export interface TProperties {
+ [key: string]: TSchema;
+}
+export type ObjectProperties = T extends TObject ? U : never;
+export type ObjectPropertyKeys = T extends TObject ? keyof U : never;
+export type TAdditionalProperties = undefined | TSchema | boolean;
+export interface ObjectOptions extends SchemaOptions {
+ additionalProperties?: TAdditionalProperties;
+ minProperties?: number;
+ maxProperties?: number;
+}
+export interface TObject extends TSchema, ObjectOptions {
+ [Kind]: 'Object';
+ static: PropertiesReduce;
+ additionalProperties?: TAdditionalProperties;
+ type: 'object';
+ properties: T;
+ required?: string[];
+}
+export interface TOmit[]> extends TObject, ObjectOptions {
+ static: Omit, Properties[number]>;
+ properties: T extends TObject ? Omit : never;
+}
+export interface TPartial extends TObject {
+ static: Partial>;
+ properties: {
+ [K in keyof T['properties']]: T['properties'][K] extends TReadonlyOptional ? TReadonlyOptional : T['properties'][K] extends TReadonly ? TReadonlyOptional : T['properties'][K] extends TOptional ? TOptional : TOptional;
+ };
+}
+export type TPick[]> = TObject<{
+ [K in Properties[number]]: T['properties'][K];
+}>;
+export interface TPromise extends TSchema {
+ [Kind]: 'Promise';
+ static: Promise>;
+ type: 'object';
+ instanceOf: 'Promise';
+ item: TSchema;
+}
+export type TRecordKey = TString | TNumeric | TUnion[]>;
+export interface TRecord extends TSchema {
+ [Kind]: 'Record';
+ static: Record, Static>;
+ type: 'object';
+ patternProperties: {
+ [pattern: string]: T;
+ };
+ additionalProperties: false;
+}
+export interface TSelf extends TSchema {
+ [Kind]: 'Self';
+ static: this['params'][0];
+ $ref: string;
+}
+export type TRecursiveReduce = Static]>;
+export interface TRecursive extends TSchema {
+ static: TRecursiveReduce;
+}
+export interface TRef extends TSchema {
+ [Kind]: 'Ref';
+ static: Static;
+ $ref: string;
+}
+export interface TRequired> extends TObject {
+ static: Required>;
+ properties: {
+ [K in keyof T['properties']]: T['properties'][K] extends TReadonlyOptional ? TReadonly : T['properties'][K] extends TReadonly ? TReadonly : T['properties'][K] extends TOptional ? U : T['properties'][K];
+ };
+}
+export type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex';
+export interface StringOptions extends SchemaOptions {
+ minLength?: number;
+ maxLength?: number;
+ pattern?: string;
+ format?: Format;
+ contentEncoding?: '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64';
+ contentMediaType?: string;
+}
+export interface TString extends TSchema, StringOptions {
+ [Kind]: 'String';
+ static: string;
+ type: 'string';
+}
+export type TupleToArray> = T extends TTuple ? R : never;
+export interface TTuple extends TSchema {
+ [Kind]: 'Tuple';
+ static: {
+ [K in keyof T]: T[K] extends TSchema ? Static : T[K];
+ };
+ type: 'array';
+ items?: T;
+ additionalItems?: false;
+ minItems: number;
+ maxItems: number;
+}
+export interface TUndefined extends TSchema {
+ [Kind]: 'Undefined';
+ static: undefined;
+ type: 'null';
+ typeOf: 'Undefined';
+}
+export interface TUnion extends TSchema {
+ [Kind]: 'Union';
+ static: {
+ [K in keyof T]: T[K] extends TSchema ? Static : never;
+ }[number];
+ anyOf: T;
+}
+export interface Uint8ArrayOptions extends SchemaOptions {
+ maxByteLength?: number;
+ minByteLength?: number;
+}
+export interface TUint8Array extends TSchema, Uint8ArrayOptions {
+ [Kind]: 'Uint8Array';
+ static: Uint8Array;
+ instanceOf: 'Uint8Array';
+ type: 'object';
+}
+export interface TUnknown extends TSchema {
+ [Kind]: 'Unknown';
+ static: unknown;
+}
+export interface UnsafeOptions extends SchemaOptions {
+ [Kind]?: string;
+}
+export interface TUnsafe extends TSchema {
+ [Kind]: string;
+ static: T;
+}
+export interface TVoid extends TSchema {
+ [Kind]: 'Void';
+ static: void;
+ type: 'null';
+ typeOf: 'Void';
+}
+/** Creates a static type from a TypeBox type */
+export type Static = (T & {
+ params: P;
+})['static'];
+export declare class TypeBuilder {
+ /** Creates a readonly optional property */
+ ReadonlyOptional(item: T): TReadonlyOptional;
+ /** Creates a readonly property */
+ Readonly(item: T): TReadonly;
+ /** Creates a optional property */
+ Optional(item: T): TOptional;
+ /** `Standard` Creates a any type */
+ Any(options?: SchemaOptions): TAny;
+ /** `Standard` Creates a array type */
+ Array(items: T, options?: ArrayOptions): TArray;
+ /** `Standard` Creates a boolean type */
+ Boolean(options?: SchemaOptions): TBoolean;
+ /** `Extended` Creates a tuple type from this constructors parameters */
+ ConstructorParameters>(schema: T, options?: SchemaOptions): TConstructorParameters;
+ /** `Extended` Creates a constructor type */
+ Constructor, U extends TSchema>(parameters: T, returns: U, options?: SchemaOptions): TConstructor, U>;
+ /** `Extended` Creates a constructor type */
+ Constructor(parameters: [...T], returns: U, options?: SchemaOptions): TConstructor;
+ /** `Extended` Creates a Date type */
+ Date(options?: DateOptions): TDate;
+ /** `Standard` Creates a enum type */
+ Enum>(item: T, options?: SchemaOptions): TEnum;
+ /** `Extended` Creates a function type */
+ Function, U extends TSchema>(parameters: T, returns: U, options?: SchemaOptions): TFunction, U>;
+ /** `Extended` Creates a function type */
+ Function(parameters: [...T], returns: U, options?: SchemaOptions): TFunction;
+ /** `Extended` Creates a type from this constructors instance type */
+ InstanceType>(schema: T, options?: SchemaOptions): TInstanceType;
+ /** `Standard` Creates a integer type */
+ Integer(options?: NumericOptions): TInteger;
+ /** `Standard` Creates a intersect type. */
+ Intersect(objects: [...T], options?: ObjectOptions): TIntersect;
+ /** `Standard` Creates a keyof type */
+ KeyOf(object: T, options?: SchemaOptions): TKeyOf;
+ /** `Standard` Creates a literal type. */
+ Literal(value: T, options?: SchemaOptions): TLiteral;
+ /** `Standard` Creates a never type */
+ Never(options?: SchemaOptions): TNever;
+ /** `Standard` Creates a null type */
+ Null(options?: SchemaOptions): TNull;
+ /** `Standard` Creates a number type */
+ Number(options?: NumericOptions): TNumber;
+ /** `Standard` Creates an object type */
+ Object(properties: T, options?: ObjectOptions): TObject;
+ /** `Standard` Creates a new object type whose keys are omitted from the given source type */
+ Omit[]>>(schema: T, keys: K, options?: ObjectOptions): TOmit>;
+ /** `Standard` Creates a new object type whose keys are omitted from the given source type */
+ Omit[]>(schema: T, keys: readonly [...K], options?: ObjectOptions): TOmit;
+ /** `Extended` Creates a tuple type from this functions parameters */
+ Parameters>(schema: T, options?: SchemaOptions): TParameters;
+ /** `Standard` Creates an object type whose properties are all optional */
+ Partial(schema: T, options?: ObjectOptions): TPartial;
+ /** `Standard` Creates a new object type whose keys are picked from the given source type */
+ Pick[]>>(schema: T, keys: K, options?: ObjectOptions): TPick>;
+ /** `Standard` Creates a new object type whose keys are picked from the given source type */
+ Pick[]>(schema: T, keys: readonly [...K], options?: ObjectOptions): TPick;
+ /** `Extended` Creates a Promise type */
+ Promise(item: T, options?: SchemaOptions): TPromise;
+ /** `Standard` Creates an object whose properties are derived from the given string literal union. */
+ Record, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): TObject>;
+ /** `Standard` Creates a record type */
+ Record(key: K, schema: T, options?: ObjectOptions): TRecord;
+ /** `Standard` Creates recursive type */
+ Recursive(callback: (self: TSelf) => T, options?: SchemaOptions): TRecursive;
+ /** `Standard` Creates a reference type. The referenced type must contain a $id. */
+ Ref(schema: T, options?: SchemaOptions): TRef;
+ /** `Standard` Creates a string type from a regular expression */
+ RegEx(regex: RegExp, options?: SchemaOptions): TString;
+ /** `Standard` Creates an object type whose properties are all required */
+ Required(schema: T, options?: SchemaOptions): TRequired;
+ /** `Extended` Creates a type from this functions return type */
+ ReturnType>(schema: T, options?: SchemaOptions): TReturnType;
+ /** Removes Kind and Modifier symbol property keys from this schema */
+ Strict(schema: T): T;
+ /** `Standard` Creates a string type */
+ String(options?: StringOptions): TString;
+ /** `Standard` Creates a tuple type */
+ Tuple(items: [...T], options?: SchemaOptions): TTuple;
+ /** `Extended` Creates a undefined type */
+ Undefined(options?: SchemaOptions): TUndefined;
+ /** `Standard` Creates a union type */
+ Union(items: [], options?: SchemaOptions): TNever;
+ /** `Standard` Creates a union type */
+ Union(items: [...T], options?: SchemaOptions): TUnion;
+ /** `Extended` Creates a Uint8Array type */
+ Uint8Array(options?: Uint8ArrayOptions): TUint8Array;
+ /** `Standard` Creates an unknown type */
+ Unknown(options?: SchemaOptions): TUnknown;
+ /** `Standard` Creates a user defined schema that infers as type T */
+ Unsafe(options?: UnsafeOptions): TUnsafe;
+ /** `Extended` Creates a void type */
+ Void(options?: SchemaOptions): TVoid;
+ /** Use this function to return TSchema with static and params omitted */
+ protected Create(schema: Omit): T;
+ /** Clones the given value */
+ protected Clone(value: any): any;
+}
+/** JSON Schema Type Builder with Static Type Resolution for TypeScript */
+export declare const Type: TypeBuilder;
diff --git a/dist/esm/deps/deno.land/x/typebox@0.25.13/src/typebox.js b/dist/esm/deps/deno.land/x/typebox@0.25.13/src/typebox.js
new file mode 100644
index 00000000..5fb39c9a
--- /dev/null
+++ b/dist/esm/deps/deno.land/x/typebox@0.25.13/src/typebox.js
@@ -0,0 +1,384 @@
+/*--------------------------------------------------------------------------
+
+@sinclair/typebox
+
+The MIT License (MIT)
+
+Copyright (c) 2022 Haydn Paterson (sinclair)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+---------------------------------------------------------------------------*/
+// --------------------------------------------------------------------------
+// Symbols
+// --------------------------------------------------------------------------
+export const Kind = Symbol.for('TypeBox.Kind');
+export const Hint = Symbol.for('TypeBox.Hint');
+export const Modifier = Symbol.for('TypeBox.Modifier');
+// --------------------------------------------------------------------------
+// TypeBuilder
+// --------------------------------------------------------------------------
+let TypeOrdinal = 0;
+export class TypeBuilder {
+ // ----------------------------------------------------------------------
+ // Modifiers
+ // ----------------------------------------------------------------------
+ /** Creates a readonly optional property */
+ ReadonlyOptional(item) {
+ return { [Modifier]: 'ReadonlyOptional', ...item };
+ }
+ /** Creates a readonly property */
+ Readonly(item) {
+ return { [Modifier]: 'Readonly', ...item };
+ }
+ /** Creates a optional property */
+ Optional(item) {
+ return { [Modifier]: 'Optional', ...item };
+ }
+ // ----------------------------------------------------------------------
+ // Types
+ // ----------------------------------------------------------------------
+ /** `Standard` Creates a any type */
+ Any(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Any' });
+ }
+ /** `Standard` Creates a array type */
+ Array(items, options = {}) {
+ return this.Create({ ...options, [Kind]: 'Array', type: 'array', items });
+ }
+ /** `Standard` Creates a boolean type */
+ Boolean(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Boolean', type: 'boolean' });
+ }
+ /** `Extended` Creates a tuple type from this constructors parameters */
+ ConstructorParameters(schema, options = {}) {
+ return this.Tuple([...schema.parameters], { ...options });
+ }
+ /** `Extended` Creates a constructor type */
+ Constructor(parameters, returns, options = {}) {
+ if (parameters[Kind] === 'Tuple') {
+ const inner = parameters.items === undefined ? [] : parameters.items;
+ return this.Create({ ...options, [Kind]: 'Constructor', type: 'object', instanceOf: 'Constructor', parameters: inner, returns });
+ }
+ else if (globalThis.Array.isArray(parameters)) {
+ return this.Create({ ...options, [Kind]: 'Constructor', type: 'object', instanceOf: 'Constructor', parameters, returns });
+ }
+ else {
+ throw new Error('TypeBuilder.Constructor: Invalid parameters');
+ }
+ }
+ /** `Extended` Creates a Date type */
+ Date(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Date', type: 'object', instanceOf: 'Date' });
+ }
+ /** `Standard` Creates a enum type */
+ Enum(item, options = {}) {
+ const values = Object.keys(item)
+ .filter((key) => isNaN(key))
+ .map((key) => item[key]);
+ const anyOf = values.map((value) => (typeof value === 'string' ? { [Kind]: 'Literal', type: 'string', const: value } : { [Kind]: 'Literal', type: 'number', const: value }));
+ return this.Create({ ...options, [Kind]: 'Union', [Hint]: 'Enum', anyOf });
+ }
+ /** `Extended` Creates a function type */
+ Function(parameters, returns, options = {}) {
+ if (parameters[Kind] === 'Tuple') {
+ const inner = parameters.items === undefined ? [] : parameters.items;
+ return this.Create({ ...options, [Kind]: 'Function', type: 'object', instanceOf: 'Function', parameters: inner, returns });
+ }
+ else if (globalThis.Array.isArray(parameters)) {
+ return this.Create({ ...options, [Kind]: 'Function', type: 'object', instanceOf: 'Function', parameters, returns });
+ }
+ else {
+ throw new Error('TypeBuilder.Function: Invalid parameters');
+ }
+ }
+ /** `Extended` Creates a type from this constructors instance type */
+ InstanceType(schema, options = {}) {
+ return { ...options, ...this.Clone(schema.returns) };
+ }
+ /** `Standard` Creates a integer type */
+ Integer(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Integer', type: 'integer' });
+ }
+ /** `Standard` Creates a intersect type. */
+ Intersect(objects, options = {}) {
+ const isOptional = (schema) => (schema[Modifier] && schema[Modifier] === 'Optional') || schema[Modifier] === 'ReadonlyOptional';
+ const [required, optional] = [new Set(), new Set()];
+ for (const object of objects) {
+ for (const [key, schema] of Object.entries(object.properties)) {
+ if (isOptional(schema))
+ optional.add(key);
+ }
+ }
+ for (const object of objects) {
+ for (const key of Object.keys(object.properties)) {
+ if (!optional.has(key))
+ required.add(key);
+ }
+ }
+ const properties = {};
+ for (const object of objects) {
+ for (const [key, schema] of Object.entries(object.properties)) {
+ properties[key] = properties[key] === undefined ? schema : { [Kind]: 'Union', anyOf: [properties[key], { ...schema }] };
+ }
+ }
+ if (required.size > 0) {
+ return this.Create({ ...options, [Kind]: 'Object', type: 'object', properties, required: [...required] });
+ }
+ else {
+ return this.Create({ ...options, [Kind]: 'Object', type: 'object', properties });
+ }
+ }
+ /** `Standard` Creates a keyof type */
+ KeyOf(object, options = {}) {
+ const items = Object.keys(object.properties).map((key) => this.Create({ ...options, [Kind]: 'Literal', type: 'string', const: key }));
+ return this.Create({ ...options, [Kind]: 'Union', [Hint]: 'KeyOf', anyOf: items });
+ }
+ /** `Standard` Creates a literal type. */
+ Literal(value, options = {}) {
+ return this.Create({ ...options, [Kind]: 'Literal', const: value, type: typeof value });
+ }
+ /** `Standard` Creates a never type */
+ Never(options = {}) {
+ return this.Create({
+ ...options,
+ [Kind]: 'Never',
+ allOf: [
+ { type: 'boolean', const: false },
+ { type: 'boolean', const: true },
+ ],
+ });
+ }
+ /** `Standard` Creates a null type */
+ Null(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Null', type: 'null' });
+ }
+ /** `Standard` Creates a number type */
+ Number(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Number', type: 'number' });
+ }
+ /** `Standard` Creates an object type */
+ Object(properties, options = {}) {
+ const property_names = Object.keys(properties);
+ const optional = property_names.filter((name) => {
+ const property = properties[name];
+ const modifier = property[Modifier];
+ return modifier && (modifier === 'Optional' || modifier === 'ReadonlyOptional');
+ });
+ const required = property_names.filter((name) => !optional.includes(name));
+ if (required.length > 0) {
+ return this.Create({ ...options, [Kind]: 'Object', type: 'object', properties, required });
+ }
+ else {
+ return this.Create({ ...options, [Kind]: 'Object', type: 'object', properties });
+ }
+ }
+ /** `Standard` Creates a new object type whose keys are omitted from the given source type */
+ Omit(schema, keys, options = {}) {
+ const select = keys[Kind] === 'Union' ? keys.anyOf.map((schema) => schema.const) : keys;
+ const next = { ...this.Clone(schema), ...options, [Hint]: 'Omit' };
+ if (next.required) {
+ next.required = next.required.filter((key) => !select.includes(key));
+ if (next.required.length === 0)
+ delete next.required;
+ }
+ for (const key of Object.keys(next.properties)) {
+ if (select.includes(key))
+ delete next.properties[key];
+ }
+ return this.Create(next);
+ }
+ /** `Extended` Creates a tuple type from this functions parameters */
+ Parameters(schema, options = {}) {
+ return Type.Tuple(schema.parameters, { ...options });
+ }
+ /** `Standard` Creates an object type whose properties are all optional */
+ Partial(schema, options = {}) {
+ const next = { ...this.Clone(schema), ...options, [Hint]: 'Partial' };
+ delete next.required;
+ for (const key of Object.keys(next.properties)) {
+ const property = next.properties[key];
+ const modifer = property[Modifier];
+ switch (modifer) {
+ case 'ReadonlyOptional':
+ property[Modifier] = 'ReadonlyOptional';
+ break;
+ case 'Readonly':
+ property[Modifier] = 'ReadonlyOptional';
+ break;
+ case 'Optional':
+ property[Modifier] = 'Optional';
+ break;
+ default:
+ property[Modifier] = 'Optional';
+ break;
+ }
+ }
+ return this.Create(next);
+ }
+ /** `Standard` Creates a new object type whose keys are picked from the given source type */
+ Pick(schema, keys, options = {}) {
+ const select = keys[Kind] === 'Union' ? keys.anyOf.map((schema) => schema.const) : keys;
+ const next = { ...this.Clone(schema), ...options, [Hint]: 'Pick' };
+ if (next.required) {
+ next.required = next.required.filter((key) => select.includes(key));
+ if (next.required.length === 0)
+ delete next.required;
+ }
+ for (const key of Object.keys(next.properties)) {
+ if (!select.includes(key))
+ delete next.properties[key];
+ }
+ return this.Create(next);
+ }
+ /** `Extended` Creates a Promise type */
+ Promise(item, options = {}) {
+ return this.Create({ ...options, [Kind]: 'Promise', type: 'object', instanceOf: 'Promise', item });
+ }
+ /** `Standard` Creates a record type */
+ Record(key, value, options = {}) {
+ // If string literal union return TObject with properties extracted from union.
+ if (key[Kind] === 'Union') {
+ return this.Object(key.anyOf.reduce((acc, literal) => {
+ return { ...acc, [literal.const]: value };
+ }, {}), { ...options, [Hint]: 'Record' });
+ }
+ // otherwise return TRecord with patternProperties
+ const pattern = ['Integer', 'Number'].includes(key[Kind]) ? '^(0|[1-9][0-9]*)$' : key[Kind] === 'String' && key.pattern ? key.pattern : '^.*$';
+ return this.Create({
+ ...options,
+ [Kind]: 'Record',
+ type: 'object',
+ patternProperties: { [pattern]: value },
+ additionalProperties: false,
+ });
+ }
+ /** `Standard` Creates recursive type */
+ Recursive(callback, options = {}) {
+ if (options.$id === undefined)
+ options.$id = `T${TypeOrdinal++}`;
+ const self = callback({ [Kind]: 'Self', $ref: `${options.$id}` });
+ self.$id = options.$id;
+ return this.Create({ ...options, ...self });
+ }
+ /** `Standard` Creates a reference type. The referenced type must contain a $id. */
+ Ref(schema, options = {}) {
+ if (schema.$id === undefined)
+ throw Error('TypeBuilder.Ref: Referenced schema must specify an $id');
+ return this.Create({ ...options, [Kind]: 'Ref', $ref: schema.$id });
+ }
+ /** `Standard` Creates a string type from a regular expression */
+ RegEx(regex, options = {}) {
+ return this.Create({ ...options, [Kind]: 'String', type: 'string', pattern: regex.source });
+ }
+ /** `Standard` Creates an object type whose properties are all required */
+ Required(schema, options = {}) {
+ const next = { ...this.Clone(schema), ...options, [Hint]: 'Required' };
+ next.required = Object.keys(next.properties);
+ for (const key of Object.keys(next.properties)) {
+ const property = next.properties[key];
+ const modifier = property[Modifier];
+ switch (modifier) {
+ case 'ReadonlyOptional':
+ property[Modifier] = 'Readonly';
+ break;
+ case 'Readonly':
+ property[Modifier] = 'Readonly';
+ break;
+ case 'Optional':
+ delete property[Modifier];
+ break;
+ default:
+ delete property[Modifier];
+ break;
+ }
+ }
+ return this.Create(next);
+ }
+ /** `Extended` Creates a type from this functions return type */
+ ReturnType(schema, options = {}) {
+ return { ...options, ...this.Clone(schema.returns) };
+ }
+ /** Removes Kind and Modifier symbol property keys from this schema */
+ Strict(schema) {
+ return JSON.parse(JSON.stringify(schema));
+ }
+ /** `Standard` Creates a string type */
+ String(options = {}) {
+ return this.Create({ ...options, [Kind]: 'String', type: 'string' });
+ }
+ /** `Standard` Creates a tuple type */
+ Tuple(items, options = {}) {
+ const additionalItems = false;
+ const minItems = items.length;
+ const maxItems = items.length;
+ const schema = (items.length > 0 ? { ...options, [Kind]: 'Tuple', type: 'array', items, additionalItems, minItems, maxItems } : { ...options, [Kind]: 'Tuple', type: 'array', minItems, maxItems });
+ return this.Create(schema);
+ }
+ /** `Extended` Creates a undefined type */
+ Undefined(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Undefined', type: 'null', typeOf: 'Undefined' });
+ }
+ /** `Standard` Creates a union type */
+ Union(items, options = {}) {
+ return items.length === 0 ? Type.Never({ ...options }) : this.Create({ ...options, [Kind]: 'Union', anyOf: items });
+ }
+ /** `Extended` Creates a Uint8Array type */
+ Uint8Array(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Uint8Array', type: 'object', instanceOf: 'Uint8Array' });
+ }
+ /** `Standard` Creates an unknown type */
+ Unknown(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Unknown' });
+ }
+ /** `Standard` Creates a user defined schema that infers as type T */
+ Unsafe(options = {}) {
+ return this.Create({ ...options, [Kind]: options[Kind] || 'Unsafe' });
+ }
+ /** `Extended` Creates a void type */
+ Void(options = {}) {
+ return this.Create({ ...options, [Kind]: 'Void', type: 'null', typeOf: 'Void' });
+ }
+ /** Use this function to return TSchema with static and params omitted */
+ Create(schema) {
+ return schema;
+ }
+ /** Clones the given value */
+ Clone(value) {
+ const isObject = (object) => typeof object === 'object' && object !== null && !Array.isArray(object);
+ const isArray = (object) => typeof object === 'object' && object !== null && Array.isArray(object);
+ if (isObject(value)) {
+ return Object.keys(value).reduce((acc, key) => ({
+ ...acc,
+ [key]: this.Clone(value[key]),
+ }), Object.getOwnPropertySymbols(value).reduce((acc, key) => ({
+ ...acc,
+ [key]: this.Clone(value[key]),
+ }), {}));
+ }
+ else if (isArray(value)) {
+ return value.map((item) => this.Clone(item));
+ }
+ else {
+ return value;
+ }
+ }
+}
+/** JSON Schema Type Builder with Static Type Resolution for TypeScript */
+export const Type = new TypeBuilder();
diff --git a/dist/esm/mod.d.ts b/dist/esm/mod.d.ts
new file mode 100644
index 00000000..16c0ba89
--- /dev/null
+++ b/dist/esm/mod.d.ts
@@ -0,0 +1,2 @@
+import "./_dnt.polyfills.js";
+export * from "./src/mod.js";
diff --git a/dist/esm/mod.js b/dist/esm/mod.js
new file mode 100644
index 00000000..16c0ba89
--- /dev/null
+++ b/dist/esm/mod.js
@@ -0,0 +1,2 @@
+import "./_dnt.polyfills.js";
+export * from "./src/mod.js";
diff --git a/dist/esm/package.d.ts b/dist/esm/package.d.ts
new file mode 100644
index 00000000..94e176d0
--- /dev/null
+++ b/dist/esm/package.d.ts
@@ -0,0 +1,9 @@
+declare namespace _default {
+ let name: string;
+ let version: string;
+ let license: string;
+ let author: string;
+ let description: string;
+ let repository: string;
+}
+export default _default;
diff --git a/dist/esm/package.js b/dist/esm/package.js
new file mode 100644
index 00000000..7b93f4ad
--- /dev/null
+++ b/dist/esm/package.js
@@ -0,0 +1,8 @@
+export default {
+ "name": "lucid-cardano",
+ "version": "0.10.10",
+ "license": "MIT",
+ "author": "Alessandro Konrad",
+ "description": "Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript, Deno and Node.js.",
+ "repository": "https://github.com/spacebudz/lucid"
+};
diff --git a/dist/esm/package.json b/dist/esm/package.json
new file mode 100644
index 00000000..3dbc1ca5
--- /dev/null
+++ b/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "module"
+}
diff --git a/dist/esm/src/core/core.d.ts b/dist/esm/src/core/core.d.ts
new file mode 100644
index 00000000..7ea09656
--- /dev/null
+++ b/dist/esm/src/core/core.d.ts
@@ -0,0 +1,3 @@
+import * as C from "./libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.js";
+import * as M from "./libs/cardano_message_signing/cardano_message_signing.generated.js";
+export { C, M };
diff --git a/dist/esm/src/core/core.js b/dist/esm/src/core/core.js
new file mode 100644
index 00000000..a3e7ae28
--- /dev/null
+++ b/dist/esm/src/core/core.js
@@ -0,0 +1,60 @@
+const isNode = globalThis?.process?.versions?.node;
+if (isNode) {
+ if (typeof btoa === 'undefined') {globalThis.btoa = function (str) {return Buffer.from(str, 'binary').toString('base64');}; globalThis.atob = function (b64Encoded) {return Buffer.from(b64Encoded, 'base64').toString('binary');};}
+ const fetch = /* #__PURE__ */ await import(/* webpackIgnore: true */ "node-fetch");
+ const { Crypto } = /* #__PURE__ */ await import(/* webpackIgnore: true */ "@peculiar/webcrypto");
+ const { WebSocket } = /* #__PURE__ */ await import(/* webpackIgnore: true */ "ws");
+ const fs = /* #__PURE__ */ await import(/* webpackIgnore: true */ "fs");
+ if (!globalThis.WebSocket) globalThis.WebSocket = WebSocket;
+ if (!globalThis.crypto) globalThis.crypto = new Crypto();
+ if (!globalThis.fetch) globalThis.fetch = fetch.default;
+ if (!globalThis.Headers) globalThis.Headers = fetch.Headers;
+ if (!globalThis.Request) globalThis.Request = fetch.Request;
+ if (!globalThis.Response) globalThis.Response = fetch.Response;
+ if (!globalThis.fs) globalThis.fs = fs;
+}
+
+const C = await (async () => {
+ try {
+ if (isNode) {
+ return await import(
+ /* webpackIgnore: true */ "./libs/cardano_multiplatform_lib/nodejs/cardano_multiplatform_lib.generated.js"
+ );
+ }
+ return await import(
+ "./libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.js"
+ );
+ } catch (_e) {
+ // This only ever happens during SSR rendering
+ return null;
+ }
+})();
+const M = await (async () => {
+ try {
+ if (isNode) {
+ return await import(
+ /* webpackIgnore: true */ "./libs/cardano_message_signing/nodejs/cardano_message_signing.generated.js"
+ );
+ }
+ return await import(
+ "./libs/cardano_message_signing/cardano_message_signing.generated.js"
+ );
+ } catch (_e) {
+ // This only ever happens during SSR rendering
+ return null;
+ }
+})();
+if (!isNode) {
+ async function unsafeInstantiate(module) {
+ try {
+ await module.instantiate();
+ } catch (_e) {
+ // This only ever happens during SSR rendering
+ }
+ }
+ await Promise.all([
+ unsafeInstantiate(C),
+ unsafeInstantiate(M),
+ ]);
+}
+export { C, M };
diff --git a/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing.generated.d.ts b/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing.generated.d.ts
new file mode 100644
index 00000000..07a0d7d1
--- /dev/null
+++ b/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing.generated.d.ts
@@ -0,0 +1,1416 @@
+/**
+ * Decompression callback
+ *
+ * @callback DecompressCallback
+ * @param {Uint8Array} compressed
+ * @return {Uint8Array} decompressed
+ */
+/**
+ * Options for instantiating a Wasm instance.
+ * @typedef {Object} InstantiateOptions
+ * @property {URL=} url - Optional url to the Wasm file to instantiate.
+ * @property {DecompressCallback=} decompress - Callback to decompress the
+ * raw Wasm file bytes before instantiating.
+ */
+/** Instantiates an instance of the Wasm module returning its functions.
+ * @remarks It is safe to call this multiple times and once successfully
+ * loaded it will always return a reference to the same object.
+ * @param {InstantiateOptions=} opts
+ */
+export function instantiate(opts?: InstantiateOptions | undefined): Promise<{
+ BigNum: typeof BigNum;
+ CBORArray: typeof CBORArray;
+ CBORObject: typeof CBORObject;
+ CBORSpecial: typeof CBORSpecial;
+ CBORValue: typeof CBORValue;
+ COSEEncrypt: typeof COSEEncrypt;
+ COSEEncrypt0: typeof COSEEncrypt0;
+ COSEKey: typeof COSEKey;
+ COSERecipient: typeof COSERecipient;
+ COSERecipients: typeof COSERecipients;
+ COSESign: typeof COSESign;
+ COSESign1: typeof COSESign1;
+ COSESign1Builder: typeof COSESign1Builder;
+ COSESignBuilder: typeof COSESignBuilder;
+ COSESignature: typeof COSESignature;
+ COSESignatures: typeof COSESignatures;
+ CounterSignature: typeof CounterSignature;
+ EdDSA25519Key: typeof EdDSA25519Key;
+ HeaderMap: typeof HeaderMap;
+ Headers: typeof Headers;
+ Int: typeof Int;
+ Label: typeof Label;
+ Labels: typeof Labels;
+ PasswordEncryption: typeof PasswordEncryption;
+ ProtectedHeaderMap: typeof ProtectedHeaderMap;
+ PubKeyEncryption: typeof PubKeyEncryption;
+ SigStructure: typeof SigStructure;
+ SignedMessage: typeof SignedMessage;
+ TaggedCBOR: typeof TaggedCBOR;
+}>;
+/** Instantiates an instance of the Wasm module along with its exports.
+ * @remarks It is safe to call this multiple times and once successfully
+ * loaded it will always return a reference to the same object.
+ * @param {InstantiateOptions=} opts
+ * @returns {Promise<{
+ * instance: WebAssembly.Instance;
+ * exports: { BigNum : typeof BigNum ; CBORArray : typeof CBORArray ; CBORObject : typeof CBORObject ; CBORSpecial : typeof CBORSpecial ; CBORValue : typeof CBORValue ; COSEEncrypt : typeof COSEEncrypt ; COSEEncrypt0 : typeof COSEEncrypt0 ; COSEKey : typeof COSEKey ; COSERecipient : typeof COSERecipient ; COSERecipients : typeof COSERecipients ; COSESign : typeof COSESign ; COSESign1 : typeof COSESign1 ; COSESign1Builder : typeof COSESign1Builder ; COSESignBuilder : typeof COSESignBuilder ; COSESignature : typeof COSESignature ; COSESignatures : typeof COSESignatures ; CounterSignature : typeof CounterSignature ; EdDSA25519Key : typeof EdDSA25519Key ; HeaderMap : typeof HeaderMap ; Headers : typeof Headers ; Int : typeof Int ; Label : typeof Label ; Labels : typeof Labels ; PasswordEncryption : typeof PasswordEncryption ; ProtectedHeaderMap : typeof ProtectedHeaderMap ; PubKeyEncryption : typeof PubKeyEncryption ; SigStructure : typeof SigStructure ; SignedMessage : typeof SignedMessage ; TaggedCBOR : typeof TaggedCBOR }
+ * }>}
+ */
+export function instantiateWithInstance(opts?: InstantiateOptions | undefined): Promise<{
+ instance: WebAssembly.Instance;
+ exports: {
+ BigNum: typeof BigNum;
+ CBORArray: typeof CBORArray;
+ CBORObject: typeof CBORObject;
+ CBORSpecial: typeof CBORSpecial;
+ CBORValue: typeof CBORValue;
+ COSEEncrypt: typeof COSEEncrypt;
+ COSEEncrypt0: typeof COSEEncrypt0;
+ COSEKey: typeof COSEKey;
+ COSERecipient: typeof COSERecipient;
+ COSERecipients: typeof COSERecipients;
+ COSESign: typeof COSESign;
+ COSESign1: typeof COSESign1;
+ COSESign1Builder: typeof COSESign1Builder;
+ COSESignBuilder: typeof COSESignBuilder;
+ COSESignature: typeof COSESignature;
+ COSESignatures: typeof COSESignatures;
+ CounterSignature: typeof CounterSignature;
+ EdDSA25519Key: typeof EdDSA25519Key;
+ HeaderMap: typeof HeaderMap;
+ Headers: typeof Headers;
+ Int: typeof Int;
+ Label: typeof Label;
+ Labels: typeof Labels;
+ PasswordEncryption: typeof PasswordEncryption;
+ ProtectedHeaderMap: typeof ProtectedHeaderMap;
+ PubKeyEncryption: typeof PubKeyEncryption;
+ SigStructure: typeof SigStructure;
+ SignedMessage: typeof SignedMessage;
+ TaggedCBOR: typeof TaggedCBOR;
+ };
+}>;
+/** Gets if the Wasm module has been instantiated. */
+export function isInstantiated(): boolean;
+/** */
+export const AlgorithmId: Readonly<{
+ /**
+ * r" EdDSA (Pure EdDSA, not HashedEdDSA) - the algorithm used for Cardano addresses
+ */
+ EdDSA: 0;
+ "0": "EdDSA";
+ /**
+ * r" ChaCha20/Poly1305 w/ 256-bit key, 128-bit tag
+ */
+ ChaCha20Poly1305: 1;
+ "1": "ChaCha20Poly1305";
+}>;
+/** */
+export const KeyType: Readonly<{
+ /**
+ * r" octet key pair
+ */
+ OKP: 0;
+ "0": "OKP";
+ /**
+ * r" 2-coord EC
+ */
+ EC2: 1;
+ "1": "EC2";
+ Symmetric: 2;
+ "2": "Symmetric";
+}>;
+/** */
+export const ECKey: Readonly<{
+ CRV: 0;
+ "0": "CRV";
+ X: 1;
+ "1": "X";
+ Y: 2;
+ "2": "Y";
+ D: 3;
+ "3": "D";
+}>;
+/** */
+export const CurveType: Readonly<{
+ P256: 0;
+ "0": "P256";
+ P384: 1;
+ "1": "P384";
+ P521: 2;
+ "2": "P521";
+ X25519: 3;
+ "3": "X25519";
+ X448: 4;
+ "4": "X448";
+ Ed25519: 5;
+ "5": "Ed25519";
+ Ed448: 6;
+ "6": "Ed448";
+}>;
+/** */
+export const KeyOperation: Readonly<{
+ Sign: 0;
+ "0": "Sign";
+ Verify: 1;
+ "1": "Verify";
+ Encrypt: 2;
+ "2": "Encrypt";
+ Decrypt: 3;
+ "3": "Decrypt";
+ WrapKey: 4;
+ "4": "WrapKey";
+ UnwrapKey: 5;
+ "5": "UnwrapKey";
+ DeriveKey: 6;
+ "6": "DeriveKey";
+ DeriveBits: 7;
+ "7": "DeriveBits";
+}>;
+/** */
+export const CBORSpecialType: Readonly<{
+ Bool: 0;
+ "0": "Bool";
+ Float: 1;
+ "1": "Float";
+ Unassigned: 2;
+ "2": "Unassigned";
+ Break: 3;
+ "3": "Break";
+ Undefined: 4;
+ "4": "Undefined";
+ Null: 5;
+ "5": "Null";
+}>;
+/** */
+export const CBORValueKind: Readonly<{
+ Int: 0;
+ "0": "Int";
+ Bytes: 1;
+ "1": "Bytes";
+ Text: 2;
+ "2": "Text";
+ Array: 3;
+ "3": "Array";
+ Object: 4;
+ "4": "Object";
+ TaggedCBOR: 5;
+ "5": "TaggedCBOR";
+ Special: 6;
+ "6": "Special";
+}>;
+/** */
+export const LabelKind: Readonly<{
+ Int: 0;
+ "0": "Int";
+ Text: 1;
+ "1": "Text";
+}>;
+/** */
+export const SignedMessageKind: Readonly<{
+ COSESIGN: 0;
+ "0": "COSESIGN";
+ COSESIGN1: 1;
+ "1": "COSESIGN1";
+}>;
+/** */
+export const SigContext: Readonly<{
+ Signature: 0;
+ "0": "Signature";
+ Signature1: 1;
+ "1": "Signature1";
+ CounterSignature: 2;
+ "2": "CounterSignature";
+}>;
+/** */
+export class BigNum {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {BigNum}
+ */
+ static from_bytes(bytes: Uint8Array): BigNum;
+ /**
+ * @param {string} string
+ * @returns {BigNum}
+ */
+ static from_str(string: string): BigNum;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_str(): string;
+ /**
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ checked_mul(other: BigNum): BigNum;
+ /**
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ checked_add(other: BigNum): BigNum;
+ /**
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ checked_sub(other: BigNum): BigNum;
+}
+/** */
+export class CBORArray {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORArray}
+ */
+ static from_bytes(bytes: Uint8Array): CBORArray;
+ /**
+ * @returns {CBORArray}
+ */
+ static new(): CBORArray;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {CBORValue}
+ */
+ get(index: number): CBORValue;
+ /**
+ * @param {CBORValue} elem
+ */
+ add(elem: CBORValue): void;
+ /**
+ * @param {boolean} use_definite
+ */
+ set_definite_encoding(use_definite: boolean): void;
+ /**
+ * @returns {boolean}
+ */
+ is_definite(): boolean;
+}
+/** */
+export class CBORObject {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORObject}
+ */
+ static from_bytes(bytes: Uint8Array): CBORObject;
+ /**
+ * @returns {CBORObject}
+ */
+ static new(): CBORObject;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {CBORValue} key
+ * @param {CBORValue} value
+ * @returns {CBORValue | undefined}
+ */
+ insert(key: CBORValue, value: CBORValue): CBORValue | undefined;
+ /**
+ * @param {CBORValue} key
+ * @returns {CBORValue | undefined}
+ */
+ get(key: CBORValue): CBORValue | undefined;
+ /**
+ * @returns {CBORArray}
+ */
+ keys(): CBORArray;
+ /**
+ * @param {boolean} use_definite
+ */
+ set_definite_encoding(use_definite: boolean): void;
+ /**
+ * @returns {boolean}
+ */
+ is_definite(): boolean;
+}
+/** */
+export class CBORSpecial {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORSpecial}
+ */
+ static from_bytes(bytes: Uint8Array): CBORSpecial;
+ /**
+ * @param {boolean} b
+ * @returns {CBORSpecial}
+ */
+ static new_bool(b: boolean): CBORSpecial;
+ /**
+ * @param {number} u
+ * @returns {CBORSpecial}
+ */
+ static new_unassigned(u: number): CBORSpecial;
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_break(): CBORSpecial;
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_null(): CBORSpecial;
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_undefined(): CBORSpecial;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {boolean | undefined}
+ */
+ as_bool(): boolean | undefined;
+ /**
+ * @returns {number | undefined}
+ */
+ as_float(): number | undefined;
+ /**
+ * @returns {number | undefined}
+ */
+ as_unassigned(): number | undefined;
+}
+/** */
+export class CBORValue {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORValue}
+ */
+ static from_bytes(bytes: Uint8Array): CBORValue;
+ /**
+ * @param {Int} int
+ * @returns {CBORValue}
+ */
+ static new_int(int: Int): CBORValue;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORValue}
+ */
+ static new_bytes(bytes: Uint8Array): CBORValue;
+ /**
+ * @param {string} text
+ * @returns {CBORValue}
+ */
+ static new_text(text: string): CBORValue;
+ /**
+ * @param {CBORArray} arr
+ * @returns {CBORValue}
+ */
+ static new_array(arr: CBORArray): CBORValue;
+ /**
+ * @param {CBORObject} obj
+ * @returns {CBORValue}
+ */
+ static new_object(obj: CBORObject): CBORValue;
+ /**
+ * @param {TaggedCBOR} tagged
+ * @returns {CBORValue}
+ */
+ static new_tagged(tagged: TaggedCBOR): CBORValue;
+ /**
+ * @param {CBORSpecial} special
+ * @returns {CBORValue}
+ */
+ static new_special(special: CBORSpecial): CBORValue;
+ /**
+ * @param {Label} label
+ * @returns {CBORValue}
+ */
+ static from_label(label: Label): CBORValue;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int(): Int | undefined;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ as_bytes(): Uint8Array | undefined;
+ /**
+ * @returns {string | undefined}
+ */
+ as_text(): string | undefined;
+ /**
+ * @returns {CBORArray | undefined}
+ */
+ as_array(): CBORArray | undefined;
+ /**
+ * @returns {CBORObject | undefined}
+ */
+ as_object(): CBORObject | undefined;
+ /**
+ * @returns {TaggedCBOR | undefined}
+ */
+ as_tagged(): TaggedCBOR | undefined;
+ /**
+ * @returns {CBORSpecial | undefined}
+ */
+ as_special(): CBORSpecial | undefined;
+}
+/** */
+export class COSEEncrypt {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEEncrypt}
+ */
+ static from_bytes(bytes: Uint8Array): COSEEncrypt;
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @param {COSERecipients} recipients
+ * @returns {COSEEncrypt}
+ */
+ static new(headers: Headers, ciphertext: Uint8Array | undefined, recipients: COSERecipients): COSEEncrypt;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {Headers}
+ */
+ headers(): Headers;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext(): Uint8Array | undefined;
+ /**
+ * @returns {COSERecipients}
+ */
+ recipients(): COSERecipients;
+}
+/** */
+export class COSEEncrypt0 {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEEncrypt0}
+ */
+ static from_bytes(bytes: Uint8Array): COSEEncrypt0;
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @returns {COSEEncrypt0}
+ */
+ static new(headers: Headers, ciphertext: Uint8Array | undefined): COSEEncrypt0;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {Headers}
+ */
+ headers(): Headers;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext(): Uint8Array | undefined;
+}
+/** */
+export class COSEKey {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEKey}
+ */
+ static from_bytes(bytes: Uint8Array): COSEKey;
+ /**
+ * @param {Label} key_type
+ * @returns {COSEKey}
+ */
+ static new(key_type: Label): COSEKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {Label} key_type
+ */
+ set_key_type(key_type: Label): void;
+ /**
+ * @returns {Label}
+ */
+ key_type(): Label;
+ /**
+ * @param {Uint8Array} key_id
+ */
+ set_key_id(key_id: Uint8Array): void;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ key_id(): Uint8Array | undefined;
+ /**
+ * @param {Label} algorithm_id
+ */
+ set_algorithm_id(algorithm_id: Label): void;
+ /**
+ * @returns {Label | undefined}
+ */
+ algorithm_id(): Label | undefined;
+ /**
+ * @param {Labels} key_ops
+ */
+ set_key_ops(key_ops: Labels): void;
+ /**
+ * @returns {Labels | undefined}
+ */
+ key_ops(): Labels | undefined;
+ /**
+ * @param {Uint8Array} base_init_vector
+ */
+ set_base_init_vector(base_init_vector: Uint8Array): void;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ base_init_vector(): Uint8Array | undefined;
+ /**
+ * @param {Label} label
+ * @returns {CBORValue | undefined}
+ */
+ header(label: Label): CBORValue | undefined;
+ /**
+ * @param {Label} label
+ * @param {CBORValue} value
+ */
+ set_header(label: Label, value: CBORValue): void;
+}
+/** */
+export class COSERecipient {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSERecipient}
+ */
+ static from_bytes(bytes: Uint8Array): COSERecipient;
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @returns {COSERecipient}
+ */
+ static new(headers: Headers, ciphertext: Uint8Array | undefined): COSERecipient;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {Headers}
+ */
+ headers(): Headers;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext(): Uint8Array | undefined;
+}
+/** */
+export class COSERecipients {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSERecipients}
+ */
+ static from_bytes(bytes: Uint8Array): COSERecipients;
+ /**
+ * @returns {COSERecipients}
+ */
+ static new(): COSERecipients;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {COSERecipient}
+ */
+ get(index: number): COSERecipient;
+ /**
+ * @param {COSERecipient} elem
+ */
+ add(elem: COSERecipient): void;
+}
+/** */
+export class COSESign {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESign}
+ */
+ static from_bytes(bytes: Uint8Array): COSESign;
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} payload
+ * @param {COSESignatures} signatures
+ * @returns {COSESign}
+ */
+ static new(headers: Headers, payload: Uint8Array | undefined, signatures: COSESignatures): COSESign;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {Headers}
+ */
+ headers(): Headers;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ payload(): Uint8Array | undefined;
+ /**
+ * @returns {COSESignatures}
+ */
+ signatures(): COSESignatures;
+}
+/** */
+export class COSESign1 {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESign1}
+ */
+ static from_bytes(bytes: Uint8Array): COSESign1;
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} payload
+ * @param {Uint8Array} signature
+ * @returns {COSESign1}
+ */
+ static new(headers: Headers, payload: Uint8Array | undefined, signature: Uint8Array): COSESign1;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {Headers}
+ */
+ headers(): Headers;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ payload(): Uint8Array | undefined;
+ /**
+ * @returns {Uint8Array}
+ */
+ signature(): Uint8Array;
+ /**
+ * For verifying, we will want to reverse-construct this SigStructure to check the signature against
+ * # Arguments
+ * * `external_aad` - External application data - see RFC 8152 section 4.3. Set to None if not using this.
+ * @param {Uint8Array | undefined} external_aad
+ * @param {Uint8Array | undefined} external_payload
+ * @returns {SigStructure}
+ */
+ signed_data(external_aad: Uint8Array | undefined, external_payload: Uint8Array | undefined): SigStructure;
+}
+/** */
+export class COSESign1Builder {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} payload
+ * @param {boolean} is_payload_external
+ * @returns {COSESign1Builder}
+ */
+ static new(headers: Headers, payload: Uint8Array, is_payload_external: boolean): COSESign1Builder;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /** */
+ hash_payload(): void;
+ /**
+ * @param {Uint8Array} external_aad
+ */
+ set_external_aad(external_aad: Uint8Array): void;
+ /**
+ * @returns {SigStructure}
+ */
+ make_data_to_sign(): SigStructure;
+ /**
+ * @param {Uint8Array} signed_sig_structure
+ * @returns {COSESign1}
+ */
+ build(signed_sig_structure: Uint8Array): COSESign1;
+}
+/** */
+export class COSESignBuilder {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} payload
+ * @param {boolean} is_payload_external
+ * @returns {COSESignBuilder}
+ */
+ static new(headers: Headers, payload: Uint8Array, is_payload_external: boolean): COSESignBuilder;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /** */
+ hash_payload(): void;
+ /**
+ * @param {Uint8Array} external_aad
+ */
+ set_external_aad(external_aad: Uint8Array): void;
+ /**
+ * @returns {SigStructure}
+ */
+ make_data_to_sign(): SigStructure;
+ /**
+ * @param {COSESignatures} signed_sig_structure
+ * @returns {COSESign}
+ */
+ build(signed_sig_structure: COSESignatures): COSESign;
+}
+/** */
+export class COSESignature {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESignature}
+ */
+ static from_bytes(bytes: Uint8Array): COSESignature;
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} signature
+ * @returns {COSESignature}
+ */
+ static new(headers: Headers, signature: Uint8Array): COSESignature;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {Headers}
+ */
+ headers(): Headers;
+ /**
+ * @returns {Uint8Array}
+ */
+ signature(): Uint8Array;
+}
+/** */
+export class COSESignatures {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESignatures}
+ */
+ static from_bytes(bytes: Uint8Array): COSESignatures;
+ /**
+ * @returns {COSESignatures}
+ */
+ static new(): COSESignatures;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {COSESignature}
+ */
+ get(index: number): COSESignature;
+ /**
+ * @param {COSESignature} elem
+ */
+ add(elem: COSESignature): void;
+}
+/** */
+export class CounterSignature {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CounterSignature}
+ */
+ static from_bytes(bytes: Uint8Array): CounterSignature;
+ /**
+ * @param {COSESignature} cose_signature
+ * @returns {CounterSignature}
+ */
+ static new_single(cose_signature: COSESignature): CounterSignature;
+ /**
+ * @param {COSESignatures} cose_signatures
+ * @returns {CounterSignature}
+ */
+ static new_multi(cose_signatures: COSESignatures): CounterSignature;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {COSESignatures}
+ */
+ signatures(): COSESignatures;
+}
+/** */
+export class EdDSA25519Key {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} pubkey_bytes
+ * @returns {EdDSA25519Key}
+ */
+ static new(pubkey_bytes: Uint8Array): EdDSA25519Key;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @param {Uint8Array} private_key_bytes
+ */
+ set_private_key(private_key_bytes: Uint8Array): void;
+ /** */
+ is_for_signing(): void;
+ /** */
+ is_for_verifying(): void;
+ /**
+ * @returns {COSEKey}
+ */
+ build(): COSEKey;
+}
+/** */
+export class HeaderMap {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {HeaderMap}
+ */
+ static from_bytes(bytes: Uint8Array): HeaderMap;
+ /**
+ * @returns {HeaderMap}
+ */
+ static new(): HeaderMap;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {Label} algorithm_id
+ */
+ set_algorithm_id(algorithm_id: Label): void;
+ /**
+ * @returns {Label | undefined}
+ */
+ algorithm_id(): Label | undefined;
+ /**
+ * @param {Labels} criticality
+ */
+ set_criticality(criticality: Labels): void;
+ /**
+ * @returns {Labels | undefined}
+ */
+ criticality(): Labels | undefined;
+ /**
+ * @param {Label} content_type
+ */
+ set_content_type(content_type: Label): void;
+ /**
+ * @returns {Label | undefined}
+ */
+ content_type(): Label | undefined;
+ /**
+ * @param {Uint8Array} key_id
+ */
+ set_key_id(key_id: Uint8Array): void;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ key_id(): Uint8Array | undefined;
+ /**
+ * @param {Uint8Array} init_vector
+ */
+ set_init_vector(init_vector: Uint8Array): void;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ init_vector(): Uint8Array | undefined;
+ /**
+ * @param {Uint8Array} partial_init_vector
+ */
+ set_partial_init_vector(partial_init_vector: Uint8Array): void;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ partial_init_vector(): Uint8Array | undefined;
+ /**
+ * @param {CounterSignature} counter_signature
+ */
+ set_counter_signature(counter_signature: CounterSignature): void;
+ /**
+ * @returns {CounterSignature | undefined}
+ */
+ counter_signature(): CounterSignature | undefined;
+ /**
+ * @param {Label} label
+ * @returns {CBORValue | undefined}
+ */
+ header(label: Label): CBORValue | undefined;
+ /**
+ * @param {Label} label
+ * @param {CBORValue} value
+ */
+ set_header(label: Label, value: CBORValue): void;
+ /**
+ * @returns {Labels}
+ */
+ keys(): Labels;
+}
+/** */
+export class Headers {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Headers}
+ */
+ static from_bytes(bytes: Uint8Array): Headers;
+ /**
+ * @param {ProtectedHeaderMap} protected_
+ * @param {HeaderMap} unprotected_
+ * @returns {Headers}
+ */
+ static new(protected_: ProtectedHeaderMap, unprotected_: HeaderMap): Headers;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ protected(): ProtectedHeaderMap;
+ /**
+ * @returns {HeaderMap}
+ */
+ unprotected(): HeaderMap;
+}
+/** */
+export class Int {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new(x: BigNum): Int;
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new_negative(x: BigNum): Int;
+ /**
+ * @param {number} x
+ * @returns {Int}
+ */
+ static new_i32(x: number): Int;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {boolean}
+ */
+ is_positive(): boolean;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_positive(): BigNum | undefined;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_negative(): BigNum | undefined;
+ /**
+ * @returns {number | undefined}
+ */
+ as_i32(): number | undefined;
+}
+/** */
+export class Label {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Label}
+ */
+ static from_bytes(bytes: Uint8Array): Label;
+ /**
+ * @param {Int} int
+ * @returns {Label}
+ */
+ static new_int(int: Int): Label;
+ /**
+ * @param {string} text
+ * @returns {Label}
+ */
+ static new_text(text: string): Label;
+ /**
+ * @param {number} id
+ * @returns {Label}
+ */
+ static from_algorithm_id(id: number): Label;
+ /**
+ * @param {number} key_type
+ * @returns {Label}
+ */
+ static from_key_type(key_type: number): Label;
+ /**
+ * @param {number} ec_key
+ * @returns {Label}
+ */
+ static from_ec_key(ec_key: number): Label;
+ /**
+ * @param {number} curve_type
+ * @returns {Label}
+ */
+ static from_curve_type(curve_type: number): Label;
+ /**
+ * @param {number} key_op
+ * @returns {Label}
+ */
+ static from_key_operation(key_op: number): Label;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int(): Int | undefined;
+ /**
+ * @returns {string | undefined}
+ */
+ as_text(): string | undefined;
+}
+/** */
+export class Labels {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Labels}
+ */
+ static from_bytes(bytes: Uint8Array): Labels;
+ /**
+ * @returns {Labels}
+ */
+ static new(): Labels;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {Label}
+ */
+ get(index: number): Label;
+ /**
+ * @param {Label} elem
+ */
+ add(elem: Label): void;
+}
+/** */
+export class PasswordEncryption {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PasswordEncryption}
+ */
+ static from_bytes(bytes: Uint8Array): PasswordEncryption;
+ /**
+ * @param {COSEEncrypt0} data
+ * @returns {PasswordEncryption}
+ */
+ static new(data: COSEEncrypt0): PasswordEncryption;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+}
+/** */
+export class ProtectedHeaderMap {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProtectedHeaderMap}
+ */
+ static from_bytes(bytes: Uint8Array): ProtectedHeaderMap;
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ static new_empty(): ProtectedHeaderMap;
+ /**
+ * @param {HeaderMap} header_map
+ * @returns {ProtectedHeaderMap}
+ */
+ static new(header_map: HeaderMap): ProtectedHeaderMap;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {HeaderMap}
+ */
+ deserialized_headers(): HeaderMap;
+}
+/** */
+export class PubKeyEncryption {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PubKeyEncryption}
+ */
+ static from_bytes(bytes: Uint8Array): PubKeyEncryption;
+ /**
+ * @param {COSEEncrypt} data
+ * @returns {PubKeyEncryption}
+ */
+ static new(data: COSEEncrypt): PubKeyEncryption;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+}
+/** */
+export class SigStructure {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {SigStructure}
+ */
+ static from_bytes(bytes: Uint8Array): SigStructure;
+ /**
+ * @param {number} context
+ * @param {ProtectedHeaderMap} body_protected
+ * @param {Uint8Array} external_aad
+ * @param {Uint8Array} payload
+ * @returns {SigStructure}
+ */
+ static new(context: number, body_protected: ProtectedHeaderMap, external_aad: Uint8Array, payload: Uint8Array): SigStructure;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ context(): number;
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ body_protected(): ProtectedHeaderMap;
+ /**
+ * @returns {ProtectedHeaderMap | undefined}
+ */
+ sign_protected(): ProtectedHeaderMap | undefined;
+ /**
+ * @returns {Uint8Array}
+ */
+ external_aad(): Uint8Array;
+ /**
+ * @returns {Uint8Array}
+ */
+ payload(): Uint8Array;
+ /**
+ * @param {ProtectedHeaderMap} sign_protected
+ */
+ set_sign_protected(sign_protected: ProtectedHeaderMap): void;
+}
+/** */
+export class SignedMessage {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {SignedMessage}
+ */
+ static from_bytes(bytes: Uint8Array): SignedMessage;
+ /**
+ * @param {COSESign} cose_sign
+ * @returns {SignedMessage}
+ */
+ static new_cose_sign(cose_sign: COSESign): SignedMessage;
+ /**
+ * @param {COSESign1} cose_sign1
+ * @returns {SignedMessage}
+ */
+ static new_cose_sign1(cose_sign1: COSESign1): SignedMessage;
+ /**
+ * @param {string} s
+ * @returns {SignedMessage}
+ */
+ static from_user_facing_encoding(s: string): SignedMessage;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_user_facing_encoding(): string;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {COSESign | undefined}
+ */
+ as_cose_sign(): COSESign | undefined;
+ /**
+ * @returns {COSESign1 | undefined}
+ */
+ as_cose_sign1(): COSESign1 | undefined;
+}
+/** */
+export class TaggedCBOR {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TaggedCBOR}
+ */
+ static from_bytes(bytes: Uint8Array): TaggedCBOR;
+ /**
+ * @param {BigNum} tag
+ * @param {CBORValue} value
+ * @returns {TaggedCBOR}
+ */
+ static new(tag: BigNum, value: CBORValue): TaggedCBOR;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {BigNum}
+ */
+ tag(): BigNum;
+ /**
+ * @returns {CBORValue}
+ */
+ value(): CBORValue;
+}
+/**
+ * Decompression callback
+ */
+export type DecompressCallback = (compressed: Uint8Array) => Uint8Array;
+/**
+ * Options for instantiating a Wasm instance.
+ */
+export type InstantiateOptions = {
+ /**
+ * - Optional url to the Wasm file to instantiate.
+ */
+ url?: URL | undefined;
+ /**
+ * - Callback to decompress the
+ * raw Wasm file bytes before instantiating.
+ */
+ decompress?: DecompressCallback | undefined;
+};
diff --git a/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing.generated.js b/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing.generated.js
new file mode 100644
index 00000000..1ee2c363
--- /dev/null
+++ b/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing.generated.js
@@ -0,0 +1,3720 @@
+// @generated file from wasmbuild -- do not edit
+// deno-lint-ignore-file
+// deno-fmt-ignore-file
+// source-hash: ccea9a27c8aee355bc2051725d859ee0a31dcb77
+let wasm;
+const heap = new Array(128).fill(undefined);
+heap.push(undefined, null, true, false);
+function getObject(idx) {
+ return heap[idx];
+}
+let heap_next = heap.length;
+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;
+}
+const 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) {
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
+}
+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 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;
+}
+let WASM_VECTOR_LEN = 0;
+const cachedTextEncoder = new TextEncoder("utf-8");
+const encodeString = function (arg, view) {
+ return cachedTextEncoder.encodeInto(arg, view);
+};
+function passStringToWasm0(arg, malloc, realloc) {
+ if (realloc === undefined) {
+ const buf = cachedTextEncoder.encode(arg);
+ const ptr = malloc(buf.length);
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
+ WASM_VECTOR_LEN = buf.length;
+ return ptr;
+ }
+ let len = arg.length;
+ let ptr = malloc(len);
+ 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);
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
+ const ret = encodeString(arg, view);
+ offset += ret.written;
+ }
+ WASM_VECTOR_LEN = offset;
+ return ptr;
+}
+let cachedInt32Memory0 = null;
+function getInt32Memory0() {
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
+ }
+ return cachedInt32Memory0;
+}
+function _assertClass(instance, klass) {
+ if (!(instance instanceof klass)) {
+ throw new Error(`expected instance of ${klass.name}`);
+ }
+ return instance.ptr;
+}
+function passArray8ToWasm0(arg, malloc) {
+ const ptr = malloc(arg.length * 1);
+ getUint8Memory0().set(arg, ptr / 1);
+ WASM_VECTOR_LEN = arg.length;
+ return ptr;
+}
+function getArrayU8FromWasm0(ptr, len) {
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
+}
+let cachedFloat64Memory0 = null;
+function getFloat64Memory0() {
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
+ }
+ return cachedFloat64Memory0;
+}
+function isLikeNone(x) {
+ return x === undefined || x === null;
+}
+/** */
+export const AlgorithmId = Object.freeze({
+ /**
+ * r" EdDSA (Pure EdDSA, not HashedEdDSA) - the algorithm used for Cardano addresses
+ */
+ EdDSA: 0,
+ "0": "EdDSA",
+ /**
+ * r" ChaCha20/Poly1305 w/ 256-bit key, 128-bit tag
+ */
+ ChaCha20Poly1305: 1,
+ "1": "ChaCha20Poly1305",
+});
+/** */
+export const KeyType = Object.freeze({
+ /**
+ * r" octet key pair
+ */
+ OKP: 0,
+ "0": "OKP",
+ /**
+ * r" 2-coord EC
+ */
+ EC2: 1,
+ "1": "EC2",
+ Symmetric: 2,
+ "2": "Symmetric",
+});
+/** */
+export const ECKey = Object.freeze({
+ CRV: 0,
+ "0": "CRV",
+ X: 1,
+ "1": "X",
+ Y: 2,
+ "2": "Y",
+ D: 3,
+ "3": "D",
+});
+/** */
+export const CurveType = Object.freeze({
+ P256: 0,
+ "0": "P256",
+ P384: 1,
+ "1": "P384",
+ P521: 2,
+ "2": "P521",
+ X25519: 3,
+ "3": "X25519",
+ X448: 4,
+ "4": "X448",
+ Ed25519: 5,
+ "5": "Ed25519",
+ Ed448: 6,
+ "6": "Ed448",
+});
+/** */
+export const KeyOperation = Object.freeze({
+ Sign: 0,
+ "0": "Sign",
+ Verify: 1,
+ "1": "Verify",
+ Encrypt: 2,
+ "2": "Encrypt",
+ Decrypt: 3,
+ "3": "Decrypt",
+ WrapKey: 4,
+ "4": "WrapKey",
+ UnwrapKey: 5,
+ "5": "UnwrapKey",
+ DeriveKey: 6,
+ "6": "DeriveKey",
+ DeriveBits: 7,
+ "7": "DeriveBits",
+});
+/** */
+export const CBORSpecialType = Object.freeze({
+ Bool: 0,
+ "0": "Bool",
+ Float: 1,
+ "1": "Float",
+ Unassigned: 2,
+ "2": "Unassigned",
+ Break: 3,
+ "3": "Break",
+ Undefined: 4,
+ "4": "Undefined",
+ Null: 5,
+ "5": "Null",
+});
+/** */
+export const CBORValueKind = Object.freeze({
+ Int: 0,
+ "0": "Int",
+ Bytes: 1,
+ "1": "Bytes",
+ Text: 2,
+ "2": "Text",
+ Array: 3,
+ "3": "Array",
+ Object: 4,
+ "4": "Object",
+ TaggedCBOR: 5,
+ "5": "TaggedCBOR",
+ Special: 6,
+ "6": "Special",
+});
+/** */
+export const LabelKind = Object.freeze({
+ Int: 0,
+ "0": "Int",
+ Text: 1,
+ "1": "Text",
+});
+/** */
+export const SignedMessageKind = Object.freeze({
+ COSESIGN: 0,
+ "0": "COSESIGN",
+ COSESIGN1: 1,
+ "1": "COSESIGN1",
+});
+/** */
+export const SigContext = Object.freeze({
+ Signature: 0,
+ "0": "Signature",
+ Signature1: 1,
+ "1": "Signature1",
+ CounterSignature: 2,
+ "2": "CounterSignature",
+});
+const BigNumFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_bignum_free(ptr));
+/** */
+export class BigNum {
+ static __wrap(ptr) {
+ const obj = Object.create(BigNum.prototype);
+ obj.ptr = ptr;
+ BigNumFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bignum_to_str(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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.ptr, other.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.ptr, other.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.ptr, other.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);
+ }
+ }
+}
+const CBORArrayFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cborarray_free(ptr));
+/** */
+export class CBORArray {
+ static __wrap(ptr) {
+ const obj = Object.create(CBORArray.prototype);
+ obj.ptr = ptr;
+ CBORArrayFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CBORArrayFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cborarray_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborarray_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORArray}
+ */
+ 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.cborarray_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 CBORArray.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {CBORArray}
+ */
+ static new() {
+ const ret = wasm.cborarray_new();
+ return CBORArray.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborarray_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {CBORValue}
+ */
+ get(index) {
+ const ret = wasm.cborarray_get(this.ptr, index);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORValue} elem
+ */
+ add(elem) {
+ _assertClass(elem, CBORValue);
+ wasm.cborarray_add(this.ptr, elem.ptr);
+ }
+ /**
+ * @param {boolean} use_definite
+ */
+ set_definite_encoding(use_definite) {
+ wasm.cborarray_set_definite_encoding(this.ptr, use_definite);
+ }
+ /**
+ * @returns {boolean}
+ */
+ is_definite() {
+ const ret = wasm.cborarray_is_definite(this.ptr);
+ return ret !== 0;
+ }
+}
+const CBORObjectFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cborobject_free(ptr));
+/** */
+export class CBORObject {
+ static __wrap(ptr) {
+ const obj = Object.create(CBORObject.prototype);
+ obj.ptr = ptr;
+ CBORObjectFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CBORObjectFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cborobject_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborobject_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORObject}
+ */
+ 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.cborobject_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 CBORObject.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {CBORObject}
+ */
+ static new() {
+ const ret = wasm.cborobject_new();
+ return CBORObject.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborobject_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {CBORValue} key
+ * @param {CBORValue} value
+ * @returns {CBORValue | undefined}
+ */
+ insert(key, value) {
+ _assertClass(key, CBORValue);
+ _assertClass(value, CBORValue);
+ const ret = wasm.cborobject_insert(this.ptr, key.ptr, value.ptr);
+ return ret === 0 ? undefined : CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORValue} key
+ * @returns {CBORValue | undefined}
+ */
+ get(key) {
+ _assertClass(key, CBORValue);
+ const ret = wasm.cborobject_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : CBORValue.__wrap(ret);
+ }
+ /**
+ * @returns {CBORArray}
+ */
+ keys() {
+ const ret = wasm.cborobject_keys(this.ptr);
+ return CBORArray.__wrap(ret);
+ }
+ /**
+ * @param {boolean} use_definite
+ */
+ set_definite_encoding(use_definite) {
+ wasm.cborobject_set_definite_encoding(this.ptr, use_definite);
+ }
+ /**
+ * @returns {boolean}
+ */
+ is_definite() {
+ const ret = wasm.cborobject_is_definite(this.ptr);
+ return ret !== 0;
+ }
+}
+const CBORSpecialFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cborspecial_free(ptr));
+/** */
+export class CBORSpecial {
+ static __wrap(ptr) {
+ const obj = Object.create(CBORSpecial.prototype);
+ obj.ptr = ptr;
+ CBORSpecialFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CBORSpecialFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cborspecial_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborspecial_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORSpecial}
+ */
+ 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.cborspecial_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 CBORSpecial.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {boolean} b
+ * @returns {CBORSpecial}
+ */
+ static new_bool(b) {
+ const ret = wasm.cborspecial_new_bool(b);
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @param {number} u
+ * @returns {CBORSpecial}
+ */
+ static new_unassigned(u) {
+ const ret = wasm.cborspecial_new_unassigned(u);
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_break() {
+ const ret = wasm.cborspecial_new_break();
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_null() {
+ const ret = wasm.cborspecial_new_null();
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_undefined() {
+ const ret = wasm.cborspecial_new_undefined();
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.cborspecial_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {boolean | undefined}
+ */
+ as_bool() {
+ const ret = wasm.cborspecial_as_bool(this.ptr);
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ as_float() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborspecial_as_float(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
+ return r0 === 0 ? undefined : r2;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ as_unassigned() {
+ const ret = wasm.cborspecial_as_unassigned(this.ptr);
+ return ret === 0xFFFFFF ? undefined : ret;
+ }
+}
+const CBORValueFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cborvalue_free(ptr));
+/** */
+export class CBORValue {
+ static __wrap(ptr) {
+ const obj = Object.create(CBORValue.prototype);
+ obj.ptr = ptr;
+ CBORValueFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CBORValueFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cborvalue_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborvalue_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORValue}
+ */
+ 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.cborvalue_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 CBORValue.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Int} int
+ * @returns {CBORValue}
+ */
+ static new_int(int) {
+ _assertClass(int, Int);
+ const ret = wasm.cborvalue_new_int(int.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORValue}
+ */
+ static new_bytes(bytes) {
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cborvalue_new_bytes(ptr0, len0);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {string} text
+ * @returns {CBORValue}
+ */
+ static new_text(text) {
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cborvalue_new_text(ptr0, len0);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORArray} arr
+ * @returns {CBORValue}
+ */
+ static new_array(arr) {
+ _assertClass(arr, CBORArray);
+ const ret = wasm.cborvalue_new_array(arr.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORObject} obj
+ * @returns {CBORValue}
+ */
+ static new_object(obj) {
+ _assertClass(obj, CBORObject);
+ const ret = wasm.cborvalue_new_object(obj.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {TaggedCBOR} tagged
+ * @returns {CBORValue}
+ */
+ static new_tagged(tagged) {
+ _assertClass(tagged, TaggedCBOR);
+ const ret = wasm.cborvalue_new_tagged(tagged.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORSpecial} special
+ * @returns {CBORValue}
+ */
+ static new_special(special) {
+ _assertClass(special, CBORSpecial);
+ const ret = wasm.cborvalue_new_special(special.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {Label} label
+ * @returns {CBORValue}
+ */
+ static from_label(label) {
+ _assertClass(label, Label);
+ const ret = wasm.cborvalue_from_label(label.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.cborvalue_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int() {
+ const ret = wasm.cborvalue_as_int(this.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ as_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborvalue_as_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string | undefined}
+ */
+ as_text() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborvalue_as_text(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getStringFromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {CBORArray | undefined}
+ */
+ as_array() {
+ const ret = wasm.cborvalue_as_array(this.ptr);
+ return ret === 0 ? undefined : CBORArray.__wrap(ret);
+ }
+ /**
+ * @returns {CBORObject | undefined}
+ */
+ as_object() {
+ const ret = wasm.cborvalue_as_object(this.ptr);
+ return ret === 0 ? undefined : CBORObject.__wrap(ret);
+ }
+ /**
+ * @returns {TaggedCBOR | undefined}
+ */
+ as_tagged() {
+ const ret = wasm.cborvalue_as_tagged(this.ptr);
+ return ret === 0 ? undefined : TaggedCBOR.__wrap(ret);
+ }
+ /**
+ * @returns {CBORSpecial | undefined}
+ */
+ as_special() {
+ const ret = wasm.cborvalue_as_special(this.ptr);
+ return ret === 0 ? undefined : CBORSpecial.__wrap(ret);
+ }
+}
+const COSEEncryptFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_coseencrypt_free(ptr));
+/** */
+export class COSEEncrypt {
+ static __wrap(ptr) {
+ const obj = Object.create(COSEEncrypt.prototype);
+ obj.ptr = ptr;
+ COSEEncryptFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSEEncryptFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coseencrypt_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEEncrypt}
+ */
+ 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.coseencrypt_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 COSEEncrypt.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {COSERecipients}
+ */
+ recipients() {
+ const ret = wasm.coseencrypt_recipients(this.ptr);
+ return COSERecipients.__wrap(ret);
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @param {COSERecipients} recipients
+ * @returns {COSEEncrypt}
+ */
+ static new(headers, ciphertext, recipients) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(ciphertext)
+ ? 0
+ : passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ _assertClass(recipients, COSERecipients);
+ const ret = wasm.coseencrypt_new(headers.ptr, ptr0, len0, recipients.ptr);
+ return COSEEncrypt.__wrap(ret);
+ }
+}
+const COSEEncrypt0Finalization = new FinalizationRegistry((ptr) => wasm.__wbg_coseencrypt0_free(ptr));
+/** */
+export class COSEEncrypt0 {
+ static __wrap(ptr) {
+ const obj = Object.create(COSEEncrypt0.prototype);
+ obj.ptr = ptr;
+ COSEEncrypt0Finalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSEEncrypt0Finalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coseencrypt0_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt0_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEEncrypt0}
+ */
+ 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.coseencrypt0_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 COSEEncrypt0.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt0_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @returns {COSEEncrypt0}
+ */
+ static new(headers, ciphertext) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(ciphertext)
+ ? 0
+ : passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coseencrypt0_new(headers.ptr, ptr0, len0);
+ return COSEEncrypt0.__wrap(ret);
+ }
+}
+const COSEKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cosekey_free(ptr));
+/** */
+export class COSEKey {
+ static __wrap(ptr) {
+ const obj = Object.create(COSEKey.prototype);
+ obj.ptr = ptr;
+ COSEKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSEKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosekey_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosekey_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEKey}
+ */
+ 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.cosekey_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 COSEKey.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Label} key_type
+ */
+ set_key_type(key_type) {
+ _assertClass(key_type, Label);
+ wasm.cosekey_set_key_type(this.ptr, key_type.ptr);
+ }
+ /**
+ * @returns {Label}
+ */
+ key_type() {
+ const ret = wasm.cosekey_key_type(this.ptr);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} key_id
+ */
+ set_key_id(key_id) {
+ const ptr0 = passArray8ToWasm0(key_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosekey_set_key_id(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ key_id() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosekey_key_id(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Label} algorithm_id
+ */
+ set_algorithm_id(algorithm_id) {
+ _assertClass(algorithm_id, Label);
+ wasm.cosekey_set_algorithm_id(this.ptr, algorithm_id.ptr);
+ }
+ /**
+ * @returns {Label | undefined}
+ */
+ algorithm_id() {
+ const ret = wasm.cosekey_algorithm_id(this.ptr);
+ return ret === 0 ? undefined : Label.__wrap(ret);
+ }
+ /**
+ * @param {Labels} key_ops
+ */
+ set_key_ops(key_ops) {
+ _assertClass(key_ops, Labels);
+ wasm.cosekey_set_key_ops(this.ptr, key_ops.ptr);
+ }
+ /**
+ * @returns {Labels | undefined}
+ */
+ key_ops() {
+ const ret = wasm.cosekey_key_ops(this.ptr);
+ return ret === 0 ? undefined : Labels.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} base_init_vector
+ */
+ set_base_init_vector(base_init_vector) {
+ const ptr0 = passArray8ToWasm0(base_init_vector, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosekey_set_base_init_vector(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ base_init_vector() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosekey_base_init_vector(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Label} label
+ * @returns {CBORValue | undefined}
+ */
+ header(label) {
+ _assertClass(label, Label);
+ const ret = wasm.cosekey_header(this.ptr, label.ptr);
+ return ret === 0 ? undefined : CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {Label} label
+ * @param {CBORValue} value
+ */
+ set_header(label, value) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(label, Label);
+ _assertClass(value, CBORValue);
+ wasm.cosekey_set_header(retptr, this.ptr, label.ptr, value.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 {Label} key_type
+ * @returns {COSEKey}
+ */
+ static new(key_type) {
+ _assertClass(key_type, Label);
+ const ret = wasm.cosekey_new(key_type.ptr);
+ return COSEKey.__wrap(ret);
+ }
+}
+const COSERecipientFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_coserecipient_free(ptr));
+/** */
+export class COSERecipient {
+ static __wrap(ptr) {
+ const obj = Object.create(COSERecipient.prototype);
+ obj.ptr = ptr;
+ COSERecipientFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSERecipientFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coserecipient_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coserecipient_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSERecipient}
+ */
+ 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.coserecipient_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 COSERecipient.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt0_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @returns {COSERecipient}
+ */
+ static new(headers, ciphertext) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(ciphertext)
+ ? 0
+ : passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coseencrypt0_new(headers.ptr, ptr0, len0);
+ return COSERecipient.__wrap(ret);
+ }
+}
+const COSERecipientsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_coserecipients_free(ptr));
+/** */
+export class COSERecipients {
+ static __wrap(ptr) {
+ const obj = Object.create(COSERecipients.prototype);
+ obj.ptr = ptr;
+ COSERecipientsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSERecipientsFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coserecipients_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coserecipients_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSERecipients}
+ */
+ 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.coserecipients_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 COSERecipients.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {COSERecipients}
+ */
+ static new() {
+ const ret = wasm.coserecipients_new();
+ return COSERecipients.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborarray_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {COSERecipient}
+ */
+ get(index) {
+ const ret = wasm.coserecipients_get(this.ptr, index);
+ return COSERecipient.__wrap(ret);
+ }
+ /**
+ * @param {COSERecipient} elem
+ */
+ add(elem) {
+ _assertClass(elem, COSERecipient);
+ wasm.coserecipients_add(this.ptr, elem.ptr);
+ }
+}
+const COSESignFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cosesign_free(ptr));
+/** */
+export class COSESign {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESign.prototype);
+ obj.ptr = ptr;
+ COSESignFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESignFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesign_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesign_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESign}
+ */
+ 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.cosesign_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 COSESign.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ payload() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {COSESignatures}
+ */
+ signatures() {
+ const ret = wasm.cosesign_signatures(this.ptr);
+ return COSESignatures.__wrap(ret);
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} payload
+ * @param {COSESignatures} signatures
+ * @returns {COSESign}
+ */
+ static new(headers, payload, signatures) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(payload)
+ ? 0
+ : passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ _assertClass(signatures, COSESignatures);
+ const ret = wasm.cosesign_new(headers.ptr, ptr0, len0, signatures.ptr);
+ return COSESign.__wrap(ret);
+ }
+}
+const COSESign1Finalization = new FinalizationRegistry((ptr) => wasm.__wbg_cosesign1_free(ptr));
+/** */
+export class COSESign1 {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESign1.prototype);
+ obj.ptr = ptr;
+ COSESign1Finalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESign1Finalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesign1_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesign1_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESign1}
+ */
+ 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.cosesign1_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 COSESign1.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ payload() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ signature() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesign1_signature(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * For verifying, we will want to reverse-construct this SigStructure to check the signature against
+ * # Arguments
+ * * `external_aad` - External application data - see RFC 8152 section 4.3. Set to None if not using this.
+ * @param {Uint8Array | undefined} external_aad
+ * @param {Uint8Array | undefined} external_payload
+ * @returns {SigStructure}
+ */
+ signed_data(external_aad, external_payload) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ var ptr0 = isLikeNone(external_aad)
+ ? 0
+ : passArray8ToWasm0(external_aad, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ var ptr1 = isLikeNone(external_payload)
+ ? 0
+ : passArray8ToWasm0(external_payload, wasm.__wbindgen_malloc);
+ var len1 = WASM_VECTOR_LEN;
+ wasm.cosesign1_signed_data(retptr, this.ptr, 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 SigStructure.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} payload
+ * @param {Uint8Array} signature
+ * @returns {COSESign1}
+ */
+ static new(headers, payload, signature) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(payload)
+ ? 0
+ : passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesign1_new(headers.ptr, ptr0, len0, ptr1, len1);
+ return COSESign1.__wrap(ret);
+ }
+}
+const COSESign1BuilderFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cosesign1builder_free(ptr));
+/** */
+export class COSESign1Builder {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESign1Builder.prototype);
+ obj.ptr = ptr;
+ COSESign1BuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESign1BuilderFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesign1builder_free(ptr);
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} payload
+ * @param {boolean} is_payload_external
+ * @returns {COSESign1Builder}
+ */
+ static new(headers, payload, is_payload_external) {
+ _assertClass(headers, Headers);
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesign1builder_new(headers.ptr, ptr0, len0, is_payload_external);
+ return COSESign1Builder.__wrap(ret);
+ }
+ /** */
+ hash_payload() {
+ wasm.cosesign1builder_hash_payload(this.ptr);
+ }
+ /**
+ * @param {Uint8Array} external_aad
+ */
+ set_external_aad(external_aad) {
+ const ptr0 = passArray8ToWasm0(external_aad, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosesign1builder_set_external_aad(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {SigStructure}
+ */
+ make_data_to_sign() {
+ const ret = wasm.cosesign1builder_make_data_to_sign(this.ptr);
+ return SigStructure.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} signed_sig_structure
+ * @returns {COSESign1}
+ */
+ build(signed_sig_structure) {
+ const ptr0 = passArray8ToWasm0(signed_sig_structure, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesign1builder_build(this.ptr, ptr0, len0);
+ return COSESign1.__wrap(ret);
+ }
+}
+const COSESignBuilderFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cosesignbuilder_free(ptr));
+/** */
+export class COSESignBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESignBuilder.prototype);
+ obj.ptr = ptr;
+ COSESignBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESignBuilderFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesignbuilder_free(ptr);
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} payload
+ * @param {boolean} is_payload_external
+ * @returns {COSESignBuilder}
+ */
+ static new(headers, payload, is_payload_external) {
+ _assertClass(headers, Headers);
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesignbuilder_new(headers.ptr, ptr0, len0, is_payload_external);
+ return COSESignBuilder.__wrap(ret);
+ }
+ /** */
+ hash_payload() {
+ wasm.cosesign1builder_hash_payload(this.ptr);
+ }
+ /**
+ * @param {Uint8Array} external_aad
+ */
+ set_external_aad(external_aad) {
+ const ptr0 = passArray8ToWasm0(external_aad, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosesign1builder_set_external_aad(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {SigStructure}
+ */
+ make_data_to_sign() {
+ const ret = wasm.cosesignbuilder_make_data_to_sign(this.ptr);
+ return SigStructure.__wrap(ret);
+ }
+ /**
+ * @param {COSESignatures} signed_sig_structure
+ * @returns {COSESign}
+ */
+ build(signed_sig_structure) {
+ _assertClass(signed_sig_structure, COSESignatures);
+ const ret = wasm.cosesignbuilder_build(this.ptr, signed_sig_structure.ptr);
+ return COSESign.__wrap(ret);
+ }
+}
+const COSESignatureFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cosesignature_free(ptr));
+/** */
+export class COSESignature {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESignature.prototype);
+ obj.ptr = ptr;
+ COSESignatureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESignatureFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesignature_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesignature_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESignature}
+ */
+ 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.cosesignature_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 COSESignature.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ signature() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesign1_signature(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} signature
+ * @returns {COSESignature}
+ */
+ static new(headers, signature) {
+ _assertClass(headers, Headers);
+ const ptr0 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesignature_new(headers.ptr, ptr0, len0);
+ return COSESignature.__wrap(ret);
+ }
+}
+const COSESignaturesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_cosesignatures_free(ptr));
+/** */
+export class COSESignatures {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESignatures.prototype);
+ obj.ptr = ptr;
+ COSESignaturesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESignaturesFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesignatures_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesignatures_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESignatures}
+ */
+ 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.cosesignatures_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 COSESignatures.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {COSESignatures}
+ */
+ static new() {
+ const ret = wasm.coserecipients_new();
+ return COSESignatures.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborarray_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {COSESignature}
+ */
+ get(index) {
+ const ret = wasm.cosesignatures_get(this.ptr, index);
+ return COSESignature.__wrap(ret);
+ }
+ /**
+ * @param {COSESignature} elem
+ */
+ add(elem) {
+ _assertClass(elem, COSESignature);
+ wasm.cosesignatures_add(this.ptr, elem.ptr);
+ }
+}
+const CounterSignatureFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_countersignature_free(ptr));
+/** */
+export class CounterSignature {
+ static __wrap(ptr) {
+ const obj = Object.create(CounterSignature.prototype);
+ obj.ptr = ptr;
+ CounterSignatureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CounterSignatureFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_countersignature_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.countersignature_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CounterSignature}
+ */
+ 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.countersignature_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 CounterSignature.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {COSESignature} cose_signature
+ * @returns {CounterSignature}
+ */
+ static new_single(cose_signature) {
+ _assertClass(cose_signature, COSESignature);
+ const ret = wasm.countersignature_new_single(cose_signature.ptr);
+ return CounterSignature.__wrap(ret);
+ }
+ /**
+ * @param {COSESignatures} cose_signatures
+ * @returns {CounterSignature}
+ */
+ static new_multi(cose_signatures) {
+ _assertClass(cose_signatures, COSESignatures);
+ const ret = wasm.countersignature_new_multi(cose_signatures.ptr);
+ return CounterSignature.__wrap(ret);
+ }
+ /**
+ * @returns {COSESignatures}
+ */
+ signatures() {
+ const ret = wasm.countersignature_signatures(this.ptr);
+ return COSESignatures.__wrap(ret);
+ }
+}
+const EdDSA25519KeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_eddsa25519key_free(ptr));
+/** */
+export class EdDSA25519Key {
+ static __wrap(ptr) {
+ const obj = Object.create(EdDSA25519Key.prototype);
+ obj.ptr = ptr;
+ EdDSA25519KeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ EdDSA25519KeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_eddsa25519key_free(ptr);
+ }
+ /**
+ * @param {Uint8Array} pubkey_bytes
+ * @returns {EdDSA25519Key}
+ */
+ static new(pubkey_bytes) {
+ const ptr0 = passArray8ToWasm0(pubkey_bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.eddsa25519key_new(ptr0, len0);
+ return EdDSA25519Key.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} private_key_bytes
+ */
+ set_private_key(private_key_bytes) {
+ const ptr0 = passArray8ToWasm0(private_key_bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.eddsa25519key_set_private_key(this.ptr, ptr0, len0);
+ }
+ /** */
+ is_for_signing() {
+ wasm.eddsa25519key_is_for_signing(this.ptr);
+ }
+ /** */
+ is_for_verifying() {
+ wasm.eddsa25519key_is_for_verifying(this.ptr);
+ }
+ /**
+ * @returns {COSEKey}
+ */
+ build() {
+ const ret = wasm.eddsa25519key_build(this.ptr);
+ return COSEKey.__wrap(ret);
+ }
+}
+const HeaderMapFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_headermap_free(ptr));
+/** */
+export class HeaderMap {
+ static __wrap(ptr) {
+ const obj = Object.create(HeaderMap.prototype);
+ obj.ptr = ptr;
+ HeaderMapFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ HeaderMapFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_headermap_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headermap_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {HeaderMap}
+ */
+ 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.headermap_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 HeaderMap.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Label} algorithm_id
+ */
+ set_algorithm_id(algorithm_id) {
+ _assertClass(algorithm_id, Label);
+ wasm.headermap_set_algorithm_id(this.ptr, algorithm_id.ptr);
+ }
+ /**
+ * @returns {Label | undefined}
+ */
+ algorithm_id() {
+ const ret = wasm.headermap_algorithm_id(this.ptr);
+ return ret === 0 ? undefined : Label.__wrap(ret);
+ }
+ /**
+ * @param {Labels} criticality
+ */
+ set_criticality(criticality) {
+ _assertClass(criticality, Labels);
+ wasm.headermap_set_criticality(this.ptr, criticality.ptr);
+ }
+ /**
+ * @returns {Labels | undefined}
+ */
+ criticality() {
+ const ret = wasm.headermap_criticality(this.ptr);
+ return ret === 0 ? undefined : Labels.__wrap(ret);
+ }
+ /**
+ * @param {Label} content_type
+ */
+ set_content_type(content_type) {
+ _assertClass(content_type, Label);
+ wasm.headermap_set_content_type(this.ptr, content_type.ptr);
+ }
+ /**
+ * @returns {Label | undefined}
+ */
+ content_type() {
+ const ret = wasm.headermap_content_type(this.ptr);
+ return ret === 0 ? undefined : Label.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} key_id
+ */
+ set_key_id(key_id) {
+ const ptr0 = passArray8ToWasm0(key_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.headermap_set_key_id(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ key_id() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headermap_key_id(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} init_vector
+ */
+ set_init_vector(init_vector) {
+ const ptr0 = passArray8ToWasm0(init_vector, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosekey_set_base_init_vector(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ init_vector() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosekey_base_init_vector(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} partial_init_vector
+ */
+ set_partial_init_vector(partial_init_vector) {
+ const ptr0 = passArray8ToWasm0(partial_init_vector, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.headermap_set_partial_init_vector(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ partial_init_vector() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headermap_partial_init_vector(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {CounterSignature} counter_signature
+ */
+ set_counter_signature(counter_signature) {
+ _assertClass(counter_signature, CounterSignature);
+ wasm.headermap_set_counter_signature(this.ptr, counter_signature.ptr);
+ }
+ /**
+ * @returns {CounterSignature | undefined}
+ */
+ counter_signature() {
+ const ret = wasm.headermap_counter_signature(this.ptr);
+ return ret === 0 ? undefined : CounterSignature.__wrap(ret);
+ }
+ /**
+ * @param {Label} label
+ * @returns {CBORValue | undefined}
+ */
+ header(label) {
+ _assertClass(label, Label);
+ const ret = wasm.headermap_header(this.ptr, label.ptr);
+ return ret === 0 ? undefined : CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {Label} label
+ * @param {CBORValue} value
+ */
+ set_header(label, value) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(label, Label);
+ _assertClass(value, CBORValue);
+ wasm.headermap_set_header(retptr, this.ptr, label.ptr, value.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 {Labels}
+ */
+ keys() {
+ const ret = wasm.headermap_keys(this.ptr);
+ return Labels.__wrap(ret);
+ }
+ /**
+ * @returns {HeaderMap}
+ */
+ static new() {
+ const ret = wasm.headermap_new();
+ return HeaderMap.__wrap(ret);
+ }
+}
+const HeadersFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_headers_free(ptr));
+/** */
+export class Headers {
+ static __wrap(ptr) {
+ const obj = Object.create(Headers.prototype);
+ obj.ptr = ptr;
+ HeadersFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ HeadersFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_headers_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headers_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Headers}
+ */
+ 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.headers_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 Headers.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ protected() {
+ const ret = wasm.headers_protected(this.ptr);
+ return ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @returns {HeaderMap}
+ */
+ unprotected() {
+ const ret = wasm.headers_unprotected(this.ptr);
+ return HeaderMap.__wrap(ret);
+ }
+ /**
+ * @param {ProtectedHeaderMap} protected_
+ * @param {HeaderMap} unprotected_
+ * @returns {Headers}
+ */
+ static new(protected_, unprotected_) {
+ _assertClass(protected_, ProtectedHeaderMap);
+ _assertClass(unprotected_, HeaderMap);
+ const ret = wasm.headers_new(protected_.ptr, unprotected_.ptr);
+ return Headers.__wrap(ret);
+ }
+}
+const IntFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_int_free(ptr));
+/** */
+export class Int {
+ static __wrap(ptr) {
+ const obj = Object.create(Int.prototype);
+ obj.ptr = ptr;
+ IntFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ IntFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_int_free(ptr);
+ }
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new(x) {
+ _assertClass(x, BigNum);
+ var ptr0 = x.__destroy_into_raw();
+ const ret = wasm.int_new(ptr0);
+ return Int.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new_negative(x) {
+ _assertClass(x, BigNum);
+ var ptr0 = x.__destroy_into_raw();
+ const ret = wasm.int_new_negative(ptr0);
+ 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.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_positive() {
+ const ret = wasm.int_as_positive(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_negative() {
+ const ret = wasm.int_as_negative(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ as_i32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.int_as_i32(retptr, this.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);
+ }
+ }
+}
+const LabelFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_label_free(ptr));
+/** */
+export class Label {
+ static __wrap(ptr) {
+ const obj = Object.create(Label.prototype);
+ obj.ptr = ptr;
+ LabelFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ LabelFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_label_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.label_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Label}
+ */
+ 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.label_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 Label.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Int} int
+ * @returns {Label}
+ */
+ static new_int(int) {
+ _assertClass(int, Int);
+ const ret = wasm.label_new_int(int.ptr);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {string} text
+ * @returns {Label}
+ */
+ static new_text(text) {
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.label_new_text(ptr0, len0);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.label_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int() {
+ const ret = wasm.label_as_int(this.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @returns {string | undefined}
+ */
+ as_text() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.label_as_text(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getStringFromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {number} id
+ * @returns {Label}
+ */
+ static from_algorithm_id(id) {
+ const ret = wasm.label_from_algorithm_id(id);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {number} key_type
+ * @returns {Label}
+ */
+ static from_key_type(key_type) {
+ const ret = wasm.label_from_key_type(key_type);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {number} ec_key
+ * @returns {Label}
+ */
+ static from_ec_key(ec_key) {
+ const ret = wasm.label_from_ec_key(ec_key);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {number} curve_type
+ * @returns {Label}
+ */
+ static from_curve_type(curve_type) {
+ const ret = wasm.label_from_curve_type(curve_type);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {number} key_op
+ * @returns {Label}
+ */
+ static from_key_operation(key_op) {
+ const ret = wasm.label_from_key_operation(key_op);
+ return Label.__wrap(ret);
+ }
+}
+const LabelsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_labels_free(ptr));
+/** */
+export class Labels {
+ static __wrap(ptr) {
+ const obj = Object.create(Labels.prototype);
+ obj.ptr = ptr;
+ LabelsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ LabelsFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_labels_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.labels_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Labels}
+ */
+ 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.labels_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 Labels.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Labels}
+ */
+ static new() {
+ const ret = wasm.coserecipients_new();
+ return Labels.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborarray_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Label}
+ */
+ get(index) {
+ const ret = wasm.labels_get(this.ptr, index);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {Label} elem
+ */
+ add(elem) {
+ _assertClass(elem, Label);
+ wasm.labels_add(this.ptr, elem.ptr);
+ }
+}
+const PasswordEncryptionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_passwordencryption_free(ptr));
+/** */
+export class PasswordEncryption {
+ static __wrap(ptr) {
+ const obj = Object.create(PasswordEncryption.prototype);
+ obj.ptr = ptr;
+ PasswordEncryptionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PasswordEncryptionFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_passwordencryption_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.passwordencryption_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PasswordEncryption}
+ */
+ 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.passwordencryption_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 PasswordEncryption.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {COSEEncrypt0} data
+ * @returns {PasswordEncryption}
+ */
+ static new(data) {
+ _assertClass(data, COSEEncrypt0);
+ const ret = wasm.passwordencryption_new(data.ptr);
+ return PasswordEncryption.__wrap(ret);
+ }
+}
+const ProtectedHeaderMapFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_protectedheadermap_free(ptr));
+/** */
+export class ProtectedHeaderMap {
+ static __wrap(ptr) {
+ const obj = Object.create(ProtectedHeaderMap.prototype);
+ obj.ptr = ptr;
+ ProtectedHeaderMapFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ProtectedHeaderMapFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_protectedheadermap_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protectedheadermap_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProtectedHeaderMap}
+ */
+ 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.protectedheadermap_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 ProtectedHeaderMap.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ static new_empty() {
+ const ret = wasm.protectedheadermap_new_empty();
+ return ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @param {HeaderMap} header_map
+ * @returns {ProtectedHeaderMap}
+ */
+ static new(header_map) {
+ _assertClass(header_map, HeaderMap);
+ const ret = wasm.protectedheadermap_new(header_map.ptr);
+ return ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @returns {HeaderMap}
+ */
+ deserialized_headers() {
+ const ret = wasm.protectedheadermap_deserialized_headers(this.ptr);
+ return HeaderMap.__wrap(ret);
+ }
+}
+const PubKeyEncryptionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_pubkeyencryption_free(ptr));
+/** */
+export class PubKeyEncryption {
+ static __wrap(ptr) {
+ const obj = Object.create(PubKeyEncryption.prototype);
+ obj.ptr = ptr;
+ PubKeyEncryptionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PubKeyEncryptionFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_pubkeyencryption_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.pubkeyencryption_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PubKeyEncryption}
+ */
+ 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.pubkeyencryption_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 PubKeyEncryption.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {COSEEncrypt} data
+ * @returns {PubKeyEncryption}
+ */
+ static new(data) {
+ _assertClass(data, COSEEncrypt);
+ const ret = wasm.pubkeyencryption_new(data.ptr);
+ return PubKeyEncryption.__wrap(ret);
+ }
+}
+const SigStructureFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_sigstructure_free(ptr));
+/** */
+export class SigStructure {
+ static __wrap(ptr) {
+ const obj = Object.create(SigStructure.prototype);
+ obj.ptr = ptr;
+ SigStructureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ SigStructureFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_sigstructure_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.sigstructure_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {SigStructure}
+ */
+ 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.sigstructure_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 SigStructure.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {number}
+ */
+ context() {
+ const ret = wasm.sigstructure_context(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ body_protected() {
+ const ret = wasm.sigstructure_body_protected(this.ptr);
+ return ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @returns {ProtectedHeaderMap | undefined}
+ */
+ sign_protected() {
+ const ret = wasm.sigstructure_sign_protected(this.ptr);
+ return ret === 0 ? undefined : ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ external_aad() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.sigstructure_external_aad(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ payload() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.sigstructure_payload(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {ProtectedHeaderMap} sign_protected
+ */
+ set_sign_protected(sign_protected) {
+ _assertClass(sign_protected, ProtectedHeaderMap);
+ wasm.sigstructure_set_sign_protected(this.ptr, sign_protected.ptr);
+ }
+ /**
+ * @param {number} context
+ * @param {ProtectedHeaderMap} body_protected
+ * @param {Uint8Array} external_aad
+ * @param {Uint8Array} payload
+ * @returns {SigStructure}
+ */
+ static new(context, body_protected, external_aad, payload) {
+ _assertClass(body_protected, ProtectedHeaderMap);
+ const ptr0 = passArray8ToWasm0(external_aad, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.sigstructure_new(context, body_protected.ptr, ptr0, len0, ptr1, len1);
+ return SigStructure.__wrap(ret);
+ }
+}
+const SignedMessageFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_signedmessage_free(ptr));
+/** */
+export class SignedMessage {
+ static __wrap(ptr) {
+ const obj = Object.create(SignedMessage.prototype);
+ obj.ptr = ptr;
+ SignedMessageFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ SignedMessageFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_signedmessage_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.signedmessage_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {SignedMessage}
+ */
+ 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.signedmessage_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 SignedMessage.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {COSESign} cose_sign
+ * @returns {SignedMessage}
+ */
+ static new_cose_sign(cose_sign) {
+ _assertClass(cose_sign, COSESign);
+ const ret = wasm.signedmessage_new_cose_sign(cose_sign.ptr);
+ return SignedMessage.__wrap(ret);
+ }
+ /**
+ * @param {COSESign1} cose_sign1
+ * @returns {SignedMessage}
+ */
+ static new_cose_sign1(cose_sign1) {
+ _assertClass(cose_sign1, COSESign1);
+ const ret = wasm.signedmessage_new_cose_sign1(cose_sign1.ptr);
+ return SignedMessage.__wrap(ret);
+ }
+ /**
+ * @param {string} s
+ * @returns {SignedMessage}
+ */
+ static from_user_facing_encoding(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.signedmessage_from_user_facing_encoding(retptr, ptr0, len0);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
+ if (r2) {
+ throw takeObject(r1);
+ }
+ return SignedMessage.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_user_facing_encoding() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.signedmessage_to_user_facing_encoding(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.signedmessage_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {COSESign | undefined}
+ */
+ as_cose_sign() {
+ const ret = wasm.signedmessage_as_cose_sign(this.ptr);
+ return ret === 0 ? undefined : COSESign.__wrap(ret);
+ }
+ /**
+ * @returns {COSESign1 | undefined}
+ */
+ as_cose_sign1() {
+ const ret = wasm.signedmessage_as_cose_sign1(this.ptr);
+ return ret === 0 ? undefined : COSESign1.__wrap(ret);
+ }
+}
+const TaggedCBORFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_taggedcbor_free(ptr));
+/** */
+export class TaggedCBOR {
+ static __wrap(ptr) {
+ const obj = Object.create(TaggedCBOR.prototype);
+ obj.ptr = ptr;
+ TaggedCBORFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TaggedCBORFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_taggedcbor_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.taggedcbor_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TaggedCBOR}
+ */
+ 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.taggedcbor_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 TaggedCBOR.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {BigNum}
+ */
+ tag() {
+ const ret = wasm.taggedcbor_tag(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {CBORValue}
+ */
+ value() {
+ const ret = wasm.taggedcbor_value(this.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} tag
+ * @param {CBORValue} value
+ * @returns {TaggedCBOR}
+ */
+ static new(tag, value) {
+ _assertClass(tag, BigNum);
+ var ptr0 = tag.__destroy_into_raw();
+ _assertClass(value, CBORValue);
+ const ret = wasm.taggedcbor_new(ptr0, value.ptr);
+ return TaggedCBOR.__wrap(ret);
+ }
+}
+const imports = {
+ __wbindgen_placeholder__: {
+ __wbindgen_object_drop_ref: function (arg0) {
+ takeObject(arg0);
+ },
+ __wbindgen_string_new: function (arg0, arg1) {
+ const ret = getStringFromWasm0(arg0, arg1);
+ return addHeapObject(ret);
+ },
+ __wbindgen_debug_string: function (arg0, arg1) {
+ const ret = debugString(getObject(arg1));
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
+ },
+ __wbindgen_throw: function (arg0, arg1) {
+ throw new Error(getStringFromWasm0(arg0, arg1));
+ },
+ },
+};
+/**
+ * Decompression callback
+ *
+ * @callback DecompressCallback
+ * @param {Uint8Array} compressed
+ * @return {Uint8Array} decompressed
+ */
+/**
+ * Options for instantiating a Wasm instance.
+ * @typedef {Object} InstantiateOptions
+ * @property {URL=} url - Optional url to the Wasm file to instantiate.
+ * @property {DecompressCallback=} decompress - Callback to decompress the
+ * raw Wasm file bytes before instantiating.
+ */
+/** Instantiates an instance of the Wasm module returning its functions.
+ * @remarks It is safe to call this multiple times and once successfully
+ * loaded it will always return a reference to the same object.
+ * @param {InstantiateOptions=} opts
+ */
+export async function instantiate(opts) {
+ return (await instantiateWithInstance(opts)).exports;
+}
+let instanceWithExports;
+let lastLoadPromise;
+/** Instantiates an instance of the Wasm module along with its exports.
+ * @remarks It is safe to call this multiple times and once successfully
+ * loaded it will always return a reference to the same object.
+ * @param {InstantiateOptions=} opts
+ * @returns {Promise<{
+ * instance: WebAssembly.Instance;
+ * exports: { BigNum : typeof BigNum ; CBORArray : typeof CBORArray ; CBORObject : typeof CBORObject ; CBORSpecial : typeof CBORSpecial ; CBORValue : typeof CBORValue ; COSEEncrypt : typeof COSEEncrypt ; COSEEncrypt0 : typeof COSEEncrypt0 ; COSEKey : typeof COSEKey ; COSERecipient : typeof COSERecipient ; COSERecipients : typeof COSERecipients ; COSESign : typeof COSESign ; COSESign1 : typeof COSESign1 ; COSESign1Builder : typeof COSESign1Builder ; COSESignBuilder : typeof COSESignBuilder ; COSESignature : typeof COSESignature ; COSESignatures : typeof COSESignatures ; CounterSignature : typeof CounterSignature ; EdDSA25519Key : typeof EdDSA25519Key ; HeaderMap : typeof HeaderMap ; Headers : typeof Headers ; Int : typeof Int ; Label : typeof Label ; Labels : typeof Labels ; PasswordEncryption : typeof PasswordEncryption ; ProtectedHeaderMap : typeof ProtectedHeaderMap ; PubKeyEncryption : typeof PubKeyEncryption ; SigStructure : typeof SigStructure ; SignedMessage : typeof SignedMessage ; TaggedCBOR : typeof TaggedCBOR }
+ * }>}
+ */
+export function instantiateWithInstance(opts) {
+ if (instanceWithExports != null) {
+ return Promise.resolve(instanceWithExports);
+ }
+ if (lastLoadPromise == null) {
+ lastLoadPromise = (async () => {
+ try {
+ const instance = (await instantiateModule(opts ?? {})).instance;
+ wasm = instance.exports;
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
+ instanceWithExports = {
+ instance,
+ exports: getWasmInstanceExports(),
+ };
+ return instanceWithExports;
+ }
+ finally {
+ lastLoadPromise = null;
+ }
+ })();
+ }
+ return lastLoadPromise;
+}
+function getWasmInstanceExports() {
+ return {
+ BigNum,
+ CBORArray,
+ CBORObject,
+ CBORSpecial,
+ CBORValue,
+ COSEEncrypt,
+ COSEEncrypt0,
+ COSEKey,
+ COSERecipient,
+ COSERecipients,
+ COSESign,
+ COSESign1,
+ COSESign1Builder,
+ COSESignBuilder,
+ COSESignature,
+ COSESignatures,
+ CounterSignature,
+ EdDSA25519Key,
+ HeaderMap,
+ Headers,
+ Int,
+ Label,
+ Labels,
+ PasswordEncryption,
+ ProtectedHeaderMap,
+ PubKeyEncryption,
+ SigStructure,
+ SignedMessage,
+ TaggedCBOR,
+ };
+}
+/** Gets if the Wasm module has been instantiated. */
+export function isInstantiated() {
+ return instanceWithExports != null;
+}
+/**
+ * @param {InstantiateOptions} opts
+ */
+async function instantiateModule(opts) {
+ // Temporary exception for fresh framework
+ const wasmUrl = import.meta.url.includes("_frsh")
+ ? opts.url
+ : new URL("cardano_message_signing_bg.wasm", import.meta.url);
+ const decompress = opts.decompress;
+ const isFile = wasmUrl.protocol === "file:";
+ // make file urls work in Node via dnt
+ const isNode = globalThis.process?.versions?.node != null;
+ if (isNode && isFile) {
+ // requires fs to be set externally on globalThis
+ const wasmCode = fs.readFileSync(wasmUrl);
+ return WebAssembly.instantiate(decompress ? decompress(wasmCode) : wasmCode, imports);
+ }
+ switch (wasmUrl.protocol) {
+ case "": // relative URL
+ case "chrome-extension:":
+ case "file:":
+ case "https:":
+ case "http:": {
+ if (isFile) {
+ if (typeof Deno !== "object") {
+ throw new Error("file urls are not supported in this environment");
+ }
+ if ("permissions" in Deno) {
+ await Deno.permissions.request({ name: "read", path: wasmUrl });
+ }
+ }
+ else if (typeof Deno === "object" && "permissions" in Deno) {
+ await Deno.permissions.request({ name: "net", host: wasmUrl.host });
+ }
+ const wasmResponse = await fetch(wasmUrl);
+ if (decompress) {
+ const wasmCode = new Uint8Array(await wasmResponse.arrayBuffer());
+ return WebAssembly.instantiate(decompress(wasmCode), imports);
+ }
+ if (isFile ||
+ wasmResponse.headers.get("content-type")?.toLowerCase()
+ .startsWith("application/wasm")) {
+ return WebAssembly.instantiateStreaming(wasmResponse, imports);
+ }
+ else {
+ return WebAssembly.instantiate(await wasmResponse.arrayBuffer(), imports);
+ }
+ }
+ default:
+ throw new Error(`Unsupported protocol: ${wasmUrl.protocol}`);
+ }
+}
diff --git a/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing_bg.wasm b/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing_bg.wasm
new file mode 100644
index 00000000..ad64343d
Binary files /dev/null and b/dist/esm/src/core/libs/cardano_message_signing/cardano_message_signing_bg.wasm differ
diff --git a/dist/esm/src/core/libs/cardano_message_signing/nodejs/cardano_message_signing.generated.js b/dist/esm/src/core/libs/cardano_message_signing/nodejs/cardano_message_signing.generated.js
new file mode 100644
index 00000000..6222db2d
--- /dev/null
+++ b/dist/esm/src/core/libs/cardano_message_signing/nodejs/cardano_message_signing.generated.js
@@ -0,0 +1,3759 @@
+// @generated file from wasmbuild -- do not edit
+// deno-lint-ignore-file
+// deno-fmt-ignore-file
+// source-hash: ccea9a27c8aee355bc2051725d859ee0a31dcb77
+
+let imports = {};
+imports["__wbindgen_placeholder__"] = module.exports;
+let wasm;
+const { TextDecoder, TextEncoder } = require(`util`);
+
+const heap = new Array(128).fill(undefined);
+
+heap.push(undefined, null, true, false);
+
+function getObject(idx) {
+ return heap[idx];
+}
+
+let heap_next = heap.length;
+
+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 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) {
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
+}
+
+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 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;
+}
+
+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);
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
+ WASM_VECTOR_LEN = buf.length;
+ return ptr;
+ }
+
+ let len = arg.length;
+ let ptr = malloc(len);
+
+ 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);
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
+ const ret = encodeString(arg, view);
+
+ offset += ret.written;
+ }
+
+ WASM_VECTOR_LEN = offset;
+ return ptr;
+}
+
+let cachedInt32Memory0 = null;
+
+function getInt32Memory0() {
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
+ }
+ return cachedInt32Memory0;
+}
+
+function _assertClass(instance, klass) {
+ if (!(instance instanceof klass)) {
+ throw new Error(`expected instance of ${klass.name}`);
+ }
+ return instance.ptr;
+}
+
+function passArray8ToWasm0(arg, malloc) {
+ const ptr = malloc(arg.length * 1);
+ getUint8Memory0().set(arg, ptr / 1);
+ WASM_VECTOR_LEN = arg.length;
+ return ptr;
+}
+
+function getArrayU8FromWasm0(ptr, len) {
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
+}
+
+let cachedFloat64Memory0 = null;
+
+function getFloat64Memory0() {
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
+ }
+ return cachedFloat64Memory0;
+}
+
+function isLikeNone(x) {
+ return x === undefined || x === null;
+}
+/** */
+module.exports.AlgorithmId = Object.freeze({
+ /**
+ * r" EdDSA (Pure EdDSA, not HashedEdDSA) - the algorithm used for Cardano addresses
+ */
+ EdDSA: 0,
+ "0": "EdDSA",
+ /**
+ * r" ChaCha20/Poly1305 w/ 256-bit key, 128-bit tag
+ */
+ ChaCha20Poly1305: 1,
+ "1": "ChaCha20Poly1305",
+});
+/** */
+module.exports.KeyType = Object.freeze({
+ /**
+ * r" octet key pair
+ */
+ OKP: 0,
+ "0": "OKP",
+ /**
+ * r" 2-coord EC
+ */
+ EC2: 1,
+ "1": "EC2",
+ Symmetric: 2,
+ "2": "Symmetric",
+});
+/** */
+module.exports.ECKey = Object.freeze({
+ CRV: 0,
+ "0": "CRV",
+ X: 1,
+ "1": "X",
+ Y: 2,
+ "2": "Y",
+ D: 3,
+ "3": "D",
+});
+/** */
+module.exports.CurveType = Object.freeze({
+ P256: 0,
+ "0": "P256",
+ P384: 1,
+ "1": "P384",
+ P521: 2,
+ "2": "P521",
+ X25519: 3,
+ "3": "X25519",
+ X448: 4,
+ "4": "X448",
+ Ed25519: 5,
+ "5": "Ed25519",
+ Ed448: 6,
+ "6": "Ed448",
+});
+/** */
+module.exports.KeyOperation = Object.freeze({
+ Sign: 0,
+ "0": "Sign",
+ Verify: 1,
+ "1": "Verify",
+ Encrypt: 2,
+ "2": "Encrypt",
+ Decrypt: 3,
+ "3": "Decrypt",
+ WrapKey: 4,
+ "4": "WrapKey",
+ UnwrapKey: 5,
+ "5": "UnwrapKey",
+ DeriveKey: 6,
+ "6": "DeriveKey",
+ DeriveBits: 7,
+ "7": "DeriveBits",
+});
+/** */
+module.exports.CBORSpecialType = Object.freeze({
+ Bool: 0,
+ "0": "Bool",
+ Float: 1,
+ "1": "Float",
+ Unassigned: 2,
+ "2": "Unassigned",
+ Break: 3,
+ "3": "Break",
+ Undefined: 4,
+ "4": "Undefined",
+ Null: 5,
+ "5": "Null",
+});
+/** */
+module.exports.CBORValueKind = Object.freeze({
+ Int: 0,
+ "0": "Int",
+ Bytes: 1,
+ "1": "Bytes",
+ Text: 2,
+ "2": "Text",
+ Array: 3,
+ "3": "Array",
+ Object: 4,
+ "4": "Object",
+ TaggedCBOR: 5,
+ "5": "TaggedCBOR",
+ Special: 6,
+ "6": "Special",
+});
+/** */
+module.exports.LabelKind = Object.freeze({
+ Int: 0,
+ "0": "Int",
+ Text: 1,
+ "1": "Text",
+});
+/** */
+module.exports.SignedMessageKind = Object.freeze({
+ COSESIGN: 0,
+ "0": "COSESIGN",
+ COSESIGN1: 1,
+ "1": "COSESIGN1",
+});
+/** */
+module.exports.SigContext = Object.freeze({
+ Signature: 0,
+ "0": "Signature",
+ Signature1: 1,
+ "1": "Signature1",
+ CounterSignature: 2,
+ "2": "CounterSignature",
+});
+
+const BigNumFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_bignum_free(ptr)
+);
+/** */
+class BigNum {
+ static __wrap(ptr) {
+ const obj = Object.create(BigNum.prototype);
+ obj.ptr = ptr;
+ BigNumFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bignum_to_str(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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.ptr, other.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.ptr, other.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.ptr, other.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.BigNum = BigNum;
+
+const CBORArrayFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cborarray_free(ptr)
+);
+/** */
+class CBORArray {
+ static __wrap(ptr) {
+ const obj = Object.create(CBORArray.prototype);
+ obj.ptr = ptr;
+ CBORArrayFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CBORArrayFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cborarray_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborarray_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORArray}
+ */
+ 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.cborarray_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 CBORArray.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {CBORArray}
+ */
+ static new() {
+ const ret = wasm.cborarray_new();
+ return CBORArray.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborarray_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {CBORValue}
+ */
+ get(index) {
+ const ret = wasm.cborarray_get(this.ptr, index);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORValue} elem
+ */
+ add(elem) {
+ _assertClass(elem, CBORValue);
+ wasm.cborarray_add(this.ptr, elem.ptr);
+ }
+ /**
+ * @param {boolean} use_definite
+ */
+ set_definite_encoding(use_definite) {
+ wasm.cborarray_set_definite_encoding(this.ptr, use_definite);
+ }
+ /**
+ * @returns {boolean}
+ */
+ is_definite() {
+ const ret = wasm.cborarray_is_definite(this.ptr);
+ return ret !== 0;
+ }
+}
+module.exports.CBORArray = CBORArray;
+
+const CBORObjectFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cborobject_free(ptr)
+);
+/** */
+class CBORObject {
+ static __wrap(ptr) {
+ const obj = Object.create(CBORObject.prototype);
+ obj.ptr = ptr;
+ CBORObjectFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CBORObjectFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cborobject_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborobject_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORObject}
+ */
+ 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.cborobject_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 CBORObject.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {CBORObject}
+ */
+ static new() {
+ const ret = wasm.cborobject_new();
+ return CBORObject.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborobject_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {CBORValue} key
+ * @param {CBORValue} value
+ * @returns {CBORValue | undefined}
+ */
+ insert(key, value) {
+ _assertClass(key, CBORValue);
+ _assertClass(value, CBORValue);
+ const ret = wasm.cborobject_insert(this.ptr, key.ptr, value.ptr);
+ return ret === 0 ? undefined : CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORValue} key
+ * @returns {CBORValue | undefined}
+ */
+ get(key) {
+ _assertClass(key, CBORValue);
+ const ret = wasm.cborobject_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : CBORValue.__wrap(ret);
+ }
+ /**
+ * @returns {CBORArray}
+ */
+ keys() {
+ const ret = wasm.cborobject_keys(this.ptr);
+ return CBORArray.__wrap(ret);
+ }
+ /**
+ * @param {boolean} use_definite
+ */
+ set_definite_encoding(use_definite) {
+ wasm.cborobject_set_definite_encoding(this.ptr, use_definite);
+ }
+ /**
+ * @returns {boolean}
+ */
+ is_definite() {
+ const ret = wasm.cborobject_is_definite(this.ptr);
+ return ret !== 0;
+ }
+}
+module.exports.CBORObject = CBORObject;
+
+const CBORSpecialFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cborspecial_free(ptr)
+);
+/** */
+class CBORSpecial {
+ static __wrap(ptr) {
+ const obj = Object.create(CBORSpecial.prototype);
+ obj.ptr = ptr;
+ CBORSpecialFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CBORSpecialFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cborspecial_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborspecial_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORSpecial}
+ */
+ 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.cborspecial_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 CBORSpecial.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {boolean} b
+ * @returns {CBORSpecial}
+ */
+ static new_bool(b) {
+ const ret = wasm.cborspecial_new_bool(b);
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @param {number} u
+ * @returns {CBORSpecial}
+ */
+ static new_unassigned(u) {
+ const ret = wasm.cborspecial_new_unassigned(u);
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_break() {
+ const ret = wasm.cborspecial_new_break();
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_null() {
+ const ret = wasm.cborspecial_new_null();
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @returns {CBORSpecial}
+ */
+ static new_undefined() {
+ const ret = wasm.cborspecial_new_undefined();
+ return CBORSpecial.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.cborspecial_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {boolean | undefined}
+ */
+ as_bool() {
+ const ret = wasm.cborspecial_as_bool(this.ptr);
+ return ret === 0xFFFFFF ? undefined : ret !== 0;
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ as_float() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborspecial_as_float(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
+ return r0 === 0 ? undefined : r2;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ as_unassigned() {
+ const ret = wasm.cborspecial_as_unassigned(this.ptr);
+ return ret === 0xFFFFFF ? undefined : ret;
+ }
+}
+module.exports.CBORSpecial = CBORSpecial;
+
+const CBORValueFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cborvalue_free(ptr)
+);
+/** */
+class CBORValue {
+ static __wrap(ptr) {
+ const obj = Object.create(CBORValue.prototype);
+ obj.ptr = ptr;
+ CBORValueFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CBORValueFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cborvalue_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborvalue_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORValue}
+ */
+ 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.cborvalue_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 CBORValue.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Int} int
+ * @returns {CBORValue}
+ */
+ static new_int(int) {
+ _assertClass(int, Int);
+ const ret = wasm.cborvalue_new_int(int.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CBORValue}
+ */
+ static new_bytes(bytes) {
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cborvalue_new_bytes(ptr0, len0);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {string} text
+ * @returns {CBORValue}
+ */
+ static new_text(text) {
+ const ptr0 = passStringToWasm0(
+ text,
+ wasm.__wbindgen_malloc,
+ wasm.__wbindgen_realloc,
+ );
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cborvalue_new_text(ptr0, len0);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORArray} arr
+ * @returns {CBORValue}
+ */
+ static new_array(arr) {
+ _assertClass(arr, CBORArray);
+ const ret = wasm.cborvalue_new_array(arr.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORObject} obj
+ * @returns {CBORValue}
+ */
+ static new_object(obj) {
+ _assertClass(obj, CBORObject);
+ const ret = wasm.cborvalue_new_object(obj.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {TaggedCBOR} tagged
+ * @returns {CBORValue}
+ */
+ static new_tagged(tagged) {
+ _assertClass(tagged, TaggedCBOR);
+ const ret = wasm.cborvalue_new_tagged(tagged.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {CBORSpecial} special
+ * @returns {CBORValue}
+ */
+ static new_special(special) {
+ _assertClass(special, CBORSpecial);
+ const ret = wasm.cborvalue_new_special(special.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {Label} label
+ * @returns {CBORValue}
+ */
+ static from_label(label) {
+ _assertClass(label, Label);
+ const ret = wasm.cborvalue_from_label(label.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.cborvalue_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int() {
+ const ret = wasm.cborvalue_as_int(this.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ as_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborvalue_as_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string | undefined}
+ */
+ as_text() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cborvalue_as_text(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getStringFromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {CBORArray | undefined}
+ */
+ as_array() {
+ const ret = wasm.cborvalue_as_array(this.ptr);
+ return ret === 0 ? undefined : CBORArray.__wrap(ret);
+ }
+ /**
+ * @returns {CBORObject | undefined}
+ */
+ as_object() {
+ const ret = wasm.cborvalue_as_object(this.ptr);
+ return ret === 0 ? undefined : CBORObject.__wrap(ret);
+ }
+ /**
+ * @returns {TaggedCBOR | undefined}
+ */
+ as_tagged() {
+ const ret = wasm.cborvalue_as_tagged(this.ptr);
+ return ret === 0 ? undefined : TaggedCBOR.__wrap(ret);
+ }
+ /**
+ * @returns {CBORSpecial | undefined}
+ */
+ as_special() {
+ const ret = wasm.cborvalue_as_special(this.ptr);
+ return ret === 0 ? undefined : CBORSpecial.__wrap(ret);
+ }
+}
+module.exports.CBORValue = CBORValue;
+
+const COSEEncryptFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_coseencrypt_free(ptr)
+);
+/** */
+class COSEEncrypt {
+ static __wrap(ptr) {
+ const obj = Object.create(COSEEncrypt.prototype);
+ obj.ptr = ptr;
+ COSEEncryptFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSEEncryptFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coseencrypt_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEEncrypt}
+ */
+ 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.coseencrypt_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 COSEEncrypt.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {COSERecipients}
+ */
+ recipients() {
+ const ret = wasm.coseencrypt_recipients(this.ptr);
+ return COSERecipients.__wrap(ret);
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @param {COSERecipients} recipients
+ * @returns {COSEEncrypt}
+ */
+ static new(headers, ciphertext, recipients) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(ciphertext)
+ ? 0
+ : passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ _assertClass(recipients, COSERecipients);
+ const ret = wasm.coseencrypt_new(headers.ptr, ptr0, len0, recipients.ptr);
+ return COSEEncrypt.__wrap(ret);
+ }
+}
+module.exports.COSEEncrypt = COSEEncrypt;
+
+const COSEEncrypt0Finalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_coseencrypt0_free(ptr)
+);
+/** */
+class COSEEncrypt0 {
+ static __wrap(ptr) {
+ const obj = Object.create(COSEEncrypt0.prototype);
+ obj.ptr = ptr;
+ COSEEncrypt0Finalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSEEncrypt0Finalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coseencrypt0_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt0_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEEncrypt0}
+ */
+ 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.coseencrypt0_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 COSEEncrypt0.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt0_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @returns {COSEEncrypt0}
+ */
+ static new(headers, ciphertext) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(ciphertext)
+ ? 0
+ : passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coseencrypt0_new(headers.ptr, ptr0, len0);
+ return COSEEncrypt0.__wrap(ret);
+ }
+}
+module.exports.COSEEncrypt0 = COSEEncrypt0;
+
+const COSEKeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cosekey_free(ptr)
+);
+/** */
+class COSEKey {
+ static __wrap(ptr) {
+ const obj = Object.create(COSEKey.prototype);
+ obj.ptr = ptr;
+ COSEKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSEKeyFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosekey_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosekey_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSEKey}
+ */
+ 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.cosekey_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 COSEKey.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Label} key_type
+ */
+ set_key_type(key_type) {
+ _assertClass(key_type, Label);
+ wasm.cosekey_set_key_type(this.ptr, key_type.ptr);
+ }
+ /**
+ * @returns {Label}
+ */
+ key_type() {
+ const ret = wasm.cosekey_key_type(this.ptr);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} key_id
+ */
+ set_key_id(key_id) {
+ const ptr0 = passArray8ToWasm0(key_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosekey_set_key_id(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ key_id() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosekey_key_id(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Label} algorithm_id
+ */
+ set_algorithm_id(algorithm_id) {
+ _assertClass(algorithm_id, Label);
+ wasm.cosekey_set_algorithm_id(this.ptr, algorithm_id.ptr);
+ }
+ /**
+ * @returns {Label | undefined}
+ */
+ algorithm_id() {
+ const ret = wasm.cosekey_algorithm_id(this.ptr);
+ return ret === 0 ? undefined : Label.__wrap(ret);
+ }
+ /**
+ * @param {Labels} key_ops
+ */
+ set_key_ops(key_ops) {
+ _assertClass(key_ops, Labels);
+ wasm.cosekey_set_key_ops(this.ptr, key_ops.ptr);
+ }
+ /**
+ * @returns {Labels | undefined}
+ */
+ key_ops() {
+ const ret = wasm.cosekey_key_ops(this.ptr);
+ return ret === 0 ? undefined : Labels.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} base_init_vector
+ */
+ set_base_init_vector(base_init_vector) {
+ const ptr0 = passArray8ToWasm0(base_init_vector, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosekey_set_base_init_vector(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ base_init_vector() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosekey_base_init_vector(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Label} label
+ * @returns {CBORValue | undefined}
+ */
+ header(label) {
+ _assertClass(label, Label);
+ const ret = wasm.cosekey_header(this.ptr, label.ptr);
+ return ret === 0 ? undefined : CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {Label} label
+ * @param {CBORValue} value
+ */
+ set_header(label, value) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(label, Label);
+ _assertClass(value, CBORValue);
+ wasm.cosekey_set_header(retptr, this.ptr, label.ptr, value.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 {Label} key_type
+ * @returns {COSEKey}
+ */
+ static new(key_type) {
+ _assertClass(key_type, Label);
+ const ret = wasm.cosekey_new(key_type.ptr);
+ return COSEKey.__wrap(ret);
+ }
+}
+module.exports.COSEKey = COSEKey;
+
+const COSERecipientFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_coserecipient_free(ptr)
+);
+/** */
+class COSERecipient {
+ static __wrap(ptr) {
+ const obj = Object.create(COSERecipient.prototype);
+ obj.ptr = ptr;
+ COSERecipientFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSERecipientFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coserecipient_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coserecipient_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSERecipient}
+ */
+ 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.coserecipient_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 COSERecipient.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ ciphertext() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt0_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} ciphertext
+ * @returns {COSERecipient}
+ */
+ static new(headers, ciphertext) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(ciphertext)
+ ? 0
+ : passArray8ToWasm0(ciphertext, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coseencrypt0_new(headers.ptr, ptr0, len0);
+ return COSERecipient.__wrap(ret);
+ }
+}
+module.exports.COSERecipient = COSERecipient;
+
+const COSERecipientsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_coserecipients_free(ptr)
+);
+/** */
+class COSERecipients {
+ static __wrap(ptr) {
+ const obj = Object.create(COSERecipients.prototype);
+ obj.ptr = ptr;
+ COSERecipientsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSERecipientsFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coserecipients_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coserecipients_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSERecipients}
+ */
+ 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.coserecipients_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 COSERecipients.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {COSERecipients}
+ */
+ static new() {
+ const ret = wasm.coserecipients_new();
+ return COSERecipients.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborarray_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {COSERecipient}
+ */
+ get(index) {
+ const ret = wasm.coserecipients_get(this.ptr, index);
+ return COSERecipient.__wrap(ret);
+ }
+ /**
+ * @param {COSERecipient} elem
+ */
+ add(elem) {
+ _assertClass(elem, COSERecipient);
+ wasm.coserecipients_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.COSERecipients = COSERecipients;
+
+const COSESignFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cosesign_free(ptr)
+);
+/** */
+class COSESign {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESign.prototype);
+ obj.ptr = ptr;
+ COSESignFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESignFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesign_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesign_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESign}
+ */
+ 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.cosesign_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 COSESign.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ payload() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {COSESignatures}
+ */
+ signatures() {
+ const ret = wasm.cosesign_signatures(this.ptr);
+ return COSESignatures.__wrap(ret);
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} payload
+ * @param {COSESignatures} signatures
+ * @returns {COSESign}
+ */
+ static new(headers, payload, signatures) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(payload)
+ ? 0
+ : passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ _assertClass(signatures, COSESignatures);
+ const ret = wasm.cosesign_new(headers.ptr, ptr0, len0, signatures.ptr);
+ return COSESign.__wrap(ret);
+ }
+}
+module.exports.COSESign = COSESign;
+
+const COSESign1Finalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cosesign1_free(ptr)
+);
+/** */
+class COSESign1 {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESign1.prototype);
+ obj.ptr = ptr;
+ COSESign1Finalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESign1Finalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesign1_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesign1_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESign1}
+ */
+ 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.cosesign1_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 COSESign1.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ payload() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.coseencrypt_ciphertext(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ signature() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesign1_signature(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * For verifying, we will want to reverse-construct this SigStructure to check the signature against
+ * # Arguments
+ * * `external_aad` - External application data - see RFC 8152 section 4.3. Set to None if not using this.
+ * @param {Uint8Array | undefined} external_aad
+ * @param {Uint8Array | undefined} external_payload
+ * @returns {SigStructure}
+ */
+ signed_data(external_aad, external_payload) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ var ptr0 = isLikeNone(external_aad)
+ ? 0
+ : passArray8ToWasm0(external_aad, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ var ptr1 = isLikeNone(external_payload)
+ ? 0
+ : passArray8ToWasm0(external_payload, wasm.__wbindgen_malloc);
+ var len1 = WASM_VECTOR_LEN;
+ wasm.cosesign1_signed_data(retptr, this.ptr, 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 SigStructure.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array | undefined} payload
+ * @param {Uint8Array} signature
+ * @returns {COSESign1}
+ */
+ static new(headers, payload, signature) {
+ _assertClass(headers, Headers);
+ var ptr0 = isLikeNone(payload)
+ ? 0
+ : passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesign1_new(headers.ptr, ptr0, len0, ptr1, len1);
+ return COSESign1.__wrap(ret);
+ }
+}
+module.exports.COSESign1 = COSESign1;
+
+const COSESign1BuilderFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cosesign1builder_free(ptr)
+);
+/** */
+class COSESign1Builder {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESign1Builder.prototype);
+ obj.ptr = ptr;
+ COSESign1BuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESign1BuilderFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesign1builder_free(ptr);
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} payload
+ * @param {boolean} is_payload_external
+ * @returns {COSESign1Builder}
+ */
+ static new(headers, payload, is_payload_external) {
+ _assertClass(headers, Headers);
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesign1builder_new(
+ headers.ptr,
+ ptr0,
+ len0,
+ is_payload_external,
+ );
+ return COSESign1Builder.__wrap(ret);
+ }
+ /** */
+ hash_payload() {
+ wasm.cosesign1builder_hash_payload(this.ptr);
+ }
+ /**
+ * @param {Uint8Array} external_aad
+ */
+ set_external_aad(external_aad) {
+ const ptr0 = passArray8ToWasm0(external_aad, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosesign1builder_set_external_aad(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {SigStructure}
+ */
+ make_data_to_sign() {
+ const ret = wasm.cosesign1builder_make_data_to_sign(this.ptr);
+ return SigStructure.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} signed_sig_structure
+ * @returns {COSESign1}
+ */
+ build(signed_sig_structure) {
+ const ptr0 = passArray8ToWasm0(
+ signed_sig_structure,
+ wasm.__wbindgen_malloc,
+ );
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesign1builder_build(this.ptr, ptr0, len0);
+ return COSESign1.__wrap(ret);
+ }
+}
+module.exports.COSESign1Builder = COSESign1Builder;
+
+const COSESignBuilderFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cosesignbuilder_free(ptr)
+);
+/** */
+class COSESignBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESignBuilder.prototype);
+ obj.ptr = ptr;
+ COSESignBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESignBuilderFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesignbuilder_free(ptr);
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} payload
+ * @param {boolean} is_payload_external
+ * @returns {COSESignBuilder}
+ */
+ static new(headers, payload, is_payload_external) {
+ _assertClass(headers, Headers);
+ const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesignbuilder_new(
+ headers.ptr,
+ ptr0,
+ len0,
+ is_payload_external,
+ );
+ return COSESignBuilder.__wrap(ret);
+ }
+ /** */
+ hash_payload() {
+ wasm.cosesign1builder_hash_payload(this.ptr);
+ }
+ /**
+ * @param {Uint8Array} external_aad
+ */
+ set_external_aad(external_aad) {
+ const ptr0 = passArray8ToWasm0(external_aad, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosesign1builder_set_external_aad(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {SigStructure}
+ */
+ make_data_to_sign() {
+ const ret = wasm.cosesignbuilder_make_data_to_sign(this.ptr);
+ return SigStructure.__wrap(ret);
+ }
+ /**
+ * @param {COSESignatures} signed_sig_structure
+ * @returns {COSESign}
+ */
+ build(signed_sig_structure) {
+ _assertClass(signed_sig_structure, COSESignatures);
+ const ret = wasm.cosesignbuilder_build(this.ptr, signed_sig_structure.ptr);
+ return COSESign.__wrap(ret);
+ }
+}
+module.exports.COSESignBuilder = COSESignBuilder;
+
+const COSESignatureFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cosesignature_free(ptr)
+);
+/** */
+class COSESignature {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESignature.prototype);
+ obj.ptr = ptr;
+ COSESignatureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESignatureFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesignature_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesignature_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESignature}
+ */
+ 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.cosesignature_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 COSESignature.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Headers}
+ */
+ headers() {
+ const ret = wasm.coseencrypt0_headers(this.ptr);
+ return Headers.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ signature() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesign1_signature(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Headers} headers
+ * @param {Uint8Array} signature
+ * @returns {COSESignature}
+ */
+ static new(headers, signature) {
+ _assertClass(headers, Headers);
+ const ptr0 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.cosesignature_new(headers.ptr, ptr0, len0);
+ return COSESignature.__wrap(ret);
+ }
+}
+module.exports.COSESignature = COSESignature;
+
+const COSESignaturesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_cosesignatures_free(ptr)
+);
+/** */
+class COSESignatures {
+ static __wrap(ptr) {
+ const obj = Object.create(COSESignatures.prototype);
+ obj.ptr = ptr;
+ COSESignaturesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ COSESignaturesFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_cosesignatures_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosesignatures_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {COSESignatures}
+ */
+ 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.cosesignatures_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 COSESignatures.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {COSESignatures}
+ */
+ static new() {
+ const ret = wasm.coserecipients_new();
+ return COSESignatures.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborarray_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {COSESignature}
+ */
+ get(index) {
+ const ret = wasm.cosesignatures_get(this.ptr, index);
+ return COSESignature.__wrap(ret);
+ }
+ /**
+ * @param {COSESignature} elem
+ */
+ add(elem) {
+ _assertClass(elem, COSESignature);
+ wasm.cosesignatures_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.COSESignatures = COSESignatures;
+
+const CounterSignatureFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_countersignature_free(ptr)
+);
+/** */
+class CounterSignature {
+ static __wrap(ptr) {
+ const obj = Object.create(CounterSignature.prototype);
+ obj.ptr = ptr;
+ CounterSignatureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ CounterSignatureFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_countersignature_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.countersignature_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CounterSignature}
+ */
+ 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.countersignature_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 CounterSignature.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {COSESignature} cose_signature
+ * @returns {CounterSignature}
+ */
+ static new_single(cose_signature) {
+ _assertClass(cose_signature, COSESignature);
+ const ret = wasm.countersignature_new_single(cose_signature.ptr);
+ return CounterSignature.__wrap(ret);
+ }
+ /**
+ * @param {COSESignatures} cose_signatures
+ * @returns {CounterSignature}
+ */
+ static new_multi(cose_signatures) {
+ _assertClass(cose_signatures, COSESignatures);
+ const ret = wasm.countersignature_new_multi(cose_signatures.ptr);
+ return CounterSignature.__wrap(ret);
+ }
+ /**
+ * @returns {COSESignatures}
+ */
+ signatures() {
+ const ret = wasm.countersignature_signatures(this.ptr);
+ return COSESignatures.__wrap(ret);
+ }
+}
+module.exports.CounterSignature = CounterSignature;
+
+const EdDSA25519KeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_eddsa25519key_free(ptr)
+);
+/** */
+class EdDSA25519Key {
+ static __wrap(ptr) {
+ const obj = Object.create(EdDSA25519Key.prototype);
+ obj.ptr = ptr;
+ EdDSA25519KeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ EdDSA25519KeyFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_eddsa25519key_free(ptr);
+ }
+ /**
+ * @param {Uint8Array} pubkey_bytes
+ * @returns {EdDSA25519Key}
+ */
+ static new(pubkey_bytes) {
+ const ptr0 = passArray8ToWasm0(pubkey_bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.eddsa25519key_new(ptr0, len0);
+ return EdDSA25519Key.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} private_key_bytes
+ */
+ set_private_key(private_key_bytes) {
+ const ptr0 = passArray8ToWasm0(private_key_bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.eddsa25519key_set_private_key(this.ptr, ptr0, len0);
+ }
+ /** */
+ is_for_signing() {
+ wasm.eddsa25519key_is_for_signing(this.ptr);
+ }
+ /** */
+ is_for_verifying() {
+ wasm.eddsa25519key_is_for_verifying(this.ptr);
+ }
+ /**
+ * @returns {COSEKey}
+ */
+ build() {
+ const ret = wasm.eddsa25519key_build(this.ptr);
+ return COSEKey.__wrap(ret);
+ }
+}
+module.exports.EdDSA25519Key = EdDSA25519Key;
+
+const HeaderMapFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_headermap_free(ptr)
+);
+/** */
+class HeaderMap {
+ static __wrap(ptr) {
+ const obj = Object.create(HeaderMap.prototype);
+ obj.ptr = ptr;
+ HeaderMapFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ HeaderMapFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_headermap_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headermap_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {HeaderMap}
+ */
+ 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.headermap_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 HeaderMap.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Label} algorithm_id
+ */
+ set_algorithm_id(algorithm_id) {
+ _assertClass(algorithm_id, Label);
+ wasm.headermap_set_algorithm_id(this.ptr, algorithm_id.ptr);
+ }
+ /**
+ * @returns {Label | undefined}
+ */
+ algorithm_id() {
+ const ret = wasm.headermap_algorithm_id(this.ptr);
+ return ret === 0 ? undefined : Label.__wrap(ret);
+ }
+ /**
+ * @param {Labels} criticality
+ */
+ set_criticality(criticality) {
+ _assertClass(criticality, Labels);
+ wasm.headermap_set_criticality(this.ptr, criticality.ptr);
+ }
+ /**
+ * @returns {Labels | undefined}
+ */
+ criticality() {
+ const ret = wasm.headermap_criticality(this.ptr);
+ return ret === 0 ? undefined : Labels.__wrap(ret);
+ }
+ /**
+ * @param {Label} content_type
+ */
+ set_content_type(content_type) {
+ _assertClass(content_type, Label);
+ wasm.headermap_set_content_type(this.ptr, content_type.ptr);
+ }
+ /**
+ * @returns {Label | undefined}
+ */
+ content_type() {
+ const ret = wasm.headermap_content_type(this.ptr);
+ return ret === 0 ? undefined : Label.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} key_id
+ */
+ set_key_id(key_id) {
+ const ptr0 = passArray8ToWasm0(key_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.headermap_set_key_id(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ key_id() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headermap_key_id(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} init_vector
+ */
+ set_init_vector(init_vector) {
+ const ptr0 = passArray8ToWasm0(init_vector, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.cosekey_set_base_init_vector(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ init_vector() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.cosekey_base_init_vector(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} partial_init_vector
+ */
+ set_partial_init_vector(partial_init_vector) {
+ const ptr0 = passArray8ToWasm0(partial_init_vector, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.headermap_set_partial_init_vector(this.ptr, ptr0, len0);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ partial_init_vector() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headermap_partial_init_vector(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {CounterSignature} counter_signature
+ */
+ set_counter_signature(counter_signature) {
+ _assertClass(counter_signature, CounterSignature);
+ wasm.headermap_set_counter_signature(this.ptr, counter_signature.ptr);
+ }
+ /**
+ * @returns {CounterSignature | undefined}
+ */
+ counter_signature() {
+ const ret = wasm.headermap_counter_signature(this.ptr);
+ return ret === 0 ? undefined : CounterSignature.__wrap(ret);
+ }
+ /**
+ * @param {Label} label
+ * @returns {CBORValue | undefined}
+ */
+ header(label) {
+ _assertClass(label, Label);
+ const ret = wasm.headermap_header(this.ptr, label.ptr);
+ return ret === 0 ? undefined : CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {Label} label
+ * @param {CBORValue} value
+ */
+ set_header(label, value) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(label, Label);
+ _assertClass(value, CBORValue);
+ wasm.headermap_set_header(retptr, this.ptr, label.ptr, value.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 {Labels}
+ */
+ keys() {
+ const ret = wasm.headermap_keys(this.ptr);
+ return Labels.__wrap(ret);
+ }
+ /**
+ * @returns {HeaderMap}
+ */
+ static new() {
+ const ret = wasm.headermap_new();
+ return HeaderMap.__wrap(ret);
+ }
+}
+module.exports.HeaderMap = HeaderMap;
+
+const HeadersFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_headers_free(ptr)
+);
+/** */
+class Headers {
+ static __wrap(ptr) {
+ const obj = Object.create(Headers.prototype);
+ obj.ptr = ptr;
+ HeadersFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ HeadersFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_headers_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headers_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Headers}
+ */
+ 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.headers_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 Headers.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ protected() {
+ const ret = wasm.headers_protected(this.ptr);
+ return ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @returns {HeaderMap}
+ */
+ unprotected() {
+ const ret = wasm.headers_unprotected(this.ptr);
+ return HeaderMap.__wrap(ret);
+ }
+ /**
+ * @param {ProtectedHeaderMap} protected_
+ * @param {HeaderMap} unprotected_
+ * @returns {Headers}
+ */
+ static new(protected_, unprotected_) {
+ _assertClass(protected_, ProtectedHeaderMap);
+ _assertClass(unprotected_, HeaderMap);
+ const ret = wasm.headers_new(protected_.ptr, unprotected_.ptr);
+ return Headers.__wrap(ret);
+ }
+}
+module.exports.Headers = Headers;
+
+const IntFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_int_free(ptr)
+);
+/** */
+class Int {
+ static __wrap(ptr) {
+ const obj = Object.create(Int.prototype);
+ obj.ptr = ptr;
+ IntFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ IntFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_int_free(ptr);
+ }
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new(x) {
+ _assertClass(x, BigNum);
+ var ptr0 = x.__destroy_into_raw();
+ const ret = wasm.int_new(ptr0);
+ return Int.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new_negative(x) {
+ _assertClass(x, BigNum);
+ var ptr0 = x.__destroy_into_raw();
+ const ret = wasm.int_new_negative(ptr0);
+ 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.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_positive() {
+ const ret = wasm.int_as_positive(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_negative() {
+ const ret = wasm.int_as_negative(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ as_i32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.int_as_i32(retptr, this.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);
+ }
+ }
+}
+module.exports.Int = Int;
+
+const LabelFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_label_free(ptr)
+);
+/** */
+class Label {
+ static __wrap(ptr) {
+ const obj = Object.create(Label.prototype);
+ obj.ptr = ptr;
+ LabelFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ LabelFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_label_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.label_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Label}
+ */
+ 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.label_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 Label.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Int} int
+ * @returns {Label}
+ */
+ static new_int(int) {
+ _assertClass(int, Int);
+ const ret = wasm.label_new_int(int.ptr);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {string} text
+ * @returns {Label}
+ */
+ static new_text(text) {
+ const ptr0 = passStringToWasm0(
+ text,
+ wasm.__wbindgen_malloc,
+ wasm.__wbindgen_realloc,
+ );
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.label_new_text(ptr0, len0);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.label_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int() {
+ const ret = wasm.label_as_int(this.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @returns {string | undefined}
+ */
+ as_text() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.label_as_text(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getStringFromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {number} id
+ * @returns {Label}
+ */
+ static from_algorithm_id(id) {
+ const ret = wasm.label_from_algorithm_id(id);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {number} key_type
+ * @returns {Label}
+ */
+ static from_key_type(key_type) {
+ const ret = wasm.label_from_key_type(key_type);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {number} ec_key
+ * @returns {Label}
+ */
+ static from_ec_key(ec_key) {
+ const ret = wasm.label_from_ec_key(ec_key);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {number} curve_type
+ * @returns {Label}
+ */
+ static from_curve_type(curve_type) {
+ const ret = wasm.label_from_curve_type(curve_type);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {number} key_op
+ * @returns {Label}
+ */
+ static from_key_operation(key_op) {
+ const ret = wasm.label_from_key_operation(key_op);
+ return Label.__wrap(ret);
+ }
+}
+module.exports.Label = Label;
+
+const LabelsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_labels_free(ptr)
+);
+/** */
+class Labels {
+ static __wrap(ptr) {
+ const obj = Object.create(Labels.prototype);
+ obj.ptr = ptr;
+ LabelsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ LabelsFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_labels_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.labels_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Labels}
+ */
+ 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.labels_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 Labels.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Labels}
+ */
+ static new() {
+ const ret = wasm.coserecipients_new();
+ return Labels.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.cborarray_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Label}
+ */
+ get(index) {
+ const ret = wasm.labels_get(this.ptr, index);
+ return Label.__wrap(ret);
+ }
+ /**
+ * @param {Label} elem
+ */
+ add(elem) {
+ _assertClass(elem, Label);
+ wasm.labels_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.Labels = Labels;
+
+const PasswordEncryptionFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_passwordencryption_free(ptr)
+);
+/** */
+class PasswordEncryption {
+ static __wrap(ptr) {
+ const obj = Object.create(PasswordEncryption.prototype);
+ obj.ptr = ptr;
+ PasswordEncryptionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PasswordEncryptionFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_passwordencryption_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.passwordencryption_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PasswordEncryption}
+ */
+ 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.passwordencryption_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 PasswordEncryption.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {COSEEncrypt0} data
+ * @returns {PasswordEncryption}
+ */
+ static new(data) {
+ _assertClass(data, COSEEncrypt0);
+ const ret = wasm.passwordencryption_new(data.ptr);
+ return PasswordEncryption.__wrap(ret);
+ }
+}
+module.exports.PasswordEncryption = PasswordEncryption;
+
+const ProtectedHeaderMapFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_protectedheadermap_free(ptr)
+);
+/** */
+class ProtectedHeaderMap {
+ static __wrap(ptr) {
+ const obj = Object.create(ProtectedHeaderMap.prototype);
+ obj.ptr = ptr;
+ ProtectedHeaderMapFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ProtectedHeaderMapFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_protectedheadermap_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protectedheadermap_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProtectedHeaderMap}
+ */
+ 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.protectedheadermap_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 ProtectedHeaderMap.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ static new_empty() {
+ const ret = wasm.protectedheadermap_new_empty();
+ return ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @param {HeaderMap} header_map
+ * @returns {ProtectedHeaderMap}
+ */
+ static new(header_map) {
+ _assertClass(header_map, HeaderMap);
+ const ret = wasm.protectedheadermap_new(header_map.ptr);
+ return ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @returns {HeaderMap}
+ */
+ deserialized_headers() {
+ const ret = wasm.protectedheadermap_deserialized_headers(this.ptr);
+ return HeaderMap.__wrap(ret);
+ }
+}
+module.exports.ProtectedHeaderMap = ProtectedHeaderMap;
+
+const PubKeyEncryptionFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_pubkeyencryption_free(ptr)
+);
+/** */
+class PubKeyEncryption {
+ static __wrap(ptr) {
+ const obj = Object.create(PubKeyEncryption.prototype);
+ obj.ptr = ptr;
+ PubKeyEncryptionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PubKeyEncryptionFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_pubkeyencryption_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.pubkeyencryption_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PubKeyEncryption}
+ */
+ 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.pubkeyencryption_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 PubKeyEncryption.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {COSEEncrypt} data
+ * @returns {PubKeyEncryption}
+ */
+ static new(data) {
+ _assertClass(data, COSEEncrypt);
+ const ret = wasm.pubkeyencryption_new(data.ptr);
+ return PubKeyEncryption.__wrap(ret);
+ }
+}
+module.exports.PubKeyEncryption = PubKeyEncryption;
+
+const SigStructureFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_sigstructure_free(ptr)
+);
+/** */
+class SigStructure {
+ static __wrap(ptr) {
+ const obj = Object.create(SigStructure.prototype);
+ obj.ptr = ptr;
+ SigStructureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ SigStructureFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_sigstructure_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.sigstructure_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {SigStructure}
+ */
+ 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.sigstructure_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 SigStructure.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {number}
+ */
+ context() {
+ const ret = wasm.sigstructure_context(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {ProtectedHeaderMap}
+ */
+ body_protected() {
+ const ret = wasm.sigstructure_body_protected(this.ptr);
+ return ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @returns {ProtectedHeaderMap | undefined}
+ */
+ sign_protected() {
+ const ret = wasm.sigstructure_sign_protected(this.ptr);
+ return ret === 0 ? undefined : ProtectedHeaderMap.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ external_aad() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.sigstructure_external_aad(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ payload() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.sigstructure_payload(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {ProtectedHeaderMap} sign_protected
+ */
+ set_sign_protected(sign_protected) {
+ _assertClass(sign_protected, ProtectedHeaderMap);
+ wasm.sigstructure_set_sign_protected(this.ptr, sign_protected.ptr);
+ }
+ /**
+ * @param {number} context
+ * @param {ProtectedHeaderMap} body_protected
+ * @param {Uint8Array} external_aad
+ * @param {Uint8Array} payload
+ * @returns {SigStructure}
+ */
+ static new(context, body_protected, external_aad, payload) {
+ _assertClass(body_protected, ProtectedHeaderMap);
+ const ptr0 = passArray8ToWasm0(external_aad, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.sigstructure_new(
+ context,
+ body_protected.ptr,
+ ptr0,
+ len0,
+ ptr1,
+ len1,
+ );
+ return SigStructure.__wrap(ret);
+ }
+}
+module.exports.SigStructure = SigStructure;
+
+const SignedMessageFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_signedmessage_free(ptr)
+);
+/** */
+class SignedMessage {
+ static __wrap(ptr) {
+ const obj = Object.create(SignedMessage.prototype);
+ obj.ptr = ptr;
+ SignedMessageFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ SignedMessageFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_signedmessage_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.signedmessage_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {SignedMessage}
+ */
+ 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.signedmessage_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 SignedMessage.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {COSESign} cose_sign
+ * @returns {SignedMessage}
+ */
+ static new_cose_sign(cose_sign) {
+ _assertClass(cose_sign, COSESign);
+ const ret = wasm.signedmessage_new_cose_sign(cose_sign.ptr);
+ return SignedMessage.__wrap(ret);
+ }
+ /**
+ * @param {COSESign1} cose_sign1
+ * @returns {SignedMessage}
+ */
+ static new_cose_sign1(cose_sign1) {
+ _assertClass(cose_sign1, COSESign1);
+ const ret = wasm.signedmessage_new_cose_sign1(cose_sign1.ptr);
+ return SignedMessage.__wrap(ret);
+ }
+ /**
+ * @param {string} s
+ * @returns {SignedMessage}
+ */
+ static from_user_facing_encoding(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.signedmessage_from_user_facing_encoding(retptr, ptr0, len0);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
+ if (r2) {
+ throw takeObject(r1);
+ }
+ return SignedMessage.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_user_facing_encoding() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.signedmessage_to_user_facing_encoding(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.signedmessage_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {COSESign | undefined}
+ */
+ as_cose_sign() {
+ const ret = wasm.signedmessage_as_cose_sign(this.ptr);
+ return ret === 0 ? undefined : COSESign.__wrap(ret);
+ }
+ /**
+ * @returns {COSESign1 | undefined}
+ */
+ as_cose_sign1() {
+ const ret = wasm.signedmessage_as_cose_sign1(this.ptr);
+ return ret === 0 ? undefined : COSESign1.__wrap(ret);
+ }
+}
+module.exports.SignedMessage = SignedMessage;
+
+const TaggedCBORFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_taggedcbor_free(ptr)
+);
+/** */
+class TaggedCBOR {
+ static __wrap(ptr) {
+ const obj = Object.create(TaggedCBOR.prototype);
+ obj.ptr = ptr;
+ TaggedCBORFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TaggedCBORFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_taggedcbor_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.taggedcbor_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TaggedCBOR}
+ */
+ 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.taggedcbor_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 TaggedCBOR.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {BigNum}
+ */
+ tag() {
+ const ret = wasm.taggedcbor_tag(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {CBORValue}
+ */
+ value() {
+ const ret = wasm.taggedcbor_value(this.ptr);
+ return CBORValue.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} tag
+ * @param {CBORValue} value
+ * @returns {TaggedCBOR}
+ */
+ static new(tag, value) {
+ _assertClass(tag, BigNum);
+ var ptr0 = tag.__destroy_into_raw();
+ _assertClass(value, CBORValue);
+ const ret = wasm.taggedcbor_new(ptr0, value.ptr);
+ return TaggedCBOR.__wrap(ret);
+ }
+}
+module.exports.TaggedCBOR = TaggedCBOR;
+
+module.exports.__wbindgen_object_drop_ref = function (arg0) {
+ takeObject(arg0);
+};
+
+module.exports.__wbindgen_string_new = function (arg0, arg1) {
+ const ret = getStringFromWasm0(arg0, arg1);
+ return addHeapObject(ret);
+};
+
+module.exports.__wbindgen_debug_string = function (arg0, arg1) {
+ const ret = debugString(getObject(arg1));
+ const ptr0 = passStringToWasm0(
+ ret,
+ wasm.__wbindgen_malloc,
+ wasm.__wbindgen_realloc,
+ );
+ const len0 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
+};
+
+module.exports.__wbindgen_throw = function (arg0, arg1) {
+ throw new Error(getStringFromWasm0(arg0, arg1));
+};
+
+const path = require("path").join(
+ __dirname,
+ "../cardano_message_signing_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;
diff --git a/dist/esm/src/core/libs/cardano_message_signing/nodejs/package.json b/dist/esm/src/core/libs/cardano_message_signing/nodejs/package.json
new file mode 100644
index 00000000..0292b995
--- /dev/null
+++ b/dist/esm/src/core/libs/cardano_message_signing/nodejs/package.json
@@ -0,0 +1 @@
+{"type":"commonjs"}
\ No newline at end of file
diff --git a/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.d.ts b/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.d.ts
new file mode 100644
index 00000000..5d52fd1c
--- /dev/null
+++ b/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.d.ts
@@ -0,0 +1,9358 @@
+/**
+ * @param {string} password
+ * @param {string} salt
+ * @param {string} nonce
+ * @param {string} data
+ * @returns {string}
+ */
+export function encrypt_with_password(password: string, salt: string, nonce: string, data: string): string;
+/**
+ * @param {string} password
+ * @param {string} data
+ * @returns {string}
+ */
+export function decrypt_with_password(password: string, data: string): string;
+/**
+ * @param {Transaction} tx
+ * @param {LinearFee} linear_fee
+ * @param {ExUnitPrices} ex_unit_prices
+ * @param {UnitInterval} minfee_refscript_cost_per_byte
+ * @param {TransactionOutputs} ref_script_outputs
+ * @returns {BigNum}
+ */
+export function min_fee(tx: Transaction, linear_fee: LinearFee, ex_unit_prices: ExUnitPrices, minfee_refscript_cost_per_byte: UnitInterval, ref_script_outputs: TransactionOutputs): BigNum;
+/**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionMetadatum}
+ */
+export function encode_arbitrary_bytes_as_metadatum(bytes: Uint8Array): TransactionMetadatum;
+/**
+ * @param {TransactionMetadatum} metadata
+ * @returns {Uint8Array}
+ */
+export function decode_arbitrary_bytes_from_metadatum(metadata: TransactionMetadatum): Uint8Array;
+/**
+ * @param {string} json
+ * @param {number} schema
+ * @returns {TransactionMetadatum}
+ */
+export function encode_json_str_to_metadatum(json: string, schema: number): TransactionMetadatum;
+/**
+ * @param {TransactionMetadatum} metadatum
+ * @param {number} schema
+ * @returns {string}
+ */
+export function decode_metadatum_to_json_str(metadatum: TransactionMetadatum, schema: number): string;
+/**
+ * @param {string} json
+ * @param {number} schema
+ * @returns {PlutusData}
+ */
+export function encode_json_str_to_plutus_datum(json: string, schema: number): PlutusData;
+/**
+ * @param {PlutusData} datum
+ * @param {number} schema
+ * @returns {string}
+ */
+export function decode_plutus_datum_to_json_str(datum: PlutusData, schema: number): string;
+/**
+ * @param {TransactionHash} tx_body_hash
+ * @param {ByronAddress} addr
+ * @param {LegacyDaedalusPrivateKey} key
+ * @returns {BootstrapWitness}
+ */
+export function make_daedalus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: LegacyDaedalusPrivateKey): BootstrapWitness;
+/**
+ * @param {TransactionHash} tx_body_hash
+ * @param {ByronAddress} addr
+ * @param {Bip32PrivateKey} key
+ * @returns {BootstrapWitness}
+ */
+export function make_icarus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: Bip32PrivateKey): BootstrapWitness;
+/**
+ * @param {TransactionHash} tx_body_hash
+ * @param {PrivateKey} sk
+ * @returns {Vkeywitness}
+ */
+export function make_vkey_witness(tx_body_hash: TransactionHash, sk: PrivateKey): Vkeywitness;
+/**
+ * @param {AuxiliaryData} auxiliary_data
+ * @returns {AuxiliaryDataHash}
+ */
+export function hash_auxiliary_data(auxiliary_data: AuxiliaryData): AuxiliaryDataHash;
+/**
+ * @param {TransactionBody} tx_body
+ * @returns {TransactionHash}
+ */
+export function hash_transaction(tx_body: TransactionBody): TransactionHash;
+/**
+ * @param {PlutusData} plutus_data
+ * @returns {DataHash}
+ */
+export function hash_plutus_data(plutus_data: PlutusData): DataHash;
+/**
+ * @param {Uint8Array} data
+ * @returns {Uint8Array}
+ */
+export function hash_blake2b256(data: Uint8Array): Uint8Array;
+/**
+ * @param {Uint8Array} data
+ * @returns {Uint8Array}
+ */
+export function hash_blake2b224(data: Uint8Array): Uint8Array;
+/**
+ * @param {Redeemers} redeemers
+ * @param {Costmdls} cost_models
+ * @param {PlutusList | undefined} datums
+ * @returns {ScriptDataHash}
+ */
+export function hash_script_data(redeemers: Redeemers, cost_models: Costmdls, datums: PlutusList | undefined): ScriptDataHash;
+/**
+ * @param {TransactionBody} txbody
+ * @param {BigNum} pool_deposit
+ * @param {BigNum} key_deposit
+ * @returns {Value}
+ */
+export function get_implicit_input(txbody: TransactionBody, pool_deposit: BigNum, key_deposit: BigNum): Value;
+/**
+ * @param {TransactionBody} txbody
+ * @param {BigNum} pool_deposit
+ * @param {BigNum} key_deposit
+ * @returns {BigNum}
+ */
+export function get_deposit(txbody: TransactionBody, pool_deposit: BigNum, key_deposit: BigNum): BigNum;
+/**
+ * @param {TransactionOutput} output
+ * @param {BigNum} coins_per_utxo_byte
+ * @returns {BigNum}
+ */
+export function min_ada_required(output: TransactionOutput, coins_per_utxo_byte: BigNum): BigNum;
+/**
+ * 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 {number} schema
+ * @returns {NativeScript}
+ */
+export function encode_json_str_to_native_script(json: string, self_xpub: string, schema: number): NativeScript;
+/**
+ * @param {PlutusList} params
+ * @param {PlutusScript} plutus_script
+ * @returns {PlutusScript}
+ */
+export function apply_params_to_plutus_script(params: PlutusList, plutus_script: PlutusScript): PlutusScript;
+/**
+ * Decompression callback
+ *
+ * @callback DecompressCallback
+ * @param {Uint8Array} compressed
+ * @return {Uint8Array} decompressed
+ */
+/**
+ * Options for instantiating a Wasm instance.
+ * @typedef {Object} InstantiateOptions
+ * @property {URL=} url - Optional url to the Wasm file to instantiate.
+ * @property {DecompressCallback=} decompress - Callback to decompress the
+ * raw Wasm file bytes before instantiating.
+ */
+/** Instantiates an instance of the Wasm module returning its functions.
+ * @remarks It is safe to call this multiple times and once successfully
+ * loaded it will always return a reference to the same object.
+ * @param {InstantiateOptions=} opts
+ */
+export function instantiate(opts?: InstantiateOptions | undefined): Promise<{
+ encrypt_with_password: typeof encrypt_with_password;
+ decrypt_with_password: typeof decrypt_with_password;
+ min_fee: typeof min_fee;
+ encode_arbitrary_bytes_as_metadatum: typeof encode_arbitrary_bytes_as_metadatum;
+ decode_arbitrary_bytes_from_metadatum: typeof decode_arbitrary_bytes_from_metadatum;
+ encode_json_str_to_metadatum: typeof encode_json_str_to_metadatum;
+ decode_metadatum_to_json_str: typeof decode_metadatum_to_json_str;
+ encode_json_str_to_plutus_datum: typeof encode_json_str_to_plutus_datum;
+ decode_plutus_datum_to_json_str: typeof decode_plutus_datum_to_json_str;
+ make_daedalus_bootstrap_witness: typeof make_daedalus_bootstrap_witness;
+ make_icarus_bootstrap_witness: typeof make_icarus_bootstrap_witness;
+ make_vkey_witness: typeof make_vkey_witness;
+ hash_auxiliary_data: typeof hash_auxiliary_data;
+ hash_transaction: typeof hash_transaction;
+ hash_plutus_data: typeof hash_plutus_data;
+ hash_blake2b256: typeof hash_blake2b256;
+ hash_blake2b224: typeof hash_blake2b224;
+ hash_script_data: typeof hash_script_data;
+ get_implicit_input: typeof get_implicit_input;
+ get_deposit: typeof get_deposit;
+ min_ada_required: typeof min_ada_required;
+ encode_json_str_to_native_script: typeof encode_json_str_to_native_script;
+ apply_params_to_plutus_script: typeof apply_params_to_plutus_script;
+ Address: typeof Address;
+ Anchor: typeof Anchor;
+ AssetName: typeof AssetName;
+ AssetNames: typeof AssetNames;
+ Assets: typeof Assets;
+ AuxiliaryData: typeof AuxiliaryData;
+ AuxiliaryDataHash: typeof AuxiliaryDataHash;
+ AuxiliaryDataSet: typeof AuxiliaryDataSet;
+ BaseAddress: typeof BaseAddress;
+ BigInt: typeof BigInt;
+ BigNum: typeof BigNum;
+ Bip32PrivateKey: typeof Bip32PrivateKey;
+ Bip32PublicKey: typeof Bip32PublicKey;
+ Block: typeof Block;
+ BlockHash: typeof BlockHash;
+ Blockfrost: typeof Blockfrost;
+ BootstrapWitness: typeof BootstrapWitness;
+ BootstrapWitnesses: typeof BootstrapWitnesses;
+ ByronAddress: typeof ByronAddress;
+ Certificate: typeof Certificate;
+ Certificates: typeof Certificates;
+ ConstrPlutusData: typeof ConstrPlutusData;
+ CostModel: typeof CostModel;
+ Costmdls: typeof Costmdls;
+ DNSRecordAorAAAA: typeof DNSRecordAorAAAA;
+ DNSRecordSRV: typeof DNSRecordSRV;
+ Data: typeof Data;
+ DataHash: typeof DataHash;
+ Datum: typeof Datum;
+ Drep: typeof Drep;
+ DrepVotingThresholds: typeof DrepVotingThresholds;
+ Ed25519KeyHash: typeof Ed25519KeyHash;
+ Ed25519KeyHashes: typeof Ed25519KeyHashes;
+ Ed25519Signature: typeof Ed25519Signature;
+ EnterpriseAddress: typeof EnterpriseAddress;
+ ExUnitPrices: typeof ExUnitPrices;
+ ExUnits: typeof ExUnits;
+ GeneralTransactionMetadata: typeof GeneralTransactionMetadata;
+ GenesisDelegateHash: typeof GenesisDelegateHash;
+ GenesisHash: typeof GenesisHash;
+ GenesisHashes: typeof GenesisHashes;
+ GenesisKeyDelegation: typeof GenesisKeyDelegation;
+ GovernanceAction: typeof GovernanceAction;
+ GovernanceActionId: typeof GovernanceActionId;
+ HardForkInitiationAction: typeof HardForkInitiationAction;
+ Header: typeof Header;
+ HeaderBody: typeof HeaderBody;
+ Int: typeof Int;
+ Ipv4: typeof Ipv4;
+ Ipv6: typeof Ipv6;
+ KESSignature: typeof KESSignature;
+ KESVKey: typeof KESVKey;
+ Language: typeof Language;
+ Languages: typeof Languages;
+ LegacyDaedalusPrivateKey: typeof LegacyDaedalusPrivateKey;
+ LinearFee: typeof LinearFee;
+ MIRToStakeCredentials: typeof MIRToStakeCredentials;
+ MetadataList: typeof MetadataList;
+ MetadataMap: typeof MetadataMap;
+ Mint: typeof Mint;
+ MintAssets: typeof MintAssets;
+ MoveInstantaneousReward: typeof MoveInstantaneousReward;
+ MoveInstantaneousRewardsCert: typeof MoveInstantaneousRewardsCert;
+ MultiAsset: typeof MultiAsset;
+ MultiHostName: typeof MultiHostName;
+ NativeScript: typeof NativeScript;
+ NativeScripts: typeof NativeScripts;
+ NetworkId: typeof NetworkId;
+ NetworkInfo: typeof NetworkInfo;
+ NewCommittee: typeof NewCommittee;
+ NewConstitution: typeof NewConstitution;
+ Nonce: typeof Nonce;
+ OperationalCert: typeof OperationalCert;
+ ParameterChangeAction: typeof ParameterChangeAction;
+ PlutusData: typeof PlutusData;
+ PlutusList: typeof PlutusList;
+ PlutusMap: typeof PlutusMap;
+ PlutusScript: typeof PlutusScript;
+ PlutusScripts: typeof PlutusScripts;
+ PlutusWitness: typeof PlutusWitness;
+ Pointer: typeof Pointer;
+ PointerAddress: typeof PointerAddress;
+ PoolMetadata: typeof PoolMetadata;
+ PoolMetadataHash: typeof PoolMetadataHash;
+ PoolParams: typeof PoolParams;
+ PoolRegistration: typeof PoolRegistration;
+ PoolRetirement: typeof PoolRetirement;
+ PoolVotingThresholds: typeof PoolVotingThresholds;
+ PrivateKey: typeof PrivateKey;
+ ProposalProcedure: typeof ProposalProcedure;
+ ProposalProcedures: typeof ProposalProcedures;
+ ProposedProtocolParameterUpdates: typeof ProposedProtocolParameterUpdates;
+ ProtocolParamUpdate: typeof ProtocolParamUpdate;
+ ProtocolVersion: typeof ProtocolVersion;
+ PublicKey: typeof PublicKey;
+ PublicKeys: typeof PublicKeys;
+ Redeemer: typeof Redeemer;
+ RedeemerTag: typeof RedeemerTag;
+ RedeemerWitnessKey: typeof RedeemerWitnessKey;
+ Redeemers: typeof Redeemers;
+ RegCert: typeof RegCert;
+ RegCommitteeHotKeyCert: typeof RegCommitteeHotKeyCert;
+ RegDrepCert: typeof RegDrepCert;
+ Relay: typeof Relay;
+ Relays: typeof Relays;
+ RequiredWitnessSet: typeof RequiredWitnessSet;
+ RewardAddress: typeof RewardAddress;
+ RewardAddresses: typeof RewardAddresses;
+ Script: typeof Script;
+ ScriptAll: typeof ScriptAll;
+ ScriptAny: typeof ScriptAny;
+ ScriptDataHash: typeof ScriptDataHash;
+ ScriptHash: typeof ScriptHash;
+ ScriptHashes: typeof ScriptHashes;
+ ScriptNOfK: typeof ScriptNOfK;
+ ScriptPubkey: typeof ScriptPubkey;
+ ScriptRef: typeof ScriptRef;
+ ScriptWitness: typeof ScriptWitness;
+ SingleHostAddr: typeof SingleHostAddr;
+ SingleHostName: typeof SingleHostName;
+ StakeCredential: typeof StakeCredential;
+ StakeCredentials: typeof StakeCredentials;
+ StakeDelegation: typeof StakeDelegation;
+ StakeDeregistration: typeof StakeDeregistration;
+ StakeRegDelegCert: typeof StakeRegDelegCert;
+ StakeRegistration: typeof StakeRegistration;
+ StakeVoteDelegCert: typeof StakeVoteDelegCert;
+ StakeVoteRegDelegCert: typeof StakeVoteRegDelegCert;
+ Strings: typeof Strings;
+ TimelockExpiry: typeof TimelockExpiry;
+ TimelockStart: typeof TimelockStart;
+ Transaction: typeof Transaction;
+ TransactionBodies: typeof TransactionBodies;
+ TransactionBody: typeof TransactionBody;
+ TransactionBuilder: typeof TransactionBuilder;
+ TransactionBuilderConfig: typeof TransactionBuilderConfig;
+ TransactionBuilderConfigBuilder: typeof TransactionBuilderConfigBuilder;
+ TransactionHash: typeof TransactionHash;
+ TransactionIndexes: typeof TransactionIndexes;
+ TransactionInput: typeof TransactionInput;
+ TransactionInputs: typeof TransactionInputs;
+ TransactionMetadatum: typeof TransactionMetadatum;
+ TransactionMetadatumLabels: typeof TransactionMetadatumLabels;
+ TransactionOutput: typeof TransactionOutput;
+ TransactionOutputAmountBuilder: typeof TransactionOutputAmountBuilder;
+ TransactionOutputBuilder: typeof TransactionOutputBuilder;
+ TransactionOutputs: typeof TransactionOutputs;
+ TransactionUnspentOutput: typeof TransactionUnspentOutput;
+ TransactionUnspentOutputs: typeof TransactionUnspentOutputs;
+ TransactionWitnessSet: typeof TransactionWitnessSet;
+ TransactionWitnessSetBuilder: typeof TransactionWitnessSetBuilder;
+ TransactionWitnessSets: typeof TransactionWitnessSets;
+ TreasuryWithdrawals: typeof TreasuryWithdrawals;
+ TreasuryWithdrawalsAction: typeof TreasuryWithdrawalsAction;
+ UnitInterval: typeof UnitInterval;
+ UnregCert: typeof UnregCert;
+ UnregCommitteeHotKeyCert: typeof UnregCommitteeHotKeyCert;
+ UnregDrepCert: typeof UnregDrepCert;
+ Update: typeof Update;
+ Url: typeof Url;
+ VRFCert: typeof VRFCert;
+ VRFKeyHash: typeof VRFKeyHash;
+ VRFVKey: typeof VRFVKey;
+ Value: typeof Value;
+ Vkey: typeof Vkey;
+ Vkeys: typeof Vkeys;
+ Vkeywitness: typeof Vkeywitness;
+ Vkeywitnesses: typeof Vkeywitnesses;
+ Vote: typeof Vote;
+ VoteDelegCert: typeof VoteDelegCert;
+ VoteRegDelegCert: typeof VoteRegDelegCert;
+ Voter: typeof Voter;
+ VotingProcedure: typeof VotingProcedure;
+ VotingProcedures: typeof VotingProcedures;
+ Withdrawals: typeof Withdrawals;
+}>;
+/** Instantiates an instance of the Wasm module along with its exports.
+ * @remarks It is safe to call this multiple times and once successfully
+ * loaded it will always return a reference to the same object.
+ * @param {InstantiateOptions=} opts
+ * @returns {Promise<{
+ * instance: WebAssembly.Instance;
+ * exports: { encrypt_with_password: typeof encrypt_with_password; decrypt_with_password: typeof decrypt_with_password; min_fee: typeof min_fee; encode_arbitrary_bytes_as_metadatum: typeof encode_arbitrary_bytes_as_metadatum; decode_arbitrary_bytes_from_metadatum: typeof decode_arbitrary_bytes_from_metadatum; encode_json_str_to_metadatum: typeof encode_json_str_to_metadatum; decode_metadatum_to_json_str: typeof decode_metadatum_to_json_str; encode_json_str_to_plutus_datum: typeof encode_json_str_to_plutus_datum; decode_plutus_datum_to_json_str: typeof decode_plutus_datum_to_json_str; make_daedalus_bootstrap_witness: typeof make_daedalus_bootstrap_witness; make_icarus_bootstrap_witness: typeof make_icarus_bootstrap_witness; make_vkey_witness: typeof make_vkey_witness; hash_auxiliary_data: typeof hash_auxiliary_data; hash_transaction: typeof hash_transaction; hash_plutus_data: typeof hash_plutus_data; hash_blake2b256: typeof hash_blake2b256; hash_blake2b224: typeof hash_blake2b224; hash_script_data: typeof hash_script_data; get_implicit_input: typeof get_implicit_input; get_deposit: typeof get_deposit; min_ada_required: typeof min_ada_required; encode_json_str_to_native_script: typeof encode_json_str_to_native_script; apply_params_to_plutus_script: typeof apply_params_to_plutus_script; Address : typeof Address ; Anchor : typeof Anchor ; AssetName : typeof AssetName ; AssetNames : typeof AssetNames ; Assets : typeof Assets ; AuxiliaryData : typeof AuxiliaryData ; AuxiliaryDataHash : typeof AuxiliaryDataHash ; AuxiliaryDataSet : typeof AuxiliaryDataSet ; BaseAddress : typeof BaseAddress ; BigInt : typeof BigInt ; BigNum : typeof BigNum ; Bip32PrivateKey : typeof Bip32PrivateKey ; Bip32PublicKey : typeof Bip32PublicKey ; Block : typeof Block ; BlockHash : typeof BlockHash ; Blockfrost : typeof Blockfrost ; BootstrapWitness : typeof BootstrapWitness ; BootstrapWitnesses : typeof BootstrapWitnesses ; ByronAddress : typeof ByronAddress ; Certificate : typeof Certificate ; Certificates : typeof Certificates ; ConstrPlutusData : typeof ConstrPlutusData ; CostModel : typeof CostModel ; Costmdls : typeof Costmdls ; DNSRecordAorAAAA : typeof DNSRecordAorAAAA ; DNSRecordSRV : typeof DNSRecordSRV ; Data : typeof Data ; DataHash : typeof DataHash ; Datum : typeof Datum ; Drep : typeof Drep ; DrepVotingThresholds : typeof DrepVotingThresholds ; Ed25519KeyHash : typeof Ed25519KeyHash ; Ed25519KeyHashes : typeof Ed25519KeyHashes ; Ed25519Signature : typeof Ed25519Signature ; EnterpriseAddress : typeof EnterpriseAddress ; ExUnitPrices : typeof ExUnitPrices ; ExUnits : typeof ExUnits ; GeneralTransactionMetadata : typeof GeneralTransactionMetadata ; GenesisDelegateHash : typeof GenesisDelegateHash ; GenesisHash : typeof GenesisHash ; GenesisHashes : typeof GenesisHashes ; GenesisKeyDelegation : typeof GenesisKeyDelegation ; GovernanceAction : typeof GovernanceAction ; GovernanceActionId : typeof GovernanceActionId ; HardForkInitiationAction : typeof HardForkInitiationAction ; Header : typeof Header ; HeaderBody : typeof HeaderBody ; Int : typeof Int ; Ipv4 : typeof Ipv4 ; Ipv6 : typeof Ipv6 ; KESSignature : typeof KESSignature ; KESVKey : typeof KESVKey ; Language : typeof Language ; Languages : typeof Languages ; LegacyDaedalusPrivateKey : typeof LegacyDaedalusPrivateKey ; LinearFee : typeof LinearFee ; MIRToStakeCredentials : typeof MIRToStakeCredentials ; MetadataList : typeof MetadataList ; MetadataMap : typeof MetadataMap ; Mint : typeof Mint ; MintAssets : typeof MintAssets ; MoveInstantaneousReward : typeof MoveInstantaneousReward ; MoveInstantaneousRewardsCert : typeof MoveInstantaneousRewardsCert ; MultiAsset : typeof MultiAsset ; MultiHostName : typeof MultiHostName ; NativeScript : typeof NativeScript ; NativeScripts : typeof NativeScripts ; NetworkId : typeof NetworkId ; NetworkInfo : typeof NetworkInfo ; NewCommittee : typeof NewCommittee ; NewConstitution : typeof NewConstitution ; Nonce : typeof Nonce ; OperationalCert : typeof OperationalCert ; ParameterChangeAction : typeof ParameterChangeAction ; PlutusData : typeof PlutusData ; PlutusList : typeof PlutusList ; PlutusMap : typeof PlutusMap ; PlutusScript : typeof PlutusScript ; PlutusScripts : typeof PlutusScripts ; PlutusWitness : typeof PlutusWitness ; Pointer : typeof Pointer ; PointerAddress : typeof PointerAddress ; PoolMetadata : typeof PoolMetadata ; PoolMetadataHash : typeof PoolMetadataHash ; PoolParams : typeof PoolParams ; PoolRegistration : typeof PoolRegistration ; PoolRetirement : typeof PoolRetirement ; PoolVotingThresholds : typeof PoolVotingThresholds ; PrivateKey : typeof PrivateKey ; ProposalProcedure : typeof ProposalProcedure ; ProposalProcedures : typeof ProposalProcedures ; ProposedProtocolParameterUpdates : typeof ProposedProtocolParameterUpdates ; ProtocolParamUpdate : typeof ProtocolParamUpdate ; ProtocolVersion : typeof ProtocolVersion ; PublicKey : typeof PublicKey ; PublicKeys : typeof PublicKeys ; Redeemer : typeof Redeemer ; RedeemerTag : typeof RedeemerTag ; RedeemerWitnessKey : typeof RedeemerWitnessKey ; Redeemers : typeof Redeemers ; RegCert : typeof RegCert ; RegCommitteeHotKeyCert : typeof RegCommitteeHotKeyCert ; RegDrepCert : typeof RegDrepCert ; Relay : typeof Relay ; Relays : typeof Relays ; RequiredWitnessSet : typeof RequiredWitnessSet ; RewardAddress : typeof RewardAddress ; RewardAddresses : typeof RewardAddresses ; Script : typeof Script ; ScriptAll : typeof ScriptAll ; ScriptAny : typeof ScriptAny ; ScriptDataHash : typeof ScriptDataHash ; ScriptHash : typeof ScriptHash ; ScriptHashes : typeof ScriptHashes ; ScriptNOfK : typeof ScriptNOfK ; ScriptPubkey : typeof ScriptPubkey ; ScriptRef : typeof ScriptRef ; ScriptWitness : typeof ScriptWitness ; SingleHostAddr : typeof SingleHostAddr ; SingleHostName : typeof SingleHostName ; StakeCredential : typeof StakeCredential ; StakeCredentials : typeof StakeCredentials ; StakeDelegation : typeof StakeDelegation ; StakeDeregistration : typeof StakeDeregistration ; StakeRegDelegCert : typeof StakeRegDelegCert ; StakeRegistration : typeof StakeRegistration ; StakeVoteDelegCert : typeof StakeVoteDelegCert ; StakeVoteRegDelegCert : typeof StakeVoteRegDelegCert ; Strings : typeof Strings ; TimelockExpiry : typeof TimelockExpiry ; TimelockStart : typeof TimelockStart ; Transaction : typeof Transaction ; TransactionBodies : typeof TransactionBodies ; TransactionBody : typeof TransactionBody ; TransactionBuilder : typeof TransactionBuilder ; TransactionBuilderConfig : typeof TransactionBuilderConfig ; TransactionBuilderConfigBuilder : typeof TransactionBuilderConfigBuilder ; TransactionHash : typeof TransactionHash ; TransactionIndexes : typeof TransactionIndexes ; TransactionInput : typeof TransactionInput ; TransactionInputs : typeof TransactionInputs ; TransactionMetadatum : typeof TransactionMetadatum ; TransactionMetadatumLabels : typeof TransactionMetadatumLabels ; TransactionOutput : typeof TransactionOutput ; TransactionOutputAmountBuilder : typeof TransactionOutputAmountBuilder ; TransactionOutputBuilder : typeof TransactionOutputBuilder ; TransactionOutputs : typeof TransactionOutputs ; TransactionUnspentOutput : typeof TransactionUnspentOutput ; TransactionUnspentOutputs : typeof TransactionUnspentOutputs ; TransactionWitnessSet : typeof TransactionWitnessSet ; TransactionWitnessSetBuilder : typeof TransactionWitnessSetBuilder ; TransactionWitnessSets : typeof TransactionWitnessSets ; TreasuryWithdrawals : typeof TreasuryWithdrawals ; TreasuryWithdrawalsAction : typeof TreasuryWithdrawalsAction ; UnitInterval : typeof UnitInterval ; UnregCert : typeof UnregCert ; UnregCommitteeHotKeyCert : typeof UnregCommitteeHotKeyCert ; UnregDrepCert : typeof UnregDrepCert ; Update : typeof Update ; Url : typeof Url ; VRFCert : typeof VRFCert ; VRFKeyHash : typeof VRFKeyHash ; VRFVKey : typeof VRFVKey ; Value : typeof Value ; Vkey : typeof Vkey ; Vkeys : typeof Vkeys ; Vkeywitness : typeof Vkeywitness ; Vkeywitnesses : typeof Vkeywitnesses ; Vote : typeof Vote ; VoteDelegCert : typeof VoteDelegCert ; VoteRegDelegCert : typeof VoteRegDelegCert ; Voter : typeof Voter ; VotingProcedure : typeof VotingProcedure ; VotingProcedures : typeof VotingProcedures ; Withdrawals : typeof Withdrawals }
+ * }>}
+ */
+export function instantiateWithInstance(opts?: InstantiateOptions | undefined): Promise<{
+ instance: WebAssembly.Instance;
+ exports: {
+ encrypt_with_password: typeof encrypt_with_password;
+ decrypt_with_password: typeof decrypt_with_password;
+ min_fee: typeof min_fee;
+ encode_arbitrary_bytes_as_metadatum: typeof encode_arbitrary_bytes_as_metadatum;
+ decode_arbitrary_bytes_from_metadatum: typeof decode_arbitrary_bytes_from_metadatum;
+ encode_json_str_to_metadatum: typeof encode_json_str_to_metadatum;
+ decode_metadatum_to_json_str: typeof decode_metadatum_to_json_str;
+ encode_json_str_to_plutus_datum: typeof encode_json_str_to_plutus_datum;
+ decode_plutus_datum_to_json_str: typeof decode_plutus_datum_to_json_str;
+ make_daedalus_bootstrap_witness: typeof make_daedalus_bootstrap_witness;
+ make_icarus_bootstrap_witness: typeof make_icarus_bootstrap_witness;
+ make_vkey_witness: typeof make_vkey_witness;
+ hash_auxiliary_data: typeof hash_auxiliary_data;
+ hash_transaction: typeof hash_transaction;
+ hash_plutus_data: typeof hash_plutus_data;
+ hash_blake2b256: typeof hash_blake2b256;
+ hash_blake2b224: typeof hash_blake2b224;
+ hash_script_data: typeof hash_script_data;
+ get_implicit_input: typeof get_implicit_input;
+ get_deposit: typeof get_deposit;
+ min_ada_required: typeof min_ada_required;
+ encode_json_str_to_native_script: typeof encode_json_str_to_native_script;
+ apply_params_to_plutus_script: typeof apply_params_to_plutus_script;
+ Address: typeof Address;
+ Anchor: typeof Anchor;
+ AssetName: typeof AssetName;
+ AssetNames: typeof AssetNames;
+ Assets: typeof Assets;
+ AuxiliaryData: typeof AuxiliaryData;
+ AuxiliaryDataHash: typeof AuxiliaryDataHash;
+ AuxiliaryDataSet: typeof AuxiliaryDataSet;
+ BaseAddress: typeof BaseAddress;
+ BigInt: typeof BigInt;
+ BigNum: typeof BigNum;
+ Bip32PrivateKey: typeof Bip32PrivateKey;
+ Bip32PublicKey: typeof Bip32PublicKey;
+ Block: typeof Block;
+ BlockHash: typeof BlockHash;
+ Blockfrost: typeof Blockfrost;
+ BootstrapWitness: typeof BootstrapWitness;
+ BootstrapWitnesses: typeof BootstrapWitnesses;
+ ByronAddress: typeof ByronAddress;
+ Certificate: typeof Certificate;
+ Certificates: typeof Certificates;
+ ConstrPlutusData: typeof ConstrPlutusData;
+ CostModel: typeof CostModel;
+ Costmdls: typeof Costmdls;
+ DNSRecordAorAAAA: typeof DNSRecordAorAAAA;
+ DNSRecordSRV: typeof DNSRecordSRV;
+ Data: typeof Data;
+ DataHash: typeof DataHash;
+ Datum: typeof Datum;
+ Drep: typeof Drep;
+ DrepVotingThresholds: typeof DrepVotingThresholds;
+ Ed25519KeyHash: typeof Ed25519KeyHash;
+ Ed25519KeyHashes: typeof Ed25519KeyHashes;
+ Ed25519Signature: typeof Ed25519Signature;
+ EnterpriseAddress: typeof EnterpriseAddress;
+ ExUnitPrices: typeof ExUnitPrices;
+ ExUnits: typeof ExUnits;
+ GeneralTransactionMetadata: typeof GeneralTransactionMetadata;
+ GenesisDelegateHash: typeof GenesisDelegateHash;
+ GenesisHash: typeof GenesisHash;
+ GenesisHashes: typeof GenesisHashes;
+ GenesisKeyDelegation: typeof GenesisKeyDelegation;
+ GovernanceAction: typeof GovernanceAction;
+ GovernanceActionId: typeof GovernanceActionId;
+ HardForkInitiationAction: typeof HardForkInitiationAction;
+ Header: typeof Header;
+ HeaderBody: typeof HeaderBody;
+ Int: typeof Int;
+ Ipv4: typeof Ipv4;
+ Ipv6: typeof Ipv6;
+ KESSignature: typeof KESSignature;
+ KESVKey: typeof KESVKey;
+ Language: typeof Language;
+ Languages: typeof Languages;
+ LegacyDaedalusPrivateKey: typeof LegacyDaedalusPrivateKey;
+ LinearFee: typeof LinearFee;
+ MIRToStakeCredentials: typeof MIRToStakeCredentials;
+ MetadataList: typeof MetadataList;
+ MetadataMap: typeof MetadataMap;
+ Mint: typeof Mint;
+ MintAssets: typeof MintAssets;
+ MoveInstantaneousReward: typeof MoveInstantaneousReward;
+ MoveInstantaneousRewardsCert: typeof MoveInstantaneousRewardsCert;
+ MultiAsset: typeof MultiAsset;
+ MultiHostName: typeof MultiHostName;
+ NativeScript: typeof NativeScript;
+ NativeScripts: typeof NativeScripts;
+ NetworkId: typeof NetworkId;
+ NetworkInfo: typeof NetworkInfo;
+ NewCommittee: typeof NewCommittee;
+ NewConstitution: typeof NewConstitution;
+ Nonce: typeof Nonce;
+ OperationalCert: typeof OperationalCert;
+ ParameterChangeAction: typeof ParameterChangeAction;
+ PlutusData: typeof PlutusData;
+ PlutusList: typeof PlutusList;
+ PlutusMap: typeof PlutusMap;
+ PlutusScript: typeof PlutusScript;
+ PlutusScripts: typeof PlutusScripts;
+ PlutusWitness: typeof PlutusWitness;
+ Pointer: typeof Pointer;
+ PointerAddress: typeof PointerAddress;
+ PoolMetadata: typeof PoolMetadata;
+ PoolMetadataHash: typeof PoolMetadataHash;
+ PoolParams: typeof PoolParams;
+ PoolRegistration: typeof PoolRegistration;
+ PoolRetirement: typeof PoolRetirement;
+ PoolVotingThresholds: typeof PoolVotingThresholds;
+ PrivateKey: typeof PrivateKey;
+ ProposalProcedure: typeof ProposalProcedure;
+ ProposalProcedures: typeof ProposalProcedures;
+ ProposedProtocolParameterUpdates: typeof ProposedProtocolParameterUpdates;
+ ProtocolParamUpdate: typeof ProtocolParamUpdate;
+ ProtocolVersion: typeof ProtocolVersion;
+ PublicKey: typeof PublicKey;
+ PublicKeys: typeof PublicKeys;
+ Redeemer: typeof Redeemer;
+ RedeemerTag: typeof RedeemerTag;
+ RedeemerWitnessKey: typeof RedeemerWitnessKey;
+ Redeemers: typeof Redeemers;
+ RegCert: typeof RegCert;
+ RegCommitteeHotKeyCert: typeof RegCommitteeHotKeyCert;
+ RegDrepCert: typeof RegDrepCert;
+ Relay: typeof Relay;
+ Relays: typeof Relays;
+ RequiredWitnessSet: typeof RequiredWitnessSet;
+ RewardAddress: typeof RewardAddress;
+ RewardAddresses: typeof RewardAddresses;
+ Script: typeof Script;
+ ScriptAll: typeof ScriptAll;
+ ScriptAny: typeof ScriptAny;
+ ScriptDataHash: typeof ScriptDataHash;
+ ScriptHash: typeof ScriptHash;
+ ScriptHashes: typeof ScriptHashes;
+ ScriptNOfK: typeof ScriptNOfK;
+ ScriptPubkey: typeof ScriptPubkey;
+ ScriptRef: typeof ScriptRef;
+ ScriptWitness: typeof ScriptWitness;
+ SingleHostAddr: typeof SingleHostAddr;
+ SingleHostName: typeof SingleHostName;
+ StakeCredential: typeof StakeCredential;
+ StakeCredentials: typeof StakeCredentials;
+ StakeDelegation: typeof StakeDelegation;
+ StakeDeregistration: typeof StakeDeregistration;
+ StakeRegDelegCert: typeof StakeRegDelegCert;
+ StakeRegistration: typeof StakeRegistration;
+ StakeVoteDelegCert: typeof StakeVoteDelegCert;
+ StakeVoteRegDelegCert: typeof StakeVoteRegDelegCert;
+ Strings: typeof Strings;
+ TimelockExpiry: typeof TimelockExpiry;
+ TimelockStart: typeof TimelockStart;
+ Transaction: typeof Transaction;
+ TransactionBodies: typeof TransactionBodies;
+ TransactionBody: typeof TransactionBody;
+ TransactionBuilder: typeof TransactionBuilder;
+ TransactionBuilderConfig: typeof TransactionBuilderConfig;
+ TransactionBuilderConfigBuilder: typeof TransactionBuilderConfigBuilder;
+ TransactionHash: typeof TransactionHash;
+ TransactionIndexes: typeof TransactionIndexes;
+ TransactionInput: typeof TransactionInput;
+ TransactionInputs: typeof TransactionInputs;
+ TransactionMetadatum: typeof TransactionMetadatum;
+ TransactionMetadatumLabels: typeof TransactionMetadatumLabels;
+ TransactionOutput: typeof TransactionOutput;
+ TransactionOutputAmountBuilder: typeof TransactionOutputAmountBuilder;
+ TransactionOutputBuilder: typeof TransactionOutputBuilder;
+ TransactionOutputs: typeof TransactionOutputs;
+ TransactionUnspentOutput: typeof TransactionUnspentOutput;
+ TransactionUnspentOutputs: typeof TransactionUnspentOutputs;
+ TransactionWitnessSet: typeof TransactionWitnessSet;
+ TransactionWitnessSetBuilder: typeof TransactionWitnessSetBuilder;
+ TransactionWitnessSets: typeof TransactionWitnessSets;
+ TreasuryWithdrawals: typeof TreasuryWithdrawals;
+ TreasuryWithdrawalsAction: typeof TreasuryWithdrawalsAction;
+ UnitInterval: typeof UnitInterval;
+ UnregCert: typeof UnregCert;
+ UnregCommitteeHotKeyCert: typeof UnregCommitteeHotKeyCert;
+ UnregDrepCert: typeof UnregDrepCert;
+ Update: typeof Update;
+ Url: typeof Url;
+ VRFCert: typeof VRFCert;
+ VRFKeyHash: typeof VRFKeyHash;
+ VRFVKey: typeof VRFVKey;
+ Value: typeof Value;
+ Vkey: typeof Vkey;
+ Vkeys: typeof Vkeys;
+ Vkeywitness: typeof Vkeywitness;
+ Vkeywitnesses: typeof Vkeywitnesses;
+ Vote: typeof Vote;
+ VoteDelegCert: typeof VoteDelegCert;
+ VoteRegDelegCert: typeof VoteRegDelegCert;
+ Voter: typeof Voter;
+ VotingProcedure: typeof VotingProcedure;
+ VotingProcedures: typeof VotingProcedures;
+ Withdrawals: typeof Withdrawals;
+ };
+}>;
+/** Gets if the Wasm module has been instantiated. */
+export function isInstantiated(): boolean;
+/** */
+export const StakeCredKind: Readonly<{
+ Key: 0;
+ "0": "Key";
+ Script: 1;
+ "1": "Script";
+}>;
+/** */
+export const GovernanceActionKind: Readonly<{
+ ParameterChangeAction: 0;
+ "0": "ParameterChangeAction";
+ HardForkInitiationAction: 1;
+ "1": "HardForkInitiationAction";
+ TreasuryWithdrawalsAction: 2;
+ "2": "TreasuryWithdrawalsAction";
+ NoConfidence: 3;
+ "3": "NoConfidence";
+ NewCommittee: 4;
+ "4": "NewCommittee";
+ NewConstitution: 5;
+ "5": "NewConstitution";
+ InfoAction: 6;
+ "6": "InfoAction";
+}>;
+/** */
+export const VoterKind: Readonly<{
+ CommitteeHotKeyHash: 0;
+ "0": "CommitteeHotKeyHash";
+ CommitteeHotScriptHash: 1;
+ "1": "CommitteeHotScriptHash";
+ DrepKeyHash: 2;
+ "2": "DrepKeyHash";
+ DrepScriptHash: 3;
+ "3": "DrepScriptHash";
+ StakingPoolKeyHash: 4;
+ "4": "StakingPoolKeyHash";
+}>;
+/** */
+export const VoteKind: Readonly<{
+ No: 0;
+ "0": "No";
+ Yes: 1;
+ "1": "Yes";
+ Abstain: 2;
+ "2": "Abstain";
+}>;
+/** */
+export const DrepKind: Readonly<{
+ KeyHash: 0;
+ "0": "KeyHash";
+ ScriptHash: 1;
+ "1": "ScriptHash";
+ Abstain: 2;
+ "2": "Abstain";
+ NoConfidence: 3;
+ "3": "NoConfidence";
+}>;
+/** */
+export const TransactionMetadatumKind: Readonly<{
+ MetadataMap: 0;
+ "0": "MetadataMap";
+ MetadataList: 1;
+ "1": "MetadataList";
+ Int: 2;
+ "2": "Int";
+ Bytes: 3;
+ "3": "Bytes";
+ Text: 4;
+ "4": "Text";
+}>;
+/** */
+export const MetadataJsonSchema: Readonly<{
+ NoConversions: 0;
+ "0": "NoConversions";
+ BasicConversions: 1;
+ "1": "BasicConversions";
+ DetailedSchema: 2;
+ "2": "DetailedSchema";
+}>;
+/** */
+export const LanguageKind: Readonly<{
+ PlutusV1: 0;
+ "0": "PlutusV1";
+ PlutusV2: 1;
+ "1": "PlutusV2";
+ PlutusV3: 2;
+ "2": "PlutusV3";
+}>;
+/** */
+export const PlutusDataKind: Readonly<{
+ ConstrPlutusData: 0;
+ "0": "ConstrPlutusData";
+ Map: 1;
+ "1": "Map";
+ List: 2;
+ "2": "List";
+ Integer: 3;
+ "3": "Integer";
+ Bytes: 4;
+ "4": "Bytes";
+}>;
+/** */
+export const RedeemerTagKind: Readonly<{
+ Spend: 0;
+ "0": "Spend";
+ Mint: 1;
+ "1": "Mint";
+ Cert: 2;
+ "2": "Cert";
+ Reward: 3;
+ "3": "Reward";
+ Voting: 4;
+ "4": "Voting";
+ Proposing: 5;
+ "5": "Proposing";
+}>;
+/**
+ * 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
+ */
+export const PlutusDatumSchema: Readonly<{
+ /**
+ * 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";
+}>;
+/** */
+export const ScriptKind: Readonly<{
+ NativeScript: 0;
+ "0": "NativeScript";
+ PlutusScriptV1: 1;
+ "1": "PlutusScriptV1";
+ PlutusScriptV2: 2;
+ "2": "PlutusScriptV2";
+ PlutusScriptV3: 3;
+ "3": "PlutusScriptV3";
+}>;
+/** */
+export const DatumKind: Readonly<{
+ Hash: 0;
+ "0": "Hash";
+ Data: 1;
+ "1": "Data";
+}>;
+/**
+ * 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
+ * https://github.com/input-output-hk/cardano-ledger/blob/9c3b4737b13b30f71529e76c5330f403165e28a6/eras/alonzo/impl/src/Cardano/Ledger/Alonzo.hs#L127
+ */
+export const ScriptHashNamespace: Readonly<{
+ NativeScript: 0;
+ "0": "NativeScript";
+ PlutusV1: 1;
+ "1": "PlutusV1";
+ PlutusV2: 2;
+ "2": "PlutusV2";
+}>;
+/**
+ * Used to choose the schema for a script JSON string
+ */
+export const ScriptSchema: Readonly<{
+ Wallet: 0;
+ "0": "Wallet";
+ Node: 1;
+ "1": "Node";
+}>;
+/** */
+export const ScriptWitnessKind: Readonly<{
+ NativeWitness: 0;
+ "0": "NativeWitness";
+ PlutusWitness: 1;
+ "1": "PlutusWitness";
+}>;
+/** */
+export const CertificateKind: Readonly<{
+ 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";
+ RegCert: 7;
+ "7": "RegCert";
+ UnregCert: 8;
+ "8": "UnregCert";
+ VoteDelegCert: 9;
+ "9": "VoteDelegCert";
+ StakeVoteDelegCert: 10;
+ "10": "StakeVoteDelegCert";
+ StakeRegDelegCert: 11;
+ "11": "StakeRegDelegCert";
+ VoteRegDelegCert: 12;
+ "12": "VoteRegDelegCert";
+ StakeVoteRegDelegCert: 13;
+ "13": "StakeVoteRegDelegCert";
+ RegCommitteeHotKeyCert: 14;
+ "14": "RegCommitteeHotKeyCert";
+ UnregCommitteeHotKeyCert: 15;
+ "15": "UnregCommitteeHotKeyCert";
+ RegDrepCert: 16;
+ "16": "RegDrepCert";
+ UnregDrepCert: 17;
+ "17": "UnregDrepCert";
+}>;
+/** */
+export const MIRPot: Readonly<{
+ Reserves: 0;
+ "0": "Reserves";
+ Treasury: 1;
+ "1": "Treasury";
+}>;
+/** */
+export const MIRKind: Readonly<{
+ ToOtherPot: 0;
+ "0": "ToOtherPot";
+ ToStakeCredentials: 1;
+ "1": "ToStakeCredentials";
+}>;
+/** */
+export const RelayKind: Readonly<{
+ SingleHostAddr: 0;
+ "0": "SingleHostAddr";
+ SingleHostName: 1;
+ "1": "SingleHostName";
+ MultiHostName: 2;
+ "2": "MultiHostName";
+}>;
+/** */
+export const NativeScriptKind: Readonly<{
+ ScriptPubkey: 0;
+ "0": "ScriptPubkey";
+ ScriptAll: 1;
+ "1": "ScriptAll";
+ ScriptAny: 2;
+ "2": "ScriptAny";
+ ScriptNOfK: 3;
+ "3": "ScriptNOfK";
+ TimelockStart: 4;
+ "4": "TimelockStart";
+ TimelockExpiry: 5;
+ "5": "TimelockExpiry";
+}>;
+/** */
+export const NetworkIdKind: Readonly<{
+ Testnet: 0;
+ "0": "Testnet";
+ Mainnet: 1;
+ "1": "Mainnet";
+}>;
+/** */
+export class Address {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} data
+ * @returns {Address}
+ */
+ static from_bytes(data: Uint8Array): Address;
+ /**
+ * @param {string} json
+ * @returns {Address}
+ */
+ static from_json(json: string): Address;
+ /**
+ * @param {string} bech_str
+ * @returns {Address}
+ */
+ static from_bech32(bech_str: string): Address;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string | undefined} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string | undefined): string;
+ /**
+ * @returns {number}
+ */
+ network_id(): number;
+ /**
+ * @returns {ByronAddress | undefined}
+ */
+ as_byron(): ByronAddress | undefined;
+ /**
+ * @returns {RewardAddress | undefined}
+ */
+ as_reward(): RewardAddress | undefined;
+ /**
+ * @returns {PointerAddress | undefined}
+ */
+ as_pointer(): PointerAddress | undefined;
+ /**
+ * @returns {EnterpriseAddress | undefined}
+ */
+ as_enterprise(): EnterpriseAddress | undefined;
+ /**
+ * @returns {BaseAddress | undefined}
+ */
+ as_base(): BaseAddress | undefined;
+}
+/** */
+export class Anchor {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Anchor}
+ */
+ static from_bytes(bytes: Uint8Array): Anchor;
+ /**
+ * @param {string} json
+ * @returns {Anchor}
+ */
+ static from_json(json: string): Anchor;
+ /**
+ * @param {Url} anchor_url
+ * @param {DataHash} anchor_data_hash
+ * @returns {Anchor}
+ */
+ static new(anchor_url: Url, anchor_data_hash: DataHash): Anchor;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Url}
+ */
+ anchor_url(): Url;
+ /**
+ * @returns {DataHash}
+ */
+ anchor_data_hash(): DataHash;
+}
+/** */
+export class AssetName {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {AssetName}
+ */
+ static from_bytes(bytes: Uint8Array): AssetName;
+ /**
+ * @param {string} json
+ * @returns {AssetName}
+ */
+ static from_json(json: string): AssetName;
+ /**
+ * @param {Uint8Array} name
+ * @returns {AssetName}
+ */
+ static new(name: Uint8Array): AssetName;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Uint8Array}
+ */
+ name(): Uint8Array;
+}
+/** */
+export class AssetNames {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {AssetNames}
+ */
+ static from_bytes(bytes: Uint8Array): AssetNames;
+ /**
+ * @param {string} json
+ * @returns {AssetNames}
+ */
+ static from_json(json: string): AssetNames;
+ /**
+ * @returns {AssetNames}
+ */
+ static new(): AssetNames;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {AssetName}
+ */
+ get(index: number): AssetName;
+ /**
+ * @param {AssetName} elem
+ */
+ add(elem: AssetName): void;
+}
+/** */
+export class Assets {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Assets}
+ */
+ static from_bytes(bytes: Uint8Array): Assets;
+ /**
+ * @param {string} json
+ * @returns {Assets}
+ */
+ static from_json(json: string): Assets;
+ /**
+ * @returns {Assets}
+ */
+ static new(): Assets;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {AssetName} key
+ * @param {BigNum} value
+ * @returns {BigNum | undefined}
+ */
+ insert(key: AssetName, value: BigNum): BigNum | undefined;
+ /**
+ * @param {AssetName} key
+ * @returns {BigNum | undefined}
+ */
+ get(key: AssetName): BigNum | undefined;
+ /**
+ * @returns {AssetNames}
+ */
+ keys(): AssetNames;
+}
+/** */
+export class AuxiliaryData {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {AuxiliaryData}
+ */
+ static from_bytes(bytes: Uint8Array): AuxiliaryData;
+ /**
+ * @param {string} json
+ * @returns {AuxiliaryData}
+ */
+ static from_json(json: string): AuxiliaryData;
+ /**
+ * @returns {AuxiliaryData}
+ */
+ static new(): AuxiliaryData;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {GeneralTransactionMetadata | undefined}
+ */
+ metadata(): GeneralTransactionMetadata | undefined;
+ /**
+ * @param {GeneralTransactionMetadata} metadata
+ */
+ set_metadata(metadata: GeneralTransactionMetadata): void;
+ /**
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts(): NativeScripts | undefined;
+ /**
+ * @param {NativeScripts} native_scripts
+ */
+ set_native_scripts(native_scripts: NativeScripts): void;
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_scripts(): PlutusScripts | undefined;
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v2_scripts(): PlutusScripts | undefined;
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v3_scripts(): PlutusScripts | undefined;
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_scripts(plutus_scripts: PlutusScripts): void;
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v2_scripts(plutus_scripts: PlutusScripts): void;
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v3_scripts(plutus_scripts: PlutusScripts): void;
+}
+/** */
+export class AuxiliaryDataHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {AuxiliaryDataHash}
+ */
+ static from_bytes(bytes: Uint8Array): AuxiliaryDataHash;
+ /**
+ * @param {string} bech_str
+ * @returns {AuxiliaryDataHash}
+ */
+ static from_bech32(bech_str: string): AuxiliaryDataHash;
+ /**
+ * @param {string} hex
+ * @returns {AuxiliaryDataHash}
+ */
+ static from_hex(hex: string): AuxiliaryDataHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class AuxiliaryDataSet {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {AuxiliaryDataSet}
+ */
+ static new(): AuxiliaryDataSet;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {BigNum} tx_index
+ * @param {AuxiliaryData} data
+ * @returns {AuxiliaryData | undefined}
+ */
+ insert(tx_index: BigNum, data: AuxiliaryData): AuxiliaryData | undefined;
+ /**
+ * @param {BigNum} tx_index
+ * @returns {AuxiliaryData | undefined}
+ */
+ get(tx_index: BigNum): AuxiliaryData | undefined;
+ /**
+ * @returns {TransactionIndexes}
+ */
+ indices(): TransactionIndexes;
+}
+/** */
+export class BaseAddress {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @param {StakeCredential} stake
+ * @returns {BaseAddress}
+ */
+ static new(network: number, payment: StakeCredential, stake: StakeCredential): BaseAddress;
+ /**
+ * @param {Address} addr
+ * @returns {BaseAddress | undefined}
+ */
+ static from_address(addr: Address): BaseAddress | undefined;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred(): StakeCredential;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_cred(): StakeCredential;
+ /**
+ * @returns {Address}
+ */
+ to_address(): Address;
+}
+/** */
+export class BigInt {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {BigInt}
+ */
+ static from_bytes(bytes: Uint8Array): BigInt;
+ /**
+ * @param {string} text
+ * @returns {BigInt}
+ */
+ static from_str(text: string): BigInt;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_u64(): BigNum | undefined;
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int(): Int | undefined;
+ /**
+ * @returns {string}
+ */
+ to_str(): string;
+}
+/** */
+export class BigNum {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {BigNum}
+ */
+ static from_bytes(bytes: Uint8Array): BigNum;
+ /**
+ * @param {string} string
+ * @returns {BigNum}
+ */
+ static from_str(string: string): BigNum;
+ /**
+ * @returns {BigNum}
+ */
+ static zero(): BigNum;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_str(): string;
+ /**
+ * @returns {boolean}
+ */
+ is_zero(): boolean;
+ /**
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ checked_mul(other: BigNum): BigNum;
+ /**
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ checked_add(other: BigNum): BigNum;
+ /**
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ checked_sub(other: BigNum): BigNum;
+ /**
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ checked_div(other: BigNum): BigNum;
+ /**
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ checked_div_ceil(other: BigNum): BigNum;
+ /**
+ * returns 0 if it would otherwise underflow
+ * @param {BigNum} other
+ * @returns {BigNum}
+ */
+ clamped_sub(other: BigNum): BigNum;
+ /**
+ * @param {BigNum} rhs_value
+ * @returns {number}
+ */
+ compare(rhs_value: BigNum): number;
+}
+/** */
+export class Bip32PrivateKey {
+ static __wrap(ptr: any): any;
+ /**
+ * 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: Uint8Array): Bip32PrivateKey;
+ /**
+ * @returns {Bip32PrivateKey}
+ */
+ static generate_ed25519_bip32(): Bip32PrivateKey;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Bip32PrivateKey}
+ */
+ static from_bytes(bytes: Uint8Array): Bip32PrivateKey;
+ /**
+ * @param {string} bech32_str
+ * @returns {Bip32PrivateKey}
+ */
+ static from_bech32(bech32_str: string): Bip32PrivateKey;
+ /**
+ * @param {Uint8Array} entropy
+ * @param {Uint8Array} password
+ * @returns {Bip32PrivateKey}
+ */
+ static from_bip39_entropy(entropy: Uint8Array, password: Uint8Array): Bip32PrivateKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * 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: number): Bip32PrivateKey;
+ /**
+ * see from_128_xprv
+ * @returns {Uint8Array}
+ */
+ to_128_xprv(): Uint8Array;
+ /**
+ * @returns {PrivateKey}
+ */
+ to_raw_key(): PrivateKey;
+ /**
+ * @returns {Bip32PublicKey}
+ */
+ to_public(): Bip32PublicKey;
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_bech32(): string;
+ /**
+ * @returns {Uint8Array}
+ */
+ chaincode(): Uint8Array;
+}
+/** */
+export class Bip32PublicKey {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Bip32PublicKey}
+ */
+ static from_bytes(bytes: Uint8Array): Bip32PublicKey;
+ /**
+ * @param {string} bech32_str
+ * @returns {Bip32PublicKey}
+ */
+ static from_bech32(bech32_str: string): Bip32PublicKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * 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: number): Bip32PublicKey;
+ /**
+ * @returns {PublicKey}
+ */
+ to_raw_key(): PublicKey;
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_bech32(): string;
+ /**
+ * @returns {Uint8Array}
+ */
+ chaincode(): Uint8Array;
+}
+/** */
+export class Block {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Block}
+ */
+ static from_bytes(bytes: Uint8Array): Block;
+ /**
+ * @param {string} json
+ * @returns {Block}
+ */
+ static from_json(json: string): Block;
+ /**
+ * @param {Header} header
+ * @param {TransactionBodies} transaction_bodies
+ * @param {TransactionWitnessSets} transaction_witness_sets
+ * @param {AuxiliaryDataSet} auxiliary_data_set
+ * @param {TransactionIndexes} invalid_transactions
+ * @returns {Block}
+ */
+ static new(header: Header, transaction_bodies: TransactionBodies, transaction_witness_sets: TransactionWitnessSets, auxiliary_data_set: AuxiliaryDataSet, invalid_transactions: TransactionIndexes): Block;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Header}
+ */
+ header(): Header;
+ /**
+ * @returns {TransactionBodies}
+ */
+ transaction_bodies(): TransactionBodies;
+ /**
+ * @returns {TransactionWitnessSets}
+ */
+ transaction_witness_sets(): TransactionWitnessSets;
+ /**
+ * @returns {AuxiliaryDataSet}
+ */
+ auxiliary_data_set(): AuxiliaryDataSet;
+ /**
+ * @returns {TransactionIndexes}
+ */
+ invalid_transactions(): TransactionIndexes;
+}
+/** */
+export class BlockHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {BlockHash}
+ */
+ static from_bytes(bytes: Uint8Array): BlockHash;
+ /**
+ * @param {string} bech_str
+ * @returns {BlockHash}
+ */
+ static from_bech32(bech_str: string): BlockHash;
+ /**
+ * @param {string} hex
+ * @returns {BlockHash}
+ */
+ static from_hex(hex: string): BlockHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class Blockfrost {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {string} url
+ * @param {string} project_id
+ * @returns {Blockfrost}
+ */
+ static new(url: string, project_id: string): Blockfrost;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {string}
+ */
+ url(): string;
+ /**
+ * @returns {string}
+ */
+ project_id(): string;
+}
+/** */
+export class BootstrapWitness {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {BootstrapWitness}
+ */
+ static from_bytes(bytes: Uint8Array): BootstrapWitness;
+ /**
+ * @param {string} json
+ * @returns {BootstrapWitness}
+ */
+ static from_json(json: string): BootstrapWitness;
+ /**
+ * @param {Vkey} vkey
+ * @param {Ed25519Signature} signature
+ * @param {Uint8Array} chain_code
+ * @param {Uint8Array} attributes
+ * @returns {BootstrapWitness}
+ */
+ static new(vkey: Vkey, signature: Ed25519Signature, chain_code: Uint8Array, attributes: Uint8Array): BootstrapWitness;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Vkey}
+ */
+ vkey(): Vkey;
+ /**
+ * @returns {Ed25519Signature}
+ */
+ signature(): Ed25519Signature;
+ /**
+ * @returns {Uint8Array}
+ */
+ chain_code(): Uint8Array;
+ /**
+ * @returns {Uint8Array}
+ */
+ attributes(): Uint8Array;
+}
+/** */
+export class BootstrapWitnesses {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {BootstrapWitnesses}
+ */
+ static new(): BootstrapWitnesses;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {BootstrapWitness}
+ */
+ get(index: number): BootstrapWitness;
+ /**
+ * @param {BootstrapWitness} elem
+ */
+ add(elem: BootstrapWitness): void;
+}
+/** */
+export class ByronAddress {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ByronAddress}
+ */
+ static from_bytes(bytes: Uint8Array): ByronAddress;
+ /**
+ * @param {string} s
+ * @returns {ByronAddress}
+ */
+ static from_base58(s: string): ByronAddress;
+ /**
+ * @param {Bip32PublicKey} key
+ * @param {number} protocol_magic
+ * @returns {ByronAddress}
+ */
+ static icarus_from_key(key: Bip32PublicKey, protocol_magic: number): ByronAddress;
+ /**
+ * @param {string} s
+ * @returns {boolean}
+ */
+ static is_valid(s: string): boolean;
+ /**
+ * @param {Address} addr
+ * @returns {ByronAddress | undefined}
+ */
+ static from_address(addr: Address): ByronAddress | undefined;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {string}
+ */
+ to_base58(): string;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * 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(): number;
+ /**
+ * @returns {Uint8Array}
+ */
+ attributes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ network_id(): number;
+ /**
+ * @returns {Address}
+ */
+ to_address(): Address;
+}
+/** */
+export class Certificate {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Certificate}
+ */
+ static from_bytes(bytes: Uint8Array): Certificate;
+ /**
+ * @param {string} json
+ * @returns {Certificate}
+ */
+ static from_json(json: string): Certificate;
+ /**
+ * @param {StakeRegistration} stake_registration
+ * @returns {Certificate}
+ */
+ static new_stake_registration(stake_registration: StakeRegistration): Certificate;
+ /**
+ * @param {StakeDeregistration} stake_deregistration
+ * @returns {Certificate}
+ */
+ static new_stake_deregistration(stake_deregistration: StakeDeregistration): Certificate;
+ /**
+ * @param {StakeDelegation} stake_delegation
+ * @returns {Certificate}
+ */
+ static new_stake_delegation(stake_delegation: StakeDelegation): Certificate;
+ /**
+ * @param {PoolRegistration} pool_registration
+ * @returns {Certificate}
+ */
+ static new_pool_registration(pool_registration: PoolRegistration): Certificate;
+ /**
+ * @param {PoolRetirement} pool_retirement
+ * @returns {Certificate}
+ */
+ static new_pool_retirement(pool_retirement: PoolRetirement): Certificate;
+ /**
+ * @param {GenesisKeyDelegation} genesis_key_delegation
+ * @returns {Certificate}
+ */
+ static new_genesis_key_delegation(genesis_key_delegation: GenesisKeyDelegation): Certificate;
+ /**
+ * @param {MoveInstantaneousRewardsCert} move_instantaneous_rewards_cert
+ * @returns {Certificate}
+ */
+ static new_move_instantaneous_rewards_cert(move_instantaneous_rewards_cert: MoveInstantaneousRewardsCert): Certificate;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {StakeRegistration | undefined}
+ */
+ as_stake_registration(): StakeRegistration | undefined;
+ /**
+ * @returns {StakeDeregistration | undefined}
+ */
+ as_stake_deregistration(): StakeDeregistration | undefined;
+ /**
+ * @returns {StakeDelegation | undefined}
+ */
+ as_stake_delegation(): StakeDelegation | undefined;
+ /**
+ * @returns {PoolRegistration | undefined}
+ */
+ as_pool_registration(): PoolRegistration | undefined;
+ /**
+ * @returns {PoolRetirement | undefined}
+ */
+ as_pool_retirement(): PoolRetirement | undefined;
+ /**
+ * @returns {GenesisKeyDelegation | undefined}
+ */
+ as_genesis_key_delegation(): GenesisKeyDelegation | undefined;
+ /**
+ * @returns {MoveInstantaneousRewardsCert | undefined}
+ */
+ as_move_instantaneous_rewards_cert(): MoveInstantaneousRewardsCert | undefined;
+ /**
+ * @returns {RegCert | undefined}
+ */
+ as_reg_cert(): RegCert | undefined;
+ /**
+ * @returns {UnregCert | undefined}
+ */
+ as_unreg_cert(): UnregCert | undefined;
+ /**
+ * @returns {VoteDelegCert | undefined}
+ */
+ as_vote_deleg_cert(): VoteDelegCert | undefined;
+ /**
+ * @returns {StakeVoteDelegCert | undefined}
+ */
+ as_stake_vote_deleg_cert(): StakeVoteDelegCert | undefined;
+ /**
+ * @returns {StakeRegDelegCert | undefined}
+ */
+ as_stake_reg_deleg_cert(): StakeRegDelegCert | undefined;
+ /**
+ * @returns {VoteRegDelegCert | undefined}
+ */
+ as_vote_reg_deleg_cert(): VoteRegDelegCert | undefined;
+ /**
+ * @returns {StakeVoteRegDelegCert | undefined}
+ */
+ as_stake_vote_reg_deleg_cert(): StakeVoteRegDelegCert | undefined;
+ /**
+ * @returns {RegCommitteeHotKeyCert | undefined}
+ */
+ as_reg_committee_hot_key_cert(): RegCommitteeHotKeyCert | undefined;
+ /**
+ * @returns {UnregCommitteeHotKeyCert | undefined}
+ */
+ as_unreg_committee_hot_key_cert(): UnregCommitteeHotKeyCert | undefined;
+ /**
+ * @returns {RegDrepCert | undefined}
+ */
+ as_reg_drep_cert(): RegDrepCert | undefined;
+ /**
+ * @returns {UnregDrepCert | undefined}
+ */
+ as_unreg_drep_cert(): UnregDrepCert | undefined;
+}
+/** */
+export class Certificates {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Certificates}
+ */
+ static from_bytes(bytes: Uint8Array): Certificates;
+ /**
+ * @param {string} json
+ * @returns {Certificates}
+ */
+ static from_json(json: string): Certificates;
+ /**
+ * @returns {Certificates}
+ */
+ static new(): Certificates;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {Certificate}
+ */
+ get(index: number): Certificate;
+ /**
+ * @param {Certificate} elem
+ */
+ add(elem: Certificate): void;
+}
+/** */
+export class ConstrPlutusData {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ConstrPlutusData}
+ */
+ static from_bytes(bytes: Uint8Array): ConstrPlutusData;
+ /**
+ * @param {BigNum} alternative
+ * @param {PlutusList} data
+ * @returns {ConstrPlutusData}
+ */
+ static new(alternative: BigNum, data: PlutusList): ConstrPlutusData;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {BigNum}
+ */
+ alternative(): BigNum;
+ /**
+ * @returns {PlutusList}
+ */
+ data(): PlutusList;
+}
+/** */
+export class CostModel {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {CostModel}
+ */
+ static from_bytes(bytes: Uint8Array): CostModel;
+ /**
+ * @returns {CostModel}
+ */
+ static new(): CostModel;
+ /**
+ * @returns {CostModel}
+ */
+ static new_plutus_v2(): CostModel;
+ /**
+ * @returns {CostModel}
+ */
+ static new_plutus_v3(): CostModel;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {number} operation
+ * @param {Int} cost
+ * @returns {Int}
+ */
+ set(operation: number, cost: Int): Int;
+ /**
+ * @param {number} operation
+ * @returns {Int}
+ */
+ get(operation: number): Int;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+}
+/** */
+export class Costmdls {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Costmdls}
+ */
+ static from_bytes(bytes: Uint8Array): Costmdls;
+ /**
+ * @returns {Costmdls}
+ */
+ static new(): Costmdls;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {Language} key
+ * @param {CostModel} value
+ * @returns {CostModel | undefined}
+ */
+ insert(key: Language, value: CostModel): CostModel | undefined;
+ /**
+ * @param {Language} key
+ * @returns {CostModel | undefined}
+ */
+ get(key: Language): CostModel | undefined;
+ /**
+ * @returns {Languages}
+ */
+ keys(): Languages;
+}
+/** */
+export class DNSRecordAorAAAA {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {DNSRecordAorAAAA}
+ */
+ static from_bytes(bytes: Uint8Array): DNSRecordAorAAAA;
+ /**
+ * @param {string} dns_name
+ * @returns {DNSRecordAorAAAA}
+ */
+ static new(dns_name: string): DNSRecordAorAAAA;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ record(): string;
+}
+/** */
+export class DNSRecordSRV {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {DNSRecordSRV}
+ */
+ static from_bytes(bytes: Uint8Array): DNSRecordSRV;
+ /**
+ * @param {string} dns_name
+ * @returns {DNSRecordSRV}
+ */
+ static new(dns_name: string): DNSRecordSRV;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ record(): string;
+}
+/** */
+export class Data {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Data}
+ */
+ static from_bytes(bytes: Uint8Array): Data;
+ /**
+ * @param {string} json
+ * @returns {Data}
+ */
+ static from_json(json: string): Data;
+ /**
+ * @param {PlutusData} plutus_data
+ * @returns {Data}
+ */
+ static new(plutus_data: PlutusData): Data;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {PlutusData}
+ */
+ get(): PlutusData;
+}
+/** */
+export class DataHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {DataHash}
+ */
+ static from_bytes(bytes: Uint8Array): DataHash;
+ /**
+ * @param {string} bech_str
+ * @returns {DataHash}
+ */
+ static from_bech32(bech_str: string): DataHash;
+ /**
+ * @param {string} hex
+ * @returns {DataHash}
+ */
+ static from_hex(hex: string): DataHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class Datum {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Datum}
+ */
+ static from_bytes(bytes: Uint8Array): Datum;
+ /**
+ * @param {string} json
+ * @returns {Datum}
+ */
+ static from_json(json: string): Datum;
+ /**
+ * @param {DataHash} data_hash
+ * @returns {Datum}
+ */
+ static new_data_hash(data_hash: DataHash): Datum;
+ /**
+ * @param {Data} data
+ * @returns {Datum}
+ */
+ static new_data(data: Data): Datum;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {DataHash | undefined}
+ */
+ as_data_hash(): DataHash | undefined;
+ /**
+ * @returns {Data | undefined}
+ */
+ as_data(): Data | undefined;
+}
+/** */
+export class Drep {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Drep}
+ */
+ static from_bytes(bytes: Uint8Array): Drep;
+ /**
+ * @param {string} json
+ * @returns {Drep}
+ */
+ static from_json(json: string): Drep;
+ /**
+ * @param {Ed25519KeyHash} keyhash
+ * @returns {Drep}
+ */
+ static new_keyhash(keyhash: Ed25519KeyHash): Drep;
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Drep}
+ */
+ static new_scripthash(scripthash: ScriptHash): Drep;
+ /**
+ * @returns {Drep}
+ */
+ static new_abstain(): Drep;
+ /**
+ * @returns {Drep}
+ */
+ static new_no_confidence(): Drep;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_keyhash(): Ed25519KeyHash | undefined;
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_scripthash(): ScriptHash | undefined;
+}
+/** */
+export class DrepVotingThresholds {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {DrepVotingThresholds}
+ */
+ static from_bytes(bytes: Uint8Array): DrepVotingThresholds;
+ /**
+ * @param {string} json
+ * @returns {DrepVotingThresholds}
+ */
+ static from_json(json: string): DrepVotingThresholds;
+ /**
+ * @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: UnitInterval, committee_normal: UnitInterval, committee_no_confidence: UnitInterval, update_constitution: UnitInterval, hard_fork_initiation: UnitInterval, pp_network_group: UnitInterval, pp_economic_group: UnitInterval, pp_technical_group: UnitInterval, pp_governance_group: UnitInterval, treasury_withdrawal: UnitInterval): DrepVotingThresholds;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {UnitInterval}
+ */
+ motion_no_confidence(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_normal(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_no_confidence(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ update_constitution(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ hard_fork_initiation(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_network_group(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_economic_group(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_technical_group(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_governance_group(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ treasury_withdrawal(): UnitInterval;
+}
+/** */
+export class Ed25519KeyHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Ed25519KeyHash}
+ */
+ static from_bytes(bytes: Uint8Array): Ed25519KeyHash;
+ /**
+ * @param {string} bech_str
+ * @returns {Ed25519KeyHash}
+ */
+ static from_bech32(bech_str: string): Ed25519KeyHash;
+ /**
+ * @param {string} hex
+ * @returns {Ed25519KeyHash}
+ */
+ static from_hex(hex: string): Ed25519KeyHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class Ed25519KeyHashes {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Ed25519KeyHashes}
+ */
+ static from_bytes(bytes: Uint8Array): Ed25519KeyHashes;
+ /**
+ * @param {string} json
+ * @returns {Ed25519KeyHashes}
+ */
+ static from_json(json: string): Ed25519KeyHashes;
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ static new(): Ed25519KeyHashes;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {Ed25519KeyHash}
+ */
+ get(index: number): Ed25519KeyHash;
+ /**
+ * @param {Ed25519KeyHash} elem
+ */
+ add(elem: Ed25519KeyHash): void;
+}
+/** */
+export class Ed25519Signature {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {string} bech32_str
+ * @returns {Ed25519Signature}
+ */
+ static from_bech32(bech32_str: string): Ed25519Signature;
+ /**
+ * @param {string} input
+ * @returns {Ed25519Signature}
+ */
+ static from_hex(input: string): Ed25519Signature;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Ed25519Signature}
+ */
+ static from_bytes(bytes: Uint8Array): Ed25519Signature;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_bech32(): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class EnterpriseAddress {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @returns {EnterpriseAddress}
+ */
+ static new(network: number, payment: StakeCredential): EnterpriseAddress;
+ /**
+ * @param {Address} addr
+ * @returns {EnterpriseAddress | undefined}
+ */
+ static from_address(addr: Address): EnterpriseAddress | undefined;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred(): StakeCredential;
+ /**
+ * @returns {Address}
+ */
+ to_address(): Address;
+}
+/** */
+export class ExUnitPrices {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ExUnitPrices}
+ */
+ static from_bytes(bytes: Uint8Array): ExUnitPrices;
+ /**
+ * @param {UnitInterval} mem_price
+ * @param {UnitInterval} step_price
+ * @returns {ExUnitPrices}
+ */
+ static new(mem_price: UnitInterval, step_price: UnitInterval): ExUnitPrices;
+ /**
+ * @param {number} mem_price
+ * @param {number} step_price
+ * @returns {ExUnitPrices}
+ */
+ static from_float(mem_price: number, step_price: number): ExUnitPrices;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {UnitInterval}
+ */
+ mem_price(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ step_price(): UnitInterval;
+}
+/** */
+export class ExUnits {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ExUnits}
+ */
+ static from_bytes(bytes: Uint8Array): ExUnits;
+ /**
+ * @param {BigNum} mem
+ * @param {BigNum} steps
+ * @returns {ExUnits}
+ */
+ static new(mem: BigNum, steps: BigNum): ExUnits;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {BigNum}
+ */
+ mem(): BigNum;
+ /**
+ * @returns {BigNum}
+ */
+ steps(): BigNum;
+}
+/** */
+export class GeneralTransactionMetadata {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {GeneralTransactionMetadata}
+ */
+ static from_bytes(bytes: Uint8Array): GeneralTransactionMetadata;
+ /**
+ * @param {string} json
+ * @returns {GeneralTransactionMetadata}
+ */
+ static from_json(json: string): GeneralTransactionMetadata;
+ /**
+ * @returns {GeneralTransactionMetadata}
+ */
+ static new(): GeneralTransactionMetadata;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {BigNum} key
+ * @param {TransactionMetadatum} value
+ * @returns {TransactionMetadatum | undefined}
+ */
+ insert(key: BigNum, value: TransactionMetadatum): TransactionMetadatum | undefined;
+ /**
+ * @param {BigNum} key
+ * @returns {TransactionMetadatum | undefined}
+ */
+ get(key: BigNum): TransactionMetadatum | undefined;
+ /**
+ * @returns {TransactionMetadatumLabels}
+ */
+ keys(): TransactionMetadatumLabels;
+}
+/** */
+export class GenesisDelegateHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {GenesisDelegateHash}
+ */
+ static from_bytes(bytes: Uint8Array): GenesisDelegateHash;
+ /**
+ * @param {string} bech_str
+ * @returns {GenesisDelegateHash}
+ */
+ static from_bech32(bech_str: string): GenesisDelegateHash;
+ /**
+ * @param {string} hex
+ * @returns {GenesisDelegateHash}
+ */
+ static from_hex(hex: string): GenesisDelegateHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class GenesisHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {GenesisHash}
+ */
+ static from_bytes(bytes: Uint8Array): GenesisHash;
+ /**
+ * @param {string} bech_str
+ * @returns {GenesisHash}
+ */
+ static from_bech32(bech_str: string): GenesisHash;
+ /**
+ * @param {string} hex
+ * @returns {GenesisHash}
+ */
+ static from_hex(hex: string): GenesisHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class GenesisHashes {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {GenesisHashes}
+ */
+ static from_bytes(bytes: Uint8Array): GenesisHashes;
+ /**
+ * @param {string} json
+ * @returns {GenesisHashes}
+ */
+ static from_json(json: string): GenesisHashes;
+ /**
+ * @returns {GenesisHashes}
+ */
+ static new(): GenesisHashes;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {GenesisHash}
+ */
+ get(index: number): GenesisHash;
+ /**
+ * @param {GenesisHash} elem
+ */
+ add(elem: GenesisHash): void;
+}
+/** */
+export class GenesisKeyDelegation {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {GenesisKeyDelegation}
+ */
+ static from_bytes(bytes: Uint8Array): GenesisKeyDelegation;
+ /**
+ * @param {string} json
+ * @returns {GenesisKeyDelegation}
+ */
+ static from_json(json: string): GenesisKeyDelegation;
+ /**
+ * @param {GenesisHash} genesishash
+ * @param {GenesisDelegateHash} genesis_delegate_hash
+ * @param {VRFKeyHash} vrf_keyhash
+ * @returns {GenesisKeyDelegation}
+ */
+ static new(genesishash: GenesisHash, genesis_delegate_hash: GenesisDelegateHash, vrf_keyhash: VRFKeyHash): GenesisKeyDelegation;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {GenesisHash}
+ */
+ genesishash(): GenesisHash;
+ /**
+ * @returns {GenesisDelegateHash}
+ */
+ genesis_delegate_hash(): GenesisDelegateHash;
+ /**
+ * @returns {VRFKeyHash}
+ */
+ vrf_keyhash(): VRFKeyHash;
+}
+/** */
+export class GovernanceAction {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {GovernanceAction}
+ */
+ static from_bytes(bytes: Uint8Array): GovernanceAction;
+ /**
+ * @param {string} json
+ * @returns {GovernanceAction}
+ */
+ static from_json(json: string): GovernanceAction;
+ /**
+ * @param {ParameterChangeAction} parameter_change_action
+ * @returns {GovernanceAction}
+ */
+ static new_parameter_change_action(parameter_change_action: ParameterChangeAction): GovernanceAction;
+ /**
+ * @param {HardForkInitiationAction} hard_fork_initiation_action
+ * @returns {GovernanceAction}
+ */
+ static new_hard_fork_initiation_action(hard_fork_initiation_action: HardForkInitiationAction): GovernanceAction;
+ /**
+ * @param {TreasuryWithdrawalsAction} treasury_withdrawals_action
+ * @returns {GovernanceAction}
+ */
+ static new_treasury_withdrawals_action(treasury_withdrawals_action: TreasuryWithdrawalsAction): GovernanceAction;
+ /**
+ * @returns {GovernanceAction}
+ */
+ static new_no_confidence(): GovernanceAction;
+ /**
+ * @param {NewCommittee} new_committe
+ * @returns {GovernanceAction}
+ */
+ static new_new_committee(new_committe: NewCommittee): GovernanceAction;
+ /**
+ * @param {NewConstitution} new_constitution
+ * @returns {GovernanceAction}
+ */
+ static new_new_constitution(new_constitution: NewConstitution): GovernanceAction;
+ /**
+ * @returns {GovernanceAction}
+ */
+ static new_info_action(): GovernanceAction;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {ParameterChangeAction | undefined}
+ */
+ as_parameter_change_action(): ParameterChangeAction | undefined;
+ /**
+ * @returns {HardForkInitiationAction | undefined}
+ */
+ as_hard_fork_initiation_action(): HardForkInitiationAction | undefined;
+ /**
+ * @returns {TreasuryWithdrawalsAction | undefined}
+ */
+ as_treasury_withdrawals_action(): TreasuryWithdrawalsAction | undefined;
+ /**
+ * @returns {NewCommittee | undefined}
+ */
+ as_new_committee(): NewCommittee | undefined;
+ /**
+ * @returns {NewConstitution | undefined}
+ */
+ as_new_constitution(): NewConstitution | undefined;
+}
+/** */
+export class GovernanceActionId {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {GovernanceActionId}
+ */
+ static from_bytes(bytes: Uint8Array): GovernanceActionId;
+ /**
+ * @param {string} json
+ * @returns {GovernanceActionId}
+ */
+ static from_json(json: string): GovernanceActionId;
+ /**
+ * @param {TransactionHash} transaction_id
+ * @param {BigNum} governance_action_index
+ * @returns {GovernanceActionId}
+ */
+ static new(transaction_id: TransactionHash, governance_action_index: BigNum): GovernanceActionId;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {TransactionHash}
+ */
+ transaction_id(): TransactionHash;
+ /**
+ * @returns {BigNum}
+ */
+ governance_action_index(): BigNum;
+}
+/** */
+export class HardForkInitiationAction {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {HardForkInitiationAction}
+ */
+ static from_bytes(bytes: Uint8Array): HardForkInitiationAction;
+ /**
+ * @param {string} json
+ * @returns {HardForkInitiationAction}
+ */
+ static from_json(json: string): HardForkInitiationAction;
+ /**
+ * @param {ProtocolVersion} protocol_version
+ * @returns {HardForkInitiationAction}
+ */
+ static new(protocol_version: ProtocolVersion): HardForkInitiationAction;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {ProtocolVersion}
+ */
+ protocol_version(): ProtocolVersion;
+}
+/** */
+export class Header {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Header}
+ */
+ static from_bytes(bytes: Uint8Array): Header;
+ /**
+ * @param {string} json
+ * @returns {Header}
+ */
+ static from_json(json: string): Header;
+ /**
+ * @param {HeaderBody} header_body
+ * @param {KESSignature} body_signature
+ * @returns {Header}
+ */
+ static new(header_body: HeaderBody, body_signature: KESSignature): Header;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {HeaderBody}
+ */
+ header_body(): HeaderBody;
+ /**
+ * @returns {KESSignature}
+ */
+ body_signature(): KESSignature;
+}
+/** */
+export class HeaderBody {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {HeaderBody}
+ */
+ static from_bytes(bytes: Uint8Array): HeaderBody;
+ /**
+ * @param {string} json
+ * @returns {HeaderBody}
+ */
+ static from_json(json: string): HeaderBody;
+ /**
+ * @param {number} block_number
+ * @param {BigNum} slot
+ * @param {BlockHash | undefined} prev_hash
+ * @param {Vkey} issuer_vkey
+ * @param {VRFVKey} vrf_vkey
+ * @param {VRFCert} nonce_vrf
+ * @param {VRFCert} leader_vrf
+ * @param {number} block_body_size
+ * @param {BlockHash} block_body_hash
+ * @param {OperationalCert} operational_cert
+ * @param {ProtocolVersion} protocol_version
+ * @returns {HeaderBody}
+ */
+ static new(block_number: number, slot: BigNum, prev_hash: BlockHash | undefined, issuer_vkey: Vkey, vrf_vkey: VRFVKey, nonce_vrf: VRFCert, leader_vrf: VRFCert, block_body_size: number, block_body_hash: BlockHash, operational_cert: OperationalCert, protocol_version: ProtocolVersion): HeaderBody;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ block_number(): number;
+ /**
+ * @returns {BigNum}
+ */
+ slot(): BigNum;
+ /**
+ * @returns {BlockHash | undefined}
+ */
+ prev_hash(): BlockHash | undefined;
+ /**
+ * @returns {Vkey}
+ */
+ issuer_vkey(): Vkey;
+ /**
+ * @returns {VRFVKey}
+ */
+ vrf_vkey(): VRFVKey;
+ /**
+ * @returns {VRFCert}
+ */
+ nonce_vrf(): VRFCert;
+ /**
+ * @returns {VRFCert}
+ */
+ leader_vrf(): VRFCert;
+ /**
+ * @returns {number}
+ */
+ block_body_size(): number;
+ /**
+ * @returns {BlockHash}
+ */
+ block_body_hash(): BlockHash;
+ /**
+ * @returns {OperationalCert}
+ */
+ operational_cert(): OperationalCert;
+ /**
+ * @returns {ProtocolVersion}
+ */
+ protocol_version(): ProtocolVersion;
+}
+/** */
+export class Int {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Int}
+ */
+ static from_bytes(bytes: Uint8Array): Int;
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new(x: BigNum): Int;
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new_negative(x: BigNum): Int;
+ /**
+ * @param {number} x
+ * @returns {Int}
+ */
+ static new_i32(x: number): Int;
+ /**
+ * @param {string} string
+ * @returns {Int}
+ */
+ static from_str(string: string): Int;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {boolean}
+ */
+ is_positive(): boolean;
+ /**
+ * 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(): BigNum | undefined;
+ /**
+ * 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(): BigNum | undefined;
+ /**
+ * !!! 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(): number | undefined;
+ /**
+ * 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(): number | undefined;
+ /**
+ * 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(): number;
+ /**
+ * Returns string representation of the underlying i128 value directly.
+ * Might contain the minus sign (-) in case of negative value.
+ * @returns {string}
+ */
+ to_str(): string;
+}
+/** */
+export class Ipv4 {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Ipv4}
+ */
+ static from_bytes(bytes: Uint8Array): Ipv4;
+ /**
+ * @param {string} json
+ * @returns {Ipv4}
+ */
+ static from_json(json: string): Ipv4;
+ /**
+ * @param {Uint8Array} data
+ * @returns {Ipv4}
+ */
+ static new(data: Uint8Array): Ipv4;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Uint8Array}
+ */
+ ip(): Uint8Array;
+}
+/** */
+export class Ipv6 {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Ipv6}
+ */
+ static from_bytes(bytes: Uint8Array): Ipv6;
+ /**
+ * @param {string} json
+ * @returns {Ipv6}
+ */
+ static from_json(json: string): Ipv6;
+ /**
+ * @param {Uint8Array} data
+ * @returns {Ipv6}
+ */
+ static new(data: Uint8Array): Ipv6;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Uint8Array}
+ */
+ ip(): Uint8Array;
+}
+/** */
+export class KESSignature {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {KESSignature}
+ */
+ static from_bytes(bytes: Uint8Array): KESSignature;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+}
+/** */
+export class KESVKey {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {KESVKey}
+ */
+ static from_bytes(bytes: Uint8Array): KESVKey;
+ /**
+ * @param {string} bech_str
+ * @returns {KESVKey}
+ */
+ static from_bech32(bech_str: string): KESVKey;
+ /**
+ * @param {string} hex
+ * @returns {KESVKey}
+ */
+ static from_hex(hex: string): KESVKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class Language {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Language}
+ */
+ static from_bytes(bytes: Uint8Array): Language;
+ /**
+ * @returns {Language}
+ */
+ static new_plutus_v1(): Language;
+ /**
+ * @returns {Language}
+ */
+ static new_plutus_v2(): Language;
+ /**
+ * @returns {Language}
+ */
+ static new_plutus_v3(): Language;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+}
+/** */
+export class Languages {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {Languages}
+ */
+ static new(): Languages;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {Language}
+ */
+ get(index: number): Language;
+ /**
+ * @param {Language} elem
+ */
+ add(elem: Language): void;
+}
+/** */
+export class LegacyDaedalusPrivateKey {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {LegacyDaedalusPrivateKey}
+ */
+ static from_bytes(bytes: Uint8Array): LegacyDaedalusPrivateKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes(): Uint8Array;
+ /**
+ * @returns {Uint8Array}
+ */
+ chaincode(): Uint8Array;
+}
+/** */
+export class LinearFee {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {BigNum} coefficient
+ * @param {BigNum} constant
+ * @returns {LinearFee}
+ */
+ static new(coefficient: BigNum, constant: BigNum): LinearFee;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {BigNum}
+ */
+ constant(): BigNum;
+ /**
+ * @returns {BigNum}
+ */
+ coefficient(): BigNum;
+}
+/** */
+export class MIRToStakeCredentials {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {MIRToStakeCredentials}
+ */
+ static from_bytes(bytes: Uint8Array): MIRToStakeCredentials;
+ /**
+ * @param {string} json
+ * @returns {MIRToStakeCredentials}
+ */
+ static from_json(json: string): MIRToStakeCredentials;
+ /**
+ * @returns {MIRToStakeCredentials}
+ */
+ static new(): MIRToStakeCredentials;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {StakeCredential} cred
+ * @param {Int} delta
+ * @returns {Int | undefined}
+ */
+ insert(cred: StakeCredential, delta: Int): Int | undefined;
+ /**
+ * @param {StakeCredential} cred
+ * @returns {Int | undefined}
+ */
+ get(cred: StakeCredential): Int | undefined;
+ /**
+ * @returns {StakeCredentials}
+ */
+ keys(): StakeCredentials;
+}
+/** */
+export class MetadataList {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {MetadataList}
+ */
+ static from_bytes(bytes: Uint8Array): MetadataList;
+ /**
+ * @returns {MetadataList}
+ */
+ static new(): MetadataList;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {TransactionMetadatum}
+ */
+ get(index: number): TransactionMetadatum;
+ /**
+ * @param {TransactionMetadatum} elem
+ */
+ add(elem: TransactionMetadatum): void;
+}
+/** */
+export class MetadataMap {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {MetadataMap}
+ */
+ static from_bytes(bytes: Uint8Array): MetadataMap;
+ /**
+ * @returns {MetadataMap}
+ */
+ static new(): MetadataMap;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {TransactionMetadatum} key
+ * @param {TransactionMetadatum} value
+ * @returns {TransactionMetadatum | undefined}
+ */
+ insert(key: TransactionMetadatum, value: TransactionMetadatum): TransactionMetadatum | undefined;
+ /**
+ * @param {string} key
+ * @param {TransactionMetadatum} value
+ * @returns {TransactionMetadatum | undefined}
+ */
+ insert_str(key: string, value: TransactionMetadatum): TransactionMetadatum | undefined;
+ /**
+ * @param {number} key
+ * @param {TransactionMetadatum} value
+ * @returns {TransactionMetadatum | undefined}
+ */
+ insert_i32(key: number, value: TransactionMetadatum): TransactionMetadatum | undefined;
+ /**
+ * @param {TransactionMetadatum} key
+ * @returns {TransactionMetadatum}
+ */
+ get(key: TransactionMetadatum): TransactionMetadatum;
+ /**
+ * @param {string} key
+ * @returns {TransactionMetadatum}
+ */
+ get_str(key: string): TransactionMetadatum;
+ /**
+ * @param {number} key
+ * @returns {TransactionMetadatum}
+ */
+ get_i32(key: number): TransactionMetadatum;
+ /**
+ * @param {TransactionMetadatum} key
+ * @returns {boolean}
+ */
+ has(key: TransactionMetadatum): boolean;
+ /**
+ * @returns {MetadataList}
+ */
+ keys(): MetadataList;
+}
+/** */
+export class Mint {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Mint}
+ */
+ static from_bytes(bytes: Uint8Array): Mint;
+ /**
+ * @param {string} json
+ * @returns {Mint}
+ */
+ static from_json(json: string): Mint;
+ /**
+ * @returns {Mint}
+ */
+ static new(): Mint;
+ /**
+ * @param {ScriptHash} key
+ * @param {MintAssets} value
+ * @returns {Mint}
+ */
+ static new_from_entry(key: ScriptHash, value: MintAssets): Mint;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {ScriptHash} key
+ * @param {MintAssets} value
+ * @returns {MintAssets | undefined}
+ */
+ insert(key: ScriptHash, value: MintAssets): MintAssets | undefined;
+ /**
+ * @param {ScriptHash} key
+ * @returns {MintAssets | undefined}
+ */
+ get(key: ScriptHash): MintAssets | undefined;
+ /**
+ * @returns {ScriptHashes}
+ */
+ keys(): ScriptHashes;
+ /**
+ * Returns the multiasset where only positive (minting) entries are present
+ * @returns {MultiAsset}
+ */
+ as_positive_multiasset(): MultiAsset;
+ /**
+ * Returns the multiasset where only negative (burning) entries are present
+ * @returns {MultiAsset}
+ */
+ as_negative_multiasset(): MultiAsset;
+}
+/** */
+export class MintAssets {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {MintAssets}
+ */
+ static new(): MintAssets;
+ /**
+ * @param {AssetName} key
+ * @param {Int} value
+ * @returns {MintAssets}
+ */
+ static new_from_entry(key: AssetName, value: Int): MintAssets;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {AssetName} key
+ * @param {Int} value
+ * @returns {Int | undefined}
+ */
+ insert(key: AssetName, value: Int): Int | undefined;
+ /**
+ * @param {AssetName} key
+ * @returns {Int | undefined}
+ */
+ get(key: AssetName): Int | undefined;
+ /**
+ * @returns {AssetNames}
+ */
+ keys(): AssetNames;
+}
+/** */
+export class MoveInstantaneousReward {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {MoveInstantaneousReward}
+ */
+ static from_bytes(bytes: Uint8Array): MoveInstantaneousReward;
+ /**
+ * @param {string} json
+ * @returns {MoveInstantaneousReward}
+ */
+ static from_json(json: string): MoveInstantaneousReward;
+ /**
+ * @param {number} pot
+ * @param {BigNum} amount
+ * @returns {MoveInstantaneousReward}
+ */
+ static new_to_other_pot(pot: number, amount: BigNum): MoveInstantaneousReward;
+ /**
+ * @param {number} pot
+ * @param {MIRToStakeCredentials} amounts
+ * @returns {MoveInstantaneousReward}
+ */
+ static new_to_stake_creds(pot: number, amounts: MIRToStakeCredentials): MoveInstantaneousReward;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ pot(): number;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_to_other_pot(): BigNum | undefined;
+ /**
+ * @returns {MIRToStakeCredentials | undefined}
+ */
+ as_to_stake_creds(): MIRToStakeCredentials | undefined;
+}
+/** */
+export class MoveInstantaneousRewardsCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {MoveInstantaneousRewardsCert}
+ */
+ static from_bytes(bytes: Uint8Array): MoveInstantaneousRewardsCert;
+ /**
+ * @param {string} json
+ * @returns {MoveInstantaneousRewardsCert}
+ */
+ static from_json(json: string): MoveInstantaneousRewardsCert;
+ /**
+ * @param {MoveInstantaneousReward} move_instantaneous_reward
+ * @returns {MoveInstantaneousRewardsCert}
+ */
+ static new(move_instantaneous_reward: MoveInstantaneousReward): MoveInstantaneousRewardsCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {MoveInstantaneousReward}
+ */
+ move_instantaneous_reward(): MoveInstantaneousReward;
+}
+/** */
+export class MultiAsset {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {MultiAsset}
+ */
+ static from_bytes(bytes: Uint8Array): MultiAsset;
+ /**
+ * @param {string} json
+ * @returns {MultiAsset}
+ */
+ static from_json(json: string): MultiAsset;
+ /**
+ * @returns {MultiAsset}
+ */
+ static new(): MultiAsset;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * the number of unique policy IDs in the multiasset
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * 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: ScriptHash, assets: Assets): Assets | undefined;
+ /**
+ * all assets under {policy_id}, if any exist, or else None (undefined in JS)
+ * @param {ScriptHash} policy_id
+ * @returns {Assets | undefined}
+ */
+ get(policy_id: ScriptHash): Assets | undefined;
+ /**
+ * 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: ScriptHash, asset_name: AssetName, value: BigNum): BigNum | undefined;
+ /**
+ * 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: ScriptHash, asset_name: AssetName): BigNum;
+ /**
+ * returns all policy IDs used by assets in this multiasset
+ * @returns {ScriptHashes}
+ */
+ keys(): ScriptHashes;
+ /**
+ * 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: MultiAsset): MultiAsset;
+}
+/** */
+export class MultiHostName {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {MultiHostName}
+ */
+ static from_bytes(bytes: Uint8Array): MultiHostName;
+ /**
+ * @param {string} json
+ * @returns {MultiHostName}
+ */
+ static from_json(json: string): MultiHostName;
+ /**
+ * @param {DNSRecordSRV} dns_name
+ * @returns {MultiHostName}
+ */
+ static new(dns_name: DNSRecordSRV): MultiHostName;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {DNSRecordSRV}
+ */
+ dns_name(): DNSRecordSRV;
+}
+/** */
+export class NativeScript {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {NativeScript}
+ */
+ static from_bytes(bytes: Uint8Array): NativeScript;
+ /**
+ * @param {string} json
+ * @returns {NativeScript}
+ */
+ static from_json(json: string): NativeScript;
+ /**
+ * @param {ScriptPubkey} script_pubkey
+ * @returns {NativeScript}
+ */
+ static new_script_pubkey(script_pubkey: ScriptPubkey): NativeScript;
+ /**
+ * @param {ScriptAll} script_all
+ * @returns {NativeScript}
+ */
+ static new_script_all(script_all: ScriptAll): NativeScript;
+ /**
+ * @param {ScriptAny} script_any
+ * @returns {NativeScript}
+ */
+ static new_script_any(script_any: ScriptAny): NativeScript;
+ /**
+ * @param {ScriptNOfK} script_n_of_k
+ * @returns {NativeScript}
+ */
+ static new_script_n_of_k(script_n_of_k: ScriptNOfK): NativeScript;
+ /**
+ * @param {TimelockStart} timelock_start
+ * @returns {NativeScript}
+ */
+ static new_timelock_start(timelock_start: TimelockStart): NativeScript;
+ /**
+ * @param {TimelockExpiry} timelock_expiry
+ * @returns {NativeScript}
+ */
+ static new_timelock_expiry(timelock_expiry: TimelockExpiry): NativeScript;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @param {number} namespace
+ * @returns {ScriptHash}
+ */
+ hash(namespace: number): ScriptHash;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {ScriptPubkey | undefined}
+ */
+ as_script_pubkey(): ScriptPubkey | undefined;
+ /**
+ * @returns {ScriptAll | undefined}
+ */
+ as_script_all(): ScriptAll | undefined;
+ /**
+ * @returns {ScriptAny | undefined}
+ */
+ as_script_any(): ScriptAny | undefined;
+ /**
+ * @returns {ScriptNOfK | undefined}
+ */
+ as_script_n_of_k(): ScriptNOfK | undefined;
+ /**
+ * @returns {TimelockStart | undefined}
+ */
+ as_timelock_start(): TimelockStart | undefined;
+ /**
+ * @returns {TimelockExpiry | undefined}
+ */
+ as_timelock_expiry(): TimelockExpiry | undefined;
+ /**
+ * Returns an array of unique 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(): Ed25519KeyHashes;
+ /**
+ * @param {BigNum | undefined} lower_bound
+ * @param {BigNum | undefined} upper_bound
+ * @param {Ed25519KeyHashes} key_hashes
+ * @returns {boolean}
+ */
+ verify(lower_bound: BigNum | undefined, upper_bound: BigNum | undefined, key_hashes: Ed25519KeyHashes): boolean;
+}
+/** */
+export class NativeScripts {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {NativeScripts}
+ */
+ static new(): NativeScripts;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {NativeScript}
+ */
+ get(index: number): NativeScript;
+ /**
+ * @param {NativeScript} elem
+ */
+ add(elem: NativeScript): void;
+}
+/** */
+export class NetworkId {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {NetworkId}
+ */
+ static from_bytes(bytes: Uint8Array): NetworkId;
+ /**
+ * @param {string} json
+ * @returns {NetworkId}
+ */
+ static from_json(json: string): NetworkId;
+ /**
+ * @returns {NetworkId}
+ */
+ static testnet(): NetworkId;
+ /**
+ * @returns {NetworkId}
+ */
+ static mainnet(): NetworkId;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+}
+/** */
+export class NetworkInfo {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {number} network_id
+ * @param {number} protocol_magic
+ * @returns {NetworkInfo}
+ */
+ static new(network_id: number, protocol_magic: number): NetworkInfo;
+ /**
+ * @returns {NetworkInfo}
+ */
+ static testnet(): NetworkInfo;
+ /**
+ * @returns {NetworkInfo}
+ */
+ static mainnet(): NetworkInfo;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ network_id(): number;
+ /**
+ * @returns {number}
+ */
+ protocol_magic(): number;
+}
+/** */
+export class NewCommittee {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {NewCommittee}
+ */
+ static from_bytes(bytes: Uint8Array): NewCommittee;
+ /**
+ * @param {string} json
+ * @returns {NewCommittee}
+ */
+ static from_json(json: string): NewCommittee;
+ /**
+ * @param {Ed25519KeyHashes} committee
+ * @param {UnitInterval} rational
+ * @returns {NewCommittee}
+ */
+ static new(committee: Ed25519KeyHashes, rational: UnitInterval): NewCommittee;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ committee(): Ed25519KeyHashes;
+ /**
+ * @returns {UnitInterval}
+ */
+ rational(): UnitInterval;
+}
+/** */
+export class NewConstitution {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {NewConstitution}
+ */
+ static from_bytes(bytes: Uint8Array): NewConstitution;
+ /**
+ * @param {string} json
+ * @returns {NewConstitution}
+ */
+ static from_json(json: string): NewConstitution;
+ /**
+ * @param {DataHash} hash
+ * @returns {NewConstitution}
+ */
+ static new(hash: DataHash): NewConstitution;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {DataHash}
+ */
+ hash(): DataHash;
+}
+/** */
+export class Nonce {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Nonce}
+ */
+ static from_bytes(bytes: Uint8Array): Nonce;
+ /**
+ * @returns {Nonce}
+ */
+ static new_identity(): Nonce;
+ /**
+ * @param {Uint8Array} hash
+ * @returns {Nonce}
+ */
+ static new_from_hash(hash: Uint8Array): Nonce;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ get_hash(): Uint8Array | undefined;
+}
+/** */
+export class OperationalCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {OperationalCert}
+ */
+ static from_bytes(bytes: Uint8Array): OperationalCert;
+ /**
+ * @param {string} json
+ * @returns {OperationalCert}
+ */
+ static from_json(json: string): OperationalCert;
+ /**
+ * @param {KESVKey} hot_vkey
+ * @param {number} sequence_number
+ * @param {number} kes_period
+ * @param {Ed25519Signature} sigma
+ * @returns {OperationalCert}
+ */
+ static new(hot_vkey: KESVKey, sequence_number: number, kes_period: number, sigma: Ed25519Signature): OperationalCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {KESVKey}
+ */
+ hot_vkey(): KESVKey;
+ /**
+ * @returns {number}
+ */
+ sequence_number(): number;
+ /**
+ * @returns {number}
+ */
+ kes_period(): number;
+ /**
+ * @returns {Ed25519Signature}
+ */
+ sigma(): Ed25519Signature;
+}
+/** */
+export class ParameterChangeAction {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ParameterChangeAction}
+ */
+ static from_bytes(bytes: Uint8Array): ParameterChangeAction;
+ /**
+ * @param {string} json
+ * @returns {ParameterChangeAction}
+ */
+ static from_json(json: string): ParameterChangeAction;
+ /**
+ * @param {ProtocolParamUpdate} protocol_param_update
+ * @returns {ParameterChangeAction}
+ */
+ static new(protocol_param_update: ProtocolParamUpdate): ParameterChangeAction;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {ProtocolParamUpdate}
+ */
+ protocol_param_update(): ProtocolParamUpdate;
+}
+/** */
+export class PlutusData {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PlutusData}
+ */
+ static from_bytes(bytes: Uint8Array): PlutusData;
+ /**
+ * @param {ConstrPlutusData} constr_plutus_data
+ * @returns {PlutusData}
+ */
+ static new_constr_plutus_data(constr_plutus_data: ConstrPlutusData): PlutusData;
+ /**
+ * @param {PlutusMap} map
+ * @returns {PlutusData}
+ */
+ static new_map(map: PlutusMap): PlutusData;
+ /**
+ * @param {PlutusList} list
+ * @returns {PlutusData}
+ */
+ static new_list(list: PlutusList): PlutusData;
+ /**
+ * @param {BigInt} integer
+ * @returns {PlutusData}
+ */
+ static new_integer(integer: BigInt): PlutusData;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PlutusData}
+ */
+ static new_bytes(bytes: Uint8Array): PlutusData;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {ConstrPlutusData | undefined}
+ */
+ as_constr_plutus_data(): ConstrPlutusData | undefined;
+ /**
+ * @returns {PlutusMap | undefined}
+ */
+ as_map(): PlutusMap | undefined;
+ /**
+ * @returns {PlutusList | undefined}
+ */
+ as_list(): PlutusList | undefined;
+ /**
+ * @returns {BigInt | undefined}
+ */
+ as_integer(): BigInt | undefined;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ as_bytes(): Uint8Array | undefined;
+}
+/** */
+export class PlutusList {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PlutusList}
+ */
+ static from_bytes(bytes: Uint8Array): PlutusList;
+ /**
+ * @returns {PlutusList}
+ */
+ static new(): PlutusList;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {PlutusData}
+ */
+ get(index: number): PlutusData;
+ /**
+ * @param {PlutusData} elem
+ */
+ add(elem: PlutusData): void;
+}
+/** */
+export class PlutusMap {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PlutusMap}
+ */
+ static from_bytes(bytes: Uint8Array): PlutusMap;
+ /**
+ * @returns {PlutusMap}
+ */
+ static new(): PlutusMap;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {PlutusData} key
+ * @param {PlutusData} value
+ * @returns {PlutusData | undefined}
+ */
+ insert(key: PlutusData, value: PlutusData): PlutusData | undefined;
+ /**
+ * @param {PlutusData} key
+ * @returns {PlutusData | undefined}
+ */
+ get(key: PlutusData): PlutusData | undefined;
+ /**
+ * @returns {PlutusList}
+ */
+ keys(): PlutusList;
+}
+/** */
+export class PlutusScript {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PlutusScript}
+ */
+ static from_bytes(bytes: Uint8Array): PlutusScript;
+ /**
+ * * 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: Uint8Array): PlutusScript;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {number} namespace
+ * @returns {ScriptHash}
+ */
+ hash(namespace: number): ScriptHash;
+ /**
+ * * The raw bytes of this compiled Plutus script.
+ * * If you need "cborBytes" for cardano-cli use PlutusScript::to_bytes() instead.
+ *
+ * @returns {Uint8Array}
+ */
+ bytes(): Uint8Array;
+}
+/** */
+export class PlutusScripts {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PlutusScripts}
+ */
+ static from_bytes(bytes: Uint8Array): PlutusScripts;
+ /**
+ * @returns {PlutusScripts}
+ */
+ static new(): PlutusScripts;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {PlutusScript}
+ */
+ get(index: number): PlutusScript;
+ /**
+ * @param {PlutusScript} elem
+ */
+ add(elem: PlutusScript): void;
+}
+/** */
+export class PlutusWitness {
+ static __wrap(ptr: any): any;
+ /**
+ * Plutus V1 witness or witness where no script is attached and so version doesn't matter
+ * @param {PlutusData} redeemer
+ * @param {PlutusData | undefined} plutus_data
+ * @param {PlutusScript | undefined} script
+ * @returns {PlutusWitness}
+ */
+ static new(redeemer: PlutusData, plutus_data: PlutusData | undefined, script: PlutusScript | undefined): PlutusWitness;
+ /**
+ * @param {PlutusData} redeemer
+ * @param {PlutusData | undefined} plutus_data
+ * @param {PlutusScript | undefined} script
+ * @returns {PlutusWitness}
+ */
+ static new_plutus_v2(redeemer: PlutusData, plutus_data: PlutusData | undefined, script: PlutusScript | undefined): PlutusWitness;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {PlutusData | undefined}
+ */
+ plutus_data(): PlutusData | undefined;
+ /**
+ * @returns {PlutusData}
+ */
+ redeemer(): PlutusData;
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ script(): PlutusScript | undefined;
+ /**
+ * @returns {number}
+ */
+ version(): number;
+}
+/** */
+export class Pointer {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {BigNum} slot
+ * @param {BigNum} tx_index
+ * @param {BigNum} cert_index
+ * @returns {Pointer}
+ */
+ static new(slot: BigNum, tx_index: BigNum, cert_index: BigNum): Pointer;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {BigNum}
+ */
+ slot(): BigNum;
+ /**
+ * @returns {BigNum}
+ */
+ tx_index(): BigNum;
+ /**
+ * @returns {BigNum}
+ */
+ cert_index(): BigNum;
+}
+/** */
+export class PointerAddress {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @param {Pointer} stake
+ * @returns {PointerAddress}
+ */
+ static new(network: number, payment: StakeCredential, stake: Pointer): PointerAddress;
+ /**
+ * @param {Address} addr
+ * @returns {PointerAddress | undefined}
+ */
+ static from_address(addr: Address): PointerAddress | undefined;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred(): StakeCredential;
+ /**
+ * @returns {Pointer}
+ */
+ stake_pointer(): Pointer;
+ /**
+ * @returns {Address}
+ */
+ to_address(): Address;
+}
+/** */
+export class PoolMetadata {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PoolMetadata}
+ */
+ static from_bytes(bytes: Uint8Array): PoolMetadata;
+ /**
+ * @param {string} json
+ * @returns {PoolMetadata}
+ */
+ static from_json(json: string): PoolMetadata;
+ /**
+ * @param {Url} url
+ * @param {PoolMetadataHash} pool_metadata_hash
+ * @returns {PoolMetadata}
+ */
+ static new(url: Url, pool_metadata_hash: PoolMetadataHash): PoolMetadata;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Url}
+ */
+ url(): Url;
+ /**
+ * @returns {PoolMetadataHash}
+ */
+ pool_metadata_hash(): PoolMetadataHash;
+}
+/** */
+export class PoolMetadataHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PoolMetadataHash}
+ */
+ static from_bytes(bytes: Uint8Array): PoolMetadataHash;
+ /**
+ * @param {string} bech_str
+ * @returns {PoolMetadataHash}
+ */
+ static from_bech32(bech_str: string): PoolMetadataHash;
+ /**
+ * @param {string} hex
+ * @returns {PoolMetadataHash}
+ */
+ static from_hex(hex: string): PoolMetadataHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class PoolParams {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PoolParams}
+ */
+ static from_bytes(bytes: Uint8Array): PoolParams;
+ /**
+ * @param {string} json
+ * @returns {PoolParams}
+ */
+ static from_json(json: string): PoolParams;
+ /**
+ * @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: Ed25519KeyHash, vrf_keyhash: VRFKeyHash, pledge: BigNum, cost: BigNum, margin: UnitInterval, reward_account: RewardAddress, pool_owners: Ed25519KeyHashes, relays: Relays, pool_metadata: PoolMetadata | undefined): PoolParams;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ operator(): Ed25519KeyHash;
+ /**
+ * @returns {VRFKeyHash}
+ */
+ vrf_keyhash(): VRFKeyHash;
+ /**
+ * @returns {BigNum}
+ */
+ pledge(): BigNum;
+ /**
+ * @returns {BigNum}
+ */
+ cost(): BigNum;
+ /**
+ * @returns {UnitInterval}
+ */
+ margin(): UnitInterval;
+ /**
+ * @returns {RewardAddress}
+ */
+ reward_account(): RewardAddress;
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ pool_owners(): Ed25519KeyHashes;
+ /**
+ * @returns {Relays}
+ */
+ relays(): Relays;
+ /**
+ * @returns {PoolMetadata | undefined}
+ */
+ pool_metadata(): PoolMetadata | undefined;
+}
+/** */
+export class PoolRegistration {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PoolRegistration}
+ */
+ static from_bytes(bytes: Uint8Array): PoolRegistration;
+ /**
+ * @param {string} json
+ * @returns {PoolRegistration}
+ */
+ static from_json(json: string): PoolRegistration;
+ /**
+ * @param {PoolParams} pool_params
+ * @returns {PoolRegistration}
+ */
+ static new(pool_params: PoolParams): PoolRegistration;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {PoolParams}
+ */
+ pool_params(): PoolParams;
+ /**
+ * @param {boolean} update
+ */
+ set_is_update(update: boolean): void;
+}
+/** */
+export class PoolRetirement {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PoolRetirement}
+ */
+ static from_bytes(bytes: Uint8Array): PoolRetirement;
+ /**
+ * @param {string} json
+ * @returns {PoolRetirement}
+ */
+ static from_json(json: string): PoolRetirement;
+ /**
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {number} epoch
+ * @returns {PoolRetirement}
+ */
+ static new(pool_keyhash: Ed25519KeyHash, epoch: number): PoolRetirement;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash(): Ed25519KeyHash;
+ /**
+ * @returns {number}
+ */
+ epoch(): number;
+}
+/** */
+export class PoolVotingThresholds {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PoolVotingThresholds}
+ */
+ static from_bytes(bytes: Uint8Array): PoolVotingThresholds;
+ /**
+ * @param {string} json
+ * @returns {PoolVotingThresholds}
+ */
+ static from_json(json: string): PoolVotingThresholds;
+ /**
+ * @param {UnitInterval} motion_no_confidence
+ * @param {UnitInterval} committee_normal
+ * @param {UnitInterval} committee_no_confidence
+ * @param {UnitInterval} hard_fork_initiation
+ * @returns {PoolVotingThresholds}
+ */
+ static new(motion_no_confidence: UnitInterval, committee_normal: UnitInterval, committee_no_confidence: UnitInterval, hard_fork_initiation: UnitInterval): PoolVotingThresholds;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {UnitInterval}
+ */
+ motion_no_confidence(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_normal(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_no_confidence(): UnitInterval;
+ /**
+ * @returns {UnitInterval}
+ */
+ hard_fork_initiation(): UnitInterval;
+}
+/** */
+export class PrivateKey {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {PrivateKey}
+ */
+ static generate_ed25519(): PrivateKey;
+ /**
+ * @returns {PrivateKey}
+ */
+ static generate_ed25519extended(): PrivateKey;
+ /**
+ * 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: string): PrivateKey;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PrivateKey}
+ */
+ static from_extended_bytes(bytes: Uint8Array): PrivateKey;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PrivateKey}
+ */
+ static from_normal_bytes(bytes: Uint8Array): PrivateKey;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PrivateKey}
+ */
+ static from_bytes(bytes: Uint8Array): PrivateKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {PublicKey}
+ */
+ to_public(): PublicKey;
+ /**
+ * @returns {string}
+ */
+ to_bech32(): string;
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes(): Uint8Array;
+ /**
+ * @param {Uint8Array} message
+ * @returns {Ed25519Signature}
+ */
+ sign(message: Uint8Array): Ed25519Signature;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+}
+/** */
+export class ProposalProcedure {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProposalProcedure}
+ */
+ static from_bytes(bytes: Uint8Array): ProposalProcedure;
+ /**
+ * @param {string} json
+ * @returns {ProposalProcedure}
+ */
+ static from_json(json: string): ProposalProcedure;
+ /**
+ * @param {BigNum} deposit
+ * @param {ScriptHash} hash
+ * @param {GovernanceAction} governance_action
+ * @param {Anchor} anchor
+ * @returns {ProposalProcedure}
+ */
+ static new(deposit: BigNum, hash: ScriptHash, governance_action: GovernanceAction, anchor: Anchor): ProposalProcedure;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {BigNum}
+ */
+ deposit(): BigNum;
+ /**
+ * @returns {ScriptHash}
+ */
+ hash(): ScriptHash;
+ /**
+ * @returns {GovernanceAction}
+ */
+ governance_action(): GovernanceAction;
+ /**
+ * @returns {Anchor}
+ */
+ anchor(): Anchor;
+}
+/** */
+export class ProposalProcedures {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProposalProcedures}
+ */
+ static from_bytes(bytes: Uint8Array): ProposalProcedures;
+ /**
+ * @returns {ProposalProcedures}
+ */
+ static new(): ProposalProcedures;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {ProposalProcedure}
+ */
+ get(index: number): ProposalProcedure;
+ /**
+ * @param {ProposalProcedure} elem
+ */
+ add(elem: ProposalProcedure): void;
+}
+/** */
+export class ProposedProtocolParameterUpdates {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProposedProtocolParameterUpdates}
+ */
+ static from_bytes(bytes: Uint8Array): ProposedProtocolParameterUpdates;
+ /**
+ * @param {string} json
+ * @returns {ProposedProtocolParameterUpdates}
+ */
+ static from_json(json: string): ProposedProtocolParameterUpdates;
+ /**
+ * @returns {ProposedProtocolParameterUpdates}
+ */
+ static new(): ProposedProtocolParameterUpdates;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {GenesisHash} key
+ * @param {ProtocolParamUpdate} value
+ * @returns {ProtocolParamUpdate | undefined}
+ */
+ insert(key: GenesisHash, value: ProtocolParamUpdate): ProtocolParamUpdate | undefined;
+ /**
+ * @param {GenesisHash} key
+ * @returns {ProtocolParamUpdate | undefined}
+ */
+ get(key: GenesisHash): ProtocolParamUpdate | undefined;
+ /**
+ * @returns {GenesisHashes}
+ */
+ keys(): GenesisHashes;
+}
+/** */
+export class ProtocolParamUpdate {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProtocolParamUpdate}
+ */
+ static from_bytes(bytes: Uint8Array): ProtocolParamUpdate;
+ /**
+ * @param {string} json
+ * @returns {ProtocolParamUpdate}
+ */
+ static from_json(json: string): ProtocolParamUpdate;
+ /**
+ * @returns {ProtocolParamUpdate}
+ */
+ static new(): ProtocolParamUpdate;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @param {BigNum} minfee_a
+ */
+ set_minfee_a(minfee_a: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ minfee_a(): BigNum | undefined;
+ /**
+ * @param {BigNum} minfee_b
+ */
+ set_minfee_b(minfee_b: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ minfee_b(): BigNum | undefined;
+ /**
+ * @param {number} max_block_body_size
+ */
+ set_max_block_body_size(max_block_body_size: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ max_block_body_size(): number | undefined;
+ /**
+ * @param {number} max_tx_size
+ */
+ set_max_tx_size(max_tx_size: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ max_tx_size(): number | undefined;
+ /**
+ * @param {number} max_block_header_size
+ */
+ set_max_block_header_size(max_block_header_size: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ max_block_header_size(): number | undefined;
+ /**
+ * @param {BigNum} key_deposit
+ */
+ set_key_deposit(key_deposit: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ key_deposit(): BigNum | undefined;
+ /**
+ * @param {BigNum} pool_deposit
+ */
+ set_pool_deposit(pool_deposit: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ pool_deposit(): BigNum | undefined;
+ /**
+ * @param {number} max_epoch
+ */
+ set_max_epoch(max_epoch: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ max_epoch(): number | undefined;
+ /**
+ * @param {number} n_opt
+ */
+ set_n_opt(n_opt: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ n_opt(): number | undefined;
+ /**
+ * @param {UnitInterval} pool_pledge_influence
+ */
+ set_pool_pledge_influence(pool_pledge_influence: UnitInterval): void;
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ pool_pledge_influence(): UnitInterval | undefined;
+ /**
+ * @param {UnitInterval} expansion_rate
+ */
+ set_expansion_rate(expansion_rate: UnitInterval): void;
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ expansion_rate(): UnitInterval | undefined;
+ /**
+ * @param {UnitInterval} treasury_growth_rate
+ */
+ set_treasury_growth_rate(treasury_growth_rate: UnitInterval): void;
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ treasury_growth_rate(): UnitInterval | undefined;
+ /**
+ * @param {UnitInterval} d
+ */
+ set_d(d: UnitInterval): void;
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ d(): UnitInterval | undefined;
+ /**
+ * @param {Nonce} extra_entropy
+ */
+ set_extra_entropy(extra_entropy: Nonce): void;
+ /**
+ * @returns {Nonce | undefined}
+ */
+ extra_entropy(): Nonce | undefined;
+ /**
+ * @param {ProtocolVersion} protocol_version
+ */
+ set_protocol_version(protocol_version: ProtocolVersion): void;
+ /**
+ * @returns {ProtocolVersion | undefined}
+ */
+ protocol_version(): ProtocolVersion | undefined;
+ /**
+ * @param {BigNum} min_pool_cost
+ */
+ set_min_pool_cost(min_pool_cost: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ min_pool_cost(): BigNum | undefined;
+ /**
+ * @param {BigNum} ada_per_utxo_byte
+ */
+ set_ada_per_utxo_byte(ada_per_utxo_byte: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ ada_per_utxo_byte(): BigNum | undefined;
+ /**
+ * @param {Costmdls} cost_models
+ */
+ set_cost_models(cost_models: Costmdls): void;
+ /**
+ * @returns {Costmdls | undefined}
+ */
+ cost_models(): Costmdls | undefined;
+ /**
+ * @param {ExUnitPrices} execution_costs
+ */
+ set_execution_costs(execution_costs: ExUnitPrices): void;
+ /**
+ * @returns {ExUnitPrices | undefined}
+ */
+ execution_costs(): ExUnitPrices | undefined;
+ /**
+ * @param {ExUnits} max_tx_ex_units
+ */
+ set_max_tx_ex_units(max_tx_ex_units: ExUnits): void;
+ /**
+ * @returns {ExUnits | undefined}
+ */
+ max_tx_ex_units(): ExUnits | undefined;
+ /**
+ * @param {ExUnits} max_block_ex_units
+ */
+ set_max_block_ex_units(max_block_ex_units: ExUnits): void;
+ /**
+ * @returns {ExUnits | undefined}
+ */
+ max_block_ex_units(): ExUnits | undefined;
+ /**
+ * @param {number} max_value_size
+ */
+ set_max_value_size(max_value_size: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ max_value_size(): number | undefined;
+ /**
+ * @param {number} collateral_percentage
+ */
+ set_collateral_percentage(collateral_percentage: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ collateral_percentage(): number | undefined;
+ /**
+ * @param {number} max_collateral_inputs
+ */
+ set_max_collateral_inputs(max_collateral_inputs: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ max_collateral_inputs(): number | undefined;
+ /**
+ * @param {PoolVotingThresholds} pool_voting_thresholds
+ */
+ set_pool_voting_thresholds(pool_voting_thresholds: PoolVotingThresholds): void;
+ /**
+ * @returns {PoolVotingThresholds | undefined}
+ */
+ pool_voting_thresholds(): PoolVotingThresholds | undefined;
+ /**
+ * @param {DrepVotingThresholds} drep_voting_thresholds
+ */
+ set_drep_voting_thresholds(drep_voting_thresholds: DrepVotingThresholds): void;
+ /**
+ * @returns {DrepVotingThresholds | undefined}
+ */
+ drep_voting_thresholds(): DrepVotingThresholds | undefined;
+ /**
+ * @param {BigNum} min_committee_size
+ */
+ set_min_committee_size(min_committee_size: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ min_committee_size(): BigNum | undefined;
+ /**
+ * @param {BigNum} committee_term_limit
+ */
+ set_committee_term_limit(committee_term_limit: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ committee_term_limit(): BigNum | undefined;
+ /**
+ * @param {BigNum} governance_action_expiration
+ */
+ set_governance_action_expiration(governance_action_expiration: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ governance_action_expiration(): BigNum | undefined;
+ /**
+ * @param {BigNum} governance_action_deposit
+ */
+ set_governance_action_deposit(governance_action_deposit: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ governance_action_deposit(): BigNum | undefined;
+ /**
+ * @param {BigNum} drep_deposit
+ */
+ set_drep_deposit(drep_deposit: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ drep_deposit(): BigNum | undefined;
+ /**
+ * @param {number} drep_inactivity_period
+ */
+ set_drep_inactivity_period(drep_inactivity_period: number): void;
+ /**
+ * @returns {number | undefined}
+ */
+ drep_inactivity_period(): number | undefined;
+ /**
+ * @param {UnitInterval} minfee_refscript_cost_per_byte
+ */
+ set_minfee_refscript_cost_per_byte(minfee_refscript_cost_per_byte: UnitInterval): void;
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ minfee_refscript_cost_per_byte(): UnitInterval | undefined;
+}
+/** */
+export class ProtocolVersion {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProtocolVersion}
+ */
+ static from_bytes(bytes: Uint8Array): ProtocolVersion;
+ /**
+ * @param {string} json
+ * @returns {ProtocolVersion}
+ */
+ static from_json(json: string): ProtocolVersion;
+ /**
+ * @param {number} major
+ * @param {number} minor
+ * @returns {ProtocolVersion}
+ */
+ static new(major: number, minor: number): ProtocolVersion;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ major(): number;
+ /**
+ * @returns {number}
+ */
+ minor(): number;
+}
+/**
+ * ED25519 key used as public key
+ */
+export class PublicKey {
+ static __wrap(ptr: any): any;
+ /**
+ * 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: string): PublicKey;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PublicKey}
+ */
+ static from_bytes(bytes: Uint8Array): PublicKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {string}
+ */
+ to_bech32(): string;
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes(): Uint8Array;
+ /**
+ * @param {Uint8Array} data
+ * @param {Ed25519Signature} signature
+ * @returns {boolean}
+ */
+ verify(data: Uint8Array, signature: Ed25519Signature): boolean;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ hash(): Ed25519KeyHash;
+}
+/** */
+export class PublicKeys {
+ static __wrap(ptr: any): any;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ size(): number;
+ /**
+ * @param {number} index
+ * @returns {PublicKey}
+ */
+ get(index: number): PublicKey;
+ /**
+ * @param {PublicKey} key
+ */
+ add(key: PublicKey): void;
+}
+/** */
+export class Redeemer {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Redeemer}
+ */
+ static from_bytes(bytes: Uint8Array): Redeemer;
+ /**
+ * @param {RedeemerTag} tag
+ * @param {BigNum} index
+ * @param {PlutusData} data
+ * @param {ExUnits} ex_units
+ * @returns {Redeemer}
+ */
+ static new(tag: RedeemerTag, index: BigNum, data: PlutusData, ex_units: ExUnits): Redeemer;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {RedeemerTag}
+ */
+ tag(): RedeemerTag;
+ /**
+ * @returns {BigNum}
+ */
+ index(): BigNum;
+ /**
+ * @returns {PlutusData}
+ */
+ data(): PlutusData;
+ /**
+ * @returns {ExUnits}
+ */
+ ex_units(): ExUnits;
+}
+/** */
+export class RedeemerTag {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RedeemerTag}
+ */
+ static from_bytes(bytes: Uint8Array): RedeemerTag;
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_spend(): RedeemerTag;
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_mint(): RedeemerTag;
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_cert(): RedeemerTag;
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_reward(): RedeemerTag;
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_voting(): RedeemerTag;
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_proposing(): RedeemerTag;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+}
+/** */
+export class RedeemerWitnessKey {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {RedeemerTag} tag
+ * @param {BigNum} index
+ * @returns {RedeemerWitnessKey}
+ */
+ static new(tag: RedeemerTag, index: BigNum): RedeemerWitnessKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {RedeemerTag}
+ */
+ tag(): RedeemerTag;
+ /**
+ * @returns {BigNum}
+ */
+ index(): BigNum;
+}
+/** */
+export class Redeemers {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Redeemers}
+ */
+ static from_bytes(bytes: Uint8Array): Redeemers;
+ /**
+ * @returns {Redeemers}
+ */
+ static new(): Redeemers;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {Redeemer}
+ */
+ get(index: number): Redeemer;
+ /**
+ * @param {Redeemer} elem
+ */
+ add(elem: Redeemer): void;
+}
+/** */
+export class RegCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegCert}
+ */
+ static from_bytes(bytes: Uint8Array): RegCert;
+ /**
+ * @param {string} json
+ * @returns {RegCert}
+ */
+ static from_json(json: string): RegCert;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {BigNum} coin
+ * @returns {RegCert}
+ */
+ static new(stake_credential: StakeCredential, coin: BigNum): RegCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+ /**
+ * @returns {BigNum}
+ */
+ coin(): BigNum;
+}
+/** */
+export class RegCommitteeHotKeyCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegCommitteeHotKeyCert}
+ */
+ static from_bytes(bytes: Uint8Array): RegCommitteeHotKeyCert;
+ /**
+ * @param {string} json
+ * @returns {RegCommitteeHotKeyCert}
+ */
+ static from_json(json: string): RegCommitteeHotKeyCert;
+ /**
+ * @param {Ed25519KeyHash} committee_cold_keyhash
+ * @param {Ed25519KeyHash} committee_hot_keyhash
+ * @returns {RegCommitteeHotKeyCert}
+ */
+ static new(committee_cold_keyhash: Ed25519KeyHash, committee_hot_keyhash: Ed25519KeyHash): RegCommitteeHotKeyCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_cold_keyhash(): Ed25519KeyHash;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_hot_keyhash(): Ed25519KeyHash;
+}
+/** */
+export class RegDrepCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegDrepCert}
+ */
+ static from_bytes(bytes: Uint8Array): RegDrepCert;
+ /**
+ * @param {string} json
+ * @returns {RegDrepCert}
+ */
+ static from_json(json: string): RegDrepCert;
+ /**
+ * @param {StakeCredential} voting_credential
+ * @param {BigNum} coin
+ * @returns {RegDrepCert}
+ */
+ static new(voting_credential: StakeCredential, coin: BigNum): RegDrepCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ voting_credential(): StakeCredential;
+ /**
+ * @returns {BigNum}
+ */
+ coin(): BigNum;
+}
+/** */
+export class Relay {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Relay}
+ */
+ static from_bytes(bytes: Uint8Array): Relay;
+ /**
+ * @param {string} json
+ * @returns {Relay}
+ */
+ static from_json(json: string): Relay;
+ /**
+ * @param {SingleHostAddr} single_host_addr
+ * @returns {Relay}
+ */
+ static new_single_host_addr(single_host_addr: SingleHostAddr): Relay;
+ /**
+ * @param {SingleHostName} single_host_name
+ * @returns {Relay}
+ */
+ static new_single_host_name(single_host_name: SingleHostName): Relay;
+ /**
+ * @param {MultiHostName} multi_host_name
+ * @returns {Relay}
+ */
+ static new_multi_host_name(multi_host_name: MultiHostName): Relay;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {SingleHostAddr | undefined}
+ */
+ as_single_host_addr(): SingleHostAddr | undefined;
+ /**
+ * @returns {SingleHostName | undefined}
+ */
+ as_single_host_name(): SingleHostName | undefined;
+ /**
+ * @returns {MultiHostName | undefined}
+ */
+ as_multi_host_name(): MultiHostName | undefined;
+}
+/** */
+export class Relays {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Relays}
+ */
+ static from_bytes(bytes: Uint8Array): Relays;
+ /**
+ * @param {string} json
+ * @returns {Relays}
+ */
+ static from_json(json: string): Relays;
+ /**
+ * @returns {Relays}
+ */
+ static new(): Relays;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {Relay}
+ */
+ get(index: number): Relay;
+ /**
+ * @param {Relay} elem
+ */
+ add(elem: Relay): void;
+}
+/** */
+export class RequiredWitnessSet {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {RequiredWitnessSet}
+ */
+ static new(): RequiredWitnessSet;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @param {Vkeywitness} vkey
+ */
+ add_vkey(vkey: Vkeywitness): void;
+ /**
+ * @param {Vkey} vkey
+ */
+ add_vkey_key(vkey: Vkey): void;
+ /**
+ * @param {Ed25519KeyHash} hash
+ */
+ add_vkey_key_hash(hash: Ed25519KeyHash): void;
+ /**
+ * @param {BootstrapWitness} bootstrap
+ */
+ add_bootstrap(bootstrap: BootstrapWitness): void;
+ /**
+ * @param {Vkey} bootstrap
+ */
+ add_bootstrap_key(bootstrap: Vkey): void;
+ /**
+ * @param {Ed25519KeyHash} hash
+ */
+ add_bootstrap_key_hash(hash: Ed25519KeyHash): void;
+ /**
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script: NativeScript): void;
+ /**
+ * @param {ScriptHash} native_script
+ */
+ add_native_script_hash(native_script: ScriptHash): void;
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script: PlutusScript): void;
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script: PlutusScript): void;
+ /**
+ * @param {ScriptHash} plutus_script
+ */
+ add_plutus_hash(plutus_script: ScriptHash): void;
+ /**
+ * @param {PlutusData} plutus_datum
+ */
+ add_plutus_datum(plutus_datum: PlutusData): void;
+ /**
+ * @param {DataHash} plutus_datum
+ */
+ add_plutus_datum_hash(plutus_datum: DataHash): void;
+ /**
+ * @param {Redeemer} redeemer
+ */
+ add_redeemer(redeemer: Redeemer): void;
+ /**
+ * @param {RedeemerWitnessKey} redeemer
+ */
+ add_redeemer_tag(redeemer: RedeemerWitnessKey): void;
+ /**
+ * @param {RequiredWitnessSet} requirements
+ */
+ add_all(requirements: RequiredWitnessSet): void;
+}
+/** */
+export class RewardAddress {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @returns {RewardAddress}
+ */
+ static new(network: number, payment: StakeCredential): RewardAddress;
+ /**
+ * @param {Address} addr
+ * @returns {RewardAddress | undefined}
+ */
+ static from_address(addr: Address): RewardAddress | undefined;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred(): StakeCredential;
+ /**
+ * @returns {Address}
+ */
+ to_address(): Address;
+}
+/** */
+export class RewardAddresses {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RewardAddresses}
+ */
+ static from_bytes(bytes: Uint8Array): RewardAddresses;
+ /**
+ * @param {string} json
+ * @returns {RewardAddresses}
+ */
+ static from_json(json: string): RewardAddresses;
+ /**
+ * @returns {RewardAddresses}
+ */
+ static new(): RewardAddresses;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {RewardAddress}
+ */
+ get(index: number): RewardAddress;
+ /**
+ * @param {RewardAddress} elem
+ */
+ add(elem: RewardAddress): void;
+}
+/** */
+export class Script {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Script}
+ */
+ static from_bytes(bytes: Uint8Array): Script;
+ /**
+ * @param {string} json
+ * @returns {Script}
+ */
+ static from_json(json: string): Script;
+ /**
+ * @param {NativeScript} native_script
+ * @returns {Script}
+ */
+ static new_native(native_script: NativeScript): Script;
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v1(plutus_script: PlutusScript): Script;
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v2(plutus_script: PlutusScript): Script;
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v3(plutus_script: PlutusScript): Script;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {NativeScript | undefined}
+ */
+ as_native(): NativeScript | undefined;
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v1(): PlutusScript | undefined;
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v2(): PlutusScript | undefined;
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v3(): PlutusScript | undefined;
+}
+/** */
+export class ScriptAll {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ScriptAll}
+ */
+ static from_bytes(bytes: Uint8Array): ScriptAll;
+ /**
+ * @param {string} json
+ * @returns {ScriptAll}
+ */
+ static from_json(json: string): ScriptAll;
+ /**
+ * @param {NativeScripts} native_scripts
+ * @returns {ScriptAll}
+ */
+ static new(native_scripts: NativeScripts): ScriptAll;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {NativeScripts}
+ */
+ native_scripts(): NativeScripts;
+}
+/** */
+export class ScriptAny {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ScriptAny}
+ */
+ static from_bytes(bytes: Uint8Array): ScriptAny;
+ /**
+ * @param {string} json
+ * @returns {ScriptAny}
+ */
+ static from_json(json: string): ScriptAny;
+ /**
+ * @param {NativeScripts} native_scripts
+ * @returns {ScriptAny}
+ */
+ static new(native_scripts: NativeScripts): ScriptAny;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {NativeScripts}
+ */
+ native_scripts(): NativeScripts;
+}
+/** */
+export class ScriptDataHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ScriptDataHash}
+ */
+ static from_bytes(bytes: Uint8Array): ScriptDataHash;
+ /**
+ * @param {string} bech_str
+ * @returns {ScriptDataHash}
+ */
+ static from_bech32(bech_str: string): ScriptDataHash;
+ /**
+ * @param {string} hex
+ * @returns {ScriptDataHash}
+ */
+ static from_hex(hex: string): ScriptDataHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class ScriptHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ScriptHash}
+ */
+ static from_bytes(bytes: Uint8Array): ScriptHash;
+ /**
+ * @param {string} bech_str
+ * @returns {ScriptHash}
+ */
+ static from_bech32(bech_str: string): ScriptHash;
+ /**
+ * @param {string} hex
+ * @returns {ScriptHash}
+ */
+ static from_hex(hex: string): ScriptHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class ScriptHashes {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ScriptHashes}
+ */
+ static from_bytes(bytes: Uint8Array): ScriptHashes;
+ /**
+ * @param {string} json
+ * @returns {ScriptHashes}
+ */
+ static from_json(json: string): ScriptHashes;
+ /**
+ * @returns {ScriptHashes}
+ */
+ static new(): ScriptHashes;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {ScriptHash}
+ */
+ get(index: number): ScriptHash;
+ /**
+ * @param {ScriptHash} elem
+ */
+ add(elem: ScriptHash): void;
+}
+/** */
+export class ScriptNOfK {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ScriptNOfK}
+ */
+ static from_bytes(bytes: Uint8Array): ScriptNOfK;
+ /**
+ * @param {string} json
+ * @returns {ScriptNOfK}
+ */
+ static from_json(json: string): ScriptNOfK;
+ /**
+ * @param {number} n
+ * @param {NativeScripts} native_scripts
+ * @returns {ScriptNOfK}
+ */
+ static new(n: number, native_scripts: NativeScripts): ScriptNOfK;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ n(): number;
+ /**
+ * @returns {NativeScripts}
+ */
+ native_scripts(): NativeScripts;
+}
+/** */
+export class ScriptPubkey {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ScriptPubkey}
+ */
+ static from_bytes(bytes: Uint8Array): ScriptPubkey;
+ /**
+ * @param {string} json
+ * @returns {ScriptPubkey}
+ */
+ static from_json(json: string): ScriptPubkey;
+ /**
+ * @param {Ed25519KeyHash} addr_keyhash
+ * @returns {ScriptPubkey}
+ */
+ static new(addr_keyhash: Ed25519KeyHash): ScriptPubkey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ addr_keyhash(): Ed25519KeyHash;
+}
+/** */
+export class ScriptRef {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ScriptRef}
+ */
+ static from_bytes(bytes: Uint8Array): ScriptRef;
+ /**
+ * @param {string} json
+ * @returns {ScriptRef}
+ */
+ static from_json(json: string): ScriptRef;
+ /**
+ * @param {Script} script
+ * @returns {ScriptRef}
+ */
+ static new(script: Script): ScriptRef;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Script}
+ */
+ get(): Script;
+}
+/** */
+export class ScriptWitness {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {string} json
+ * @returns {ScriptWitness}
+ */
+ static from_json(json: string): ScriptWitness;
+ /**
+ * @param {NativeScript} native_script
+ * @returns {ScriptWitness}
+ */
+ static new_native_witness(native_script: NativeScript): ScriptWitness;
+ /**
+ * @param {PlutusWitness} plutus_witness
+ * @returns {ScriptWitness}
+ */
+ static new_plutus_witness(plutus_witness: PlutusWitness): ScriptWitness;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {NativeScript | undefined}
+ */
+ as_native_witness(): NativeScript | undefined;
+ /**
+ * @returns {PlutusWitness | undefined}
+ */
+ as_plutus_witness(): PlutusWitness | undefined;
+}
+/** */
+export class SingleHostAddr {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {SingleHostAddr}
+ */
+ static from_bytes(bytes: Uint8Array): SingleHostAddr;
+ /**
+ * @param {string} json
+ * @returns {SingleHostAddr}
+ */
+ static from_json(json: string): SingleHostAddr;
+ /**
+ * @param {number | undefined} port
+ * @param {Ipv4 | undefined} ipv4
+ * @param {Ipv6 | undefined} ipv6
+ * @returns {SingleHostAddr}
+ */
+ static new(port: number | undefined, ipv4: Ipv4 | undefined, ipv6: Ipv6 | undefined): SingleHostAddr;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number | undefined}
+ */
+ port(): number | undefined;
+ /**
+ * @returns {Ipv4 | undefined}
+ */
+ ipv4(): Ipv4 | undefined;
+ /**
+ * @returns {Ipv6 | undefined}
+ */
+ ipv6(): Ipv6 | undefined;
+}
+/** */
+export class SingleHostName {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {SingleHostName}
+ */
+ static from_bytes(bytes: Uint8Array): SingleHostName;
+ /**
+ * @param {string} json
+ * @returns {SingleHostName}
+ */
+ static from_json(json: string): SingleHostName;
+ /**
+ * @param {number | undefined} port
+ * @param {DNSRecordAorAAAA} dns_name
+ * @returns {SingleHostName}
+ */
+ static new(port: number | undefined, dns_name: DNSRecordAorAAAA): SingleHostName;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number | undefined}
+ */
+ port(): number | undefined;
+ /**
+ * @returns {DNSRecordAorAAAA}
+ */
+ dns_name(): DNSRecordAorAAAA;
+}
+/** */
+export class StakeCredential {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Ed25519KeyHash} hash
+ * @returns {StakeCredential}
+ */
+ static from_keyhash(hash: Ed25519KeyHash): StakeCredential;
+ /**
+ * @param {ScriptHash} hash
+ * @returns {StakeCredential}
+ */
+ static from_scripthash(hash: ScriptHash): StakeCredential;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeCredential}
+ */
+ static from_bytes(bytes: Uint8Array): StakeCredential;
+ /**
+ * @param {string} json
+ * @returns {StakeCredential}
+ */
+ static from_json(json: string): StakeCredential;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ to_keyhash(): Ed25519KeyHash | undefined;
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ to_scripthash(): ScriptHash | undefined;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+}
+/** */
+export class StakeCredentials {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeCredentials}
+ */
+ static from_bytes(bytes: Uint8Array): StakeCredentials;
+ /**
+ * @param {string} json
+ * @returns {StakeCredentials}
+ */
+ static from_json(json: string): StakeCredentials;
+ /**
+ * @returns {StakeCredentials}
+ */
+ static new(): StakeCredentials;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {StakeCredential}
+ */
+ get(index: number): StakeCredential;
+ /**
+ * @param {StakeCredential} elem
+ */
+ add(elem: StakeCredential): void;
+}
+/** */
+export class StakeDelegation {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeDelegation}
+ */
+ static from_bytes(bytes: Uint8Array): StakeDelegation;
+ /**
+ * @param {string} json
+ * @returns {StakeDelegation}
+ */
+ static from_json(json: string): StakeDelegation;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @returns {StakeDelegation}
+ */
+ static new(stake_credential: StakeCredential, pool_keyhash: Ed25519KeyHash): StakeDelegation;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash(): Ed25519KeyHash;
+}
+/** */
+export class StakeDeregistration {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeDeregistration}
+ */
+ static from_bytes(bytes: Uint8Array): StakeDeregistration;
+ /**
+ * @param {string} json
+ * @returns {StakeDeregistration}
+ */
+ static from_json(json: string): StakeDeregistration;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @returns {StakeDeregistration}
+ */
+ static new(stake_credential: StakeCredential): StakeDeregistration;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+}
+/** */
+export class StakeRegDelegCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeRegDelegCert}
+ */
+ static from_bytes(bytes: Uint8Array): StakeRegDelegCert;
+ /**
+ * @param {string} json
+ * @returns {StakeRegDelegCert}
+ */
+ static from_json(json: string): StakeRegDelegCert;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {BigNum} coin
+ * @returns {StakeRegDelegCert}
+ */
+ static new(stake_credential: StakeCredential, pool_keyhash: Ed25519KeyHash, coin: BigNum): StakeRegDelegCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash(): Ed25519KeyHash;
+ /**
+ * @returns {BigNum}
+ */
+ coin(): BigNum;
+}
+/** */
+export class StakeRegistration {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeRegistration}
+ */
+ static from_bytes(bytes: Uint8Array): StakeRegistration;
+ /**
+ * @param {string} json
+ * @returns {StakeRegistration}
+ */
+ static from_json(json: string): StakeRegistration;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @returns {StakeRegistration}
+ */
+ static new(stake_credential: StakeCredential): StakeRegistration;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+}
+/** */
+export class StakeVoteDelegCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeVoteDelegCert}
+ */
+ static from_bytes(bytes: Uint8Array): StakeVoteDelegCert;
+ /**
+ * @param {string} json
+ * @returns {StakeVoteDelegCert}
+ */
+ static from_json(json: string): StakeVoteDelegCert;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {Drep} drep
+ * @returns {StakeVoteDelegCert}
+ */
+ static new(stake_credential: StakeCredential, pool_keyhash: Ed25519KeyHash, drep: Drep): StakeVoteDelegCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash(): Ed25519KeyHash;
+ /**
+ * @returns {Drep}
+ */
+ drep(): Drep;
+}
+/** */
+export class StakeVoteRegDelegCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeVoteRegDelegCert}
+ */
+ static from_bytes(bytes: Uint8Array): StakeVoteRegDelegCert;
+ /**
+ * @param {string} json
+ * @returns {StakeVoteRegDelegCert}
+ */
+ static from_json(json: string): StakeVoteRegDelegCert;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {Drep} drep
+ * @param {BigNum} coin
+ * @returns {StakeVoteRegDelegCert}
+ */
+ static new(stake_credential: StakeCredential, pool_keyhash: Ed25519KeyHash, drep: Drep, coin: BigNum): StakeVoteRegDelegCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash(): Ed25519KeyHash;
+ /**
+ * @returns {Drep}
+ */
+ drep(): Drep;
+ /**
+ * @returns {BigNum}
+ */
+ coin(): BigNum;
+}
+/** */
+export class Strings {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {Strings}
+ */
+ static new(): Strings;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {string}
+ */
+ get(index: number): string;
+ /**
+ * @param {string} elem
+ */
+ add(elem: string): void;
+}
+/** */
+export class TimelockExpiry {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TimelockExpiry}
+ */
+ static from_bytes(bytes: Uint8Array): TimelockExpiry;
+ /**
+ * @param {string} json
+ * @returns {TimelockExpiry}
+ */
+ static from_json(json: string): TimelockExpiry;
+ /**
+ * @param {BigNum} slot
+ * @returns {TimelockExpiry}
+ */
+ static new(slot: BigNum): TimelockExpiry;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {BigNum}
+ */
+ slot(): BigNum;
+}
+/** */
+export class TimelockStart {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TimelockStart}
+ */
+ static from_bytes(bytes: Uint8Array): TimelockStart;
+ /**
+ * @param {string} json
+ * @returns {TimelockStart}
+ */
+ static from_json(json: string): TimelockStart;
+ /**
+ * @param {BigNum} slot
+ * @returns {TimelockStart}
+ */
+ static new(slot: BigNum): TimelockStart;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {BigNum}
+ */
+ slot(): BigNum;
+}
+/** */
+export class Transaction {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Transaction}
+ */
+ static from_bytes(bytes: Uint8Array): Transaction;
+ /**
+ * @param {string} json
+ * @returns {Transaction}
+ */
+ static from_json(json: string): Transaction;
+ /**
+ * @param {TransactionBody} body
+ * @param {TransactionWitnessSet} witness_set
+ * @param {AuxiliaryData | undefined} auxiliary_data
+ * @returns {Transaction}
+ */
+ static new(body: TransactionBody, witness_set: TransactionWitnessSet, auxiliary_data: AuxiliaryData | undefined): Transaction;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {TransactionBody}
+ */
+ body(): TransactionBody;
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ witness_set(): TransactionWitnessSet;
+ /**
+ * @returns {boolean}
+ */
+ is_valid(): boolean;
+ /**
+ * @returns {AuxiliaryData | undefined}
+ */
+ auxiliary_data(): AuxiliaryData | undefined;
+ /**
+ * @param {boolean} valid
+ */
+ set_is_valid(valid: boolean): void;
+}
+/** */
+export class TransactionBodies {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionBodies}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionBodies;
+ /**
+ * @param {string} json
+ * @returns {TransactionBodies}
+ */
+ static from_json(json: string): TransactionBodies;
+ /**
+ * @returns {TransactionBodies}
+ */
+ static new(): TransactionBodies;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {TransactionBody}
+ */
+ get(index: number): TransactionBody;
+ /**
+ * @param {TransactionBody} elem
+ */
+ add(elem: TransactionBody): void;
+}
+/** */
+export class TransactionBody {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionBody}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionBody;
+ /**
+ * @param {string} json
+ * @returns {TransactionBody}
+ */
+ static from_json(json: string): TransactionBody;
+ /**
+ * @param {TransactionInputs} inputs
+ * @param {TransactionOutputs} outputs
+ * @param {BigNum} fee
+ * @param {BigNum | undefined} ttl
+ * @returns {TransactionBody}
+ */
+ static new(inputs: TransactionInputs, outputs: TransactionOutputs, fee: BigNum, ttl: BigNum | undefined): TransactionBody;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {TransactionInputs}
+ */
+ inputs(): TransactionInputs;
+ /**
+ * @returns {TransactionOutputs}
+ */
+ outputs(): TransactionOutputs;
+ /**
+ * @returns {BigNum}
+ */
+ fee(): BigNum;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ ttl(): BigNum | undefined;
+ /**
+ * @param {Certificates} certs
+ */
+ set_certs(certs: Certificates): void;
+ /**
+ * @returns {Certificates | undefined}
+ */
+ certs(): Certificates | undefined;
+ /**
+ * @param {Withdrawals} withdrawals
+ */
+ set_withdrawals(withdrawals: Withdrawals): void;
+ /**
+ * @returns {Withdrawals | undefined}
+ */
+ withdrawals(): Withdrawals | undefined;
+ /**
+ * @param {Update} update
+ */
+ set_update(update: Update): void;
+ /**
+ * @returns {Update | undefined}
+ */
+ update(): Update | undefined;
+ /**
+ * @returns {VotingProcedures | undefined}
+ */
+ voting_procedures(): VotingProcedures | undefined;
+ /**
+ * @returns {ProposalProcedures | undefined}
+ */
+ proposal_procedures(): ProposalProcedures | undefined;
+ /**
+ * @param {AuxiliaryDataHash} auxiliary_data_hash
+ */
+ set_auxiliary_data_hash(auxiliary_data_hash: AuxiliaryDataHash): void;
+ /**
+ * @returns {AuxiliaryDataHash | undefined}
+ */
+ auxiliary_data_hash(): AuxiliaryDataHash | undefined;
+ /**
+ * @param {BigNum} validity_start_interval
+ */
+ set_validity_start_interval(validity_start_interval: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ validity_start_interval(): BigNum | undefined;
+ /**
+ * @param {Mint} mint
+ */
+ set_mint(mint: Mint): void;
+ /**
+ * @returns {Mint | undefined}
+ */
+ mint(): Mint | undefined;
+ /**
+ * @param {ScriptDataHash} script_data_hash
+ */
+ set_script_data_hash(script_data_hash: ScriptDataHash): void;
+ /**
+ * @returns {ScriptDataHash | undefined}
+ */
+ script_data_hash(): ScriptDataHash | undefined;
+ /**
+ * @param {TransactionInputs} collateral
+ */
+ set_collateral(collateral: TransactionInputs): void;
+ /**
+ * @returns {TransactionInputs | undefined}
+ */
+ collateral(): TransactionInputs | undefined;
+ /**
+ * @param {Ed25519KeyHashes} required_signers
+ */
+ set_required_signers(required_signers: Ed25519KeyHashes): void;
+ /**
+ * @returns {Ed25519KeyHashes | undefined}
+ */
+ required_signers(): Ed25519KeyHashes | undefined;
+ /**
+ * @param {NetworkId} network_id
+ */
+ set_network_id(network_id: NetworkId): void;
+ /**
+ * @returns {NetworkId | undefined}
+ */
+ network_id(): NetworkId | undefined;
+ /**
+ * @param {TransactionOutput} collateral_return
+ */
+ set_collateral_return(collateral_return: TransactionOutput): void;
+ /**
+ * @returns {TransactionOutput | undefined}
+ */
+ collateral_return(): TransactionOutput | undefined;
+ /**
+ * @param {BigNum} total_collateral
+ */
+ set_total_collateral(total_collateral: BigNum): void;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ total_collateral(): BigNum | undefined;
+ /**
+ * @param {TransactionInputs} reference_inputs
+ */
+ set_reference_inputs(reference_inputs: TransactionInputs): void;
+ /**
+ * @returns {TransactionInputs | undefined}
+ */
+ reference_inputs(): TransactionInputs | undefined;
+ /**
+ * @param {VotingProcedures} voting_procedures
+ */
+ set_voting_procedures(voting_procedures: VotingProcedures): void;
+ /**
+ * @param {ProposalProcedures} proposal_procedures
+ */
+ set_proposal_procedures(proposal_procedures: ProposalProcedures): void;
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ raw(): Uint8Array | undefined;
+}
+/** */
+export class TransactionBuilder {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {TransactionBuilderConfig} cfg
+ * @returns {TransactionBuilder}
+ */
+ static new(cfg: TransactionBuilderConfig): TransactionBuilder;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * 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.
+ * Adding a change output must be called after via TransactionBuilder::balance()
+ * inputs to cover the minimum fees. This does not, however, set the txbuilder's fee.
+ *
+ * change_address is required here in order to determine the min ada requirement precisely
+ * @param {TransactionUnspentOutputs} inputs
+ * @param {Address} change_address
+ * @param {Uint32Array} weights
+ */
+ add_inputs_from(inputs: TransactionUnspentOutputs, change_address: Address, weights: Uint32Array): void;
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_input(utxo: TransactionUnspentOutput, script_witness: ScriptWitness | undefined): void;
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ */
+ add_reference_input(utxo: TransactionUnspentOutput): void;
+ /**
+ * 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: Address, input: TransactionInput, amount: Value): BigNum;
+ /**
+ * Add explicit output via a TransactionOutput object
+ * @param {TransactionOutput} output
+ */
+ add_output(output: TransactionOutput): void;
+ /**
+ * Add plutus scripts via a PlutusScripts object
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script: PlutusScript): void;
+ /**
+ * Add plutus v2 scripts via a PlutusScripts object
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script: PlutusScript): void;
+ /**
+ * Add plutus data via a PlutusData object
+ * @param {PlutusData} plutus_data
+ */
+ add_plutus_data(plutus_data: PlutusData): void;
+ /**
+ * Add native scripts via a NativeScripts object
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script: NativeScript): void;
+ /**
+ * Add certificate via a Certificates object
+ * @param {Certificate} certificate
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_certificate(certificate: Certificate, script_witness: ScriptWitness | undefined): void;
+ /**
+ * calculates how much the fee would increase if you added a given output
+ * @param {TransactionOutput} output
+ * @returns {BigNum}
+ */
+ fee_for_output(output: TransactionOutput): BigNum;
+ /**
+ * @param {BigNum} ttl
+ */
+ set_ttl(ttl: BigNum): void;
+ /**
+ * @param {BigNum} validity_start_interval
+ */
+ set_validity_start_interval(validity_start_interval: BigNum): void;
+ /**
+ * @param {RewardAddress} reward_address
+ * @param {BigNum} coin
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_withdrawal(reward_address: RewardAddress, coin: BigNum, script_witness: ScriptWitness | undefined): void;
+ /**
+ * @returns {AuxiliaryData | undefined}
+ */
+ auxiliary_data(): AuxiliaryData | undefined;
+ /**
+ * 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: AuxiliaryData): void;
+ /**
+ * 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: GeneralTransactionMetadata): void;
+ /**
+ * 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: BigNum, val: TransactionMetadatum): void;
+ /**
+ * 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: BigNum, val: string): void;
+ /**
+ * 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 {number} schema
+ */
+ add_json_metadatum_with_schema(key: BigNum, val: string, schema: number): void;
+ /**
+ * Returns a copy of the current mint state in the builder
+ * @returns {Mint | undefined}
+ */
+ mint(): Mint | undefined;
+ /**
+ * @returns {Certificates | undefined}
+ */
+ certificates(): Certificates | undefined;
+ /**
+ * @returns {Withdrawals | undefined}
+ */
+ withdrawals(): Withdrawals | undefined;
+ /**
+ * Returns a copy of the current witness native scripts in the builder
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts(): NativeScripts | undefined;
+ /**
+ * 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 securely add assets to an existing PolicyID
+ * But it will replace/overwrite any existing mint assets with the same PolicyID
+ * first redeemer applied to a PolicyID is taken for all further assets added to the same PolicyID
+ * @param {ScriptHash} policy_id
+ * @param {MintAssets} mint_assets
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_mint(policy_id: ScriptHash, mint_assets: MintAssets, script_witness: ScriptWitness | undefined): void;
+ /**
+ * @returns {ScriptDataHash | undefined}
+ */
+ script_data_hash(): ScriptDataHash | undefined;
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ */
+ add_collateral(utxo: TransactionUnspentOutput): void;
+ /**
+ * @returns {TransactionInputs | undefined}
+ */
+ get_collateral(): TransactionInputs | undefined;
+ /**
+ * @param {Ed25519KeyHash} required_signer
+ */
+ add_required_signer(required_signer: Ed25519KeyHash): void;
+ /**
+ * @returns {Ed25519KeyHashes | undefined}
+ */
+ required_signers(): Ed25519KeyHashes | undefined;
+ /**
+ * @param {NetworkId} network_id
+ */
+ set_network_id(network_id: NetworkId): void;
+ /**
+ * @returns {NetworkId | undefined}
+ */
+ network_id(): NetworkId | undefined;
+ /**
+ * @returns {Redeemers | undefined}
+ */
+ redeemers(): Redeemers | undefined;
+ /**
+ * does not include refunds or withdrawals
+ * @returns {Value}
+ */
+ get_explicit_input(): Value;
+ /**
+ * withdrawals and refunds
+ * @returns {Value}
+ */
+ get_implicit_input(): Value;
+ /**
+ * Return explicit input plus implicit input plus mint
+ * @returns {Value}
+ */
+ get_total_input(): Value;
+ /**
+ * Return explicit output plus implicit output plus burn (does not consider fee directly)
+ * @returns {Value}
+ */
+ get_total_output(): Value;
+ /**
+ * does not include fee
+ * @returns {Value}
+ */
+ get_explicit_output(): Value;
+ /**
+ * @returns {BigNum}
+ */
+ get_deposit(): BigNum;
+ /**
+ * @returns {BigNum | undefined}
+ */
+ get_fee_if_set(): BigNum | undefined;
+ /**
+ * 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} change_address
+ * @param {Datum | undefined} datum
+ */
+ balance(change_address: Address, datum: Datum | undefined): void;
+ /**
+ * Returns the TransactionBody.
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ full_size(): number;
+ /**
+ * @returns {Uint32Array}
+ */
+ output_sizes(): Uint32Array;
+ /**
+ * @returns {TransactionOutputs}
+ */
+ outputs(): TransactionOutputs;
+ /**
+ * 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
+ *
+ * takes fetched ex units into consideration
+ *
+ * add collateral utxos and collateral change receiver in case you redeem from plutus script utxos
+ *
+ * async call
+ *
+ * NOTE: is_valid set to true
+ * @param {TransactionUnspentOutputs | undefined} collateral_utxos
+ * @param {Address | undefined} collateral_change_address
+ * @param {boolean | undefined} native_uplc
+ * @returns {Promise}
+ */
+ construct(collateral_utxos: TransactionUnspentOutputs | undefined, collateral_change_address: Address | undefined, native_uplc: boolean | undefined): Promise;
+ /**
+ * 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
+ * @returns {Transaction}
+ */
+ build_tx(): Transaction;
+ /**
+ * 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(): BigNum;
+}
+/** */
+export class TransactionBuilderConfig {
+ static __wrap(ptr: any): any;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+}
+/** */
+export class TransactionBuilderConfigBuilder {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ static new(): TransactionBuilderConfigBuilder;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @param {LinearFee} fee_algo
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ fee_algo(fee_algo: LinearFee): TransactionBuilderConfigBuilder;
+ /**
+ * @param {BigNum} coins_per_utxo_byte
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ coins_per_utxo_byte(coins_per_utxo_byte: BigNum): TransactionBuilderConfigBuilder;
+ /**
+ * @param {BigNum} pool_deposit
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ pool_deposit(pool_deposit: BigNum): TransactionBuilderConfigBuilder;
+ /**
+ * @param {BigNum} key_deposit
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ key_deposit(key_deposit: BigNum): TransactionBuilderConfigBuilder;
+ /**
+ * @param {number} max_value_size
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ max_value_size(max_value_size: number): TransactionBuilderConfigBuilder;
+ /**
+ * @param {number} max_tx_size
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ max_tx_size(max_tx_size: number): TransactionBuilderConfigBuilder;
+ /**
+ * @param {ExUnitPrices} ex_unit_prices
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ ex_unit_prices(ex_unit_prices: ExUnitPrices): TransactionBuilderConfigBuilder;
+ /**
+ * @param {ExUnits} max_tx_ex_units
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ max_tx_ex_units(max_tx_ex_units: ExUnits): TransactionBuilderConfigBuilder;
+ /**
+ * @param {Costmdls} costmdls
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ costmdls(costmdls: Costmdls): TransactionBuilderConfigBuilder;
+ /**
+ * @param {number} collateral_percentage
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ collateral_percentage(collateral_percentage: number): TransactionBuilderConfigBuilder;
+ /**
+ * @param {number} max_collateral_inputs
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ max_collateral_inputs(max_collateral_inputs: number): TransactionBuilderConfigBuilder;
+ /**
+ * @param {UnitInterval} minfee_refscript_cost_per_byte
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ minfee_refscript_cost_per_byte(minfee_refscript_cost_per_byte: UnitInterval): TransactionBuilderConfigBuilder;
+ /**
+ * @param {BigNum} zero_time
+ * @param {BigNum} zero_slot
+ * @param {number} slot_length
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ slot_config(zero_time: BigNum, zero_slot: BigNum, slot_length: number): TransactionBuilderConfigBuilder;
+ /**
+ * @param {Blockfrost} blockfrost
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ blockfrost(blockfrost: Blockfrost): TransactionBuilderConfigBuilder;
+ /**
+ * @returns {TransactionBuilderConfig}
+ */
+ build(): TransactionBuilderConfig;
+}
+/** */
+export class TransactionHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionHash}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionHash;
+ /**
+ * @param {string} bech_str
+ * @returns {TransactionHash}
+ */
+ static from_bech32(bech_str: string): TransactionHash;
+ /**
+ * @param {string} hex
+ * @returns {TransactionHash}
+ */
+ static from_hex(hex: string): TransactionHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class TransactionIndexes {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionIndexes}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionIndexes;
+ /**
+ * @returns {TransactionIndexes}
+ */
+ static new(): TransactionIndexes;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {BigNum}
+ */
+ get(index: number): BigNum;
+ /**
+ * @param {BigNum} elem
+ */
+ add(elem: BigNum): void;
+}
+/** */
+export class TransactionInput {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionInput}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionInput;
+ /**
+ * @param {string} json
+ * @returns {TransactionInput}
+ */
+ static from_json(json: string): TransactionInput;
+ /**
+ * @param {TransactionHash} transaction_id
+ * @param {BigNum} index
+ * @returns {TransactionInput}
+ */
+ static new(transaction_id: TransactionHash, index: BigNum): TransactionInput;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {TransactionHash}
+ */
+ transaction_id(): TransactionHash;
+ /**
+ * @returns {BigNum}
+ */
+ index(): BigNum;
+}
+/** */
+export class TransactionInputs {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionInputs}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionInputs;
+ /**
+ * @param {string} json
+ * @returns {TransactionInputs}
+ */
+ static from_json(json: string): TransactionInputs;
+ /**
+ * @returns {TransactionInputs}
+ */
+ static new(): TransactionInputs;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {TransactionInput}
+ */
+ get(index: number): TransactionInput;
+ /**
+ * @param {TransactionInput} elem
+ */
+ add(elem: TransactionInput): void;
+ /** */
+ sort(): void;
+}
+/** */
+export class TransactionMetadatum {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionMetadatum}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionMetadatum;
+ /**
+ * @param {MetadataMap} map
+ * @returns {TransactionMetadatum}
+ */
+ static new_map(map: MetadataMap): TransactionMetadatum;
+ /**
+ * @param {MetadataList} list
+ * @returns {TransactionMetadatum}
+ */
+ static new_list(list: MetadataList): TransactionMetadatum;
+ /**
+ * @param {Int} int
+ * @returns {TransactionMetadatum}
+ */
+ static new_int(int: Int): TransactionMetadatum;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionMetadatum}
+ */
+ static new_bytes(bytes: Uint8Array): TransactionMetadatum;
+ /**
+ * @param {string} text
+ * @returns {TransactionMetadatum}
+ */
+ static new_text(text: string): TransactionMetadatum;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {MetadataMap}
+ */
+ as_map(): MetadataMap;
+ /**
+ * @returns {MetadataList}
+ */
+ as_list(): MetadataList;
+ /**
+ * @returns {Int}
+ */
+ as_int(): Int;
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ as_text(): string;
+}
+/** */
+export class TransactionMetadatumLabels {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionMetadatumLabels}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionMetadatumLabels;
+ /**
+ * @returns {TransactionMetadatumLabels}
+ */
+ static new(): TransactionMetadatumLabels;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {BigNum}
+ */
+ get(index: number): BigNum;
+ /**
+ * @param {BigNum} elem
+ */
+ add(elem: BigNum): void;
+}
+/** */
+export class TransactionOutput {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionOutput}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionOutput;
+ /**
+ * @param {string} json
+ * @returns {TransactionOutput}
+ */
+ static from_json(json: string): TransactionOutput;
+ /**
+ * @param {Address} address
+ * @param {Value} amount
+ * @returns {TransactionOutput}
+ */
+ static new(address: Address, amount: Value): TransactionOutput;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Address}
+ */
+ address(): Address;
+ /**
+ * @returns {Value}
+ */
+ amount(): Value;
+ /**
+ * @returns {Datum | undefined}
+ */
+ datum(): Datum | undefined;
+ /**
+ * @returns {ScriptRef | undefined}
+ */
+ script_ref(): ScriptRef | undefined;
+ /**
+ * @param {Datum} datum
+ */
+ set_datum(datum: Datum): void;
+ /**
+ * @param {ScriptRef} script_ref
+ */
+ set_script_ref(script_ref: ScriptRef): void;
+ /**
+ * @returns {number}
+ */
+ format(): number;
+ /**
+ * legacy support: serialize output as array array
+ *
+ * does not support inline datum and script_ref!
+ * @returns {Uint8Array}
+ */
+ to_legacy_bytes(): Uint8Array;
+}
+/** */
+export class TransactionOutputAmountBuilder {
+ static __wrap(ptr: any): any;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @param {Value} amount
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ with_value(amount: Value): TransactionOutputAmountBuilder;
+ /**
+ * @param {BigNum} coin
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ with_coin(coin: BigNum): TransactionOutputAmountBuilder;
+ /**
+ * @param {BigNum} coin
+ * @param {MultiAsset} multiasset
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ with_coin_and_asset(coin: BigNum, multiasset: MultiAsset): TransactionOutputAmountBuilder;
+ /**
+ * @param {MultiAsset} multiasset
+ * @param {BigNum} coins_per_utxo_word
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ with_asset_and_min_required_coin(multiasset: MultiAsset, coins_per_utxo_word: BigNum): TransactionOutputAmountBuilder;
+ /**
+ * @returns {TransactionOutput}
+ */
+ build(): TransactionOutput;
+}
+/**
+ * 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
+ */
+export class TransactionOutputBuilder {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {TransactionOutputBuilder}
+ */
+ static new(): TransactionOutputBuilder;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @param {Address} address
+ * @returns {TransactionOutputBuilder}
+ */
+ with_address(address: Address): TransactionOutputBuilder;
+ /**
+ * @param {Datum} data_hash
+ * @returns {TransactionOutputBuilder}
+ */
+ with_datum(data_hash: Datum): TransactionOutputBuilder;
+ /**
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ next(): TransactionOutputAmountBuilder;
+}
+/** */
+export class TransactionOutputs {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionOutputs}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionOutputs;
+ /**
+ * @param {string} json
+ * @returns {TransactionOutputs}
+ */
+ static from_json(json: string): TransactionOutputs;
+ /**
+ * @returns {TransactionOutputs}
+ */
+ static new(): TransactionOutputs;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {TransactionOutput}
+ */
+ get(index: number): TransactionOutput;
+ /**
+ * @param {TransactionOutput} elem
+ */
+ add(elem: TransactionOutput): void;
+}
+/** */
+export class TransactionUnspentOutput {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionUnspentOutput}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionUnspentOutput;
+ /**
+ * @param {TransactionInput} input
+ * @param {TransactionOutput} output
+ * @returns {TransactionUnspentOutput}
+ */
+ static new(input: TransactionInput, output: TransactionOutput): TransactionUnspentOutput;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {TransactionInput}
+ */
+ input(): TransactionInput;
+ /**
+ * @returns {TransactionOutput}
+ */
+ output(): TransactionOutput;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_legacy_bytes(): Uint8Array;
+}
+/** */
+export class TransactionUnspentOutputs {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {TransactionUnspentOutputs}
+ */
+ static new(): TransactionUnspentOutputs;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {TransactionUnspentOutput}
+ */
+ get(index: number): TransactionUnspentOutput;
+ /**
+ * @param {TransactionUnspentOutput} elem
+ */
+ add(elem: TransactionUnspentOutput): void;
+}
+/** */
+export class TransactionWitnessSet {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionWitnessSet}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionWitnessSet;
+ /**
+ * @param {string} json
+ * @returns {TransactionWitnessSet}
+ */
+ static from_json(json: string): TransactionWitnessSet;
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ static new(): TransactionWitnessSet;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @param {Vkeywitnesses} vkeys
+ */
+ set_vkeys(vkeys: Vkeywitnesses): void;
+ /**
+ * @returns {Vkeywitnesses | undefined}
+ */
+ vkeys(): Vkeywitnesses | undefined;
+ /**
+ * @param {NativeScripts} native_scripts
+ */
+ set_native_scripts(native_scripts: NativeScripts): void;
+ /**
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts(): NativeScripts | undefined;
+ /**
+ * @param {BootstrapWitnesses} bootstraps
+ */
+ set_bootstraps(bootstraps: BootstrapWitnesses): void;
+ /**
+ * @returns {BootstrapWitnesses | undefined}
+ */
+ bootstraps(): BootstrapWitnesses | undefined;
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_scripts(plutus_scripts: PlutusScripts): void;
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_scripts(): PlutusScripts | undefined;
+ /**
+ * @param {PlutusList} plutus_data
+ */
+ set_plutus_data(plutus_data: PlutusList): void;
+ /**
+ * @returns {PlutusList | undefined}
+ */
+ plutus_data(): PlutusList | undefined;
+ /**
+ * @param {Redeemers} redeemers
+ */
+ set_redeemers(redeemers: Redeemers): void;
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v2_scripts(plutus_scripts: PlutusScripts): void;
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v3_scripts(plutus_scripts: PlutusScripts): void;
+ /**
+ * @returns {Redeemers | undefined}
+ */
+ redeemers(): Redeemers | undefined;
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v2_scripts(): PlutusScripts | undefined;
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v3_scripts(): PlutusScripts | undefined;
+}
+/**
+ * Builder de-duplicates witnesses as they are added
+ */
+export class TransactionWitnessSetBuilder {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {TransactionWitnessSetBuilder}
+ */
+ static new(): TransactionWitnessSetBuilder;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @param {Vkeywitness} vkey
+ */
+ add_vkey(vkey: Vkeywitness): void;
+ /**
+ * @param {BootstrapWitness} bootstrap
+ */
+ add_bootstrap(bootstrap: BootstrapWitness): void;
+ /**
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script: NativeScript): void;
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script: PlutusScript): void;
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script: PlutusScript): void;
+ /**
+ * @param {PlutusData} plutus_datum
+ */
+ add_plutus_datum(plutus_datum: PlutusData): void;
+ /**
+ * @param {Redeemer} redeemer
+ */
+ add_redeemer(redeemer: Redeemer): void;
+ /**
+ * @param {RequiredWitnessSet} required_wits
+ */
+ add_required_wits(required_wits: RequiredWitnessSet): void;
+ /**
+ * @param {TransactionWitnessSet} wit_set
+ */
+ add_existing(wit_set: TransactionWitnessSet): void;
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ build(): TransactionWitnessSet;
+}
+/** */
+export class TransactionWitnessSets {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionWitnessSets}
+ */
+ static from_bytes(bytes: Uint8Array): TransactionWitnessSets;
+ /**
+ * @param {string} json
+ * @returns {TransactionWitnessSets}
+ */
+ static from_json(json: string): TransactionWitnessSets;
+ /**
+ * @returns {TransactionWitnessSets}
+ */
+ static new(): TransactionWitnessSets;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {TransactionWitnessSet}
+ */
+ get(index: number): TransactionWitnessSet;
+ /**
+ * @param {TransactionWitnessSet} elem
+ */
+ add(elem: TransactionWitnessSet): void;
+}
+/** */
+export class TreasuryWithdrawals {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TreasuryWithdrawals}
+ */
+ static from_bytes(bytes: Uint8Array): TreasuryWithdrawals;
+ /**
+ * @param {string} json
+ * @returns {TreasuryWithdrawals}
+ */
+ static from_json(json: string): TreasuryWithdrawals;
+ /**
+ * @returns {TreasuryWithdrawals}
+ */
+ static new(): TreasuryWithdrawals;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {Ed25519KeyHash} key
+ * @param {BigNum} value
+ * @returns {BigNum | undefined}
+ */
+ insert(key: Ed25519KeyHash, value: BigNum): BigNum | undefined;
+ /**
+ * @param {Ed25519KeyHash} key
+ * @returns {BigNum | undefined}
+ */
+ get(key: Ed25519KeyHash): BigNum | undefined;
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ keys(): Ed25519KeyHashes;
+}
+/** */
+export class TreasuryWithdrawalsAction {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TreasuryWithdrawalsAction}
+ */
+ static from_bytes(bytes: Uint8Array): TreasuryWithdrawalsAction;
+ /**
+ * @param {string} json
+ * @returns {TreasuryWithdrawalsAction}
+ */
+ static from_json(json: string): TreasuryWithdrawalsAction;
+ /**
+ * @param {TreasuryWithdrawals} withdrawals
+ * @returns {TreasuryWithdrawalsAction}
+ */
+ static new(withdrawals: TreasuryWithdrawals): TreasuryWithdrawalsAction;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {TreasuryWithdrawals}
+ */
+ withdrawals(): TreasuryWithdrawals;
+}
+/** */
+export class UnitInterval {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnitInterval}
+ */
+ static from_bytes(bytes: Uint8Array): UnitInterval;
+ /**
+ * @param {string} json
+ * @returns {UnitInterval}
+ */
+ static from_json(json: string): UnitInterval;
+ /**
+ * @param {BigNum} numerator
+ * @param {BigNum} denominator
+ * @returns {UnitInterval}
+ */
+ static new(numerator: BigNum, denominator: BigNum): UnitInterval;
+ /**
+ * @param {number} float_number
+ * @returns {UnitInterval}
+ */
+ static from_float(float_number: number): UnitInterval;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {BigNum}
+ */
+ numerator(): BigNum;
+ /**
+ * @returns {BigNum}
+ */
+ denominator(): BigNum;
+}
+/** */
+export class UnregCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregCert}
+ */
+ static from_bytes(bytes: Uint8Array): UnregCert;
+ /**
+ * @param {string} json
+ * @returns {UnregCert}
+ */
+ static from_json(json: string): UnregCert;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {BigNum} coin
+ * @returns {UnregCert}
+ */
+ static new(stake_credential: StakeCredential, coin: BigNum): UnregCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+ /**
+ * @returns {BigNum}
+ */
+ coin(): BigNum;
+}
+/** */
+export class UnregCommitteeHotKeyCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregCommitteeHotKeyCert}
+ */
+ static from_bytes(bytes: Uint8Array): UnregCommitteeHotKeyCert;
+ /**
+ * @param {string} json
+ * @returns {UnregCommitteeHotKeyCert}
+ */
+ static from_json(json: string): UnregCommitteeHotKeyCert;
+ /**
+ * @param {Ed25519KeyHash} committee_cold_keyhash
+ * @returns {UnregCommitteeHotKeyCert}
+ */
+ static new(committee_cold_keyhash: Ed25519KeyHash): UnregCommitteeHotKeyCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_cold_keyhash(): Ed25519KeyHash;
+}
+/** */
+export class UnregDrepCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregDrepCert}
+ */
+ static from_bytes(bytes: Uint8Array): UnregDrepCert;
+ /**
+ * @param {string} json
+ * @returns {UnregDrepCert}
+ */
+ static from_json(json: string): UnregDrepCert;
+ /**
+ * @param {StakeCredential} voting_credential
+ * @param {BigNum} coin
+ * @returns {UnregDrepCert}
+ */
+ static new(voting_credential: StakeCredential, coin: BigNum): UnregDrepCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ voting_credential(): StakeCredential;
+ /**
+ * @returns {BigNum}
+ */
+ coin(): BigNum;
+}
+/** */
+export class Update {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Update}
+ */
+ static from_bytes(bytes: Uint8Array): Update;
+ /**
+ * @param {string} json
+ * @returns {Update}
+ */
+ static from_json(json: string): Update;
+ /**
+ * @param {ProposedProtocolParameterUpdates} proposed_protocol_parameter_updates
+ * @param {number} epoch
+ * @returns {Update}
+ */
+ static new(proposed_protocol_parameter_updates: ProposedProtocolParameterUpdates, epoch: number): Update;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {ProposedProtocolParameterUpdates}
+ */
+ proposed_protocol_parameter_updates(): ProposedProtocolParameterUpdates;
+ /**
+ * @returns {number}
+ */
+ epoch(): number;
+}
+/** */
+export class Url {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Url}
+ */
+ static from_bytes(bytes: Uint8Array): Url;
+ /**
+ * @param {string} url
+ * @returns {Url}
+ */
+ static new(url: string): Url;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ url(): string;
+}
+/** */
+export class VRFCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VRFCert}
+ */
+ static from_bytes(bytes: Uint8Array): VRFCert;
+ /**
+ * @param {string} json
+ * @returns {VRFCert}
+ */
+ static from_json(json: string): VRFCert;
+ /**
+ * @param {Uint8Array} output
+ * @param {Uint8Array} proof
+ * @returns {VRFCert}
+ */
+ static new(output: Uint8Array, proof: Uint8Array): VRFCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Uint8Array}
+ */
+ output(): Uint8Array;
+ /**
+ * @returns {Uint8Array}
+ */
+ proof(): Uint8Array;
+}
+/** */
+export class VRFKeyHash {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VRFKeyHash}
+ */
+ static from_bytes(bytes: Uint8Array): VRFKeyHash;
+ /**
+ * @param {string} bech_str
+ * @returns {VRFKeyHash}
+ */
+ static from_bech32(bech_str: string): VRFKeyHash;
+ /**
+ * @param {string} hex
+ * @returns {VRFKeyHash}
+ */
+ static from_hex(hex: string): VRFKeyHash;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix: string): string;
+ /**
+ * @returns {string}
+ */
+ to_hex(): string;
+}
+/** */
+export class VRFVKey {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VRFVKey}
+ */
+ static from_bytes(bytes: Uint8Array): VRFVKey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {VRFKeyHash}
+ */
+ hash(): VRFKeyHash;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_raw_key(): Uint8Array;
+}
+/** */
+export class Value {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Value}
+ */
+ static from_bytes(bytes: Uint8Array): Value;
+ /**
+ * @param {string} json
+ * @returns {Value}
+ */
+ static from_json(json: string): Value;
+ /**
+ * @param {BigNum} coin
+ * @returns {Value}
+ */
+ static new(coin: BigNum): Value;
+ /**
+ * @param {MultiAsset} multiasset
+ * @returns {Value}
+ */
+ static new_from_assets(multiasset: MultiAsset): Value;
+ /**
+ * @returns {Value}
+ */
+ static zero(): Value;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {boolean}
+ */
+ is_zero(): boolean;
+ /**
+ * @returns {BigNum}
+ */
+ coin(): BigNum;
+ /**
+ * @param {BigNum} coin
+ */
+ set_coin(coin: BigNum): void;
+ /**
+ * @returns {MultiAsset | undefined}
+ */
+ multiasset(): MultiAsset | undefined;
+ /**
+ * @param {MultiAsset} multiasset
+ */
+ set_multiasset(multiasset: MultiAsset): void;
+ /**
+ * @param {Value} rhs
+ * @returns {Value}
+ */
+ checked_add(rhs: Value): Value;
+ /**
+ * @param {Value} rhs_value
+ * @returns {Value}
+ */
+ checked_sub(rhs_value: Value): Value;
+ /**
+ * @param {Value} rhs_value
+ * @returns {Value}
+ */
+ clamped_sub(rhs_value: Value): Value;
+ /**
+ * note: values are only partially comparable
+ * @param {Value} rhs_value
+ * @returns {number | undefined}
+ */
+ compare(rhs_value: Value): number | undefined;
+}
+/** */
+export class Vkey {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Vkey}
+ */
+ static from_bytes(bytes: Uint8Array): Vkey;
+ /**
+ * @param {PublicKey} pk
+ * @returns {Vkey}
+ */
+ static new(pk: PublicKey): Vkey;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {PublicKey}
+ */
+ public_key(): PublicKey;
+}
+/** */
+export class Vkeys {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {Vkeys}
+ */
+ static new(): Vkeys;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {Vkey}
+ */
+ get(index: number): Vkey;
+ /**
+ * @param {Vkey} elem
+ */
+ add(elem: Vkey): void;
+}
+/** */
+export class Vkeywitness {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Vkeywitness}
+ */
+ static from_bytes(bytes: Uint8Array): Vkeywitness;
+ /**
+ * @param {string} json
+ * @returns {Vkeywitness}
+ */
+ static from_json(json: string): Vkeywitness;
+ /**
+ * @param {Vkey} vkey
+ * @param {Ed25519Signature} signature
+ * @returns {Vkeywitness}
+ */
+ static new(vkey: Vkey, signature: Ed25519Signature): Vkeywitness;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {Vkey}
+ */
+ vkey(): Vkey;
+ /**
+ * @returns {Ed25519Signature}
+ */
+ signature(): Ed25519Signature;
+}
+/** */
+export class Vkeywitnesses {
+ static __wrap(ptr: any): any;
+ /**
+ * @returns {Vkeywitnesses}
+ */
+ static new(): Vkeywitnesses;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {Vkeywitness}
+ */
+ get(index: number): Vkeywitness;
+ /**
+ * @param {Vkeywitness} elem
+ */
+ add(elem: Vkeywitness): void;
+}
+/** */
+export class Vote {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Vote}
+ */
+ static from_bytes(bytes: Uint8Array): Vote;
+ /**
+ * @param {string} json
+ * @returns {Vote}
+ */
+ static from_json(json: string): Vote;
+ /**
+ * @returns {Vote}
+ */
+ static new_no(): Vote;
+ /**
+ * @returns {Vote}
+ */
+ static new_yes(): Vote;
+ /**
+ * @returns {Vote}
+ */
+ static new_abstain(): Vote;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+}
+/** */
+export class VoteDelegCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VoteDelegCert}
+ */
+ static from_bytes(bytes: Uint8Array): VoteDelegCert;
+ /**
+ * @param {string} json
+ * @returns {VoteDelegCert}
+ */
+ static from_json(json: string): VoteDelegCert;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Drep} drep
+ * @returns {VoteDelegCert}
+ */
+ static new(stake_credential: StakeCredential, drep: Drep): VoteDelegCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+ /**
+ * @returns {Drep}
+ */
+ drep(): Drep;
+}
+/** */
+export class VoteRegDelegCert {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VoteRegDelegCert}
+ */
+ static from_bytes(bytes: Uint8Array): VoteRegDelegCert;
+ /**
+ * @param {string} json
+ * @returns {VoteRegDelegCert}
+ */
+ static from_json(json: string): VoteRegDelegCert;
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Drep} drep
+ * @param {BigNum} coin
+ * @returns {VoteRegDelegCert}
+ */
+ static new(stake_credential: StakeCredential, drep: Drep, coin: BigNum): VoteRegDelegCert;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential(): StakeCredential;
+ /**
+ * @returns {Drep}
+ */
+ drep(): Drep;
+ /**
+ * @returns {BigNum}
+ */
+ coin(): BigNum;
+}
+/** */
+export class Voter {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Voter}
+ */
+ static from_bytes(bytes: Uint8Array): Voter;
+ /**
+ * @param {string} json
+ * @returns {Voter}
+ */
+ static from_json(json: string): Voter;
+ /**
+ * @param {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_committee_hot_keyhash(keyhash: Ed25519KeyHash): Voter;
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Voter}
+ */
+ static new_committee_hot_scripthash(scripthash: ScriptHash): Voter;
+ /**
+ * @param {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_drep_keyhash(keyhash: Ed25519KeyHash): Voter;
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Voter}
+ */
+ static new_drep_scripthash(scripthash: ScriptHash): Voter;
+ /**
+ * @param {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_staking_pool_keyhash(keyhash: Ed25519KeyHash): Voter;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ kind(): number;
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_committee_hot_keyhash(): Ed25519KeyHash | undefined;
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_committee_hot_scripthash(): ScriptHash | undefined;
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_drep_keyhash(): Ed25519KeyHash | undefined;
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_drep_scripthash(): ScriptHash | undefined;
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_staking_pool_keyhash(): Ed25519KeyHash | undefined;
+}
+/** */
+export class VotingProcedure {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VotingProcedure}
+ */
+ static from_bytes(bytes: Uint8Array): VotingProcedure;
+ /**
+ * @param {string} json
+ * @returns {VotingProcedure}
+ */
+ static from_json(json: string): VotingProcedure;
+ /**
+ * @param {GovernanceActionId} governance_action_id
+ * @param {Voter} voter
+ * @param {Vote} vote
+ * @param {Anchor} anchor
+ * @returns {VotingProcedure}
+ */
+ static new(governance_action_id: GovernanceActionId, voter: Voter, vote: Vote, anchor: Anchor): VotingProcedure;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {GovernanceActionId}
+ */
+ governance_action_id(): GovernanceActionId;
+ /**
+ * @returns {Voter}
+ */
+ voter(): Voter;
+ /**
+ * @returns {number}
+ */
+ vote(): number;
+ /**
+ * @returns {Anchor}
+ */
+ anchor(): Anchor;
+}
+/** */
+export class VotingProcedures {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VotingProcedures}
+ */
+ static from_bytes(bytes: Uint8Array): VotingProcedures;
+ /**
+ * @returns {VotingProcedures}
+ */
+ static new(): VotingProcedures;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {number} index
+ * @returns {VotingProcedure}
+ */
+ get(index: number): VotingProcedure;
+ /**
+ * @param {VotingProcedure} elem
+ */
+ add(elem: VotingProcedure): void;
+}
+/** */
+export class Withdrawals {
+ static __wrap(ptr: any): any;
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Withdrawals}
+ */
+ static from_bytes(bytes: Uint8Array): Withdrawals;
+ /**
+ * @param {string} json
+ * @returns {Withdrawals}
+ */
+ static from_json(json: string): Withdrawals;
+ /**
+ * @returns {Withdrawals}
+ */
+ static new(): Withdrawals;
+ __destroy_into_raw(): number | undefined;
+ ptr: number | undefined;
+ free(): void;
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes(): Uint8Array;
+ /**
+ * @returns {string}
+ */
+ to_json(): string;
+ /**
+ * @returns {any}
+ */
+ to_js_value(): any;
+ /**
+ * @returns {number}
+ */
+ len(): number;
+ /**
+ * @param {RewardAddress} key
+ * @param {BigNum} value
+ * @returns {BigNum | undefined}
+ */
+ insert(key: RewardAddress, value: BigNum): BigNum | undefined;
+ /**
+ * @param {RewardAddress} key
+ * @returns {BigNum | undefined}
+ */
+ get(key: RewardAddress): BigNum | undefined;
+ /**
+ * @returns {RewardAddresses}
+ */
+ keys(): RewardAddresses;
+}
+/**
+ * Decompression callback
+ */
+export type DecompressCallback = (compressed: Uint8Array) => Uint8Array;
+/**
+ * Options for instantiating a Wasm instance.
+ */
+export type InstantiateOptions = {
+ /**
+ * - Optional url to the Wasm file to instantiate.
+ */
+ url?: URL | undefined;
+ /**
+ * - Callback to decompress the
+ * raw Wasm file bytes before instantiating.
+ */
+ decompress?: DecompressCallback | undefined;
+};
diff --git a/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.js b/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.js
new file mode 100644
index 00000000..b4fe0e67
--- /dev/null
+++ b/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.js
@@ -0,0 +1,27424 @@
+// @generated file from wasmbuild -- do not edit
+// deno-lint-ignore-file
+// deno-fmt-ignore-file
+// source-hash: bfd95ebe53d43f00db0f8f58f0273ee50ec6421a
+let wasm;
+const 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) {
+ 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;
+const cachedTextEncoder = new TextEncoder("utf-8");
+const encodeString = function (arg, view) {
+ return cachedTextEncoder.encodeInto(arg, view);
+};
+function passStringToWasm0(arg, malloc, realloc) {
+ if (realloc === undefined) {
+ const buf = cachedTextEncoder.encode(arg);
+ const ptr = malloc(buf.length);
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
+ WASM_VECTOR_LEN = buf.length;
+ return ptr;
+ }
+ let len = arg.length;
+ let ptr = malloc(len);
+ 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);
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
+ const ret = encodeString(arg, view);
+ offset += ret.written;
+ }
+ WASM_VECTOR_LEN = offset;
+ return ptr;
+}
+let cachedInt32Memory0 = null;
+function getInt32Memory0() {
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
+ }
+ return cachedInt32Memory0;
+}
+function isLikeNone(x) {
+ return x === undefined || x === null;
+}
+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;
+}
+const CLOSURE_DTORS = new FinalizationRegistry((state) => {
+ wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
+});
+function makeMutClosure(arg0, arg1, dtor, f) {
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
+ const real = (...args) => {
+ // First up with a closure we increment the internal reference
+ // count. This ensures that the Rust closure environment won't
+ // be deallocated while we're invoking it.
+ state.cnt++;
+ const a = state.a;
+ state.a = 0;
+ try {
+ return f(a, state.b, ...args);
+ }
+ finally {
+ if (--state.cnt === 0) {
+ wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
+ CLOSURE_DTORS.unregister(state);
+ }
+ else {
+ state.a = a;
+ }
+ }
+ };
+ real.original = state;
+ CLOSURE_DTORS.register(real, state, state);
+ return real;
+}
+function __wbg_adapter_30(arg0, arg1, arg2) {
+ wasm.wasm_bindgen__convert__closures__invoke1_mut__h9aff1b1babe72eb2(arg0, arg1, addHeapObject(arg2));
+}
+function _assertClass(instance, klass) {
+ if (!(instance instanceof klass)) {
+ throw new Error(`expected instance of ${klass.name}`);
+ }
+ return instance.ptr;
+}
+function getArrayU8FromWasm0(ptr, len) {
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
+}
+function passArray8ToWasm0(arg, malloc) {
+ const ptr = malloc(arg.length * 1);
+ getUint8Memory0().set(arg, ptr / 1);
+ WASM_VECTOR_LEN = arg.length;
+ return ptr;
+}
+/**
+ * @param {string} password
+ * @param {string} salt
+ * @param {string} nonce
+ * @param {string} data
+ * @returns {string}
+ */
+export function encrypt_with_password(password, salt, nonce, data) {
+ 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 ptr4 = r0;
+ var len4 = r1;
+ if (r3) {
+ ptr4 = 0;
+ len4 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr4, len4);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr4, len4);
+ }
+}
+/**
+ * @param {string} password
+ * @param {string} data
+ * @returns {string}
+ */
+export function decrypt_with_password(password, data) {
+ 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 ptr2 = r0;
+ var len2 = r1;
+ if (r3) {
+ ptr2 = 0;
+ len2 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr2, len2);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr2, len2);
+ }
+}
+/**
+ * @param {Transaction} tx
+ * @param {LinearFee} linear_fee
+ * @param {ExUnitPrices} ex_unit_prices
+ * @param {UnitInterval} minfee_refscript_cost_per_byte
+ * @param {TransactionOutputs} ref_script_outputs
+ * @returns {BigNum}
+ */
+export function min_fee(tx, linear_fee, ex_unit_prices, minfee_refscript_cost_per_byte, ref_script_outputs) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(tx, Transaction);
+ _assertClass(linear_fee, LinearFee);
+ _assertClass(ex_unit_prices, ExUnitPrices);
+ _assertClass(minfee_refscript_cost_per_byte, UnitInterval);
+ _assertClass(ref_script_outputs, TransactionOutputs);
+ wasm.min_fee(retptr, tx.ptr, linear_fee.ptr, ex_unit_prices.ptr, minfee_refscript_cost_per_byte.ptr, ref_script_outputs.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 {Uint8Array} bytes
+ * @returns {TransactionMetadatum}
+ */
+export function encode_arbitrary_bytes_as_metadatum(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}
+ */
+export function decode_arbitrary_bytes_from_metadatum(metadata) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(metadata, TransactionMetadatum);
+ wasm.decode_arbitrary_bytes_from_metadatum(retptr, metadata.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 v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+}
+/**
+ * @param {string} json
+ * @param {number} schema
+ * @returns {TransactionMetadatum}
+ */
+export function encode_json_str_to_metadatum(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 {number} schema
+ * @returns {string}
+ */
+export function decode_metadatum_to_json_str(metadatum, schema) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(metadatum, TransactionMetadatum);
+ wasm.decode_metadatum_to_json_str(retptr, metadatum.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+}
+/**
+ * @param {string} json
+ * @param {number} schema
+ * @returns {PlutusData}
+ */
+export function encode_json_str_to_plutus_datum(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 {number} schema
+ * @returns {string}
+ */
+export function decode_plutus_datum_to_json_str(datum, schema) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(datum, PlutusData);
+ wasm.decode_plutus_datum_to_json_str(retptr, datum.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+}
+let cachedUint32Memory0 = null;
+function getUint32Memory0() {
+ if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
+ cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
+ }
+ return cachedUint32Memory0;
+}
+function passArray32ToWasm0(arg, malloc) {
+ const ptr = malloc(arg.length * 4);
+ getUint32Memory0().set(arg, ptr / 4);
+ WASM_VECTOR_LEN = arg.length;
+ return ptr;
+}
+function getArrayU32FromWasm0(ptr, len) {
+ return getUint32Memory0().subarray(ptr / 4, ptr / 4 + len);
+}
+/**
+ * @param {TransactionHash} tx_body_hash
+ * @param {ByronAddress} addr
+ * @param {LegacyDaedalusPrivateKey} key
+ * @returns {BootstrapWitness}
+ */
+export function make_daedalus_bootstrap_witness(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.ptr, addr.ptr, key.ptr);
+ return BootstrapWitness.__wrap(ret);
+}
+/**
+ * @param {TransactionHash} tx_body_hash
+ * @param {ByronAddress} addr
+ * @param {Bip32PrivateKey} key
+ * @returns {BootstrapWitness}
+ */
+export function make_icarus_bootstrap_witness(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.ptr, addr.ptr, key.ptr);
+ return BootstrapWitness.__wrap(ret);
+}
+/**
+ * @param {TransactionHash} tx_body_hash
+ * @param {PrivateKey} sk
+ * @returns {Vkeywitness}
+ */
+export function make_vkey_witness(tx_body_hash, sk) {
+ _assertClass(tx_body_hash, TransactionHash);
+ _assertClass(sk, PrivateKey);
+ const ret = wasm.make_vkey_witness(tx_body_hash.ptr, sk.ptr);
+ return Vkeywitness.__wrap(ret);
+}
+/**
+ * @param {AuxiliaryData} auxiliary_data
+ * @returns {AuxiliaryDataHash}
+ */
+export function hash_auxiliary_data(auxiliary_data) {
+ _assertClass(auxiliary_data, AuxiliaryData);
+ const ret = wasm.hash_auxiliary_data(auxiliary_data.ptr);
+ return AuxiliaryDataHash.__wrap(ret);
+}
+/**
+ * @param {TransactionBody} tx_body
+ * @returns {TransactionHash}
+ */
+export function hash_transaction(tx_body) {
+ _assertClass(tx_body, TransactionBody);
+ const ret = wasm.hash_transaction(tx_body.ptr);
+ return TransactionHash.__wrap(ret);
+}
+/**
+ * @param {PlutusData} plutus_data
+ * @returns {DataHash}
+ */
+export function hash_plutus_data(plutus_data) {
+ _assertClass(plutus_data, PlutusData);
+ const ret = wasm.hash_plutus_data(plutus_data.ptr);
+ return DataHash.__wrap(ret);
+}
+/**
+ * @param {Uint8Array} data
+ * @returns {Uint8Array}
+ */
+export function hash_blake2b256(data) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.hash_blake2b256(retptr, ptr0, len0);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v1;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+}
+/**
+ * @param {Uint8Array} data
+ * @returns {Uint8Array}
+ */
+export function hash_blake2b224(data) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.hash_blake2b224(retptr, ptr0, len0);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v1;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+}
+/**
+ * @param {Redeemers} redeemers
+ * @param {Costmdls} cost_models
+ * @param {PlutusList | undefined} datums
+ * @returns {ScriptDataHash}
+ */
+export function hash_script_data(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.ptr, cost_models.ptr, ptr0);
+ return ScriptDataHash.__wrap(ret);
+}
+/**
+ * @param {TransactionBody} txbody
+ * @param {BigNum} pool_deposit
+ * @param {BigNum} key_deposit
+ * @returns {Value}
+ */
+export function get_implicit_input(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.ptr, pool_deposit.ptr, key_deposit.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}
+ */
+export function get_deposit(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.ptr, pool_deposit.ptr, key_deposit.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 {TransactionOutput} output
+ * @param {BigNum} coins_per_utxo_byte
+ * @returns {BigNum}
+ */
+export function min_ada_required(output, coins_per_utxo_byte) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(output, TransactionOutput);
+ _assertClass(coins_per_utxo_byte, BigNum);
+ wasm.min_ada_required(retptr, output.ptr, coins_per_utxo_byte.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 {number} schema
+ * @returns {NativeScript}
+ */
+export function encode_json_str_to_native_script(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);
+ }
+}
+/**
+ * @param {PlutusList} params
+ * @param {PlutusScript} plutus_script
+ * @returns {PlutusScript}
+ */
+export function apply_params_to_plutus_script(params, plutus_script) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(params, PlutusList);
+ _assertClass(plutus_script, PlutusScript);
+ var ptr0 = plutus_script.__destroy_into_raw();
+ wasm.apply_params_to_plutus_script(retptr, params.ptr, ptr0);
+ 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);
+ }
+}
+function handleError(f, args) {
+ try {
+ return f.apply(this, args);
+ }
+ catch (e) {
+ wasm.__wbindgen_exn_store(addHeapObject(e));
+ }
+}
+function __wbg_adapter_1684(arg0, arg1, arg2, arg3) {
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__he7061673dd7691f9(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
+}
+/** */
+export const StakeCredKind = Object.freeze({
+ Key: 0,
+ "0": "Key",
+ Script: 1,
+ "1": "Script",
+});
+/** */
+export const GovernanceActionKind = Object.freeze({
+ ParameterChangeAction: 0,
+ "0": "ParameterChangeAction",
+ HardForkInitiationAction: 1,
+ "1": "HardForkInitiationAction",
+ TreasuryWithdrawalsAction: 2,
+ "2": "TreasuryWithdrawalsAction",
+ NoConfidence: 3,
+ "3": "NoConfidence",
+ NewCommittee: 4,
+ "4": "NewCommittee",
+ NewConstitution: 5,
+ "5": "NewConstitution",
+ InfoAction: 6,
+ "6": "InfoAction",
+});
+/** */
+export const VoterKind = Object.freeze({
+ CommitteeHotKeyHash: 0,
+ "0": "CommitteeHotKeyHash",
+ CommitteeHotScriptHash: 1,
+ "1": "CommitteeHotScriptHash",
+ DrepKeyHash: 2,
+ "2": "DrepKeyHash",
+ DrepScriptHash: 3,
+ "3": "DrepScriptHash",
+ StakingPoolKeyHash: 4,
+ "4": "StakingPoolKeyHash",
+});
+/** */
+export const VoteKind = Object.freeze({
+ No: 0,
+ "0": "No",
+ Yes: 1,
+ "1": "Yes",
+ Abstain: 2,
+ "2": "Abstain",
+});
+/** */
+export const DrepKind = Object.freeze({
+ KeyHash: 0,
+ "0": "KeyHash",
+ ScriptHash: 1,
+ "1": "ScriptHash",
+ Abstain: 2,
+ "2": "Abstain",
+ NoConfidence: 3,
+ "3": "NoConfidence",
+});
+/** */
+export const TransactionMetadatumKind = Object.freeze({
+ MetadataMap: 0,
+ "0": "MetadataMap",
+ MetadataList: 1,
+ "1": "MetadataList",
+ Int: 2,
+ "2": "Int",
+ Bytes: 3,
+ "3": "Bytes",
+ Text: 4,
+ "4": "Text",
+});
+/** */
+export const MetadataJsonSchema = Object.freeze({
+ NoConversions: 0,
+ "0": "NoConversions",
+ BasicConversions: 1,
+ "1": "BasicConversions",
+ DetailedSchema: 2,
+ "2": "DetailedSchema",
+});
+/** */
+export const LanguageKind = Object.freeze({
+ PlutusV1: 0,
+ "0": "PlutusV1",
+ PlutusV2: 1,
+ "1": "PlutusV2",
+ PlutusV3: 2,
+ "2": "PlutusV3",
+});
+/** */
+export const PlutusDataKind = Object.freeze({
+ ConstrPlutusData: 0,
+ "0": "ConstrPlutusData",
+ Map: 1,
+ "1": "Map",
+ List: 2,
+ "2": "List",
+ Integer: 3,
+ "3": "Integer",
+ Bytes: 4,
+ "4": "Bytes",
+});
+/** */
+export const RedeemerTagKind = Object.freeze({
+ Spend: 0,
+ "0": "Spend",
+ Mint: 1,
+ "1": "Mint",
+ Cert: 2,
+ "2": "Cert",
+ Reward: 3,
+ "3": "Reward",
+ Voting: 4,
+ "4": "Voting",
+ Proposing: 5,
+ "5": "Proposing",
+});
+/**
+ * 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
+ */
+export const 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",
+});
+/** */
+export const ScriptKind = Object.freeze({
+ NativeScript: 0,
+ "0": "NativeScript",
+ PlutusScriptV1: 1,
+ "1": "PlutusScriptV1",
+ PlutusScriptV2: 2,
+ "2": "PlutusScriptV2",
+ PlutusScriptV3: 3,
+ "3": "PlutusScriptV3",
+});
+/** */
+export const DatumKind = Object.freeze({
+ Hash: 0,
+ "0": "Hash",
+ Data: 1,
+ "1": "Data",
+});
+/**
+ * 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
+ * https://github.com/input-output-hk/cardano-ledger/blob/9c3b4737b13b30f71529e76c5330f403165e28a6/eras/alonzo/impl/src/Cardano/Ledger/Alonzo.hs#L127
+ */
+export const ScriptHashNamespace = Object.freeze({
+ NativeScript: 0,
+ "0": "NativeScript",
+ PlutusV1: 1,
+ "1": "PlutusV1",
+ PlutusV2: 2,
+ "2": "PlutusV2",
+});
+/**
+ * Used to choose the schema for a script JSON string
+ */
+export const ScriptSchema = Object.freeze({
+ Wallet: 0,
+ "0": "Wallet",
+ Node: 1,
+ "1": "Node",
+});
+/** */
+export const ScriptWitnessKind = Object.freeze({
+ NativeWitness: 0,
+ "0": "NativeWitness",
+ PlutusWitness: 1,
+ "1": "PlutusWitness",
+});
+/** */
+export const 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",
+ RegCert: 7,
+ "7": "RegCert",
+ UnregCert: 8,
+ "8": "UnregCert",
+ VoteDelegCert: 9,
+ "9": "VoteDelegCert",
+ StakeVoteDelegCert: 10,
+ "10": "StakeVoteDelegCert",
+ StakeRegDelegCert: 11,
+ "11": "StakeRegDelegCert",
+ VoteRegDelegCert: 12,
+ "12": "VoteRegDelegCert",
+ StakeVoteRegDelegCert: 13,
+ "13": "StakeVoteRegDelegCert",
+ RegCommitteeHotKeyCert: 14,
+ "14": "RegCommitteeHotKeyCert",
+ UnregCommitteeHotKeyCert: 15,
+ "15": "UnregCommitteeHotKeyCert",
+ RegDrepCert: 16,
+ "16": "RegDrepCert",
+ UnregDrepCert: 17,
+ "17": "UnregDrepCert",
+});
+/** */
+export const MIRPot = Object.freeze({
+ Reserves: 0,
+ "0": "Reserves",
+ Treasury: 1,
+ "1": "Treasury",
+});
+/** */
+export const MIRKind = Object.freeze({
+ ToOtherPot: 0,
+ "0": "ToOtherPot",
+ ToStakeCredentials: 1,
+ "1": "ToStakeCredentials",
+});
+/** */
+export const RelayKind = Object.freeze({
+ SingleHostAddr: 0,
+ "0": "SingleHostAddr",
+ SingleHostName: 1,
+ "1": "SingleHostName",
+ MultiHostName: 2,
+ "2": "MultiHostName",
+});
+/** */
+export const 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",
+});
+/** */
+export const NetworkIdKind = Object.freeze({
+ Testnet: 0,
+ "0": "Testnet",
+ Mainnet: 1,
+ "1": "Mainnet",
+});
+const AddressFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_address_free(ptr));
+/** */
+export class Address {
+ static __wrap(ptr) {
+ const obj = Object.create(Address.prototype);
+ obj.ptr = ptr;
+ AddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.address_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.address_to_js_value(retptr, this.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 {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.address_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string | undefined} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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.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 {ByronAddress | undefined}
+ */
+ as_byron() {
+ const ret = wasm.address_as_byron(this.ptr);
+ return ret === 0 ? undefined : ByronAddress.__wrap(ret);
+ }
+ /**
+ * @returns {RewardAddress | undefined}
+ */
+ as_reward() {
+ const ret = wasm.address_as_reward(this.ptr);
+ return ret === 0 ? undefined : RewardAddress.__wrap(ret);
+ }
+ /**
+ * @returns {PointerAddress | undefined}
+ */
+ as_pointer() {
+ const ret = wasm.address_as_pointer(this.ptr);
+ return ret === 0 ? undefined : PointerAddress.__wrap(ret);
+ }
+ /**
+ * @returns {EnterpriseAddress | undefined}
+ */
+ as_enterprise() {
+ const ret = wasm.address_as_enterprise(this.ptr);
+ return ret === 0 ? undefined : EnterpriseAddress.__wrap(ret);
+ }
+ /**
+ * @returns {BaseAddress | undefined}
+ */
+ as_base() {
+ const ret = wasm.address_as_base(this.ptr);
+ return ret === 0 ? undefined : BaseAddress.__wrap(ret);
+ }
+}
+const AnchorFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_anchor_free(ptr));
+/** */
+export class Anchor {
+ static __wrap(ptr) {
+ const obj = Object.create(Anchor.prototype);
+ obj.ptr = ptr;
+ AnchorFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.anchor_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.anchor_to_js_value(retptr, this.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}
+ */
+ anchor_url() {
+ const ret = wasm.anchor_anchor_url(this.ptr);
+ return Url.__wrap(ret);
+ }
+ /**
+ * @returns {DataHash}
+ */
+ anchor_data_hash() {
+ const ret = wasm.anchor_anchor_data_hash(this.ptr);
+ return DataHash.__wrap(ret);
+ }
+ /**
+ * @param {Url} anchor_url
+ * @param {DataHash} anchor_data_hash
+ * @returns {Anchor}
+ */
+ static new(anchor_url, anchor_data_hash) {
+ _assertClass(anchor_url, Url);
+ _assertClass(anchor_data_hash, DataHash);
+ const ret = wasm.anchor_new(anchor_url.ptr, anchor_data_hash.ptr);
+ return Anchor.__wrap(ret);
+ }
+}
+const AssetNameFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_assetname_free(ptr));
+/** */
+export class AssetName {
+ static __wrap(ptr) {
+ const obj = Object.create(AssetName.prototype);
+ obj.ptr = ptr;
+ AssetNameFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetname_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetname_to_js_value(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const AssetNamesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_assetnames_free(ptr));
+/** */
+export class AssetNames {
+ static __wrap(ptr) {
+ const obj = Object.create(AssetNames.prototype);
+ obj.ptr = ptr;
+ AssetNamesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetnames_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetnames_to_js_value(retptr, this.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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {AssetName}
+ */
+ get(index) {
+ const ret = wasm.assetnames_get(this.ptr, index);
+ return AssetName.__wrap(ret);
+ }
+ /**
+ * @param {AssetName} elem
+ */
+ add(elem) {
+ _assertClass(elem, AssetName);
+ wasm.assetnames_add(this.ptr, elem.ptr);
+ }
+}
+const AssetsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_assets_free(ptr));
+/** */
+export class Assets {
+ static __wrap(ptr) {
+ const obj = Object.create(Assets.prototype);
+ obj.ptr = ptr;
+ AssetsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assets_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assets_to_js_value(retptr, this.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.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.ptr, key.ptr, value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {AssetNames}
+ */
+ keys() {
+ const ret = wasm.assets_keys(this.ptr);
+ return AssetNames.__wrap(ret);
+ }
+}
+const AuxiliaryDataFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_auxiliarydata_free(ptr));
+/** */
+export class AuxiliaryData {
+ static __wrap(ptr) {
+ const obj = Object.create(AuxiliaryData.prototype);
+ obj.ptr = ptr;
+ AuxiliaryDataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydata_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydata_to_js_value(retptr, this.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.ptr);
+ return ret === 0 ? undefined : GeneralTransactionMetadata.__wrap(ret);
+ }
+ /**
+ * @param {GeneralTransactionMetadata} metadata
+ */
+ set_metadata(metadata) {
+ _assertClass(metadata, GeneralTransactionMetadata);
+ wasm.auxiliarydata_set_metadata(this.ptr, metadata.ptr);
+ }
+ /**
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts() {
+ const ret = wasm.auxiliarydata_native_scripts(this.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.ptr, native_scripts.ptr);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_scripts() {
+ const ret = wasm.auxiliarydata_plutus_scripts(this.ptr);
+ return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v2_scripts() {
+ const ret = wasm.auxiliarydata_plutus_v2_scripts(this.ptr);
+ return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v3_scripts() {
+ const ret = wasm.auxiliarydata_plutus_v3_scripts(this.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.ptr, plutus_scripts.ptr);
+ }
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v2_scripts(plutus_scripts) {
+ _assertClass(plutus_scripts, PlutusScripts);
+ wasm.auxiliarydata_set_plutus_v2_scripts(this.ptr, plutus_scripts.ptr);
+ }
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v3_scripts(plutus_scripts) {
+ _assertClass(plutus_scripts, PlutusScripts);
+ wasm.auxiliarydata_set_plutus_v3_scripts(this.ptr, plutus_scripts.ptr);
+ }
+}
+const AuxiliaryDataHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_auxiliarydatahash_free(ptr));
+/** */
+export class AuxiliaryDataHash {
+ static __wrap(ptr) {
+ const obj = Object.create(AuxiliaryDataHash.prototype);
+ obj.ptr = ptr;
+ AuxiliaryDataHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const AuxiliaryDataSetFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_auxiliarydataset_free(ptr));
+/** */
+export class AuxiliaryDataSet {
+ static __wrap(ptr) {
+ const obj = Object.create(AuxiliaryDataSet.prototype);
+ obj.ptr = ptr;
+ AuxiliaryDataSetFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {BigNum} tx_index
+ * @param {AuxiliaryData} data
+ * @returns {AuxiliaryData | undefined}
+ */
+ insert(tx_index, data) {
+ _assertClass(tx_index, BigNum);
+ _assertClass(data, AuxiliaryData);
+ const ret = wasm.auxiliarydataset_insert(this.ptr, tx_index.ptr, data.ptr);
+ return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} tx_index
+ * @returns {AuxiliaryData | undefined}
+ */
+ get(tx_index) {
+ _assertClass(tx_index, BigNum);
+ const ret = wasm.auxiliarydataset_get(this.ptr, tx_index.ptr);
+ return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionIndexes}
+ */
+ indices() {
+ const ret = wasm.auxiliarydataset_indices(this.ptr);
+ return TransactionIndexes.__wrap(ret);
+ }
+}
+const BaseAddressFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_baseaddress_free(ptr));
+/** */
+export class BaseAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(BaseAddress.prototype);
+ obj.ptr = ptr;
+ BaseAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ BaseAddressFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_baseaddress_free(ptr);
+ }
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @param {StakeCredential} stake
+ * @returns {BaseAddress}
+ */
+ static new(network, payment, stake) {
+ _assertClass(payment, StakeCredential);
+ _assertClass(stake, StakeCredential);
+ const ret = wasm.baseaddress_new(network, payment.ptr, stake.ptr);
+ return BaseAddress.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_cred() {
+ const ret = wasm.baseaddress_stake_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Address}
+ */
+ to_address() {
+ const ret = wasm.baseaddress_to_address(this.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {BaseAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_base(addr.ptr);
+ return ret === 0 ? undefined : BaseAddress.__wrap(ret);
+ }
+}
+const BigIntFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_bigint_free(ptr));
+/** */
+export class BigInt {
+ static __wrap(ptr) {
+ const obj = Object.create(BigInt.prototype);
+ obj.ptr = ptr;
+ BigIntFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {BigNum | undefined}
+ */
+ as_u64() {
+ const ret = wasm.bigint_as_u64(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int() {
+ const ret = wasm.bigint_as_int(this.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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bigint_to_str(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+const BigNumFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_bignum_free(ptr));
+/** */
+export class BigNum {
+ static __wrap(ptr) {
+ const obj = Object.create(BigNum.prototype);
+ obj.ptr = ptr;
+ BigNumFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bignum_to_str(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {BigNum}
+ */
+ static zero() {
+ const ret = wasm.bignum_zero();
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {boolean}
+ */
+ is_zero() {
+ const ret = wasm.bignum_is_zero(this.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @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.ptr, other.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.ptr, other.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.ptr, other.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_div(other) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(other, BigNum);
+ wasm.bignum_checked_div(retptr, this.ptr, other.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_div_ceil(other) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(other, BigNum);
+ wasm.bignum_checked_div_ceil(retptr, this.ptr, other.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.ptr, other.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} rhs_value
+ * @returns {number}
+ */
+ compare(rhs_value) {
+ _assertClass(rhs_value, BigNum);
+ const ret = wasm.bignum_compare(this.ptr, rhs_value.ptr);
+ return ret;
+ }
+}
+const Bip32PrivateKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_bip32privatekey_free(ptr));
+/** */
+export class Bip32PrivateKey {
+ static __wrap(ptr) {
+ const obj = Object.create(Bip32PrivateKey.prototype);
+ obj.ptr = ptr;
+ Bip32PrivateKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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.ptr);
+ return PrivateKey.__wrap(ret);
+ }
+ /**
+ * @returns {Bip32PublicKey}
+ */
+ to_public() {
+ const ret = wasm.bip32privatekey_to_public(this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32privatekey_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const Bip32PublicKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_bip32publickey_free(ptr));
+/** */
+export class Bip32PublicKey {
+ static __wrap(ptr) {
+ const obj = Object.create(Bip32PublicKey.prototype);
+ obj.ptr = ptr;
+ Bip32PublicKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ Bip32PublicKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_bip32publickey_free(ptr);
+ }
+ /**
+ * 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.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);
+ }
+ }
+ /**
+ * @returns {PublicKey}
+ */
+ to_raw_key() {
+ const ret = wasm.bip32publickey_to_raw_key(this.ptr);
+ return PublicKey.__wrap(ret);
+ }
+ /**
+ * @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 {Uint8Array}
+ */
+ as_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32publickey_as_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @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 {string}
+ */
+ to_bech32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32publickey_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ chaincode() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32publickey_chaincode(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const BlockFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_block_free(ptr));
+/** */
+export class Block {
+ static __wrap(ptr) {
+ const obj = Object.create(Block.prototype);
+ obj.ptr = ptr;
+ BlockFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.block_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.block_to_js_value(retptr, this.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.ptr);
+ return Header.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionBodies}
+ */
+ transaction_bodies() {
+ const ret = wasm.block_transaction_bodies(this.ptr);
+ return TransactionBodies.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionWitnessSets}
+ */
+ transaction_witness_sets() {
+ const ret = wasm.block_transaction_witness_sets(this.ptr);
+ return TransactionWitnessSets.__wrap(ret);
+ }
+ /**
+ * @returns {AuxiliaryDataSet}
+ */
+ auxiliary_data_set() {
+ const ret = wasm.block_auxiliary_data_set(this.ptr);
+ return AuxiliaryDataSet.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionIndexes}
+ */
+ invalid_transactions() {
+ const ret = wasm.block_invalid_transactions(this.ptr);
+ return TransactionIndexes.__wrap(ret);
+ }
+ /**
+ * @param {Header} header
+ * @param {TransactionBodies} transaction_bodies
+ * @param {TransactionWitnessSets} transaction_witness_sets
+ * @param {AuxiliaryDataSet} auxiliary_data_set
+ * @param {TransactionIndexes} 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);
+ _assertClass(invalid_transactions, TransactionIndexes);
+ const ret = wasm.block_new(header.ptr, transaction_bodies.ptr, transaction_witness_sets.ptr, auxiliary_data_set.ptr, invalid_transactions.ptr);
+ return Block.__wrap(ret);
+ }
+}
+const BlockHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_blockhash_free(ptr));
+/** */
+export class BlockHash {
+ static __wrap(ptr) {
+ const obj = Object.create(BlockHash.prototype);
+ obj.ptr = ptr;
+ BlockHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const BlockfrostFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_blockfrost_free(ptr));
+/** */
+export class Blockfrost {
+ static __wrap(ptr) {
+ const obj = Object.create(Blockfrost.prototype);
+ obj.ptr = ptr;
+ BlockfrostFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ BlockfrostFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_blockfrost_free(ptr);
+ }
+ /**
+ * @param {string} url
+ * @param {string} project_id
+ * @returns {Blockfrost}
+ */
+ static new(url, project_id) {
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(project_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.blockfrost_new(ptr0, len0, ptr1, len1);
+ return Blockfrost.__wrap(ret);
+ }
+ /**
+ * @returns {string}
+ */
+ url() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_url(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ project_id() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_project_id(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+const BootstrapWitnessFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_bootstrapwitness_free(ptr));
+/** */
+export class BootstrapWitness {
+ static __wrap(ptr) {
+ const obj = Object.create(BootstrapWitness.prototype);
+ obj.ptr = ptr;
+ BootstrapWitnessFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bootstrapwitness_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bootstrapwitness_to_js_value(retptr, this.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.ptr);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519Signature}
+ */
+ signature() {
+ const ret = wasm.bootstrapwitness_signature(this.ptr);
+ return Ed25519Signature.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ chain_code() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetname_name(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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.ptr, signature.ptr, ptr0, len0, ptr1, len1);
+ return BootstrapWitness.__wrap(ret);
+ }
+}
+const BootstrapWitnessesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_bootstrapwitnesses_free(ptr));
+/** */
+export class BootstrapWitnesses {
+ static __wrap(ptr) {
+ const obj = Object.create(BootstrapWitnesses.prototype);
+ obj.ptr = ptr;
+ BootstrapWitnessesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ BootstrapWitnessesFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_bootstrapwitnesses_free(ptr);
+ }
+ /**
+ * @returns {BootstrapWitnesses}
+ */
+ static new() {
+ const ret = wasm.assetnames_new();
+ return BootstrapWitnesses.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {BootstrapWitness}
+ */
+ get(index) {
+ const ret = wasm.bootstrapwitnesses_get(this.ptr, index);
+ return BootstrapWitness.__wrap(ret);
+ }
+ /**
+ * @param {BootstrapWitness} elem
+ */
+ add(elem) {
+ _assertClass(elem, BootstrapWitness);
+ wasm.bootstrapwitnesses_add(this.ptr, elem.ptr);
+ }
+}
+const ByronAddressFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_byronaddress_free(ptr));
+/** */
+export class ByronAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(ByronAddress.prototype);
+ obj.ptr = ptr;
+ ByronAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ByronAddressFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_byronaddress_free(ptr);
+ }
+ /**
+ * @returns {string}
+ */
+ to_base58() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.byronaddress_to_base58(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.byronaddress_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ attributes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.byronaddress_attributes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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.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.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.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {ByronAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_byron(addr.ptr);
+ return ret === 0 ? undefined : ByronAddress.__wrap(ret);
+ }
+}
+const CertificateFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_certificate_free(ptr));
+/** */
+export class Certificate {
+ static __wrap(ptr) {
+ const obj = Object.create(Certificate.prototype);
+ obj.ptr = ptr;
+ CertificateFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.certificate_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.certificate_to_js_value(retptr, this.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.ptr);
+ return Certificate.__wrap(ret);
+ }
+ /**
+ * @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.ptr);
+ return Certificate.__wrap(ret);
+ }
+ /**
+ * @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.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.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.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.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.ptr);
+ return Certificate.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.certificate_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {StakeRegistration | undefined}
+ */
+ as_stake_registration() {
+ const ret = wasm.certificate_as_stake_registration(this.ptr);
+ return ret === 0 ? undefined : StakeRegistration.__wrap(ret);
+ }
+ /**
+ * @returns {StakeDeregistration | undefined}
+ */
+ as_stake_deregistration() {
+ const ret = wasm.certificate_as_stake_deregistration(this.ptr);
+ return ret === 0 ? undefined : StakeDeregistration.__wrap(ret);
+ }
+ /**
+ * @returns {StakeDelegation | undefined}
+ */
+ as_stake_delegation() {
+ const ret = wasm.certificate_as_stake_delegation(this.ptr);
+ return ret === 0 ? undefined : StakeDelegation.__wrap(ret);
+ }
+ /**
+ * @returns {PoolRegistration | undefined}
+ */
+ as_pool_registration() {
+ const ret = wasm.certificate_as_pool_registration(this.ptr);
+ return ret === 0 ? undefined : PoolRegistration.__wrap(ret);
+ }
+ /**
+ * @returns {PoolRetirement | undefined}
+ */
+ as_pool_retirement() {
+ const ret = wasm.certificate_as_pool_retirement(this.ptr);
+ return ret === 0 ? undefined : PoolRetirement.__wrap(ret);
+ }
+ /**
+ * @returns {GenesisKeyDelegation | undefined}
+ */
+ as_genesis_key_delegation() {
+ const ret = wasm.certificate_as_genesis_key_delegation(this.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.ptr);
+ return ret === 0 ? undefined : MoveInstantaneousRewardsCert.__wrap(ret);
+ }
+ /**
+ * @returns {RegCert | undefined}
+ */
+ as_reg_cert() {
+ const ret = wasm.certificate_as_reg_cert(this.ptr);
+ return ret === 0 ? undefined : RegCert.__wrap(ret);
+ }
+ /**
+ * @returns {UnregCert | undefined}
+ */
+ as_unreg_cert() {
+ const ret = wasm.certificate_as_unreg_cert(this.ptr);
+ return ret === 0 ? undefined : UnregCert.__wrap(ret);
+ }
+ /**
+ * @returns {VoteDelegCert | undefined}
+ */
+ as_vote_deleg_cert() {
+ const ret = wasm.certificate_as_vote_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : VoteDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {StakeVoteDelegCert | undefined}
+ */
+ as_stake_vote_deleg_cert() {
+ const ret = wasm.certificate_as_stake_vote_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : StakeVoteDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {StakeRegDelegCert | undefined}
+ */
+ as_stake_reg_deleg_cert() {
+ const ret = wasm.certificate_as_stake_reg_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : StakeRegDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {VoteRegDelegCert | undefined}
+ */
+ as_vote_reg_deleg_cert() {
+ const ret = wasm.certificate_as_vote_reg_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : VoteRegDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {StakeVoteRegDelegCert | undefined}
+ */
+ as_stake_vote_reg_deleg_cert() {
+ const ret = wasm.certificate_as_stake_vote_reg_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : StakeVoteRegDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {RegCommitteeHotKeyCert | undefined}
+ */
+ as_reg_committee_hot_key_cert() {
+ const ret = wasm.certificate_as_reg_committee_hot_key_cert(this.ptr);
+ return ret === 0 ? undefined : RegCommitteeHotKeyCert.__wrap(ret);
+ }
+ /**
+ * @returns {UnregCommitteeHotKeyCert | undefined}
+ */
+ as_unreg_committee_hot_key_cert() {
+ const ret = wasm.certificate_as_unreg_committee_hot_key_cert(this.ptr);
+ return ret === 0 ? undefined : UnregCommitteeHotKeyCert.__wrap(ret);
+ }
+ /**
+ * @returns {RegDrepCert | undefined}
+ */
+ as_reg_drep_cert() {
+ const ret = wasm.certificate_as_reg_drep_cert(this.ptr);
+ return ret === 0 ? undefined : RegDrepCert.__wrap(ret);
+ }
+ /**
+ * @returns {UnregDrepCert | undefined}
+ */
+ as_unreg_drep_cert() {
+ const ret = wasm.certificate_as_unreg_drep_cert(this.ptr);
+ return ret === 0 ? undefined : UnregDrepCert.__wrap(ret);
+ }
+}
+const CertificatesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_certificates_free(ptr));
+/** */
+export class Certificates {
+ static __wrap(ptr) {
+ const obj = Object.create(Certificates.prototype);
+ obj.ptr = ptr;
+ CertificatesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.certificates_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.certificates_to_js_value(retptr, this.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.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Certificate}
+ */
+ get(index) {
+ const ret = wasm.certificates_get(this.ptr, index);
+ return Certificate.__wrap(ret);
+ }
+ /**
+ * @param {Certificate} elem
+ */
+ add(elem) {
+ _assertClass(elem, Certificate);
+ wasm.certificates_add(this.ptr, elem.ptr);
+ }
+}
+const ConstrPlutusDataFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_constrplutusdata_free(ptr));
+/** */
+export class ConstrPlutusData {
+ static __wrap(ptr) {
+ const obj = Object.create(ConstrPlutusData.prototype);
+ obj.ptr = ptr;
+ ConstrPlutusDataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {BigNum}
+ */
+ alternative() {
+ const ret = wasm.constrplutusdata_alternative(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusList}
+ */
+ data() {
+ const ret = wasm.constrplutusdata_data(this.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.ptr, data.ptr);
+ return ConstrPlutusData.__wrap(ret);
+ }
+}
+const CostModelFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_costmodel_free(ptr));
+/** */
+export class CostModel {
+ static __wrap(ptr) {
+ const obj = Object.create(CostModel.prototype);
+ obj.ptr = ptr;
+ CostModelFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {CostModel}
+ */
+ static new() {
+ const ret = wasm.costmodel_new();
+ return CostModel.__wrap(ret);
+ }
+ /**
+ * @returns {CostModel}
+ */
+ static new_plutus_v2() {
+ const ret = wasm.costmodel_new_plutus_v2();
+ return CostModel.__wrap(ret);
+ }
+ /**
+ * @returns {CostModel}
+ */
+ static new_plutus_v3() {
+ const ret = wasm.costmodel_new_plutus_v3();
+ return CostModel.__wrap(ret);
+ }
+ /**
+ * @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.ptr, operation, cost.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.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.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+}
+const CostmdlsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_costmdls_free(ptr));
+/** */
+export class Costmdls {
+ static __wrap(ptr) {
+ const obj = Object.create(Costmdls.prototype);
+ obj.ptr = ptr;
+ CostmdlsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {Costmdls}
+ */
+ static new() {
+ const ret = wasm.assets_new();
+ return Costmdls.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.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.ptr, key.ptr, value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : CostModel.__wrap(ret);
+ }
+ /**
+ * @returns {Languages}
+ */
+ keys() {
+ const ret = wasm.costmdls_keys(this.ptr);
+ return Languages.__wrap(ret);
+ }
+}
+const DNSRecordAorAAAAFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_dnsrecordaoraaaa_free(ptr));
+/** */
+export class DNSRecordAorAAAA {
+ static __wrap(ptr) {
+ const obj = Object.create(DNSRecordAorAAAA.prototype);
+ obj.ptr = ptr;
+ DNSRecordAorAAAAFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_url(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+const DNSRecordSRVFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_dnsrecordsrv_free(ptr));
+/** */
+export class DNSRecordSRV {
+ static __wrap(ptr) {
+ const obj = Object.create(DNSRecordSRV.prototype);
+ obj.ptr = ptr;
+ DNSRecordSRVFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_url(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+const DataFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_data_free(ptr));
+/** */
+export class Data {
+ static __wrap(ptr) {
+ const obj = Object.create(Data.prototype);
+ obj.ptr = ptr;
+ DataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ DataFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_data_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.data_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Data}
+ */
+ 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.data_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 Data.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.data_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.data_to_js_value(retptr, this.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 {Data}
+ */
+ 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.data_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 Data.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {PlutusData} plutus_data
+ * @returns {Data}
+ */
+ static new(plutus_data) {
+ _assertClass(plutus_data, PlutusData);
+ const ret = wasm.data_new(plutus_data.ptr);
+ return Data.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusData}
+ */
+ get() {
+ const ret = wasm.data_get(this.ptr);
+ return PlutusData.__wrap(ret);
+ }
+}
+const DataHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_datahash_free(ptr));
+/** */
+export class DataHash {
+ static __wrap(ptr) {
+ const obj = Object.create(DataHash.prototype);
+ obj.ptr = ptr;
+ DataHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const DatumFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_datum_free(ptr));
+/** */
+export class Datum {
+ static __wrap(ptr) {
+ const obj = Object.create(Datum.prototype);
+ obj.ptr = ptr;
+ DatumFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ DatumFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_datum_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.datum_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Datum}
+ */
+ 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.datum_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 Datum.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.datum_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.datum_to_js_value(retptr, this.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 {Datum}
+ */
+ 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.datum_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 Datum.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {DataHash} data_hash
+ * @returns {Datum}
+ */
+ static new_data_hash(data_hash) {
+ _assertClass(data_hash, DataHash);
+ const ret = wasm.datum_new_data_hash(data_hash.ptr);
+ return Datum.__wrap(ret);
+ }
+ /**
+ * @param {Data} data
+ * @returns {Datum}
+ */
+ static new_data(data) {
+ _assertClass(data, Data);
+ const ret = wasm.datum_new_data(data.ptr);
+ return Datum.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.datum_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {DataHash | undefined}
+ */
+ as_data_hash() {
+ const ret = wasm.datum_as_data_hash(this.ptr);
+ return ret === 0 ? undefined : DataHash.__wrap(ret);
+ }
+ /**
+ * @returns {Data | undefined}
+ */
+ as_data() {
+ const ret = wasm.datum_as_data(this.ptr);
+ return ret === 0 ? undefined : Data.__wrap(ret);
+ }
+}
+const DrepFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_drep_free(ptr));
+/** */
+export class Drep {
+ static __wrap(ptr) {
+ const obj = Object.create(Drep.prototype);
+ obj.ptr = ptr;
+ DrepFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.drep_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.drep_to_js_value(retptr, this.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} keyhash
+ * @returns {Drep}
+ */
+ static new_keyhash(keyhash) {
+ _assertClass(keyhash, Ed25519KeyHash);
+ const ret = wasm.drep_new_keyhash(keyhash.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Drep}
+ */
+ static new_scripthash(scripthash) {
+ _assertClass(scripthash, ScriptHash);
+ const ret = wasm.drep_new_scripthash(scripthash.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ static new_abstain() {
+ const ret = wasm.drep_new_abstain();
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ static new_no_confidence() {
+ const ret = wasm.drep_new_no_confidence();
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.drep_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_keyhash() {
+ const ret = wasm.drep_as_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_scripthash() {
+ const ret = wasm.drep_as_scripthash(this.ptr);
+ return ret === 0 ? undefined : ScriptHash.__wrap(ret);
+ }
+}
+const DrepVotingThresholdsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_drepvotingthresholds_free(ptr));
+/** */
+export class DrepVotingThresholds {
+ static __wrap(ptr) {
+ const obj = Object.create(DrepVotingThresholds.prototype);
+ obj.ptr = ptr;
+ DrepVotingThresholdsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.drepvotingthresholds_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.drepvotingthresholds_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ motion_no_confidence() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_normal() {
+ const ret = wasm.drepvotingthresholds_committee_normal(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_no_confidence() {
+ const ret = wasm.drepvotingthresholds_committee_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ update_constitution() {
+ const ret = wasm.drepvotingthresholds_update_constitution(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ hard_fork_initiation() {
+ const ret = wasm.drepvotingthresholds_hard_fork_initiation(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_network_group() {
+ const ret = wasm.drepvotingthresholds_pp_network_group(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_economic_group() {
+ const ret = wasm.drepvotingthresholds_pp_economic_group(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_technical_group() {
+ const ret = wasm.drepvotingthresholds_pp_technical_group(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_governance_group() {
+ const ret = wasm.drepvotingthresholds_pp_governance_group(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ treasury_withdrawal() {
+ const ret = wasm.drepvotingthresholds_treasury_withdrawal(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @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.ptr, committee_normal.ptr, committee_no_confidence.ptr, update_constitution.ptr, hard_fork_initiation.ptr, pp_network_group.ptr, pp_economic_group.ptr, pp_technical_group.ptr, pp_governance_group.ptr, treasury_withdrawal.ptr);
+ return DrepVotingThresholds.__wrap(ret);
+ }
+}
+const Ed25519KeyHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_ed25519keyhash_free(ptr));
+/** */
+export class Ed25519KeyHash {
+ static __wrap(ptr) {
+ const obj = Object.create(Ed25519KeyHash.prototype);
+ obj.ptr = ptr;
+ Ed25519KeyHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const Ed25519KeyHashesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_ed25519keyhashes_free(ptr));
+/** */
+export class Ed25519KeyHashes {
+ static __wrap(ptr) {
+ const obj = Object.create(Ed25519KeyHashes.prototype);
+ obj.ptr = ptr;
+ Ed25519KeyHashesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_js_value(retptr, this.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.ed25519keyhashes_new();
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Ed25519KeyHash}
+ */
+ get(index) {
+ const ret = wasm.ed25519keyhashes_get(this.ptr, index);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} elem
+ */
+ add(elem) {
+ _assertClass(elem, Ed25519KeyHash);
+ wasm.ed25519keyhashes_add(this.ptr, elem.ptr);
+ }
+}
+const Ed25519SignatureFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_ed25519signature_free(ptr));
+/** */
+export class Ed25519Signature {
+ static __wrap(ptr) {
+ const obj = Object.create(Ed25519Signature.prototype);
+ obj.ptr = ptr;
+ Ed25519SignatureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_bech32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519signature_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_hex() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519signature_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const EnterpriseAddressFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_enterpriseaddress_free(ptr));
+/** */
+export class EnterpriseAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(EnterpriseAddress.prototype);
+ obj.ptr = ptr;
+ EnterpriseAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ EnterpriseAddressFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_enterpriseaddress_free(ptr);
+ }
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @returns {EnterpriseAddress}
+ */
+ static new(network, payment) {
+ _assertClass(payment, StakeCredential);
+ const ret = wasm.enterpriseaddress_new(network, payment.ptr);
+ return EnterpriseAddress.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Address}
+ */
+ to_address() {
+ const ret = wasm.enterpriseaddress_to_address(this.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {EnterpriseAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_enterprise(addr.ptr);
+ return ret === 0 ? undefined : EnterpriseAddress.__wrap(ret);
+ }
+}
+const ExUnitPricesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_exunitprices_free(ptr));
+/** */
+export class ExUnitPrices {
+ static __wrap(ptr) {
+ const obj = Object.create(ExUnitPrices.prototype);
+ obj.ptr = ptr;
+ ExUnitPricesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {UnitInterval}
+ */
+ mem_price() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ step_price() {
+ const ret = wasm.drepvotingthresholds_committee_normal(this.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.ptr, step_price.ptr);
+ return ExUnitPrices.__wrap(ret);
+ }
+ /**
+ * @param {number} mem_price
+ * @param {number} step_price
+ * @returns {ExUnitPrices}
+ */
+ static from_float(mem_price, step_price) {
+ const ret = wasm.exunitprices_from_float(mem_price, step_price);
+ return ExUnitPrices.__wrap(ret);
+ }
+}
+const ExUnitsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_exunits_free(ptr));
+/** */
+export class ExUnits {
+ static __wrap(ptr) {
+ const obj = Object.create(ExUnits.prototype);
+ obj.ptr = ptr;
+ ExUnitsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {BigNum}
+ */
+ mem() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ steps() {
+ const ret = wasm.exunits_steps(this.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.ptr, steps.ptr);
+ return ExUnits.__wrap(ret);
+ }
+}
+const GeneralTransactionMetadataFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_generaltransactionmetadata_free(ptr));
+/** */
+export class GeneralTransactionMetadata {
+ static __wrap(ptr) {
+ const obj = Object.create(GeneralTransactionMetadata.prototype);
+ obj.ptr = ptr;
+ GeneralTransactionMetadataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.generaltransactionmetadata_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.generaltransactionmetadata_to_js_value(retptr, this.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.auxiliarydataset_new();
+ return GeneralTransactionMetadata.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.auxiliarydataset_len(this.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.ptr, key.ptr, value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : TransactionMetadatum.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionMetadatumLabels}
+ */
+ keys() {
+ const ret = wasm.generaltransactionmetadata_keys(this.ptr);
+ return TransactionMetadatumLabels.__wrap(ret);
+ }
+}
+const GenesisDelegateHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_genesisdelegatehash_free(ptr));
+/** */
+export class GenesisDelegateHash {
+ static __wrap(ptr) {
+ const obj = Object.create(GenesisDelegateHash.prototype);
+ obj.ptr = ptr;
+ GenesisDelegateHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const GenesisHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_genesishash_free(ptr));
+/** */
+export class GenesisHash {
+ static __wrap(ptr) {
+ const obj = Object.create(GenesisHash.prototype);
+ obj.ptr = ptr;
+ GenesisHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const GenesisHashesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_genesishashes_free(ptr));
+/** */
+export class GenesisHashes {
+ static __wrap(ptr) {
+ const obj = Object.create(GenesisHashes.prototype);
+ obj.ptr = ptr;
+ GenesisHashesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_js_value(retptr, this.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.ed25519keyhashes_new();
+ return GenesisHashes.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {GenesisHash}
+ */
+ get(index) {
+ const ret = wasm.genesishashes_get(this.ptr, index);
+ return GenesisHash.__wrap(ret);
+ }
+ /**
+ * @param {GenesisHash} elem
+ */
+ add(elem) {
+ _assertClass(elem, GenesisHash);
+ wasm.ed25519keyhashes_add(this.ptr, elem.ptr);
+ }
+}
+const GenesisKeyDelegationFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_genesiskeydelegation_free(ptr));
+/** */
+export class GenesisKeyDelegation {
+ static __wrap(ptr) {
+ const obj = Object.create(GenesisKeyDelegation.prototype);
+ obj.ptr = ptr;
+ GenesisKeyDelegationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.genesiskeydelegation_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.genesiskeydelegation_to_js_value(retptr, this.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.ptr);
+ return GenesisHash.__wrap(ret);
+ }
+ /**
+ * @returns {GenesisDelegateHash}
+ */
+ genesis_delegate_hash() {
+ const ret = wasm.genesiskeydelegation_genesis_delegate_hash(this.ptr);
+ return GenesisDelegateHash.__wrap(ret);
+ }
+ /**
+ * @returns {VRFKeyHash}
+ */
+ vrf_keyhash() {
+ const ret = wasm.genesiskeydelegation_vrf_keyhash(this.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.ptr, genesis_delegate_hash.ptr, vrf_keyhash.ptr);
+ return GenesisKeyDelegation.__wrap(ret);
+ }
+}
+const GovernanceActionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_governanceaction_free(ptr));
+/** */
+export class GovernanceAction {
+ static __wrap(ptr) {
+ const obj = Object.create(GovernanceAction.prototype);
+ obj.ptr = ptr;
+ GovernanceActionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.governanceaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.governanceaction_to_js_value(retptr, this.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.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.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.ptr);
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @returns {GovernanceAction}
+ */
+ static new_no_confidence() {
+ const ret = wasm.governanceaction_new_no_confidence();
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @param {NewCommittee} new_committe
+ * @returns {GovernanceAction}
+ */
+ static new_new_committee(new_committe) {
+ _assertClass(new_committe, NewCommittee);
+ const ret = wasm.governanceaction_new_new_committee(new_committe.ptr);
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @param {NewConstitution} new_constitution
+ * @returns {GovernanceAction}
+ */
+ static new_new_constitution(new_constitution) {
+ _assertClass(new_constitution, NewConstitution);
+ const ret = wasm.governanceaction_new_new_constitution(new_constitution.ptr);
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @returns {GovernanceAction}
+ */
+ static new_info_action() {
+ const ret = wasm.governanceaction_new_info_action();
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.governanceaction_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {ParameterChangeAction | undefined}
+ */
+ as_parameter_change_action() {
+ const ret = wasm.governanceaction_as_parameter_change_action(this.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.ptr);
+ return ret === 0 ? undefined : HardForkInitiationAction.__wrap(ret);
+ }
+ /**
+ * @returns {TreasuryWithdrawalsAction | undefined}
+ */
+ as_treasury_withdrawals_action() {
+ const ret = wasm.governanceaction_as_treasury_withdrawals_action(this.ptr);
+ return ret === 0 ? undefined : TreasuryWithdrawalsAction.__wrap(ret);
+ }
+ /**
+ * @returns {NewCommittee | undefined}
+ */
+ as_new_committee() {
+ const ret = wasm.governanceaction_as_new_committee(this.ptr);
+ return ret === 0 ? undefined : NewCommittee.__wrap(ret);
+ }
+ /**
+ * @returns {NewConstitution | undefined}
+ */
+ as_new_constitution() {
+ const ret = wasm.governanceaction_as_new_constitution(this.ptr);
+ return ret === 0 ? undefined : NewConstitution.__wrap(ret);
+ }
+}
+const GovernanceActionIdFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_governanceactionid_free(ptr));
+/** */
+export class GovernanceActionId {
+ static __wrap(ptr) {
+ const obj = Object.create(GovernanceActionId.prototype);
+ obj.ptr = ptr;
+ GovernanceActionIdFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.governanceactionid_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.governanceactionid_to_js_value(retptr, this.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.ptr);
+ return TransactionHash.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ governance_action_index() {
+ const ret = wasm.governanceactionid_governance_action_index(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {TransactionHash} transaction_id
+ * @param {BigNum} governance_action_index
+ * @returns {GovernanceActionId}
+ */
+ static new(transaction_id, governance_action_index) {
+ _assertClass(transaction_id, TransactionHash);
+ _assertClass(governance_action_index, BigNum);
+ const ret = wasm.governanceactionid_new(transaction_id.ptr, governance_action_index.ptr);
+ return GovernanceActionId.__wrap(ret);
+ }
+}
+const HardForkInitiationActionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_hardforkinitiationaction_free(ptr));
+/** */
+export class HardForkInitiationAction {
+ static __wrap(ptr) {
+ const obj = Object.create(HardForkInitiationAction.prototype);
+ obj.ptr = ptr;
+ HardForkInitiationActionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.hardforkinitiationaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.hardforkinitiationaction_to_js_value(retptr, this.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 {ProtocolVersion}
+ */
+ protocol_version() {
+ const ret = wasm.hardforkinitiationaction_new(this.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.ptr);
+ return HardForkInitiationAction.__wrap(ret);
+ }
+}
+const HeaderFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_header_free(ptr));
+/** */
+export class Header {
+ static __wrap(ptr) {
+ const obj = Object.create(Header.prototype);
+ obj.ptr = ptr;
+ HeaderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.header_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.header_to_js_value(retptr, this.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.ptr);
+ return HeaderBody.__wrap(ret);
+ }
+ /**
+ * @returns {KESSignature}
+ */
+ body_signature() {
+ const ret = wasm.header_body_signature(this.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.ptr, body_signature.ptr);
+ return Header.__wrap(ret);
+ }
+}
+const HeaderBodyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_headerbody_free(ptr));
+/** */
+export class HeaderBody {
+ static __wrap(ptr) {
+ const obj = Object.create(HeaderBody.prototype);
+ obj.ptr = ptr;
+ HeaderBodyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headerbody_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headerbody_to_js_value(retptr, this.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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {BigNum}
+ */
+ slot() {
+ const ret = wasm.headerbody_slot(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BlockHash | undefined}
+ */
+ prev_hash() {
+ const ret = wasm.headerbody_prev_hash(this.ptr);
+ return ret === 0 ? undefined : BlockHash.__wrap(ret);
+ }
+ /**
+ * @returns {Vkey}
+ */
+ issuer_vkey() {
+ const ret = wasm.headerbody_issuer_vkey(this.ptr);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @returns {VRFVKey}
+ */
+ vrf_vkey() {
+ const ret = wasm.headerbody_vrf_vkey(this.ptr);
+ return VRFVKey.__wrap(ret);
+ }
+ /**
+ * @returns {VRFCert}
+ */
+ nonce_vrf() {
+ const ret = wasm.headerbody_nonce_vrf(this.ptr);
+ return VRFCert.__wrap(ret);
+ }
+ /**
+ * @returns {VRFCert}
+ */
+ leader_vrf() {
+ const ret = wasm.headerbody_leader_vrf(this.ptr);
+ return VRFCert.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ block_body_size() {
+ const ret = wasm.headerbody_block_body_size(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {BlockHash}
+ */
+ block_body_hash() {
+ const ret = wasm.headerbody_block_body_hash(this.ptr);
+ return BlockHash.__wrap(ret);
+ }
+ /**
+ * @returns {OperationalCert}
+ */
+ operational_cert() {
+ const ret = wasm.headerbody_operational_cert(this.ptr);
+ return OperationalCert.__wrap(ret);
+ }
+ /**
+ * @returns {ProtocolVersion}
+ */
+ protocol_version() {
+ const ret = wasm.headerbody_protocol_version(this.ptr);
+ return ProtocolVersion.__wrap(ret);
+ }
+ /**
+ * @param {number} block_number
+ * @param {BigNum} slot
+ * @param {BlockHash | undefined} prev_hash
+ * @param {Vkey} issuer_vkey
+ * @param {VRFVKey} vrf_vkey
+ * @param {VRFCert} nonce_vrf
+ * @param {VRFCert} leader_vrf
+ * @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, nonce_vrf, leader_vrf, 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(nonce_vrf, VRFCert);
+ _assertClass(leader_vrf, VRFCert);
+ _assertClass(block_body_hash, BlockHash);
+ _assertClass(operational_cert, OperationalCert);
+ _assertClass(protocol_version, ProtocolVersion);
+ const ret = wasm.headerbody_new(block_number, slot.ptr, ptr0, issuer_vkey.ptr, vrf_vkey.ptr, nonce_vrf.ptr, leader_vrf.ptr, block_body_size, block_body_hash.ptr, operational_cert.ptr, protocol_version.ptr);
+ return HeaderBody.__wrap(ret);
+ }
+}
+const IntFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_int_free(ptr));
+/** */
+export class Int {
+ static __wrap(ptr) {
+ const obj = Object.create(Int.prototype);
+ obj.ptr = ptr;
+ IntFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new(x) {
+ _assertClass(x, BigNum);
+ const ret = wasm.int_new(x.ptr);
+ return Int.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new_negative(x) {
+ _assertClass(x, BigNum);
+ const ret = wasm.int_new_negative(x.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.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.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.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.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.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.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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.int_to_str(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const Ipv4Finalization = new FinalizationRegistry((ptr) => wasm.__wbg_ipv4_free(ptr));
+/** */
+export class Ipv4 {
+ static __wrap(ptr) {
+ const obj = Object.create(Ipv4.prototype);
+ obj.ptr = ptr;
+ Ipv4Finalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ipv4_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ipv4_to_js_value(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const Ipv6Finalization = new FinalizationRegistry((ptr) => wasm.__wbg_ipv6_free(ptr));
+/** */
+export class Ipv6 {
+ static __wrap(ptr) {
+ const obj = Object.create(Ipv6.prototype);
+ obj.ptr = ptr;
+ Ipv6Finalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ipv6_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ipv6_to_js_value(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const KESSignatureFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_kessignature_free(ptr));
+/** */
+export class KESSignature {
+ static __wrap(ptr) {
+ const obj = Object.create(KESSignature.prototype);
+ obj.ptr = ptr;
+ KESSignatureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.assetname_name(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+}
+const KESVKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_kesvkey_free(ptr));
+/** */
+export class KESVKey {
+ static __wrap(ptr) {
+ const obj = Object.create(KESVKey.prototype);
+ obj.ptr = ptr;
+ KESVKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const LanguageFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_language_free(ptr));
+/** */
+export class Language {
+ static __wrap(ptr) {
+ const obj = Object.create(Language.prototype);
+ obj.ptr = ptr;
+ LanguageFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {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 {number}
+ */
+ kind() {
+ const ret = wasm.language_kind(this.ptr);
+ return ret >>> 0;
+ }
+}
+const LanguagesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_languages_free(ptr));
+/** */
+export class Languages {
+ static __wrap(ptr) {
+ const obj = Object.create(Languages.prototype);
+ obj.ptr = ptr;
+ LanguagesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ed25519keyhashes_new();
+ return Languages.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Language}
+ */
+ get(index) {
+ const ret = wasm.languages_get(this.ptr, index);
+ return Language.__wrap(ret);
+ }
+ /**
+ * @param {Language} elem
+ */
+ add(elem) {
+ _assertClass(elem, Language);
+ var ptr0 = elem.__destroy_into_raw();
+ wasm.languages_add(this.ptr, ptr0);
+ }
+}
+const LegacyDaedalusPrivateKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_legacydaedalusprivatekey_free(ptr));
+/** */
+export class LegacyDaedalusPrivateKey {
+ static __wrap(ptr) {
+ const obj = Object.create(LegacyDaedalusPrivateKey.prototype);
+ obj.ptr = ptr;
+ LegacyDaedalusPrivateKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.bip32privatekey_as_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ chaincode() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32privatekey_chaincode(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const LinearFeeFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_linearfee_free(ptr));
+/** */
+export class LinearFee {
+ static __wrap(ptr) {
+ const obj = Object.create(LinearFee.prototype);
+ obj.ptr = ptr;
+ LinearFeeFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coefficient() {
+ const ret = wasm.linearfee_coefficient(this.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.ptr, constant.ptr);
+ return LinearFee.__wrap(ret);
+ }
+}
+const MIRToStakeCredentialsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_mirtostakecredentials_free(ptr));
+/** */
+export class MIRToStakeCredentials {
+ static __wrap(ptr) {
+ const obj = Object.create(MIRToStakeCredentials.prototype);
+ obj.ptr = ptr;
+ MIRToStakeCredentialsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.mirtostakecredentials_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.mirtostakecredentials_to_js_value(retptr, this.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.auxiliarydataset_new();
+ return MIRToStakeCredentials.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.auxiliarydataset_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {StakeCredential} cred
+ * @param {Int} delta
+ * @returns {Int | undefined}
+ */
+ insert(cred, delta) {
+ _assertClass(cred, StakeCredential);
+ _assertClass(delta, Int);
+ const ret = wasm.mirtostakecredentials_insert(this.ptr, cred.ptr, delta.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} cred
+ * @returns {Int | undefined}
+ */
+ get(cred) {
+ _assertClass(cred, StakeCredential);
+ const ret = wasm.mirtostakecredentials_get(this.ptr, cred.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredentials}
+ */
+ keys() {
+ const ret = wasm.mirtostakecredentials_keys(this.ptr);
+ return StakeCredentials.__wrap(ret);
+ }
+}
+const MetadataListFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_metadatalist_free(ptr));
+/** */
+export class MetadataList {
+ static __wrap(ptr) {
+ const obj = Object.create(MetadataList.prototype);
+ obj.ptr = ptr;
+ MetadataListFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {MetadataList}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return MetadataList.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionMetadatum}
+ */
+ get(index) {
+ const ret = wasm.metadatalist_get(this.ptr, index);
+ return TransactionMetadatum.__wrap(ret);
+ }
+ /**
+ * @param {TransactionMetadatum} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionMetadatum);
+ wasm.metadatalist_add(this.ptr, elem.ptr);
+ }
+}
+const MetadataMapFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_metadatamap_free(ptr));
+/** */
+export class MetadataMap {
+ static __wrap(ptr) {
+ const obj = Object.create(MetadataMap.prototype);
+ obj.ptr = ptr;
+ MetadataMapFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {MetadataMap}
+ */
+ static new() {
+ const ret = wasm.auxiliarydataset_new();
+ return MetadataMap.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.auxiliarydataset_len(this.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.ptr, key.ptr, value.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.ptr, ptr0, len0, value.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.ptr, key, value.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.ptr, key.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.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.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.ptr, key.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {MetadataList}
+ */
+ keys() {
+ const ret = wasm.metadatamap_keys(this.ptr);
+ return MetadataList.__wrap(ret);
+ }
+}
+const MintFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_mint_free(ptr));
+/** */
+export class Mint {
+ static __wrap(ptr) {
+ const obj = Object.create(Mint.prototype);
+ obj.ptr = ptr;
+ MintFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.mint_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.mint_to_js_value(retptr, this.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.assets_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.ptr, value.ptr);
+ return Mint.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.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.ptr, key.ptr, value.ptr);
+ return ret === 0 ? undefined : MintAssets.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} key
+ * @returns {MintAssets | undefined}
+ */
+ get(key) {
+ _assertClass(key, ScriptHash);
+ const ret = wasm.mint_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : MintAssets.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHashes}
+ */
+ keys() {
+ const ret = wasm.mint_keys(this.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.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.ptr);
+ return MultiAsset.__wrap(ret);
+ }
+}
+const MintAssetsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_mintassets_free(ptr));
+/** */
+export class MintAssets {
+ static __wrap(ptr) {
+ const obj = Object.create(MintAssets.prototype);
+ obj.ptr = ptr;
+ MintAssetsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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) {
+ _assertClass(key, AssetName);
+ _assertClass(value, Int);
+ var ptr0 = value.__destroy_into_raw();
+ const ret = wasm.mintassets_new_from_entry(key.ptr, ptr0);
+ return MintAssets.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {AssetName} key
+ * @param {Int} value
+ * @returns {Int | undefined}
+ */
+ insert(key, value) {
+ _assertClass(key, AssetName);
+ _assertClass(value, Int);
+ var ptr0 = value.__destroy_into_raw();
+ const ret = wasm.mintassets_insert(this.ptr, key.ptr, ptr0);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @param {AssetName} key
+ * @returns {Int | undefined}
+ */
+ get(key) {
+ _assertClass(key, AssetName);
+ const ret = wasm.mintassets_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @returns {AssetNames}
+ */
+ keys() {
+ const ret = wasm.mintassets_keys(this.ptr);
+ return AssetNames.__wrap(ret);
+ }
+}
+const MoveInstantaneousRewardFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_moveinstantaneousreward_free(ptr));
+/** */
+export class MoveInstantaneousReward {
+ static __wrap(ptr) {
+ const obj = Object.create(MoveInstantaneousReward.prototype);
+ obj.ptr = ptr;
+ MoveInstantaneousRewardFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.moveinstantaneousreward_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.moveinstantaneousreward_to_js_value(retptr, this.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 {number} 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.ptr);
+ return MoveInstantaneousReward.__wrap(ret);
+ }
+ /**
+ * @param {number} 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.ptr);
+ return MoveInstantaneousReward.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ pot() {
+ const ret = wasm.moveinstantaneousreward_pot(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.moveinstantaneousreward_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_to_other_pot() {
+ const ret = wasm.moveinstantaneousreward_as_to_other_pot(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {MIRToStakeCredentials | undefined}
+ */
+ as_to_stake_creds() {
+ const ret = wasm.moveinstantaneousreward_as_to_stake_creds(this.ptr);
+ return ret === 0 ? undefined : MIRToStakeCredentials.__wrap(ret);
+ }
+}
+const MoveInstantaneousRewardsCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_moveinstantaneousrewardscert_free(ptr));
+/** */
+export class MoveInstantaneousRewardsCert {
+ static __wrap(ptr) {
+ const obj = Object.create(MoveInstantaneousRewardsCert.prototype);
+ obj.ptr = ptr;
+ MoveInstantaneousRewardsCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.moveinstantaneousrewardscert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.moveinstantaneousrewardscert_to_js_value(retptr, this.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.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.ptr);
+ return MoveInstantaneousRewardsCert.__wrap(ret);
+ }
+}
+const MultiAssetFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_multiasset_free(ptr));
+/** */
+export class MultiAsset {
+ static __wrap(ptr) {
+ const obj = Object.create(MultiAsset.prototype);
+ obj.ptr = ptr;
+ MultiAssetFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.multiasset_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.multiasset_to_js_value(retptr, this.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.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.ptr, policy_id.ptr, assets.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.ptr, policy_id.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);
+ var ptr0 = value.__destroy_into_raw();
+ const ret = wasm.multiasset_set_asset(this.ptr, policy_id.ptr, asset_name.ptr, ptr0);
+ 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.ptr, policy_id.ptr, asset_name.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * returns all policy IDs used by assets in this multiasset
+ * @returns {ScriptHashes}
+ */
+ keys() {
+ const ret = wasm.mint_keys(this.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.ptr, rhs_ma.ptr);
+ return MultiAsset.__wrap(ret);
+ }
+}
+const MultiHostNameFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_multihostname_free(ptr));
+/** */
+export class MultiHostName {
+ static __wrap(ptr) {
+ const obj = Object.create(MultiHostName.prototype);
+ obj.ptr = ptr;
+ MultiHostNameFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.multihostname_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.multihostname_to_js_value(retptr, this.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.anchor_anchor_url(this.ptr);
+ return DNSRecordSRV.__wrap(ret);
+ }
+ /**
+ * @param {DNSRecordSRV} dns_name
+ * @returns {MultiHostName}
+ */
+ static new(dns_name) {
+ _assertClass(dns_name, DNSRecordSRV);
+ const ret = wasm.multihostname_new(dns_name.ptr);
+ return MultiHostName.__wrap(ret);
+ }
+}
+const NativeScriptFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_nativescript_free(ptr));
+/** */
+export class NativeScript {
+ static __wrap(ptr) {
+ const obj = Object.create(NativeScript.prototype);
+ obj.ptr = ptr;
+ NativeScriptFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.nativescript_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.nativescript_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @param {number} namespace
+ * @returns {ScriptHash}
+ */
+ hash(namespace) {
+ const ret = wasm.nativescript_hash(this.ptr, namespace);
+ 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.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.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.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.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.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.ptr);
+ return NativeScript.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.nativescript_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {ScriptPubkey | undefined}
+ */
+ as_script_pubkey() {
+ const ret = wasm.nativescript_as_script_pubkey(this.ptr);
+ return ret === 0 ? undefined : ScriptPubkey.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptAll | undefined}
+ */
+ as_script_all() {
+ const ret = wasm.nativescript_as_script_all(this.ptr);
+ return ret === 0 ? undefined : ScriptAll.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptAny | undefined}
+ */
+ as_script_any() {
+ const ret = wasm.nativescript_as_script_any(this.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.ptr);
+ return ret === 0 ? undefined : ScriptNOfK.__wrap(ret);
+ }
+ /**
+ * @returns {TimelockStart | undefined}
+ */
+ as_timelock_start() {
+ const ret = wasm.nativescript_as_timelock_start(this.ptr);
+ return ret === 0 ? undefined : TimelockStart.__wrap(ret);
+ }
+ /**
+ * @returns {TimelockExpiry | undefined}
+ */
+ as_timelock_expiry() {
+ const ret = wasm.nativescript_as_timelock_expiry(this.ptr);
+ return ret === 0 ? undefined : TimelockExpiry.__wrap(ret);
+ }
+ /**
+ * Returns an array of unique 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.ptr);
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @param {BigNum | undefined} lower_bound
+ * @param {BigNum | undefined} upper_bound
+ * @param {Ed25519KeyHashes} key_hashes
+ * @returns {boolean}
+ */
+ verify(lower_bound, upper_bound, key_hashes) {
+ let ptr0 = 0;
+ if (!isLikeNone(lower_bound)) {
+ _assertClass(lower_bound, BigNum);
+ ptr0 = lower_bound.__destroy_into_raw();
+ }
+ let ptr1 = 0;
+ if (!isLikeNone(upper_bound)) {
+ _assertClass(upper_bound, BigNum);
+ ptr1 = upper_bound.__destroy_into_raw();
+ }
+ _assertClass(key_hashes, Ed25519KeyHashes);
+ const ret = wasm.nativescript_verify(this.ptr, ptr0, ptr1, key_hashes.ptr);
+ return ret !== 0;
+ }
+}
+const NativeScriptsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_nativescripts_free(ptr));
+/** */
+export class NativeScripts {
+ static __wrap(ptr) {
+ const obj = Object.create(NativeScripts.prototype);
+ obj.ptr = ptr;
+ NativeScriptsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.certificates_new();
+ return NativeScripts.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {NativeScript}
+ */
+ get(index) {
+ const ret = wasm.nativescripts_get(this.ptr, index);
+ return NativeScript.__wrap(ret);
+ }
+ /**
+ * @param {NativeScript} elem
+ */
+ add(elem) {
+ _assertClass(elem, NativeScript);
+ wasm.nativescripts_add(this.ptr, elem.ptr);
+ }
+}
+const NetworkIdFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_networkid_free(ptr));
+/** */
+export class NetworkId {
+ static __wrap(ptr) {
+ const obj = Object.create(NetworkId.prototype);
+ obj.ptr = ptr;
+ NetworkIdFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.networkid_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.networkid_to_js_value(retptr, this.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 {number}
+ */
+ kind() {
+ const ret = wasm.networkid_kind(this.ptr);
+ return ret >>> 0;
+ }
+}
+const NetworkInfoFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_networkinfo_free(ptr));
+/** */
+export class NetworkInfo {
+ static __wrap(ptr) {
+ const obj = Object.create(NetworkInfo.prototype);
+ obj.ptr = ptr;
+ NetworkInfoFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ return ret;
+ }
+ /**
+ * @returns {number}
+ */
+ protocol_magic() {
+ const ret = wasm.networkinfo_protocol_magic(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {NetworkInfo}
+ */
+ static testnet() {
+ const ret = wasm.networkinfo_testnet();
+ return NetworkInfo.__wrap(ret);
+ }
+ /**
+ * @returns {NetworkInfo}
+ */
+ static mainnet() {
+ const ret = wasm.networkinfo_mainnet();
+ return NetworkInfo.__wrap(ret);
+ }
+}
+const NewCommitteeFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_newcommittee_free(ptr));
+/** */
+export class NewCommittee {
+ static __wrap(ptr) {
+ const obj = Object.create(NewCommittee.prototype);
+ obj.ptr = ptr;
+ NewCommitteeFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ NewCommitteeFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_newcommittee_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newcommittee_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {NewCommittee}
+ */
+ 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.newcommittee_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 NewCommittee.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newcommittee_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newcommittee_to_js_value(retptr, this.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 {NewCommittee}
+ */
+ 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.newcommittee_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 NewCommittee.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ committee() {
+ const ret = wasm.newcommittee_committee(this.ptr);
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ rational() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHashes} committee
+ * @param {UnitInterval} rational
+ * @returns {NewCommittee}
+ */
+ static new(committee, rational) {
+ _assertClass(committee, Ed25519KeyHashes);
+ _assertClass(rational, UnitInterval);
+ const ret = wasm.newcommittee_new(committee.ptr, rational.ptr);
+ return NewCommittee.__wrap(ret);
+ }
+}
+const NewConstitutionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_newconstitution_free(ptr));
+/** */
+export class NewConstitution {
+ static __wrap(ptr) {
+ const obj = Object.create(NewConstitution.prototype);
+ obj.ptr = ptr;
+ NewConstitutionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ NewConstitutionFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_newconstitution_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newconstitution_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {NewConstitution}
+ */
+ 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.newconstitution_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 NewConstitution.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newconstitution_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newconstitution_to_js_value(retptr, this.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 {NewConstitution}
+ */
+ 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.newconstitution_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 NewConstitution.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {DataHash}
+ */
+ hash() {
+ const ret = wasm.genesiskeydelegation_vrf_keyhash(this.ptr);
+ return DataHash.__wrap(ret);
+ }
+ /**
+ * @param {DataHash} hash
+ * @returns {NewConstitution}
+ */
+ static new(hash) {
+ _assertClass(hash, DataHash);
+ const ret = wasm.newconstitution_new(hash.ptr);
+ return NewConstitution.__wrap(ret);
+ }
+}
+const NonceFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_nonce_free(ptr));
+/** */
+export class Nonce {
+ static __wrap(ptr) {
+ const obj = Object.create(Nonce.prototype);
+ obj.ptr = ptr;
+ NonceFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const OperationalCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_operationalcert_free(ptr));
+/** */
+export class OperationalCert {
+ static __wrap(ptr) {
+ const obj = Object.create(OperationalCert.prototype);
+ obj.ptr = ptr;
+ OperationalCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.operationalcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.operationalcert_to_js_value(retptr, this.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.ptr);
+ return KESVKey.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ sequence_number() {
+ const ret = wasm.operationalcert_sequence_number(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {number}
+ */
+ kes_period() {
+ const ret = wasm.operationalcert_kes_period(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Ed25519Signature}
+ */
+ sigma() {
+ const ret = wasm.operationalcert_sigma(this.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.ptr, sequence_number, kes_period, sigma.ptr);
+ return OperationalCert.__wrap(ret);
+ }
+}
+const ParameterChangeActionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_parameterchangeaction_free(ptr));
+/** */
+export class ParameterChangeAction {
+ static __wrap(ptr) {
+ const obj = Object.create(ParameterChangeAction.prototype);
+ obj.ptr = ptr;
+ ParameterChangeActionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.parameterchangeaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.parameterchangeaction_to_js_value(retptr, this.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 {ProtocolParamUpdate}
+ */
+ protocol_param_update() {
+ const ret = wasm.parameterchangeaction_protocol_param_update(this.ptr);
+ return ProtocolParamUpdate.__wrap(ret);
+ }
+ /**
+ * @param {ProtocolParamUpdate} protocol_param_update
+ * @returns {ParameterChangeAction}
+ */
+ static new(protocol_param_update) {
+ _assertClass(protocol_param_update, ProtocolParamUpdate);
+ const ret = wasm.parameterchangeaction_new(protocol_param_update.ptr);
+ return ParameterChangeAction.__wrap(ret);
+ }
+}
+const PlutusDataFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_plutusdata_free(ptr));
+/** */
+export class PlutusData {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusData.prototype);
+ obj.ptr = ptr;
+ PlutusDataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @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.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {PlutusMap} map
+ * @returns {PlutusData}
+ */
+ static new_map(map) {
+ _assertClass(map, PlutusMap);
+ const ret = wasm.plutusdata_new_map(map.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {PlutusList} list
+ * @returns {PlutusData}
+ */
+ static new_list(list) {
+ _assertClass(list, PlutusList);
+ const ret = wasm.plutusdata_new_list(list.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {BigInt} integer
+ * @returns {PlutusData}
+ */
+ static new_integer(integer) {
+ _assertClass(integer, BigInt);
+ const ret = wasm.plutusdata_new_integer(integer.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 {number}
+ */
+ kind() {
+ const ret = wasm.plutusdata_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {ConstrPlutusData | undefined}
+ */
+ as_constr_plutus_data() {
+ const ret = wasm.plutusdata_as_constr_plutus_data(this.ptr);
+ return ret === 0 ? undefined : ConstrPlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusMap | undefined}
+ */
+ as_map() {
+ const ret = wasm.plutusdata_as_map(this.ptr);
+ return ret === 0 ? undefined : PlutusMap.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusList | undefined}
+ */
+ as_list() {
+ const ret = wasm.plutusdata_as_list(this.ptr);
+ return ret === 0 ? undefined : PlutusList.__wrap(ret);
+ }
+ /**
+ * @returns {BigInt | undefined}
+ */
+ as_integer() {
+ const ret = wasm.plutusdata_as_integer(this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const PlutusListFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_plutuslist_free(ptr));
+/** */
+export class PlutusList {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusList.prototype);
+ obj.ptr = ptr;
+ PlutusListFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {PlutusList}
+ */
+ static new() {
+ const ret = wasm.plutuslist_new();
+ return PlutusList.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {PlutusData}
+ */
+ get(index) {
+ const ret = wasm.plutuslist_get(this.ptr, index);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {PlutusData} elem
+ */
+ add(elem) {
+ _assertClass(elem, PlutusData);
+ wasm.plutuslist_add(this.ptr, elem.ptr);
+ }
+}
+const PlutusMapFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_plutusmap_free(ptr));
+/** */
+export class PlutusMap {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusMap.prototype);
+ obj.ptr = ptr;
+ PlutusMapFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {PlutusMap}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return PlutusMap.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {PlutusData} key
+ * @param {PlutusData} value
+ * @returns {PlutusData | undefined}
+ */
+ insert(key, value) {
+ _assertClass(key, PlutusData);
+ _assertClass(value, PlutusData);
+ const ret = wasm.plutusmap_insert(this.ptr, key.ptr, value.ptr);
+ return ret === 0 ? undefined : PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {PlutusData} key
+ * @returns {PlutusData | undefined}
+ */
+ get(key) {
+ _assertClass(key, PlutusData);
+ const ret = wasm.plutusmap_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : PlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusList}
+ */
+ keys() {
+ const ret = wasm.plutusmap_keys(this.ptr);
+ return PlutusList.__wrap(ret);
+ }
+}
+const PlutusScriptFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_plutusscript_free(ptr));
+/** */
+export class PlutusScript {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusScript.prototype);
+ obj.ptr = ptr;
+ PlutusScriptFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @param {number} namespace
+ * @returns {ScriptHash}
+ */
+ hash(namespace) {
+ const ret = wasm.plutusscript_hash(this.ptr, namespace);
+ return ScriptHash.__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(bytes) {
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.plutusscript_new(ptr0, len0);
+ 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.assetname_name(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const PlutusScriptsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_plutusscripts_free(ptr));
+/** */
+export class PlutusScripts {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusScripts.prototype);
+ obj.ptr = ptr;
+ PlutusScriptsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {PlutusScripts}
+ */
+ static new() {
+ const ret = wasm.assetnames_new();
+ return PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {PlutusScript}
+ */
+ get(index) {
+ const ret = wasm.plutusscripts_get(this.ptr, index);
+ return PlutusScript.__wrap(ret);
+ }
+ /**
+ * @param {PlutusScript} elem
+ */
+ add(elem) {
+ _assertClass(elem, PlutusScript);
+ wasm.assetnames_add(this.ptr, elem.ptr);
+ }
+}
+const PlutusWitnessFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_plutuswitness_free(ptr));
+/** */
+export class PlutusWitness {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusWitness.prototype);
+ obj.ptr = ptr;
+ PlutusWitnessFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PlutusWitnessFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_plutuswitness_free(ptr);
+ }
+ /**
+ * Plutus V1 witness or witness where no script is attached and so version doesn't matter
+ * @param {PlutusData} redeemer
+ * @param {PlutusData | undefined} plutus_data
+ * @param {PlutusScript | undefined} script
+ * @returns {PlutusWitness}
+ */
+ static new(redeemer, plutus_data, script) {
+ _assertClass(redeemer, PlutusData);
+ let ptr0 = 0;
+ if (!isLikeNone(plutus_data)) {
+ _assertClass(plutus_data, PlutusData);
+ ptr0 = plutus_data.__destroy_into_raw();
+ }
+ let ptr1 = 0;
+ if (!isLikeNone(script)) {
+ _assertClass(script, PlutusScript);
+ ptr1 = script.__destroy_into_raw();
+ }
+ const ret = wasm.plutuswitness_new(redeemer.ptr, ptr0, ptr1);
+ return PlutusWitness.__wrap(ret);
+ }
+ /**
+ * @param {PlutusData} redeemer
+ * @param {PlutusData | undefined} plutus_data
+ * @param {PlutusScript | undefined} script
+ * @returns {PlutusWitness}
+ */
+ static new_plutus_v2(redeemer, plutus_data, script) {
+ _assertClass(redeemer, PlutusData);
+ let ptr0 = 0;
+ if (!isLikeNone(plutus_data)) {
+ _assertClass(plutus_data, PlutusData);
+ ptr0 = plutus_data.__destroy_into_raw();
+ }
+ let ptr1 = 0;
+ if (!isLikeNone(script)) {
+ _assertClass(script, PlutusScript);
+ ptr1 = script.__destroy_into_raw();
+ }
+ const ret = wasm.plutuswitness_new_plutus_v2(redeemer.ptr, ptr0, ptr1);
+ return PlutusWitness.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusData | undefined}
+ */
+ plutus_data() {
+ const ret = wasm.plutuswitness_plutus_data(this.ptr);
+ return ret === 0 ? undefined : PlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusData}
+ */
+ redeemer() {
+ const ret = wasm.plutuswitness_redeemer(this.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ script() {
+ const ret = wasm.plutuswitness_script(this.ptr);
+ return ret === 0 ? undefined : PlutusScript.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ version() {
+ const ret = wasm.plutuswitness_version(this.ptr);
+ return ret >>> 0;
+ }
+}
+const PointerFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_pointer_free(ptr));
+/** */
+export class Pointer {
+ static __wrap(ptr) {
+ const obj = Object.create(Pointer.prototype);
+ obj.ptr = ptr;
+ PointerFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PointerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_pointer_free(ptr);
+ }
+ /**
+ * @param {BigNum} slot
+ * @param {BigNum} tx_index
+ * @param {BigNum} cert_index
+ * @returns {Pointer}
+ */
+ static new(slot, tx_index, cert_index) {
+ _assertClass(slot, BigNum);
+ _assertClass(tx_index, BigNum);
+ _assertClass(cert_index, BigNum);
+ const ret = wasm.pointer_new(slot.ptr, tx_index.ptr, cert_index.ptr);
+ return Pointer.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ slot() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ tx_index() {
+ const ret = wasm.exunits_steps(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ cert_index() {
+ const ret = wasm.constrplutusdata_alternative(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+}
+const PointerAddressFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_pointeraddress_free(ptr));
+/** */
+export class PointerAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(PointerAddress.prototype);
+ obj.ptr = ptr;
+ PointerAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PointerAddressFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_pointeraddress_free(ptr);
+ }
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @param {Pointer} stake
+ * @returns {PointerAddress}
+ */
+ static new(network, payment, stake) {
+ _assertClass(payment, StakeCredential);
+ _assertClass(stake, Pointer);
+ const ret = wasm.pointeraddress_new(network, payment.ptr, stake.ptr);
+ return PointerAddress.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred() {
+ const ret = wasm.pointeraddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Pointer}
+ */
+ stake_pointer() {
+ const ret = wasm.pointeraddress_stake_pointer(this.ptr);
+ return Pointer.__wrap(ret);
+ }
+ /**
+ * @returns {Address}
+ */
+ to_address() {
+ const ret = wasm.pointeraddress_to_address(this.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {PointerAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_pointer(addr.ptr);
+ return ret === 0 ? undefined : PointerAddress.__wrap(ret);
+ }
+}
+const PoolMetadataFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_poolmetadata_free(ptr));
+/** */
+export class PoolMetadata {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolMetadata.prototype);
+ obj.ptr = ptr;
+ PoolMetadataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolmetadata_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolmetadata_to_js_value(retptr, this.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.anchor_anchor_url(this.ptr);
+ return Url.__wrap(ret);
+ }
+ /**
+ * @returns {PoolMetadataHash}
+ */
+ pool_metadata_hash() {
+ const ret = wasm.anchor_anchor_data_hash(this.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.anchor_new(url.ptr, pool_metadata_hash.ptr);
+ return PoolMetadata.__wrap(ret);
+ }
+}
+const PoolMetadataHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_poolmetadatahash_free(ptr));
+/** */
+export class PoolMetadataHash {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolMetadataHash.prototype);
+ obj.ptr = ptr;
+ PoolMetadataHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const PoolParamsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_poolparams_free(ptr));
+/** */
+export class PoolParams {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolParams.prototype);
+ obj.ptr = ptr;
+ PoolParamsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolparams_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolparams_to_js_value(retptr, this.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.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {VRFKeyHash}
+ */
+ vrf_keyhash() {
+ const ret = wasm.governanceactionid_transaction_id(this.ptr);
+ return VRFKeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ pledge() {
+ const ret = wasm.headerbody_slot(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ cost() {
+ const ret = wasm.poolparams_cost(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ margin() {
+ const ret = wasm.drepvotingthresholds_committee_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {RewardAddress}
+ */
+ reward_account() {
+ const ret = wasm.poolparams_reward_account(this.ptr);
+ return RewardAddress.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ pool_owners() {
+ const ret = wasm.poolparams_pool_owners(this.ptr);
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @returns {Relays}
+ */
+ relays() {
+ const ret = wasm.poolparams_relays(this.ptr);
+ return Relays.__wrap(ret);
+ }
+ /**
+ * @returns {PoolMetadata | undefined}
+ */
+ pool_metadata() {
+ const ret = wasm.poolparams_pool_metadata(this.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.ptr, vrf_keyhash.ptr, pledge.ptr, cost.ptr, margin.ptr, reward_account.ptr, pool_owners.ptr, relays.ptr, ptr0);
+ return PoolParams.__wrap(ret);
+ }
+}
+const PoolRegistrationFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_poolregistration_free(ptr));
+/** */
+export class PoolRegistration {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolRegistration.prototype);
+ obj.ptr = ptr;
+ PoolRegistrationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolregistration_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolregistration_to_js_value(retptr, this.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.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.ptr);
+ return PoolRegistration.__wrap(ret);
+ }
+ /**
+ * @param {boolean} update
+ */
+ set_is_update(update) {
+ wasm.poolregistration_set_is_update(this.ptr, update);
+ }
+}
+const PoolRetirementFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_poolretirement_free(ptr));
+/** */
+export class PoolRetirement {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolRetirement.prototype);
+ obj.ptr = ptr;
+ PoolRetirementFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolretirement_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolretirement_to_js_value(retptr, this.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.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ epoch() {
+ const ret = wasm.poolretirement_epoch(this.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.ptr, epoch);
+ return PoolRetirement.__wrap(ret);
+ }
+}
+const PoolVotingThresholdsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_poolvotingthresholds_free(ptr));
+/** */
+export class PoolVotingThresholds {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolVotingThresholds.prototype);
+ obj.ptr = ptr;
+ PoolVotingThresholdsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolvotingthresholds_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolvotingthresholds_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ motion_no_confidence() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_normal() {
+ const ret = wasm.drepvotingthresholds_committee_normal(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_no_confidence() {
+ const ret = wasm.drepvotingthresholds_committee_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ hard_fork_initiation() {
+ const ret = wasm.drepvotingthresholds_update_constitution(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {UnitInterval} motion_no_confidence
+ * @param {UnitInterval} committee_normal
+ * @param {UnitInterval} committee_no_confidence
+ * @param {UnitInterval} hard_fork_initiation
+ * @returns {PoolVotingThresholds}
+ */
+ static new(motion_no_confidence, committee_normal, committee_no_confidence, hard_fork_initiation) {
+ _assertClass(motion_no_confidence, UnitInterval);
+ _assertClass(committee_normal, UnitInterval);
+ _assertClass(committee_no_confidence, UnitInterval);
+ _assertClass(hard_fork_initiation, UnitInterval);
+ const ret = wasm.poolvotingthresholds_new(motion_no_confidence.ptr, committee_normal.ptr, committee_no_confidence.ptr, hard_fork_initiation.ptr);
+ return PoolVotingThresholds.__wrap(ret);
+ }
+}
+const PrivateKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_privatekey_free(ptr));
+/** */
+export class PrivateKey {
+ static __wrap(ptr) {
+ const obj = Object.create(PrivateKey.prototype);
+ obj.ptr = ptr;
+ PrivateKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PrivateKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_privatekey_free(ptr);
+ }
+ /**
+ * @returns {PublicKey}
+ */
+ to_public() {
+ const ret = wasm.privatekey_to_public(this.ptr);
+ return PublicKey.__wrap(ret);
+ }
+ /**
+ * @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 {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);
+ }
+ }
+ /**
+ * 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 {string}
+ */
+ to_bech32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.privatekey_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.privatekey_as_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @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} message
+ * @returns {Ed25519Signature}
+ */
+ sign(message) {
+ const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.privatekey_sign(this.ptr, ptr0, len0);
+ return Ed25519Signature.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PrivateKey}
+ */
+ 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.privatekey_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 PrivateKey.__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.privatekey_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const ProposalProcedureFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_proposalprocedure_free(ptr));
+/** */
+export class ProposalProcedure {
+ static __wrap(ptr) {
+ const obj = Object.create(ProposalProcedure.prototype);
+ obj.ptr = ptr;
+ ProposalProcedureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ProposalProcedureFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_proposalprocedure_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposalprocedure_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProposalProcedure}
+ */
+ 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.proposalprocedure_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 ProposalProcedure.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposalprocedure_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposalprocedure_to_js_value(retptr, this.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 {ProposalProcedure}
+ */
+ 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.proposalprocedure_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 ProposalProcedure.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {BigNum}
+ */
+ deposit() {
+ const ret = wasm.proposalprocedure_deposit(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash}
+ */
+ hash() {
+ const ret = wasm.proposalprocedure_hash(this.ptr);
+ return ScriptHash.__wrap(ret);
+ }
+ /**
+ * @returns {GovernanceAction}
+ */
+ governance_action() {
+ const ret = wasm.proposalprocedure_governance_action(this.ptr);
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @returns {Anchor}
+ */
+ anchor() {
+ const ret = wasm.proposalprocedure_anchor(this.ptr);
+ return Anchor.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} deposit
+ * @param {ScriptHash} hash
+ * @param {GovernanceAction} governance_action
+ * @param {Anchor} anchor
+ * @returns {ProposalProcedure}
+ */
+ static new(deposit, hash, governance_action, anchor) {
+ _assertClass(deposit, BigNum);
+ _assertClass(hash, ScriptHash);
+ _assertClass(governance_action, GovernanceAction);
+ _assertClass(anchor, Anchor);
+ const ret = wasm.proposalprocedure_new(deposit.ptr, hash.ptr, governance_action.ptr, anchor.ptr);
+ return ProposalProcedure.__wrap(ret);
+ }
+}
+const ProposalProceduresFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_proposalprocedures_free(ptr));
+/** */
+export class ProposalProcedures {
+ static __wrap(ptr) {
+ const obj = Object.create(ProposalProcedures.prototype);
+ obj.ptr = ptr;
+ ProposalProceduresFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ProposalProceduresFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_proposalprocedures_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposalprocedures_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProposalProcedures}
+ */
+ 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.proposalprocedures_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 ProposalProcedures.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {ProposalProcedures}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return ProposalProcedures.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {ProposalProcedure}
+ */
+ get(index) {
+ const ret = wasm.proposalprocedures_get(this.ptr, index);
+ return ProposalProcedure.__wrap(ret);
+ }
+ /**
+ * @param {ProposalProcedure} elem
+ */
+ add(elem) {
+ _assertClass(elem, ProposalProcedure);
+ wasm.proposalprocedures_add(this.ptr, elem.ptr);
+ }
+}
+const ProposedProtocolParameterUpdatesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_proposedprotocolparameterupdates_free(ptr));
+/** */
+export class ProposedProtocolParameterUpdates {
+ static __wrap(ptr) {
+ const obj = Object.create(ProposedProtocolParameterUpdates.prototype);
+ obj.ptr = ptr;
+ ProposedProtocolParameterUpdatesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposedprotocolparameterupdates_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposedprotocolparameterupdates_to_js_value(retptr, this.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.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.ptr, key.ptr, value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : ProtocolParamUpdate.__wrap(ret);
+ }
+ /**
+ * @returns {GenesisHashes}
+ */
+ keys() {
+ const ret = wasm.proposedprotocolparameterupdates_keys(this.ptr);
+ return GenesisHashes.__wrap(ret);
+ }
+}
+const ProtocolParamUpdateFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_protocolparamupdate_free(ptr));
+/** */
+export class ProtocolParamUpdate {
+ static __wrap(ptr) {
+ const obj = Object.create(ProtocolParamUpdate.prototype);
+ obj.ptr = ptr;
+ ProtocolParamUpdateFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_to_js_value(retptr, this.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.ptr, minfee_a.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ minfee_a() {
+ const ret = wasm.protocolparamupdate_minfee_a(this.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.ptr, minfee_b.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ minfee_b() {
+ const ret = wasm.protocolparamupdate_minfee_b(this.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.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.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.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.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.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.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.ptr, key_deposit.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ key_deposit() {
+ const ret = wasm.protocolparamupdate_key_deposit(this.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.ptr, pool_deposit.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ pool_deposit() {
+ const ret = wasm.protocolparamupdate_pool_deposit(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {number} max_epoch
+ */
+ set_max_epoch(max_epoch) {
+ wasm.protocolparamupdate_set_max_epoch(this.ptr, max_epoch);
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ max_epoch() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_max_epoch(retptr, this.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.ptr, n_opt);
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ n_opt() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_n_opt(retptr, this.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.ptr, pool_pledge_influence.ptr);
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ pool_pledge_influence() {
+ const ret = wasm.protocolparamupdate_pool_pledge_influence(this.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.ptr, expansion_rate.ptr);
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ expansion_rate() {
+ const ret = wasm.protocolparamupdate_expansion_rate(this.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.ptr, treasury_growth_rate.ptr);
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ treasury_growth_rate() {
+ const ret = wasm.protocolparamupdate_treasury_growth_rate(this.ptr);
+ return ret === 0 ? undefined : UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {UnitInterval} d
+ */
+ set_d(d) {
+ _assertClass(d, UnitInterval);
+ wasm.protocolparamupdate_set_d(this.ptr, d.ptr);
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ d() {
+ const ret = wasm.protocolparamupdate_d(this.ptr);
+ return ret === 0 ? undefined : UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {Nonce} extra_entropy
+ */
+ set_extra_entropy(extra_entropy) {
+ _assertClass(extra_entropy, Nonce);
+ wasm.protocolparamupdate_set_extra_entropy(this.ptr, extra_entropy.ptr);
+ }
+ /**
+ * @returns {Nonce | undefined}
+ */
+ extra_entropy() {
+ const ret = wasm.protocolparamupdate_extra_entropy(this.ptr);
+ return ret === 0 ? undefined : Nonce.__wrap(ret);
+ }
+ /**
+ * @param {ProtocolVersion} protocol_version
+ */
+ set_protocol_version(protocol_version) {
+ _assertClass(protocol_version, ProtocolVersion);
+ wasm.protocolparamupdate_set_protocol_version(this.ptr, protocol_version.ptr);
+ }
+ /**
+ * @returns {ProtocolVersion | undefined}
+ */
+ protocol_version() {
+ const ret = wasm.protocolparamupdate_protocol_version(this.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.ptr, min_pool_cost.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ min_pool_cost() {
+ const ret = wasm.protocolparamupdate_min_pool_cost(this.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.ptr, ada_per_utxo_byte.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ ada_per_utxo_byte() {
+ const ret = wasm.protocolparamupdate_ada_per_utxo_byte(this.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.ptr, cost_models.ptr);
+ }
+ /**
+ * @returns {Costmdls | undefined}
+ */
+ cost_models() {
+ const ret = wasm.protocolparamupdate_cost_models(this.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.ptr, execution_costs.ptr);
+ }
+ /**
+ * @returns {ExUnitPrices | undefined}
+ */
+ execution_costs() {
+ const ret = wasm.protocolparamupdate_execution_costs(this.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.ptr, max_tx_ex_units.ptr);
+ }
+ /**
+ * @returns {ExUnits | undefined}
+ */
+ max_tx_ex_units() {
+ const ret = wasm.protocolparamupdate_max_tx_ex_units(this.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.ptr, max_block_ex_units.ptr);
+ }
+ /**
+ * @returns {ExUnits | undefined}
+ */
+ max_block_ex_units() {
+ const ret = wasm.protocolparamupdate_max_block_ex_units(this.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.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.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.ptr, collateral_percentage);
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ collateral_percentage() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_collateral_percentage(retptr, this.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.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.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);
+ var ptr0 = pool_voting_thresholds.__destroy_into_raw();
+ wasm.protocolparamupdate_set_pool_voting_thresholds(this.ptr, ptr0);
+ }
+ /**
+ * @returns {PoolVotingThresholds | undefined}
+ */
+ pool_voting_thresholds() {
+ const ret = wasm.protocolparamupdate_pool_voting_thresholds(this.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);
+ var ptr0 = drep_voting_thresholds.__destroy_into_raw();
+ wasm.protocolparamupdate_set_drep_voting_thresholds(this.ptr, ptr0);
+ }
+ /**
+ * @returns {DrepVotingThresholds | undefined}
+ */
+ drep_voting_thresholds() {
+ const ret = wasm.protocolparamupdate_drep_voting_thresholds(this.ptr);
+ return ret === 0 ? undefined : DrepVotingThresholds.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} min_committee_size
+ */
+ set_min_committee_size(min_committee_size) {
+ _assertClass(min_committee_size, BigNum);
+ var ptr0 = min_committee_size.__destroy_into_raw();
+ wasm.protocolparamupdate_set_min_committee_size(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ min_committee_size() {
+ const ret = wasm.protocolparamupdate_min_committee_size(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} committee_term_limit
+ */
+ set_committee_term_limit(committee_term_limit) {
+ _assertClass(committee_term_limit, BigNum);
+ var ptr0 = committee_term_limit.__destroy_into_raw();
+ wasm.protocolparamupdate_set_committee_term_limit(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ committee_term_limit() {
+ const ret = wasm.protocolparamupdate_committee_term_limit(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} governance_action_expiration
+ */
+ set_governance_action_expiration(governance_action_expiration) {
+ _assertClass(governance_action_expiration, BigNum);
+ var ptr0 = governance_action_expiration.__destroy_into_raw();
+ wasm.protocolparamupdate_set_governance_action_expiration(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ governance_action_expiration() {
+ const ret = wasm.protocolparamupdate_governance_action_expiration(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} governance_action_deposit
+ */
+ set_governance_action_deposit(governance_action_deposit) {
+ _assertClass(governance_action_deposit, BigNum);
+ var ptr0 = governance_action_deposit.__destroy_into_raw();
+ wasm.protocolparamupdate_set_governance_action_deposit(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ governance_action_deposit() {
+ const ret = wasm.protocolparamupdate_governance_action_deposit(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} drep_deposit
+ */
+ set_drep_deposit(drep_deposit) {
+ _assertClass(drep_deposit, BigNum);
+ var ptr0 = drep_deposit.__destroy_into_raw();
+ wasm.protocolparamupdate_set_drep_deposit(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ drep_deposit() {
+ const ret = wasm.protocolparamupdate_drep_deposit(this.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.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.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} minfee_refscript_cost_per_byte
+ */
+ set_minfee_refscript_cost_per_byte(minfee_refscript_cost_per_byte) {
+ _assertClass(minfee_refscript_cost_per_byte, UnitInterval);
+ var ptr0 = minfee_refscript_cost_per_byte.__destroy_into_raw();
+ wasm.protocolparamupdate_set_minfee_refscript_cost_per_byte(this.ptr, ptr0);
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ minfee_refscript_cost_per_byte() {
+ const ret = wasm.protocolparamupdate_minfee_refscript_cost_per_byte(this.ptr);
+ return ret === 0 ? undefined : UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {ProtocolParamUpdate}
+ */
+ static new() {
+ const ret = wasm.protocolparamupdate_new();
+ return ProtocolParamUpdate.__wrap(ret);
+ }
+}
+const ProtocolVersionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_protocolversion_free(ptr));
+/** */
+export class ProtocolVersion {
+ static __wrap(ptr) {
+ const obj = Object.create(ProtocolVersion.prototype);
+ obj.ptr = ptr;
+ ProtocolVersionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolversion_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolversion_to_js_value(retptr, this.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.networkinfo_protocol_magic(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {number}
+ */
+ minor() {
+ const ret = wasm.protocolversion_minor(this.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);
+ }
+}
+const PublicKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_publickey_free(ptr));
+/**
+ * ED25519 key used as public key
+ */
+export class PublicKey {
+ static __wrap(ptr) {
+ const obj = Object.create(PublicKey.prototype);
+ obj.ptr = ptr;
+ PublicKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PublicKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_publickey_free(ptr);
+ }
+ /**
+ * 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);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_bech32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.publickey_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+ /**
+ * @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.ptr, ptr0, len0, signature.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ hash() {
+ const ret = wasm.publickey_hash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+}
+const PublicKeysFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_publickeys_free(ptr));
+/** */
+export class PublicKeys {
+ static __wrap(ptr) {
+ const obj = Object.create(PublicKeys.prototype);
+ obj.ptr = ptr;
+ PublicKeysFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PublicKeysFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_publickeys_free(ptr);
+ }
+ /** */
+ constructor() {
+ const ret = wasm.ed25519keyhashes_new();
+ return PublicKeys.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ size() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {PublicKey}
+ */
+ get(index) {
+ const ret = wasm.publickeys_get(this.ptr, index);
+ return PublicKey.__wrap(ret);
+ }
+ /**
+ * @param {PublicKey} key
+ */
+ add(key) {
+ _assertClass(key, PublicKey);
+ wasm.publickeys_add(this.ptr, key.ptr);
+ }
+}
+const RedeemerFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_redeemer_free(ptr));
+/** */
+export class Redeemer {
+ static __wrap(ptr) {
+ const obj = Object.create(Redeemer.prototype);
+ obj.ptr = ptr;
+ RedeemerFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {RedeemerTag}
+ */
+ tag() {
+ const ret = wasm.redeemer_tag(this.ptr);
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ index() {
+ const ret = wasm.constrplutusdata_alternative(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusData}
+ */
+ data() {
+ const ret = wasm.redeemer_data(this.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {ExUnits}
+ */
+ ex_units() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.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.ptr, index.ptr, data.ptr, ex_units.ptr);
+ return Redeemer.__wrap(ret);
+ }
+}
+const RedeemerTagFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_redeemertag_free(ptr));
+/** */
+export class RedeemerTag {
+ static __wrap(ptr) {
+ const obj = Object.create(RedeemerTag.prototype);
+ obj.ptr = ptr;
+ RedeemerTagFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {RedeemerTag}
+ */
+ static new_spend() {
+ const ret = wasm.language_new_plutus_v1();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_mint() {
+ const ret = wasm.language_new_plutus_v2();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_cert() {
+ const ret = wasm.language_new_plutus_v3();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_reward() {
+ const ret = wasm.redeemertag_new_reward();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_voting() {
+ const ret = wasm.redeemertag_new_voting();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_proposing() {
+ const ret = wasm.redeemertag_new_proposing();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.redeemertag_kind(this.ptr);
+ return ret >>> 0;
+ }
+}
+const RedeemerWitnessKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_redeemerwitnesskey_free(ptr));
+/** */
+export class RedeemerWitnessKey {
+ static __wrap(ptr) {
+ const obj = Object.create(RedeemerWitnessKey.prototype);
+ obj.ptr = ptr;
+ RedeemerWitnessKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RedeemerWitnessKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_redeemerwitnesskey_free(ptr);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ tag() {
+ const ret = wasm.redeemerwitnesskey_tag(this.ptr);
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ index() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {RedeemerTag} tag
+ * @param {BigNum} index
+ * @returns {RedeemerWitnessKey}
+ */
+ static new(tag, index) {
+ _assertClass(tag, RedeemerTag);
+ _assertClass(index, BigNum);
+ const ret = wasm.redeemerwitnesskey_new(tag.ptr, index.ptr);
+ return RedeemerWitnessKey.__wrap(ret);
+ }
+}
+const RedeemersFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_redeemers_free(ptr));
+/** */
+export class Redeemers {
+ static __wrap(ptr) {
+ const obj = Object.create(Redeemers.prototype);
+ obj.ptr = ptr;
+ RedeemersFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {Redeemers}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return Redeemers.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Redeemer}
+ */
+ get(index) {
+ const ret = wasm.redeemers_get(this.ptr, index);
+ return Redeemer.__wrap(ret);
+ }
+ /**
+ * @param {Redeemer} elem
+ */
+ add(elem) {
+ _assertClass(elem, Redeemer);
+ wasm.redeemers_add(this.ptr, elem.ptr);
+ }
+}
+const RegCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_regcert_free(ptr));
+/** */
+export class RegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(RegCert.prototype);
+ obj.ptr = ptr;
+ RegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RegCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_regcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegCert}
+ */
+ 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.regcert_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 RegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_js_value(retptr, this.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 {RegCert}
+ */
+ 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.regcert_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 RegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {BigNum} coin
+ * @returns {RegCert}
+ */
+ static new(stake_credential, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(coin, BigNum);
+ const ret = wasm.regcert_new(stake_credential.ptr, coin.ptr);
+ return RegCert.__wrap(ret);
+ }
+}
+const RegCommitteeHotKeyCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_regcommitteehotkeycert_free(ptr));
+/** */
+export class RegCommitteeHotKeyCert {
+ static __wrap(ptr) {
+ const obj = Object.create(RegCommitteeHotKeyCert.prototype);
+ obj.ptr = ptr;
+ RegCommitteeHotKeyCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RegCommitteeHotKeyCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_regcommitteehotkeycert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcommitteehotkeycert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegCommitteeHotKeyCert}
+ */
+ 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.regcommitteehotkeycert_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 RegCommitteeHotKeyCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcommitteehotkeycert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcommitteehotkeycert_to_js_value(retptr, this.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 {RegCommitteeHotKeyCert}
+ */
+ 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.regcommitteehotkeycert_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 RegCommitteeHotKeyCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_cold_keyhash() {
+ const ret = wasm.regcommitteehotkeycert_committee_cold_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_hot_keyhash() {
+ const ret = wasm.regcommitteehotkeycert_committee_hot_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} committee_cold_keyhash
+ * @param {Ed25519KeyHash} committee_hot_keyhash
+ * @returns {RegCommitteeHotKeyCert}
+ */
+ static new(committee_cold_keyhash, committee_hot_keyhash) {
+ _assertClass(committee_cold_keyhash, Ed25519KeyHash);
+ _assertClass(committee_hot_keyhash, Ed25519KeyHash);
+ const ret = wasm.regcommitteehotkeycert_new(committee_cold_keyhash.ptr, committee_hot_keyhash.ptr);
+ return RegCommitteeHotKeyCert.__wrap(ret);
+ }
+}
+const RegDrepCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_regdrepcert_free(ptr));
+/** */
+export class RegDrepCert {
+ static __wrap(ptr) {
+ const obj = Object.create(RegDrepCert.prototype);
+ obj.ptr = ptr;
+ RegDrepCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RegDrepCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_regdrepcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegDrepCert}
+ */
+ 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.regdrepcert_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 RegDrepCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_js_value(retptr, this.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 {RegDrepCert}
+ */
+ 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.regdrepcert_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 RegDrepCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ voting_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} voting_credential
+ * @param {BigNum} coin
+ * @returns {RegDrepCert}
+ */
+ static new(voting_credential, coin) {
+ _assertClass(voting_credential, StakeCredential);
+ _assertClass(coin, BigNum);
+ const ret = wasm.regcert_new(voting_credential.ptr, coin.ptr);
+ return RegDrepCert.__wrap(ret);
+ }
+}
+const RelayFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_relay_free(ptr));
+/** */
+export class Relay {
+ static __wrap(ptr) {
+ const obj = Object.create(Relay.prototype);
+ obj.ptr = ptr;
+ RelayFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.relay_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.relay_to_js_value(retptr, this.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.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.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.ptr);
+ return Relay.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.relay_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {SingleHostAddr | undefined}
+ */
+ as_single_host_addr() {
+ const ret = wasm.relay_as_single_host_addr(this.ptr);
+ return ret === 0 ? undefined : SingleHostAddr.__wrap(ret);
+ }
+ /**
+ * @returns {SingleHostName | undefined}
+ */
+ as_single_host_name() {
+ const ret = wasm.relay_as_single_host_name(this.ptr);
+ return ret === 0 ? undefined : SingleHostName.__wrap(ret);
+ }
+ /**
+ * @returns {MultiHostName | undefined}
+ */
+ as_multi_host_name() {
+ const ret = wasm.relay_as_multi_host_name(this.ptr);
+ return ret === 0 ? undefined : MultiHostName.__wrap(ret);
+ }
+}
+const RelaysFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_relays_free(ptr));
+/** */
+export class Relays {
+ static __wrap(ptr) {
+ const obj = Object.create(Relays.prototype);
+ obj.ptr = ptr;
+ RelaysFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.relays_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.relays_to_js_value(retptr, this.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.assetnames_new();
+ return Relays.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Relay}
+ */
+ get(index) {
+ const ret = wasm.relays_get(this.ptr, index);
+ return Relay.__wrap(ret);
+ }
+ /**
+ * @param {Relay} elem
+ */
+ add(elem) {
+ _assertClass(elem, Relay);
+ wasm.relays_add(this.ptr, elem.ptr);
+ }
+}
+const RequiredWitnessSetFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_requiredwitnessset_free(ptr));
+/** */
+export class RequiredWitnessSet {
+ static __wrap(ptr) {
+ const obj = Object.create(RequiredWitnessSet.prototype);
+ obj.ptr = ptr;
+ RequiredWitnessSetFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RequiredWitnessSetFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_requiredwitnessset_free(ptr);
+ }
+ /**
+ * @param {Vkeywitness} vkey
+ */
+ add_vkey(vkey) {
+ _assertClass(vkey, Vkeywitness);
+ wasm.requiredwitnessset_add_vkey(this.ptr, vkey.ptr);
+ }
+ /**
+ * @param {Vkey} vkey
+ */
+ add_vkey_key(vkey) {
+ _assertClass(vkey, Vkey);
+ wasm.requiredwitnessset_add_vkey_key(this.ptr, vkey.ptr);
+ }
+ /**
+ * @param {Ed25519KeyHash} hash
+ */
+ add_vkey_key_hash(hash) {
+ _assertClass(hash, Ed25519KeyHash);
+ wasm.requiredwitnessset_add_vkey_key_hash(this.ptr, hash.ptr);
+ }
+ /**
+ * @param {BootstrapWitness} bootstrap
+ */
+ add_bootstrap(bootstrap) {
+ _assertClass(bootstrap, BootstrapWitness);
+ wasm.requiredwitnessset_add_bootstrap(this.ptr, bootstrap.ptr);
+ }
+ /**
+ * @param {Vkey} bootstrap
+ */
+ add_bootstrap_key(bootstrap) {
+ _assertClass(bootstrap, Vkey);
+ wasm.requiredwitnessset_add_bootstrap_key(this.ptr, bootstrap.ptr);
+ }
+ /**
+ * @param {Ed25519KeyHash} hash
+ */
+ add_bootstrap_key_hash(hash) {
+ _assertClass(hash, Ed25519KeyHash);
+ wasm.requiredwitnessset_add_bootstrap_key_hash(this.ptr, hash.ptr);
+ }
+ /**
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script) {
+ _assertClass(native_script, NativeScript);
+ wasm.requiredwitnessset_add_native_script(this.ptr, native_script.ptr);
+ }
+ /**
+ * @param {ScriptHash} native_script
+ */
+ add_native_script_hash(native_script) {
+ _assertClass(native_script, ScriptHash);
+ wasm.requiredwitnessset_add_native_script_hash(this.ptr, native_script.ptr);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.requiredwitnessset_add_plutus_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.requiredwitnessset_add_plutus_v2_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * @param {ScriptHash} plutus_script
+ */
+ add_plutus_hash(plutus_script) {
+ _assertClass(plutus_script, ScriptHash);
+ wasm.requiredwitnessset_add_plutus_hash(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * @param {PlutusData} plutus_datum
+ */
+ add_plutus_datum(plutus_datum) {
+ _assertClass(plutus_datum, PlutusData);
+ wasm.requiredwitnessset_add_plutus_datum(this.ptr, plutus_datum.ptr);
+ }
+ /**
+ * @param {DataHash} plutus_datum
+ */
+ add_plutus_datum_hash(plutus_datum) {
+ _assertClass(plutus_datum, DataHash);
+ wasm.requiredwitnessset_add_plutus_datum_hash(this.ptr, plutus_datum.ptr);
+ }
+ /**
+ * @param {Redeemer} redeemer
+ */
+ add_redeemer(redeemer) {
+ _assertClass(redeemer, Redeemer);
+ wasm.requiredwitnessset_add_redeemer(this.ptr, redeemer.ptr);
+ }
+ /**
+ * @param {RedeemerWitnessKey} redeemer
+ */
+ add_redeemer_tag(redeemer) {
+ _assertClass(redeemer, RedeemerWitnessKey);
+ wasm.requiredwitnessset_add_redeemer_tag(this.ptr, redeemer.ptr);
+ }
+ /**
+ * @param {RequiredWitnessSet} requirements
+ */
+ add_all(requirements) {
+ _assertClass(requirements, RequiredWitnessSet);
+ wasm.requiredwitnessset_add_all(this.ptr, requirements.ptr);
+ }
+ /**
+ * @returns {RequiredWitnessSet}
+ */
+ static new() {
+ const ret = wasm.requiredwitnessset_new();
+ return RequiredWitnessSet.__wrap(ret);
+ }
+}
+const RewardAddressFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_rewardaddress_free(ptr));
+/** */
+export class RewardAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(RewardAddress.prototype);
+ obj.ptr = ptr;
+ RewardAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RewardAddressFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_rewardaddress_free(ptr);
+ }
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @returns {RewardAddress}
+ */
+ static new(network, payment) {
+ _assertClass(payment, StakeCredential);
+ const ret = wasm.enterpriseaddress_new(network, payment.ptr);
+ return RewardAddress.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Address}
+ */
+ to_address() {
+ const ret = wasm.rewardaddress_to_address(this.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {RewardAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_reward(addr.ptr);
+ return ret === 0 ? undefined : RewardAddress.__wrap(ret);
+ }
+}
+const RewardAddressesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_rewardaddresses_free(ptr));
+/** */
+export class RewardAddresses {
+ static __wrap(ptr) {
+ const obj = Object.create(RewardAddresses.prototype);
+ obj.ptr = ptr;
+ RewardAddressesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.rewardaddresses_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.rewardaddresses_to_js_value(retptr, this.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.ed25519keyhashes_new();
+ return RewardAddresses.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {RewardAddress}
+ */
+ get(index) {
+ const ret = wasm.rewardaddresses_get(this.ptr, index);
+ return RewardAddress.__wrap(ret);
+ }
+ /**
+ * @param {RewardAddress} elem
+ */
+ add(elem) {
+ _assertClass(elem, RewardAddress);
+ wasm.rewardaddresses_add(this.ptr, elem.ptr);
+ }
+}
+const ScriptFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_script_free(ptr));
+/** */
+export class Script {
+ static __wrap(ptr) {
+ const obj = Object.create(Script.prototype);
+ obj.ptr = ptr;
+ ScriptFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ScriptFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_script_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Script}
+ */
+ 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.script_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 Script.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_js_value(retptr, this.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 {Script}
+ */
+ 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.script_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 Script.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {NativeScript} native_script
+ * @returns {Script}
+ */
+ static new_native(native_script) {
+ _assertClass(native_script, NativeScript);
+ const ret = wasm.script_new_native(native_script.ptr);
+ return Script.__wrap(ret);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v1(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ const ret = wasm.script_new_plutus_v1(plutus_script.ptr);
+ return Script.__wrap(ret);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v2(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ const ret = wasm.script_new_plutus_v2(plutus_script.ptr);
+ return Script.__wrap(ret);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v3(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ const ret = wasm.script_new_plutus_v3(plutus_script.ptr);
+ return Script.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.script_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {NativeScript | undefined}
+ */
+ as_native() {
+ const ret = wasm.script_as_native(this.ptr);
+ return ret === 0 ? undefined : NativeScript.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v1() {
+ const ret = wasm.script_as_plutus_v1(this.ptr);
+ return ret === 0 ? undefined : PlutusScript.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v2() {
+ const ret = wasm.script_as_plutus_v2(this.ptr);
+ return ret === 0 ? undefined : PlutusScript.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v3() {
+ const ret = wasm.script_as_plutus_v3(this.ptr);
+ return ret === 0 ? undefined : PlutusScript.__wrap(ret);
+ }
+}
+const ScriptAllFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scriptall_free(ptr));
+/** */
+export class ScriptAll {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptAll.prototype);
+ obj.ptr = ptr;
+ ScriptAllFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptall_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptall_to_js_value(retptr, this.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.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.ptr);
+ return ScriptAll.__wrap(ret);
+ }
+}
+const ScriptAnyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scriptany_free(ptr));
+/** */
+export class ScriptAny {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptAny.prototype);
+ obj.ptr = ptr;
+ ScriptAnyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptall_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptall_to_js_value(retptr, this.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.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.ptr);
+ return ScriptAny.__wrap(ret);
+ }
+}
+const ScriptDataHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scriptdatahash_free(ptr));
+/** */
+export class ScriptDataHash {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptDataHash.prototype);
+ obj.ptr = ptr;
+ ScriptDataHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const ScriptHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scripthash_free(ptr));
+/** */
+export class ScriptHash {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptHash.prototype);
+ obj.ptr = ptr;
+ ScriptHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const ScriptHashesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scripthashes_free(ptr));
+/** */
+export class ScriptHashes {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptHashes.prototype);
+ obj.ptr = ptr;
+ ScriptHashesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_js_value(retptr, this.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.ed25519keyhashes_new();
+ return ScriptHashes.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {ScriptHash}
+ */
+ get(index) {
+ const ret = wasm.scripthashes_get(this.ptr, index);
+ return ScriptHash.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} elem
+ */
+ add(elem) {
+ _assertClass(elem, ScriptHash);
+ wasm.ed25519keyhashes_add(this.ptr, elem.ptr);
+ }
+}
+const ScriptNOfKFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scriptnofk_free(ptr));
+/** */
+export class ScriptNOfK {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptNOfK.prototype);
+ obj.ptr = ptr;
+ ScriptNOfKFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptnofk_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptnofk_to_js_value(retptr, this.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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {NativeScripts}
+ */
+ native_scripts() {
+ const ret = wasm.scriptall_native_scripts(this.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.ptr);
+ return ScriptNOfK.__wrap(ret);
+ }
+}
+const ScriptPubkeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scriptpubkey_free(ptr));
+/** */
+export class ScriptPubkey {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptPubkey.prototype);
+ obj.ptr = ptr;
+ ScriptPubkeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptpubkey_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptpubkey_to_js_value(retptr, this.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.regcommitteehotkeycert_committee_cold_keyhash(this.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.ptr);
+ return ScriptPubkey.__wrap(ret);
+ }
+}
+const ScriptRefFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scriptref_free(ptr));
+/** */
+export class ScriptRef {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptRef.prototype);
+ obj.ptr = ptr;
+ ScriptRefFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_js_value(retptr, this.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 {Script} script
+ * @returns {ScriptRef}
+ */
+ static new(script) {
+ _assertClass(script, Script);
+ const ret = wasm.scriptref_new(script.ptr);
+ return ScriptRef.__wrap(ret);
+ }
+ /**
+ * @returns {Script}
+ */
+ get() {
+ const ret = wasm.scriptref_get(this.ptr);
+ return Script.__wrap(ret);
+ }
+}
+const ScriptWitnessFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_scriptwitness_free(ptr));
+/** */
+export class ScriptWitness {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptWitness.prototype);
+ obj.ptr = ptr;
+ ScriptWitnessFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ScriptWitnessFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_scriptwitness_free(ptr);
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptwitness_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptwitness_to_js_value(retptr, this.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 {ScriptWitness}
+ */
+ 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.scriptwitness_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 ScriptWitness.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {NativeScript} native_script
+ * @returns {ScriptWitness}
+ */
+ static new_native_witness(native_script) {
+ _assertClass(native_script, NativeScript);
+ const ret = wasm.scriptwitness_new_native_witness(native_script.ptr);
+ return ScriptWitness.__wrap(ret);
+ }
+ /**
+ * @param {PlutusWitness} plutus_witness
+ * @returns {ScriptWitness}
+ */
+ static new_plutus_witness(plutus_witness) {
+ _assertClass(plutus_witness, PlutusWitness);
+ const ret = wasm.scriptwitness_new_plutus_witness(plutus_witness.ptr);
+ return ScriptWitness.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.scriptwitness_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {NativeScript | undefined}
+ */
+ as_native_witness() {
+ const ret = wasm.scriptwitness_as_native_witness(this.ptr);
+ return ret === 0 ? undefined : NativeScript.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusWitness | undefined}
+ */
+ as_plutus_witness() {
+ const ret = wasm.scriptwitness_as_plutus_witness(this.ptr);
+ return ret === 0 ? undefined : PlutusWitness.__wrap(ret);
+ }
+}
+const SingleHostAddrFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_singlehostaddr_free(ptr));
+/** */
+export class SingleHostAddr {
+ static __wrap(ptr) {
+ const obj = Object.create(SingleHostAddr.prototype);
+ obj.ptr = ptr;
+ SingleHostAddrFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.singlehostaddr_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.singlehostaddr_to_js_value(retptr, this.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.ptr);
+ return ret === 0xFFFFFF ? undefined : ret;
+ }
+ /**
+ * @returns {Ipv4 | undefined}
+ */
+ ipv4() {
+ const ret = wasm.singlehostaddr_ipv4(this.ptr);
+ return ret === 0 ? undefined : Ipv4.__wrap(ret);
+ }
+ /**
+ * @returns {Ipv6 | undefined}
+ */
+ ipv6() {
+ const ret = wasm.singlehostaddr_ipv6(this.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);
+ }
+}
+const SingleHostNameFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_singlehostname_free(ptr));
+/** */
+export class SingleHostName {
+ static __wrap(ptr) {
+ const obj = Object.create(SingleHostName.prototype);
+ obj.ptr = ptr;
+ SingleHostNameFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.singlehostname_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.singlehostname_to_js_value(retptr, this.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.ptr);
+ return ret === 0xFFFFFF ? undefined : ret;
+ }
+ /**
+ * @returns {DNSRecordAorAAAA}
+ */
+ dns_name() {
+ const ret = wasm.anchor_anchor_url(this.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.ptr);
+ return SingleHostName.__wrap(ret);
+ }
+}
+const StakeCredentialFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_stakecredential_free(ptr));
+/** */
+export class StakeCredential {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeCredential.prototype);
+ obj.ptr = ptr;
+ StakeCredentialFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeCredentialFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakecredential_free(ptr);
+ }
+ /**
+ * @param {Ed25519KeyHash} hash
+ * @returns {StakeCredential}
+ */
+ static from_keyhash(hash) {
+ _assertClass(hash, Ed25519KeyHash);
+ const ret = wasm.drep_new_keyhash(hash.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} hash
+ * @returns {StakeCredential}
+ */
+ static from_scripthash(hash) {
+ _assertClass(hash, ScriptHash);
+ const ret = wasm.drep_new_scripthash(hash.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ to_keyhash() {
+ const ret = wasm.stakecredential_to_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ to_scripthash() {
+ const ret = wasm.stakecredential_to_scripthash(this.ptr);
+ return ret === 0 ? undefined : ScriptHash.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.networkid_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredential_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeCredential}
+ */
+ 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.stakecredential_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 StakeCredential.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredential_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredential_to_js_value(retptr, this.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 {StakeCredential}
+ */
+ 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.stakecredential_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 StakeCredential.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const StakeCredentialsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_stakecredentials_free(ptr));
+/** */
+export class StakeCredentials {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeCredentials.prototype);
+ obj.ptr = ptr;
+ StakeCredentialsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeCredentialsFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakecredentials_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredentials_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeCredentials}
+ */
+ 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.stakecredentials_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 StakeCredentials.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredentials_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredentials_to_js_value(retptr, this.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 {StakeCredentials}
+ */
+ 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.stakecredentials_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 StakeCredentials.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredentials}
+ */
+ static new() {
+ const ret = wasm.ed25519keyhashes_new();
+ return StakeCredentials.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {StakeCredential}
+ */
+ get(index) {
+ const ret = wasm.stakecredentials_get(this.ptr, index);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} elem
+ */
+ add(elem) {
+ _assertClass(elem, StakeCredential);
+ wasm.stakecredentials_add(this.ptr, elem.ptr);
+ }
+}
+const StakeDelegationFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_stakedelegation_free(ptr));
+/** */
+export class StakeDelegation {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeDelegation.prototype);
+ obj.ptr = ptr;
+ StakeDelegationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakedelegation_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakedelegation_to_js_value(retptr, this.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 {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash() {
+ const ret = wasm.stakedelegation_pool_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @returns {StakeDelegation}
+ */
+ static new(stake_credential, pool_keyhash) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(pool_keyhash, Ed25519KeyHash);
+ const ret = wasm.stakedelegation_new(stake_credential.ptr, pool_keyhash.ptr);
+ return StakeDelegation.__wrap(ret);
+ }
+}
+const StakeDeregistrationFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_stakederegistration_free(ptr));
+/** */
+export class StakeDeregistration {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeDeregistration.prototype);
+ obj.ptr = ptr;
+ StakeDeregistrationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakederegistration_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakederegistration_to_js_value(retptr, this.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 {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @returns {StakeDeregistration}
+ */
+ static new(stake_credential) {
+ _assertClass(stake_credential, StakeCredential);
+ const ret = wasm.stakederegistration_new(stake_credential.ptr);
+ return StakeDeregistration.__wrap(ret);
+ }
+}
+const StakeRegDelegCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_stakeregdelegcert_free(ptr));
+/** */
+export class StakeRegDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeRegDelegCert.prototype);
+ obj.ptr = ptr;
+ StakeRegDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeRegDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakeregdelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakeregdelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeRegDelegCert}
+ */
+ 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.stakeregdelegcert_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 StakeRegDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakeregdelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakeregdelegcert_to_js_value(retptr, this.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 {StakeRegDelegCert}
+ */
+ 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.stakeregdelegcert_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 StakeRegDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.stakeregdelegcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash() {
+ const ret = wasm.stakeregdelegcert_pool_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {BigNum} coin
+ * @returns {StakeRegDelegCert}
+ */
+ static new(stake_credential, pool_keyhash, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(pool_keyhash, Ed25519KeyHash);
+ _assertClass(coin, BigNum);
+ const ret = wasm.stakeregdelegcert_new(stake_credential.ptr, pool_keyhash.ptr, coin.ptr);
+ return StakeRegDelegCert.__wrap(ret);
+ }
+}
+const StakeRegistrationFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_stakeregistration_free(ptr));
+/** */
+export class StakeRegistration {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeRegistration.prototype);
+ obj.ptr = ptr;
+ StakeRegistrationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakederegistration_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakederegistration_to_js_value(retptr, this.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 {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @returns {StakeRegistration}
+ */
+ static new(stake_credential) {
+ _assertClass(stake_credential, StakeCredential);
+ const ret = wasm.stakederegistration_new(stake_credential.ptr);
+ return StakeRegistration.__wrap(ret);
+ }
+}
+const StakeVoteDelegCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_stakevotedelegcert_free(ptr));
+/** */
+export class StakeVoteDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeVoteDelegCert.prototype);
+ obj.ptr = ptr;
+ StakeVoteDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeVoteDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakevotedelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevotedelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeVoteDelegCert}
+ */
+ 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.stakevotedelegcert_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 StakeVoteDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevotedelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevotedelegcert_to_js_value(retptr, this.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 {StakeVoteDelegCert}
+ */
+ 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.stakevotedelegcert_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 StakeVoteDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash() {
+ const ret = wasm.stakevotedelegcert_pool_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ drep() {
+ const ret = wasm.stakevotedelegcert_drep(this.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {Drep} drep
+ * @returns {StakeVoteDelegCert}
+ */
+ static new(stake_credential, pool_keyhash, drep) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(pool_keyhash, Ed25519KeyHash);
+ _assertClass(drep, Drep);
+ const ret = wasm.stakevotedelegcert_new(stake_credential.ptr, pool_keyhash.ptr, drep.ptr);
+ return StakeVoteDelegCert.__wrap(ret);
+ }
+}
+const StakeVoteRegDelegCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_stakevoteregdelegcert_free(ptr));
+/** */
+export class StakeVoteRegDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeVoteRegDelegCert.prototype);
+ obj.ptr = ptr;
+ StakeVoteRegDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeVoteRegDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakevoteregdelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevoteregdelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeVoteRegDelegCert}
+ */
+ 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.stakevoteregdelegcert_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 StakeVoteRegDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevoteregdelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevoteregdelegcert_to_js_value(retptr, this.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 {StakeVoteRegDelegCert}
+ */
+ 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.stakevoteregdelegcert_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 StakeVoteRegDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.stakevoteregdelegcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash() {
+ const ret = wasm.stakeregdelegcert_pool_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ drep() {
+ const ret = wasm.stakevoteregdelegcert_drep(this.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {Drep} drep
+ * @param {BigNum} coin
+ * @returns {StakeVoteRegDelegCert}
+ */
+ static new(stake_credential, pool_keyhash, drep, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(pool_keyhash, Ed25519KeyHash);
+ _assertClass(drep, Drep);
+ _assertClass(coin, BigNum);
+ const ret = wasm.stakevoteregdelegcert_new(stake_credential.ptr, pool_keyhash.ptr, drep.ptr, coin.ptr);
+ return StakeVoteRegDelegCert.__wrap(ret);
+ }
+}
+const StringsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_strings_free(ptr));
+/** */
+export class Strings {
+ static __wrap(ptr) {
+ const obj = Object.create(Strings.prototype);
+ obj.ptr = ptr;
+ StringsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.assetnames_new();
+ return Strings.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {string}
+ */
+ get(index) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.strings_get(retptr, this.ptr, index);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @param {string} elem
+ */
+ add(elem) {
+ const ptr0 = passStringToWasm0(elem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.strings_add(this.ptr, ptr0, len0);
+ }
+}
+const TimelockExpiryFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_timelockexpiry_free(ptr));
+/** */
+export class TimelockExpiry {
+ static __wrap(ptr) {
+ const obj = Object.create(TimelockExpiry.prototype);
+ obj.ptr = ptr;
+ TimelockExpiryFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.timelockexpiry_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.timelockexpiry_to_js_value(retptr, this.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 {BigNum}
+ */
+ slot() {
+ const ret = wasm.linearfee_constant(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} slot
+ * @returns {TimelockExpiry}
+ */
+ static new(slot) {
+ _assertClass(slot, BigNum);
+ const ret = wasm.exunits_mem(slot.ptr);
+ return TimelockExpiry.__wrap(ret);
+ }
+}
+const TimelockStartFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_timelockstart_free(ptr));
+/** */
+export class TimelockStart {
+ static __wrap(ptr) {
+ const obj = Object.create(TimelockStart.prototype);
+ obj.ptr = ptr;
+ TimelockStartFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.timelockexpiry_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.timelockexpiry_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @returns {BigNum}
+ */
+ slot() {
+ const ret = wasm.linearfee_constant(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} slot
+ * @returns {TimelockStart}
+ */
+ static new(slot) {
+ _assertClass(slot, BigNum);
+ const ret = wasm.exunits_mem(slot.ptr);
+ return TimelockStart.__wrap(ret);
+ }
+}
+const TransactionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transaction_free(ptr));
+/** */
+export class Transaction {
+ static __wrap(ptr) {
+ const obj = Object.create(Transaction.prototype);
+ obj.ptr = ptr;
+ TransactionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transaction_to_js_value(retptr, this.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.ptr);
+ return TransactionBody.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ witness_set() {
+ const ret = wasm.transaction_witness_set(this.ptr);
+ return TransactionWitnessSet.__wrap(ret);
+ }
+ /**
+ * @returns {boolean}
+ */
+ is_valid() {
+ const ret = wasm.transaction_is_valid(this.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {AuxiliaryData | undefined}
+ */
+ auxiliary_data() {
+ const ret = wasm.transaction_auxiliary_data(this.ptr);
+ return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
+ }
+ /**
+ * @param {boolean} valid
+ */
+ set_is_valid(valid) {
+ wasm.transaction_set_is_valid(this.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.ptr, witness_set.ptr, ptr0);
+ return Transaction.__wrap(ret);
+ }
+}
+const TransactionBodiesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionbodies_free(ptr));
+/** */
+export class TransactionBodies {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBodies.prototype);
+ obj.ptr = ptr;
+ TransactionBodiesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbodies_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbodies_to_js_value(retptr, this.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.certificates_new();
+ return TransactionBodies.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionBody}
+ */
+ get(index) {
+ const ret = wasm.transactionbodies_get(this.ptr, index);
+ return TransactionBody.__wrap(ret);
+ }
+ /**
+ * @param {TransactionBody} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionBody);
+ wasm.transactionbodies_add(this.ptr, elem.ptr);
+ }
+}
+const TransactionBodyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionbody_free(ptr));
+/** */
+export class TransactionBody {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBody.prototype);
+ obj.ptr = ptr;
+ TransactionBodyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbody_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbody_to_js_value(retptr, this.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.ptr);
+ return TransactionInputs.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionOutputs}
+ */
+ outputs() {
+ const ret = wasm.transactionbody_outputs(this.ptr);
+ return TransactionOutputs.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ fee() {
+ const ret = wasm.transactionbody_fee(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ ttl() {
+ const ret = wasm.transactionbody_ttl(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {Certificates} certs
+ */
+ set_certs(certs) {
+ _assertClass(certs, Certificates);
+ wasm.transactionbody_set_certs(this.ptr, certs.ptr);
+ }
+ /**
+ * @returns {Certificates | undefined}
+ */
+ certs() {
+ const ret = wasm.transactionbody_certs(this.ptr);
+ return ret === 0 ? undefined : Certificates.__wrap(ret);
+ }
+ /**
+ * @param {Withdrawals} withdrawals
+ */
+ set_withdrawals(withdrawals) {
+ _assertClass(withdrawals, Withdrawals);
+ wasm.transactionbody_set_withdrawals(this.ptr, withdrawals.ptr);
+ }
+ /**
+ * @returns {Withdrawals | undefined}
+ */
+ withdrawals() {
+ const ret = wasm.transactionbody_withdrawals(this.ptr);
+ return ret === 0 ? undefined : Withdrawals.__wrap(ret);
+ }
+ /**
+ * @param {Update} update
+ */
+ set_update(update) {
+ _assertClass(update, Update);
+ wasm.transactionbody_set_update(this.ptr, update.ptr);
+ }
+ /**
+ * @returns {Update | undefined}
+ */
+ update() {
+ const ret = wasm.transactionbody_update(this.ptr);
+ return ret === 0 ? undefined : Update.__wrap(ret);
+ }
+ /**
+ * @returns {VotingProcedures | undefined}
+ */
+ voting_procedures() {
+ const ret = wasm.transactionbody_voting_procedures(this.ptr);
+ return ret === 0 ? undefined : VotingProcedures.__wrap(ret);
+ }
+ /**
+ * @returns {ProposalProcedures | undefined}
+ */
+ proposal_procedures() {
+ const ret = wasm.transactionbody_proposal_procedures(this.ptr);
+ return ret === 0 ? undefined : ProposalProcedures.__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.ptr, auxiliary_data_hash.ptr);
+ }
+ /**
+ * @returns {AuxiliaryDataHash | undefined}
+ */
+ auxiliary_data_hash() {
+ const ret = wasm.transactionbody_auxiliary_data_hash(this.ptr);
+ return ret === 0 ? undefined : AuxiliaryDataHash.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} validity_start_interval
+ */
+ set_validity_start_interval(validity_start_interval) {
+ _assertClass(validity_start_interval, BigNum);
+ wasm.protocolparamupdate_set_minfee_b(this.ptr, validity_start_interval.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ validity_start_interval() {
+ const ret = wasm.protocolparamupdate_minfee_b(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {Mint} mint
+ */
+ set_mint(mint) {
+ _assertClass(mint, Mint);
+ wasm.transactionbody_set_mint(this.ptr, mint.ptr);
+ }
+ /**
+ * @returns {Mint | undefined}
+ */
+ mint() {
+ const ret = wasm.transactionbody_mint(this.ptr);
+ return ret === 0 ? undefined : Mint.__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.ptr, script_data_hash.ptr);
+ }
+ /**
+ * @returns {ScriptDataHash | undefined}
+ */
+ script_data_hash() {
+ const ret = wasm.transactionbody_script_data_hash(this.ptr);
+ return ret === 0 ? undefined : ScriptDataHash.__wrap(ret);
+ }
+ /**
+ * @param {TransactionInputs} collateral
+ */
+ set_collateral(collateral) {
+ _assertClass(collateral, TransactionInputs);
+ wasm.transactionbody_set_collateral(this.ptr, collateral.ptr);
+ }
+ /**
+ * @returns {TransactionInputs | undefined}
+ */
+ collateral() {
+ const ret = wasm.transactionbody_collateral(this.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.ptr, required_signers.ptr);
+ }
+ /**
+ * @returns {Ed25519KeyHashes | undefined}
+ */
+ required_signers() {
+ const ret = wasm.transactionbody_required_signers(this.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.ptr, network_id.ptr);
+ }
+ /**
+ * @returns {NetworkId | undefined}
+ */
+ network_id() {
+ const ret = wasm.transactionbody_network_id(this.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.ptr, collateral_return.ptr);
+ }
+ /**
+ * @returns {TransactionOutput | undefined}
+ */
+ collateral_return() {
+ const ret = wasm.transactionbody_collateral_return(this.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.ptr, total_collateral.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ total_collateral() {
+ const ret = wasm.protocolparamupdate_key_deposit(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {TransactionInputs} reference_inputs
+ */
+ set_reference_inputs(reference_inputs) {
+ _assertClass(reference_inputs, TransactionInputs);
+ wasm.transactionbody_set_reference_inputs(this.ptr, reference_inputs.ptr);
+ }
+ /**
+ * @returns {TransactionInputs | undefined}
+ */
+ reference_inputs() {
+ const ret = wasm.transactionbody_reference_inputs(this.ptr);
+ return ret === 0 ? undefined : TransactionInputs.__wrap(ret);
+ }
+ /**
+ * @param {VotingProcedures} voting_procedures
+ */
+ set_voting_procedures(voting_procedures) {
+ _assertClass(voting_procedures, VotingProcedures);
+ wasm.transactionbody_set_voting_procedures(this.ptr, voting_procedures.ptr);
+ }
+ /**
+ * @param {ProposalProcedures} proposal_procedures
+ */
+ set_proposal_procedures(proposal_procedures) {
+ _assertClass(proposal_procedures, ProposalProcedures);
+ wasm.transactionbody_set_proposal_procedures(this.ptr, proposal_procedures.ptr);
+ }
+ /**
+ * @param {TransactionInputs} inputs
+ * @param {TransactionOutputs} outputs
+ * @param {BigNum} fee
+ * @param {BigNum | undefined} ttl
+ * @returns {TransactionBody}
+ */
+ static new(inputs, outputs, fee, ttl) {
+ _assertClass(inputs, TransactionInputs);
+ _assertClass(outputs, TransactionOutputs);
+ _assertClass(fee, BigNum);
+ let ptr0 = 0;
+ if (!isLikeNone(ttl)) {
+ _assertClass(ttl, BigNum);
+ ptr0 = ttl.__destroy_into_raw();
+ }
+ const ret = wasm.transactionbody_new(inputs.ptr, outputs.ptr, fee.ptr, ptr0);
+ return TransactionBody.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ raw() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbody_raw(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const TransactionBuilderFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionbuilder_free(ptr));
+/** */
+export class TransactionBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.
+ * Adding a change output must be called after via TransactionBuilder::balance()
+ * inputs to cover the minimum fees. This does not, however, set the txbuilder's fee.
+ *
+ * change_address is required here in order to determine the min ada requirement precisely
+ * @param {TransactionUnspentOutputs} inputs
+ * @param {Address} change_address
+ * @param {Uint32Array} weights
+ */
+ add_inputs_from(inputs, change_address, weights) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(inputs, TransactionUnspentOutputs);
+ _assertClass(change_address, Address);
+ const ptr0 = passArray32ToWasm0(weights, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.transactionbuilder_add_inputs_from(retptr, this.ptr, inputs.ptr, change_address.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);
+ }
+ }
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_input(utxo, script_witness) {
+ _assertClass(utxo, TransactionUnspentOutput);
+ let ptr0 = 0;
+ if (!isLikeNone(script_witness)) {
+ _assertClass(script_witness, ScriptWitness);
+ ptr0 = script_witness.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_add_input(this.ptr, utxo.ptr, ptr0);
+ }
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ */
+ add_reference_input(utxo) {
+ _assertClass(utxo, TransactionUnspentOutput);
+ wasm.transactionbuilder_add_reference_input(this.ptr, utxo.ptr);
+ }
+ /**
+ * 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.ptr, address.ptr, input.ptr, amount.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.ptr, output.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 plutus scripts via a PlutusScripts object
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.transactionbuilder_add_plutus_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * Add plutus v2 scripts via a PlutusScripts object
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.transactionbuilder_add_plutus_v2_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * Add plutus data via a PlutusData object
+ * @param {PlutusData} plutus_data
+ */
+ add_plutus_data(plutus_data) {
+ _assertClass(plutus_data, PlutusData);
+ wasm.transactionbuilder_add_plutus_data(this.ptr, plutus_data.ptr);
+ }
+ /**
+ * Add native scripts via a NativeScripts object
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script) {
+ _assertClass(native_script, NativeScript);
+ wasm.transactionbuilder_add_native_script(this.ptr, native_script.ptr);
+ }
+ /**
+ * Add certificate via a Certificates object
+ * @param {Certificate} certificate
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_certificate(certificate, script_witness) {
+ _assertClass(certificate, Certificate);
+ let ptr0 = 0;
+ if (!isLikeNone(script_witness)) {
+ _assertClass(script_witness, ScriptWitness);
+ ptr0 = script_witness.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_add_certificate(this.ptr, certificate.ptr, ptr0);
+ }
+ /**
+ * 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.ptr, output.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} ttl
+ */
+ set_ttl(ttl) {
+ _assertClass(ttl, BigNum);
+ wasm.protocolparamupdate_set_minfee_b(this.ptr, ttl.ptr);
+ }
+ /**
+ * @param {BigNum} validity_start_interval
+ */
+ set_validity_start_interval(validity_start_interval) {
+ _assertClass(validity_start_interval, BigNum);
+ wasm.protocolparamupdate_set_key_deposit(this.ptr, validity_start_interval.ptr);
+ }
+ /**
+ * @param {RewardAddress} reward_address
+ * @param {BigNum} coin
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_withdrawal(reward_address, coin, script_witness) {
+ _assertClass(reward_address, RewardAddress);
+ _assertClass(coin, BigNum);
+ let ptr0 = 0;
+ if (!isLikeNone(script_witness)) {
+ _assertClass(script_witness, ScriptWitness);
+ ptr0 = script_witness.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_add_withdrawal(this.ptr, reward_address.ptr, coin.ptr, ptr0);
+ }
+ /**
+ * @returns {AuxiliaryData | undefined}
+ */
+ auxiliary_data() {
+ const ret = wasm.transactionbuilder_auxiliary_data(this.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.ptr, auxiliary_data.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.ptr, metadata.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.ptr, key.ptr, val.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.ptr, key.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 {number} 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.ptr, key.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);
+ }
+ }
+ /**
+ * Returns a copy of the current mint state in the builder
+ * @returns {Mint | undefined}
+ */
+ mint() {
+ const ret = wasm.transactionbuilder_mint(this.ptr);
+ return ret === 0 ? undefined : Mint.__wrap(ret);
+ }
+ /**
+ * @returns {Certificates | undefined}
+ */
+ certificates() {
+ const ret = wasm.transactionbuilder_certificates(this.ptr);
+ return ret === 0 ? undefined : Certificates.__wrap(ret);
+ }
+ /**
+ * @returns {Withdrawals | undefined}
+ */
+ withdrawals() {
+ const ret = wasm.transactionbuilder_withdrawals(this.ptr);
+ return ret === 0 ? undefined : Withdrawals.__wrap(ret);
+ }
+ /**
+ * Returns a copy of the current witness native scripts in the builder
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts() {
+ const ret = wasm.transactionbuilder_native_scripts(this.ptr);
+ return ret === 0 ? undefined : NativeScripts.__wrap(ret);
+ }
+ /**
+ * 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 securely add assets to an existing PolicyID
+ * But it will replace/overwrite any existing mint assets with the same PolicyID
+ * first redeemer applied to a PolicyID is taken for all further assets added to the same PolicyID
+ * @param {ScriptHash} policy_id
+ * @param {MintAssets} mint_assets
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_mint(policy_id, mint_assets, script_witness) {
+ _assertClass(policy_id, ScriptHash);
+ _assertClass(mint_assets, MintAssets);
+ let ptr0 = 0;
+ if (!isLikeNone(script_witness)) {
+ _assertClass(script_witness, ScriptWitness);
+ ptr0 = script_witness.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_add_mint(this.ptr, policy_id.ptr, mint_assets.ptr, ptr0);
+ }
+ /**
+ * @param {TransactionBuilderConfig} cfg
+ * @returns {TransactionBuilder}
+ */
+ static new(cfg) {
+ _assertClass(cfg, TransactionBuilderConfig);
+ const ret = wasm.transactionbuilder_new(cfg.ptr);
+ return TransactionBuilder.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptDataHash | undefined}
+ */
+ script_data_hash() {
+ const ret = wasm.transactionbuilder_script_data_hash(this.ptr);
+ return ret === 0 ? undefined : ScriptDataHash.__wrap(ret);
+ }
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ */
+ add_collateral(utxo) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(utxo, TransactionUnspentOutput);
+ wasm.transactionbuilder_add_collateral(retptr, this.ptr, utxo.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 | undefined}
+ */
+ get_collateral() {
+ const ret = wasm.transactionbuilder_get_collateral(this.ptr);
+ return ret === 0 ? undefined : TransactionInputs.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} required_signer
+ */
+ add_required_signer(required_signer) {
+ _assertClass(required_signer, Ed25519KeyHash);
+ wasm.transactionbuilder_add_required_signer(this.ptr, required_signer.ptr);
+ }
+ /**
+ * @returns {Ed25519KeyHashes | undefined}
+ */
+ required_signers() {
+ const ret = wasm.transactionbuilder_required_signers(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @param {NetworkId} network_id
+ */
+ set_network_id(network_id) {
+ _assertClass(network_id, NetworkId);
+ var ptr0 = network_id.__destroy_into_raw();
+ wasm.transactionbuilder_set_network_id(this.ptr, ptr0);
+ }
+ /**
+ * @returns {NetworkId | undefined}
+ */
+ network_id() {
+ const ret = wasm.transactionbuilder_network_id(this.ptr);
+ return ret === 0 ? undefined : NetworkId.__wrap(ret);
+ }
+ /**
+ * @returns {Redeemers | undefined}
+ */
+ redeemers() {
+ const ret = wasm.transactionbuilder_redeemers(this.ptr);
+ return ret === 0 ? undefined : Redeemers.__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.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.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.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 implicit output plus burn (does not consider fee directly)
+ * @returns {Value}
+ */
+ get_total_output() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilder_get_total_output(retptr, this.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.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.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.protocolparamupdate_minfee_a(this.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} change_address
+ * @param {Datum | undefined} datum
+ */
+ balance(change_address, datum) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(change_address, Address);
+ let ptr0 = 0;
+ if (!isLikeNone(datum)) {
+ _assertClass(datum, Datum);
+ ptr0 = datum.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_balance(retptr, this.ptr, change_address.ptr, ptr0);
+ 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 the TransactionBody.
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilder_to_bytes(retptr, this.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 v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {number}
+ */
+ full_size() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilder_full_size(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU32FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 4);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {TransactionOutputs}
+ */
+ outputs() {
+ const ret = wasm.transactionbuilder_outputs(this.ptr);
+ return TransactionOutputs.__wrap(ret);
+ }
+ /**
+ * 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
+ *
+ * takes fetched ex units into consideration
+ *
+ * add collateral utxos and collateral change receiver in case you redeem from plutus script utxos
+ *
+ * async call
+ *
+ * NOTE: is_valid set to true
+ * @param {TransactionUnspentOutputs | undefined} collateral_utxos
+ * @param {Address | undefined} collateral_change_address
+ * @param {boolean | undefined} native_uplc
+ * @returns {Promise}
+ */
+ construct(collateral_utxos, collateral_change_address, native_uplc) {
+ const ptr = this.__destroy_into_raw();
+ let ptr0 = 0;
+ if (!isLikeNone(collateral_utxos)) {
+ _assertClass(collateral_utxos, TransactionUnspentOutputs);
+ ptr0 = collateral_utxos.__destroy_into_raw();
+ }
+ let ptr1 = 0;
+ if (!isLikeNone(collateral_change_address)) {
+ _assertClass(collateral_change_address, Address);
+ ptr1 = collateral_change_address.__destroy_into_raw();
+ }
+ const ret = wasm.transactionbuilder_construct(ptr, ptr0, ptr1, isLikeNone(native_uplc) ? 0xFFFFFF : native_uplc ? 1 : 0);
+ return takeObject(ret);
+ }
+ /**
+ * 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
+ * @returns {Transaction}
+ */
+ build_tx() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilder_build_tx(retptr, this.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.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);
+ }
+ }
+}
+const TransactionBuilderConfigFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionbuilderconfig_free(ptr));
+/** */
+export class TransactionBuilderConfig {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBuilderConfig.prototype);
+ obj.ptr = ptr;
+ TransactionBuilderConfigFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TransactionBuilderConfigFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_transactionbuilderconfig_free(ptr);
+ }
+}
+const TransactionBuilderConfigBuilderFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionbuilderconfigbuilder_free(ptr));
+/** */
+export class TransactionBuilderConfigBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBuilderConfigBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionBuilderConfigBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr, fee_algo.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.ptr, coins_per_utxo_byte.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.ptr, pool_deposit.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.ptr, key_deposit.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.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.ptr, max_tx_size);
+ 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.ptr, ex_unit_prices.ptr);
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {ExUnits} max_tx_ex_units
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ max_tx_ex_units(max_tx_ex_units) {
+ _assertClass(max_tx_ex_units, ExUnits);
+ const ret = wasm.transactionbuilderconfigbuilder_max_tx_ex_units(this.ptr, max_tx_ex_units.ptr);
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {Costmdls} costmdls
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ costmdls(costmdls) {
+ _assertClass(costmdls, Costmdls);
+ const ret = wasm.transactionbuilderconfigbuilder_costmdls(this.ptr, costmdls.ptr);
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {number} collateral_percentage
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ collateral_percentage(collateral_percentage) {
+ const ret = wasm.transactionbuilderconfigbuilder_collateral_percentage(this.ptr, collateral_percentage);
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {number} max_collateral_inputs
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ max_collateral_inputs(max_collateral_inputs) {
+ const ret = wasm.transactionbuilderconfigbuilder_max_collateral_inputs(this.ptr, max_collateral_inputs);
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {UnitInterval} minfee_refscript_cost_per_byte
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ minfee_refscript_cost_per_byte(minfee_refscript_cost_per_byte) {
+ _assertClass(minfee_refscript_cost_per_byte, UnitInterval);
+ const ret = wasm
+ .transactionbuilderconfigbuilder_minfee_refscript_cost_per_byte(this.ptr, minfee_refscript_cost_per_byte.ptr);
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} zero_time
+ * @param {BigNum} zero_slot
+ * @param {number} slot_length
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ slot_config(zero_time, zero_slot, slot_length) {
+ _assertClass(zero_time, BigNum);
+ _assertClass(zero_slot, BigNum);
+ const ret = wasm.transactionbuilderconfigbuilder_slot_config(this.ptr, zero_time.ptr, zero_slot.ptr, slot_length);
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {Blockfrost} blockfrost
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ blockfrost(blockfrost) {
+ _assertClass(blockfrost, Blockfrost);
+ const ret = wasm.transactionbuilderconfigbuilder_blockfrost(this.ptr, blockfrost.ptr);
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionBuilderConfig}
+ */
+ build() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilderconfigbuilder_build(retptr, this.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);
+ }
+ }
+}
+const TransactionHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionhash_free(ptr));
+/** */
+export class TransactionHash {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionHash.prototype);
+ obj.ptr = ptr;
+ TransactionHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const TransactionIndexesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionindexes_free(ptr));
+/** */
+export class TransactionIndexes {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionIndexes.prototype);
+ obj.ptr = ptr;
+ TransactionIndexesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TransactionIndexesFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_transactionindexes_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionindexes_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionIndexes}
+ */
+ 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.transactionindexes_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 TransactionIndexes.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {TransactionIndexes}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return TransactionIndexes.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {BigNum}
+ */
+ get(index) {
+ const ret = wasm.transactionindexes_get(this.ptr, index);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} elem
+ */
+ add(elem) {
+ _assertClass(elem, BigNum);
+ wasm.transactionindexes_add(this.ptr, elem.ptr);
+ }
+}
+const TransactionInputFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactioninput_free(ptr));
+/** */
+export class TransactionInput {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionInput.prototype);
+ obj.ptr = ptr;
+ TransactionInputFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactioninput_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactioninput_to_js_value(retptr, this.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.governanceactionid_transaction_id(this.ptr);
+ return TransactionHash.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ index() {
+ const ret = wasm.governanceactionid_governance_action_index(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {TransactionHash} transaction_id
+ * @param {BigNum} index
+ * @returns {TransactionInput}
+ */
+ static new(transaction_id, index) {
+ _assertClass(transaction_id, TransactionHash);
+ _assertClass(index, BigNum);
+ const ret = wasm.governanceactionid_new(transaction_id.ptr, index.ptr);
+ return TransactionInput.__wrap(ret);
+ }
+}
+const TransactionInputsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactioninputs_free(ptr));
+/** */
+export class TransactionInputs {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionInputs.prototype);
+ obj.ptr = ptr;
+ TransactionInputsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactioninputs_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactioninputs_to_js_value(retptr, this.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.certificates_new();
+ return TransactionInputs.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionInput}
+ */
+ get(index) {
+ const ret = wasm.transactioninputs_get(this.ptr, index);
+ return TransactionInput.__wrap(ret);
+ }
+ /**
+ * @param {TransactionInput} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionInput);
+ wasm.transactioninputs_add(this.ptr, elem.ptr);
+ }
+ /** */
+ sort() {
+ wasm.transactioninputs_sort(this.ptr);
+ }
+}
+const TransactionMetadatumFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionmetadatum_free(ptr));
+/** */
+export class TransactionMetadatum {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionMetadatum.prototype);
+ obj.ptr = ptr;
+ TransactionMetadatumFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @param {MetadataMap} map
+ * @returns {TransactionMetadatum}
+ */
+ static new_map(map) {
+ _assertClass(map, MetadataMap);
+ const ret = wasm.transactionmetadatum_new_map(map.ptr);
+ return TransactionMetadatum.__wrap(ret);
+ }
+ /**
+ * @param {MetadataList} list
+ * @returns {TransactionMetadatum}
+ */
+ static new_list(list) {
+ _assertClass(list, MetadataList);
+ const ret = wasm.transactionmetadatum_new_list(list.ptr);
+ return TransactionMetadatum.__wrap(ret);
+ }
+ /**
+ * @param {Int} int
+ * @returns {TransactionMetadatum}
+ */
+ static new_int(int) {
+ _assertClass(int, Int);
+ const ret = wasm.transactionmetadatum_new_int(int.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 {number}
+ */
+ kind() {
+ const ret = wasm.transactionmetadatum_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {MetadataMap}
+ */
+ as_map() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionmetadatum_as_map(retptr, this.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.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.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.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 v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ as_text() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionmetadatum_as_text(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+}
+const TransactionMetadatumLabelsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionmetadatumlabels_free(ptr));
+/** */
+export class TransactionMetadatumLabels {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionMetadatumLabels.prototype);
+ obj.ptr = ptr;
+ TransactionMetadatumLabelsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {TransactionMetadatumLabels}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return TransactionMetadatumLabels.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {BigNum}
+ */
+ get(index) {
+ const ret = wasm.transactionmetadatumlabels_get(this.ptr, index);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} elem
+ */
+ add(elem) {
+ _assertClass(elem, BigNum);
+ wasm.transactionindexes_add(this.ptr, elem.ptr);
+ }
+}
+const TransactionOutputFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionoutput_free(ptr));
+/** */
+export class TransactionOutput {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionOutput.prototype);
+ obj.ptr = ptr;
+ TransactionOutputFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutput_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutput_to_js_value(retptr, this.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.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @returns {Value}
+ */
+ amount() {
+ const ret = wasm.transactionoutput_amount(this.ptr);
+ return Value.__wrap(ret);
+ }
+ /**
+ * @returns {Datum | undefined}
+ */
+ datum() {
+ const ret = wasm.transactionoutput_datum(this.ptr);
+ return ret === 0 ? undefined : Datum.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptRef | undefined}
+ */
+ script_ref() {
+ const ret = wasm.transactionoutput_script_ref(this.ptr);
+ return ret === 0 ? undefined : ScriptRef.__wrap(ret);
+ }
+ /**
+ * @param {Datum} datum
+ */
+ set_datum(datum) {
+ _assertClass(datum, Datum);
+ wasm.transactionoutput_set_datum(this.ptr, datum.ptr);
+ }
+ /**
+ * @param {ScriptRef} script_ref
+ */
+ set_script_ref(script_ref) {
+ _assertClass(script_ref, ScriptRef);
+ wasm.transactionoutput_set_script_ref(this.ptr, script_ref.ptr);
+ }
+ /**
+ * @param {Address} address
+ * @param {Value} amount
+ * @returns {TransactionOutput}
+ */
+ static new(address, amount) {
+ _assertClass(address, Address);
+ _assertClass(amount, Value);
+ const ret = wasm.transactionoutput_new(address.ptr, amount.ptr);
+ return TransactionOutput.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ format() {
+ const ret = wasm.transactionoutput_format(this.ptr);
+ return ret;
+ }
+ /**
+ * legacy support: serialize output as array array
+ *
+ * does not support inline datum and script_ref!
+ * @returns {Uint8Array}
+ */
+ to_legacy_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutput_to_legacy_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const TransactionOutputAmountBuilderFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionoutputamountbuilder_free(ptr));
+/** */
+export class TransactionOutputAmountBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionOutputAmountBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionOutputAmountBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr, amount.ptr);
+ return TransactionOutputAmountBuilder.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} coin
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ with_coin(coin) {
+ _assertClass(coin, BigNum);
+ const ret = wasm.transactionoutputamountbuilder_with_coin(this.ptr, coin.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.ptr, coin.ptr, multiasset.ptr);
+ return TransactionOutputAmountBuilder.__wrap(ret);
+ }
+ /**
+ * @param {MultiAsset} multiasset
+ * @param {BigNum} coins_per_utxo_word
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ with_asset_and_min_required_coin(multiasset, coins_per_utxo_word) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(multiasset, MultiAsset);
+ _assertClass(coins_per_utxo_word, BigNum);
+ wasm.transactionoutputamountbuilder_with_asset_and_min_required_coin(retptr, this.ptr, multiasset.ptr, coins_per_utxo_word.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.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);
+ }
+ }
+}
+const TransactionOutputBuilderFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionoutputbuilder_free(ptr));
+/**
+ * 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
+ */
+export class TransactionOutputBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionOutputBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionOutputBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr, address.ptr);
+ return TransactionOutputBuilder.__wrap(ret);
+ }
+ /**
+ * @param {Datum} data_hash
+ * @returns {TransactionOutputBuilder}
+ */
+ with_datum(data_hash) {
+ _assertClass(data_hash, Datum);
+ const ret = wasm.transactionoutputbuilder_with_datum(this.ptr, data_hash.ptr);
+ return TransactionOutputBuilder.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ next() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutputbuilder_next(retptr, this.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);
+ }
+ }
+}
+const TransactionOutputsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionoutputs_free(ptr));
+/** */
+export class TransactionOutputs {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionOutputs.prototype);
+ obj.ptr = ptr;
+ TransactionOutputsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutputs_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutputs_to_js_value(retptr, this.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.certificates_new();
+ return TransactionOutputs.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionOutput}
+ */
+ get(index) {
+ const ret = wasm.transactionoutputs_get(this.ptr, index);
+ return TransactionOutput.__wrap(ret);
+ }
+ /**
+ * @param {TransactionOutput} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionOutput);
+ wasm.transactionoutputs_add(this.ptr, elem.ptr);
+ }
+}
+const TransactionUnspentOutputFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionunspentoutput_free(ptr));
+/** */
+export class TransactionUnspentOutput {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionUnspentOutput.prototype);
+ obj.ptr = ptr;
+ TransactionUnspentOutputFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @param {TransactionInput} input
+ * @param {TransactionOutput} output
+ * @returns {TransactionUnspentOutput}
+ */
+ static new(input, output) {
+ _assertClass(input, TransactionInput);
+ _assertClass(output, TransactionOutput);
+ const ret = wasm.transactionunspentoutput_new(input.ptr, output.ptr);
+ return TransactionUnspentOutput.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionInput}
+ */
+ input() {
+ const ret = wasm.transactionunspentoutput_input(this.ptr);
+ return TransactionInput.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionOutput}
+ */
+ output() {
+ const ret = wasm.transactionunspentoutput_output(this.ptr);
+ return TransactionOutput.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_legacy_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionunspentoutput_to_legacy_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const TransactionUnspentOutputsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionunspentoutputs_free(ptr));
+/** */
+export class TransactionUnspentOutputs {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionUnspentOutputs.prototype);
+ obj.ptr = ptr;
+ TransactionUnspentOutputsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TransactionUnspentOutputsFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_transactionunspentoutputs_free(ptr);
+ }
+ /**
+ * @returns {TransactionUnspentOutputs}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return TransactionUnspentOutputs.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionUnspentOutput}
+ */
+ get(index) {
+ const ret = wasm.transactionunspentoutputs_get(this.ptr, index);
+ return TransactionUnspentOutput.__wrap(ret);
+ }
+ /**
+ * @param {TransactionUnspentOutput} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionUnspentOutput);
+ wasm.transactionunspentoutputs_add(this.ptr, elem.ptr);
+ }
+}
+const TransactionWitnessSetFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionwitnessset_free(ptr));
+/** */
+export class TransactionWitnessSet {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionWitnessSet.prototype);
+ obj.ptr = ptr;
+ TransactionWitnessSetFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnessset_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnessset_to_js_value(retptr, this.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.ptr, vkeys.ptr);
+ }
+ /**
+ * @returns {Vkeywitnesses | undefined}
+ */
+ vkeys() {
+ const ret = wasm.transactionwitnessset_vkeys(this.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.ptr, native_scripts.ptr);
+ }
+ /**
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts() {
+ const ret = wasm.transactionwitnessset_native_scripts(this.ptr);
+ return ret === 0 ? undefined : NativeScripts.__wrap(ret);
+ }
+ /**
+ * @param {BootstrapWitnesses} bootstraps
+ */
+ set_bootstraps(bootstraps) {
+ _assertClass(bootstraps, BootstrapWitnesses);
+ wasm.transactionwitnessset_set_bootstraps(this.ptr, bootstraps.ptr);
+ }
+ /**
+ * @returns {BootstrapWitnesses | undefined}
+ */
+ bootstraps() {
+ const ret = wasm.transactionwitnessset_bootstraps(this.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.ptr, plutus_scripts.ptr);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_scripts() {
+ const ret = wasm.transactionwitnessset_plutus_scripts(this.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.ptr, plutus_data.ptr);
+ }
+ /**
+ * @returns {PlutusList | undefined}
+ */
+ plutus_data() {
+ const ret = wasm.transactionwitnessset_plutus_data(this.ptr);
+ return ret === 0 ? undefined : PlutusList.__wrap(ret);
+ }
+ /**
+ * @param {Redeemers} redeemers
+ */
+ set_redeemers(redeemers) {
+ _assertClass(redeemers, Redeemers);
+ wasm.transactionwitnessset_set_redeemers(this.ptr, redeemers.ptr);
+ }
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v2_scripts(plutus_scripts) {
+ _assertClass(plutus_scripts, PlutusScripts);
+ wasm.transactionwitnessset_set_plutus_v2_scripts(this.ptr, plutus_scripts.ptr);
+ }
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v3_scripts(plutus_scripts) {
+ _assertClass(plutus_scripts, PlutusScripts);
+ wasm.transactionwitnessset_set_plutus_v3_scripts(this.ptr, plutus_scripts.ptr);
+ }
+ /**
+ * @returns {Redeemers | undefined}
+ */
+ redeemers() {
+ const ret = wasm.transactionwitnessset_redeemers(this.ptr);
+ return ret === 0 ? undefined : Redeemers.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v2_scripts() {
+ const ret = wasm.transactionwitnessset_plutus_v2_scripts(this.ptr);
+ return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v3_scripts() {
+ const ret = wasm.transactionwitnessset_plutus_v3_scripts(this.ptr);
+ return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ static new() {
+ const ret = wasm.transactionwitnessset_new();
+ return TransactionWitnessSet.__wrap(ret);
+ }
+}
+const TransactionWitnessSetBuilderFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionwitnesssetbuilder_free(ptr));
+/**
+ * Builder de-duplicates witnesses as they are added
+ */
+export class TransactionWitnessSetBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionWitnessSetBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionWitnessSetBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TransactionWitnessSetBuilderFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_transactionwitnesssetbuilder_free(ptr);
+ }
+ /**
+ * @param {Vkeywitness} vkey
+ */
+ add_vkey(vkey) {
+ _assertClass(vkey, Vkeywitness);
+ wasm.transactionwitnesssetbuilder_add_vkey(this.ptr, vkey.ptr);
+ }
+ /**
+ * @param {BootstrapWitness} bootstrap
+ */
+ add_bootstrap(bootstrap) {
+ _assertClass(bootstrap, BootstrapWitness);
+ wasm.transactionwitnesssetbuilder_add_bootstrap(this.ptr, bootstrap.ptr);
+ }
+ /**
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script) {
+ _assertClass(native_script, NativeScript);
+ wasm.transactionwitnesssetbuilder_add_native_script(this.ptr, native_script.ptr);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.transactionwitnesssetbuilder_add_plutus_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.transactionwitnesssetbuilder_add_plutus_v2_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * @param {PlutusData} plutus_datum
+ */
+ add_plutus_datum(plutus_datum) {
+ _assertClass(plutus_datum, PlutusData);
+ wasm.transactionwitnesssetbuilder_add_plutus_datum(this.ptr, plutus_datum.ptr);
+ }
+ /**
+ * @param {Redeemer} redeemer
+ */
+ add_redeemer(redeemer) {
+ _assertClass(redeemer, Redeemer);
+ wasm.transactionwitnesssetbuilder_add_redeemer(this.ptr, redeemer.ptr);
+ }
+ /**
+ * @param {RequiredWitnessSet} required_wits
+ */
+ add_required_wits(required_wits) {
+ _assertClass(required_wits, RequiredWitnessSet);
+ wasm.transactionwitnesssetbuilder_add_required_wits(this.ptr, required_wits.ptr);
+ }
+ /**
+ * @returns {TransactionWitnessSetBuilder}
+ */
+ static new() {
+ const ret = wasm.transactionwitnesssetbuilder_new();
+ return TransactionWitnessSetBuilder.__wrap(ret);
+ }
+ /**
+ * @param {TransactionWitnessSet} wit_set
+ */
+ add_existing(wit_set) {
+ _assertClass(wit_set, TransactionWitnessSet);
+ wasm.transactionwitnesssetbuilder_add_existing(this.ptr, wit_set.ptr);
+ }
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ build() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnesssetbuilder_build(retptr, this.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 TransactionWitnessSet.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const TransactionWitnessSetsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_transactionwitnesssets_free(ptr));
+/** */
+export class TransactionWitnessSets {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionWitnessSets.prototype);
+ obj.ptr = ptr;
+ TransactionWitnessSetsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnesssets_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnesssets_to_js_value(retptr, this.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.assetnames_new();
+ return TransactionWitnessSets.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionWitnessSet}
+ */
+ get(index) {
+ const ret = wasm.transactionwitnesssets_get(this.ptr, index);
+ return TransactionWitnessSet.__wrap(ret);
+ }
+ /**
+ * @param {TransactionWitnessSet} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionWitnessSet);
+ wasm.transactionwitnesssets_add(this.ptr, elem.ptr);
+ }
+}
+const TreasuryWithdrawalsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_treasurywithdrawals_free(ptr));
+/** */
+export class TreasuryWithdrawals {
+ static __wrap(ptr) {
+ const obj = Object.create(TreasuryWithdrawals.prototype);
+ obj.ptr = ptr;
+ TreasuryWithdrawalsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TreasuryWithdrawalsFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_treasurywithdrawals_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawals_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TreasuryWithdrawals}
+ */
+ 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.treasurywithdrawals_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 TreasuryWithdrawals.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawals_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawals_to_js_value(retptr, this.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.assets_new();
+ return TreasuryWithdrawals.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {Ed25519KeyHash} key
+ * @param {BigNum} value
+ * @returns {BigNum | undefined}
+ */
+ insert(key, value) {
+ _assertClass(key, Ed25519KeyHash);
+ _assertClass(value, BigNum);
+ const ret = wasm.treasurywithdrawals_insert(this.ptr, key.ptr, value.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} key
+ * @returns {BigNum | undefined}
+ */
+ get(key) {
+ _assertClass(key, Ed25519KeyHash);
+ const ret = wasm.treasurywithdrawals_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ keys() {
+ const ret = wasm.treasurywithdrawals_keys(this.ptr);
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+}
+const TreasuryWithdrawalsActionFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_treasurywithdrawalsaction_free(ptr));
+/** */
+export class TreasuryWithdrawalsAction {
+ static __wrap(ptr) {
+ const obj = Object.create(TreasuryWithdrawalsAction.prototype);
+ obj.ptr = ptr;
+ TreasuryWithdrawalsActionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawalsaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawalsaction_to_js_value(retptr, this.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.ptr);
+ return TreasuryWithdrawals.__wrap(ret);
+ }
+ /**
+ * @param {TreasuryWithdrawals} withdrawals
+ * @returns {TreasuryWithdrawalsAction}
+ */
+ static new(withdrawals) {
+ _assertClass(withdrawals, TreasuryWithdrawals);
+ const ret = wasm.treasurywithdrawalsaction_new(withdrawals.ptr);
+ return TreasuryWithdrawalsAction.__wrap(ret);
+ }
+}
+const UnitIntervalFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_unitinterval_free(ptr));
+/** */
+export class UnitInterval {
+ static __wrap(ptr) {
+ const obj = Object.create(UnitInterval.prototype);
+ obj.ptr = ptr;
+ UnitIntervalFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unitinterval_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unitinterval_to_js_value(retptr, this.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.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ denominator() {
+ const ret = wasm.exunits_steps(this.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.exunits_new(numerator.ptr, denominator.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {number} float_number
+ * @returns {UnitInterval}
+ */
+ static from_float(float_number) {
+ const ret = wasm.unitinterval_from_float(float_number);
+ return UnitInterval.__wrap(ret);
+ }
+}
+const UnregCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_unregcert_free(ptr));
+/** */
+export class UnregCert {
+ static __wrap(ptr) {
+ const obj = Object.create(UnregCert.prototype);
+ obj.ptr = ptr;
+ UnregCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ UnregCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_unregcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregCert}
+ */
+ 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.unregcert_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 UnregCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_js_value(retptr, this.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 {UnregCert}
+ */
+ 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.unregcert_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 UnregCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {BigNum} coin
+ * @returns {UnregCert}
+ */
+ static new(stake_credential, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(coin, BigNum);
+ const ret = wasm.regcert_new(stake_credential.ptr, coin.ptr);
+ return UnregCert.__wrap(ret);
+ }
+}
+const UnregCommitteeHotKeyCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_unregcommitteehotkeycert_free(ptr));
+/** */
+export class UnregCommitteeHotKeyCert {
+ static __wrap(ptr) {
+ const obj = Object.create(UnregCommitteeHotKeyCert.prototype);
+ obj.ptr = ptr;
+ UnregCommitteeHotKeyCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ UnregCommitteeHotKeyCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_unregcommitteehotkeycert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregcommitteehotkeycert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregCommitteeHotKeyCert}
+ */
+ 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.unregcommitteehotkeycert_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 UnregCommitteeHotKeyCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregcommitteehotkeycert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregcommitteehotkeycert_to_js_value(retptr, this.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 {UnregCommitteeHotKeyCert}
+ */
+ 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.unregcommitteehotkeycert_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 UnregCommitteeHotKeyCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_cold_keyhash() {
+ const ret = wasm.regcommitteehotkeycert_committee_cold_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} committee_cold_keyhash
+ * @returns {UnregCommitteeHotKeyCert}
+ */
+ static new(committee_cold_keyhash) {
+ _assertClass(committee_cold_keyhash, Ed25519KeyHash);
+ const ret = wasm.scriptpubkey_new(committee_cold_keyhash.ptr);
+ return UnregCommitteeHotKeyCert.__wrap(ret);
+ }
+}
+const UnregDrepCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_unregdrepcert_free(ptr));
+/** */
+export class UnregDrepCert {
+ static __wrap(ptr) {
+ const obj = Object.create(UnregDrepCert.prototype);
+ obj.ptr = ptr;
+ UnregDrepCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ UnregDrepCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_unregdrepcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregdrepcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregDrepCert}
+ */
+ 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.unregdrepcert_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 UnregDrepCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_js_value(retptr, this.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 {UnregDrepCert}
+ */
+ 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.unregdrepcert_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 UnregDrepCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ voting_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} voting_credential
+ * @param {BigNum} coin
+ * @returns {UnregDrepCert}
+ */
+ static new(voting_credential, coin) {
+ _assertClass(voting_credential, StakeCredential);
+ _assertClass(coin, BigNum);
+ const ret = wasm.regcert_new(voting_credential.ptr, coin.ptr);
+ return UnregDrepCert.__wrap(ret);
+ }
+}
+const UpdateFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_update_free(ptr));
+/** */
+export class Update {
+ static __wrap(ptr) {
+ const obj = Object.create(Update.prototype);
+ obj.ptr = ptr;
+ UpdateFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.update_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.update_to_js_value(retptr, this.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.ptr);
+ return ProposedProtocolParameterUpdates.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ epoch() {
+ const ret = wasm.update_epoch(this.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.ptr, epoch);
+ return Update.__wrap(ret);
+ }
+}
+const UrlFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_url_free(ptr));
+/** */
+export class Url {
+ static __wrap(ptr) {
+ const obj = Object.create(Url.prototype);
+ obj.ptr = ptr;
+ UrlFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_url(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+const VRFCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_vrfcert_free(ptr));
+/** */
+export class VRFCert {
+ static __wrap(ptr) {
+ const obj = Object.create(VRFCert.prototype);
+ obj.ptr = ptr;
+ VRFCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vrfcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vrfcert_to_js_value(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ proof() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bootstrapwitness_attributes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+}
+const VRFKeyHashFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_vrfkeyhash_free(ptr));
+/** */
+export class VRFKeyHash {
+ static __wrap(ptr) {
+ const obj = Object.create(VRFKeyHash.prototype);
+ obj.ptr = ptr;
+ VRFKeyHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+}
+const VRFVKeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_vrfvkey_free(ptr));
+/** */
+export class VRFVKey {
+ static __wrap(ptr) {
+ const obj = Object.create(VRFVKey.prototype);
+ obj.ptr = ptr;
+ VRFVKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VRFVKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_vrfvkey_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vrfvkey_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @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.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 VRFVKey.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {VRFKeyHash}
+ */
+ hash() {
+ const ret = wasm.vrfvkey_hash(this.ptr);
+ return VRFKeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_raw_key() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetname_name(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+const ValueFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_value_free(ptr));
+/** */
+export class Value {
+ static __wrap(ptr) {
+ const obj = Object.create(Value.prototype);
+ obj.ptr = ptr;
+ ValueFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.value_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.value_to_js_value(retptr, this.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.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.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.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.value_coin(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} coin
+ */
+ set_coin(coin) {
+ _assertClass(coin, BigNum);
+ wasm.value_set_coin(this.ptr, coin.ptr);
+ }
+ /**
+ * @returns {MultiAsset | undefined}
+ */
+ multiasset() {
+ const ret = wasm.value_multiasset(this.ptr);
+ return ret === 0 ? undefined : MultiAsset.__wrap(ret);
+ }
+ /**
+ * @param {MultiAsset} multiasset
+ */
+ set_multiasset(multiasset) {
+ _assertClass(multiasset, MultiAsset);
+ wasm.value_set_multiasset(this.ptr, multiasset.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.ptr, rhs.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.ptr, rhs_value.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.ptr, rhs_value.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.ptr, rhs_value.ptr);
+ return ret === 0xFFFFFF ? undefined : ret;
+ }
+}
+const VkeyFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_vkey_free(ptr));
+/** */
+export class Vkey {
+ static __wrap(ptr) {
+ const obj = Object.create(Vkey.prototype);
+ obj.ptr = ptr;
+ VkeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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);
+ }
+ }
+ /**
+ * @param {PublicKey} pk
+ * @returns {Vkey}
+ */
+ static new(pk) {
+ _assertClass(pk, PublicKey);
+ const ret = wasm.vkey_new(pk.ptr);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @returns {PublicKey}
+ */
+ public_key() {
+ const ret = wasm.vkey_public_key(this.ptr);
+ return PublicKey.__wrap(ret);
+ }
+}
+const VkeysFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_vkeys_free(ptr));
+/** */
+export class Vkeys {
+ static __wrap(ptr) {
+ const obj = Object.create(Vkeys.prototype);
+ obj.ptr = ptr;
+ VkeysFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ed25519keyhashes_new();
+ return Vkeys.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Vkey}
+ */
+ get(index) {
+ const ret = wasm.vkeys_get(this.ptr, index);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @param {Vkey} elem
+ */
+ add(elem) {
+ _assertClass(elem, Vkey);
+ wasm.vkeys_add(this.ptr, elem.ptr);
+ }
+}
+const VkeywitnessFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_vkeywitness_free(ptr));
+/** */
+export class Vkeywitness {
+ static __wrap(ptr) {
+ const obj = Object.create(Vkeywitness.prototype);
+ obj.ptr = ptr;
+ VkeywitnessFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vkeywitness_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vkeywitness_to_js_value(retptr, this.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.ptr, signature.ptr);
+ return Vkeywitness.__wrap(ret);
+ }
+ /**
+ * @returns {Vkey}
+ */
+ vkey() {
+ const ret = wasm.vkeywitness_vkey(this.ptr);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519Signature}
+ */
+ signature() {
+ const ret = wasm.vkeywitness_signature(this.ptr);
+ return Ed25519Signature.__wrap(ret);
+ }
+}
+const VkeywitnessesFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_vkeywitnesses_free(ptr));
+/** */
+export class Vkeywitnesses {
+ static __wrap(ptr) {
+ const obj = Object.create(Vkeywitnesses.prototype);
+ obj.ptr = ptr;
+ VkeywitnessesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VkeywitnessesFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_vkeywitnesses_free(ptr);
+ }
+ /**
+ * @returns {Vkeywitnesses}
+ */
+ static new() {
+ const ret = wasm.ed25519keyhashes_new();
+ return Vkeywitnesses.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Vkeywitness}
+ */
+ get(index) {
+ const ret = wasm.vkeywitnesses_get(this.ptr, index);
+ return Vkeywitness.__wrap(ret);
+ }
+ /**
+ * @param {Vkeywitness} elem
+ */
+ add(elem) {
+ _assertClass(elem, Vkeywitness);
+ wasm.vkeywitnesses_add(this.ptr, elem.ptr);
+ }
+}
+const VoteFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_vote_free(ptr));
+/** */
+export class Vote {
+ static __wrap(ptr) {
+ const obj = Object.create(Vote.prototype);
+ obj.ptr = ptr;
+ VoteFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VoteFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_vote_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vote_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Vote}
+ */
+ 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.vote_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 Vote.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vote_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vote_to_js_value(retptr, this.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 {Vote}
+ */
+ 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.vote_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 Vote.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Vote}
+ */
+ static new_no() {
+ const ret = wasm.language_new_plutus_v1();
+ return Vote.__wrap(ret);
+ }
+ /**
+ * @returns {Vote}
+ */
+ static new_yes() {
+ const ret = wasm.language_new_plutus_v2();
+ return Vote.__wrap(ret);
+ }
+ /**
+ * @returns {Vote}
+ */
+ static new_abstain() {
+ const ret = wasm.language_new_plutus_v3();
+ return Vote.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.vote_kind(this.ptr);
+ return ret >>> 0;
+ }
+}
+const VoteDelegCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_votedelegcert_free(ptr));
+/** */
+export class VoteDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(VoteDelegCert.prototype);
+ obj.ptr = ptr;
+ VoteDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VoteDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_votedelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votedelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VoteDelegCert}
+ */
+ 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.votedelegcert_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 VoteDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votedelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votedelegcert_to_js_value(retptr, this.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 {VoteDelegCert}
+ */
+ 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.votedelegcert_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 VoteDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ drep() {
+ const ret = wasm.stakevotedelegcert_drep(this.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Drep} drep
+ * @returns {VoteDelegCert}
+ */
+ static new(stake_credential, drep) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(drep, Drep);
+ const ret = wasm.votedelegcert_new(stake_credential.ptr, drep.ptr);
+ return VoteDelegCert.__wrap(ret);
+ }
+}
+const VoteRegDelegCertFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_voteregdelegcert_free(ptr));
+/** */
+export class VoteRegDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(VoteRegDelegCert.prototype);
+ obj.ptr = ptr;
+ VoteRegDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VoteRegDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_voteregdelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voteregdelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VoteRegDelegCert}
+ */
+ 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.voteregdelegcert_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 VoteRegDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voteregdelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voteregdelegcert_to_js_value(retptr, this.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 {VoteRegDelegCert}
+ */
+ 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.voteregdelegcert_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 VoteRegDelegCert.__wrap(r0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ drep() {
+ const ret = wasm.voteregdelegcert_drep(this.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Drep} drep
+ * @param {BigNum} coin
+ * @returns {VoteRegDelegCert}
+ */
+ static new(stake_credential, drep, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(drep, Drep);
+ _assertClass(coin, BigNum);
+ const ret = wasm.voteregdelegcert_new(stake_credential.ptr, drep.ptr, coin.ptr);
+ return VoteRegDelegCert.__wrap(ret);
+ }
+}
+const VoterFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_voter_free(ptr));
+/** */
+export class Voter {
+ static __wrap(ptr) {
+ const obj = Object.create(Voter.prototype);
+ obj.ptr = ptr;
+ VoterFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voter_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voter_to_js_value(retptr, this.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 {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_committee_hot_keyhash(keyhash) {
+ _assertClass(keyhash, Ed25519KeyHash);
+ const ret = wasm.drep_new_keyhash(keyhash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Voter}
+ */
+ static new_committee_hot_scripthash(scripthash) {
+ _assertClass(scripthash, ScriptHash);
+ const ret = wasm.drep_new_scripthash(scripthash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_drep_keyhash(keyhash) {
+ _assertClass(keyhash, Ed25519KeyHash);
+ const ret = wasm.voter_new_drep_keyhash(keyhash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Voter}
+ */
+ static new_drep_scripthash(scripthash) {
+ _assertClass(scripthash, ScriptHash);
+ const ret = wasm.voter_new_drep_scripthash(scripthash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_staking_pool_keyhash(keyhash) {
+ _assertClass(keyhash, Ed25519KeyHash);
+ const ret = wasm.voter_new_staking_pool_keyhash(keyhash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.voter_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_committee_hot_keyhash() {
+ const ret = wasm.voter_as_committee_hot_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_committee_hot_scripthash() {
+ const ret = wasm.voter_as_committee_hot_scripthash(this.ptr);
+ return ret === 0 ? undefined : ScriptHash.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_drep_keyhash() {
+ const ret = wasm.voter_as_drep_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_drep_scripthash() {
+ const ret = wasm.voter_as_drep_scripthash(this.ptr);
+ return ret === 0 ? undefined : ScriptHash.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_staking_pool_keyhash() {
+ const ret = wasm.voter_as_staking_pool_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+}
+const VotingProcedureFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_votingprocedure_free(ptr));
+/** */
+export class VotingProcedure {
+ static __wrap(ptr) {
+ const obj = Object.create(VotingProcedure.prototype);
+ obj.ptr = ptr;
+ VotingProcedureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votingprocedure_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votingprocedure_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @returns {GovernanceActionId}
+ */
+ governance_action_id() {
+ const ret = wasm.votingprocedure_governance_action_id(this.ptr);
+ return GovernanceActionId.__wrap(ret);
+ }
+ /**
+ * @returns {Voter}
+ */
+ voter() {
+ const ret = wasm.votingprocedure_voter(this.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ vote() {
+ const ret = wasm.votingprocedure_vote(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Anchor}
+ */
+ anchor() {
+ const ret = wasm.votingprocedure_anchor(this.ptr);
+ return Anchor.__wrap(ret);
+ }
+ /**
+ * @param {GovernanceActionId} governance_action_id
+ * @param {Voter} voter
+ * @param {Vote} vote
+ * @param {Anchor} anchor
+ * @returns {VotingProcedure}
+ */
+ static new(governance_action_id, voter, vote, anchor) {
+ _assertClass(governance_action_id, GovernanceActionId);
+ _assertClass(voter, Voter);
+ _assertClass(vote, Vote);
+ _assertClass(anchor, Anchor);
+ const ret = wasm.votingprocedure_new(governance_action_id.ptr, voter.ptr, vote.ptr, anchor.ptr);
+ return VotingProcedure.__wrap(ret);
+ }
+}
+const VotingProceduresFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_votingprocedures_free(ptr));
+/** */
+export class VotingProcedures {
+ static __wrap(ptr) {
+ const obj = Object.create(VotingProcedures.prototype);
+ obj.ptr = ptr;
+ VotingProceduresFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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 {VotingProcedures}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return VotingProcedures.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {VotingProcedure}
+ */
+ get(index) {
+ const ret = wasm.votingprocedures_get(this.ptr, index);
+ return VotingProcedure.__wrap(ret);
+ }
+ /**
+ * @param {VotingProcedure} elem
+ */
+ add(elem) {
+ _assertClass(elem, VotingProcedure);
+ wasm.votingprocedures_add(this.ptr, elem.ptr);
+ }
+}
+const WithdrawalsFinalization = new FinalizationRegistry((ptr) => wasm.__wbg_withdrawals_free(ptr));
+/** */
+export class Withdrawals {
+ static __wrap(ptr) {
+ const obj = Object.create(Withdrawals.prototype);
+ obj.ptr = ptr;
+ WithdrawalsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ }
+ 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.withdrawals_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ }
+ finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.withdrawals_to_js_value(retptr, this.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.assets_new();
+ return Withdrawals.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.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.ptr, key.ptr, value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {RewardAddresses}
+ */
+ keys() {
+ const ret = wasm.withdrawals_keys(this.ptr);
+ return RewardAddresses.__wrap(ret);
+ }
+}
+const imports = {
+ __wbindgen_placeholder__: {
+ __wbindgen_string_new: function (arg0, arg1) {
+ const ret = getStringFromWasm0(arg0, arg1);
+ return addHeapObject(ret);
+ },
+ __wbindgen_object_drop_ref: function (arg0) {
+ takeObject(arg0);
+ },
+ __wbindgen_json_parse: function (arg0, arg1) {
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
+ return addHeapObject(ret);
+ },
+ __wbindgen_json_serialize: function (arg0, arg1) {
+ const obj = getObject(arg1);
+ const ret = JSON.stringify(obj === undefined ? null : obj);
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
+ },
+ __wbg_fetch_16f5dddfc5a913a4: function (arg0, arg1) {
+ const ret = getObject(arg0).fetch(getObject(arg1));
+ return addHeapObject(ret);
+ },
+ __wbg_transaction_new: function (arg0) {
+ const ret = Transaction.__wrap(arg0);
+ return addHeapObject(ret);
+ },
+ __wbindgen_string_get: function (arg0, arg1) {
+ const obj = getObject(arg1);
+ const ret = typeof obj === "string" ? obj : undefined;
+ var ptr0 = isLikeNone(ret)
+ ? 0
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ var len0 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
+ },
+ __wbindgen_object_clone_ref: function (arg0) {
+ const ret = getObject(arg0);
+ return addHeapObject(ret);
+ },
+ __wbg_set_a5d34c36a1a4ebd1: function () {
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
+ getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
+ }, arguments);
+ },
+ __wbg_headers_ab5251d2727ac41e: function (arg0) {
+ const ret = getObject(arg0).headers;
+ return addHeapObject(ret);
+ },
+ __wbg_newwithstrandinit_c45f0dc6da26fd03: function () {
+ return handleError(function (arg0, arg1, arg2) {
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbg_instanceof_Response_fb3a4df648c1859b: function (arg0) {
+ let result;
+ try {
+ result = getObject(arg0) instanceof Response;
+ }
+ catch {
+ result = false;
+ }
+ const ret = result;
+ return ret;
+ },
+ __wbg_json_b9414eb18cb751d0: function () {
+ return handleError(function (arg0) {
+ const ret = getObject(arg0).json();
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbindgen_cb_drop: function (arg0) {
+ const obj = takeObject(arg0).original;
+ if (obj.cnt-- == 1) {
+ obj.a = 0;
+ return true;
+ }
+ const ret = false;
+ return ret;
+ },
+ __wbg_process_5615a087a47ba544: function (arg0) {
+ const ret = getObject(arg0).process;
+ return addHeapObject(ret);
+ },
+ __wbindgen_is_object: function (arg0) {
+ const val = getObject(arg0);
+ const ret = typeof val === "object" && val !== null;
+ return ret;
+ },
+ __wbg_versions_8404a8b21b9337ae: function (arg0) {
+ const ret = getObject(arg0).versions;
+ return addHeapObject(ret);
+ },
+ __wbg_node_8b504e170b6380b9: function (arg0) {
+ const ret = getObject(arg0).node;
+ return addHeapObject(ret);
+ },
+ __wbindgen_is_string: function (arg0) {
+ const ret = typeof (getObject(arg0)) === "string";
+ return ret;
+ },
+ __wbg_require_0430b68b38d1a77e: function () {
+ return handleError(function (arg0, arg1, arg2) {
+ const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbg_crypto_ca5197b41df5e2bd: function (arg0) {
+ const ret = getObject(arg0).crypto;
+ return addHeapObject(ret);
+ },
+ __wbg_msCrypto_1088c21440b2d7e4: function (arg0) {
+ const ret = getObject(arg0).msCrypto;
+ return addHeapObject(ret);
+ },
+ __wbg_static_accessor_NODE_MODULE_06b864c18e8ae506: function () {
+ const ret = module;
+ return addHeapObject(ret);
+ },
+ __wbg_randomFillSync_2f6909f8132a175d: function () {
+ return handleError(function (arg0, arg1, arg2) {
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
+ }, arguments);
+ },
+ __wbg_getRandomValues_11a236fbf9914290: function () {
+ return handleError(function (arg0, arg1) {
+ getObject(arg0).getRandomValues(getObject(arg1));
+ }, arguments);
+ },
+ __wbg_self_e7c1f827057f6584: function () {
+ return handleError(function () {
+ const ret = self.self;
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbg_window_a09ec664e14b1b81: function () {
+ return handleError(function () {
+ const ret = globalThis.window;
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbg_globalThis_87cbb8506fecf3a9: function () {
+ return handleError(function () {
+ const ret = globalThis.globalThis;
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbg_global_c85a9259e621f3db: function () {
+ return handleError(function () {
+ const ret = global.global;
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbindgen_is_undefined: function (arg0) {
+ const ret = getObject(arg0) === undefined;
+ return ret;
+ },
+ __wbg_newnoargs_2b8b6bd7753c76ba: function (arg0, arg1) {
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
+ return addHeapObject(ret);
+ },
+ __wbg_call_95d1ea488d03e4e8: function () {
+ return handleError(function (arg0, arg1) {
+ const ret = getObject(arg0).call(getObject(arg1));
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbg_new_f9876326328f45ed: function () {
+ const ret = new Object();
+ return addHeapObject(ret);
+ },
+ __wbg_call_9495de66fdbe016b: function () {
+ return handleError(function (arg0, arg1, arg2) {
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
+ return addHeapObject(ret);
+ }, arguments);
+ },
+ __wbg_set_6aa458a4ebdb65cb: function () {
+ return handleError(function (arg0, arg1, arg2) {
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
+ return ret;
+ }, arguments);
+ },
+ __wbg_buffer_cf65c07de34b9a08: function (arg0) {
+ const ret = getObject(arg0).buffer;
+ return addHeapObject(ret);
+ },
+ __wbg_new_9d3a9ce4282a18a8: function (arg0, arg1) {
+ try {
+ var state0 = { a: arg0, b: arg1 };
+ var cb0 = (arg0, arg1) => {
+ const a = state0.a;
+ state0.a = 0;
+ try {
+ return __wbg_adapter_1684(a, state0.b, arg0, arg1);
+ }
+ finally {
+ state0.a = a;
+ }
+ };
+ const ret = new Promise(cb0);
+ return addHeapObject(ret);
+ }
+ finally {
+ state0.a = state0.b = 0;
+ }
+ },
+ __wbg_resolve_fd40f858d9db1a04: function (arg0) {
+ const ret = Promise.resolve(getObject(arg0));
+ return addHeapObject(ret);
+ },
+ __wbg_then_ec5db6d509eb475f: function (arg0, arg1) {
+ const ret = getObject(arg0).then(getObject(arg1));
+ return addHeapObject(ret);
+ },
+ __wbg_then_f753623316e2873a: function (arg0, arg1, arg2) {
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
+ return addHeapObject(ret);
+ },
+ __wbg_new_537b7341ce90bb31: function (arg0) {
+ const ret = new Uint8Array(getObject(arg0));
+ return addHeapObject(ret);
+ },
+ __wbg_set_17499e8aa4003ebd: function (arg0, arg1, arg2) {
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
+ },
+ __wbg_length_27a2afe8ab42b09f: function (arg0) {
+ const ret = getObject(arg0).length;
+ return ret;
+ },
+ __wbg_newwithlength_b56c882b57805732: function (arg0) {
+ const ret = new Uint8Array(arg0 >>> 0);
+ return addHeapObject(ret);
+ },
+ __wbg_subarray_7526649b91a252a6: function (arg0, arg1, arg2) {
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
+ return addHeapObject(ret);
+ },
+ __wbg_new_d87f272aec784ec0: function (arg0, arg1) {
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
+ return addHeapObject(ret);
+ },
+ __wbg_call_eae29933372a39be: function (arg0, arg1) {
+ const ret = getObject(arg0).call(getObject(arg1));
+ return addHeapObject(ret);
+ },
+ __wbindgen_jsval_eq: function (arg0, arg1) {
+ const ret = getObject(arg0) === getObject(arg1);
+ return ret;
+ },
+ __wbg_self_e0b3266d2d9eba1a: function (arg0) {
+ const ret = getObject(arg0).self;
+ return addHeapObject(ret);
+ },
+ __wbg_require_0993fe224bf8e202: function (arg0, arg1) {
+ const ret = require(getStringFromWasm0(arg0, arg1));
+ return addHeapObject(ret);
+ },
+ __wbg_crypto_e95a6e54c5c2e37f: function (arg0) {
+ const ret = getObject(arg0).crypto;
+ return addHeapObject(ret);
+ },
+ __wbg_getRandomValues_dc67302a7bd1aec5: function (arg0) {
+ const ret = getObject(arg0).getRandomValues;
+ return addHeapObject(ret);
+ },
+ __wbg_randomFillSync_dd2297de5917c74e: function (arg0, arg1, arg2) {
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
+ },
+ __wbg_getRandomValues_02639197c8166a96: function (arg0, arg1, arg2) {
+ getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2));
+ },
+ __wbindgen_debug_string: function (arg0, arg1) {
+ const ret = debugString(getObject(arg1));
+ const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
+ },
+ __wbindgen_throw: function (arg0, arg1) {
+ throw new Error(getStringFromWasm0(arg0, arg1));
+ },
+ __wbindgen_memory: function () {
+ const ret = wasm.memory;
+ return addHeapObject(ret);
+ },
+ __wbindgen_closure_wrapper7045: function (arg0, arg1, arg2) {
+ const ret = makeMutClosure(arg0, arg1, 200, __wbg_adapter_30);
+ return addHeapObject(ret);
+ },
+ },
+};
+/**
+ * Decompression callback
+ *
+ * @callback DecompressCallback
+ * @param {Uint8Array} compressed
+ * @return {Uint8Array} decompressed
+ */
+/**
+ * Options for instantiating a Wasm instance.
+ * @typedef {Object} InstantiateOptions
+ * @property {URL=} url - Optional url to the Wasm file to instantiate.
+ * @property {DecompressCallback=} decompress - Callback to decompress the
+ * raw Wasm file bytes before instantiating.
+ */
+/** Instantiates an instance of the Wasm module returning its functions.
+ * @remarks It is safe to call this multiple times and once successfully
+ * loaded it will always return a reference to the same object.
+ * @param {InstantiateOptions=} opts
+ */
+export async function instantiate(opts) {
+ return (await instantiateWithInstance(opts)).exports;
+}
+let instanceWithExports;
+let lastLoadPromise;
+/** Instantiates an instance of the Wasm module along with its exports.
+ * @remarks It is safe to call this multiple times and once successfully
+ * loaded it will always return a reference to the same object.
+ * @param {InstantiateOptions=} opts
+ * @returns {Promise<{
+ * instance: WebAssembly.Instance;
+ * exports: { encrypt_with_password: typeof encrypt_with_password; decrypt_with_password: typeof decrypt_with_password; min_fee: typeof min_fee; encode_arbitrary_bytes_as_metadatum: typeof encode_arbitrary_bytes_as_metadatum; decode_arbitrary_bytes_from_metadatum: typeof decode_arbitrary_bytes_from_metadatum; encode_json_str_to_metadatum: typeof encode_json_str_to_metadatum; decode_metadatum_to_json_str: typeof decode_metadatum_to_json_str; encode_json_str_to_plutus_datum: typeof encode_json_str_to_plutus_datum; decode_plutus_datum_to_json_str: typeof decode_plutus_datum_to_json_str; make_daedalus_bootstrap_witness: typeof make_daedalus_bootstrap_witness; make_icarus_bootstrap_witness: typeof make_icarus_bootstrap_witness; make_vkey_witness: typeof make_vkey_witness; hash_auxiliary_data: typeof hash_auxiliary_data; hash_transaction: typeof hash_transaction; hash_plutus_data: typeof hash_plutus_data; hash_blake2b256: typeof hash_blake2b256; hash_blake2b224: typeof hash_blake2b224; hash_script_data: typeof hash_script_data; get_implicit_input: typeof get_implicit_input; get_deposit: typeof get_deposit; min_ada_required: typeof min_ada_required; encode_json_str_to_native_script: typeof encode_json_str_to_native_script; apply_params_to_plutus_script: typeof apply_params_to_plutus_script; Address : typeof Address ; Anchor : typeof Anchor ; AssetName : typeof AssetName ; AssetNames : typeof AssetNames ; Assets : typeof Assets ; AuxiliaryData : typeof AuxiliaryData ; AuxiliaryDataHash : typeof AuxiliaryDataHash ; AuxiliaryDataSet : typeof AuxiliaryDataSet ; BaseAddress : typeof BaseAddress ; BigInt : typeof BigInt ; BigNum : typeof BigNum ; Bip32PrivateKey : typeof Bip32PrivateKey ; Bip32PublicKey : typeof Bip32PublicKey ; Block : typeof Block ; BlockHash : typeof BlockHash ; Blockfrost : typeof Blockfrost ; BootstrapWitness : typeof BootstrapWitness ; BootstrapWitnesses : typeof BootstrapWitnesses ; ByronAddress : typeof ByronAddress ; Certificate : typeof Certificate ; Certificates : typeof Certificates ; ConstrPlutusData : typeof ConstrPlutusData ; CostModel : typeof CostModel ; Costmdls : typeof Costmdls ; DNSRecordAorAAAA : typeof DNSRecordAorAAAA ; DNSRecordSRV : typeof DNSRecordSRV ; Data : typeof Data ; DataHash : typeof DataHash ; Datum : typeof Datum ; Drep : typeof Drep ; DrepVotingThresholds : typeof DrepVotingThresholds ; Ed25519KeyHash : typeof Ed25519KeyHash ; Ed25519KeyHashes : typeof Ed25519KeyHashes ; Ed25519Signature : typeof Ed25519Signature ; EnterpriseAddress : typeof EnterpriseAddress ; ExUnitPrices : typeof ExUnitPrices ; ExUnits : typeof ExUnits ; GeneralTransactionMetadata : typeof GeneralTransactionMetadata ; GenesisDelegateHash : typeof GenesisDelegateHash ; GenesisHash : typeof GenesisHash ; GenesisHashes : typeof GenesisHashes ; GenesisKeyDelegation : typeof GenesisKeyDelegation ; GovernanceAction : typeof GovernanceAction ; GovernanceActionId : typeof GovernanceActionId ; HardForkInitiationAction : typeof HardForkInitiationAction ; Header : typeof Header ; HeaderBody : typeof HeaderBody ; Int : typeof Int ; Ipv4 : typeof Ipv4 ; Ipv6 : typeof Ipv6 ; KESSignature : typeof KESSignature ; KESVKey : typeof KESVKey ; Language : typeof Language ; Languages : typeof Languages ; LegacyDaedalusPrivateKey : typeof LegacyDaedalusPrivateKey ; LinearFee : typeof LinearFee ; MIRToStakeCredentials : typeof MIRToStakeCredentials ; MetadataList : typeof MetadataList ; MetadataMap : typeof MetadataMap ; Mint : typeof Mint ; MintAssets : typeof MintAssets ; MoveInstantaneousReward : typeof MoveInstantaneousReward ; MoveInstantaneousRewardsCert : typeof MoveInstantaneousRewardsCert ; MultiAsset : typeof MultiAsset ; MultiHostName : typeof MultiHostName ; NativeScript : typeof NativeScript ; NativeScripts : typeof NativeScripts ; NetworkId : typeof NetworkId ; NetworkInfo : typeof NetworkInfo ; NewCommittee : typeof NewCommittee ; NewConstitution : typeof NewConstitution ; Nonce : typeof Nonce ; OperationalCert : typeof OperationalCert ; ParameterChangeAction : typeof ParameterChangeAction ; PlutusData : typeof PlutusData ; PlutusList : typeof PlutusList ; PlutusMap : typeof PlutusMap ; PlutusScript : typeof PlutusScript ; PlutusScripts : typeof PlutusScripts ; PlutusWitness : typeof PlutusWitness ; Pointer : typeof Pointer ; PointerAddress : typeof PointerAddress ; PoolMetadata : typeof PoolMetadata ; PoolMetadataHash : typeof PoolMetadataHash ; PoolParams : typeof PoolParams ; PoolRegistration : typeof PoolRegistration ; PoolRetirement : typeof PoolRetirement ; PoolVotingThresholds : typeof PoolVotingThresholds ; PrivateKey : typeof PrivateKey ; ProposalProcedure : typeof ProposalProcedure ; ProposalProcedures : typeof ProposalProcedures ; ProposedProtocolParameterUpdates : typeof ProposedProtocolParameterUpdates ; ProtocolParamUpdate : typeof ProtocolParamUpdate ; ProtocolVersion : typeof ProtocolVersion ; PublicKey : typeof PublicKey ; PublicKeys : typeof PublicKeys ; Redeemer : typeof Redeemer ; RedeemerTag : typeof RedeemerTag ; RedeemerWitnessKey : typeof RedeemerWitnessKey ; Redeemers : typeof Redeemers ; RegCert : typeof RegCert ; RegCommitteeHotKeyCert : typeof RegCommitteeHotKeyCert ; RegDrepCert : typeof RegDrepCert ; Relay : typeof Relay ; Relays : typeof Relays ; RequiredWitnessSet : typeof RequiredWitnessSet ; RewardAddress : typeof RewardAddress ; RewardAddresses : typeof RewardAddresses ; Script : typeof Script ; ScriptAll : typeof ScriptAll ; ScriptAny : typeof ScriptAny ; ScriptDataHash : typeof ScriptDataHash ; ScriptHash : typeof ScriptHash ; ScriptHashes : typeof ScriptHashes ; ScriptNOfK : typeof ScriptNOfK ; ScriptPubkey : typeof ScriptPubkey ; ScriptRef : typeof ScriptRef ; ScriptWitness : typeof ScriptWitness ; SingleHostAddr : typeof SingleHostAddr ; SingleHostName : typeof SingleHostName ; StakeCredential : typeof StakeCredential ; StakeCredentials : typeof StakeCredentials ; StakeDelegation : typeof StakeDelegation ; StakeDeregistration : typeof StakeDeregistration ; StakeRegDelegCert : typeof StakeRegDelegCert ; StakeRegistration : typeof StakeRegistration ; StakeVoteDelegCert : typeof StakeVoteDelegCert ; StakeVoteRegDelegCert : typeof StakeVoteRegDelegCert ; Strings : typeof Strings ; TimelockExpiry : typeof TimelockExpiry ; TimelockStart : typeof TimelockStart ; Transaction : typeof Transaction ; TransactionBodies : typeof TransactionBodies ; TransactionBody : typeof TransactionBody ; TransactionBuilder : typeof TransactionBuilder ; TransactionBuilderConfig : typeof TransactionBuilderConfig ; TransactionBuilderConfigBuilder : typeof TransactionBuilderConfigBuilder ; TransactionHash : typeof TransactionHash ; TransactionIndexes : typeof TransactionIndexes ; TransactionInput : typeof TransactionInput ; TransactionInputs : typeof TransactionInputs ; TransactionMetadatum : typeof TransactionMetadatum ; TransactionMetadatumLabels : typeof TransactionMetadatumLabels ; TransactionOutput : typeof TransactionOutput ; TransactionOutputAmountBuilder : typeof TransactionOutputAmountBuilder ; TransactionOutputBuilder : typeof TransactionOutputBuilder ; TransactionOutputs : typeof TransactionOutputs ; TransactionUnspentOutput : typeof TransactionUnspentOutput ; TransactionUnspentOutputs : typeof TransactionUnspentOutputs ; TransactionWitnessSet : typeof TransactionWitnessSet ; TransactionWitnessSetBuilder : typeof TransactionWitnessSetBuilder ; TransactionWitnessSets : typeof TransactionWitnessSets ; TreasuryWithdrawals : typeof TreasuryWithdrawals ; TreasuryWithdrawalsAction : typeof TreasuryWithdrawalsAction ; UnitInterval : typeof UnitInterval ; UnregCert : typeof UnregCert ; UnregCommitteeHotKeyCert : typeof UnregCommitteeHotKeyCert ; UnregDrepCert : typeof UnregDrepCert ; Update : typeof Update ; Url : typeof Url ; VRFCert : typeof VRFCert ; VRFKeyHash : typeof VRFKeyHash ; VRFVKey : typeof VRFVKey ; Value : typeof Value ; Vkey : typeof Vkey ; Vkeys : typeof Vkeys ; Vkeywitness : typeof Vkeywitness ; Vkeywitnesses : typeof Vkeywitnesses ; Vote : typeof Vote ; VoteDelegCert : typeof VoteDelegCert ; VoteRegDelegCert : typeof VoteRegDelegCert ; Voter : typeof Voter ; VotingProcedure : typeof VotingProcedure ; VotingProcedures : typeof VotingProcedures ; Withdrawals : typeof Withdrawals }
+ * }>}
+ */
+export function instantiateWithInstance(opts) {
+ if (instanceWithExports != null) {
+ return Promise.resolve(instanceWithExports);
+ }
+ if (lastLoadPromise == null) {
+ lastLoadPromise = (async () => {
+ try {
+ const instance = (await instantiateModule(opts ?? {})).instance;
+ wasm = instance.exports;
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
+ instanceWithExports = {
+ instance,
+ exports: getWasmInstanceExports(),
+ };
+ return instanceWithExports;
+ }
+ finally {
+ lastLoadPromise = null;
+ }
+ })();
+ }
+ return lastLoadPromise;
+}
+function getWasmInstanceExports() {
+ return {
+ encrypt_with_password,
+ decrypt_with_password,
+ min_fee,
+ encode_arbitrary_bytes_as_metadatum,
+ decode_arbitrary_bytes_from_metadatum,
+ encode_json_str_to_metadatum,
+ decode_metadatum_to_json_str,
+ encode_json_str_to_plutus_datum,
+ decode_plutus_datum_to_json_str,
+ make_daedalus_bootstrap_witness,
+ make_icarus_bootstrap_witness,
+ make_vkey_witness,
+ hash_auxiliary_data,
+ hash_transaction,
+ hash_plutus_data,
+ hash_blake2b256,
+ hash_blake2b224,
+ hash_script_data,
+ get_implicit_input,
+ get_deposit,
+ min_ada_required,
+ encode_json_str_to_native_script,
+ apply_params_to_plutus_script,
+ Address,
+ Anchor,
+ AssetName,
+ AssetNames,
+ Assets,
+ AuxiliaryData,
+ AuxiliaryDataHash,
+ AuxiliaryDataSet,
+ BaseAddress,
+ BigInt,
+ BigNum,
+ Bip32PrivateKey,
+ Bip32PublicKey,
+ Block,
+ BlockHash,
+ Blockfrost,
+ BootstrapWitness,
+ BootstrapWitnesses,
+ ByronAddress,
+ Certificate,
+ Certificates,
+ ConstrPlutusData,
+ CostModel,
+ Costmdls,
+ DNSRecordAorAAAA,
+ DNSRecordSRV,
+ Data,
+ DataHash,
+ Datum,
+ Drep,
+ DrepVotingThresholds,
+ Ed25519KeyHash,
+ Ed25519KeyHashes,
+ Ed25519Signature,
+ EnterpriseAddress,
+ ExUnitPrices,
+ ExUnits,
+ GeneralTransactionMetadata,
+ GenesisDelegateHash,
+ GenesisHash,
+ GenesisHashes,
+ GenesisKeyDelegation,
+ GovernanceAction,
+ GovernanceActionId,
+ HardForkInitiationAction,
+ Header,
+ HeaderBody,
+ Int,
+ Ipv4,
+ Ipv6,
+ KESSignature,
+ KESVKey,
+ Language,
+ Languages,
+ LegacyDaedalusPrivateKey,
+ LinearFee,
+ MIRToStakeCredentials,
+ MetadataList,
+ MetadataMap,
+ Mint,
+ MintAssets,
+ MoveInstantaneousReward,
+ MoveInstantaneousRewardsCert,
+ MultiAsset,
+ MultiHostName,
+ NativeScript,
+ NativeScripts,
+ NetworkId,
+ NetworkInfo,
+ NewCommittee,
+ NewConstitution,
+ Nonce,
+ OperationalCert,
+ ParameterChangeAction,
+ PlutusData,
+ PlutusList,
+ PlutusMap,
+ PlutusScript,
+ PlutusScripts,
+ PlutusWitness,
+ Pointer,
+ PointerAddress,
+ PoolMetadata,
+ PoolMetadataHash,
+ PoolParams,
+ PoolRegistration,
+ PoolRetirement,
+ PoolVotingThresholds,
+ PrivateKey,
+ ProposalProcedure,
+ ProposalProcedures,
+ ProposedProtocolParameterUpdates,
+ ProtocolParamUpdate,
+ ProtocolVersion,
+ PublicKey,
+ PublicKeys,
+ Redeemer,
+ RedeemerTag,
+ RedeemerWitnessKey,
+ Redeemers,
+ RegCert,
+ RegCommitteeHotKeyCert,
+ RegDrepCert,
+ Relay,
+ Relays,
+ RequiredWitnessSet,
+ RewardAddress,
+ RewardAddresses,
+ Script,
+ ScriptAll,
+ ScriptAny,
+ ScriptDataHash,
+ ScriptHash,
+ ScriptHashes,
+ ScriptNOfK,
+ ScriptPubkey,
+ ScriptRef,
+ ScriptWitness,
+ SingleHostAddr,
+ SingleHostName,
+ StakeCredential,
+ StakeCredentials,
+ StakeDelegation,
+ StakeDeregistration,
+ StakeRegDelegCert,
+ StakeRegistration,
+ StakeVoteDelegCert,
+ StakeVoteRegDelegCert,
+ Strings,
+ TimelockExpiry,
+ TimelockStart,
+ Transaction,
+ TransactionBodies,
+ TransactionBody,
+ TransactionBuilder,
+ TransactionBuilderConfig,
+ TransactionBuilderConfigBuilder,
+ TransactionHash,
+ TransactionIndexes,
+ TransactionInput,
+ TransactionInputs,
+ TransactionMetadatum,
+ TransactionMetadatumLabels,
+ TransactionOutput,
+ TransactionOutputAmountBuilder,
+ TransactionOutputBuilder,
+ TransactionOutputs,
+ TransactionUnspentOutput,
+ TransactionUnspentOutputs,
+ TransactionWitnessSet,
+ TransactionWitnessSetBuilder,
+ TransactionWitnessSets,
+ TreasuryWithdrawals,
+ TreasuryWithdrawalsAction,
+ UnitInterval,
+ UnregCert,
+ UnregCommitteeHotKeyCert,
+ UnregDrepCert,
+ Update,
+ Url,
+ VRFCert,
+ VRFKeyHash,
+ VRFVKey,
+ Value,
+ Vkey,
+ Vkeys,
+ Vkeywitness,
+ Vkeywitnesses,
+ Vote,
+ VoteDelegCert,
+ VoteRegDelegCert,
+ Voter,
+ VotingProcedure,
+ VotingProcedures,
+ Withdrawals,
+ };
+}
+/** Gets if the Wasm module has been instantiated. */
+export function isInstantiated() {
+ return instanceWithExports != null;
+}
+/**
+ * @param {InstantiateOptions} opts
+ */
+async function instantiateModule(opts) {
+ // Temporary exception for fresh framework
+ const wasmUrl = import.meta.url.includes("_frsh")
+ ? opts.url
+ : new URL("cardano_multiplatform_lib_bg.wasm", import.meta.url);
+ const decompress = opts.decompress;
+ const isFile = wasmUrl.protocol === "file:";
+ // make file urls work in Node via dnt
+ const isNode = globalThis.process?.versions?.node != null;
+ if (isNode && isFile) {
+ // requires fs to be set externally on globalThis
+ const wasmCode = fs.readFileSync(wasmUrl);
+ return WebAssembly.instantiate(decompress ? decompress(wasmCode) : wasmCode, imports);
+ }
+ switch (wasmUrl.protocol) {
+ case "": // relative URL
+ case "chrome-extension:":
+ case "file:":
+ case "https:":
+ case "http:": {
+ if (isFile) {
+ if (typeof Deno !== "object") {
+ throw new Error("file urls are not supported in this environment");
+ }
+ if ("permissions" in Deno) {
+ await Deno.permissions.request({ name: "read", path: wasmUrl });
+ }
+ }
+ else if (typeof Deno === "object" && "permissions" in Deno) {
+ await Deno.permissions.request({ name: "net", host: wasmUrl.host });
+ }
+ const wasmResponse = await fetch(wasmUrl);
+ if (decompress) {
+ const wasmCode = new Uint8Array(await wasmResponse.arrayBuffer());
+ return WebAssembly.instantiate(decompress(wasmCode), imports);
+ }
+ if (isFile ||
+ wasmResponse.headers.get("content-type")?.toLowerCase()
+ .startsWith("application/wasm")) {
+ return WebAssembly.instantiateStreaming(wasmResponse, imports);
+ }
+ else {
+ return WebAssembly.instantiate(await wasmResponse.arrayBuffer(), imports);
+ }
+ }
+ default:
+ throw new Error(`Unsupported protocol: ${wasmUrl.protocol}`);
+ }
+}
diff --git a/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib_bg.wasm b/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib_bg.wasm
new file mode 100644
index 00000000..b2fae0e6
Binary files /dev/null and b/dist/esm/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib_bg.wasm differ
diff --git a/dist/esm/src/core/libs/cardano_multiplatform_lib/nodejs/cardano_multiplatform_lib.generated.js b/dist/esm/src/core/libs/cardano_multiplatform_lib/nodejs/cardano_multiplatform_lib.generated.js
new file mode 100644
index 00000000..01cfe01b
--- /dev/null
+++ b/dist/esm/src/core/libs/cardano_multiplatform_lib/nodejs/cardano_multiplatform_lib.generated.js
@@ -0,0 +1,28649 @@
+// @generated file from wasmbuild -- do not edit
+// deno-lint-ignore-file
+// deno-fmt-ignore-file
+// source-hash: bfd95ebe53d43f00db0f8f58f0273ee50ec6421a
+
+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) {
+ 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);
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
+ WASM_VECTOR_LEN = buf.length;
+ return ptr;
+ }
+
+ let len = arg.length;
+ let ptr = malloc(len);
+
+ 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);
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
+ const ret = encodeString(arg, view);
+
+ offset += ret.written;
+ }
+
+ WASM_VECTOR_LEN = offset;
+ return ptr;
+}
+
+let cachedInt32Memory0 = null;
+
+function getInt32Memory0() {
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
+ }
+ return cachedInt32Memory0;
+}
+
+function isLikeNone(x) {
+ return x === undefined || x === null;
+}
+
+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;
+}
+
+const CLOSURE_DTORS = new FinalizationRegistry((state) => {
+ wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
+});
+
+function makeMutClosure(arg0, arg1, dtor, f) {
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
+ const real = (...args) => {
+ // First up with a closure we increment the internal reference
+ // count. This ensures that the Rust closure environment won't
+ // be deallocated while we're invoking it.
+ state.cnt++;
+ const a = state.a;
+ state.a = 0;
+ try {
+ return f(a, state.b, ...args);
+ } finally {
+ if (--state.cnt === 0) {
+ wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
+ CLOSURE_DTORS.unregister(state);
+ } else {
+ state.a = a;
+ }
+ }
+ };
+ real.original = state;
+ CLOSURE_DTORS.register(real, state, state);
+ return real;
+}
+function __wbg_adapter_30(arg0, arg1, arg2) {
+ wasm.wasm_bindgen__convert__closures__invoke1_mut__h9aff1b1babe72eb2(
+ arg0,
+ arg1,
+ addHeapObject(arg2),
+ );
+}
+
+function _assertClass(instance, klass) {
+ if (!(instance instanceof klass)) {
+ throw new Error(`expected instance of ${klass.name}`);
+ }
+ return instance.ptr;
+}
+
+function getArrayU8FromWasm0(ptr, len) {
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
+}
+
+function passArray8ToWasm0(arg, malloc) {
+ const ptr = malloc(arg.length * 1);
+ getUint8Memory0().set(arg, ptr / 1);
+ WASM_VECTOR_LEN = arg.length;
+ return ptr;
+}
+/**
+ * @param {string} password
+ * @param {string} salt
+ * @param {string} nonce
+ * @param {string} data
+ * @returns {string}
+ */
+module.exports.encrypt_with_password = function (password, salt, nonce, data) {
+ 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 ptr4 = r0;
+ var len4 = r1;
+ if (r3) {
+ ptr4 = 0;
+ len4 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr4, len4);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr4, len4);
+ }
+};
+
+/**
+ * @param {string} password
+ * @param {string} data
+ * @returns {string}
+ */
+module.exports.decrypt_with_password = function (password, data) {
+ 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 ptr2 = r0;
+ var len2 = r1;
+ if (r3) {
+ ptr2 = 0;
+ len2 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr2, len2);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr2, len2);
+ }
+};
+
+/**
+ * @param {Transaction} tx
+ * @param {LinearFee} linear_fee
+ * @param {ExUnitPrices} ex_unit_prices
+ * @param {UnitInterval} minfee_refscript_cost_per_byte
+ * @param {TransactionOutputs} ref_script_outputs
+ * @returns {BigNum}
+ */
+module.exports.min_fee = function (
+ tx,
+ linear_fee,
+ ex_unit_prices,
+ minfee_refscript_cost_per_byte,
+ ref_script_outputs,
+) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(tx, Transaction);
+ _assertClass(linear_fee, LinearFee);
+ _assertClass(ex_unit_prices, ExUnitPrices);
+ _assertClass(minfee_refscript_cost_per_byte, UnitInterval);
+ _assertClass(ref_script_outputs, TransactionOutputs);
+ wasm.min_fee(
+ retptr,
+ tx.ptr,
+ linear_fee.ptr,
+ ex_unit_prices.ptr,
+ minfee_refscript_cost_per_byte.ptr,
+ ref_script_outputs.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 {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.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 v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+};
+
+/**
+ * @param {string} json
+ * @param {number} 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 {number} schema
+ * @returns {string}
+ */
+module.exports.decode_metadatum_to_json_str = function (metadatum, schema) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(metadatum, TransactionMetadatum);
+ wasm.decode_metadatum_to_json_str(retptr, metadatum.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+};
+
+/**
+ * @param {string} json
+ * @param {number} 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 {number} schema
+ * @returns {string}
+ */
+module.exports.decode_plutus_datum_to_json_str = function (datum, schema) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(datum, PlutusData);
+ wasm.decode_plutus_datum_to_json_str(retptr, datum.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+};
+
+let cachedUint32Memory0 = null;
+
+function getUint32Memory0() {
+ if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
+ cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
+ }
+ return cachedUint32Memory0;
+}
+
+function passArray32ToWasm0(arg, malloc) {
+ const ptr = malloc(arg.length * 4);
+ getUint32Memory0().set(arg, ptr / 4);
+ WASM_VECTOR_LEN = arg.length;
+ return ptr;
+}
+
+function getArrayU32FromWasm0(ptr, len) {
+ return getUint32Memory0().subarray(ptr / 4, ptr / 4 + len);
+}
+/**
+ * @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.ptr,
+ addr.ptr,
+ key.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.ptr,
+ addr.ptr,
+ key.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.ptr, sk.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.ptr);
+ return AuxiliaryDataHash.__wrap(ret);
+};
+
+/**
+ * @param {TransactionBody} tx_body
+ * @returns {TransactionHash}
+ */
+module.exports.hash_transaction = function (tx_body) {
+ _assertClass(tx_body, TransactionBody);
+ const ret = wasm.hash_transaction(tx_body.ptr);
+ return TransactionHash.__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.ptr);
+ return DataHash.__wrap(ret);
+};
+
+/**
+ * @param {Uint8Array} data
+ * @returns {Uint8Array}
+ */
+module.exports.hash_blake2b256 = function (data) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.hash_blake2b256(retptr, ptr0, len0);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v1;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+};
+
+/**
+ * @param {Uint8Array} data
+ * @returns {Uint8Array}
+ */
+module.exports.hash_blake2b224 = function (data) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.hash_blake2b224(retptr, ptr0, len0);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v1;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+};
+
+/**
+ * @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.ptr, cost_models.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.ptr,
+ pool_deposit.ptr,
+ key_deposit.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.ptr, pool_deposit.ptr, key_deposit.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 {TransactionOutput} output
+ * @param {BigNum} coins_per_utxo_byte
+ * @returns {BigNum}
+ */
+module.exports.min_ada_required = function (output, coins_per_utxo_byte) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(output, TransactionOutput);
+ _assertClass(coins_per_utxo_byte, BigNum);
+ wasm.min_ada_required(retptr, output.ptr, coins_per_utxo_byte.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 {number} 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);
+ }
+};
+
+/**
+ * @param {PlutusList} params
+ * @param {PlutusScript} plutus_script
+ * @returns {PlutusScript}
+ */
+module.exports.apply_params_to_plutus_script = function (
+ params,
+ plutus_script,
+) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(params, PlutusList);
+ _assertClass(plutus_script, PlutusScript);
+ var ptr0 = plutus_script.__destroy_into_raw();
+ wasm.apply_params_to_plutus_script(retptr, params.ptr, ptr0);
+ 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);
+ }
+};
+
+function handleError(f, args) {
+ try {
+ return f.apply(this, args);
+ } catch (e) {
+ wasm.__wbindgen_exn_store(addHeapObject(e));
+ }
+}
+function __wbg_adapter_1684(arg0, arg1, arg2, arg3) {
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__he7061673dd7691f9(
+ arg0,
+ arg1,
+ addHeapObject(arg2),
+ addHeapObject(arg3),
+ );
+}
+
+/** */
+module.exports.StakeCredKind = Object.freeze({
+ Key: 0,
+ "0": "Key",
+ Script: 1,
+ "1": "Script",
+});
+/** */
+module.exports.GovernanceActionKind = Object.freeze({
+ ParameterChangeAction: 0,
+ "0": "ParameterChangeAction",
+ HardForkInitiationAction: 1,
+ "1": "HardForkInitiationAction",
+ TreasuryWithdrawalsAction: 2,
+ "2": "TreasuryWithdrawalsAction",
+ NoConfidence: 3,
+ "3": "NoConfidence",
+ NewCommittee: 4,
+ "4": "NewCommittee",
+ NewConstitution: 5,
+ "5": "NewConstitution",
+ InfoAction: 6,
+ "6": "InfoAction",
+});
+/** */
+module.exports.VoterKind = Object.freeze({
+ CommitteeHotKeyHash: 0,
+ "0": "CommitteeHotKeyHash",
+ CommitteeHotScriptHash: 1,
+ "1": "CommitteeHotScriptHash",
+ DrepKeyHash: 2,
+ "2": "DrepKeyHash",
+ DrepScriptHash: 3,
+ "3": "DrepScriptHash",
+ StakingPoolKeyHash: 4,
+ "4": "StakingPoolKeyHash",
+});
+/** */
+module.exports.VoteKind = Object.freeze({
+ No: 0,
+ "0": "No",
+ Yes: 1,
+ "1": "Yes",
+ Abstain: 2,
+ "2": "Abstain",
+});
+/** */
+module.exports.DrepKind = Object.freeze({
+ KeyHash: 0,
+ "0": "KeyHash",
+ ScriptHash: 1,
+ "1": "ScriptHash",
+ Abstain: 2,
+ "2": "Abstain",
+ NoConfidence: 3,
+ "3": "NoConfidence",
+});
+/** */
+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.MetadataJsonSchema = Object.freeze({
+ NoConversions: 0,
+ "0": "NoConversions",
+ BasicConversions: 1,
+ "1": "BasicConversions",
+ DetailedSchema: 2,
+ "2": "DetailedSchema",
+});
+/** */
+module.exports.LanguageKind = Object.freeze({
+ PlutusV1: 0,
+ "0": "PlutusV1",
+ PlutusV2: 1,
+ "1": "PlutusV2",
+ PlutusV3: 2,
+ "2": "PlutusV3",
+});
+/** */
+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.RedeemerTagKind = Object.freeze({
+ Spend: 0,
+ "0": "Spend",
+ Mint: 1,
+ "1": "Mint",
+ Cert: 2,
+ "2": "Cert",
+ Reward: 3,
+ "3": "Reward",
+ Voting: 4,
+ "4": "Voting",
+ Proposing: 5,
+ "5": "Proposing",
+});
+/**
+ * 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.ScriptKind = Object.freeze({
+ NativeScript: 0,
+ "0": "NativeScript",
+ PlutusScriptV1: 1,
+ "1": "PlutusScriptV1",
+ PlutusScriptV2: 2,
+ "2": "PlutusScriptV2",
+ PlutusScriptV3: 3,
+ "3": "PlutusScriptV3",
+});
+/** */
+module.exports.DatumKind = Object.freeze({
+ Hash: 0,
+ "0": "Hash",
+ Data: 1,
+ "1": "Data",
+});
+/**
+ * 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
+ * https://github.com/input-output-hk/cardano-ledger/blob/9c3b4737b13b30f71529e76c5330f403165e28a6/eras/alonzo/impl/src/Cardano/Ledger/Alonzo.hs#L127
+ */
+module.exports.ScriptHashNamespace = Object.freeze({
+ NativeScript: 0,
+ "0": "NativeScript",
+ PlutusV1: 1,
+ "1": "PlutusV1",
+ PlutusV2: 2,
+ "2": "PlutusV2",
+});
+/**
+ * Used to choose the schema for a script JSON string
+ */
+module.exports.ScriptSchema = Object.freeze({
+ Wallet: 0,
+ "0": "Wallet",
+ Node: 1,
+ "1": "Node",
+});
+/** */
+module.exports.ScriptWitnessKind = Object.freeze({
+ NativeWitness: 0,
+ "0": "NativeWitness",
+ PlutusWitness: 1,
+ "1": "PlutusWitness",
+});
+/** */
+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",
+ RegCert: 7,
+ "7": "RegCert",
+ UnregCert: 8,
+ "8": "UnregCert",
+ VoteDelegCert: 9,
+ "9": "VoteDelegCert",
+ StakeVoteDelegCert: 10,
+ "10": "StakeVoteDelegCert",
+ StakeRegDelegCert: 11,
+ "11": "StakeRegDelegCert",
+ VoteRegDelegCert: 12,
+ "12": "VoteRegDelegCert",
+ StakeVoteRegDelegCert: 13,
+ "13": "StakeVoteRegDelegCert",
+ RegCommitteeHotKeyCert: 14,
+ "14": "RegCommitteeHotKeyCert",
+ UnregCommitteeHotKeyCert: 15,
+ "15": "UnregCommitteeHotKeyCert",
+ RegDrepCert: 16,
+ "16": "RegDrepCert",
+ UnregDrepCert: 17,
+ "17": "UnregDrepCert",
+});
+/** */
+module.exports.MIRPot = Object.freeze({
+ Reserves: 0,
+ "0": "Reserves",
+ Treasury: 1,
+ "1": "Treasury",
+});
+/** */
+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.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.NetworkIdKind = Object.freeze({
+ Testnet: 0,
+ "0": "Testnet",
+ Mainnet: 1,
+ "1": "Mainnet",
+});
+
+const AddressFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_address_free(ptr)
+);
+/** */
+class Address {
+ static __wrap(ptr) {
+ const obj = Object.create(Address.prototype);
+ obj.ptr = ptr;
+ AddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.address_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.address_to_js_value(retptr, this.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 {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.address_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string | undefined} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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.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 {ByronAddress | undefined}
+ */
+ as_byron() {
+ const ret = wasm.address_as_byron(this.ptr);
+ return ret === 0 ? undefined : ByronAddress.__wrap(ret);
+ }
+ /**
+ * @returns {RewardAddress | undefined}
+ */
+ as_reward() {
+ const ret = wasm.address_as_reward(this.ptr);
+ return ret === 0 ? undefined : RewardAddress.__wrap(ret);
+ }
+ /**
+ * @returns {PointerAddress | undefined}
+ */
+ as_pointer() {
+ const ret = wasm.address_as_pointer(this.ptr);
+ return ret === 0 ? undefined : PointerAddress.__wrap(ret);
+ }
+ /**
+ * @returns {EnterpriseAddress | undefined}
+ */
+ as_enterprise() {
+ const ret = wasm.address_as_enterprise(this.ptr);
+ return ret === 0 ? undefined : EnterpriseAddress.__wrap(ret);
+ }
+ /**
+ * @returns {BaseAddress | undefined}
+ */
+ as_base() {
+ const ret = wasm.address_as_base(this.ptr);
+ return ret === 0 ? undefined : BaseAddress.__wrap(ret);
+ }
+}
+module.exports.Address = Address;
+
+const AnchorFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_anchor_free(ptr)
+);
+/** */
+class Anchor {
+ static __wrap(ptr) {
+ const obj = Object.create(Anchor.prototype);
+ obj.ptr = ptr;
+ AnchorFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.anchor_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.anchor_to_js_value(retptr, this.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}
+ */
+ anchor_url() {
+ const ret = wasm.anchor_anchor_url(this.ptr);
+ return Url.__wrap(ret);
+ }
+ /**
+ * @returns {DataHash}
+ */
+ anchor_data_hash() {
+ const ret = wasm.anchor_anchor_data_hash(this.ptr);
+ return DataHash.__wrap(ret);
+ }
+ /**
+ * @param {Url} anchor_url
+ * @param {DataHash} anchor_data_hash
+ * @returns {Anchor}
+ */
+ static new(anchor_url, anchor_data_hash) {
+ _assertClass(anchor_url, Url);
+ _assertClass(anchor_data_hash, DataHash);
+ const ret = wasm.anchor_new(anchor_url.ptr, anchor_data_hash.ptr);
+ return Anchor.__wrap(ret);
+ }
+}
+module.exports.Anchor = Anchor;
+
+const AssetNameFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_assetname_free(ptr)
+);
+/** */
+class AssetName {
+ static __wrap(ptr) {
+ const obj = Object.create(AssetName.prototype);
+ obj.ptr = ptr;
+ AssetNameFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetname_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetname_to_js_value(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.AssetName = AssetName;
+
+const AssetNamesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_assetnames_free(ptr)
+);
+/** */
+class AssetNames {
+ static __wrap(ptr) {
+ const obj = Object.create(AssetNames.prototype);
+ obj.ptr = ptr;
+ AssetNamesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetnames_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetnames_to_js_value(retptr, this.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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {AssetName}
+ */
+ get(index) {
+ const ret = wasm.assetnames_get(this.ptr, index);
+ return AssetName.__wrap(ret);
+ }
+ /**
+ * @param {AssetName} elem
+ */
+ add(elem) {
+ _assertClass(elem, AssetName);
+ wasm.assetnames_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.AssetNames = AssetNames;
+
+const AssetsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_assets_free(ptr)
+);
+/** */
+class Assets {
+ static __wrap(ptr) {
+ const obj = Object.create(Assets.prototype);
+ obj.ptr = ptr;
+ AssetsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assets_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assets_to_js_value(retptr, this.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.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.ptr, key.ptr, value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {AssetNames}
+ */
+ keys() {
+ const ret = wasm.assets_keys(this.ptr);
+ return AssetNames.__wrap(ret);
+ }
+}
+module.exports.Assets = Assets;
+
+const AuxiliaryDataFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_auxiliarydata_free(ptr)
+);
+/** */
+class AuxiliaryData {
+ static __wrap(ptr) {
+ const obj = Object.create(AuxiliaryData.prototype);
+ obj.ptr = ptr;
+ AuxiliaryDataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydata_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydata_to_js_value(retptr, this.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.ptr);
+ return ret === 0 ? undefined : GeneralTransactionMetadata.__wrap(ret);
+ }
+ /**
+ * @param {GeneralTransactionMetadata} metadata
+ */
+ set_metadata(metadata) {
+ _assertClass(metadata, GeneralTransactionMetadata);
+ wasm.auxiliarydata_set_metadata(this.ptr, metadata.ptr);
+ }
+ /**
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts() {
+ const ret = wasm.auxiliarydata_native_scripts(this.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.ptr, native_scripts.ptr);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_scripts() {
+ const ret = wasm.auxiliarydata_plutus_scripts(this.ptr);
+ return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v2_scripts() {
+ const ret = wasm.auxiliarydata_plutus_v2_scripts(this.ptr);
+ return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v3_scripts() {
+ const ret = wasm.auxiliarydata_plutus_v3_scripts(this.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.ptr, plutus_scripts.ptr);
+ }
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v2_scripts(plutus_scripts) {
+ _assertClass(plutus_scripts, PlutusScripts);
+ wasm.auxiliarydata_set_plutus_v2_scripts(this.ptr, plutus_scripts.ptr);
+ }
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v3_scripts(plutus_scripts) {
+ _assertClass(plutus_scripts, PlutusScripts);
+ wasm.auxiliarydata_set_plutus_v3_scripts(this.ptr, plutus_scripts.ptr);
+ }
+}
+module.exports.AuxiliaryData = AuxiliaryData;
+
+const AuxiliaryDataHashFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_auxiliarydatahash_free(ptr)
+);
+/** */
+class AuxiliaryDataHash {
+ static __wrap(ptr) {
+ const obj = Object.create(AuxiliaryDataHash.prototype);
+ obj.ptr = ptr;
+ AuxiliaryDataHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_auxiliarydataset_free(ptr)
+);
+/** */
+class AuxiliaryDataSet {
+ static __wrap(ptr) {
+ const obj = Object.create(AuxiliaryDataSet.prototype);
+ obj.ptr = ptr;
+ AuxiliaryDataSetFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {BigNum} tx_index
+ * @param {AuxiliaryData} data
+ * @returns {AuxiliaryData | undefined}
+ */
+ insert(tx_index, data) {
+ _assertClass(tx_index, BigNum);
+ _assertClass(data, AuxiliaryData);
+ const ret = wasm.auxiliarydataset_insert(this.ptr, tx_index.ptr, data.ptr);
+ return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} tx_index
+ * @returns {AuxiliaryData | undefined}
+ */
+ get(tx_index) {
+ _assertClass(tx_index, BigNum);
+ const ret = wasm.auxiliarydataset_get(this.ptr, tx_index.ptr);
+ return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionIndexes}
+ */
+ indices() {
+ const ret = wasm.auxiliarydataset_indices(this.ptr);
+ return TransactionIndexes.__wrap(ret);
+ }
+}
+module.exports.AuxiliaryDataSet = AuxiliaryDataSet;
+
+const BaseAddressFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_baseaddress_free(ptr)
+);
+/** */
+class BaseAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(BaseAddress.prototype);
+ obj.ptr = ptr;
+ BaseAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ BaseAddressFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_baseaddress_free(ptr);
+ }
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @param {StakeCredential} stake
+ * @returns {BaseAddress}
+ */
+ static new(network, payment, stake) {
+ _assertClass(payment, StakeCredential);
+ _assertClass(stake, StakeCredential);
+ const ret = wasm.baseaddress_new(network, payment.ptr, stake.ptr);
+ return BaseAddress.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_cred() {
+ const ret = wasm.baseaddress_stake_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Address}
+ */
+ to_address() {
+ const ret = wasm.baseaddress_to_address(this.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {BaseAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_base(addr.ptr);
+ return ret === 0 ? undefined : BaseAddress.__wrap(ret);
+ }
+}
+module.exports.BaseAddress = BaseAddress;
+
+const BigIntFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_bigint_free(ptr)
+);
+/** */
+class BigInt {
+ static __wrap(ptr) {
+ const obj = Object.create(BigInt.prototype);
+ obj.ptr = ptr;
+ BigIntFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {BigNum | undefined}
+ */
+ as_u64() {
+ const ret = wasm.bigint_as_u64(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {Int | undefined}
+ */
+ as_int() {
+ const ret = wasm.bigint_as_int(this.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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bigint_to_str(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+module.exports.BigInt = BigInt;
+
+const BigNumFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_bignum_free(ptr)
+);
+/** */
+class BigNum {
+ static __wrap(ptr) {
+ const obj = Object.create(BigNum.prototype);
+ obj.ptr = ptr;
+ BigNumFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bignum_to_str(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {BigNum}
+ */
+ static zero() {
+ const ret = wasm.bignum_zero();
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {boolean}
+ */
+ is_zero() {
+ const ret = wasm.bignum_is_zero(this.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @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.ptr, other.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.ptr, other.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.ptr, other.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_div(other) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(other, BigNum);
+ wasm.bignum_checked_div(retptr, this.ptr, other.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_div_ceil(other) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(other, BigNum);
+ wasm.bignum_checked_div_ceil(retptr, this.ptr, other.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.ptr, other.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} rhs_value
+ * @returns {number}
+ */
+ compare(rhs_value) {
+ _assertClass(rhs_value, BigNum);
+ const ret = wasm.bignum_compare(this.ptr, rhs_value.ptr);
+ return ret;
+ }
+}
+module.exports.BigNum = BigNum;
+
+const Bip32PrivateKeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_bip32privatekey_free(ptr)
+);
+/** */
+class Bip32PrivateKey {
+ static __wrap(ptr) {
+ const obj = Object.create(Bip32PrivateKey.prototype);
+ obj.ptr = ptr;
+ Bip32PrivateKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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.ptr);
+ return PrivateKey.__wrap(ret);
+ }
+ /**
+ * @returns {Bip32PublicKey}
+ */
+ to_public() {
+ const ret = wasm.bip32privatekey_to_public(this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32privatekey_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.Bip32PrivateKey = Bip32PrivateKey;
+
+const Bip32PublicKeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_bip32publickey_free(ptr)
+);
+/** */
+class Bip32PublicKey {
+ static __wrap(ptr) {
+ const obj = Object.create(Bip32PublicKey.prototype);
+ obj.ptr = ptr;
+ Bip32PublicKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ Bip32PublicKeyFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_bip32publickey_free(ptr);
+ }
+ /**
+ * 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.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);
+ }
+ }
+ /**
+ * @returns {PublicKey}
+ */
+ to_raw_key() {
+ const ret = wasm.bip32publickey_to_raw_key(this.ptr);
+ return PublicKey.__wrap(ret);
+ }
+ /**
+ * @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 {Uint8Array}
+ */
+ as_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32publickey_as_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @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 {string}
+ */
+ to_bech32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32publickey_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ chaincode() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32publickey_chaincode(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.Bip32PublicKey = Bip32PublicKey;
+
+const BlockFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_block_free(ptr)
+);
+/** */
+class Block {
+ static __wrap(ptr) {
+ const obj = Object.create(Block.prototype);
+ obj.ptr = ptr;
+ BlockFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.block_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.block_to_js_value(retptr, this.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.ptr);
+ return Header.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionBodies}
+ */
+ transaction_bodies() {
+ const ret = wasm.block_transaction_bodies(this.ptr);
+ return TransactionBodies.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionWitnessSets}
+ */
+ transaction_witness_sets() {
+ const ret = wasm.block_transaction_witness_sets(this.ptr);
+ return TransactionWitnessSets.__wrap(ret);
+ }
+ /**
+ * @returns {AuxiliaryDataSet}
+ */
+ auxiliary_data_set() {
+ const ret = wasm.block_auxiliary_data_set(this.ptr);
+ return AuxiliaryDataSet.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionIndexes}
+ */
+ invalid_transactions() {
+ const ret = wasm.block_invalid_transactions(this.ptr);
+ return TransactionIndexes.__wrap(ret);
+ }
+ /**
+ * @param {Header} header
+ * @param {TransactionBodies} transaction_bodies
+ * @param {TransactionWitnessSets} transaction_witness_sets
+ * @param {AuxiliaryDataSet} auxiliary_data_set
+ * @param {TransactionIndexes} 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);
+ _assertClass(invalid_transactions, TransactionIndexes);
+ const ret = wasm.block_new(
+ header.ptr,
+ transaction_bodies.ptr,
+ transaction_witness_sets.ptr,
+ auxiliary_data_set.ptr,
+ invalid_transactions.ptr,
+ );
+ return Block.__wrap(ret);
+ }
+}
+module.exports.Block = Block;
+
+const BlockHashFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_blockhash_free(ptr)
+);
+/** */
+class BlockHash {
+ static __wrap(ptr) {
+ const obj = Object.create(BlockHash.prototype);
+ obj.ptr = ptr;
+ BlockHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 BlockfrostFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_blockfrost_free(ptr)
+);
+/** */
+class Blockfrost {
+ static __wrap(ptr) {
+ const obj = Object.create(Blockfrost.prototype);
+ obj.ptr = ptr;
+ BlockfrostFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ BlockfrostFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_blockfrost_free(ptr);
+ }
+ /**
+ * @param {string} url
+ * @param {string} project_id
+ * @returns {Blockfrost}
+ */
+ static new(url, project_id) {
+ const ptr0 = passStringToWasm0(
+ url,
+ wasm.__wbindgen_malloc,
+ wasm.__wbindgen_realloc,
+ );
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(
+ project_id,
+ wasm.__wbindgen_malloc,
+ wasm.__wbindgen_realloc,
+ );
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.blockfrost_new(ptr0, len0, ptr1, len1);
+ return Blockfrost.__wrap(ret);
+ }
+ /**
+ * @returns {string}
+ */
+ url() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_url(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ project_id() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_project_id(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+module.exports.Blockfrost = Blockfrost;
+
+const BootstrapWitnessFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_bootstrapwitness_free(ptr)
+);
+/** */
+class BootstrapWitness {
+ static __wrap(ptr) {
+ const obj = Object.create(BootstrapWitness.prototype);
+ obj.ptr = ptr;
+ BootstrapWitnessFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bootstrapwitness_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bootstrapwitness_to_js_value(retptr, this.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.ptr);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519Signature}
+ */
+ signature() {
+ const ret = wasm.bootstrapwitness_signature(this.ptr);
+ return Ed25519Signature.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ chain_code() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetname_name(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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.ptr,
+ signature.ptr,
+ ptr0,
+ len0,
+ ptr1,
+ len1,
+ );
+ return BootstrapWitness.__wrap(ret);
+ }
+}
+module.exports.BootstrapWitness = BootstrapWitness;
+
+const BootstrapWitnessesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_bootstrapwitnesses_free(ptr)
+);
+/** */
+class BootstrapWitnesses {
+ static __wrap(ptr) {
+ const obj = Object.create(BootstrapWitnesses.prototype);
+ obj.ptr = ptr;
+ BootstrapWitnessesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ BootstrapWitnessesFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_bootstrapwitnesses_free(ptr);
+ }
+ /**
+ * @returns {BootstrapWitnesses}
+ */
+ static new() {
+ const ret = wasm.assetnames_new();
+ return BootstrapWitnesses.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {BootstrapWitness}
+ */
+ get(index) {
+ const ret = wasm.bootstrapwitnesses_get(this.ptr, index);
+ return BootstrapWitness.__wrap(ret);
+ }
+ /**
+ * @param {BootstrapWitness} elem
+ */
+ add(elem) {
+ _assertClass(elem, BootstrapWitness);
+ wasm.bootstrapwitnesses_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.BootstrapWitnesses = BootstrapWitnesses;
+
+const ByronAddressFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_byronaddress_free(ptr)
+);
+/** */
+class ByronAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(ByronAddress.prototype);
+ obj.ptr = ptr;
+ ByronAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ByronAddressFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_byronaddress_free(ptr);
+ }
+ /**
+ * @returns {string}
+ */
+ to_base58() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.byronaddress_to_base58(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.byronaddress_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ attributes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.byronaddress_attributes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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.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.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.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {ByronAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_byron(addr.ptr);
+ return ret === 0 ? undefined : ByronAddress.__wrap(ret);
+ }
+}
+module.exports.ByronAddress = ByronAddress;
+
+const CertificateFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_certificate_free(ptr)
+);
+/** */
+class Certificate {
+ static __wrap(ptr) {
+ const obj = Object.create(Certificate.prototype);
+ obj.ptr = ptr;
+ CertificateFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.certificate_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.certificate_to_js_value(retptr, this.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.ptr);
+ return Certificate.__wrap(ret);
+ }
+ /**
+ * @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.ptr,
+ );
+ return Certificate.__wrap(ret);
+ }
+ /**
+ * @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.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.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.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.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.ptr,
+ );
+ return Certificate.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.certificate_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {StakeRegistration | undefined}
+ */
+ as_stake_registration() {
+ const ret = wasm.certificate_as_stake_registration(this.ptr);
+ return ret === 0 ? undefined : StakeRegistration.__wrap(ret);
+ }
+ /**
+ * @returns {StakeDeregistration | undefined}
+ */
+ as_stake_deregistration() {
+ const ret = wasm.certificate_as_stake_deregistration(this.ptr);
+ return ret === 0 ? undefined : StakeDeregistration.__wrap(ret);
+ }
+ /**
+ * @returns {StakeDelegation | undefined}
+ */
+ as_stake_delegation() {
+ const ret = wasm.certificate_as_stake_delegation(this.ptr);
+ return ret === 0 ? undefined : StakeDelegation.__wrap(ret);
+ }
+ /**
+ * @returns {PoolRegistration | undefined}
+ */
+ as_pool_registration() {
+ const ret = wasm.certificate_as_pool_registration(this.ptr);
+ return ret === 0 ? undefined : PoolRegistration.__wrap(ret);
+ }
+ /**
+ * @returns {PoolRetirement | undefined}
+ */
+ as_pool_retirement() {
+ const ret = wasm.certificate_as_pool_retirement(this.ptr);
+ return ret === 0 ? undefined : PoolRetirement.__wrap(ret);
+ }
+ /**
+ * @returns {GenesisKeyDelegation | undefined}
+ */
+ as_genesis_key_delegation() {
+ const ret = wasm.certificate_as_genesis_key_delegation(this.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.ptr);
+ return ret === 0 ? undefined : MoveInstantaneousRewardsCert.__wrap(ret);
+ }
+ /**
+ * @returns {RegCert | undefined}
+ */
+ as_reg_cert() {
+ const ret = wasm.certificate_as_reg_cert(this.ptr);
+ return ret === 0 ? undefined : RegCert.__wrap(ret);
+ }
+ /**
+ * @returns {UnregCert | undefined}
+ */
+ as_unreg_cert() {
+ const ret = wasm.certificate_as_unreg_cert(this.ptr);
+ return ret === 0 ? undefined : UnregCert.__wrap(ret);
+ }
+ /**
+ * @returns {VoteDelegCert | undefined}
+ */
+ as_vote_deleg_cert() {
+ const ret = wasm.certificate_as_vote_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : VoteDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {StakeVoteDelegCert | undefined}
+ */
+ as_stake_vote_deleg_cert() {
+ const ret = wasm.certificate_as_stake_vote_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : StakeVoteDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {StakeRegDelegCert | undefined}
+ */
+ as_stake_reg_deleg_cert() {
+ const ret = wasm.certificate_as_stake_reg_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : StakeRegDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {VoteRegDelegCert | undefined}
+ */
+ as_vote_reg_deleg_cert() {
+ const ret = wasm.certificate_as_vote_reg_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : VoteRegDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {StakeVoteRegDelegCert | undefined}
+ */
+ as_stake_vote_reg_deleg_cert() {
+ const ret = wasm.certificate_as_stake_vote_reg_deleg_cert(this.ptr);
+ return ret === 0 ? undefined : StakeVoteRegDelegCert.__wrap(ret);
+ }
+ /**
+ * @returns {RegCommitteeHotKeyCert | undefined}
+ */
+ as_reg_committee_hot_key_cert() {
+ const ret = wasm.certificate_as_reg_committee_hot_key_cert(this.ptr);
+ return ret === 0 ? undefined : RegCommitteeHotKeyCert.__wrap(ret);
+ }
+ /**
+ * @returns {UnregCommitteeHotKeyCert | undefined}
+ */
+ as_unreg_committee_hot_key_cert() {
+ const ret = wasm.certificate_as_unreg_committee_hot_key_cert(this.ptr);
+ return ret === 0 ? undefined : UnregCommitteeHotKeyCert.__wrap(ret);
+ }
+ /**
+ * @returns {RegDrepCert | undefined}
+ */
+ as_reg_drep_cert() {
+ const ret = wasm.certificate_as_reg_drep_cert(this.ptr);
+ return ret === 0 ? undefined : RegDrepCert.__wrap(ret);
+ }
+ /**
+ * @returns {UnregDrepCert | undefined}
+ */
+ as_unreg_drep_cert() {
+ const ret = wasm.certificate_as_unreg_drep_cert(this.ptr);
+ return ret === 0 ? undefined : UnregDrepCert.__wrap(ret);
+ }
+}
+module.exports.Certificate = Certificate;
+
+const CertificatesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_certificates_free(ptr)
+);
+/** */
+class Certificates {
+ static __wrap(ptr) {
+ const obj = Object.create(Certificates.prototype);
+ obj.ptr = ptr;
+ CertificatesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.certificates_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.certificates_to_js_value(retptr, this.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.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Certificate}
+ */
+ get(index) {
+ const ret = wasm.certificates_get(this.ptr, index);
+ return Certificate.__wrap(ret);
+ }
+ /**
+ * @param {Certificate} elem
+ */
+ add(elem) {
+ _assertClass(elem, Certificate);
+ wasm.certificates_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.Certificates = Certificates;
+
+const ConstrPlutusDataFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_constrplutusdata_free(ptr)
+);
+/** */
+class ConstrPlutusData {
+ static __wrap(ptr) {
+ const obj = Object.create(ConstrPlutusData.prototype);
+ obj.ptr = ptr;
+ ConstrPlutusDataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {BigNum}
+ */
+ alternative() {
+ const ret = wasm.constrplutusdata_alternative(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusList}
+ */
+ data() {
+ const ret = wasm.constrplutusdata_data(this.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.ptr, data.ptr);
+ return ConstrPlutusData.__wrap(ret);
+ }
+}
+module.exports.ConstrPlutusData = ConstrPlutusData;
+
+const CostModelFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_costmodel_free(ptr)
+);
+/** */
+class CostModel {
+ static __wrap(ptr) {
+ const obj = Object.create(CostModel.prototype);
+ obj.ptr = ptr;
+ CostModelFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {CostModel}
+ */
+ static new() {
+ const ret = wasm.costmodel_new();
+ return CostModel.__wrap(ret);
+ }
+ /**
+ * @returns {CostModel}
+ */
+ static new_plutus_v2() {
+ const ret = wasm.costmodel_new_plutus_v2();
+ return CostModel.__wrap(ret);
+ }
+ /**
+ * @returns {CostModel}
+ */
+ static new_plutus_v3() {
+ const ret = wasm.costmodel_new_plutus_v3();
+ return CostModel.__wrap(ret);
+ }
+ /**
+ * @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.ptr, operation, cost.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.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.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+}
+module.exports.CostModel = CostModel;
+
+const CostmdlsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_costmdls_free(ptr)
+);
+/** */
+class Costmdls {
+ static __wrap(ptr) {
+ const obj = Object.create(Costmdls.prototype);
+ obj.ptr = ptr;
+ CostmdlsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {Costmdls}
+ */
+ static new() {
+ const ret = wasm.assets_new();
+ return Costmdls.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.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.ptr, key.ptr, value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : CostModel.__wrap(ret);
+ }
+ /**
+ * @returns {Languages}
+ */
+ keys() {
+ const ret = wasm.costmdls_keys(this.ptr);
+ return Languages.__wrap(ret);
+ }
+}
+module.exports.Costmdls = Costmdls;
+
+const DNSRecordAorAAAAFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_dnsrecordaoraaaa_free(ptr)
+);
+/** */
+class DNSRecordAorAAAA {
+ static __wrap(ptr) {
+ const obj = Object.create(DNSRecordAorAAAA.prototype);
+ obj.ptr = ptr;
+ DNSRecordAorAAAAFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_url(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+module.exports.DNSRecordAorAAAA = DNSRecordAorAAAA;
+
+const DNSRecordSRVFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_dnsrecordsrv_free(ptr)
+);
+/** */
+class DNSRecordSRV {
+ static __wrap(ptr) {
+ const obj = Object.create(DNSRecordSRV.prototype);
+ obj.ptr = ptr;
+ DNSRecordSRVFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_url(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+module.exports.DNSRecordSRV = DNSRecordSRV;
+
+const DataFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_data_free(ptr)
+);
+/** */
+class Data {
+ static __wrap(ptr) {
+ const obj = Object.create(Data.prototype);
+ obj.ptr = ptr;
+ DataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ DataFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_data_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.data_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Data}
+ */
+ 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.data_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 Data.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.data_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.data_to_js_value(retptr, this.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 {Data}
+ */
+ 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.data_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 Data.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {PlutusData} plutus_data
+ * @returns {Data}
+ */
+ static new(plutus_data) {
+ _assertClass(plutus_data, PlutusData);
+ const ret = wasm.data_new(plutus_data.ptr);
+ return Data.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusData}
+ */
+ get() {
+ const ret = wasm.data_get(this.ptr);
+ return PlutusData.__wrap(ret);
+ }
+}
+module.exports.Data = Data;
+
+const DataHashFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_datahash_free(ptr)
+);
+/** */
+class DataHash {
+ static __wrap(ptr) {
+ const obj = Object.create(DataHash.prototype);
+ obj.ptr = ptr;
+ DataHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 DatumFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_datum_free(ptr)
+);
+/** */
+class Datum {
+ static __wrap(ptr) {
+ const obj = Object.create(Datum.prototype);
+ obj.ptr = ptr;
+ DatumFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ DatumFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_datum_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.datum_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Datum}
+ */
+ 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.datum_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 Datum.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.datum_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.datum_to_js_value(retptr, this.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 {Datum}
+ */
+ 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.datum_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 Datum.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {DataHash} data_hash
+ * @returns {Datum}
+ */
+ static new_data_hash(data_hash) {
+ _assertClass(data_hash, DataHash);
+ const ret = wasm.datum_new_data_hash(data_hash.ptr);
+ return Datum.__wrap(ret);
+ }
+ /**
+ * @param {Data} data
+ * @returns {Datum}
+ */
+ static new_data(data) {
+ _assertClass(data, Data);
+ const ret = wasm.datum_new_data(data.ptr);
+ return Datum.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.datum_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {DataHash | undefined}
+ */
+ as_data_hash() {
+ const ret = wasm.datum_as_data_hash(this.ptr);
+ return ret === 0 ? undefined : DataHash.__wrap(ret);
+ }
+ /**
+ * @returns {Data | undefined}
+ */
+ as_data() {
+ const ret = wasm.datum_as_data(this.ptr);
+ return ret === 0 ? undefined : Data.__wrap(ret);
+ }
+}
+module.exports.Datum = Datum;
+
+const DrepFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_drep_free(ptr)
+);
+/** */
+class Drep {
+ static __wrap(ptr) {
+ const obj = Object.create(Drep.prototype);
+ obj.ptr = ptr;
+ DrepFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.drep_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.drep_to_js_value(retptr, this.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} keyhash
+ * @returns {Drep}
+ */
+ static new_keyhash(keyhash) {
+ _assertClass(keyhash, Ed25519KeyHash);
+ const ret = wasm.drep_new_keyhash(keyhash.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Drep}
+ */
+ static new_scripthash(scripthash) {
+ _assertClass(scripthash, ScriptHash);
+ const ret = wasm.drep_new_scripthash(scripthash.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ static new_abstain() {
+ const ret = wasm.drep_new_abstain();
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ static new_no_confidence() {
+ const ret = wasm.drep_new_no_confidence();
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.drep_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_keyhash() {
+ const ret = wasm.drep_as_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_scripthash() {
+ const ret = wasm.drep_as_scripthash(this.ptr);
+ return ret === 0 ? undefined : ScriptHash.__wrap(ret);
+ }
+}
+module.exports.Drep = Drep;
+
+const DrepVotingThresholdsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_drepvotingthresholds_free(ptr)
+);
+/** */
+class DrepVotingThresholds {
+ static __wrap(ptr) {
+ const obj = Object.create(DrepVotingThresholds.prototype);
+ obj.ptr = ptr;
+ DrepVotingThresholdsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.drepvotingthresholds_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.drepvotingthresholds_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ motion_no_confidence() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_normal() {
+ const ret = wasm.drepvotingthresholds_committee_normal(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_no_confidence() {
+ const ret = wasm.drepvotingthresholds_committee_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ update_constitution() {
+ const ret = wasm.drepvotingthresholds_update_constitution(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ hard_fork_initiation() {
+ const ret = wasm.drepvotingthresholds_hard_fork_initiation(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_network_group() {
+ const ret = wasm.drepvotingthresholds_pp_network_group(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_economic_group() {
+ const ret = wasm.drepvotingthresholds_pp_economic_group(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_technical_group() {
+ const ret = wasm.drepvotingthresholds_pp_technical_group(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ pp_governance_group() {
+ const ret = wasm.drepvotingthresholds_pp_governance_group(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ treasury_withdrawal() {
+ const ret = wasm.drepvotingthresholds_treasury_withdrawal(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @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.ptr,
+ committee_normal.ptr,
+ committee_no_confidence.ptr,
+ update_constitution.ptr,
+ hard_fork_initiation.ptr,
+ pp_network_group.ptr,
+ pp_economic_group.ptr,
+ pp_technical_group.ptr,
+ pp_governance_group.ptr,
+ treasury_withdrawal.ptr,
+ );
+ return DrepVotingThresholds.__wrap(ret);
+ }
+}
+module.exports.DrepVotingThresholds = DrepVotingThresholds;
+
+const Ed25519KeyHashFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_ed25519keyhash_free(ptr)
+);
+/** */
+class Ed25519KeyHash {
+ static __wrap(ptr) {
+ const obj = Object.create(Ed25519KeyHash.prototype);
+ obj.ptr = ptr;
+ Ed25519KeyHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_ed25519keyhashes_free(ptr)
+);
+/** */
+class Ed25519KeyHashes {
+ static __wrap(ptr) {
+ const obj = Object.create(Ed25519KeyHashes.prototype);
+ obj.ptr = ptr;
+ Ed25519KeyHashesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_js_value(retptr, this.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.ed25519keyhashes_new();
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Ed25519KeyHash}
+ */
+ get(index) {
+ const ret = wasm.ed25519keyhashes_get(this.ptr, index);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} elem
+ */
+ add(elem) {
+ _assertClass(elem, Ed25519KeyHash);
+ wasm.ed25519keyhashes_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.Ed25519KeyHashes = Ed25519KeyHashes;
+
+const Ed25519SignatureFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_ed25519signature_free(ptr)
+);
+/** */
+class Ed25519Signature {
+ static __wrap(ptr) {
+ const obj = Object.create(Ed25519Signature.prototype);
+ obj.ptr = ptr;
+ Ed25519SignatureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_bech32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519signature_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_hex() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519signature_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_enterpriseaddress_free(ptr)
+);
+/** */
+class EnterpriseAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(EnterpriseAddress.prototype);
+ obj.ptr = ptr;
+ EnterpriseAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ EnterpriseAddressFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_enterpriseaddress_free(ptr);
+ }
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @returns {EnterpriseAddress}
+ */
+ static new(network, payment) {
+ _assertClass(payment, StakeCredential);
+ const ret = wasm.enterpriseaddress_new(network, payment.ptr);
+ return EnterpriseAddress.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Address}
+ */
+ to_address() {
+ const ret = wasm.enterpriseaddress_to_address(this.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {EnterpriseAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_enterprise(addr.ptr);
+ return ret === 0 ? undefined : EnterpriseAddress.__wrap(ret);
+ }
+}
+module.exports.EnterpriseAddress = EnterpriseAddress;
+
+const ExUnitPricesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_exunitprices_free(ptr)
+);
+/** */
+class ExUnitPrices {
+ static __wrap(ptr) {
+ const obj = Object.create(ExUnitPrices.prototype);
+ obj.ptr = ptr;
+ ExUnitPricesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {UnitInterval}
+ */
+ mem_price() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ step_price() {
+ const ret = wasm.drepvotingthresholds_committee_normal(this.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.ptr, step_price.ptr);
+ return ExUnitPrices.__wrap(ret);
+ }
+ /**
+ * @param {number} mem_price
+ * @param {number} step_price
+ * @returns {ExUnitPrices}
+ */
+ static from_float(mem_price, step_price) {
+ const ret = wasm.exunitprices_from_float(mem_price, step_price);
+ return ExUnitPrices.__wrap(ret);
+ }
+}
+module.exports.ExUnitPrices = ExUnitPrices;
+
+const ExUnitsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_exunits_free(ptr)
+);
+/** */
+class ExUnits {
+ static __wrap(ptr) {
+ const obj = Object.create(ExUnits.prototype);
+ obj.ptr = ptr;
+ ExUnitsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {BigNum}
+ */
+ mem() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ steps() {
+ const ret = wasm.exunits_steps(this.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.ptr, steps.ptr);
+ return ExUnits.__wrap(ret);
+ }
+}
+module.exports.ExUnits = ExUnits;
+
+const GeneralTransactionMetadataFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_generaltransactionmetadata_free(ptr)
+);
+/** */
+class GeneralTransactionMetadata {
+ static __wrap(ptr) {
+ const obj = Object.create(GeneralTransactionMetadata.prototype);
+ obj.ptr = ptr;
+ GeneralTransactionMetadataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.generaltransactionmetadata_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.generaltransactionmetadata_to_js_value(retptr, this.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.auxiliarydataset_new();
+ return GeneralTransactionMetadata.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.auxiliarydataset_len(this.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.ptr,
+ key.ptr,
+ value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : TransactionMetadatum.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionMetadatumLabels}
+ */
+ keys() {
+ const ret = wasm.generaltransactionmetadata_keys(this.ptr);
+ return TransactionMetadatumLabels.__wrap(ret);
+ }
+}
+module.exports.GeneralTransactionMetadata = GeneralTransactionMetadata;
+
+const GenesisDelegateHashFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_genesisdelegatehash_free(ptr)
+);
+/** */
+class GenesisDelegateHash {
+ static __wrap(ptr) {
+ const obj = Object.create(GenesisDelegateHash.prototype);
+ obj.ptr = ptr;
+ GenesisDelegateHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_genesishash_free(ptr)
+);
+/** */
+class GenesisHash {
+ static __wrap(ptr) {
+ const obj = Object.create(GenesisHash.prototype);
+ obj.ptr = ptr;
+ GenesisHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_genesishashes_free(ptr)
+);
+/** */
+class GenesisHashes {
+ static __wrap(ptr) {
+ const obj = Object.create(GenesisHashes.prototype);
+ obj.ptr = ptr;
+ GenesisHashesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_js_value(retptr, this.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.ed25519keyhashes_new();
+ return GenesisHashes.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {GenesisHash}
+ */
+ get(index) {
+ const ret = wasm.genesishashes_get(this.ptr, index);
+ return GenesisHash.__wrap(ret);
+ }
+ /**
+ * @param {GenesisHash} elem
+ */
+ add(elem) {
+ _assertClass(elem, GenesisHash);
+ wasm.ed25519keyhashes_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.GenesisHashes = GenesisHashes;
+
+const GenesisKeyDelegationFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_genesiskeydelegation_free(ptr)
+);
+/** */
+class GenesisKeyDelegation {
+ static __wrap(ptr) {
+ const obj = Object.create(GenesisKeyDelegation.prototype);
+ obj.ptr = ptr;
+ GenesisKeyDelegationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.genesiskeydelegation_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.genesiskeydelegation_to_js_value(retptr, this.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.ptr);
+ return GenesisHash.__wrap(ret);
+ }
+ /**
+ * @returns {GenesisDelegateHash}
+ */
+ genesis_delegate_hash() {
+ const ret = wasm.genesiskeydelegation_genesis_delegate_hash(this.ptr);
+ return GenesisDelegateHash.__wrap(ret);
+ }
+ /**
+ * @returns {VRFKeyHash}
+ */
+ vrf_keyhash() {
+ const ret = wasm.genesiskeydelegation_vrf_keyhash(this.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.ptr,
+ genesis_delegate_hash.ptr,
+ vrf_keyhash.ptr,
+ );
+ return GenesisKeyDelegation.__wrap(ret);
+ }
+}
+module.exports.GenesisKeyDelegation = GenesisKeyDelegation;
+
+const GovernanceActionFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_governanceaction_free(ptr)
+);
+/** */
+class GovernanceAction {
+ static __wrap(ptr) {
+ const obj = Object.create(GovernanceAction.prototype);
+ obj.ptr = ptr;
+ GovernanceActionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.governanceaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.governanceaction_to_js_value(retptr, this.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.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.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.ptr,
+ );
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @returns {GovernanceAction}
+ */
+ static new_no_confidence() {
+ const ret = wasm.governanceaction_new_no_confidence();
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @param {NewCommittee} new_committe
+ * @returns {GovernanceAction}
+ */
+ static new_new_committee(new_committe) {
+ _assertClass(new_committe, NewCommittee);
+ const ret = wasm.governanceaction_new_new_committee(new_committe.ptr);
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @param {NewConstitution} new_constitution
+ * @returns {GovernanceAction}
+ */
+ static new_new_constitution(new_constitution) {
+ _assertClass(new_constitution, NewConstitution);
+ const ret = wasm.governanceaction_new_new_constitution(
+ new_constitution.ptr,
+ );
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @returns {GovernanceAction}
+ */
+ static new_info_action() {
+ const ret = wasm.governanceaction_new_info_action();
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.governanceaction_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {ParameterChangeAction | undefined}
+ */
+ as_parameter_change_action() {
+ const ret = wasm.governanceaction_as_parameter_change_action(this.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.ptr);
+ return ret === 0 ? undefined : HardForkInitiationAction.__wrap(ret);
+ }
+ /**
+ * @returns {TreasuryWithdrawalsAction | undefined}
+ */
+ as_treasury_withdrawals_action() {
+ const ret = wasm.governanceaction_as_treasury_withdrawals_action(this.ptr);
+ return ret === 0 ? undefined : TreasuryWithdrawalsAction.__wrap(ret);
+ }
+ /**
+ * @returns {NewCommittee | undefined}
+ */
+ as_new_committee() {
+ const ret = wasm.governanceaction_as_new_committee(this.ptr);
+ return ret === 0 ? undefined : NewCommittee.__wrap(ret);
+ }
+ /**
+ * @returns {NewConstitution | undefined}
+ */
+ as_new_constitution() {
+ const ret = wasm.governanceaction_as_new_constitution(this.ptr);
+ return ret === 0 ? undefined : NewConstitution.__wrap(ret);
+ }
+}
+module.exports.GovernanceAction = GovernanceAction;
+
+const GovernanceActionIdFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_governanceactionid_free(ptr)
+);
+/** */
+class GovernanceActionId {
+ static __wrap(ptr) {
+ const obj = Object.create(GovernanceActionId.prototype);
+ obj.ptr = ptr;
+ GovernanceActionIdFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.governanceactionid_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.governanceactionid_to_js_value(retptr, this.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.ptr);
+ return TransactionHash.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ governance_action_index() {
+ const ret = wasm.governanceactionid_governance_action_index(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {TransactionHash} transaction_id
+ * @param {BigNum} governance_action_index
+ * @returns {GovernanceActionId}
+ */
+ static new(transaction_id, governance_action_index) {
+ _assertClass(transaction_id, TransactionHash);
+ _assertClass(governance_action_index, BigNum);
+ const ret = wasm.governanceactionid_new(
+ transaction_id.ptr,
+ governance_action_index.ptr,
+ );
+ return GovernanceActionId.__wrap(ret);
+ }
+}
+module.exports.GovernanceActionId = GovernanceActionId;
+
+const HardForkInitiationActionFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_hardforkinitiationaction_free(ptr)
+);
+/** */
+class HardForkInitiationAction {
+ static __wrap(ptr) {
+ const obj = Object.create(HardForkInitiationAction.prototype);
+ obj.ptr = ptr;
+ HardForkInitiationActionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.hardforkinitiationaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.hardforkinitiationaction_to_js_value(retptr, this.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 {ProtocolVersion}
+ */
+ protocol_version() {
+ const ret = wasm.hardforkinitiationaction_new(this.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.ptr);
+ return HardForkInitiationAction.__wrap(ret);
+ }
+}
+module.exports.HardForkInitiationAction = HardForkInitiationAction;
+
+const HeaderFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_header_free(ptr)
+);
+/** */
+class Header {
+ static __wrap(ptr) {
+ const obj = Object.create(Header.prototype);
+ obj.ptr = ptr;
+ HeaderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.header_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.header_to_js_value(retptr, this.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.ptr);
+ return HeaderBody.__wrap(ret);
+ }
+ /**
+ * @returns {KESSignature}
+ */
+ body_signature() {
+ const ret = wasm.header_body_signature(this.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.ptr, body_signature.ptr);
+ return Header.__wrap(ret);
+ }
+}
+module.exports.Header = Header;
+
+const HeaderBodyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_headerbody_free(ptr)
+);
+/** */
+class HeaderBody {
+ static __wrap(ptr) {
+ const obj = Object.create(HeaderBody.prototype);
+ obj.ptr = ptr;
+ HeaderBodyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headerbody_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.headerbody_to_js_value(retptr, this.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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {BigNum}
+ */
+ slot() {
+ const ret = wasm.headerbody_slot(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BlockHash | undefined}
+ */
+ prev_hash() {
+ const ret = wasm.headerbody_prev_hash(this.ptr);
+ return ret === 0 ? undefined : BlockHash.__wrap(ret);
+ }
+ /**
+ * @returns {Vkey}
+ */
+ issuer_vkey() {
+ const ret = wasm.headerbody_issuer_vkey(this.ptr);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @returns {VRFVKey}
+ */
+ vrf_vkey() {
+ const ret = wasm.headerbody_vrf_vkey(this.ptr);
+ return VRFVKey.__wrap(ret);
+ }
+ /**
+ * @returns {VRFCert}
+ */
+ nonce_vrf() {
+ const ret = wasm.headerbody_nonce_vrf(this.ptr);
+ return VRFCert.__wrap(ret);
+ }
+ /**
+ * @returns {VRFCert}
+ */
+ leader_vrf() {
+ const ret = wasm.headerbody_leader_vrf(this.ptr);
+ return VRFCert.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ block_body_size() {
+ const ret = wasm.headerbody_block_body_size(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {BlockHash}
+ */
+ block_body_hash() {
+ const ret = wasm.headerbody_block_body_hash(this.ptr);
+ return BlockHash.__wrap(ret);
+ }
+ /**
+ * @returns {OperationalCert}
+ */
+ operational_cert() {
+ const ret = wasm.headerbody_operational_cert(this.ptr);
+ return OperationalCert.__wrap(ret);
+ }
+ /**
+ * @returns {ProtocolVersion}
+ */
+ protocol_version() {
+ const ret = wasm.headerbody_protocol_version(this.ptr);
+ return ProtocolVersion.__wrap(ret);
+ }
+ /**
+ * @param {number} block_number
+ * @param {BigNum} slot
+ * @param {BlockHash | undefined} prev_hash
+ * @param {Vkey} issuer_vkey
+ * @param {VRFVKey} vrf_vkey
+ * @param {VRFCert} nonce_vrf
+ * @param {VRFCert} leader_vrf
+ * @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,
+ nonce_vrf,
+ leader_vrf,
+ 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(nonce_vrf, VRFCert);
+ _assertClass(leader_vrf, VRFCert);
+ _assertClass(block_body_hash, BlockHash);
+ _assertClass(operational_cert, OperationalCert);
+ _assertClass(protocol_version, ProtocolVersion);
+ const ret = wasm.headerbody_new(
+ block_number,
+ slot.ptr,
+ ptr0,
+ issuer_vkey.ptr,
+ vrf_vkey.ptr,
+ nonce_vrf.ptr,
+ leader_vrf.ptr,
+ block_body_size,
+ block_body_hash.ptr,
+ operational_cert.ptr,
+ protocol_version.ptr,
+ );
+ return HeaderBody.__wrap(ret);
+ }
+}
+module.exports.HeaderBody = HeaderBody;
+
+const IntFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_int_free(ptr)
+);
+/** */
+class Int {
+ static __wrap(ptr) {
+ const obj = Object.create(Int.prototype);
+ obj.ptr = ptr;
+ IntFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new(x) {
+ _assertClass(x, BigNum);
+ const ret = wasm.int_new(x.ptr);
+ return Int.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} x
+ * @returns {Int}
+ */
+ static new_negative(x) {
+ _assertClass(x, BigNum);
+ const ret = wasm.int_new_negative(x.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.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.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.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.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.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.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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.int_to_str(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_ipv4_free(ptr)
+);
+/** */
+class Ipv4 {
+ static __wrap(ptr) {
+ const obj = Object.create(Ipv4.prototype);
+ obj.ptr = ptr;
+ Ipv4Finalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ipv4_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ipv4_to_js_value(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.Ipv4 = Ipv4;
+
+const Ipv6Finalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_ipv6_free(ptr)
+);
+/** */
+class Ipv6 {
+ static __wrap(ptr) {
+ const obj = Object.create(Ipv6.prototype);
+ obj.ptr = ptr;
+ Ipv6Finalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ipv6_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ipv6_to_js_value(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.Ipv6 = Ipv6;
+
+const KESSignatureFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_kessignature_free(ptr)
+);
+/** */
+class KESSignature {
+ static __wrap(ptr) {
+ const obj = Object.create(KESSignature.prototype);
+ obj.ptr = ptr;
+ KESSignatureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.assetname_name(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_kesvkey_free(ptr)
+);
+/** */
+class KESVKey {
+ static __wrap(ptr) {
+ const obj = Object.create(KESVKey.prototype);
+ obj.ptr = ptr;
+ KESVKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_language_free(ptr)
+);
+/** */
+class Language {
+ static __wrap(ptr) {
+ const obj = Object.create(Language.prototype);
+ obj.ptr = ptr;
+ LanguageFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {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 {number}
+ */
+ kind() {
+ const ret = wasm.language_kind(this.ptr);
+ return ret >>> 0;
+ }
+}
+module.exports.Language = Language;
+
+const LanguagesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_languages_free(ptr)
+);
+/** */
+class Languages {
+ static __wrap(ptr) {
+ const obj = Object.create(Languages.prototype);
+ obj.ptr = ptr;
+ LanguagesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ed25519keyhashes_new();
+ return Languages.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Language}
+ */
+ get(index) {
+ const ret = wasm.languages_get(this.ptr, index);
+ return Language.__wrap(ret);
+ }
+ /**
+ * @param {Language} elem
+ */
+ add(elem) {
+ _assertClass(elem, Language);
+ var ptr0 = elem.__destroy_into_raw();
+ wasm.languages_add(this.ptr, ptr0);
+ }
+}
+module.exports.Languages = Languages;
+
+const LegacyDaedalusPrivateKeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_legacydaedalusprivatekey_free(ptr)
+);
+/** */
+class LegacyDaedalusPrivateKey {
+ static __wrap(ptr) {
+ const obj = Object.create(LegacyDaedalusPrivateKey.prototype);
+ obj.ptr = ptr;
+ LegacyDaedalusPrivateKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.bip32privatekey_as_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ chaincode() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bip32privatekey_chaincode(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.LegacyDaedalusPrivateKey = LegacyDaedalusPrivateKey;
+
+const LinearFeeFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_linearfee_free(ptr)
+);
+/** */
+class LinearFee {
+ static __wrap(ptr) {
+ const obj = Object.create(LinearFee.prototype);
+ obj.ptr = ptr;
+ LinearFeeFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coefficient() {
+ const ret = wasm.linearfee_coefficient(this.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.ptr, constant.ptr);
+ return LinearFee.__wrap(ret);
+ }
+}
+module.exports.LinearFee = LinearFee;
+
+const MIRToStakeCredentialsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_mirtostakecredentials_free(ptr)
+);
+/** */
+class MIRToStakeCredentials {
+ static __wrap(ptr) {
+ const obj = Object.create(MIRToStakeCredentials.prototype);
+ obj.ptr = ptr;
+ MIRToStakeCredentialsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.mirtostakecredentials_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.mirtostakecredentials_to_js_value(retptr, this.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.auxiliarydataset_new();
+ return MIRToStakeCredentials.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.auxiliarydataset_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {StakeCredential} cred
+ * @param {Int} delta
+ * @returns {Int | undefined}
+ */
+ insert(cred, delta) {
+ _assertClass(cred, StakeCredential);
+ _assertClass(delta, Int);
+ const ret = wasm.mirtostakecredentials_insert(
+ this.ptr,
+ cred.ptr,
+ delta.ptr,
+ );
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} cred
+ * @returns {Int | undefined}
+ */
+ get(cred) {
+ _assertClass(cred, StakeCredential);
+ const ret = wasm.mirtostakecredentials_get(this.ptr, cred.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredentials}
+ */
+ keys() {
+ const ret = wasm.mirtostakecredentials_keys(this.ptr);
+ return StakeCredentials.__wrap(ret);
+ }
+}
+module.exports.MIRToStakeCredentials = MIRToStakeCredentials;
+
+const MetadataListFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_metadatalist_free(ptr)
+);
+/** */
+class MetadataList {
+ static __wrap(ptr) {
+ const obj = Object.create(MetadataList.prototype);
+ obj.ptr = ptr;
+ MetadataListFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {MetadataList}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return MetadataList.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionMetadatum}
+ */
+ get(index) {
+ const ret = wasm.metadatalist_get(this.ptr, index);
+ return TransactionMetadatum.__wrap(ret);
+ }
+ /**
+ * @param {TransactionMetadatum} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionMetadatum);
+ wasm.metadatalist_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.MetadataList = MetadataList;
+
+const MetadataMapFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_metadatamap_free(ptr)
+);
+/** */
+class MetadataMap {
+ static __wrap(ptr) {
+ const obj = Object.create(MetadataMap.prototype);
+ obj.ptr = ptr;
+ MetadataMapFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {MetadataMap}
+ */
+ static new() {
+ const ret = wasm.auxiliarydataset_new();
+ return MetadataMap.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.auxiliarydataset_len(this.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.ptr, key.ptr, value.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.ptr, ptr0, len0, value.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.ptr, key, value.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.ptr, key.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.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.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.ptr, key.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {MetadataList}
+ */
+ keys() {
+ const ret = wasm.metadatamap_keys(this.ptr);
+ return MetadataList.__wrap(ret);
+ }
+}
+module.exports.MetadataMap = MetadataMap;
+
+const MintFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_mint_free(ptr)
+);
+/** */
+class Mint {
+ static __wrap(ptr) {
+ const obj = Object.create(Mint.prototype);
+ obj.ptr = ptr;
+ MintFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.mint_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.mint_to_js_value(retptr, this.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.assets_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.ptr, value.ptr);
+ return Mint.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.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.ptr, key.ptr, value.ptr);
+ return ret === 0 ? undefined : MintAssets.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} key
+ * @returns {MintAssets | undefined}
+ */
+ get(key) {
+ _assertClass(key, ScriptHash);
+ const ret = wasm.mint_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : MintAssets.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHashes}
+ */
+ keys() {
+ const ret = wasm.mint_keys(this.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.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.ptr);
+ return MultiAsset.__wrap(ret);
+ }
+}
+module.exports.Mint = Mint;
+
+const MintAssetsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_mintassets_free(ptr)
+);
+/** */
+class MintAssets {
+ static __wrap(ptr) {
+ const obj = Object.create(MintAssets.prototype);
+ obj.ptr = ptr;
+ MintAssetsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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) {
+ _assertClass(key, AssetName);
+ _assertClass(value, Int);
+ var ptr0 = value.__destroy_into_raw();
+ const ret = wasm.mintassets_new_from_entry(key.ptr, ptr0);
+ return MintAssets.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {AssetName} key
+ * @param {Int} value
+ * @returns {Int | undefined}
+ */
+ insert(key, value) {
+ _assertClass(key, AssetName);
+ _assertClass(value, Int);
+ var ptr0 = value.__destroy_into_raw();
+ const ret = wasm.mintassets_insert(this.ptr, key.ptr, ptr0);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @param {AssetName} key
+ * @returns {Int | undefined}
+ */
+ get(key) {
+ _assertClass(key, AssetName);
+ const ret = wasm.mintassets_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : Int.__wrap(ret);
+ }
+ /**
+ * @returns {AssetNames}
+ */
+ keys() {
+ const ret = wasm.mintassets_keys(this.ptr);
+ return AssetNames.__wrap(ret);
+ }
+}
+module.exports.MintAssets = MintAssets;
+
+const MoveInstantaneousRewardFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_moveinstantaneousreward_free(ptr)
+);
+/** */
+class MoveInstantaneousReward {
+ static __wrap(ptr) {
+ const obj = Object.create(MoveInstantaneousReward.prototype);
+ obj.ptr = ptr;
+ MoveInstantaneousRewardFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.moveinstantaneousreward_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.moveinstantaneousreward_to_js_value(retptr, this.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 {number} 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.ptr);
+ return MoveInstantaneousReward.__wrap(ret);
+ }
+ /**
+ * @param {number} 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.ptr,
+ );
+ return MoveInstantaneousReward.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ pot() {
+ const ret = wasm.moveinstantaneousreward_pot(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.moveinstantaneousreward_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ as_to_other_pot() {
+ const ret = wasm.moveinstantaneousreward_as_to_other_pot(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {MIRToStakeCredentials | undefined}
+ */
+ as_to_stake_creds() {
+ const ret = wasm.moveinstantaneousreward_as_to_stake_creds(this.ptr);
+ return ret === 0 ? undefined : MIRToStakeCredentials.__wrap(ret);
+ }
+}
+module.exports.MoveInstantaneousReward = MoveInstantaneousReward;
+
+const MoveInstantaneousRewardsCertFinalization = new FinalizationRegistry(
+ (ptr) => wasm.__wbg_moveinstantaneousrewardscert_free(ptr)
+);
+/** */
+class MoveInstantaneousRewardsCert {
+ static __wrap(ptr) {
+ const obj = Object.create(MoveInstantaneousRewardsCert.prototype);
+ obj.ptr = ptr;
+ MoveInstantaneousRewardsCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.moveinstantaneousrewardscert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.moveinstantaneousrewardscert_to_js_value(retptr, this.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.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.ptr,
+ );
+ return MoveInstantaneousRewardsCert.__wrap(ret);
+ }
+}
+module.exports.MoveInstantaneousRewardsCert = MoveInstantaneousRewardsCert;
+
+const MultiAssetFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_multiasset_free(ptr)
+);
+/** */
+class MultiAsset {
+ static __wrap(ptr) {
+ const obj = Object.create(MultiAsset.prototype);
+ obj.ptr = ptr;
+ MultiAssetFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.multiasset_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.multiasset_to_js_value(retptr, this.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.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.ptr, policy_id.ptr, assets.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.ptr, policy_id.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);
+ var ptr0 = value.__destroy_into_raw();
+ const ret = wasm.multiasset_set_asset(
+ this.ptr,
+ policy_id.ptr,
+ asset_name.ptr,
+ ptr0,
+ );
+ 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.ptr,
+ policy_id.ptr,
+ asset_name.ptr,
+ );
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * returns all policy IDs used by assets in this multiasset
+ * @returns {ScriptHashes}
+ */
+ keys() {
+ const ret = wasm.mint_keys(this.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.ptr, rhs_ma.ptr);
+ return MultiAsset.__wrap(ret);
+ }
+}
+module.exports.MultiAsset = MultiAsset;
+
+const MultiHostNameFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_multihostname_free(ptr)
+);
+/** */
+class MultiHostName {
+ static __wrap(ptr) {
+ const obj = Object.create(MultiHostName.prototype);
+ obj.ptr = ptr;
+ MultiHostNameFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.multihostname_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.multihostname_to_js_value(retptr, this.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.anchor_anchor_url(this.ptr);
+ return DNSRecordSRV.__wrap(ret);
+ }
+ /**
+ * @param {DNSRecordSRV} dns_name
+ * @returns {MultiHostName}
+ */
+ static new(dns_name) {
+ _assertClass(dns_name, DNSRecordSRV);
+ const ret = wasm.multihostname_new(dns_name.ptr);
+ return MultiHostName.__wrap(ret);
+ }
+}
+module.exports.MultiHostName = MultiHostName;
+
+const NativeScriptFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_nativescript_free(ptr)
+);
+/** */
+class NativeScript {
+ static __wrap(ptr) {
+ const obj = Object.create(NativeScript.prototype);
+ obj.ptr = ptr;
+ NativeScriptFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.nativescript_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.nativescript_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @param {number} namespace
+ * @returns {ScriptHash}
+ */
+ hash(namespace) {
+ const ret = wasm.nativescript_hash(this.ptr, namespace);
+ 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.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.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.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.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.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.ptr);
+ return NativeScript.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.nativescript_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {ScriptPubkey | undefined}
+ */
+ as_script_pubkey() {
+ const ret = wasm.nativescript_as_script_pubkey(this.ptr);
+ return ret === 0 ? undefined : ScriptPubkey.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptAll | undefined}
+ */
+ as_script_all() {
+ const ret = wasm.nativescript_as_script_all(this.ptr);
+ return ret === 0 ? undefined : ScriptAll.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptAny | undefined}
+ */
+ as_script_any() {
+ const ret = wasm.nativescript_as_script_any(this.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.ptr);
+ return ret === 0 ? undefined : ScriptNOfK.__wrap(ret);
+ }
+ /**
+ * @returns {TimelockStart | undefined}
+ */
+ as_timelock_start() {
+ const ret = wasm.nativescript_as_timelock_start(this.ptr);
+ return ret === 0 ? undefined : TimelockStart.__wrap(ret);
+ }
+ /**
+ * @returns {TimelockExpiry | undefined}
+ */
+ as_timelock_expiry() {
+ const ret = wasm.nativescript_as_timelock_expiry(this.ptr);
+ return ret === 0 ? undefined : TimelockExpiry.__wrap(ret);
+ }
+ /**
+ * Returns an array of unique 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.ptr);
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @param {BigNum | undefined} lower_bound
+ * @param {BigNum | undefined} upper_bound
+ * @param {Ed25519KeyHashes} key_hashes
+ * @returns {boolean}
+ */
+ verify(lower_bound, upper_bound, key_hashes) {
+ let ptr0 = 0;
+ if (!isLikeNone(lower_bound)) {
+ _assertClass(lower_bound, BigNum);
+ ptr0 = lower_bound.__destroy_into_raw();
+ }
+ let ptr1 = 0;
+ if (!isLikeNone(upper_bound)) {
+ _assertClass(upper_bound, BigNum);
+ ptr1 = upper_bound.__destroy_into_raw();
+ }
+ _assertClass(key_hashes, Ed25519KeyHashes);
+ const ret = wasm.nativescript_verify(this.ptr, ptr0, ptr1, key_hashes.ptr);
+ return ret !== 0;
+ }
+}
+module.exports.NativeScript = NativeScript;
+
+const NativeScriptsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_nativescripts_free(ptr)
+);
+/** */
+class NativeScripts {
+ static __wrap(ptr) {
+ const obj = Object.create(NativeScripts.prototype);
+ obj.ptr = ptr;
+ NativeScriptsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.certificates_new();
+ return NativeScripts.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {NativeScript}
+ */
+ get(index) {
+ const ret = wasm.nativescripts_get(this.ptr, index);
+ return NativeScript.__wrap(ret);
+ }
+ /**
+ * @param {NativeScript} elem
+ */
+ add(elem) {
+ _assertClass(elem, NativeScript);
+ wasm.nativescripts_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.NativeScripts = NativeScripts;
+
+const NetworkIdFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_networkid_free(ptr)
+);
+/** */
+class NetworkId {
+ static __wrap(ptr) {
+ const obj = Object.create(NetworkId.prototype);
+ obj.ptr = ptr;
+ NetworkIdFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.networkid_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.networkid_to_js_value(retptr, this.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 {number}
+ */
+ kind() {
+ const ret = wasm.networkid_kind(this.ptr);
+ return ret >>> 0;
+ }
+}
+module.exports.NetworkId = NetworkId;
+
+const NetworkInfoFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_networkinfo_free(ptr)
+);
+/** */
+class NetworkInfo {
+ static __wrap(ptr) {
+ const obj = Object.create(NetworkInfo.prototype);
+ obj.ptr = ptr;
+ NetworkInfoFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ return ret;
+ }
+ /**
+ * @returns {number}
+ */
+ protocol_magic() {
+ const ret = wasm.networkinfo_protocol_magic(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {NetworkInfo}
+ */
+ static testnet() {
+ const ret = wasm.networkinfo_testnet();
+ return NetworkInfo.__wrap(ret);
+ }
+ /**
+ * @returns {NetworkInfo}
+ */
+ static mainnet() {
+ const ret = wasm.networkinfo_mainnet();
+ return NetworkInfo.__wrap(ret);
+ }
+}
+module.exports.NetworkInfo = NetworkInfo;
+
+const NewCommitteeFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_newcommittee_free(ptr)
+);
+/** */
+class NewCommittee {
+ static __wrap(ptr) {
+ const obj = Object.create(NewCommittee.prototype);
+ obj.ptr = ptr;
+ NewCommitteeFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ NewCommitteeFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_newcommittee_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newcommittee_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {NewCommittee}
+ */
+ 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.newcommittee_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 NewCommittee.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newcommittee_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newcommittee_to_js_value(retptr, this.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 {NewCommittee}
+ */
+ 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.newcommittee_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 NewCommittee.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ committee() {
+ const ret = wasm.newcommittee_committee(this.ptr);
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ rational() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHashes} committee
+ * @param {UnitInterval} rational
+ * @returns {NewCommittee}
+ */
+ static new(committee, rational) {
+ _assertClass(committee, Ed25519KeyHashes);
+ _assertClass(rational, UnitInterval);
+ const ret = wasm.newcommittee_new(committee.ptr, rational.ptr);
+ return NewCommittee.__wrap(ret);
+ }
+}
+module.exports.NewCommittee = NewCommittee;
+
+const NewConstitutionFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_newconstitution_free(ptr)
+);
+/** */
+class NewConstitution {
+ static __wrap(ptr) {
+ const obj = Object.create(NewConstitution.prototype);
+ obj.ptr = ptr;
+ NewConstitutionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ NewConstitutionFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_newconstitution_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newconstitution_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {NewConstitution}
+ */
+ 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.newconstitution_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 NewConstitution.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newconstitution_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.newconstitution_to_js_value(retptr, this.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 {NewConstitution}
+ */
+ 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.newconstitution_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 NewConstitution.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {DataHash}
+ */
+ hash() {
+ const ret = wasm.genesiskeydelegation_vrf_keyhash(this.ptr);
+ return DataHash.__wrap(ret);
+ }
+ /**
+ * @param {DataHash} hash
+ * @returns {NewConstitution}
+ */
+ static new(hash) {
+ _assertClass(hash, DataHash);
+ const ret = wasm.newconstitution_new(hash.ptr);
+ return NewConstitution.__wrap(ret);
+ }
+}
+module.exports.NewConstitution = NewConstitution;
+
+const NonceFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_nonce_free(ptr)
+);
+/** */
+class Nonce {
+ static __wrap(ptr) {
+ const obj = Object.create(Nonce.prototype);
+ obj.ptr = ptr;
+ NonceFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.Nonce = Nonce;
+
+const OperationalCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_operationalcert_free(ptr)
+);
+/** */
+class OperationalCert {
+ static __wrap(ptr) {
+ const obj = Object.create(OperationalCert.prototype);
+ obj.ptr = ptr;
+ OperationalCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.operationalcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.operationalcert_to_js_value(retptr, this.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.ptr);
+ return KESVKey.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ sequence_number() {
+ const ret = wasm.operationalcert_sequence_number(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {number}
+ */
+ kes_period() {
+ const ret = wasm.operationalcert_kes_period(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Ed25519Signature}
+ */
+ sigma() {
+ const ret = wasm.operationalcert_sigma(this.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.ptr,
+ sequence_number,
+ kes_period,
+ sigma.ptr,
+ );
+ return OperationalCert.__wrap(ret);
+ }
+}
+module.exports.OperationalCert = OperationalCert;
+
+const ParameterChangeActionFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_parameterchangeaction_free(ptr)
+);
+/** */
+class ParameterChangeAction {
+ static __wrap(ptr) {
+ const obj = Object.create(ParameterChangeAction.prototype);
+ obj.ptr = ptr;
+ ParameterChangeActionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.parameterchangeaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.parameterchangeaction_to_js_value(retptr, this.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 {ProtocolParamUpdate}
+ */
+ protocol_param_update() {
+ const ret = wasm.parameterchangeaction_protocol_param_update(this.ptr);
+ return ProtocolParamUpdate.__wrap(ret);
+ }
+ /**
+ * @param {ProtocolParamUpdate} protocol_param_update
+ * @returns {ParameterChangeAction}
+ */
+ static new(protocol_param_update) {
+ _assertClass(protocol_param_update, ProtocolParamUpdate);
+ const ret = wasm.parameterchangeaction_new(protocol_param_update.ptr);
+ return ParameterChangeAction.__wrap(ret);
+ }
+}
+module.exports.ParameterChangeAction = ParameterChangeAction;
+
+const PlutusDataFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_plutusdata_free(ptr)
+);
+/** */
+class PlutusData {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusData.prototype);
+ obj.ptr = ptr;
+ PlutusDataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @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.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {PlutusMap} map
+ * @returns {PlutusData}
+ */
+ static new_map(map) {
+ _assertClass(map, PlutusMap);
+ const ret = wasm.plutusdata_new_map(map.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {PlutusList} list
+ * @returns {PlutusData}
+ */
+ static new_list(list) {
+ _assertClass(list, PlutusList);
+ const ret = wasm.plutusdata_new_list(list.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {BigInt} integer
+ * @returns {PlutusData}
+ */
+ static new_integer(integer) {
+ _assertClass(integer, BigInt);
+ const ret = wasm.plutusdata_new_integer(integer.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 {number}
+ */
+ kind() {
+ const ret = wasm.plutusdata_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {ConstrPlutusData | undefined}
+ */
+ as_constr_plutus_data() {
+ const ret = wasm.plutusdata_as_constr_plutus_data(this.ptr);
+ return ret === 0 ? undefined : ConstrPlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusMap | undefined}
+ */
+ as_map() {
+ const ret = wasm.plutusdata_as_map(this.ptr);
+ return ret === 0 ? undefined : PlutusMap.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusList | undefined}
+ */
+ as_list() {
+ const ret = wasm.plutusdata_as_list(this.ptr);
+ return ret === 0 ? undefined : PlutusList.__wrap(ret);
+ }
+ /**
+ * @returns {BigInt | undefined}
+ */
+ as_integer() {
+ const ret = wasm.plutusdata_as_integer(this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.PlutusData = PlutusData;
+
+const PlutusListFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_plutuslist_free(ptr)
+);
+/** */
+class PlutusList {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusList.prototype);
+ obj.ptr = ptr;
+ PlutusListFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {PlutusList}
+ */
+ static new() {
+ const ret = wasm.plutuslist_new();
+ return PlutusList.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {PlutusData}
+ */
+ get(index) {
+ const ret = wasm.plutuslist_get(this.ptr, index);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {PlutusData} elem
+ */
+ add(elem) {
+ _assertClass(elem, PlutusData);
+ wasm.plutuslist_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.PlutusList = PlutusList;
+
+const PlutusMapFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_plutusmap_free(ptr)
+);
+/** */
+class PlutusMap {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusMap.prototype);
+ obj.ptr = ptr;
+ PlutusMapFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {PlutusMap}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return PlutusMap.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {PlutusData} key
+ * @param {PlutusData} value
+ * @returns {PlutusData | undefined}
+ */
+ insert(key, value) {
+ _assertClass(key, PlutusData);
+ _assertClass(value, PlutusData);
+ const ret = wasm.plutusmap_insert(this.ptr, key.ptr, value.ptr);
+ return ret === 0 ? undefined : PlutusData.__wrap(ret);
+ }
+ /**
+ * @param {PlutusData} key
+ * @returns {PlutusData | undefined}
+ */
+ get(key) {
+ _assertClass(key, PlutusData);
+ const ret = wasm.plutusmap_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : PlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusList}
+ */
+ keys() {
+ const ret = wasm.plutusmap_keys(this.ptr);
+ return PlutusList.__wrap(ret);
+ }
+}
+module.exports.PlutusMap = PlutusMap;
+
+const PlutusScriptFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_plutusscript_free(ptr)
+);
+/** */
+class PlutusScript {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusScript.prototype);
+ obj.ptr = ptr;
+ PlutusScriptFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @param {number} namespace
+ * @returns {ScriptHash}
+ */
+ hash(namespace) {
+ const ret = wasm.plutusscript_hash(this.ptr, namespace);
+ return ScriptHash.__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(bytes) {
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.plutusscript_new(ptr0, len0);
+ 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.assetname_name(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.PlutusScript = PlutusScript;
+
+const PlutusScriptsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_plutusscripts_free(ptr)
+);
+/** */
+class PlutusScripts {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusScripts.prototype);
+ obj.ptr = ptr;
+ PlutusScriptsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {PlutusScripts}
+ */
+ static new() {
+ const ret = wasm.assetnames_new();
+ return PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {PlutusScript}
+ */
+ get(index) {
+ const ret = wasm.plutusscripts_get(this.ptr, index);
+ return PlutusScript.__wrap(ret);
+ }
+ /**
+ * @param {PlutusScript} elem
+ */
+ add(elem) {
+ _assertClass(elem, PlutusScript);
+ wasm.assetnames_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.PlutusScripts = PlutusScripts;
+
+const PlutusWitnessFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_plutuswitness_free(ptr)
+);
+/** */
+class PlutusWitness {
+ static __wrap(ptr) {
+ const obj = Object.create(PlutusWitness.prototype);
+ obj.ptr = ptr;
+ PlutusWitnessFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PlutusWitnessFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_plutuswitness_free(ptr);
+ }
+ /**
+ * Plutus V1 witness or witness where no script is attached and so version doesn't matter
+ * @param {PlutusData} redeemer
+ * @param {PlutusData | undefined} plutus_data
+ * @param {PlutusScript | undefined} script
+ * @returns {PlutusWitness}
+ */
+ static new(redeemer, plutus_data, script) {
+ _assertClass(redeemer, PlutusData);
+ let ptr0 = 0;
+ if (!isLikeNone(plutus_data)) {
+ _assertClass(plutus_data, PlutusData);
+ ptr0 = plutus_data.__destroy_into_raw();
+ }
+ let ptr1 = 0;
+ if (!isLikeNone(script)) {
+ _assertClass(script, PlutusScript);
+ ptr1 = script.__destroy_into_raw();
+ }
+ const ret = wasm.plutuswitness_new(redeemer.ptr, ptr0, ptr1);
+ return PlutusWitness.__wrap(ret);
+ }
+ /**
+ * @param {PlutusData} redeemer
+ * @param {PlutusData | undefined} plutus_data
+ * @param {PlutusScript | undefined} script
+ * @returns {PlutusWitness}
+ */
+ static new_plutus_v2(redeemer, plutus_data, script) {
+ _assertClass(redeemer, PlutusData);
+ let ptr0 = 0;
+ if (!isLikeNone(plutus_data)) {
+ _assertClass(plutus_data, PlutusData);
+ ptr0 = plutus_data.__destroy_into_raw();
+ }
+ let ptr1 = 0;
+ if (!isLikeNone(script)) {
+ _assertClass(script, PlutusScript);
+ ptr1 = script.__destroy_into_raw();
+ }
+ const ret = wasm.plutuswitness_new_plutus_v2(redeemer.ptr, ptr0, ptr1);
+ return PlutusWitness.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusData | undefined}
+ */
+ plutus_data() {
+ const ret = wasm.plutuswitness_plutus_data(this.ptr);
+ return ret === 0 ? undefined : PlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusData}
+ */
+ redeemer() {
+ const ret = wasm.plutuswitness_redeemer(this.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ script() {
+ const ret = wasm.plutuswitness_script(this.ptr);
+ return ret === 0 ? undefined : PlutusScript.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ version() {
+ const ret = wasm.plutuswitness_version(this.ptr);
+ return ret >>> 0;
+ }
+}
+module.exports.PlutusWitness = PlutusWitness;
+
+const PointerFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_pointer_free(ptr)
+);
+/** */
+class Pointer {
+ static __wrap(ptr) {
+ const obj = Object.create(Pointer.prototype);
+ obj.ptr = ptr;
+ PointerFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PointerFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_pointer_free(ptr);
+ }
+ /**
+ * @param {BigNum} slot
+ * @param {BigNum} tx_index
+ * @param {BigNum} cert_index
+ * @returns {Pointer}
+ */
+ static new(slot, tx_index, cert_index) {
+ _assertClass(slot, BigNum);
+ _assertClass(tx_index, BigNum);
+ _assertClass(cert_index, BigNum);
+ const ret = wasm.pointer_new(slot.ptr, tx_index.ptr, cert_index.ptr);
+ return Pointer.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ slot() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ tx_index() {
+ const ret = wasm.exunits_steps(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ cert_index() {
+ const ret = wasm.constrplutusdata_alternative(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+}
+module.exports.Pointer = Pointer;
+
+const PointerAddressFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_pointeraddress_free(ptr)
+);
+/** */
+class PointerAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(PointerAddress.prototype);
+ obj.ptr = ptr;
+ PointerAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PointerAddressFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_pointeraddress_free(ptr);
+ }
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @param {Pointer} stake
+ * @returns {PointerAddress}
+ */
+ static new(network, payment, stake) {
+ _assertClass(payment, StakeCredential);
+ _assertClass(stake, Pointer);
+ const ret = wasm.pointeraddress_new(network, payment.ptr, stake.ptr);
+ return PointerAddress.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred() {
+ const ret = wasm.pointeraddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Pointer}
+ */
+ stake_pointer() {
+ const ret = wasm.pointeraddress_stake_pointer(this.ptr);
+ return Pointer.__wrap(ret);
+ }
+ /**
+ * @returns {Address}
+ */
+ to_address() {
+ const ret = wasm.pointeraddress_to_address(this.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {PointerAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_pointer(addr.ptr);
+ return ret === 0 ? undefined : PointerAddress.__wrap(ret);
+ }
+}
+module.exports.PointerAddress = PointerAddress;
+
+const PoolMetadataFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_poolmetadata_free(ptr)
+);
+/** */
+class PoolMetadata {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolMetadata.prototype);
+ obj.ptr = ptr;
+ PoolMetadataFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolmetadata_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolmetadata_to_js_value(retptr, this.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.anchor_anchor_url(this.ptr);
+ return Url.__wrap(ret);
+ }
+ /**
+ * @returns {PoolMetadataHash}
+ */
+ pool_metadata_hash() {
+ const ret = wasm.anchor_anchor_data_hash(this.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.anchor_new(url.ptr, pool_metadata_hash.ptr);
+ return PoolMetadata.__wrap(ret);
+ }
+}
+module.exports.PoolMetadata = PoolMetadata;
+
+const PoolMetadataHashFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_poolmetadatahash_free(ptr)
+);
+/** */
+class PoolMetadataHash {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolMetadataHash.prototype);
+ obj.ptr = ptr;
+ PoolMetadataHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_poolparams_free(ptr)
+);
+/** */
+class PoolParams {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolParams.prototype);
+ obj.ptr = ptr;
+ PoolParamsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolparams_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolparams_to_js_value(retptr, this.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.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {VRFKeyHash}
+ */
+ vrf_keyhash() {
+ const ret = wasm.governanceactionid_transaction_id(this.ptr);
+ return VRFKeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ pledge() {
+ const ret = wasm.headerbody_slot(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ cost() {
+ const ret = wasm.poolparams_cost(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ margin() {
+ const ret = wasm.drepvotingthresholds_committee_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {RewardAddress}
+ */
+ reward_account() {
+ const ret = wasm.poolparams_reward_account(this.ptr);
+ return RewardAddress.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ pool_owners() {
+ const ret = wasm.poolparams_pool_owners(this.ptr);
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @returns {Relays}
+ */
+ relays() {
+ const ret = wasm.poolparams_relays(this.ptr);
+ return Relays.__wrap(ret);
+ }
+ /**
+ * @returns {PoolMetadata | undefined}
+ */
+ pool_metadata() {
+ const ret = wasm.poolparams_pool_metadata(this.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.ptr,
+ vrf_keyhash.ptr,
+ pledge.ptr,
+ cost.ptr,
+ margin.ptr,
+ reward_account.ptr,
+ pool_owners.ptr,
+ relays.ptr,
+ ptr0,
+ );
+ return PoolParams.__wrap(ret);
+ }
+}
+module.exports.PoolParams = PoolParams;
+
+const PoolRegistrationFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_poolregistration_free(ptr)
+);
+/** */
+class PoolRegistration {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolRegistration.prototype);
+ obj.ptr = ptr;
+ PoolRegistrationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolregistration_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolregistration_to_js_value(retptr, this.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.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.ptr);
+ return PoolRegistration.__wrap(ret);
+ }
+ /**
+ * @param {boolean} update
+ */
+ set_is_update(update) {
+ wasm.poolregistration_set_is_update(this.ptr, update);
+ }
+}
+module.exports.PoolRegistration = PoolRegistration;
+
+const PoolRetirementFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_poolretirement_free(ptr)
+);
+/** */
+class PoolRetirement {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolRetirement.prototype);
+ obj.ptr = ptr;
+ PoolRetirementFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolretirement_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolretirement_to_js_value(retptr, this.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.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ epoch() {
+ const ret = wasm.poolretirement_epoch(this.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.ptr, epoch);
+ return PoolRetirement.__wrap(ret);
+ }
+}
+module.exports.PoolRetirement = PoolRetirement;
+
+const PoolVotingThresholdsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_poolvotingthresholds_free(ptr)
+);
+/** */
+class PoolVotingThresholds {
+ static __wrap(ptr) {
+ const obj = Object.create(PoolVotingThresholds.prototype);
+ obj.ptr = ptr;
+ PoolVotingThresholdsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolvotingthresholds_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.poolvotingthresholds_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ motion_no_confidence() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_normal() {
+ const ret = wasm.drepvotingthresholds_committee_normal(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ committee_no_confidence() {
+ const ret = wasm.drepvotingthresholds_committee_no_confidence(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @returns {UnitInterval}
+ */
+ hard_fork_initiation() {
+ const ret = wasm.drepvotingthresholds_update_constitution(this.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {UnitInterval} motion_no_confidence
+ * @param {UnitInterval} committee_normal
+ * @param {UnitInterval} committee_no_confidence
+ * @param {UnitInterval} hard_fork_initiation
+ * @returns {PoolVotingThresholds}
+ */
+ static new(
+ motion_no_confidence,
+ committee_normal,
+ committee_no_confidence,
+ hard_fork_initiation,
+ ) {
+ _assertClass(motion_no_confidence, UnitInterval);
+ _assertClass(committee_normal, UnitInterval);
+ _assertClass(committee_no_confidence, UnitInterval);
+ _assertClass(hard_fork_initiation, UnitInterval);
+ const ret = wasm.poolvotingthresholds_new(
+ motion_no_confidence.ptr,
+ committee_normal.ptr,
+ committee_no_confidence.ptr,
+ hard_fork_initiation.ptr,
+ );
+ return PoolVotingThresholds.__wrap(ret);
+ }
+}
+module.exports.PoolVotingThresholds = PoolVotingThresholds;
+
+const PrivateKeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_privatekey_free(ptr)
+);
+/** */
+class PrivateKey {
+ static __wrap(ptr) {
+ const obj = Object.create(PrivateKey.prototype);
+ obj.ptr = ptr;
+ PrivateKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PrivateKeyFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_privatekey_free(ptr);
+ }
+ /**
+ * @returns {PublicKey}
+ */
+ to_public() {
+ const ret = wasm.privatekey_to_public(this.ptr);
+ return PublicKey.__wrap(ret);
+ }
+ /**
+ * @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 {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);
+ }
+ }
+ /**
+ * 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 {string}
+ */
+ to_bech32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.privatekey_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.privatekey_as_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @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} message
+ * @returns {Ed25519Signature}
+ */
+ sign(message) {
+ const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.privatekey_sign(this.ptr, ptr0, len0);
+ return Ed25519Signature.__wrap(ret);
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {PrivateKey}
+ */
+ 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.privatekey_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 PrivateKey.__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.privatekey_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.PrivateKey = PrivateKey;
+
+const ProposalProcedureFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_proposalprocedure_free(ptr)
+);
+/** */
+class ProposalProcedure {
+ static __wrap(ptr) {
+ const obj = Object.create(ProposalProcedure.prototype);
+ obj.ptr = ptr;
+ ProposalProcedureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ProposalProcedureFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_proposalprocedure_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposalprocedure_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProposalProcedure}
+ */
+ 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.proposalprocedure_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 ProposalProcedure.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposalprocedure_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposalprocedure_to_js_value(retptr, this.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 {ProposalProcedure}
+ */
+ 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.proposalprocedure_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 ProposalProcedure.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {BigNum}
+ */
+ deposit() {
+ const ret = wasm.proposalprocedure_deposit(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash}
+ */
+ hash() {
+ const ret = wasm.proposalprocedure_hash(this.ptr);
+ return ScriptHash.__wrap(ret);
+ }
+ /**
+ * @returns {GovernanceAction}
+ */
+ governance_action() {
+ const ret = wasm.proposalprocedure_governance_action(this.ptr);
+ return GovernanceAction.__wrap(ret);
+ }
+ /**
+ * @returns {Anchor}
+ */
+ anchor() {
+ const ret = wasm.proposalprocedure_anchor(this.ptr);
+ return Anchor.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} deposit
+ * @param {ScriptHash} hash
+ * @param {GovernanceAction} governance_action
+ * @param {Anchor} anchor
+ * @returns {ProposalProcedure}
+ */
+ static new(deposit, hash, governance_action, anchor) {
+ _assertClass(deposit, BigNum);
+ _assertClass(hash, ScriptHash);
+ _assertClass(governance_action, GovernanceAction);
+ _assertClass(anchor, Anchor);
+ const ret = wasm.proposalprocedure_new(
+ deposit.ptr,
+ hash.ptr,
+ governance_action.ptr,
+ anchor.ptr,
+ );
+ return ProposalProcedure.__wrap(ret);
+ }
+}
+module.exports.ProposalProcedure = ProposalProcedure;
+
+const ProposalProceduresFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_proposalprocedures_free(ptr)
+);
+/** */
+class ProposalProcedures {
+ static __wrap(ptr) {
+ const obj = Object.create(ProposalProcedures.prototype);
+ obj.ptr = ptr;
+ ProposalProceduresFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ProposalProceduresFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_proposalprocedures_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposalprocedures_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {ProposalProcedures}
+ */
+ 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.proposalprocedures_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 ProposalProcedures.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {ProposalProcedures}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return ProposalProcedures.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {ProposalProcedure}
+ */
+ get(index) {
+ const ret = wasm.proposalprocedures_get(this.ptr, index);
+ return ProposalProcedure.__wrap(ret);
+ }
+ /**
+ * @param {ProposalProcedure} elem
+ */
+ add(elem) {
+ _assertClass(elem, ProposalProcedure);
+ wasm.proposalprocedures_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.ProposalProcedures = ProposalProcedures;
+
+const ProposedProtocolParameterUpdatesFinalization = new FinalizationRegistry(
+ (ptr) => wasm.__wbg_proposedprotocolparameterupdates_free(ptr)
+);
+/** */
+class ProposedProtocolParameterUpdates {
+ static __wrap(ptr) {
+ const obj = Object.create(ProposedProtocolParameterUpdates.prototype);
+ obj.ptr = ptr;
+ ProposedProtocolParameterUpdatesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposedprotocolparameterupdates_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.proposedprotocolparameterupdates_to_js_value(retptr, this.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.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.ptr,
+ key.ptr,
+ value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : ProtocolParamUpdate.__wrap(ret);
+ }
+ /**
+ * @returns {GenesisHashes}
+ */
+ keys() {
+ const ret = wasm.proposedprotocolparameterupdates_keys(this.ptr);
+ return GenesisHashes.__wrap(ret);
+ }
+}
+module.exports.ProposedProtocolParameterUpdates =
+ ProposedProtocolParameterUpdates;
+
+const ProtocolParamUpdateFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_protocolparamupdate_free(ptr)
+);
+/** */
+class ProtocolParamUpdate {
+ static __wrap(ptr) {
+ const obj = Object.create(ProtocolParamUpdate.prototype);
+ obj.ptr = ptr;
+ ProtocolParamUpdateFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_to_js_value(retptr, this.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.ptr, minfee_a.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ minfee_a() {
+ const ret = wasm.protocolparamupdate_minfee_a(this.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.ptr, minfee_b.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ minfee_b() {
+ const ret = wasm.protocolparamupdate_minfee_b(this.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.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.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.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.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.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.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.ptr, key_deposit.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ key_deposit() {
+ const ret = wasm.protocolparamupdate_key_deposit(this.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.ptr, pool_deposit.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ pool_deposit() {
+ const ret = wasm.protocolparamupdate_pool_deposit(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {number} max_epoch
+ */
+ set_max_epoch(max_epoch) {
+ wasm.protocolparamupdate_set_max_epoch(this.ptr, max_epoch);
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ max_epoch() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_max_epoch(retptr, this.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.ptr, n_opt);
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ n_opt() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_n_opt(retptr, this.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.ptr,
+ pool_pledge_influence.ptr,
+ );
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ pool_pledge_influence() {
+ const ret = wasm.protocolparamupdate_pool_pledge_influence(this.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.ptr, expansion_rate.ptr);
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ expansion_rate() {
+ const ret = wasm.protocolparamupdate_expansion_rate(this.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.ptr,
+ treasury_growth_rate.ptr,
+ );
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ treasury_growth_rate() {
+ const ret = wasm.protocolparamupdate_treasury_growth_rate(this.ptr);
+ return ret === 0 ? undefined : UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {UnitInterval} d
+ */
+ set_d(d) {
+ _assertClass(d, UnitInterval);
+ wasm.protocolparamupdate_set_d(this.ptr, d.ptr);
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ d() {
+ const ret = wasm.protocolparamupdate_d(this.ptr);
+ return ret === 0 ? undefined : UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {Nonce} extra_entropy
+ */
+ set_extra_entropy(extra_entropy) {
+ _assertClass(extra_entropy, Nonce);
+ wasm.protocolparamupdate_set_extra_entropy(this.ptr, extra_entropy.ptr);
+ }
+ /**
+ * @returns {Nonce | undefined}
+ */
+ extra_entropy() {
+ const ret = wasm.protocolparamupdate_extra_entropy(this.ptr);
+ return ret === 0 ? undefined : Nonce.__wrap(ret);
+ }
+ /**
+ * @param {ProtocolVersion} protocol_version
+ */
+ set_protocol_version(protocol_version) {
+ _assertClass(protocol_version, ProtocolVersion);
+ wasm.protocolparamupdate_set_protocol_version(
+ this.ptr,
+ protocol_version.ptr,
+ );
+ }
+ /**
+ * @returns {ProtocolVersion | undefined}
+ */
+ protocol_version() {
+ const ret = wasm.protocolparamupdate_protocol_version(this.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.ptr, min_pool_cost.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ min_pool_cost() {
+ const ret = wasm.protocolparamupdate_min_pool_cost(this.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.ptr,
+ ada_per_utxo_byte.ptr,
+ );
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ ada_per_utxo_byte() {
+ const ret = wasm.protocolparamupdate_ada_per_utxo_byte(this.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.ptr, cost_models.ptr);
+ }
+ /**
+ * @returns {Costmdls | undefined}
+ */
+ cost_models() {
+ const ret = wasm.protocolparamupdate_cost_models(this.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.ptr, execution_costs.ptr);
+ }
+ /**
+ * @returns {ExUnitPrices | undefined}
+ */
+ execution_costs() {
+ const ret = wasm.protocolparamupdate_execution_costs(this.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.ptr, max_tx_ex_units.ptr);
+ }
+ /**
+ * @returns {ExUnits | undefined}
+ */
+ max_tx_ex_units() {
+ const ret = wasm.protocolparamupdate_max_tx_ex_units(this.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.ptr,
+ max_block_ex_units.ptr,
+ );
+ }
+ /**
+ * @returns {ExUnits | undefined}
+ */
+ max_block_ex_units() {
+ const ret = wasm.protocolparamupdate_max_block_ex_units(this.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.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.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.ptr,
+ collateral_percentage,
+ );
+ }
+ /**
+ * @returns {number | undefined}
+ */
+ collateral_percentage() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolparamupdate_collateral_percentage(retptr, this.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.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.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);
+ var ptr0 = pool_voting_thresholds.__destroy_into_raw();
+ wasm.protocolparamupdate_set_pool_voting_thresholds(this.ptr, ptr0);
+ }
+ /**
+ * @returns {PoolVotingThresholds | undefined}
+ */
+ pool_voting_thresholds() {
+ const ret = wasm.protocolparamupdate_pool_voting_thresholds(this.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);
+ var ptr0 = drep_voting_thresholds.__destroy_into_raw();
+ wasm.protocolparamupdate_set_drep_voting_thresholds(this.ptr, ptr0);
+ }
+ /**
+ * @returns {DrepVotingThresholds | undefined}
+ */
+ drep_voting_thresholds() {
+ const ret = wasm.protocolparamupdate_drep_voting_thresholds(this.ptr);
+ return ret === 0 ? undefined : DrepVotingThresholds.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} min_committee_size
+ */
+ set_min_committee_size(min_committee_size) {
+ _assertClass(min_committee_size, BigNum);
+ var ptr0 = min_committee_size.__destroy_into_raw();
+ wasm.protocolparamupdate_set_min_committee_size(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ min_committee_size() {
+ const ret = wasm.protocolparamupdate_min_committee_size(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} committee_term_limit
+ */
+ set_committee_term_limit(committee_term_limit) {
+ _assertClass(committee_term_limit, BigNum);
+ var ptr0 = committee_term_limit.__destroy_into_raw();
+ wasm.protocolparamupdate_set_committee_term_limit(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ committee_term_limit() {
+ const ret = wasm.protocolparamupdate_committee_term_limit(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} governance_action_expiration
+ */
+ set_governance_action_expiration(governance_action_expiration) {
+ _assertClass(governance_action_expiration, BigNum);
+ var ptr0 = governance_action_expiration.__destroy_into_raw();
+ wasm.protocolparamupdate_set_governance_action_expiration(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ governance_action_expiration() {
+ const ret = wasm.protocolparamupdate_governance_action_expiration(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} governance_action_deposit
+ */
+ set_governance_action_deposit(governance_action_deposit) {
+ _assertClass(governance_action_deposit, BigNum);
+ var ptr0 = governance_action_deposit.__destroy_into_raw();
+ wasm.protocolparamupdate_set_governance_action_deposit(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ governance_action_deposit() {
+ const ret = wasm.protocolparamupdate_governance_action_deposit(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} drep_deposit
+ */
+ set_drep_deposit(drep_deposit) {
+ _assertClass(drep_deposit, BigNum);
+ var ptr0 = drep_deposit.__destroy_into_raw();
+ wasm.protocolparamupdate_set_drep_deposit(this.ptr, ptr0);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ drep_deposit() {
+ const ret = wasm.protocolparamupdate_drep_deposit(this.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.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.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} minfee_refscript_cost_per_byte
+ */
+ set_minfee_refscript_cost_per_byte(minfee_refscript_cost_per_byte) {
+ _assertClass(minfee_refscript_cost_per_byte, UnitInterval);
+ var ptr0 = minfee_refscript_cost_per_byte.__destroy_into_raw();
+ wasm.protocolparamupdate_set_minfee_refscript_cost_per_byte(this.ptr, ptr0);
+ }
+ /**
+ * @returns {UnitInterval | undefined}
+ */
+ minfee_refscript_cost_per_byte() {
+ const ret = wasm.protocolparamupdate_minfee_refscript_cost_per_byte(
+ this.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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_protocolversion_free(ptr)
+);
+/** */
+class ProtocolVersion {
+ static __wrap(ptr) {
+ const obj = Object.create(ProtocolVersion.prototype);
+ obj.ptr = ptr;
+ ProtocolVersionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolversion_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.protocolversion_to_js_value(retptr, this.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.networkinfo_protocol_magic(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {number}
+ */
+ minor() {
+ const ret = wasm.protocolversion_minor(this.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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_publickey_free(ptr)
+);
+/**
+ * ED25519 key used as public key
+ */
+class PublicKey {
+ static __wrap(ptr) {
+ const obj = Object.create(PublicKey.prototype);
+ obj.ptr = ptr;
+ PublicKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PublicKeyFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_publickey_free(ptr);
+ }
+ /**
+ * 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);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_bech32() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.publickey_to_bech32(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ as_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @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);
+ }
+ }
+ /**
+ * @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.ptr, ptr0, len0, signature.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ hash() {
+ const ret = wasm.publickey_hash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+}
+module.exports.PublicKey = PublicKey;
+
+const PublicKeysFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_publickeys_free(ptr)
+);
+/** */
+class PublicKeys {
+ static __wrap(ptr) {
+ const obj = Object.create(PublicKeys.prototype);
+ obj.ptr = ptr;
+ PublicKeysFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ PublicKeysFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_publickeys_free(ptr);
+ }
+ /** */
+ constructor() {
+ const ret = wasm.ed25519keyhashes_new();
+ return PublicKeys.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ size() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {PublicKey}
+ */
+ get(index) {
+ const ret = wasm.publickeys_get(this.ptr, index);
+ return PublicKey.__wrap(ret);
+ }
+ /**
+ * @param {PublicKey} key
+ */
+ add(key) {
+ _assertClass(key, PublicKey);
+ wasm.publickeys_add(this.ptr, key.ptr);
+ }
+}
+module.exports.PublicKeys = PublicKeys;
+
+const RedeemerFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_redeemer_free(ptr)
+);
+/** */
+class Redeemer {
+ static __wrap(ptr) {
+ const obj = Object.create(Redeemer.prototype);
+ obj.ptr = ptr;
+ RedeemerFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {RedeemerTag}
+ */
+ tag() {
+ const ret = wasm.redeemer_tag(this.ptr);
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ index() {
+ const ret = wasm.constrplutusdata_alternative(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusData}
+ */
+ data() {
+ const ret = wasm.redeemer_data(this.ptr);
+ return PlutusData.__wrap(ret);
+ }
+ /**
+ * @returns {ExUnits}
+ */
+ ex_units() {
+ const ret = wasm.drepvotingthresholds_motion_no_confidence(this.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.ptr, index.ptr, data.ptr, ex_units.ptr);
+ return Redeemer.__wrap(ret);
+ }
+}
+module.exports.Redeemer = Redeemer;
+
+const RedeemerTagFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_redeemertag_free(ptr)
+);
+/** */
+class RedeemerTag {
+ static __wrap(ptr) {
+ const obj = Object.create(RedeemerTag.prototype);
+ obj.ptr = ptr;
+ RedeemerTagFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {RedeemerTag}
+ */
+ static new_spend() {
+ const ret = wasm.language_new_plutus_v1();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_mint() {
+ const ret = wasm.language_new_plutus_v2();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_cert() {
+ const ret = wasm.language_new_plutus_v3();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_reward() {
+ const ret = wasm.redeemertag_new_reward();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_voting() {
+ const ret = wasm.redeemertag_new_voting();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ static new_proposing() {
+ const ret = wasm.redeemertag_new_proposing();
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.redeemertag_kind(this.ptr);
+ return ret >>> 0;
+ }
+}
+module.exports.RedeemerTag = RedeemerTag;
+
+const RedeemerWitnessKeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_redeemerwitnesskey_free(ptr)
+);
+/** */
+class RedeemerWitnessKey {
+ static __wrap(ptr) {
+ const obj = Object.create(RedeemerWitnessKey.prototype);
+ obj.ptr = ptr;
+ RedeemerWitnessKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RedeemerWitnessKeyFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_redeemerwitnesskey_free(ptr);
+ }
+ /**
+ * @returns {RedeemerTag}
+ */
+ tag() {
+ const ret = wasm.redeemerwitnesskey_tag(this.ptr);
+ return RedeemerTag.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ index() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {RedeemerTag} tag
+ * @param {BigNum} index
+ * @returns {RedeemerWitnessKey}
+ */
+ static new(tag, index) {
+ _assertClass(tag, RedeemerTag);
+ _assertClass(index, BigNum);
+ const ret = wasm.redeemerwitnesskey_new(tag.ptr, index.ptr);
+ return RedeemerWitnessKey.__wrap(ret);
+ }
+}
+module.exports.RedeemerWitnessKey = RedeemerWitnessKey;
+
+const RedeemersFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_redeemers_free(ptr)
+);
+/** */
+class Redeemers {
+ static __wrap(ptr) {
+ const obj = Object.create(Redeemers.prototype);
+ obj.ptr = ptr;
+ RedeemersFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {Redeemers}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return Redeemers.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Redeemer}
+ */
+ get(index) {
+ const ret = wasm.redeemers_get(this.ptr, index);
+ return Redeemer.__wrap(ret);
+ }
+ /**
+ * @param {Redeemer} elem
+ */
+ add(elem) {
+ _assertClass(elem, Redeemer);
+ wasm.redeemers_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.Redeemers = Redeemers;
+
+const RegCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_regcert_free(ptr)
+);
+/** */
+class RegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(RegCert.prototype);
+ obj.ptr = ptr;
+ RegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RegCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_regcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegCert}
+ */
+ 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.regcert_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 RegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_js_value(retptr, this.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 {RegCert}
+ */
+ 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.regcert_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 RegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {BigNum} coin
+ * @returns {RegCert}
+ */
+ static new(stake_credential, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(coin, BigNum);
+ const ret = wasm.regcert_new(stake_credential.ptr, coin.ptr);
+ return RegCert.__wrap(ret);
+ }
+}
+module.exports.RegCert = RegCert;
+
+const RegCommitteeHotKeyCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_regcommitteehotkeycert_free(ptr)
+);
+/** */
+class RegCommitteeHotKeyCert {
+ static __wrap(ptr) {
+ const obj = Object.create(RegCommitteeHotKeyCert.prototype);
+ obj.ptr = ptr;
+ RegCommitteeHotKeyCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RegCommitteeHotKeyCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_regcommitteehotkeycert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcommitteehotkeycert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegCommitteeHotKeyCert}
+ */
+ 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.regcommitteehotkeycert_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 RegCommitteeHotKeyCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcommitteehotkeycert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcommitteehotkeycert_to_js_value(retptr, this.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 {RegCommitteeHotKeyCert}
+ */
+ 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.regcommitteehotkeycert_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 RegCommitteeHotKeyCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_cold_keyhash() {
+ const ret = wasm.regcommitteehotkeycert_committee_cold_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_hot_keyhash() {
+ const ret = wasm.regcommitteehotkeycert_committee_hot_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} committee_cold_keyhash
+ * @param {Ed25519KeyHash} committee_hot_keyhash
+ * @returns {RegCommitteeHotKeyCert}
+ */
+ static new(committee_cold_keyhash, committee_hot_keyhash) {
+ _assertClass(committee_cold_keyhash, Ed25519KeyHash);
+ _assertClass(committee_hot_keyhash, Ed25519KeyHash);
+ const ret = wasm.regcommitteehotkeycert_new(
+ committee_cold_keyhash.ptr,
+ committee_hot_keyhash.ptr,
+ );
+ return RegCommitteeHotKeyCert.__wrap(ret);
+ }
+}
+module.exports.RegCommitteeHotKeyCert = RegCommitteeHotKeyCert;
+
+const RegDrepCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_regdrepcert_free(ptr)
+);
+/** */
+class RegDrepCert {
+ static __wrap(ptr) {
+ const obj = Object.create(RegDrepCert.prototype);
+ obj.ptr = ptr;
+ RegDrepCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RegDrepCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_regdrepcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {RegDrepCert}
+ */
+ 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.regdrepcert_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 RegDrepCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_js_value(retptr, this.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 {RegDrepCert}
+ */
+ 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.regdrepcert_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 RegDrepCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ voting_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} voting_credential
+ * @param {BigNum} coin
+ * @returns {RegDrepCert}
+ */
+ static new(voting_credential, coin) {
+ _assertClass(voting_credential, StakeCredential);
+ _assertClass(coin, BigNum);
+ const ret = wasm.regcert_new(voting_credential.ptr, coin.ptr);
+ return RegDrepCert.__wrap(ret);
+ }
+}
+module.exports.RegDrepCert = RegDrepCert;
+
+const RelayFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_relay_free(ptr)
+);
+/** */
+class Relay {
+ static __wrap(ptr) {
+ const obj = Object.create(Relay.prototype);
+ obj.ptr = ptr;
+ RelayFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.relay_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.relay_to_js_value(retptr, this.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.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.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.ptr);
+ return Relay.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.relay_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {SingleHostAddr | undefined}
+ */
+ as_single_host_addr() {
+ const ret = wasm.relay_as_single_host_addr(this.ptr);
+ return ret === 0 ? undefined : SingleHostAddr.__wrap(ret);
+ }
+ /**
+ * @returns {SingleHostName | undefined}
+ */
+ as_single_host_name() {
+ const ret = wasm.relay_as_single_host_name(this.ptr);
+ return ret === 0 ? undefined : SingleHostName.__wrap(ret);
+ }
+ /**
+ * @returns {MultiHostName | undefined}
+ */
+ as_multi_host_name() {
+ const ret = wasm.relay_as_multi_host_name(this.ptr);
+ return ret === 0 ? undefined : MultiHostName.__wrap(ret);
+ }
+}
+module.exports.Relay = Relay;
+
+const RelaysFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_relays_free(ptr)
+);
+/** */
+class Relays {
+ static __wrap(ptr) {
+ const obj = Object.create(Relays.prototype);
+ obj.ptr = ptr;
+ RelaysFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.relays_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.relays_to_js_value(retptr, this.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.assetnames_new();
+ return Relays.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Relay}
+ */
+ get(index) {
+ const ret = wasm.relays_get(this.ptr, index);
+ return Relay.__wrap(ret);
+ }
+ /**
+ * @param {Relay} elem
+ */
+ add(elem) {
+ _assertClass(elem, Relay);
+ wasm.relays_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.Relays = Relays;
+
+const RequiredWitnessSetFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_requiredwitnessset_free(ptr)
+);
+/** */
+class RequiredWitnessSet {
+ static __wrap(ptr) {
+ const obj = Object.create(RequiredWitnessSet.prototype);
+ obj.ptr = ptr;
+ RequiredWitnessSetFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RequiredWitnessSetFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_requiredwitnessset_free(ptr);
+ }
+ /**
+ * @param {Vkeywitness} vkey
+ */
+ add_vkey(vkey) {
+ _assertClass(vkey, Vkeywitness);
+ wasm.requiredwitnessset_add_vkey(this.ptr, vkey.ptr);
+ }
+ /**
+ * @param {Vkey} vkey
+ */
+ add_vkey_key(vkey) {
+ _assertClass(vkey, Vkey);
+ wasm.requiredwitnessset_add_vkey_key(this.ptr, vkey.ptr);
+ }
+ /**
+ * @param {Ed25519KeyHash} hash
+ */
+ add_vkey_key_hash(hash) {
+ _assertClass(hash, Ed25519KeyHash);
+ wasm.requiredwitnessset_add_vkey_key_hash(this.ptr, hash.ptr);
+ }
+ /**
+ * @param {BootstrapWitness} bootstrap
+ */
+ add_bootstrap(bootstrap) {
+ _assertClass(bootstrap, BootstrapWitness);
+ wasm.requiredwitnessset_add_bootstrap(this.ptr, bootstrap.ptr);
+ }
+ /**
+ * @param {Vkey} bootstrap
+ */
+ add_bootstrap_key(bootstrap) {
+ _assertClass(bootstrap, Vkey);
+ wasm.requiredwitnessset_add_bootstrap_key(this.ptr, bootstrap.ptr);
+ }
+ /**
+ * @param {Ed25519KeyHash} hash
+ */
+ add_bootstrap_key_hash(hash) {
+ _assertClass(hash, Ed25519KeyHash);
+ wasm.requiredwitnessset_add_bootstrap_key_hash(this.ptr, hash.ptr);
+ }
+ /**
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script) {
+ _assertClass(native_script, NativeScript);
+ wasm.requiredwitnessset_add_native_script(this.ptr, native_script.ptr);
+ }
+ /**
+ * @param {ScriptHash} native_script
+ */
+ add_native_script_hash(native_script) {
+ _assertClass(native_script, ScriptHash);
+ wasm.requiredwitnessset_add_native_script_hash(this.ptr, native_script.ptr);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.requiredwitnessset_add_plutus_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.requiredwitnessset_add_plutus_v2_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * @param {ScriptHash} plutus_script
+ */
+ add_plutus_hash(plutus_script) {
+ _assertClass(plutus_script, ScriptHash);
+ wasm.requiredwitnessset_add_plutus_hash(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * @param {PlutusData} plutus_datum
+ */
+ add_plutus_datum(plutus_datum) {
+ _assertClass(plutus_datum, PlutusData);
+ wasm.requiredwitnessset_add_plutus_datum(this.ptr, plutus_datum.ptr);
+ }
+ /**
+ * @param {DataHash} plutus_datum
+ */
+ add_plutus_datum_hash(plutus_datum) {
+ _assertClass(plutus_datum, DataHash);
+ wasm.requiredwitnessset_add_plutus_datum_hash(this.ptr, plutus_datum.ptr);
+ }
+ /**
+ * @param {Redeemer} redeemer
+ */
+ add_redeemer(redeemer) {
+ _assertClass(redeemer, Redeemer);
+ wasm.requiredwitnessset_add_redeemer(this.ptr, redeemer.ptr);
+ }
+ /**
+ * @param {RedeemerWitnessKey} redeemer
+ */
+ add_redeemer_tag(redeemer) {
+ _assertClass(redeemer, RedeemerWitnessKey);
+ wasm.requiredwitnessset_add_redeemer_tag(this.ptr, redeemer.ptr);
+ }
+ /**
+ * @param {RequiredWitnessSet} requirements
+ */
+ add_all(requirements) {
+ _assertClass(requirements, RequiredWitnessSet);
+ wasm.requiredwitnessset_add_all(this.ptr, requirements.ptr);
+ }
+ /**
+ * @returns {RequiredWitnessSet}
+ */
+ static new() {
+ const ret = wasm.requiredwitnessset_new();
+ return RequiredWitnessSet.__wrap(ret);
+ }
+}
+module.exports.RequiredWitnessSet = RequiredWitnessSet;
+
+const RewardAddressFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_rewardaddress_free(ptr)
+);
+/** */
+class RewardAddress {
+ static __wrap(ptr) {
+ const obj = Object.create(RewardAddress.prototype);
+ obj.ptr = ptr;
+ RewardAddressFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ RewardAddressFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_rewardaddress_free(ptr);
+ }
+ /**
+ * @param {number} network
+ * @param {StakeCredential} payment
+ * @returns {RewardAddress}
+ */
+ static new(network, payment) {
+ _assertClass(payment, StakeCredential);
+ const ret = wasm.enterpriseaddress_new(network, payment.ptr);
+ return RewardAddress.__wrap(ret);
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ payment_cred() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Address}
+ */
+ to_address() {
+ const ret = wasm.rewardaddress_to_address(this.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @param {Address} addr
+ * @returns {RewardAddress | undefined}
+ */
+ static from_address(addr) {
+ _assertClass(addr, Address);
+ const ret = wasm.address_as_reward(addr.ptr);
+ return ret === 0 ? undefined : RewardAddress.__wrap(ret);
+ }
+}
+module.exports.RewardAddress = RewardAddress;
+
+const RewardAddressesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_rewardaddresses_free(ptr)
+);
+/** */
+class RewardAddresses {
+ static __wrap(ptr) {
+ const obj = Object.create(RewardAddresses.prototype);
+ obj.ptr = ptr;
+ RewardAddressesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.rewardaddresses_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.rewardaddresses_to_js_value(retptr, this.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.ed25519keyhashes_new();
+ return RewardAddresses.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {RewardAddress}
+ */
+ get(index) {
+ const ret = wasm.rewardaddresses_get(this.ptr, index);
+ return RewardAddress.__wrap(ret);
+ }
+ /**
+ * @param {RewardAddress} elem
+ */
+ add(elem) {
+ _assertClass(elem, RewardAddress);
+ wasm.rewardaddresses_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.RewardAddresses = RewardAddresses;
+
+const ScriptFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_script_free(ptr)
+);
+/** */
+class Script {
+ static __wrap(ptr) {
+ const obj = Object.create(Script.prototype);
+ obj.ptr = ptr;
+ ScriptFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ScriptFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_script_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Script}
+ */
+ 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.script_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 Script.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_js_value(retptr, this.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 {Script}
+ */
+ 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.script_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 Script.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {NativeScript} native_script
+ * @returns {Script}
+ */
+ static new_native(native_script) {
+ _assertClass(native_script, NativeScript);
+ const ret = wasm.script_new_native(native_script.ptr);
+ return Script.__wrap(ret);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v1(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ const ret = wasm.script_new_plutus_v1(plutus_script.ptr);
+ return Script.__wrap(ret);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v2(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ const ret = wasm.script_new_plutus_v2(plutus_script.ptr);
+ return Script.__wrap(ret);
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ * @returns {Script}
+ */
+ static new_plutus_v3(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ const ret = wasm.script_new_plutus_v3(plutus_script.ptr);
+ return Script.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.script_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {NativeScript | undefined}
+ */
+ as_native() {
+ const ret = wasm.script_as_native(this.ptr);
+ return ret === 0 ? undefined : NativeScript.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v1() {
+ const ret = wasm.script_as_plutus_v1(this.ptr);
+ return ret === 0 ? undefined : PlutusScript.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v2() {
+ const ret = wasm.script_as_plutus_v2(this.ptr);
+ return ret === 0 ? undefined : PlutusScript.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScript | undefined}
+ */
+ as_plutus_v3() {
+ const ret = wasm.script_as_plutus_v3(this.ptr);
+ return ret === 0 ? undefined : PlutusScript.__wrap(ret);
+ }
+}
+module.exports.Script = Script;
+
+const ScriptAllFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scriptall_free(ptr)
+);
+/** */
+class ScriptAll {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptAll.prototype);
+ obj.ptr = ptr;
+ ScriptAllFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptall_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptall_to_js_value(retptr, this.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.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.ptr);
+ return ScriptAll.__wrap(ret);
+ }
+}
+module.exports.ScriptAll = ScriptAll;
+
+const ScriptAnyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scriptany_free(ptr)
+);
+/** */
+class ScriptAny {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptAny.prototype);
+ obj.ptr = ptr;
+ ScriptAnyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptall_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptall_to_js_value(retptr, this.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.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.ptr);
+ return ScriptAny.__wrap(ret);
+ }
+}
+module.exports.ScriptAny = ScriptAny;
+
+const ScriptDataHashFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scriptdatahash_free(ptr)
+);
+/** */
+class ScriptDataHash {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptDataHash.prototype);
+ obj.ptr = ptr;
+ ScriptDataHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scripthash_free(ptr)
+);
+/** */
+class ScriptHash {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptHash.prototype);
+ obj.ptr = ptr;
+ ScriptHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scripthashes_free(ptr)
+);
+/** */
+class ScriptHashes {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptHashes.prototype);
+ obj.ptr = ptr;
+ ScriptHashesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.ed25519keyhashes_to_js_value(retptr, this.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.ed25519keyhashes_new();
+ return ScriptHashes.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {ScriptHash}
+ */
+ get(index) {
+ const ret = wasm.scripthashes_get(this.ptr, index);
+ return ScriptHash.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} elem
+ */
+ add(elem) {
+ _assertClass(elem, ScriptHash);
+ wasm.ed25519keyhashes_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.ScriptHashes = ScriptHashes;
+
+const ScriptNOfKFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scriptnofk_free(ptr)
+);
+/** */
+class ScriptNOfK {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptNOfK.prototype);
+ obj.ptr = ptr;
+ ScriptNOfKFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptnofk_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptnofk_to_js_value(retptr, this.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.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {NativeScripts}
+ */
+ native_scripts() {
+ const ret = wasm.scriptall_native_scripts(this.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.ptr);
+ return ScriptNOfK.__wrap(ret);
+ }
+}
+module.exports.ScriptNOfK = ScriptNOfK;
+
+const ScriptPubkeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scriptpubkey_free(ptr)
+);
+/** */
+class ScriptPubkey {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptPubkey.prototype);
+ obj.ptr = ptr;
+ ScriptPubkeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptpubkey_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptpubkey_to_js_value(retptr, this.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.regcommitteehotkeycert_committee_cold_keyhash(this.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.ptr);
+ return ScriptPubkey.__wrap(ret);
+ }
+}
+module.exports.ScriptPubkey = ScriptPubkey;
+
+const ScriptRefFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scriptref_free(ptr)
+);
+/** */
+class ScriptRef {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptRef.prototype);
+ obj.ptr = ptr;
+ ScriptRefFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.script_to_js_value(retptr, this.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 {Script} script
+ * @returns {ScriptRef}
+ */
+ static new(script) {
+ _assertClass(script, Script);
+ const ret = wasm.scriptref_new(script.ptr);
+ return ScriptRef.__wrap(ret);
+ }
+ /**
+ * @returns {Script}
+ */
+ get() {
+ const ret = wasm.scriptref_get(this.ptr);
+ return Script.__wrap(ret);
+ }
+}
+module.exports.ScriptRef = ScriptRef;
+
+const ScriptWitnessFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_scriptwitness_free(ptr)
+);
+/** */
+class ScriptWitness {
+ static __wrap(ptr) {
+ const obj = Object.create(ScriptWitness.prototype);
+ obj.ptr = ptr;
+ ScriptWitnessFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ ScriptWitnessFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_scriptwitness_free(ptr);
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptwitness_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.scriptwitness_to_js_value(retptr, this.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 {ScriptWitness}
+ */
+ 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.scriptwitness_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 ScriptWitness.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {NativeScript} native_script
+ * @returns {ScriptWitness}
+ */
+ static new_native_witness(native_script) {
+ _assertClass(native_script, NativeScript);
+ const ret = wasm.scriptwitness_new_native_witness(native_script.ptr);
+ return ScriptWitness.__wrap(ret);
+ }
+ /**
+ * @param {PlutusWitness} plutus_witness
+ * @returns {ScriptWitness}
+ */
+ static new_plutus_witness(plutus_witness) {
+ _assertClass(plutus_witness, PlutusWitness);
+ const ret = wasm.scriptwitness_new_plutus_witness(plutus_witness.ptr);
+ return ScriptWitness.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.scriptwitness_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {NativeScript | undefined}
+ */
+ as_native_witness() {
+ const ret = wasm.scriptwitness_as_native_witness(this.ptr);
+ return ret === 0 ? undefined : NativeScript.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusWitness | undefined}
+ */
+ as_plutus_witness() {
+ const ret = wasm.scriptwitness_as_plutus_witness(this.ptr);
+ return ret === 0 ? undefined : PlutusWitness.__wrap(ret);
+ }
+}
+module.exports.ScriptWitness = ScriptWitness;
+
+const SingleHostAddrFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_singlehostaddr_free(ptr)
+);
+/** */
+class SingleHostAddr {
+ static __wrap(ptr) {
+ const obj = Object.create(SingleHostAddr.prototype);
+ obj.ptr = ptr;
+ SingleHostAddrFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.singlehostaddr_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.singlehostaddr_to_js_value(retptr, this.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.ptr);
+ return ret === 0xFFFFFF ? undefined : ret;
+ }
+ /**
+ * @returns {Ipv4 | undefined}
+ */
+ ipv4() {
+ const ret = wasm.singlehostaddr_ipv4(this.ptr);
+ return ret === 0 ? undefined : Ipv4.__wrap(ret);
+ }
+ /**
+ * @returns {Ipv6 | undefined}
+ */
+ ipv6() {
+ const ret = wasm.singlehostaddr_ipv6(this.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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_singlehostname_free(ptr)
+);
+/** */
+class SingleHostName {
+ static __wrap(ptr) {
+ const obj = Object.create(SingleHostName.prototype);
+ obj.ptr = ptr;
+ SingleHostNameFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.singlehostname_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.singlehostname_to_js_value(retptr, this.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.ptr);
+ return ret === 0xFFFFFF ? undefined : ret;
+ }
+ /**
+ * @returns {DNSRecordAorAAAA}
+ */
+ dns_name() {
+ const ret = wasm.anchor_anchor_url(this.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.ptr,
+ );
+ return SingleHostName.__wrap(ret);
+ }
+}
+module.exports.SingleHostName = SingleHostName;
+
+const StakeCredentialFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_stakecredential_free(ptr)
+);
+/** */
+class StakeCredential {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeCredential.prototype);
+ obj.ptr = ptr;
+ StakeCredentialFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeCredentialFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakecredential_free(ptr);
+ }
+ /**
+ * @param {Ed25519KeyHash} hash
+ * @returns {StakeCredential}
+ */
+ static from_keyhash(hash) {
+ _assertClass(hash, Ed25519KeyHash);
+ const ret = wasm.drep_new_keyhash(hash.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} hash
+ * @returns {StakeCredential}
+ */
+ static from_scripthash(hash) {
+ _assertClass(hash, ScriptHash);
+ const ret = wasm.drep_new_scripthash(hash.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ to_keyhash() {
+ const ret = wasm.stakecredential_to_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ to_scripthash() {
+ const ret = wasm.stakecredential_to_scripthash(this.ptr);
+ return ret === 0 ? undefined : ScriptHash.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.networkid_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredential_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeCredential}
+ */
+ 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.stakecredential_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 StakeCredential.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredential_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredential_to_js_value(retptr, this.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 {StakeCredential}
+ */
+ 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.stakecredential_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 StakeCredential.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.StakeCredential = StakeCredential;
+
+const StakeCredentialsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_stakecredentials_free(ptr)
+);
+/** */
+class StakeCredentials {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeCredentials.prototype);
+ obj.ptr = ptr;
+ StakeCredentialsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeCredentialsFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakecredentials_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredentials_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeCredentials}
+ */
+ 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.stakecredentials_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 StakeCredentials.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredentials_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakecredentials_to_js_value(retptr, this.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 {StakeCredentials}
+ */
+ 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.stakecredentials_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 StakeCredentials.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredentials}
+ */
+ static new() {
+ const ret = wasm.ed25519keyhashes_new();
+ return StakeCredentials.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {StakeCredential}
+ */
+ get(index) {
+ const ret = wasm.stakecredentials_get(this.ptr, index);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} elem
+ */
+ add(elem) {
+ _assertClass(elem, StakeCredential);
+ wasm.stakecredentials_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.StakeCredentials = StakeCredentials;
+
+const StakeDelegationFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_stakedelegation_free(ptr)
+);
+/** */
+class StakeDelegation {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeDelegation.prototype);
+ obj.ptr = ptr;
+ StakeDelegationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakedelegation_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakedelegation_to_js_value(retptr, this.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 {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash() {
+ const ret = wasm.stakedelegation_pool_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @returns {StakeDelegation}
+ */
+ static new(stake_credential, pool_keyhash) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(pool_keyhash, Ed25519KeyHash);
+ const ret = wasm.stakedelegation_new(
+ stake_credential.ptr,
+ pool_keyhash.ptr,
+ );
+ return StakeDelegation.__wrap(ret);
+ }
+}
+module.exports.StakeDelegation = StakeDelegation;
+
+const StakeDeregistrationFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_stakederegistration_free(ptr)
+);
+/** */
+class StakeDeregistration {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeDeregistration.prototype);
+ obj.ptr = ptr;
+ StakeDeregistrationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakederegistration_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakederegistration_to_js_value(retptr, this.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 {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @returns {StakeDeregistration}
+ */
+ static new(stake_credential) {
+ _assertClass(stake_credential, StakeCredential);
+ const ret = wasm.stakederegistration_new(stake_credential.ptr);
+ return StakeDeregistration.__wrap(ret);
+ }
+}
+module.exports.StakeDeregistration = StakeDeregistration;
+
+const StakeRegDelegCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_stakeregdelegcert_free(ptr)
+);
+/** */
+class StakeRegDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeRegDelegCert.prototype);
+ obj.ptr = ptr;
+ StakeRegDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeRegDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakeregdelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakeregdelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeRegDelegCert}
+ */
+ 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.stakeregdelegcert_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 StakeRegDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakeregdelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakeregdelegcert_to_js_value(retptr, this.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 {StakeRegDelegCert}
+ */
+ 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.stakeregdelegcert_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 StakeRegDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.stakeregdelegcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash() {
+ const ret = wasm.stakeregdelegcert_pool_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {BigNum} coin
+ * @returns {StakeRegDelegCert}
+ */
+ static new(stake_credential, pool_keyhash, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(pool_keyhash, Ed25519KeyHash);
+ _assertClass(coin, BigNum);
+ const ret = wasm.stakeregdelegcert_new(
+ stake_credential.ptr,
+ pool_keyhash.ptr,
+ coin.ptr,
+ );
+ return StakeRegDelegCert.__wrap(ret);
+ }
+}
+module.exports.StakeRegDelegCert = StakeRegDelegCert;
+
+const StakeRegistrationFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_stakeregistration_free(ptr)
+);
+/** */
+class StakeRegistration {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeRegistration.prototype);
+ obj.ptr = ptr;
+ StakeRegistrationFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakederegistration_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakederegistration_to_js_value(retptr, this.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 {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @returns {StakeRegistration}
+ */
+ static new(stake_credential) {
+ _assertClass(stake_credential, StakeCredential);
+ const ret = wasm.stakederegistration_new(stake_credential.ptr);
+ return StakeRegistration.__wrap(ret);
+ }
+}
+module.exports.StakeRegistration = StakeRegistration;
+
+const StakeVoteDelegCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_stakevotedelegcert_free(ptr)
+);
+/** */
+class StakeVoteDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeVoteDelegCert.prototype);
+ obj.ptr = ptr;
+ StakeVoteDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeVoteDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakevotedelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevotedelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeVoteDelegCert}
+ */
+ 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.stakevotedelegcert_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 StakeVoteDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevotedelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevotedelegcert_to_js_value(retptr, this.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 {StakeVoteDelegCert}
+ */
+ 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.stakevotedelegcert_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 StakeVoteDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash() {
+ const ret = wasm.stakevotedelegcert_pool_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ drep() {
+ const ret = wasm.stakevotedelegcert_drep(this.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {Drep} drep
+ * @returns {StakeVoteDelegCert}
+ */
+ static new(stake_credential, pool_keyhash, drep) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(pool_keyhash, Ed25519KeyHash);
+ _assertClass(drep, Drep);
+ const ret = wasm.stakevotedelegcert_new(
+ stake_credential.ptr,
+ pool_keyhash.ptr,
+ drep.ptr,
+ );
+ return StakeVoteDelegCert.__wrap(ret);
+ }
+}
+module.exports.StakeVoteDelegCert = StakeVoteDelegCert;
+
+const StakeVoteRegDelegCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_stakevoteregdelegcert_free(ptr)
+);
+/** */
+class StakeVoteRegDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(StakeVoteRegDelegCert.prototype);
+ obj.ptr = ptr;
+ StakeVoteRegDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ StakeVoteRegDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakevoteregdelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevoteregdelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {StakeVoteRegDelegCert}
+ */
+ 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.stakevoteregdelegcert_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 StakeVoteRegDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevoteregdelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.stakevoteregdelegcert_to_js_value(retptr, this.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 {StakeVoteRegDelegCert}
+ */
+ 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.stakevoteregdelegcert_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 StakeVoteRegDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.stakevoteregdelegcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ pool_keyhash() {
+ const ret = wasm.stakeregdelegcert_pool_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ drep() {
+ const ret = wasm.stakevoteregdelegcert_drep(this.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Ed25519KeyHash} pool_keyhash
+ * @param {Drep} drep
+ * @param {BigNum} coin
+ * @returns {StakeVoteRegDelegCert}
+ */
+ static new(stake_credential, pool_keyhash, drep, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(pool_keyhash, Ed25519KeyHash);
+ _assertClass(drep, Drep);
+ _assertClass(coin, BigNum);
+ const ret = wasm.stakevoteregdelegcert_new(
+ stake_credential.ptr,
+ pool_keyhash.ptr,
+ drep.ptr,
+ coin.ptr,
+ );
+ return StakeVoteRegDelegCert.__wrap(ret);
+ }
+}
+module.exports.StakeVoteRegDelegCert = StakeVoteRegDelegCert;
+
+const StringsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_strings_free(ptr)
+);
+/** */
+class Strings {
+ static __wrap(ptr) {
+ const obj = Object.create(Strings.prototype);
+ obj.ptr = ptr;
+ StringsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.assetnames_new();
+ return Strings.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {string}
+ */
+ get(index) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.strings_get(retptr, this.ptr, index);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @param {string} elem
+ */
+ add(elem) {
+ const ptr0 = passStringToWasm0(
+ elem,
+ wasm.__wbindgen_malloc,
+ wasm.__wbindgen_realloc,
+ );
+ const len0 = WASM_VECTOR_LEN;
+ wasm.strings_add(this.ptr, ptr0, len0);
+ }
+}
+module.exports.Strings = Strings;
+
+const TimelockExpiryFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_timelockexpiry_free(ptr)
+);
+/** */
+class TimelockExpiry {
+ static __wrap(ptr) {
+ const obj = Object.create(TimelockExpiry.prototype);
+ obj.ptr = ptr;
+ TimelockExpiryFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.timelockexpiry_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.timelockexpiry_to_js_value(retptr, this.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 {BigNum}
+ */
+ slot() {
+ const ret = wasm.linearfee_constant(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} slot
+ * @returns {TimelockExpiry}
+ */
+ static new(slot) {
+ _assertClass(slot, BigNum);
+ const ret = wasm.exunits_mem(slot.ptr);
+ return TimelockExpiry.__wrap(ret);
+ }
+}
+module.exports.TimelockExpiry = TimelockExpiry;
+
+const TimelockStartFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_timelockstart_free(ptr)
+);
+/** */
+class TimelockStart {
+ static __wrap(ptr) {
+ const obj = Object.create(TimelockStart.prototype);
+ obj.ptr = ptr;
+ TimelockStartFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.timelockexpiry_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.timelockexpiry_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @returns {BigNum}
+ */
+ slot() {
+ const ret = wasm.linearfee_constant(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} slot
+ * @returns {TimelockStart}
+ */
+ static new(slot) {
+ _assertClass(slot, BigNum);
+ const ret = wasm.exunits_mem(slot.ptr);
+ return TimelockStart.__wrap(ret);
+ }
+}
+module.exports.TimelockStart = TimelockStart;
+
+const TransactionFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transaction_free(ptr)
+);
+/** */
+class Transaction {
+ static __wrap(ptr) {
+ const obj = Object.create(Transaction.prototype);
+ obj.ptr = ptr;
+ TransactionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transaction_to_js_value(retptr, this.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.ptr);
+ return TransactionBody.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ witness_set() {
+ const ret = wasm.transaction_witness_set(this.ptr);
+ return TransactionWitnessSet.__wrap(ret);
+ }
+ /**
+ * @returns {boolean}
+ */
+ is_valid() {
+ const ret = wasm.transaction_is_valid(this.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {AuxiliaryData | undefined}
+ */
+ auxiliary_data() {
+ const ret = wasm.transaction_auxiliary_data(this.ptr);
+ return ret === 0 ? undefined : AuxiliaryData.__wrap(ret);
+ }
+ /**
+ * @param {boolean} valid
+ */
+ set_is_valid(valid) {
+ wasm.transaction_set_is_valid(this.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.ptr, witness_set.ptr, ptr0);
+ return Transaction.__wrap(ret);
+ }
+}
+module.exports.Transaction = Transaction;
+
+const TransactionBodiesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionbodies_free(ptr)
+);
+/** */
+class TransactionBodies {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBodies.prototype);
+ obj.ptr = ptr;
+ TransactionBodiesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbodies_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbodies_to_js_value(retptr, this.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.certificates_new();
+ return TransactionBodies.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionBody}
+ */
+ get(index) {
+ const ret = wasm.transactionbodies_get(this.ptr, index);
+ return TransactionBody.__wrap(ret);
+ }
+ /**
+ * @param {TransactionBody} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionBody);
+ wasm.transactionbodies_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.TransactionBodies = TransactionBodies;
+
+const TransactionBodyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionbody_free(ptr)
+);
+/** */
+class TransactionBody {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBody.prototype);
+ obj.ptr = ptr;
+ TransactionBodyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbody_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbody_to_js_value(retptr, this.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.ptr);
+ return TransactionInputs.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionOutputs}
+ */
+ outputs() {
+ const ret = wasm.transactionbody_outputs(this.ptr);
+ return TransactionOutputs.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ fee() {
+ const ret = wasm.transactionbody_fee(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ ttl() {
+ const ret = wasm.transactionbody_ttl(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {Certificates} certs
+ */
+ set_certs(certs) {
+ _assertClass(certs, Certificates);
+ wasm.transactionbody_set_certs(this.ptr, certs.ptr);
+ }
+ /**
+ * @returns {Certificates | undefined}
+ */
+ certs() {
+ const ret = wasm.transactionbody_certs(this.ptr);
+ return ret === 0 ? undefined : Certificates.__wrap(ret);
+ }
+ /**
+ * @param {Withdrawals} withdrawals
+ */
+ set_withdrawals(withdrawals) {
+ _assertClass(withdrawals, Withdrawals);
+ wasm.transactionbody_set_withdrawals(this.ptr, withdrawals.ptr);
+ }
+ /**
+ * @returns {Withdrawals | undefined}
+ */
+ withdrawals() {
+ const ret = wasm.transactionbody_withdrawals(this.ptr);
+ return ret === 0 ? undefined : Withdrawals.__wrap(ret);
+ }
+ /**
+ * @param {Update} update
+ */
+ set_update(update) {
+ _assertClass(update, Update);
+ wasm.transactionbody_set_update(this.ptr, update.ptr);
+ }
+ /**
+ * @returns {Update | undefined}
+ */
+ update() {
+ const ret = wasm.transactionbody_update(this.ptr);
+ return ret === 0 ? undefined : Update.__wrap(ret);
+ }
+ /**
+ * @returns {VotingProcedures | undefined}
+ */
+ voting_procedures() {
+ const ret = wasm.transactionbody_voting_procedures(this.ptr);
+ return ret === 0 ? undefined : VotingProcedures.__wrap(ret);
+ }
+ /**
+ * @returns {ProposalProcedures | undefined}
+ */
+ proposal_procedures() {
+ const ret = wasm.transactionbody_proposal_procedures(this.ptr);
+ return ret === 0 ? undefined : ProposalProcedures.__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.ptr,
+ auxiliary_data_hash.ptr,
+ );
+ }
+ /**
+ * @returns {AuxiliaryDataHash | undefined}
+ */
+ auxiliary_data_hash() {
+ const ret = wasm.transactionbody_auxiliary_data_hash(this.ptr);
+ return ret === 0 ? undefined : AuxiliaryDataHash.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} validity_start_interval
+ */
+ set_validity_start_interval(validity_start_interval) {
+ _assertClass(validity_start_interval, BigNum);
+ wasm.protocolparamupdate_set_minfee_b(
+ this.ptr,
+ validity_start_interval.ptr,
+ );
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ validity_start_interval() {
+ const ret = wasm.protocolparamupdate_minfee_b(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {Mint} mint
+ */
+ set_mint(mint) {
+ _assertClass(mint, Mint);
+ wasm.transactionbody_set_mint(this.ptr, mint.ptr);
+ }
+ /**
+ * @returns {Mint | undefined}
+ */
+ mint() {
+ const ret = wasm.transactionbody_mint(this.ptr);
+ return ret === 0 ? undefined : Mint.__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.ptr, script_data_hash.ptr);
+ }
+ /**
+ * @returns {ScriptDataHash | undefined}
+ */
+ script_data_hash() {
+ const ret = wasm.transactionbody_script_data_hash(this.ptr);
+ return ret === 0 ? undefined : ScriptDataHash.__wrap(ret);
+ }
+ /**
+ * @param {TransactionInputs} collateral
+ */
+ set_collateral(collateral) {
+ _assertClass(collateral, TransactionInputs);
+ wasm.transactionbody_set_collateral(this.ptr, collateral.ptr);
+ }
+ /**
+ * @returns {TransactionInputs | undefined}
+ */
+ collateral() {
+ const ret = wasm.transactionbody_collateral(this.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.ptr, required_signers.ptr);
+ }
+ /**
+ * @returns {Ed25519KeyHashes | undefined}
+ */
+ required_signers() {
+ const ret = wasm.transactionbody_required_signers(this.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.ptr, network_id.ptr);
+ }
+ /**
+ * @returns {NetworkId | undefined}
+ */
+ network_id() {
+ const ret = wasm.transactionbody_network_id(this.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.ptr, collateral_return.ptr);
+ }
+ /**
+ * @returns {TransactionOutput | undefined}
+ */
+ collateral_return() {
+ const ret = wasm.transactionbody_collateral_return(this.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.ptr, total_collateral.ptr);
+ }
+ /**
+ * @returns {BigNum | undefined}
+ */
+ total_collateral() {
+ const ret = wasm.protocolparamupdate_key_deposit(this.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {TransactionInputs} reference_inputs
+ */
+ set_reference_inputs(reference_inputs) {
+ _assertClass(reference_inputs, TransactionInputs);
+ wasm.transactionbody_set_reference_inputs(this.ptr, reference_inputs.ptr);
+ }
+ /**
+ * @returns {TransactionInputs | undefined}
+ */
+ reference_inputs() {
+ const ret = wasm.transactionbody_reference_inputs(this.ptr);
+ return ret === 0 ? undefined : TransactionInputs.__wrap(ret);
+ }
+ /**
+ * @param {VotingProcedures} voting_procedures
+ */
+ set_voting_procedures(voting_procedures) {
+ _assertClass(voting_procedures, VotingProcedures);
+ wasm.transactionbody_set_voting_procedures(this.ptr, voting_procedures.ptr);
+ }
+ /**
+ * @param {ProposalProcedures} proposal_procedures
+ */
+ set_proposal_procedures(proposal_procedures) {
+ _assertClass(proposal_procedures, ProposalProcedures);
+ wasm.transactionbody_set_proposal_procedures(
+ this.ptr,
+ proposal_procedures.ptr,
+ );
+ }
+ /**
+ * @param {TransactionInputs} inputs
+ * @param {TransactionOutputs} outputs
+ * @param {BigNum} fee
+ * @param {BigNum | undefined} ttl
+ * @returns {TransactionBody}
+ */
+ static new(inputs, outputs, fee, ttl) {
+ _assertClass(inputs, TransactionInputs);
+ _assertClass(outputs, TransactionOutputs);
+ _assertClass(fee, BigNum);
+ let ptr0 = 0;
+ if (!isLikeNone(ttl)) {
+ _assertClass(ttl, BigNum);
+ ptr0 = ttl.__destroy_into_raw();
+ }
+ const ret = wasm.transactionbody_new(
+ inputs.ptr,
+ outputs.ptr,
+ fee.ptr,
+ ptr0,
+ );
+ return TransactionBody.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array | undefined}
+ */
+ raw() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbody_raw(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ let v0;
+ if (r0 !== 0) {
+ v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ }
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.TransactionBody = TransactionBody;
+
+const TransactionBuilderFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionbuilder_free(ptr)
+);
+/** */
+class TransactionBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.
+ * Adding a change output must be called after via TransactionBuilder::balance()
+ * inputs to cover the minimum fees. This does not, however, set the txbuilder's fee.
+ *
+ * change_address is required here in order to determine the min ada requirement precisely
+ * @param {TransactionUnspentOutputs} inputs
+ * @param {Address} change_address
+ * @param {Uint32Array} weights
+ */
+ add_inputs_from(inputs, change_address, weights) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(inputs, TransactionUnspentOutputs);
+ _assertClass(change_address, Address);
+ const ptr0 = passArray32ToWasm0(weights, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.transactionbuilder_add_inputs_from(
+ retptr,
+ this.ptr,
+ inputs.ptr,
+ change_address.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);
+ }
+ }
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_input(utxo, script_witness) {
+ _assertClass(utxo, TransactionUnspentOutput);
+ let ptr0 = 0;
+ if (!isLikeNone(script_witness)) {
+ _assertClass(script_witness, ScriptWitness);
+ ptr0 = script_witness.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_add_input(this.ptr, utxo.ptr, ptr0);
+ }
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ */
+ add_reference_input(utxo) {
+ _assertClass(utxo, TransactionUnspentOutput);
+ wasm.transactionbuilder_add_reference_input(this.ptr, utxo.ptr);
+ }
+ /**
+ * 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.ptr,
+ address.ptr,
+ input.ptr,
+ amount.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.ptr, output.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 plutus scripts via a PlutusScripts object
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.transactionbuilder_add_plutus_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * Add plutus v2 scripts via a PlutusScripts object
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.transactionbuilder_add_plutus_v2_script(this.ptr, plutus_script.ptr);
+ }
+ /**
+ * Add plutus data via a PlutusData object
+ * @param {PlutusData} plutus_data
+ */
+ add_plutus_data(plutus_data) {
+ _assertClass(plutus_data, PlutusData);
+ wasm.transactionbuilder_add_plutus_data(this.ptr, plutus_data.ptr);
+ }
+ /**
+ * Add native scripts via a NativeScripts object
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script) {
+ _assertClass(native_script, NativeScript);
+ wasm.transactionbuilder_add_native_script(this.ptr, native_script.ptr);
+ }
+ /**
+ * Add certificate via a Certificates object
+ * @param {Certificate} certificate
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_certificate(certificate, script_witness) {
+ _assertClass(certificate, Certificate);
+ let ptr0 = 0;
+ if (!isLikeNone(script_witness)) {
+ _assertClass(script_witness, ScriptWitness);
+ ptr0 = script_witness.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_add_certificate(this.ptr, certificate.ptr, ptr0);
+ }
+ /**
+ * 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.ptr, output.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} ttl
+ */
+ set_ttl(ttl) {
+ _assertClass(ttl, BigNum);
+ wasm.protocolparamupdate_set_minfee_b(this.ptr, ttl.ptr);
+ }
+ /**
+ * @param {BigNum} validity_start_interval
+ */
+ set_validity_start_interval(validity_start_interval) {
+ _assertClass(validity_start_interval, BigNum);
+ wasm.protocolparamupdate_set_key_deposit(
+ this.ptr,
+ validity_start_interval.ptr,
+ );
+ }
+ /**
+ * @param {RewardAddress} reward_address
+ * @param {BigNum} coin
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_withdrawal(reward_address, coin, script_witness) {
+ _assertClass(reward_address, RewardAddress);
+ _assertClass(coin, BigNum);
+ let ptr0 = 0;
+ if (!isLikeNone(script_witness)) {
+ _assertClass(script_witness, ScriptWitness);
+ ptr0 = script_witness.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_add_withdrawal(
+ this.ptr,
+ reward_address.ptr,
+ coin.ptr,
+ ptr0,
+ );
+ }
+ /**
+ * @returns {AuxiliaryData | undefined}
+ */
+ auxiliary_data() {
+ const ret = wasm.transactionbuilder_auxiliary_data(this.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.ptr, auxiliary_data.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.ptr, metadata.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.ptr, key.ptr, val.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.ptr,
+ key.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 {number} 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.ptr,
+ key.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);
+ }
+ }
+ /**
+ * Returns a copy of the current mint state in the builder
+ * @returns {Mint | undefined}
+ */
+ mint() {
+ const ret = wasm.transactionbuilder_mint(this.ptr);
+ return ret === 0 ? undefined : Mint.__wrap(ret);
+ }
+ /**
+ * @returns {Certificates | undefined}
+ */
+ certificates() {
+ const ret = wasm.transactionbuilder_certificates(this.ptr);
+ return ret === 0 ? undefined : Certificates.__wrap(ret);
+ }
+ /**
+ * @returns {Withdrawals | undefined}
+ */
+ withdrawals() {
+ const ret = wasm.transactionbuilder_withdrawals(this.ptr);
+ return ret === 0 ? undefined : Withdrawals.__wrap(ret);
+ }
+ /**
+ * Returns a copy of the current witness native scripts in the builder
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts() {
+ const ret = wasm.transactionbuilder_native_scripts(this.ptr);
+ return ret === 0 ? undefined : NativeScripts.__wrap(ret);
+ }
+ /**
+ * 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 securely add assets to an existing PolicyID
+ * But it will replace/overwrite any existing mint assets with the same PolicyID
+ * first redeemer applied to a PolicyID is taken for all further assets added to the same PolicyID
+ * @param {ScriptHash} policy_id
+ * @param {MintAssets} mint_assets
+ * @param {ScriptWitness | undefined} script_witness
+ */
+ add_mint(policy_id, mint_assets, script_witness) {
+ _assertClass(policy_id, ScriptHash);
+ _assertClass(mint_assets, MintAssets);
+ let ptr0 = 0;
+ if (!isLikeNone(script_witness)) {
+ _assertClass(script_witness, ScriptWitness);
+ ptr0 = script_witness.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_add_mint(
+ this.ptr,
+ policy_id.ptr,
+ mint_assets.ptr,
+ ptr0,
+ );
+ }
+ /**
+ * @param {TransactionBuilderConfig} cfg
+ * @returns {TransactionBuilder}
+ */
+ static new(cfg) {
+ _assertClass(cfg, TransactionBuilderConfig);
+ const ret = wasm.transactionbuilder_new(cfg.ptr);
+ return TransactionBuilder.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptDataHash | undefined}
+ */
+ script_data_hash() {
+ const ret = wasm.transactionbuilder_script_data_hash(this.ptr);
+ return ret === 0 ? undefined : ScriptDataHash.__wrap(ret);
+ }
+ /**
+ * @param {TransactionUnspentOutput} utxo
+ */
+ add_collateral(utxo) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(utxo, TransactionUnspentOutput);
+ wasm.transactionbuilder_add_collateral(retptr, this.ptr, utxo.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 | undefined}
+ */
+ get_collateral() {
+ const ret = wasm.transactionbuilder_get_collateral(this.ptr);
+ return ret === 0 ? undefined : TransactionInputs.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} required_signer
+ */
+ add_required_signer(required_signer) {
+ _assertClass(required_signer, Ed25519KeyHash);
+ wasm.transactionbuilder_add_required_signer(this.ptr, required_signer.ptr);
+ }
+ /**
+ * @returns {Ed25519KeyHashes | undefined}
+ */
+ required_signers() {
+ const ret = wasm.transactionbuilder_required_signers(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHashes.__wrap(ret);
+ }
+ /**
+ * @param {NetworkId} network_id
+ */
+ set_network_id(network_id) {
+ _assertClass(network_id, NetworkId);
+ var ptr0 = network_id.__destroy_into_raw();
+ wasm.transactionbuilder_set_network_id(this.ptr, ptr0);
+ }
+ /**
+ * @returns {NetworkId | undefined}
+ */
+ network_id() {
+ const ret = wasm.transactionbuilder_network_id(this.ptr);
+ return ret === 0 ? undefined : NetworkId.__wrap(ret);
+ }
+ /**
+ * @returns {Redeemers | undefined}
+ */
+ redeemers() {
+ const ret = wasm.transactionbuilder_redeemers(this.ptr);
+ return ret === 0 ? undefined : Redeemers.__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.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.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.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 implicit output plus burn (does not consider fee directly)
+ * @returns {Value}
+ */
+ get_total_output() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilder_get_total_output(retptr, this.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.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.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.protocolparamupdate_minfee_a(this.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} change_address
+ * @param {Datum | undefined} datum
+ */
+ balance(change_address, datum) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(change_address, Address);
+ let ptr0 = 0;
+ if (!isLikeNone(datum)) {
+ _assertClass(datum, Datum);
+ ptr0 = datum.__destroy_into_raw();
+ }
+ wasm.transactionbuilder_balance(
+ retptr,
+ this.ptr,
+ change_address.ptr,
+ ptr0,
+ );
+ 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 the TransactionBody.
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilder_to_bytes(retptr, this.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 v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {number}
+ */
+ full_size() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilder_full_size(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU32FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 4);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {TransactionOutputs}
+ */
+ outputs() {
+ const ret = wasm.transactionbuilder_outputs(this.ptr);
+ return TransactionOutputs.__wrap(ret);
+ }
+ /**
+ * 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
+ *
+ * takes fetched ex units into consideration
+ *
+ * add collateral utxos and collateral change receiver in case you redeem from plutus script utxos
+ *
+ * async call
+ *
+ * NOTE: is_valid set to true
+ * @param {TransactionUnspentOutputs | undefined} collateral_utxos
+ * @param {Address | undefined} collateral_change_address
+ * @param {boolean | undefined} native_uplc
+ * @returns {Promise}
+ */
+ construct(collateral_utxos, collateral_change_address, native_uplc) {
+ const ptr = this.__destroy_into_raw();
+ let ptr0 = 0;
+ if (!isLikeNone(collateral_utxos)) {
+ _assertClass(collateral_utxos, TransactionUnspentOutputs);
+ ptr0 = collateral_utxos.__destroy_into_raw();
+ }
+ let ptr1 = 0;
+ if (!isLikeNone(collateral_change_address)) {
+ _assertClass(collateral_change_address, Address);
+ ptr1 = collateral_change_address.__destroy_into_raw();
+ }
+ const ret = wasm.transactionbuilder_construct(
+ ptr,
+ ptr0,
+ ptr1,
+ isLikeNone(native_uplc) ? 0xFFFFFF : native_uplc ? 1 : 0,
+ );
+ return takeObject(ret);
+ }
+ /**
+ * 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
+ * @returns {Transaction}
+ */
+ build_tx() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilder_build_tx(retptr, this.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.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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionbuilderconfig_free(ptr)
+);
+/** */
+class TransactionBuilderConfig {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBuilderConfig.prototype);
+ obj.ptr = ptr;
+ TransactionBuilderConfigFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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 = new FinalizationRegistry(
+ (ptr) => wasm.__wbg_transactionbuilderconfigbuilder_free(ptr)
+);
+/** */
+class TransactionBuilderConfigBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionBuilderConfigBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionBuilderConfigBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr,
+ fee_algo.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.ptr,
+ coins_per_utxo_byte.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.ptr,
+ pool_deposit.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.ptr,
+ key_deposit.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.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.ptr,
+ max_tx_size,
+ );
+ 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.ptr,
+ ex_unit_prices.ptr,
+ );
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {ExUnits} max_tx_ex_units
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ max_tx_ex_units(max_tx_ex_units) {
+ _assertClass(max_tx_ex_units, ExUnits);
+ const ret = wasm.transactionbuilderconfigbuilder_max_tx_ex_units(
+ this.ptr,
+ max_tx_ex_units.ptr,
+ );
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {Costmdls} costmdls
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ costmdls(costmdls) {
+ _assertClass(costmdls, Costmdls);
+ const ret = wasm.transactionbuilderconfigbuilder_costmdls(
+ this.ptr,
+ costmdls.ptr,
+ );
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {number} collateral_percentage
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ collateral_percentage(collateral_percentage) {
+ const ret = wasm.transactionbuilderconfigbuilder_collateral_percentage(
+ this.ptr,
+ collateral_percentage,
+ );
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {number} max_collateral_inputs
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ max_collateral_inputs(max_collateral_inputs) {
+ const ret = wasm.transactionbuilderconfigbuilder_max_collateral_inputs(
+ this.ptr,
+ max_collateral_inputs,
+ );
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {UnitInterval} minfee_refscript_cost_per_byte
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ minfee_refscript_cost_per_byte(minfee_refscript_cost_per_byte) {
+ _assertClass(minfee_refscript_cost_per_byte, UnitInterval);
+ const ret = wasm
+ .transactionbuilderconfigbuilder_minfee_refscript_cost_per_byte(
+ this.ptr,
+ minfee_refscript_cost_per_byte.ptr,
+ );
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} zero_time
+ * @param {BigNum} zero_slot
+ * @param {number} slot_length
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ slot_config(zero_time, zero_slot, slot_length) {
+ _assertClass(zero_time, BigNum);
+ _assertClass(zero_slot, BigNum);
+ const ret = wasm.transactionbuilderconfigbuilder_slot_config(
+ this.ptr,
+ zero_time.ptr,
+ zero_slot.ptr,
+ slot_length,
+ );
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @param {Blockfrost} blockfrost
+ * @returns {TransactionBuilderConfigBuilder}
+ */
+ blockfrost(blockfrost) {
+ _assertClass(blockfrost, Blockfrost);
+ const ret = wasm.transactionbuilderconfigbuilder_blockfrost(
+ this.ptr,
+ blockfrost.ptr,
+ );
+ return TransactionBuilderConfigBuilder.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionBuilderConfig}
+ */
+ build() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionbuilderconfigbuilder_build(retptr, this.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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionhash_free(ptr)
+);
+/** */
+class TransactionHash {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionHash.prototype);
+ obj.ptr = ptr;
+ TransactionHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 TransactionIndexesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionindexes_free(ptr)
+);
+/** */
+class TransactionIndexes {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionIndexes.prototype);
+ obj.ptr = ptr;
+ TransactionIndexesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TransactionIndexesFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_transactionindexes_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionindexes_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TransactionIndexes}
+ */
+ 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.transactionindexes_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 TransactionIndexes.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {TransactionIndexes}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return TransactionIndexes.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {BigNum}
+ */
+ get(index) {
+ const ret = wasm.transactionindexes_get(this.ptr, index);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} elem
+ */
+ add(elem) {
+ _assertClass(elem, BigNum);
+ wasm.transactionindexes_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.TransactionIndexes = TransactionIndexes;
+
+const TransactionInputFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactioninput_free(ptr)
+);
+/** */
+class TransactionInput {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionInput.prototype);
+ obj.ptr = ptr;
+ TransactionInputFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactioninput_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactioninput_to_js_value(retptr, this.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.governanceactionid_transaction_id(this.ptr);
+ return TransactionHash.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ index() {
+ const ret = wasm.governanceactionid_governance_action_index(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {TransactionHash} transaction_id
+ * @param {BigNum} index
+ * @returns {TransactionInput}
+ */
+ static new(transaction_id, index) {
+ _assertClass(transaction_id, TransactionHash);
+ _assertClass(index, BigNum);
+ const ret = wasm.governanceactionid_new(transaction_id.ptr, index.ptr);
+ return TransactionInput.__wrap(ret);
+ }
+}
+module.exports.TransactionInput = TransactionInput;
+
+const TransactionInputsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactioninputs_free(ptr)
+);
+/** */
+class TransactionInputs {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionInputs.prototype);
+ obj.ptr = ptr;
+ TransactionInputsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactioninputs_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactioninputs_to_js_value(retptr, this.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.certificates_new();
+ return TransactionInputs.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionInput}
+ */
+ get(index) {
+ const ret = wasm.transactioninputs_get(this.ptr, index);
+ return TransactionInput.__wrap(ret);
+ }
+ /**
+ * @param {TransactionInput} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionInput);
+ wasm.transactioninputs_add(this.ptr, elem.ptr);
+ }
+ /** */
+ sort() {
+ wasm.transactioninputs_sort(this.ptr);
+ }
+}
+module.exports.TransactionInputs = TransactionInputs;
+
+const TransactionMetadatumFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionmetadatum_free(ptr)
+);
+/** */
+class TransactionMetadatum {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionMetadatum.prototype);
+ obj.ptr = ptr;
+ TransactionMetadatumFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @param {MetadataMap} map
+ * @returns {TransactionMetadatum}
+ */
+ static new_map(map) {
+ _assertClass(map, MetadataMap);
+ const ret = wasm.transactionmetadatum_new_map(map.ptr);
+ return TransactionMetadatum.__wrap(ret);
+ }
+ /**
+ * @param {MetadataList} list
+ * @returns {TransactionMetadatum}
+ */
+ static new_list(list) {
+ _assertClass(list, MetadataList);
+ const ret = wasm.transactionmetadatum_new_list(list.ptr);
+ return TransactionMetadatum.__wrap(ret);
+ }
+ /**
+ * @param {Int} int
+ * @returns {TransactionMetadatum}
+ */
+ static new_int(int) {
+ _assertClass(int, Int);
+ const ret = wasm.transactionmetadatum_new_int(int.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 {number}
+ */
+ kind() {
+ const ret = wasm.transactionmetadatum_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {MetadataMap}
+ */
+ as_map() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionmetadatum_as_map(retptr, this.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.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.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.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 v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ as_text() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionmetadatum_as_text(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+}
+module.exports.TransactionMetadatum = TransactionMetadatum;
+
+const TransactionMetadatumLabelsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionmetadatumlabels_free(ptr)
+);
+/** */
+class TransactionMetadatumLabels {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionMetadatumLabels.prototype);
+ obj.ptr = ptr;
+ TransactionMetadatumLabelsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {TransactionMetadatumLabels}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return TransactionMetadatumLabels.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {BigNum}
+ */
+ get(index) {
+ const ret = wasm.transactionmetadatumlabels_get(this.ptr, index);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} elem
+ */
+ add(elem) {
+ _assertClass(elem, BigNum);
+ wasm.transactionindexes_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.TransactionMetadatumLabels = TransactionMetadatumLabels;
+
+const TransactionOutputFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionoutput_free(ptr)
+);
+/** */
+class TransactionOutput {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionOutput.prototype);
+ obj.ptr = ptr;
+ TransactionOutputFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutput_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutput_to_js_value(retptr, this.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.ptr);
+ return Address.__wrap(ret);
+ }
+ /**
+ * @returns {Value}
+ */
+ amount() {
+ const ret = wasm.transactionoutput_amount(this.ptr);
+ return Value.__wrap(ret);
+ }
+ /**
+ * @returns {Datum | undefined}
+ */
+ datum() {
+ const ret = wasm.transactionoutput_datum(this.ptr);
+ return ret === 0 ? undefined : Datum.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptRef | undefined}
+ */
+ script_ref() {
+ const ret = wasm.transactionoutput_script_ref(this.ptr);
+ return ret === 0 ? undefined : ScriptRef.__wrap(ret);
+ }
+ /**
+ * @param {Datum} datum
+ */
+ set_datum(datum) {
+ _assertClass(datum, Datum);
+ wasm.transactionoutput_set_datum(this.ptr, datum.ptr);
+ }
+ /**
+ * @param {ScriptRef} script_ref
+ */
+ set_script_ref(script_ref) {
+ _assertClass(script_ref, ScriptRef);
+ wasm.transactionoutput_set_script_ref(this.ptr, script_ref.ptr);
+ }
+ /**
+ * @param {Address} address
+ * @param {Value} amount
+ * @returns {TransactionOutput}
+ */
+ static new(address, amount) {
+ _assertClass(address, Address);
+ _assertClass(amount, Value);
+ const ret = wasm.transactionoutput_new(address.ptr, amount.ptr);
+ return TransactionOutput.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ format() {
+ const ret = wasm.transactionoutput_format(this.ptr);
+ return ret;
+ }
+ /**
+ * legacy support: serialize output as array array
+ *
+ * does not support inline datum and script_ref!
+ * @returns {Uint8Array}
+ */
+ to_legacy_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutput_to_legacy_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.TransactionOutput = TransactionOutput;
+
+const TransactionOutputAmountBuilderFinalization = new FinalizationRegistry(
+ (ptr) => wasm.__wbg_transactionoutputamountbuilder_free(ptr)
+);
+/** */
+class TransactionOutputAmountBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionOutputAmountBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionOutputAmountBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr,
+ amount.ptr,
+ );
+ return TransactionOutputAmountBuilder.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} coin
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ with_coin(coin) {
+ _assertClass(coin, BigNum);
+ const ret = wasm.transactionoutputamountbuilder_with_coin(
+ this.ptr,
+ coin.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.ptr,
+ coin.ptr,
+ multiasset.ptr,
+ );
+ return TransactionOutputAmountBuilder.__wrap(ret);
+ }
+ /**
+ * @param {MultiAsset} multiasset
+ * @param {BigNum} coins_per_utxo_word
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ with_asset_and_min_required_coin(multiasset, coins_per_utxo_word) {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ _assertClass(multiasset, MultiAsset);
+ _assertClass(coins_per_utxo_word, BigNum);
+ wasm.transactionoutputamountbuilder_with_asset_and_min_required_coin(
+ retptr,
+ this.ptr,
+ multiasset.ptr,
+ coins_per_utxo_word.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.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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionoutputbuilder_free(ptr)
+);
+/**
+ * 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) {
+ const obj = Object.create(TransactionOutputBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionOutputBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr,
+ address.ptr,
+ );
+ return TransactionOutputBuilder.__wrap(ret);
+ }
+ /**
+ * @param {Datum} data_hash
+ * @returns {TransactionOutputBuilder}
+ */
+ with_datum(data_hash) {
+ _assertClass(data_hash, Datum);
+ const ret = wasm.transactionoutputbuilder_with_datum(
+ this.ptr,
+ data_hash.ptr,
+ );
+ return TransactionOutputBuilder.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionOutputAmountBuilder}
+ */
+ next() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutputbuilder_next(retptr, this.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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionoutputs_free(ptr)
+);
+/** */
+class TransactionOutputs {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionOutputs.prototype);
+ obj.ptr = ptr;
+ TransactionOutputsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutputs_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionoutputs_to_js_value(retptr, this.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.certificates_new();
+ return TransactionOutputs.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionOutput}
+ */
+ get(index) {
+ const ret = wasm.transactionoutputs_get(this.ptr, index);
+ return TransactionOutput.__wrap(ret);
+ }
+ /**
+ * @param {TransactionOutput} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionOutput);
+ wasm.transactionoutputs_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.TransactionOutputs = TransactionOutputs;
+
+const TransactionUnspentOutputFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionunspentoutput_free(ptr)
+);
+/** */
+class TransactionUnspentOutput {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionUnspentOutput.prototype);
+ obj.ptr = ptr;
+ TransactionUnspentOutputFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @param {TransactionInput} input
+ * @param {TransactionOutput} output
+ * @returns {TransactionUnspentOutput}
+ */
+ static new(input, output) {
+ _assertClass(input, TransactionInput);
+ _assertClass(output, TransactionOutput);
+ const ret = wasm.transactionunspentoutput_new(input.ptr, output.ptr);
+ return TransactionUnspentOutput.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionInput}
+ */
+ input() {
+ const ret = wasm.transactionunspentoutput_input(this.ptr);
+ return TransactionInput.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionOutput}
+ */
+ output() {
+ const ret = wasm.transactionunspentoutput_output(this.ptr);
+ return TransactionOutput.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_legacy_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionunspentoutput_to_legacy_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.TransactionUnspentOutput = TransactionUnspentOutput;
+
+const TransactionUnspentOutputsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionunspentoutputs_free(ptr)
+);
+/** */
+class TransactionUnspentOutputs {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionUnspentOutputs.prototype);
+ obj.ptr = ptr;
+ TransactionUnspentOutputsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TransactionUnspentOutputsFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_transactionunspentoutputs_free(ptr);
+ }
+ /**
+ * @returns {TransactionUnspentOutputs}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return TransactionUnspentOutputs.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionUnspentOutput}
+ */
+ get(index) {
+ const ret = wasm.transactionunspentoutputs_get(this.ptr, index);
+ return TransactionUnspentOutput.__wrap(ret);
+ }
+ /**
+ * @param {TransactionUnspentOutput} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionUnspentOutput);
+ wasm.transactionunspentoutputs_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.TransactionUnspentOutputs = TransactionUnspentOutputs;
+
+const TransactionWitnessSetFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionwitnessset_free(ptr)
+);
+/** */
+class TransactionWitnessSet {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionWitnessSet.prototype);
+ obj.ptr = ptr;
+ TransactionWitnessSetFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnessset_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnessset_to_js_value(retptr, this.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.ptr, vkeys.ptr);
+ }
+ /**
+ * @returns {Vkeywitnesses | undefined}
+ */
+ vkeys() {
+ const ret = wasm.transactionwitnessset_vkeys(this.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.ptr, native_scripts.ptr);
+ }
+ /**
+ * @returns {NativeScripts | undefined}
+ */
+ native_scripts() {
+ const ret = wasm.transactionwitnessset_native_scripts(this.ptr);
+ return ret === 0 ? undefined : NativeScripts.__wrap(ret);
+ }
+ /**
+ * @param {BootstrapWitnesses} bootstraps
+ */
+ set_bootstraps(bootstraps) {
+ _assertClass(bootstraps, BootstrapWitnesses);
+ wasm.transactionwitnessset_set_bootstraps(this.ptr, bootstraps.ptr);
+ }
+ /**
+ * @returns {BootstrapWitnesses | undefined}
+ */
+ bootstraps() {
+ const ret = wasm.transactionwitnessset_bootstraps(this.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.ptr, plutus_scripts.ptr);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_scripts() {
+ const ret = wasm.transactionwitnessset_plutus_scripts(this.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.ptr, plutus_data.ptr);
+ }
+ /**
+ * @returns {PlutusList | undefined}
+ */
+ plutus_data() {
+ const ret = wasm.transactionwitnessset_plutus_data(this.ptr);
+ return ret === 0 ? undefined : PlutusList.__wrap(ret);
+ }
+ /**
+ * @param {Redeemers} redeemers
+ */
+ set_redeemers(redeemers) {
+ _assertClass(redeemers, Redeemers);
+ wasm.transactionwitnessset_set_redeemers(this.ptr, redeemers.ptr);
+ }
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v2_scripts(plutus_scripts) {
+ _assertClass(plutus_scripts, PlutusScripts);
+ wasm.transactionwitnessset_set_plutus_v2_scripts(
+ this.ptr,
+ plutus_scripts.ptr,
+ );
+ }
+ /**
+ * @param {PlutusScripts} plutus_scripts
+ */
+ set_plutus_v3_scripts(plutus_scripts) {
+ _assertClass(plutus_scripts, PlutusScripts);
+ wasm.transactionwitnessset_set_plutus_v3_scripts(
+ this.ptr,
+ plutus_scripts.ptr,
+ );
+ }
+ /**
+ * @returns {Redeemers | undefined}
+ */
+ redeemers() {
+ const ret = wasm.transactionwitnessset_redeemers(this.ptr);
+ return ret === 0 ? undefined : Redeemers.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v2_scripts() {
+ const ret = wasm.transactionwitnessset_plutus_v2_scripts(this.ptr);
+ return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {PlutusScripts | undefined}
+ */
+ plutus_v3_scripts() {
+ const ret = wasm.transactionwitnessset_plutus_v3_scripts(this.ptr);
+ return ret === 0 ? undefined : PlutusScripts.__wrap(ret);
+ }
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ static new() {
+ const ret = wasm.transactionwitnessset_new();
+ return TransactionWitnessSet.__wrap(ret);
+ }
+}
+module.exports.TransactionWitnessSet = TransactionWitnessSet;
+
+const TransactionWitnessSetBuilderFinalization = new FinalizationRegistry(
+ (ptr) => wasm.__wbg_transactionwitnesssetbuilder_free(ptr)
+);
+/**
+ * Builder de-duplicates witnesses as they are added
+ */
+class TransactionWitnessSetBuilder {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionWitnessSetBuilder.prototype);
+ obj.ptr = ptr;
+ TransactionWitnessSetBuilderFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TransactionWitnessSetBuilderFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_transactionwitnesssetbuilder_free(ptr);
+ }
+ /**
+ * @param {Vkeywitness} vkey
+ */
+ add_vkey(vkey) {
+ _assertClass(vkey, Vkeywitness);
+ wasm.transactionwitnesssetbuilder_add_vkey(this.ptr, vkey.ptr);
+ }
+ /**
+ * @param {BootstrapWitness} bootstrap
+ */
+ add_bootstrap(bootstrap) {
+ _assertClass(bootstrap, BootstrapWitness);
+ wasm.transactionwitnesssetbuilder_add_bootstrap(this.ptr, bootstrap.ptr);
+ }
+ /**
+ * @param {NativeScript} native_script
+ */
+ add_native_script(native_script) {
+ _assertClass(native_script, NativeScript);
+ wasm.transactionwitnesssetbuilder_add_native_script(
+ this.ptr,
+ native_script.ptr,
+ );
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.transactionwitnesssetbuilder_add_plutus_script(
+ this.ptr,
+ plutus_script.ptr,
+ );
+ }
+ /**
+ * @param {PlutusScript} plutus_script
+ */
+ add_plutus_v2_script(plutus_script) {
+ _assertClass(plutus_script, PlutusScript);
+ wasm.transactionwitnesssetbuilder_add_plutus_v2_script(
+ this.ptr,
+ plutus_script.ptr,
+ );
+ }
+ /**
+ * @param {PlutusData} plutus_datum
+ */
+ add_plutus_datum(plutus_datum) {
+ _assertClass(plutus_datum, PlutusData);
+ wasm.transactionwitnesssetbuilder_add_plutus_datum(
+ this.ptr,
+ plutus_datum.ptr,
+ );
+ }
+ /**
+ * @param {Redeemer} redeemer
+ */
+ add_redeemer(redeemer) {
+ _assertClass(redeemer, Redeemer);
+ wasm.transactionwitnesssetbuilder_add_redeemer(this.ptr, redeemer.ptr);
+ }
+ /**
+ * @param {RequiredWitnessSet} required_wits
+ */
+ add_required_wits(required_wits) {
+ _assertClass(required_wits, RequiredWitnessSet);
+ wasm.transactionwitnesssetbuilder_add_required_wits(
+ this.ptr,
+ required_wits.ptr,
+ );
+ }
+ /**
+ * @returns {TransactionWitnessSetBuilder}
+ */
+ static new() {
+ const ret = wasm.transactionwitnesssetbuilder_new();
+ return TransactionWitnessSetBuilder.__wrap(ret);
+ }
+ /**
+ * @param {TransactionWitnessSet} wit_set
+ */
+ add_existing(wit_set) {
+ _assertClass(wit_set, TransactionWitnessSet);
+ wasm.transactionwitnesssetbuilder_add_existing(this.ptr, wit_set.ptr);
+ }
+ /**
+ * @returns {TransactionWitnessSet}
+ */
+ build() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnesssetbuilder_build(retptr, this.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 TransactionWitnessSet.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.TransactionWitnessSetBuilder = TransactionWitnessSetBuilder;
+
+const TransactionWitnessSetsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_transactionwitnesssets_free(ptr)
+);
+/** */
+class TransactionWitnessSets {
+ static __wrap(ptr) {
+ const obj = Object.create(TransactionWitnessSets.prototype);
+ obj.ptr = ptr;
+ TransactionWitnessSetsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnesssets_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.transactionwitnesssets_to_js_value(retptr, this.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.assetnames_new();
+ return TransactionWitnessSets.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {TransactionWitnessSet}
+ */
+ get(index) {
+ const ret = wasm.transactionwitnesssets_get(this.ptr, index);
+ return TransactionWitnessSet.__wrap(ret);
+ }
+ /**
+ * @param {TransactionWitnessSet} elem
+ */
+ add(elem) {
+ _assertClass(elem, TransactionWitnessSet);
+ wasm.transactionwitnesssets_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.TransactionWitnessSets = TransactionWitnessSets;
+
+const TreasuryWithdrawalsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_treasurywithdrawals_free(ptr)
+);
+/** */
+class TreasuryWithdrawals {
+ static __wrap(ptr) {
+ const obj = Object.create(TreasuryWithdrawals.prototype);
+ obj.ptr = ptr;
+ TreasuryWithdrawalsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ TreasuryWithdrawalsFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_treasurywithdrawals_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawals_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {TreasuryWithdrawals}
+ */
+ 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.treasurywithdrawals_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 TreasuryWithdrawals.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawals_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawals_to_js_value(retptr, this.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.assets_new();
+ return TreasuryWithdrawals.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {Ed25519KeyHash} key
+ * @param {BigNum} value
+ * @returns {BigNum | undefined}
+ */
+ insert(key, value) {
+ _assertClass(key, Ed25519KeyHash);
+ _assertClass(value, BigNum);
+ const ret = wasm.treasurywithdrawals_insert(this.ptr, key.ptr, value.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} key
+ * @returns {BigNum | undefined}
+ */
+ get(key) {
+ _assertClass(key, Ed25519KeyHash);
+ const ret = wasm.treasurywithdrawals_get(this.ptr, key.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHashes}
+ */
+ keys() {
+ const ret = wasm.treasurywithdrawals_keys(this.ptr);
+ return Ed25519KeyHashes.__wrap(ret);
+ }
+}
+module.exports.TreasuryWithdrawals = TreasuryWithdrawals;
+
+const TreasuryWithdrawalsActionFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_treasurywithdrawalsaction_free(ptr)
+);
+/** */
+class TreasuryWithdrawalsAction {
+ static __wrap(ptr) {
+ const obj = Object.create(TreasuryWithdrawalsAction.prototype);
+ obj.ptr = ptr;
+ TreasuryWithdrawalsActionFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawalsaction_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.treasurywithdrawalsaction_to_js_value(retptr, this.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.ptr);
+ return TreasuryWithdrawals.__wrap(ret);
+ }
+ /**
+ * @param {TreasuryWithdrawals} withdrawals
+ * @returns {TreasuryWithdrawalsAction}
+ */
+ static new(withdrawals) {
+ _assertClass(withdrawals, TreasuryWithdrawals);
+ const ret = wasm.treasurywithdrawalsaction_new(withdrawals.ptr);
+ return TreasuryWithdrawalsAction.__wrap(ret);
+ }
+}
+module.exports.TreasuryWithdrawalsAction = TreasuryWithdrawalsAction;
+
+const UnitIntervalFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_unitinterval_free(ptr)
+);
+/** */
+class UnitInterval {
+ static __wrap(ptr) {
+ const obj = Object.create(UnitInterval.prototype);
+ obj.ptr = ptr;
+ UnitIntervalFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unitinterval_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unitinterval_to_js_value(retptr, this.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.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ denominator() {
+ const ret = wasm.exunits_steps(this.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.exunits_new(numerator.ptr, denominator.ptr);
+ return UnitInterval.__wrap(ret);
+ }
+ /**
+ * @param {number} float_number
+ * @returns {UnitInterval}
+ */
+ static from_float(float_number) {
+ const ret = wasm.unitinterval_from_float(float_number);
+ return UnitInterval.__wrap(ret);
+ }
+}
+module.exports.UnitInterval = UnitInterval;
+
+const UnregCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_unregcert_free(ptr)
+);
+/** */
+class UnregCert {
+ static __wrap(ptr) {
+ const obj = Object.create(UnregCert.prototype);
+ obj.ptr = ptr;
+ UnregCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ UnregCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_unregcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregCert}
+ */
+ 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.unregcert_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 UnregCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regcert_to_js_value(retptr, this.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 {UnregCert}
+ */
+ 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.unregcert_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 UnregCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {BigNum} coin
+ * @returns {UnregCert}
+ */
+ static new(stake_credential, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(coin, BigNum);
+ const ret = wasm.regcert_new(stake_credential.ptr, coin.ptr);
+ return UnregCert.__wrap(ret);
+ }
+}
+module.exports.UnregCert = UnregCert;
+
+const UnregCommitteeHotKeyCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_unregcommitteehotkeycert_free(ptr)
+);
+/** */
+class UnregCommitteeHotKeyCert {
+ static __wrap(ptr) {
+ const obj = Object.create(UnregCommitteeHotKeyCert.prototype);
+ obj.ptr = ptr;
+ UnregCommitteeHotKeyCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ UnregCommitteeHotKeyCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_unregcommitteehotkeycert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregcommitteehotkeycert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregCommitteeHotKeyCert}
+ */
+ 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.unregcommitteehotkeycert_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 UnregCommitteeHotKeyCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregcommitteehotkeycert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregcommitteehotkeycert_to_js_value(retptr, this.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 {UnregCommitteeHotKeyCert}
+ */
+ 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.unregcommitteehotkeycert_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 UnregCommitteeHotKeyCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Ed25519KeyHash}
+ */
+ committee_cold_keyhash() {
+ const ret = wasm.regcommitteehotkeycert_committee_cold_keyhash(this.ptr);
+ return Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} committee_cold_keyhash
+ * @returns {UnregCommitteeHotKeyCert}
+ */
+ static new(committee_cold_keyhash) {
+ _assertClass(committee_cold_keyhash, Ed25519KeyHash);
+ const ret = wasm.scriptpubkey_new(committee_cold_keyhash.ptr);
+ return UnregCommitteeHotKeyCert.__wrap(ret);
+ }
+}
+module.exports.UnregCommitteeHotKeyCert = UnregCommitteeHotKeyCert;
+
+const UnregDrepCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_unregdrepcert_free(ptr)
+);
+/** */
+class UnregDrepCert {
+ static __wrap(ptr) {
+ const obj = Object.create(UnregDrepCert.prototype);
+ obj.ptr = ptr;
+ UnregDrepCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ UnregDrepCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_unregdrepcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.unregdrepcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {UnregDrepCert}
+ */
+ 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.unregdrepcert_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 UnregDrepCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.regdrepcert_to_js_value(retptr, this.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 {UnregDrepCert}
+ */
+ 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.unregdrepcert_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 UnregDrepCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ voting_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} voting_credential
+ * @param {BigNum} coin
+ * @returns {UnregDrepCert}
+ */
+ static new(voting_credential, coin) {
+ _assertClass(voting_credential, StakeCredential);
+ _assertClass(coin, BigNum);
+ const ret = wasm.regcert_new(voting_credential.ptr, coin.ptr);
+ return UnregDrepCert.__wrap(ret);
+ }
+}
+module.exports.UnregDrepCert = UnregDrepCert;
+
+const UpdateFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_update_free(ptr)
+);
+/** */
+class Update {
+ static __wrap(ptr) {
+ const obj = Object.create(Update.prototype);
+ obj.ptr = ptr;
+ UpdateFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.update_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.update_to_js_value(retptr, this.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.ptr);
+ return ProposedProtocolParameterUpdates.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ epoch() {
+ const ret = wasm.update_epoch(this.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.ptr, epoch);
+ return Update.__wrap(ret);
+ }
+}
+module.exports.Update = Update;
+
+const UrlFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_url_free(ptr)
+);
+/** */
+class Url {
+ static __wrap(ptr) {
+ const obj = Object.create(Url.prototype);
+ obj.ptr = ptr;
+ UrlFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.blockfrost_url(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+}
+module.exports.Url = Url;
+
+const VRFCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_vrfcert_free(ptr)
+);
+/** */
+class VRFCert {
+ static __wrap(ptr) {
+ const obj = Object.create(VRFCert.prototype);
+ obj.ptr = ptr;
+ VRFCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vrfcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vrfcert_to_js_value(retptr, this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ proof() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.bootstrapwitness_attributes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_vrfkeyhash_free(ptr)
+);
+/** */
+class VRFKeyHash {
+ static __wrap(ptr) {
+ const obj = Object.create(VRFKeyHash.prototype);
+ obj.ptr = ptr;
+ VRFKeyHashFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.auxiliarydatahash_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {string} prefix
+ * @returns {string}
+ */
+ to_bech32(prefix) {
+ 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.auxiliarydatahash_to_bech32(retptr, this.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 ptr1 = r0;
+ var len1 = r1;
+ if (r3) {
+ ptr1 = 0;
+ len1 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr1, len1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr1, len1);
+ }
+ }
+ /**
+ * @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() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.auxiliarydatahash_to_hex(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ return getStringFromWasm0(r0, r1);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(r0, r1);
+ }
+ }
+ /**
+ * @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 = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_vrfvkey_free(ptr)
+);
+/** */
+class VRFVKey {
+ static __wrap(ptr) {
+ const obj = Object.create(VRFVKey.prototype);
+ obj.ptr = ptr;
+ VRFVKeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VRFVKeyFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_vrfvkey_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vrfvkey_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @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.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 VRFVKey.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {VRFKeyHash}
+ */
+ hash() {
+ const ret = wasm.vrfvkey_hash(this.ptr);
+ return VRFKeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_raw_key() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.assetname_name(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+}
+module.exports.VRFVKey = VRFVKey;
+
+const ValueFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_value_free(ptr)
+);
+/** */
+class Value {
+ static __wrap(ptr) {
+ const obj = Object.create(Value.prototype);
+ obj.ptr = ptr;
+ ValueFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.value_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.value_to_js_value(retptr, this.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.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.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.ptr);
+ return ret !== 0;
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.value_coin(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {BigNum} coin
+ */
+ set_coin(coin) {
+ _assertClass(coin, BigNum);
+ wasm.value_set_coin(this.ptr, coin.ptr);
+ }
+ /**
+ * @returns {MultiAsset | undefined}
+ */
+ multiasset() {
+ const ret = wasm.value_multiasset(this.ptr);
+ return ret === 0 ? undefined : MultiAsset.__wrap(ret);
+ }
+ /**
+ * @param {MultiAsset} multiasset
+ */
+ set_multiasset(multiasset) {
+ _assertClass(multiasset, MultiAsset);
+ wasm.value_set_multiasset(this.ptr, multiasset.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.ptr, rhs.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.ptr, rhs_value.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.ptr, rhs_value.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.ptr, rhs_value.ptr);
+ return ret === 0xFFFFFF ? undefined : ret;
+ }
+}
+module.exports.Value = Value;
+
+const VkeyFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_vkey_free(ptr)
+);
+/** */
+class Vkey {
+ static __wrap(ptr) {
+ const obj = Object.create(Vkey.prototype);
+ obj.ptr = ptr;
+ VkeyFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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);
+ }
+ }
+ /**
+ * @param {PublicKey} pk
+ * @returns {Vkey}
+ */
+ static new(pk) {
+ _assertClass(pk, PublicKey);
+ const ret = wasm.vkey_new(pk.ptr);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @returns {PublicKey}
+ */
+ public_key() {
+ const ret = wasm.vkey_public_key(this.ptr);
+ return PublicKey.__wrap(ret);
+ }
+}
+module.exports.Vkey = Vkey;
+
+const VkeysFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_vkeys_free(ptr)
+);
+/** */
+class Vkeys {
+ static __wrap(ptr) {
+ const obj = Object.create(Vkeys.prototype);
+ obj.ptr = ptr;
+ VkeysFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ed25519keyhashes_new();
+ return Vkeys.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Vkey}
+ */
+ get(index) {
+ const ret = wasm.vkeys_get(this.ptr, index);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @param {Vkey} elem
+ */
+ add(elem) {
+ _assertClass(elem, Vkey);
+ wasm.vkeys_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.Vkeys = Vkeys;
+
+const VkeywitnessFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_vkeywitness_free(ptr)
+);
+/** */
+class Vkeywitness {
+ static __wrap(ptr) {
+ const obj = Object.create(Vkeywitness.prototype);
+ obj.ptr = ptr;
+ VkeywitnessFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vkeywitness_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vkeywitness_to_js_value(retptr, this.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.ptr, signature.ptr);
+ return Vkeywitness.__wrap(ret);
+ }
+ /**
+ * @returns {Vkey}
+ */
+ vkey() {
+ const ret = wasm.vkeywitness_vkey(this.ptr);
+ return Vkey.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519Signature}
+ */
+ signature() {
+ const ret = wasm.vkeywitness_signature(this.ptr);
+ return Ed25519Signature.__wrap(ret);
+ }
+}
+module.exports.Vkeywitness = Vkeywitness;
+
+const VkeywitnessesFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_vkeywitnesses_free(ptr)
+);
+/** */
+class Vkeywitnesses {
+ static __wrap(ptr) {
+ const obj = Object.create(Vkeywitnesses.prototype);
+ obj.ptr = ptr;
+ VkeywitnessesFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VkeywitnessesFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_vkeywitnesses_free(ptr);
+ }
+ /**
+ * @returns {Vkeywitnesses}
+ */
+ static new() {
+ const ret = wasm.ed25519keyhashes_new();
+ return Vkeywitnesses.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {Vkeywitness}
+ */
+ get(index) {
+ const ret = wasm.vkeywitnesses_get(this.ptr, index);
+ return Vkeywitness.__wrap(ret);
+ }
+ /**
+ * @param {Vkeywitness} elem
+ */
+ add(elem) {
+ _assertClass(elem, Vkeywitness);
+ wasm.vkeywitnesses_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.Vkeywitnesses = Vkeywitnesses;
+
+const VoteFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_vote_free(ptr)
+);
+/** */
+class Vote {
+ static __wrap(ptr) {
+ const obj = Object.create(Vote.prototype);
+ obj.ptr = ptr;
+ VoteFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VoteFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_vote_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vote_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {Vote}
+ */
+ 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.vote_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 Vote.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vote_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.vote_to_js_value(retptr, this.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 {Vote}
+ */
+ 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.vote_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 Vote.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {Vote}
+ */
+ static new_no() {
+ const ret = wasm.language_new_plutus_v1();
+ return Vote.__wrap(ret);
+ }
+ /**
+ * @returns {Vote}
+ */
+ static new_yes() {
+ const ret = wasm.language_new_plutus_v2();
+ return Vote.__wrap(ret);
+ }
+ /**
+ * @returns {Vote}
+ */
+ static new_abstain() {
+ const ret = wasm.language_new_plutus_v3();
+ return Vote.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.vote_kind(this.ptr);
+ return ret >>> 0;
+ }
+}
+module.exports.Vote = Vote;
+
+const VoteDelegCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_votedelegcert_free(ptr)
+);
+/** */
+class VoteDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(VoteDelegCert.prototype);
+ obj.ptr = ptr;
+ VoteDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VoteDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_votedelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votedelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VoteDelegCert}
+ */
+ 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.votedelegcert_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 VoteDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votedelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votedelegcert_to_js_value(retptr, this.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 {VoteDelegCert}
+ */
+ 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.votedelegcert_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 VoteDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.baseaddress_payment_cred(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ drep() {
+ const ret = wasm.stakevotedelegcert_drep(this.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Drep} drep
+ * @returns {VoteDelegCert}
+ */
+ static new(stake_credential, drep) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(drep, Drep);
+ const ret = wasm.votedelegcert_new(stake_credential.ptr, drep.ptr);
+ return VoteDelegCert.__wrap(ret);
+ }
+}
+module.exports.VoteDelegCert = VoteDelegCert;
+
+const VoteRegDelegCertFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_voteregdelegcert_free(ptr)
+);
+/** */
+class VoteRegDelegCert {
+ static __wrap(ptr) {
+ const obj = Object.create(VoteRegDelegCert.prototype);
+ obj.ptr = ptr;
+ VoteRegDelegCertFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.ptr = 0;
+ VoteRegDelegCertFinalization.unregister(this);
+ return ptr;
+ }
+
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_voteregdelegcert_free(ptr);
+ }
+ /**
+ * @returns {Uint8Array}
+ */
+ to_bytes() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voteregdelegcert_to_bytes(retptr, this.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @param {Uint8Array} bytes
+ * @returns {VoteRegDelegCert}
+ */
+ 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.voteregdelegcert_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 VoteRegDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {string}
+ */
+ to_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voteregdelegcert_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voteregdelegcert_to_js_value(retptr, this.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 {VoteRegDelegCert}
+ */
+ 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.voteregdelegcert_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 VoteRegDelegCert.__wrap(r0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ }
+ }
+ /**
+ * @returns {StakeCredential}
+ */
+ stake_credential() {
+ const ret = wasm.regcert_stake_credential(this.ptr);
+ return StakeCredential.__wrap(ret);
+ }
+ /**
+ * @returns {Drep}
+ */
+ drep() {
+ const ret = wasm.voteregdelegcert_drep(this.ptr);
+ return Drep.__wrap(ret);
+ }
+ /**
+ * @returns {BigNum}
+ */
+ coin() {
+ const ret = wasm.exunits_mem(this.ptr);
+ return BigNum.__wrap(ret);
+ }
+ /**
+ * @param {StakeCredential} stake_credential
+ * @param {Drep} drep
+ * @param {BigNum} coin
+ * @returns {VoteRegDelegCert}
+ */
+ static new(stake_credential, drep, coin) {
+ _assertClass(stake_credential, StakeCredential);
+ _assertClass(drep, Drep);
+ _assertClass(coin, BigNum);
+ const ret = wasm.voteregdelegcert_new(
+ stake_credential.ptr,
+ drep.ptr,
+ coin.ptr,
+ );
+ return VoteRegDelegCert.__wrap(ret);
+ }
+}
+module.exports.VoteRegDelegCert = VoteRegDelegCert;
+
+const VoterFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_voter_free(ptr)
+);
+/** */
+class Voter {
+ static __wrap(ptr) {
+ const obj = Object.create(Voter.prototype);
+ obj.ptr = ptr;
+ VoterFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voter_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.voter_to_js_value(retptr, this.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 {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_committee_hot_keyhash(keyhash) {
+ _assertClass(keyhash, Ed25519KeyHash);
+ const ret = wasm.drep_new_keyhash(keyhash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Voter}
+ */
+ static new_committee_hot_scripthash(scripthash) {
+ _assertClass(scripthash, ScriptHash);
+ const ret = wasm.drep_new_scripthash(scripthash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_drep_keyhash(keyhash) {
+ _assertClass(keyhash, Ed25519KeyHash);
+ const ret = wasm.voter_new_drep_keyhash(keyhash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @param {ScriptHash} scripthash
+ * @returns {Voter}
+ */
+ static new_drep_scripthash(scripthash) {
+ _assertClass(scripthash, ScriptHash);
+ const ret = wasm.voter_new_drep_scripthash(scripthash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @param {Ed25519KeyHash} keyhash
+ * @returns {Voter}
+ */
+ static new_staking_pool_keyhash(keyhash) {
+ _assertClass(keyhash, Ed25519KeyHash);
+ const ret = wasm.voter_new_staking_pool_keyhash(keyhash.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ kind() {
+ const ret = wasm.voter_kind(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_committee_hot_keyhash() {
+ const ret = wasm.voter_as_committee_hot_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_committee_hot_scripthash() {
+ const ret = wasm.voter_as_committee_hot_scripthash(this.ptr);
+ return ret === 0 ? undefined : ScriptHash.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_drep_keyhash() {
+ const ret = wasm.voter_as_drep_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+ /**
+ * @returns {ScriptHash | undefined}
+ */
+ as_drep_scripthash() {
+ const ret = wasm.voter_as_drep_scripthash(this.ptr);
+ return ret === 0 ? undefined : ScriptHash.__wrap(ret);
+ }
+ /**
+ * @returns {Ed25519KeyHash | undefined}
+ */
+ as_staking_pool_keyhash() {
+ const ret = wasm.voter_as_staking_pool_keyhash(this.ptr);
+ return ret === 0 ? undefined : Ed25519KeyHash.__wrap(ret);
+ }
+}
+module.exports.Voter = Voter;
+
+const VotingProcedureFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_votingprocedure_free(ptr)
+);
+/** */
+class VotingProcedure {
+ static __wrap(ptr) {
+ const obj = Object.create(VotingProcedure.prototype);
+ obj.ptr = ptr;
+ VotingProcedureFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votingprocedure_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.votingprocedure_to_js_value(retptr, this.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);
+ }
+ }
+ /**
+ * @returns {GovernanceActionId}
+ */
+ governance_action_id() {
+ const ret = wasm.votingprocedure_governance_action_id(this.ptr);
+ return GovernanceActionId.__wrap(ret);
+ }
+ /**
+ * @returns {Voter}
+ */
+ voter() {
+ const ret = wasm.votingprocedure_voter(this.ptr);
+ return Voter.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ vote() {
+ const ret = wasm.votingprocedure_vote(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {Anchor}
+ */
+ anchor() {
+ const ret = wasm.votingprocedure_anchor(this.ptr);
+ return Anchor.__wrap(ret);
+ }
+ /**
+ * @param {GovernanceActionId} governance_action_id
+ * @param {Voter} voter
+ * @param {Vote} vote
+ * @param {Anchor} anchor
+ * @returns {VotingProcedure}
+ */
+ static new(governance_action_id, voter, vote, anchor) {
+ _assertClass(governance_action_id, GovernanceActionId);
+ _assertClass(voter, Voter);
+ _assertClass(vote, Vote);
+ _assertClass(anchor, Anchor);
+ const ret = wasm.votingprocedure_new(
+ governance_action_id.ptr,
+ voter.ptr,
+ vote.ptr,
+ anchor.ptr,
+ );
+ return VotingProcedure.__wrap(ret);
+ }
+}
+module.exports.VotingProcedure = VotingProcedure;
+
+const VotingProceduresFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_votingprocedures_free(ptr)
+);
+/** */
+class VotingProcedures {
+ static __wrap(ptr) {
+ const obj = Object.create(VotingProcedures.prototype);
+ obj.ptr = ptr;
+ VotingProceduresFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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 {VotingProcedures}
+ */
+ static new() {
+ const ret = wasm.certificates_new();
+ return VotingProcedures.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @param {number} index
+ * @returns {VotingProcedure}
+ */
+ get(index) {
+ const ret = wasm.votingprocedures_get(this.ptr, index);
+ return VotingProcedure.__wrap(ret);
+ }
+ /**
+ * @param {VotingProcedure} elem
+ */
+ add(elem) {
+ _assertClass(elem, VotingProcedure);
+ wasm.votingprocedures_add(this.ptr, elem.ptr);
+ }
+}
+module.exports.VotingProcedures = VotingProcedures;
+
+const WithdrawalsFinalization = new FinalizationRegistry((ptr) =>
+ wasm.__wbg_withdrawals_free(ptr)
+);
+/** */
+class Withdrawals {
+ static __wrap(ptr) {
+ const obj = Object.create(Withdrawals.prototype);
+ obj.ptr = ptr;
+ WithdrawalsFinalization.register(obj, obj.ptr, obj);
+ return obj;
+ }
+
+ __destroy_into_raw() {
+ const ptr = this.ptr;
+ this.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.ptr);
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
+ wasm.__wbindgen_free(r0, r1 * 1);
+ return v0;
+ } 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_json() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.withdrawals_to_json(retptr, this.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 ptr0 = r0;
+ var len0 = r1;
+ if (r3) {
+ ptr0 = 0;
+ len0 = 0;
+ throw takeObject(r2);
+ }
+ return getStringFromWasm0(ptr0, len0);
+ } finally {
+ wasm.__wbindgen_add_to_stack_pointer(16);
+ wasm.__wbindgen_free(ptr0, len0);
+ }
+ }
+ /**
+ * @returns {any}
+ */
+ to_js_value() {
+ try {
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
+ wasm.withdrawals_to_js_value(retptr, this.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.assets_new();
+ return Withdrawals.__wrap(ret);
+ }
+ /**
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.assetnames_len(this.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.ptr, key.ptr, value.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.ptr, key.ptr);
+ return ret === 0 ? undefined : BigNum.__wrap(ret);
+ }
+ /**
+ * @returns {RewardAddresses}
+ */
+ keys() {
+ const ret = wasm.withdrawals_keys(this.ptr);
+ return RewardAddresses.__wrap(ret);
+ }
+}
+module.exports.Withdrawals = Withdrawals;
+
+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_json_parse = function (arg0, arg1) {
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
+ return addHeapObject(ret);
+};
+
+module.exports.__wbindgen_json_serialize = function (arg0, arg1) {
+ const obj = getObject(arg1);
+ const ret = JSON.stringify(obj === undefined ? null : obj);
+ const ptr0 = passStringToWasm0(
+ ret,
+ wasm.__wbindgen_malloc,
+ wasm.__wbindgen_realloc,
+ );
+ const len0 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
+};
+
+module.exports.__wbg_fetch_16f5dddfc5a913a4 = function (arg0, arg1) {
+ const ret = getObject(arg0).fetch(getObject(arg1));
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_transaction_new = function (arg0) {
+ const ret = Transaction.__wrap(arg0);
+ return addHeapObject(ret);
+};
+
+module.exports.__wbindgen_string_get = function (arg0, arg1) {
+ const obj = getObject(arg1);
+ const ret = typeof obj === "string" ? obj : undefined;
+ var ptr0 = isLikeNone(ret)
+ ? 0
+ : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ var len0 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
+};
+
+module.exports.__wbindgen_object_clone_ref = function (arg0) {
+ const ret = getObject(arg0);
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_set_a5d34c36a1a4ebd1 = function () {
+ return handleError(function (arg0, arg1, arg2, arg3, arg4) {
+ getObject(arg0).set(
+ getStringFromWasm0(arg1, arg2),
+ getStringFromWasm0(arg3, arg4),
+ );
+ }, arguments);
+};
+
+module.exports.__wbg_headers_ab5251d2727ac41e = function (arg0) {
+ const ret = getObject(arg0).headers;
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_newwithstrandinit_c45f0dc6da26fd03 = function () {
+ return handleError(function (arg0, arg1, arg2) {
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
+ return addHeapObject(ret);
+ }, arguments);
+};
+
+module.exports.__wbg_instanceof_Response_fb3a4df648c1859b = function (arg0) {
+ let result;
+ try {
+ result = getObject(arg0) instanceof Response;
+ } catch {
+ result = false;
+ }
+ const ret = result;
+ return ret;
+};
+
+module.exports.__wbg_json_b9414eb18cb751d0 = function () {
+ return handleError(function (arg0) {
+ const ret = getObject(arg0).json();
+ return addHeapObject(ret);
+ }, arguments);
+};
+
+module.exports.__wbindgen_cb_drop = function (arg0) {
+ const obj = takeObject(arg0).original;
+ if (obj.cnt-- == 1) {
+ obj.a = 0;
+ return true;
+ }
+ const ret = false;
+ return ret;
+};
+
+module.exports.__wbg_process_5615a087a47ba544 = function (arg0) {
+ const ret = getObject(arg0).process;
+ 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_versions_8404a8b21b9337ae = function (arg0) {
+ const ret = getObject(arg0).versions;
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_node_8b504e170b6380b9 = 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_0430b68b38d1a77e = function () {
+ return handleError(function (arg0, arg1, arg2) {
+ const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
+ return addHeapObject(ret);
+ }, arguments);
+};
+
+module.exports.__wbg_crypto_ca5197b41df5e2bd = function (arg0) {
+ const ret = getObject(arg0).crypto;
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_msCrypto_1088c21440b2d7e4 = function (arg0) {
+ const ret = getObject(arg0).msCrypto;
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_static_accessor_NODE_MODULE_06b864c18e8ae506 =
+ function () {
+ const ret = module;
+ return addHeapObject(ret);
+ };
+
+module.exports.__wbg_randomFillSync_2f6909f8132a175d = function () {
+ return handleError(function (arg0, arg1, arg2) {
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
+ }, arguments);
+};
+
+module.exports.__wbg_getRandomValues_11a236fbf9914290 = function () {
+ return handleError(function (arg0, arg1) {
+ getObject(arg0).getRandomValues(getObject(arg1));
+ }, arguments);
+};
+
+module.exports.__wbg_self_e7c1f827057f6584 = function () {
+ return handleError(function () {
+ const ret = self.self;
+ return addHeapObject(ret);
+ }, arguments);
+};
+
+module.exports.__wbg_window_a09ec664e14b1b81 = function () {
+ return handleError(function () {
+ const ret = window.window;
+ return addHeapObject(ret);
+ }, arguments);
+};
+
+module.exports.__wbg_globalThis_87cbb8506fecf3a9 = function () {
+ return handleError(function () {
+ const ret = globalThis.globalThis;
+ return addHeapObject(ret);
+ }, arguments);
+};
+
+module.exports.__wbg_global_c85a9259e621f3db = 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_newnoargs_2b8b6bd7753c76ba = function (arg0, arg1) {
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_call_95d1ea488d03e4e8 = function () {
+ return handleError(function (arg0, arg1) {
+ const ret = getObject(arg0).call(getObject(arg1));
+ return addHeapObject(ret);
+ }, arguments);
+};
+
+module.exports.__wbg_new_f9876326328f45ed = function () {
+ const ret = new Object();
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_call_9495de66fdbe016b = function () {
+ return handleError(function (arg0, arg1, arg2) {
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
+ return addHeapObject(ret);
+ }, arguments);
+};
+
+module.exports.__wbg_set_6aa458a4ebdb65cb = function () {
+ return handleError(function (arg0, arg1, arg2) {
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
+ return ret;
+ }, arguments);
+};
+
+module.exports.__wbg_buffer_cf65c07de34b9a08 = function (arg0) {
+ const ret = getObject(arg0).buffer;
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_new_9d3a9ce4282a18a8 = function (arg0, arg1) {
+ try {
+ var state0 = { a: arg0, b: arg1 };
+ var cb0 = (arg0, arg1) => {
+ const a = state0.a;
+ state0.a = 0;
+ try {
+ return __wbg_adapter_1684(a, state0.b, arg0, arg1);
+ } finally {
+ state0.a = a;
+ }
+ };
+ const ret = new Promise(cb0);
+ return addHeapObject(ret);
+ } finally {
+ state0.a = state0.b = 0;
+ }
+};
+
+module.exports.__wbg_resolve_fd40f858d9db1a04 = function (arg0) {
+ const ret = Promise.resolve(getObject(arg0));
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_then_ec5db6d509eb475f = function (arg0, arg1) {
+ const ret = getObject(arg0).then(getObject(arg1));
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_then_f753623316e2873a = function (arg0, arg1, arg2) {
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_new_537b7341ce90bb31 = function (arg0) {
+ const ret = new Uint8Array(getObject(arg0));
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_set_17499e8aa4003ebd = function (arg0, arg1, arg2) {
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
+};
+
+module.exports.__wbg_length_27a2afe8ab42b09f = function (arg0) {
+ const ret = getObject(arg0).length;
+ return ret;
+};
+
+module.exports.__wbg_newwithlength_b56c882b57805732 = function (arg0) {
+ const ret = new Uint8Array(arg0 >>> 0);
+ return addHeapObject(ret);
+};
+
+module.exports.__wbg_subarray_7526649b91a252a6 = 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 ptr0 = passStringToWasm0(
+ ret,
+ wasm.__wbindgen_malloc,
+ wasm.__wbindgen_realloc,
+ );
+ const len0 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len0;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr0;
+};
+
+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);
+};
+
+module.exports.__wbindgen_closure_wrapper7045 = function (arg0, arg1, arg2) {
+ const ret = makeMutClosure(arg0, arg1, 200, __wbg_adapter_30);
+ return addHeapObject(ret);
+};
+
+const path = require("path").join(
+ __dirname,
+ "../cardano_multiplatform_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;
diff --git a/dist/esm/src/core/libs/cardano_multiplatform_lib/nodejs/package.json b/dist/esm/src/core/libs/cardano_multiplatform_lib/nodejs/package.json
new file mode 100644
index 00000000..0292b995
--- /dev/null
+++ b/dist/esm/src/core/libs/cardano_multiplatform_lib/nodejs/package.json
@@ -0,0 +1 @@
+{"type":"commonjs"}
\ No newline at end of file
diff --git a/dist/esm/src/core/mod.d.ts b/dist/esm/src/core/mod.d.ts
new file mode 100644
index 00000000..5589f336
--- /dev/null
+++ b/dist/esm/src/core/mod.d.ts
@@ -0,0 +1 @@
+export * from "./core.js";
diff --git a/dist/esm/src/core/mod.js b/dist/esm/src/core/mod.js
new file mode 100644
index 00000000..5589f336
--- /dev/null
+++ b/dist/esm/src/core/mod.js
@@ -0,0 +1 @@
+export * from "./core.js";
diff --git a/dist/esm/src/lucid/lucid.d.ts b/dist/esm/src/lucid/lucid.d.ts
new file mode 100644
index 00000000..1372acbe
--- /dev/null
+++ b/dist/esm/src/lucid/lucid.d.ts
@@ -0,0 +1,57 @@
+import { C } from "../core/mod.js";
+import { Utils } from "../utils/mod.js";
+import { Address, Credential, Delegation, ExternalWallet, Json, Network, OutRef, Payload, PrivateKey, Provider, RewardAddress, SignedMessage, Slot, Transaction, TxHash, Unit, UTxO, Wallet, WalletApi } from "../types/mod.js";
+import { Tx } from "./tx.js";
+import { TxComplete } from "./tx_complete.js";
+import { Message } from "./message.js";
+import { Data } from "../plutus/data.js";
+export declare class Lucid {
+ txBuilderConfig: C.TransactionBuilderConfig;
+ wallet: Wallet;
+ provider: Provider;
+ network: Network;
+ utils: Utils;
+ static new(provider?: Provider, network?: Network): Promise;
+ /**
+ * Switch provider and/or network.
+ * If provider or network unset, no overwriting happens. Provider or network from current instance are taken then.
+ */
+ switchProvider(provider?: Provider, network?: Network): Promise;
+ newTx(): Tx;
+ fromTx(tx: Transaction): TxComplete;
+ /** Signs a message. Expects the payload to be Hex encoded. */
+ newMessage(address: Address | RewardAddress, payload: Payload): Message;
+ /** Verify a message. Expects the payload to be Hex encoded. */
+ verifyMessage(address: Address | RewardAddress, payload: Payload, signedMessage: SignedMessage): boolean;
+ currentSlot(): Slot;
+ utxosAt(addressOrCredential: Address | Credential): Promise;
+ utxosAtWithUnit(addressOrCredential: Address | Credential, unit: Unit): Promise;
+ /** Unit needs to be an NFT (or optionally the entire supply in one UTxO). */
+ utxoByUnit(unit: Unit): Promise;
+ utxosByOutRef(outRefs: Array): Promise;
+ delegationAt(rewardAddress: RewardAddress): Promise;
+ awaitTx(txHash: TxHash, checkInterval?: number): Promise;
+ datumOf(utxo: UTxO, type?: T): Promise;
+ /** Query CIP-0068 metadata for a specifc asset. */
+ metadataOf(unit: Unit): Promise;
+ /**
+ * Cardano Private key in bech32; not the BIP32 private key or any key that is not fully derived.
+ * Only an Enteprise address (without stake credential) is derived.
+ */
+ selectWalletFromPrivateKey(privateKey: PrivateKey): Lucid;
+ selectWallet(api: WalletApi): Lucid;
+ /**
+ * Emulates a wallet by constructing it with the utxos and an address.
+ * If utxos are not set, utxos are fetched from the provided address.
+ */
+ selectWalletFrom({ address, utxos, rewardAddress, }: ExternalWallet): Lucid;
+ /**
+ * Select wallet from a seed phrase (e.g. 15 or 24 words). You have the option to choose between a Base address (with stake credential)
+ * and Enterprise address (without stake credential). You can also decide which account index to derive. By default account 0 is derived.
+ */
+ selectWalletFromSeed(seed: string, options?: {
+ addressType?: "Base" | "Enterprise";
+ accountIndex?: number;
+ password?: string;
+ }): Lucid;
+}
diff --git a/dist/esm/src/lucid/lucid.js b/dist/esm/src/lucid/lucid.js
new file mode 100644
index 00000000..f3b03489
--- /dev/null
+++ b/dist/esm/src/lucid/lucid.js
@@ -0,0 +1,392 @@
+import { C } from "../core/mod.js";
+import { coreToUtxo, createCostModels, fromHex, fromUnit, paymentCredentialOf, toHex, toUnit, Utils, utxoToCore, } from "../utils/mod.js";
+import { Tx } from "./tx.js";
+import { TxComplete } from "./tx_complete.js";
+import { discoverOwnUsedTxKeyHashes, walletFromSeed } from "../misc/wallet.js";
+import { signData, verifyData } from "../misc/sign_data.js";
+import { Message } from "./message.js";
+import { SLOT_CONFIG_NETWORK } from "../plutus/time.js";
+import { Data } from "../plutus/data.js";
+import { Emulator } from "../provider/emulator.js";
+export class Lucid {
+ constructor() {
+ Object.defineProperty(this, "txBuilderConfig", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "wallet", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "provider", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "network", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: "Mainnet"
+ });
+ Object.defineProperty(this, "utils", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ }
+ static async new(provider, network) {
+ const lucid = new this();
+ if (network)
+ lucid.network = network;
+ if (provider) {
+ lucid.provider = provider;
+ const protocolParameters = await provider.getProtocolParameters();
+ if (lucid.provider instanceof Emulator) {
+ lucid.network = "Custom";
+ SLOT_CONFIG_NETWORK[lucid.network] = {
+ zeroTime: lucid.provider.now(),
+ zeroSlot: 0,
+ slotLength: 1000,
+ };
+ }
+ const slotConfig = SLOT_CONFIG_NETWORK[lucid.network];
+ lucid.txBuilderConfig = C.TransactionBuilderConfigBuilder.new()
+ .coins_per_utxo_byte(C.BigNum.from_str(protocolParameters.coinsPerUtxoByte.toString()))
+ .fee_algo(C.LinearFee.new(C.BigNum.from_str(protocolParameters.minFeeA.toString()), C.BigNum.from_str(protocolParameters.minFeeB.toString())))
+ .key_deposit(C.BigNum.from_str(protocolParameters.keyDeposit.toString()))
+ .pool_deposit(C.BigNum.from_str(protocolParameters.poolDeposit.toString()))
+ .max_tx_size(protocolParameters.maxTxSize)
+ .max_value_size(protocolParameters.maxValSize)
+ .collateral_percentage(protocolParameters.collateralPercentage)
+ .max_collateral_inputs(protocolParameters.maxCollateralInputs)
+ .max_tx_ex_units(C.ExUnits.new(C.BigNum.from_str(protocolParameters.maxTxExMem.toString()), C.BigNum.from_str(protocolParameters.maxTxExSteps.toString())))
+ .ex_unit_prices(C.ExUnitPrices.from_float(protocolParameters.priceMem, protocolParameters.priceStep))
+ .minfee_refscript_cost_per_byte(C.UnitInterval.from_float(protocolParameters.minfeeRefscriptCostPerByte))
+ .slot_config(C.BigNum.from_str(slotConfig.zeroTime.toString()), C.BigNum.from_str(slotConfig.zeroSlot.toString()), slotConfig.slotLength)
+ .blockfrost(
+ // We have Aiken now as native plutus core engine (primary), but we still support blockfrost (secondary) in case of bugs.
+ C.Blockfrost.new(
+ // deno-lint-ignore no-explicit-any
+ (provider?.url || "") + "/utils/txs/evaluate",
+ // deno-lint-ignore no-explicit-any
+ provider?.projectId || ""))
+ .costmdls(createCostModels(protocolParameters.costModels))
+ .build();
+ }
+ lucid.utils = new Utils(lucid);
+ return lucid;
+ }
+ /**
+ * Switch provider and/or network.
+ * If provider or network unset, no overwriting happens. Provider or network from current instance are taken then.
+ */
+ async switchProvider(provider, network) {
+ if (this.network === "Custom") {
+ throw new Error("Cannot switch when on custom network.");
+ }
+ const lucid = await Lucid.new(provider, network);
+ this.txBuilderConfig = lucid.txBuilderConfig;
+ this.provider = provider || this.provider;
+ this.network = network || this.network;
+ this.wallet = lucid.wallet;
+ return this;
+ }
+ newTx() {
+ return new Tx(this);
+ }
+ fromTx(tx) {
+ return new TxComplete(this, C.Transaction.from_bytes(fromHex(tx)));
+ }
+ /** Signs a message. Expects the payload to be Hex encoded. */
+ newMessage(address, payload) {
+ return new Message(this, address, payload);
+ }
+ /** Verify a message. Expects the payload to be Hex encoded. */
+ verifyMessage(address, payload, signedMessage) {
+ const { paymentCredential, stakeCredential, address: { hex: addressHex } } = this.utils.getAddressDetails(address);
+ const keyHash = paymentCredential?.hash || stakeCredential?.hash;
+ if (!keyHash)
+ throw new Error("Not a valid address provided.");
+ return verifyData(addressHex, keyHash, payload, signedMessage);
+ }
+ currentSlot() {
+ return this.utils.unixTimeToSlot(Date.now());
+ }
+ utxosAt(addressOrCredential) {
+ return this.provider.getUtxos(addressOrCredential);
+ }
+ utxosAtWithUnit(addressOrCredential, unit) {
+ return this.provider.getUtxosWithUnit(addressOrCredential, unit);
+ }
+ /** Unit needs to be an NFT (or optionally the entire supply in one UTxO). */
+ utxoByUnit(unit) {
+ return this.provider.getUtxoByUnit(unit);
+ }
+ utxosByOutRef(outRefs) {
+ return this.provider.getUtxosByOutRef(outRefs);
+ }
+ delegationAt(rewardAddress) {
+ return this.provider.getDelegation(rewardAddress);
+ }
+ awaitTx(txHash, checkInterval = 3000) {
+ return this.provider.awaitTx(txHash, checkInterval);
+ }
+ async datumOf(utxo, type) {
+ if (!utxo.datum) {
+ if (!utxo.datumHash) {
+ throw new Error("This UTxO does not have a datum hash.");
+ }
+ utxo.datum = await this.provider.getDatum(utxo.datumHash);
+ }
+ return Data.from(utxo.datum, type);
+ }
+ /** Query CIP-0068 metadata for a specifc asset. */
+ async metadataOf(unit) {
+ const { policyId, name, label } = fromUnit(unit);
+ switch (label) {
+ case 222:
+ case 333:
+ case 444: {
+ const utxo = await this.utxoByUnit(toUnit(policyId, name, 100));
+ const metadata = await this.datumOf(utxo);
+ return Data.toJson(metadata.fields[0]);
+ }
+ default:
+ throw new Error("No variant matched.");
+ }
+ }
+ /**
+ * Cardano Private key in bech32; not the BIP32 private key or any key that is not fully derived.
+ * Only an Enteprise address (without stake credential) is derived.
+ */
+ selectWalletFromPrivateKey(privateKey) {
+ const priv = C.PrivateKey.from_bech32(privateKey);
+ const pubKeyHash = priv.to_public().hash();
+ this.wallet = {
+ // deno-lint-ignore require-await
+ address: async () => C.EnterpriseAddress.new(this.network === "Mainnet" ? 1 : 0, C.StakeCredential.from_keyhash(pubKeyHash))
+ .to_address()
+ .to_bech32(undefined),
+ // deno-lint-ignore require-await
+ rewardAddress: async () => null,
+ getUtxos: async () => {
+ return await this.utxosAt(paymentCredentialOf(await this.wallet.address()));
+ },
+ getUtxosCore: async () => {
+ const utxos = await this.utxosAt(paymentCredentialOf(await this.wallet.address()));
+ const coreUtxos = C.TransactionUnspentOutputs.new();
+ utxos.forEach((utxo) => {
+ coreUtxos.add(utxoToCore(utxo));
+ });
+ return coreUtxos;
+ },
+ // deno-lint-ignore require-await
+ getDelegation: async () => {
+ return { poolId: null, rewards: 0n };
+ },
+ // deno-lint-ignore require-await
+ signTx: async (tx) => {
+ const witness = C.make_vkey_witness(C.hash_transaction(tx.body()), priv);
+ const txWitnessSetBuilder = C.TransactionWitnessSetBuilder.new();
+ txWitnessSetBuilder.add_vkey(witness);
+ return txWitnessSetBuilder.build();
+ },
+ // deno-lint-ignore require-await
+ signMessage: async (address, payload) => {
+ const { paymentCredential, address: { hex: hexAddress } } = this.utils
+ .getAddressDetails(address);
+ const keyHash = paymentCredential?.hash;
+ const originalKeyHash = pubKeyHash.to_hex();
+ if (!keyHash || keyHash !== originalKeyHash) {
+ throw new Error(`Cannot sign message for address: ${address}.`);
+ }
+ return signData(hexAddress, payload, privateKey);
+ },
+ submitTx: async (tx) => {
+ return await this.provider.submitTx(tx);
+ },
+ };
+ return this;
+ }
+ selectWallet(api) {
+ const getAddressHex = async () => {
+ const [addressHex] = await api.getUsedAddresses();
+ if (addressHex)
+ return addressHex;
+ const [unusedAddressHex] = await api.getUnusedAddresses();
+ return unusedAddressHex;
+ };
+ this.wallet = {
+ address: async () => C.Address.from_bytes(fromHex(await getAddressHex())).to_bech32(undefined),
+ rewardAddress: async () => {
+ const [rewardAddressHex] = await api.getRewardAddresses();
+ const rewardAddress = rewardAddressHex
+ ? C.RewardAddress.from_address(C.Address.from_bytes(fromHex(rewardAddressHex)))
+ .to_address()
+ .to_bech32(undefined)
+ : null;
+ return rewardAddress;
+ },
+ getUtxos: async () => {
+ const utxos = ((await api.getUtxos()) || []).map((utxo) => {
+ const parsedUtxo = C.TransactionUnspentOutput.from_bytes(fromHex(utxo));
+ return coreToUtxo(parsedUtxo);
+ });
+ return utxos;
+ },
+ getUtxosCore: async () => {
+ const utxos = C.TransactionUnspentOutputs.new();
+ ((await api.getUtxos()) || []).forEach((utxo) => {
+ utxos.add(C.TransactionUnspentOutput.from_bytes(fromHex(utxo)));
+ });
+ return utxos;
+ },
+ getDelegation: async () => {
+ const rewardAddr = await this.wallet.rewardAddress();
+ return rewardAddr
+ ? await this.delegationAt(rewardAddr)
+ : { poolId: null, rewards: 0n };
+ },
+ signTx: async (tx) => {
+ const witnessSet = await api.signTx(toHex(tx.to_bytes()), true);
+ return C.TransactionWitnessSet.from_bytes(fromHex(witnessSet));
+ },
+ signMessage: async (address, payload) => {
+ const hexAddress = toHex(C.Address.from_bech32(address).to_bytes());
+ return await api.signData(hexAddress, payload);
+ },
+ submitTx: async (tx) => {
+ const txHash = await api.submitTx(tx);
+ return txHash;
+ },
+ };
+ return this;
+ }
+ /**
+ * Emulates a wallet by constructing it with the utxos and an address.
+ * If utxos are not set, utxos are fetched from the provided address.
+ */
+ selectWalletFrom({ address, utxos, rewardAddress, }) {
+ const addressDetails = this.utils.getAddressDetails(address);
+ this.wallet = {
+ // deno-lint-ignore require-await
+ address: async () => address,
+ // deno-lint-ignore require-await
+ rewardAddress: async () => {
+ const rewardAddr = !rewardAddress && addressDetails.stakeCredential
+ ? (() => {
+ if (addressDetails.stakeCredential.type === "Key") {
+ return C.RewardAddress.new(this.network === "Mainnet" ? 1 : 0, C.StakeCredential.from_keyhash(C.Ed25519KeyHash.from_hex(addressDetails.stakeCredential.hash)))
+ .to_address()
+ .to_bech32(undefined);
+ }
+ return C.RewardAddress.new(this.network === "Mainnet" ? 1 : 0, C.StakeCredential.from_scripthash(C.ScriptHash.from_hex(addressDetails.stakeCredential.hash)))
+ .to_address()
+ .to_bech32(undefined);
+ })()
+ : rewardAddress;
+ return rewardAddr || null;
+ },
+ getUtxos: async () => {
+ return utxos ? utxos : await this.utxosAt(paymentCredentialOf(address));
+ },
+ getUtxosCore: async () => {
+ const coreUtxos = C.TransactionUnspentOutputs.new();
+ (utxos ? utxos : await this.utxosAt(paymentCredentialOf(address)))
+ .forEach((utxo) => coreUtxos.add(utxoToCore(utxo)));
+ return coreUtxos;
+ },
+ getDelegation: async () => {
+ const rewardAddr = await this.wallet.rewardAddress();
+ return rewardAddr
+ ? await this.delegationAt(rewardAddr)
+ : { poolId: null, rewards: 0n };
+ },
+ // deno-lint-ignore require-await
+ signTx: async () => {
+ throw new Error("Not implemented");
+ },
+ // deno-lint-ignore require-await
+ signMessage: async () => {
+ throw new Error("Not implemented");
+ },
+ submitTx: async (tx) => {
+ return await this.provider.submitTx(tx);
+ },
+ };
+ return this;
+ }
+ /**
+ * Select wallet from a seed phrase (e.g. 15 or 24 words). You have the option to choose between a Base address (with stake credential)
+ * and Enterprise address (without stake credential). You can also decide which account index to derive. By default account 0 is derived.
+ */
+ selectWalletFromSeed(seed, options) {
+ const { address, rewardAddress, paymentKey, stakeKey } = walletFromSeed(seed, {
+ addressType: options?.addressType || "Base",
+ accountIndex: options?.accountIndex || 0,
+ password: options?.password,
+ network: this.network,
+ });
+ const paymentKeyHash = C.PrivateKey.from_bech32(paymentKey).to_public()
+ .hash().to_hex();
+ const stakeKeyHash = stakeKey
+ ? C.PrivateKey.from_bech32(stakeKey).to_public().hash().to_hex()
+ : "";
+ const privKeyHashMap = {
+ [paymentKeyHash]: paymentKey,
+ [stakeKeyHash]: stakeKey,
+ };
+ this.wallet = {
+ // deno-lint-ignore require-await
+ address: async () => address,
+ // deno-lint-ignore require-await
+ rewardAddress: async () => rewardAddress || null,
+ // deno-lint-ignore require-await
+ getUtxos: async () => this.utxosAt(paymentCredentialOf(address)),
+ getUtxosCore: async () => {
+ const coreUtxos = C.TransactionUnspentOutputs.new();
+ (await this.utxosAt(paymentCredentialOf(address))).forEach((utxo) => coreUtxos.add(utxoToCore(utxo)));
+ return coreUtxos;
+ },
+ getDelegation: async () => {
+ const rewardAddr = await this.wallet.rewardAddress();
+ return rewardAddr
+ ? await this.delegationAt(rewardAddr)
+ : { poolId: null, rewards: 0n };
+ },
+ signTx: async (tx) => {
+ const utxos = await this.utxosAt(paymentCredentialOf(address));
+ const ownKeyHashes = [paymentKeyHash, stakeKeyHash];
+ const usedKeyHashes = discoverOwnUsedTxKeyHashes(tx, ownKeyHashes, utxos);
+ const txWitnessSetBuilder = C.TransactionWitnessSetBuilder.new();
+ usedKeyHashes.forEach((keyHash) => {
+ const witness = C.make_vkey_witness(C.hash_transaction(tx.body()), C.PrivateKey.from_bech32(privKeyHashMap[keyHash]));
+ txWitnessSetBuilder.add_vkey(witness);
+ });
+ return txWitnessSetBuilder.build();
+ },
+ // deno-lint-ignore require-await
+ signMessage: async (address, payload) => {
+ const { paymentCredential, stakeCredential, address: { hex: hexAddress }, } = this.utils
+ .getAddressDetails(address);
+ const keyHash = paymentCredential?.hash || stakeCredential?.hash;
+ const privateKey = privKeyHashMap[keyHash];
+ if (!privateKey) {
+ throw new Error(`Cannot sign message for address: ${address}.`);
+ }
+ return signData(hexAddress, payload, privateKey);
+ },
+ submitTx: async (tx) => {
+ return await this.provider.submitTx(tx);
+ },
+ };
+ return this;
+ }
+}
diff --git a/dist/esm/src/lucid/message.d.ts b/dist/esm/src/lucid/message.d.ts
new file mode 100644
index 00000000..be96f9ba
--- /dev/null
+++ b/dist/esm/src/lucid/message.d.ts
@@ -0,0 +1,12 @@
+import { Lucid } from "./mod.js";
+import { Address, Payload, PrivateKey, RewardAddress, SignedMessage } from "../types/mod.js";
+export declare class Message {
+ lucid: Lucid;
+ address: Address | RewardAddress;
+ payload: Payload;
+ constructor(lucid: Lucid, address: Address | RewardAddress, payload: Payload);
+ /** Sign message with selected wallet. */
+ sign(): Promise;
+ /** Sign message with a separate private key. */
+ signWithPrivateKey(privateKey: PrivateKey): SignedMessage;
+}
diff --git a/dist/esm/src/lucid/message.js b/dist/esm/src/lucid/message.js
new file mode 100644
index 00000000..efbf0e5b
--- /dev/null
+++ b/dist/esm/src/lucid/message.js
@@ -0,0 +1,42 @@
+import { signData } from "../misc/sign_data.js";
+import { C } from "../mod.js";
+export class Message {
+ constructor(lucid, address, payload) {
+ Object.defineProperty(this, "lucid", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "address", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "payload", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ this.lucid = lucid;
+ this.address = address;
+ this.payload = payload;
+ }
+ /** Sign message with selected wallet. */
+ sign() {
+ return this.lucid.wallet.signMessage(this.address, this.payload);
+ }
+ /** Sign message with a separate private key. */
+ signWithPrivateKey(privateKey) {
+ const { paymentCredential, stakeCredential, address: { hex: hexAddress } } = this.lucid.utils.getAddressDetails(this.address);
+ const keyHash = paymentCredential?.hash || stakeCredential?.hash;
+ const keyHashOriginal = C.PrivateKey.from_bech32(privateKey).to_public()
+ .hash().to_hex();
+ if (!keyHash || keyHash !== keyHashOriginal) {
+ throw new Error(`Cannot sign message for address: ${this.address}.`);
+ }
+ return signData(hexAddress, this.payload, privateKey);
+ }
+}
diff --git a/dist/esm/src/lucid/mod.d.ts b/dist/esm/src/lucid/mod.d.ts
new file mode 100644
index 00000000..31ef26e5
--- /dev/null
+++ b/dist/esm/src/lucid/mod.d.ts
@@ -0,0 +1,4 @@
+export * from "./lucid.js";
+export * from "./tx.js";
+export * from "./tx_complete.js";
+export * from "./tx_signed.js";
diff --git a/dist/esm/src/lucid/mod.js b/dist/esm/src/lucid/mod.js
new file mode 100644
index 00000000..31ef26e5
--- /dev/null
+++ b/dist/esm/src/lucid/mod.js
@@ -0,0 +1,4 @@
+export * from "./lucid.js";
+export * from "./tx.js";
+export * from "./tx_complete.js";
+export * from "./tx_signed.js";
diff --git a/dist/esm/src/lucid/tx.d.ts b/dist/esm/src/lucid/tx.d.ts
new file mode 100644
index 00000000..f3216214
--- /dev/null
+++ b/dist/esm/src/lucid/tx.d.ts
@@ -0,0 +1,77 @@
+import { C } from "../core/mod.js";
+import { Address, Assets, CertificateValidator, Datum, Json, Label, Lovelace, MintingPolicy, OutputData, PaymentKeyHash, PoolId, PoolParams, Redeemer, RewardAddress, SpendingValidator, StakeKeyHash, UnixTime, UTxO, WithdrawalValidator } from "../types/mod.js";
+import { Lucid } from "./lucid.js";
+import { TxComplete } from "./tx_complete.js";
+export declare class Tx {
+ txBuilder: C.TransactionBuilder;
+ /** Stores the tx instructions, which get executed after calling .complete() */
+ private tasks;
+ private lucid;
+ constructor(lucid: Lucid);
+ /** Read data from utxos. These utxos are only referenced and not spent. */
+ readFrom(utxos: UTxO[]): Tx;
+ /**
+ * A public key or native script input.
+ * With redeemer it's a plutus script input.
+ */
+ collectFrom(utxos: UTxO[], redeemer?: Redeemer): Tx;
+ /**
+ * All assets should be of the same policy id.
+ * You can chain mintAssets functions together if you need to mint assets with different policy ids.
+ * If the plutus script doesn't need a redeemer, you still need to specifiy the void redeemer.
+ */
+ mintAssets(assets: Assets, redeemer?: Redeemer): Tx;
+ /** Pay to a public key or native script address. */
+ payToAddress(address: Address, assets: Assets): Tx;
+ /** Pay to a public key or native script address with datum or scriptRef. */
+ payToAddressWithData(address: Address, outputData: Datum | OutputData, assets: Assets): Tx;
+ /** Pay to a plutus script address with datum or scriptRef. */
+ payToContract(address: Address, outputData: Datum | OutputData, assets: Assets): Tx;
+ /** Delegate to a stake pool. */
+ delegateTo(rewardAddress: RewardAddress, poolId: PoolId, redeemer?: Redeemer): Tx;
+ /** Register a reward address in order to delegate to a pool and receive rewards. */
+ registerStake(rewardAddress: RewardAddress): Tx;
+ /** Deregister a reward address. */
+ deregisterStake(rewardAddress: RewardAddress, redeemer?: Redeemer): Tx;
+ /** Register a stake pool. A pool deposit is required. The metadataUrl needs to be hosted already before making the registration. */
+ registerPool(poolParams: PoolParams): Tx;
+ /** Update a stake pool. No pool deposit is required. The metadataUrl needs to be hosted already before making the update. */
+ updatePool(poolParams: PoolParams): Tx;
+ /**
+ * Retire a stake pool. The epoch needs to be the greater than the current epoch + 1 and less than current epoch + eMax.
+ * The pool deposit will be sent to reward address as reward after full retirement of the pool.
+ */
+ retirePool(poolId: PoolId, epoch: number): Tx;
+ withdraw(rewardAddress: RewardAddress, amount: Lovelace, redeemer?: Redeemer): Tx;
+ /**
+ * Needs to be a public key address.
+ * The PaymentKeyHash is taken when providing a Base, Enterprise or Pointer address.
+ * The StakeKeyHash is taken when providing a Reward address.
+ */
+ addSigner(address: Address | RewardAddress): Tx;
+ /** Add a payment or stake key hash as a required signer of the transaction. */
+ addSignerKey(keyHash: PaymentKeyHash | StakeKeyHash): Tx;
+ validFrom(unixTime: UnixTime): Tx;
+ validTo(unixTime: UnixTime): Tx;
+ attachMetadata(label: Label, metadata: Json): Tx;
+ /** Converts strings to bytes if prefixed with **'0x'**. */
+ attachMetadataWithConversion(label: Label, metadata: Json): Tx;
+ /** Explicitely set the network id in the transaction body. */
+ addNetworkId(id: number): Tx;
+ attachSpendingValidator(spendingValidator: SpendingValidator): Tx;
+ attachMintingPolicy(mintingPolicy: MintingPolicy): Tx;
+ attachCertificateValidator(certValidator: CertificateValidator): Tx;
+ attachWithdrawalValidator(withdrawalValidator: WithdrawalValidator): Tx;
+ /** Compose transactions. */
+ compose(tx: Tx | null): Tx;
+ complete(options?: {
+ change?: {
+ address?: Address;
+ outputData?: OutputData;
+ };
+ coinSelection?: boolean;
+ nativeUplc?: boolean;
+ }): Promise;
+ /** Return the current transaction body in Hex encoded Cbor. */
+ toString(): Promise;
+}
diff --git a/dist/esm/src/lucid/tx.js b/dist/esm/src/lucid/tx.js
new file mode 100644
index 00000000..21217183
--- /dev/null
+++ b/dist/esm/src/lucid/tx.js
@@ -0,0 +1,433 @@
+import { C } from "../core/mod.js";
+import { Data } from "../mod.js";
+import { assetsToValue, fromHex, networkToId, toHex, toScriptRef, utxoToCore, } from "../utils/mod.js";
+import { applyDoubleCborEncoding } from "../utils/utils.js";
+import { TxComplete } from "./tx_complete.js";
+export class Tx {
+ constructor(lucid) {
+ Object.defineProperty(this, "txBuilder", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ /** Stores the tx instructions, which get executed after calling .complete() */
+ Object.defineProperty(this, "tasks", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "lucid", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ this.lucid = lucid;
+ this.txBuilder = C.TransactionBuilder.new(this.lucid.txBuilderConfig);
+ this.tasks = [];
+ }
+ /** Read data from utxos. These utxos are only referenced and not spent. */
+ readFrom(utxos) {
+ this.tasks.push(async (that) => {
+ for (const utxo of utxos) {
+ if (utxo.datumHash) {
+ utxo.datum = Data.to(await that.lucid.datumOf(utxo));
+ // Add datum to witness set, so it can be read from validators
+ const plutusData = C.PlutusData.from_bytes(fromHex(utxo.datum));
+ that.txBuilder.add_plutus_data(plutusData);
+ }
+ const coreUtxo = utxoToCore(utxo);
+ that.txBuilder.add_reference_input(coreUtxo);
+ }
+ });
+ return this;
+ }
+ /**
+ * A public key or native script input.
+ * With redeemer it's a plutus script input.
+ */
+ collectFrom(utxos, redeemer) {
+ this.tasks.push(async (that) => {
+ for (const utxo of utxos) {
+ if (utxo.datumHash && !utxo.datum) {
+ utxo.datum = Data.to(await that.lucid.datumOf(utxo));
+ }
+ const coreUtxo = utxoToCore(utxo);
+ that.txBuilder.add_input(coreUtxo, redeemer &&
+ C.ScriptWitness.new_plutus_witness(C.PlutusWitness.new(C.PlutusData.from_bytes(fromHex(redeemer)), utxo.datumHash && utxo.datum
+ ? C.PlutusData.from_bytes(fromHex(utxo.datum))
+ : undefined, undefined)));
+ }
+ });
+ return this;
+ }
+ /**
+ * All assets should be of the same policy id.
+ * You can chain mintAssets functions together if you need to mint assets with different policy ids.
+ * If the plutus script doesn't need a redeemer, you still need to specifiy the void redeemer.
+ */
+ mintAssets(assets, redeemer) {
+ this.tasks.push((that) => {
+ const units = Object.keys(assets);
+ const policyId = units[0].slice(0, 56);
+ const mintAssets = C.MintAssets.new();
+ units.forEach((unit) => {
+ if (unit.slice(0, 56) !== policyId) {
+ throw new Error("Only one policy id allowed. You can chain multiple mintAssets functions together if you need to mint assets with different policy ids.");
+ }
+ mintAssets.insert(C.AssetName.new(fromHex(unit.slice(56))), C.Int.from_str(assets[unit].toString()));
+ });
+ const scriptHash = C.ScriptHash.from_bytes(fromHex(policyId));
+ that.txBuilder.add_mint(scriptHash, mintAssets, redeemer
+ ? C.ScriptWitness.new_plutus_witness(C.PlutusWitness.new(C.PlutusData.from_bytes(fromHex(redeemer)), undefined, undefined))
+ : undefined);
+ });
+ return this;
+ }
+ /** Pay to a public key or native script address. */
+ payToAddress(address, assets) {
+ this.tasks.push((that) => {
+ const output = C.TransactionOutput.new(addressFromWithNetworkCheck(address, that.lucid), assetsToValue(assets));
+ that.txBuilder.add_output(output);
+ });
+ return this;
+ }
+ /** Pay to a public key or native script address with datum or scriptRef. */
+ payToAddressWithData(address, outputData, assets) {
+ this.tasks.push((that) => {
+ if (typeof outputData === "string") {
+ outputData = { asHash: outputData };
+ }
+ if ([outputData.hash, outputData.asHash, outputData.inline].filter((b) => b)
+ .length > 1) {
+ throw new Error("Not allowed to set hash, asHash and inline at the same time.");
+ }
+ const output = C.TransactionOutput.new(addressFromWithNetworkCheck(address, that.lucid), assetsToValue(assets));
+ if (outputData.hash) {
+ output.set_datum(C.Datum.new_data_hash(C.DataHash.from_hex(outputData.hash)));
+ }
+ else if (outputData.asHash) {
+ const plutusData = C.PlutusData.from_bytes(fromHex(outputData.asHash));
+ output.set_datum(C.Datum.new_data_hash(C.hash_plutus_data(plutusData)));
+ that.txBuilder.add_plutus_data(plutusData);
+ }
+ else if (outputData.inline) {
+ const plutusData = C.PlutusData.from_bytes(fromHex(outputData.inline));
+ output.set_datum(C.Datum.new_data(C.Data.new(plutusData)));
+ }
+ const script = outputData.scriptRef;
+ if (script) {
+ output.set_script_ref(toScriptRef(script));
+ }
+ that.txBuilder.add_output(output);
+ });
+ return this;
+ }
+ /** Pay to a plutus script address with datum or scriptRef. */
+ payToContract(address, outputData, assets) {
+ if (typeof outputData === "string") {
+ outputData = { asHash: outputData };
+ }
+ if (!(outputData.hash || outputData.asHash || outputData.inline)) {
+ throw new Error("No datum set. Script output becomes unspendable without datum.");
+ }
+ return this.payToAddressWithData(address, outputData, assets);
+ }
+ /** Delegate to a stake pool. */
+ delegateTo(rewardAddress, poolId, redeemer) {
+ this.tasks.push((that) => {
+ const addressDetails = that.lucid.utils.getAddressDetails(rewardAddress);
+ if (addressDetails.type !== "Reward" ||
+ !addressDetails.stakeCredential) {
+ throw new Error("Not a reward address provided.");
+ }
+ const credential = addressDetails.stakeCredential.type === "Key"
+ ? C.StakeCredential.from_keyhash(C.Ed25519KeyHash.from_bytes(fromHex(addressDetails.stakeCredential.hash)))
+ : C.StakeCredential.from_scripthash(C.ScriptHash.from_bytes(fromHex(addressDetails.stakeCredential.hash)));
+ that.txBuilder.add_certificate(C.Certificate.new_stake_delegation(C.StakeDelegation.new(credential, C.Ed25519KeyHash.from_bech32(poolId))), redeemer
+ ? C.ScriptWitness.new_plutus_witness(C.PlutusWitness.new(C.PlutusData.from_bytes(fromHex(redeemer)), undefined, undefined))
+ : undefined);
+ });
+ return this;
+ }
+ /** Register a reward address in order to delegate to a pool and receive rewards. */
+ registerStake(rewardAddress) {
+ this.tasks.push((that) => {
+ const addressDetails = that.lucid.utils.getAddressDetails(rewardAddress);
+ if (addressDetails.type !== "Reward" ||
+ !addressDetails.stakeCredential) {
+ throw new Error("Not a reward address provided.");
+ }
+ const credential = addressDetails.stakeCredential.type === "Key"
+ ? C.StakeCredential.from_keyhash(C.Ed25519KeyHash.from_bytes(fromHex(addressDetails.stakeCredential.hash)))
+ : C.StakeCredential.from_scripthash(C.ScriptHash.from_bytes(fromHex(addressDetails.stakeCredential.hash)));
+ that.txBuilder.add_certificate(C.Certificate.new_stake_registration(C.StakeRegistration.new(credential)), undefined);
+ });
+ return this;
+ }
+ /** Deregister a reward address. */
+ deregisterStake(rewardAddress, redeemer) {
+ this.tasks.push((that) => {
+ const addressDetails = that.lucid.utils.getAddressDetails(rewardAddress);
+ if (addressDetails.type !== "Reward" ||
+ !addressDetails.stakeCredential) {
+ throw new Error("Not a reward address provided.");
+ }
+ const credential = addressDetails.stakeCredential.type === "Key"
+ ? C.StakeCredential.from_keyhash(C.Ed25519KeyHash.from_bytes(fromHex(addressDetails.stakeCredential.hash)))
+ : C.StakeCredential.from_scripthash(C.ScriptHash.from_bytes(fromHex(addressDetails.stakeCredential.hash)));
+ that.txBuilder.add_certificate(C.Certificate.new_stake_deregistration(C.StakeDeregistration.new(credential)), redeemer
+ ? C.ScriptWitness.new_plutus_witness(C.PlutusWitness.new(C.PlutusData.from_bytes(fromHex(redeemer)), undefined, undefined))
+ : undefined);
+ });
+ return this;
+ }
+ /** Register a stake pool. A pool deposit is required. The metadataUrl needs to be hosted already before making the registration. */
+ registerPool(poolParams) {
+ this.tasks.push(async (that) => {
+ const poolRegistration = await createPoolRegistration(poolParams, that.lucid);
+ const certificate = C.Certificate.new_pool_registration(poolRegistration);
+ that.txBuilder.add_certificate(certificate, undefined);
+ });
+ return this;
+ }
+ /** Update a stake pool. No pool deposit is required. The metadataUrl needs to be hosted already before making the update. */
+ updatePool(poolParams) {
+ this.tasks.push(async (that) => {
+ const poolRegistration = await createPoolRegistration(poolParams, that.lucid);
+ // This flag makes sure a pool deposit is not required
+ poolRegistration.set_is_update(true);
+ const certificate = C.Certificate.new_pool_registration(poolRegistration);
+ that.txBuilder.add_certificate(certificate, undefined);
+ });
+ return this;
+ }
+ /**
+ * Retire a stake pool. The epoch needs to be the greater than the current epoch + 1 and less than current epoch + eMax.
+ * The pool deposit will be sent to reward address as reward after full retirement of the pool.
+ */
+ retirePool(poolId, epoch) {
+ this.tasks.push((that) => {
+ const certificate = C.Certificate.new_pool_retirement(C.PoolRetirement.new(C.Ed25519KeyHash.from_bech32(poolId), epoch));
+ that.txBuilder.add_certificate(certificate, undefined);
+ });
+ return this;
+ }
+ withdraw(rewardAddress, amount, redeemer) {
+ this.tasks.push((that) => {
+ that.txBuilder.add_withdrawal(C.RewardAddress.from_address(addressFromWithNetworkCheck(rewardAddress, that.lucid)), C.BigNum.from_str(amount.toString()), redeemer
+ ? C.ScriptWitness.new_plutus_witness(C.PlutusWitness.new(C.PlutusData.from_bytes(fromHex(redeemer)), undefined, undefined))
+ : undefined);
+ });
+ return this;
+ }
+ /**
+ * Needs to be a public key address.
+ * The PaymentKeyHash is taken when providing a Base, Enterprise or Pointer address.
+ * The StakeKeyHash is taken when providing a Reward address.
+ */
+ addSigner(address) {
+ const addressDetails = this.lucid.utils.getAddressDetails(address);
+ if (!addressDetails.paymentCredential && !addressDetails.stakeCredential) {
+ throw new Error("Not a valid address.");
+ }
+ const credential = addressDetails.type === "Reward"
+ ? addressDetails.stakeCredential
+ : addressDetails.paymentCredential;
+ if (credential.type === "Script") {
+ throw new Error("Only key hashes are allowed as signers.");
+ }
+ return this.addSignerKey(credential.hash);
+ }
+ /** Add a payment or stake key hash as a required signer of the transaction. */
+ addSignerKey(keyHash) {
+ this.tasks.push((that) => {
+ that.txBuilder.add_required_signer(C.Ed25519KeyHash.from_bytes(fromHex(keyHash)));
+ });
+ return this;
+ }
+ validFrom(unixTime) {
+ this.tasks.push((that) => {
+ const slot = that.lucid.utils.unixTimeToSlot(unixTime);
+ that.txBuilder.set_validity_start_interval(C.BigNum.from_str(slot.toString()));
+ });
+ return this;
+ }
+ validTo(unixTime) {
+ this.tasks.push((that) => {
+ const slot = that.lucid.utils.unixTimeToSlot(unixTime);
+ that.txBuilder.set_ttl(C.BigNum.from_str(slot.toString()));
+ });
+ return this;
+ }
+ attachMetadata(label, metadata) {
+ this.tasks.push((that) => {
+ that.txBuilder.add_json_metadatum(C.BigNum.from_str(label.toString()), JSON.stringify(metadata));
+ });
+ return this;
+ }
+ /** Converts strings to bytes if prefixed with **'0x'**. */
+ attachMetadataWithConversion(label, metadata) {
+ this.tasks.push((that) => {
+ that.txBuilder.add_json_metadatum_with_schema(C.BigNum.from_str(label.toString()), JSON.stringify(metadata), C.MetadataJsonSchema.BasicConversions);
+ });
+ return this;
+ }
+ /** Explicitely set the network id in the transaction body. */
+ addNetworkId(id) {
+ this.tasks.push((that) => {
+ that.txBuilder.set_network_id(C.NetworkId.from_bytes(fromHex(id.toString(16).padStart(2, "0"))));
+ });
+ return this;
+ }
+ attachSpendingValidator(spendingValidator) {
+ this.tasks.push((that) => {
+ attachScript(that, spendingValidator);
+ });
+ return this;
+ }
+ attachMintingPolicy(mintingPolicy) {
+ this.tasks.push((that) => {
+ attachScript(that, mintingPolicy);
+ });
+ return this;
+ }
+ attachCertificateValidator(certValidator) {
+ this.tasks.push((that) => {
+ attachScript(that, certValidator);
+ });
+ return this;
+ }
+ attachWithdrawalValidator(withdrawalValidator) {
+ this.tasks.push((that) => {
+ attachScript(that, withdrawalValidator);
+ });
+ return this;
+ }
+ /** Compose transactions. */
+ compose(tx) {
+ if (tx)
+ this.tasks = this.tasks.concat(tx.tasks);
+ return this;
+ }
+ async complete(options) {
+ if ([
+ options?.change?.outputData?.hash,
+ options?.change?.outputData?.asHash,
+ options?.change?.outputData?.inline,
+ ].filter((b) => b)
+ .length > 1) {
+ throw new Error("Not allowed to set hash, asHash and inline at the same time.");
+ }
+ let task = this.tasks.shift();
+ while (task) {
+ await task(this);
+ task = this.tasks.shift();
+ }
+ const utxos = await this.lucid.wallet.getUtxosCore();
+ const changeAddress = addressFromWithNetworkCheck(options?.change?.address || (await this.lucid.wallet.address()), this.lucid);
+ if (options?.coinSelection || options?.coinSelection === undefined) {
+ this.txBuilder.add_inputs_from(utxos, changeAddress, Uint32Array.from([
+ 200,
+ 1000,
+ 1500,
+ 800,
+ 800,
+ 5000, // weight utxos
+ ]));
+ }
+ this.txBuilder.balance(changeAddress, (() => {
+ if (options?.change?.outputData?.hash) {
+ return C.Datum.new_data_hash(C.DataHash.from_hex(options.change.outputData.hash));
+ }
+ else if (options?.change?.outputData?.asHash) {
+ this.txBuilder.add_plutus_data(C.PlutusData.from_bytes(fromHex(options.change.outputData.asHash)));
+ return C.Datum.new_data_hash(C.hash_plutus_data(C.PlutusData.from_bytes(fromHex(options.change.outputData.asHash))));
+ }
+ else if (options?.change?.outputData?.inline) {
+ return C.Datum.new_data(C.Data.new(C.PlutusData.from_bytes(fromHex(options.change.outputData.inline))));
+ }
+ else {
+ return undefined;
+ }
+ })());
+ return new TxComplete(this.lucid, await this.txBuilder.construct(utxos, changeAddress, options?.nativeUplc === undefined ? true : options?.nativeUplc));
+ }
+ /** Return the current transaction body in Hex encoded Cbor. */
+ async toString() {
+ let task = this.tasks.shift();
+ while (task) {
+ await task(this);
+ task = this.tasks.shift();
+ }
+ return toHex(this.txBuilder.to_bytes());
+ }
+}
+function attachScript(tx, { type, script }) {
+ if (type === "Native") {
+ return tx.txBuilder.add_native_script(C.NativeScript.from_bytes(fromHex(script)));
+ }
+ else if (type === "PlutusV1") {
+ return tx.txBuilder.add_plutus_script(C.PlutusScript.from_bytes(fromHex(applyDoubleCborEncoding(script))));
+ }
+ else if (type === "PlutusV2") {
+ return tx.txBuilder.add_plutus_v2_script(C.PlutusScript.from_bytes(fromHex(applyDoubleCborEncoding(script))));
+ }
+ throw new Error("No variant matched.");
+}
+async function createPoolRegistration(poolParams, lucid) {
+ const poolOwners = C.Ed25519KeyHashes.new();
+ poolParams.owners.forEach((owner) => {
+ const { stakeCredential } = lucid.utils.getAddressDetails(owner);
+ if (stakeCredential?.type === "Key") {
+ poolOwners.add(C.Ed25519KeyHash.from_hex(stakeCredential.hash));
+ }
+ else
+ throw new Error("Only key hashes allowed for pool owners.");
+ });
+ const metadata = poolParams.metadataUrl
+ ? await fetch(poolParams.metadataUrl)
+ .then((res) => res.arrayBuffer())
+ : null;
+ const metadataHash = metadata
+ ? C.PoolMetadataHash.from_bytes(C.hash_blake2b256(new Uint8Array(metadata)))
+ : null;
+ const relays = C.Relays.new();
+ poolParams.relays.forEach((relay) => {
+ switch (relay.type) {
+ case "SingleHostIp": {
+ const ipV4 = relay.ipV4
+ ? C.Ipv4.new(new Uint8Array(relay.ipV4.split(".").map((b) => parseInt(b))))
+ : undefined;
+ const ipV6 = relay.ipV6
+ ? C.Ipv6.new(fromHex(relay.ipV6.replaceAll(":", "")))
+ : undefined;
+ relays.add(C.Relay.new_single_host_addr(C.SingleHostAddr.new(relay.port, ipV4, ipV6)));
+ break;
+ }
+ case "SingleHostDomainName": {
+ relays.add(C.Relay.new_single_host_name(C.SingleHostName.new(relay.port, C.DNSRecordAorAAAA.new(relay.domainName))));
+ break;
+ }
+ case "MultiHost": {
+ relays.add(C.Relay.new_multi_host_name(C.MultiHostName.new(C.DNSRecordSRV.new(relay.domainName))));
+ break;
+ }
+ }
+ });
+ return C.PoolRegistration.new(C.PoolParams.new(C.Ed25519KeyHash.from_bech32(poolParams.poolId), C.VRFKeyHash.from_hex(poolParams.vrfKeyHash), C.BigNum.from_str(poolParams.pledge.toString()), C.BigNum.from_str(poolParams.cost.toString()), C.UnitInterval.from_float(poolParams.margin), C.RewardAddress.from_address(addressFromWithNetworkCheck(poolParams.rewardAddress, lucid)), poolOwners, relays, metadataHash
+ ? C.PoolMetadata.new(C.Url.new(poolParams.metadataUrl), metadataHash)
+ : undefined));
+}
+function addressFromWithNetworkCheck(address, lucid) {
+ const { type, networkId } = lucid.utils.getAddressDetails(address);
+ const actualNetworkId = networkToId(lucid.network);
+ if (networkId !== actualNetworkId) {
+ throw new Error(`Invalid address: Expected address with network id ${actualNetworkId}, but got ${networkId}`);
+ }
+ return type === "Byron"
+ ? C.ByronAddress.from_base58(address).to_address()
+ : C.Address.from_bech32(address);
+}
diff --git a/dist/esm/src/lucid/tx_complete.d.ts b/dist/esm/src/lucid/tx_complete.d.ts
new file mode 100644
index 00000000..3b455dc2
--- /dev/null
+++ b/dist/esm/src/lucid/tx_complete.d.ts
@@ -0,0 +1,33 @@
+import { C } from "../core/mod.js";
+import { PrivateKey, Transaction, TransactionWitnesses, TxHash } from "../types/mod.js";
+import { Lucid } from "./lucid.js";
+import { TxSigned } from "./tx_signed.js";
+export declare class TxComplete {
+ txComplete: C.Transaction;
+ witnessSetBuilder: C.TransactionWitnessSetBuilder;
+ private tasks;
+ private lucid;
+ fee: number;
+ exUnits: {
+ cpu: number;
+ mem: number;
+ } | null;
+ constructor(lucid: Lucid, tx: C.Transaction);
+ sign(): TxComplete;
+ /** Add an extra signature from a private key. */
+ signWithPrivateKey(privateKey: PrivateKey): TxComplete;
+ /** Sign the transaction and return the witnesses that were just made. */
+ partialSign(): Promise;
+ /**
+ * Sign the transaction and return the witnesses that were just made.
+ * Add an extra signature from a private key.
+ */
+ partialSignWithPrivateKey(privateKey: PrivateKey): TransactionWitnesses;
+ /** Sign the transaction with the given witnesses. */
+ assemble(witnesses: TransactionWitnesses[]): TxComplete;
+ complete(): Promise;
+ /** Return the transaction in Hex encoded Cbor. */
+ toString(): Transaction;
+ /** Return the transaction hash. */
+ toHash(): TxHash;
+}
diff --git a/dist/esm/src/lucid/tx_complete.js b/dist/esm/src/lucid/tx_complete.js
new file mode 100644
index 00000000..9643083f
--- /dev/null
+++ b/dist/esm/src/lucid/tx_complete.js
@@ -0,0 +1,114 @@
+import { C } from "../core/mod.js";
+import { TxSigned } from "./tx_signed.js";
+import { fromHex, toHex } from "../utils/mod.js";
+export class TxComplete {
+ constructor(lucid, tx) {
+ Object.defineProperty(this, "txComplete", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "witnessSetBuilder", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "tasks", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "lucid", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "fee", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "exUnits", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: null
+ });
+ this.lucid = lucid;
+ this.txComplete = tx;
+ this.witnessSetBuilder = C.TransactionWitnessSetBuilder.new();
+ this.tasks = [];
+ this.fee = parseInt(tx.body().fee().to_str());
+ const redeemers = tx.witness_set().redeemers();
+ if (redeemers) {
+ const exUnits = { cpu: 0, mem: 0 };
+ for (let i = 0; i < redeemers.len(); i++) {
+ const redeemer = redeemers.get(i);
+ exUnits.cpu += parseInt(redeemer.ex_units().steps().to_str());
+ exUnits.mem += parseInt(redeemer.ex_units().mem().to_str());
+ }
+ this.exUnits = exUnits;
+ }
+ }
+ sign() {
+ this.tasks.push(async () => {
+ const witnesses = await this.lucid.wallet.signTx(this.txComplete);
+ this.witnessSetBuilder.add_existing(witnesses);
+ });
+ return this;
+ }
+ /** Add an extra signature from a private key. */
+ signWithPrivateKey(privateKey) {
+ const priv = C.PrivateKey.from_bech32(privateKey);
+ const witness = C.make_vkey_witness(C.hash_transaction(this.txComplete.body()), priv);
+ this.witnessSetBuilder.add_vkey(witness);
+ return this;
+ }
+ /** Sign the transaction and return the witnesses that were just made. */
+ async partialSign() {
+ const witnesses = await this.lucid.wallet.signTx(this.txComplete);
+ this.witnessSetBuilder.add_existing(witnesses);
+ return toHex(witnesses.to_bytes());
+ }
+ /**
+ * Sign the transaction and return the witnesses that were just made.
+ * Add an extra signature from a private key.
+ */
+ partialSignWithPrivateKey(privateKey) {
+ const priv = C.PrivateKey.from_bech32(privateKey);
+ const witness = C.make_vkey_witness(C.hash_transaction(this.txComplete.body()), priv);
+ this.witnessSetBuilder.add_vkey(witness);
+ const witnesses = C.TransactionWitnessSetBuilder.new();
+ witnesses.add_vkey(witness);
+ return toHex(witnesses.build().to_bytes());
+ }
+ /** Sign the transaction with the given witnesses. */
+ assemble(witnesses) {
+ witnesses.forEach((witness) => {
+ const witnessParsed = C.TransactionWitnessSet.from_bytes(fromHex(witness));
+ this.witnessSetBuilder.add_existing(witnessParsed);
+ });
+ return this;
+ }
+ async complete() {
+ for (const task of this.tasks) {
+ await task();
+ }
+ this.witnessSetBuilder.add_existing(this.txComplete.witness_set());
+ const signedTx = C.Transaction.new(this.txComplete.body(), this.witnessSetBuilder.build(), this.txComplete.auxiliary_data());
+ return new TxSigned(this.lucid, signedTx);
+ }
+ /** Return the transaction in Hex encoded Cbor. */
+ toString() {
+ return toHex(this.txComplete.to_bytes());
+ }
+ /** Return the transaction hash. */
+ toHash() {
+ return C.hash_transaction(this.txComplete.body()).to_hex();
+ }
+}
diff --git a/dist/esm/src/lucid/tx_signed.d.ts b/dist/esm/src/lucid/tx_signed.d.ts
new file mode 100644
index 00000000..39b14e34
--- /dev/null
+++ b/dist/esm/src/lucid/tx_signed.d.ts
@@ -0,0 +1,13 @@
+import { C } from "../core/mod.js";
+import { Transaction, TxHash } from "../types/mod.js";
+import { Lucid } from "./lucid.js";
+export declare class TxSigned {
+ txSigned: C.Transaction;
+ private lucid;
+ constructor(lucid: Lucid, tx: C.Transaction);
+ submit(): Promise;
+ /** Returns the transaction in Hex encoded Cbor. */
+ toString(): Transaction;
+ /** Return the transaction hash. */
+ toHash(): TxHash;
+}
diff --git a/dist/esm/src/lucid/tx_signed.js b/dist/esm/src/lucid/tx_signed.js
new file mode 100644
index 00000000..5d905d4a
--- /dev/null
+++ b/dist/esm/src/lucid/tx_signed.js
@@ -0,0 +1,31 @@
+import { C } from "../core/mod.js";
+import { toHex } from "../utils/mod.js";
+export class TxSigned {
+ constructor(lucid, tx) {
+ Object.defineProperty(this, "txSigned", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ Object.defineProperty(this, "lucid", {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: void 0
+ });
+ this.lucid = lucid;
+ this.txSigned = tx;
+ }
+ async submit() {
+ return await (this.lucid.wallet || this.lucid.provider).submitTx(toHex(this.txSigned.to_bytes()));
+ }
+ /** Returns the transaction in Hex encoded Cbor. */
+ toString() {
+ return toHex(this.txSigned.to_bytes());
+ }
+ /** Return the transaction hash. */
+ toHash() {
+ return C.hash_transaction(this.txSigned.body()).to_hex();
+ }
+}
diff --git a/dist/esm/src/misc/bip39.d.ts b/dist/esm/src/misc/bip39.d.ts
new file mode 100644
index 00000000..8adf9d0f
--- /dev/null
+++ b/dist/esm/src/misc/bip39.d.ts
@@ -0,0 +1,2 @@
+export declare function mnemonicToEntropy(mnemonic: string, wordlist?: Array): string;
+export declare function generateMnemonic(strength: number, rng?: (size: number) => Uint8Array, wordlist?: Array): string;
diff --git a/dist/esm/src/misc/bip39.js b/dist/esm/src/misc/bip39.js
new file mode 100644
index 00000000..dfe2d438
--- /dev/null
+++ b/dist/esm/src/misc/bip39.js
@@ -0,0 +1,2181 @@
+// This is a partial reimplementation of BIP39 in Deno: https://github.com/bitcoinjs/bip39
+// We only use the default Wordlist (english)
+import { Sha256 } from "../../deps/deno.land/std@0.153.0/hash/sha256.js";
+import { toHex } from "../utils/mod.js";
+const INVALID_MNEMONIC = "Invalid mnemonic";
+const INVALID_ENTROPY = "Invalid entropy";
+const INVALID_CHECKSUM = "Invalid mnemonic checksum";
+const WORDLIST_REQUIRED = "A wordlist is required but a default could not be found.\n" +
+ "Please pass a 2048 word array explicitly.";
+export function mnemonicToEntropy(mnemonic, wordlist) {
+ wordlist = wordlist || DEFAULT_WORDLIST;
+ if (!wordlist) {
+ throw new Error(WORDLIST_REQUIRED);
+ }
+ const words = normalize(mnemonic).split(" ");
+ if (words.length % 3 !== 0) {
+ throw new Error(INVALID_MNEMONIC);
+ }
+ // convert word indices to 11 bit binary strings
+ const bits = words
+ .map((word) => {
+ const index = wordlist.indexOf(word);
+ if (index === -1) {
+ throw new Error(INVALID_MNEMONIC);
+ }
+ return lpad(index.toString(2), "0", 11);
+ })
+ .join("");
+ // split the binary string into ENT/CS
+ const dividerIndex = Math.floor(bits.length / 33) * 32;
+ const entropyBits = bits.slice(0, dividerIndex);
+ const checksumBits = bits.slice(dividerIndex);
+ // calculate the checksum and compare
+ const entropyBytes = entropyBits.match(/(.{1,8})/g).map(binaryToByte);
+ if (entropyBytes.length < 16) {
+ throw new Error(INVALID_ENTROPY);
+ }
+ if (entropyBytes.length > 32) {
+ throw new Error(INVALID_ENTROPY);
+ }
+ if (entropyBytes.length % 4 !== 0) {
+ throw new Error(INVALID_ENTROPY);
+ }
+ const entropy = new Uint8Array(entropyBytes);
+ const newChecksum = deriveChecksumBits(entropy);
+ if (newChecksum !== checksumBits) {
+ throw new Error(INVALID_CHECKSUM);
+ }
+ return toHex(entropy);
+}
+function randomBytes(size) {
+ // reimplementation of: https://github.com/crypto-browserify/randombytes/blob/master/browser.js
+ const MAX_UINT32 = 4294967295;
+ const MAX_BYTES = 65536;
+ const bytes = new Uint8Array(size);
+ if (size > MAX_UINT32) {
+ throw new RangeError("requested too many random bytes");
+ }
+ if (size > 0) { // getRandomValues fails on IE if size == 0
+ if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues
+ // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues
+ for (let generated = 0; generated < size; generated += MAX_BYTES) {
+ // buffer.slice automatically checks if the end is past the end of
+ // the buffer so we don't have to here
+ crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));
+ }
+ }
+ else {
+ crypto.getRandomValues(bytes);
+ }
+ }
+ return bytes;
+}
+export function generateMnemonic(strength, rng, wordlist) {
+ strength = strength || 128;
+ if (strength % 32 !== 0) {
+ throw new TypeError(INVALID_ENTROPY);
+ }
+ rng = rng || randomBytes;
+ return entropyToMnemonic(rng(strength / 8), wordlist);
+}
+function entropyToMnemonic(entropy, wordlist) {
+ wordlist = wordlist || DEFAULT_WORDLIST;
+ if (!wordlist) {
+ throw new Error(WORDLIST_REQUIRED);
+ }
+ // 128 <= ENT <= 256
+ if (entropy.length < 16) {
+ throw new TypeError(INVALID_ENTROPY);
+ }
+ if (entropy.length > 32) {
+ throw new TypeError(INVALID_ENTROPY);
+ }
+ if (entropy.length % 4 !== 0) {
+ throw new TypeError(INVALID_ENTROPY);
+ }
+ const entropyBits = bytesToBinary(Array.from(entropy));
+ const checksumBits = deriveChecksumBits(entropy);
+ const bits = entropyBits + checksumBits;
+ const chunks = bits.match(/(.{1,11})/g);
+ const words = chunks.map((binary) => {
+ const index = binaryToByte(binary);
+ return wordlist[index];
+ });
+ return wordlist[0] === "\u3042\u3044\u3053\u304f\u3057\u3093" // Japanese wordlist
+ ? words.join("\u3000")
+ : words.join(" ");
+}
+function deriveChecksumBits(entropyBuffer) {
+ const ENT = entropyBuffer.length * 8;
+ const CS = ENT / 32;
+ const hash = new Sha256()
+ .update(entropyBuffer)
+ .digest();
+ return bytesToBinary(Array.from(hash)).slice(0, CS);
+}
+function lpad(str, padString, length) {
+ while (str.length < length) {
+ str = padString + str;
+ }
+ return str;
+}
+function bytesToBinary(bytes) {
+ return bytes.map((x) => lpad(x.toString(2), "0", 8)).join("");
+}
+function normalize(str) {
+ return (str || "").normalize("NFKD");
+}
+function binaryToByte(bin) {
+ return parseInt(bin, 2);
+}
+const DEFAULT_WORDLIST = [
+ "abandon",
+ "ability",
+ "able",
+ "about",
+ "above",
+ "absent",
+ "absorb",
+ "abstract",
+ "absurd",
+ "abuse",
+ "access",
+ "accident",
+ "account",
+ "accuse",
+ "achieve",
+ "acid",
+ "acoustic",
+ "acquire",
+ "across",
+ "act",
+ "action",
+ "actor",
+ "actress",
+ "actual",
+ "adapt",
+ "add",
+ "addict",
+ "address",
+ "adjust",
+ "admit",
+ "adult",
+ "advance",
+ "advice",
+ "aerobic",
+ "affair",
+ "afford",
+ "afraid",
+ "again",
+ "age",
+ "agent",
+ "agree",
+ "ahead",
+ "aim",
+ "air",
+ "airport",
+ "aisle",
+ "alarm",
+ "album",
+ "alcohol",
+ "alert",
+ "alien",
+ "all",
+ "alley",
+ "allow",
+ "almost",
+ "alone",
+ "alpha",
+ "already",
+ "also",
+ "alter",
+ "always",
+ "amateur",
+ "amazing",
+ "among",
+ "amount",
+ "amused",
+ "analyst",
+ "anchor",
+ "ancient",
+ "anger",
+ "angle",
+ "angry",
+ "animal",
+ "ankle",
+ "announce",
+ "annual",
+ "another",
+ "answer",
+ "antenna",
+ "antique",
+ "anxiety",
+ "any",
+ "apart",
+ "apology",
+ "appear",
+ "apple",
+ "approve",
+ "april",
+ "arch",
+ "arctic",
+ "area",
+ "arena",
+ "argue",
+ "arm",
+ "armed",
+ "armor",
+ "army",
+ "around",
+ "arrange",
+ "arrest",
+ "arrive",
+ "arrow",
+ "art",
+ "artefact",
+ "artist",
+ "artwork",
+ "ask",
+ "aspect",
+ "assault",
+ "asset",
+ "assist",
+ "assume",
+ "asthma",
+ "athlete",
+ "atom",
+ "attack",
+ "attend",
+ "attitude",
+ "attract",
+ "auction",
+ "audit",
+ "august",
+ "aunt",
+ "author",
+ "auto",
+ "autumn",
+ "average",
+ "avocado",
+ "avoid",
+ "awake",
+ "aware",
+ "away",
+ "awesome",
+ "awful",
+ "awkward",
+ "axis",
+ "baby",
+ "bachelor",
+ "bacon",
+ "badge",
+ "bag",
+ "balance",
+ "balcony",
+ "ball",
+ "bamboo",
+ "banana",
+ "banner",
+ "bar",
+ "barely",
+ "bargain",
+ "barrel",
+ "base",
+ "basic",
+ "basket",
+ "battle",
+ "beach",
+ "bean",
+ "beauty",
+ "because",
+ "become",
+ "beef",
+ "before",
+ "begin",
+ "behave",
+ "behind",
+ "believe",
+ "below",
+ "belt",
+ "bench",
+ "benefit",
+ "best",
+ "betray",
+ "better",
+ "between",
+ "beyond",
+ "bicycle",
+ "bid",
+ "bike",
+ "bind",
+ "biology",
+ "bird",
+ "birth",
+ "bitter",
+ "black",
+ "blade",
+ "blame",
+ "blanket",
+ "blast",
+ "bleak",
+ "bless",
+ "blind",
+ "blood",
+ "blossom",
+ "blouse",
+ "blue",
+ "blur",
+ "blush",
+ "board",
+ "boat",
+ "body",
+ "boil",
+ "bomb",
+ "bone",
+ "bonus",
+ "book",
+ "boost",
+ "border",
+ "boring",
+ "borrow",
+ "boss",
+ "bottom",
+ "bounce",
+ "box",
+ "boy",
+ "bracket",
+ "brain",
+ "brand",
+ "brass",
+ "brave",
+ "bread",
+ "breeze",
+ "brick",
+ "bridge",
+ "brief",
+ "bright",
+ "bring",
+ "brisk",
+ "broccoli",
+ "broken",
+ "bronze",
+ "broom",
+ "brother",
+ "brown",
+ "brush",
+ "bubble",
+ "buddy",
+ "budget",
+ "buffalo",
+ "build",
+ "bulb",
+ "bulk",
+ "bullet",
+ "bundle",
+ "bunker",
+ "burden",
+ "burger",
+ "burst",
+ "bus",
+ "business",
+ "busy",
+ "butter",
+ "buyer",
+ "buzz",
+ "cabbage",
+ "cabin",
+ "cable",
+ "cactus",
+ "cage",
+ "cake",
+ "call",
+ "calm",
+ "camera",
+ "camp",
+ "can",
+ "canal",
+ "cancel",
+ "candy",
+ "cannon",
+ "canoe",
+ "canvas",
+ "canyon",
+ "capable",
+ "capital",
+ "captain",
+ "car",
+ "carbon",
+ "card",
+ "cargo",
+ "carpet",
+ "carry",
+ "cart",
+ "case",
+ "cash",
+ "casino",
+ "castle",
+ "casual",
+ "cat",
+ "catalog",
+ "catch",
+ "category",
+ "cattle",
+ "caught",
+ "cause",
+ "caution",
+ "cave",
+ "ceiling",
+ "celery",
+ "cement",
+ "census",
+ "century",
+ "cereal",
+ "certain",
+ "chair",
+ "chalk",
+ "champion",
+ "change",
+ "chaos",
+ "chapter",
+ "charge",
+ "chase",
+ "chat",
+ "cheap",
+ "check",
+ "cheese",
+ "chef",
+ "cherry",
+ "chest",
+ "chicken",
+ "chief",
+ "child",
+ "chimney",
+ "choice",
+ "choose",
+ "chronic",
+ "chuckle",
+ "chunk",
+ "churn",
+ "cigar",
+ "cinnamon",
+ "circle",
+ "citizen",
+ "city",
+ "civil",
+ "claim",
+ "clap",
+ "clarify",
+ "claw",
+ "clay",
+ "clean",
+ "clerk",
+ "clever",
+ "click",
+ "client",
+ "cliff",
+ "climb",
+ "clinic",
+ "clip",
+ "clock",
+ "clog",
+ "close",
+ "cloth",
+ "cloud",
+ "clown",
+ "club",
+ "clump",
+ "cluster",
+ "clutch",
+ "coach",
+ "coast",
+ "coconut",
+ "code",
+ "coffee",
+ "coil",
+ "coin",
+ "collect",
+ "color",
+ "column",
+ "combine",
+ "come",
+ "comfort",
+ "comic",
+ "common",
+ "company",
+ "concert",
+ "conduct",
+ "confirm",
+ "congress",
+ "connect",
+ "consider",
+ "control",
+ "convince",
+ "cook",
+ "cool",
+ "copper",
+ "copy",
+ "coral",
+ "core",
+ "corn",
+ "correct",
+ "cost",
+ "cotton",
+ "couch",
+ "country",
+ "couple",
+ "course",
+ "cousin",
+ "cover",
+ "coyote",
+ "crack",
+ "cradle",
+ "craft",
+ "cram",
+ "crane",
+ "crash",
+ "crater",
+ "crawl",
+ "crazy",
+ "cream",
+ "credit",
+ "creek",
+ "crew",
+ "cricket",
+ "crime",
+ "crisp",
+ "critic",
+ "crop",
+ "cross",
+ "crouch",
+ "crowd",
+ "crucial",
+ "cruel",
+ "cruise",
+ "crumble",
+ "crunch",
+ "crush",
+ "cry",
+ "crystal",
+ "cube",
+ "culture",
+ "cup",
+ "cupboard",
+ "curious",
+ "current",
+ "curtain",
+ "curve",
+ "cushion",
+ "custom",
+ "cute",
+ "cycle",
+ "dad",
+ "damage",
+ "damp",
+ "dance",
+ "danger",
+ "daring",
+ "dash",
+ "daughter",
+ "dawn",
+ "day",
+ "deal",
+ "debate",
+ "debris",
+ "decade",
+ "december",
+ "decide",
+ "decline",
+ "decorate",
+ "decrease",
+ "deer",
+ "defense",
+ "define",
+ "defy",
+ "degree",
+ "delay",
+ "deliver",
+ "demand",
+ "demise",
+ "denial",
+ "dentist",
+ "deny",
+ "depart",
+ "depend",
+ "deposit",
+ "depth",
+ "deputy",
+ "derive",
+ "describe",
+ "desert",
+ "design",
+ "desk",
+ "despair",
+ "destroy",
+ "detail",
+ "detect",
+ "develop",
+ "device",
+ "devote",
+ "diagram",
+ "dial",
+ "diamond",
+ "diary",
+ "dice",
+ "diesel",
+ "diet",
+ "differ",
+ "digital",
+ "dignity",
+ "dilemma",
+ "dinner",
+ "dinosaur",
+ "direct",
+ "dirt",
+ "disagree",
+ "discover",
+ "disease",
+ "dish",
+ "dismiss",
+ "disorder",
+ "display",
+ "distance",
+ "divert",
+ "divide",
+ "divorce",
+ "dizzy",
+ "doctor",
+ "document",
+ "dog",
+ "doll",
+ "dolphin",
+ "domain",
+ "donate",
+ "donkey",
+ "donor",
+ "door",
+ "dose",
+ "double",
+ "dove",
+ "draft",
+ "dragon",
+ "drama",
+ "drastic",
+ "draw",
+ "dream",
+ "dress",
+ "drift",
+ "drill",
+ "drink",
+ "drip",
+ "drive",
+ "drop",
+ "drum",
+ "dry",
+ "duck",
+ "dumb",
+ "dune",
+ "during",
+ "dust",
+ "dutch",
+ "duty",
+ "dwarf",
+ "dynamic",
+ "eager",
+ "eagle",
+ "early",
+ "earn",
+ "earth",
+ "easily",
+ "east",
+ "easy",
+ "echo",
+ "ecology",
+ "economy",
+ "edge",
+ "edit",
+ "educate",
+ "effort",
+ "egg",
+ "eight",
+ "either",
+ "elbow",
+ "elder",
+ "electric",
+ "elegant",
+ "element",
+ "elephant",
+ "elevator",
+ "elite",
+ "else",
+ "embark",
+ "embody",
+ "embrace",
+ "emerge",
+ "emotion",
+ "employ",
+ "empower",
+ "empty",
+ "enable",
+ "enact",
+ "end",
+ "endless",
+ "endorse",
+ "enemy",
+ "energy",
+ "enforce",
+ "engage",
+ "engine",
+ "enhance",
+ "enjoy",
+ "enlist",
+ "enough",
+ "enrich",
+ "enroll",
+ "ensure",
+ "enter",
+ "entire",
+ "entry",
+ "envelope",
+ "episode",
+ "equal",
+ "equip",
+ "era",
+ "erase",
+ "erode",
+ "erosion",
+ "error",
+ "erupt",
+ "escape",
+ "essay",
+ "essence",
+ "estate",
+ "eternal",
+ "ethics",
+ "evidence",
+ "evil",
+ "evoke",
+ "evolve",
+ "exact",
+ "example",
+ "excess",
+ "exchange",
+ "excite",
+ "exclude",
+ "excuse",
+ "execute",
+ "exercise",
+ "exhaust",
+ "exhibit",
+ "exile",
+ "exist",
+ "exit",
+ "exotic",
+ "expand",
+ "expect",
+ "expire",
+ "explain",
+ "expose",
+ "express",
+ "extend",
+ "extra",
+ "eye",
+ "eyebrow",
+ "fabric",
+ "face",
+ "faculty",
+ "fade",
+ "faint",
+ "faith",
+ "fall",
+ "false",
+ "fame",
+ "family",
+ "famous",
+ "fan",
+ "fancy",
+ "fantasy",
+ "farm",
+ "fashion",
+ "fat",
+ "fatal",
+ "father",
+ "fatigue",
+ "fault",
+ "favorite",
+ "feature",
+ "february",
+ "federal",
+ "fee",
+ "feed",
+ "feel",
+ "female",
+ "fence",
+ "festival",
+ "fetch",
+ "fever",
+ "few",
+ "fiber",
+ "fiction",
+ "field",
+ "figure",
+ "file",
+ "film",
+ "filter",
+ "final",
+ "find",
+ "fine",
+ "finger",
+ "finish",
+ "fire",
+ "firm",
+ "first",
+ "fiscal",
+ "fish",
+ "fit",
+ "fitness",
+ "fix",
+ "flag",
+ "flame",
+ "flash",
+ "flat",
+ "flavor",
+ "flee",
+ "flight",
+ "flip",
+ "float",
+ "flock",
+ "floor",
+ "flower",
+ "fluid",
+ "flush",
+ "fly",
+ "foam",
+ "focus",
+ "fog",
+ "foil",
+ "fold",
+ "follow",
+ "food",
+ "foot",
+ "force",
+ "forest",
+ "forget",
+ "fork",
+ "fortune",
+ "forum",
+ "forward",
+ "fossil",
+ "foster",
+ "found",
+ "fox",
+ "fragile",
+ "frame",
+ "frequent",
+ "fresh",
+ "friend",
+ "fringe",
+ "frog",
+ "front",
+ "frost",
+ "frown",
+ "frozen",
+ "fruit",
+ "fuel",
+ "fun",
+ "funny",
+ "furnace",
+ "fury",
+ "future",
+ "gadget",
+ "gain",
+ "galaxy",
+ "gallery",
+ "game",
+ "gap",
+ "garage",
+ "garbage",
+ "garden",
+ "garlic",
+ "garment",
+ "gas",
+ "gasp",
+ "gate",
+ "gather",
+ "gauge",
+ "gaze",
+ "general",
+ "genius",
+ "genre",
+ "gentle",
+ "genuine",
+ "gesture",
+ "ghost",
+ "giant",
+ "gift",
+ "giggle",
+ "ginger",
+ "giraffe",
+ "girl",
+ "give",
+ "glad",
+ "glance",
+ "glare",
+ "glass",
+ "glide",
+ "glimpse",
+ "globe",
+ "gloom",
+ "glory",
+ "glove",
+ "glow",
+ "glue",
+ "goat",
+ "goddess",
+ "gold",
+ "good",
+ "goose",
+ "gorilla",
+ "gospel",
+ "gossip",
+ "govern",
+ "gown",
+ "grab",
+ "grace",
+ "grain",
+ "grant",
+ "grape",
+ "grass",
+ "gravity",
+ "great",
+ "green",
+ "grid",
+ "grief",
+ "grit",
+ "grocery",
+ "group",
+ "grow",
+ "grunt",
+ "guard",
+ "guess",
+ "guide",
+ "guilt",
+ "guitar",
+ "gun",
+ "gym",
+ "habit",
+ "hair",
+ "half",
+ "hammer",
+ "hamster",
+ "hand",
+ "happy",
+ "harbor",
+ "hard",
+ "harsh",
+ "harvest",
+ "hat",
+ "have",
+ "hawk",
+ "hazard",
+ "head",
+ "health",
+ "heart",
+ "heavy",
+ "hedgehog",
+ "height",
+ "hello",
+ "helmet",
+ "help",
+ "hen",
+ "hero",
+ "hidden",
+ "high",
+ "hill",
+ "hint",
+ "hip",
+ "hire",
+ "history",
+ "hobby",
+ "hockey",
+ "hold",
+ "hole",
+ "holiday",
+ "hollow",
+ "home",
+ "honey",
+ "hood",
+ "hope",
+ "horn",
+ "horror",
+ "horse",
+ "hospital",
+ "host",
+ "hotel",
+ "hour",
+ "hover",
+ "hub",
+ "huge",
+ "human",
+ "humble",
+ "humor",
+ "hundred",
+ "hungry",
+ "hunt",
+ "hurdle",
+ "hurry",
+ "hurt",
+ "husband",
+ "hybrid",
+ "ice",
+ "icon",
+ "idea",
+ "identify",
+ "idle",
+ "ignore",
+ "ill",
+ "illegal",
+ "illness",
+ "image",
+ "imitate",
+ "immense",
+ "immune",
+ "impact",
+ "impose",
+ "improve",
+ "impulse",
+ "inch",
+ "include",
+ "income",
+ "increase",
+ "index",
+ "indicate",
+ "indoor",
+ "industry",
+ "infant",
+ "inflict",
+ "inform",
+ "inhale",
+ "inherit",
+ "initial",
+ "inject",
+ "injury",
+ "inmate",
+ "inner",
+ "innocent",
+ "input",
+ "inquiry",
+ "insane",
+ "insect",
+ "inside",
+ "inspire",
+ "install",
+ "intact",
+ "interest",
+ "into",
+ "invest",
+ "invite",
+ "involve",
+ "iron",
+ "island",
+ "isolate",
+ "issue",
+ "item",
+ "ivory",
+ "jacket",
+ "jaguar",
+ "jar",
+ "jazz",
+ "jealous",
+ "jeans",
+ "jelly",
+ "jewel",
+ "job",
+ "join",
+ "joke",
+ "journey",
+ "joy",
+ "judge",
+ "juice",
+ "jump",
+ "jungle",
+ "junior",
+ "junk",
+ "just",
+ "kangaroo",
+ "keen",
+ "keep",
+ "ketchup",
+ "key",
+ "kick",
+ "kid",
+ "kidney",
+ "kind",
+ "kingdom",
+ "kiss",
+ "kit",
+ "kitchen",
+ "kite",
+ "kitten",
+ "kiwi",
+ "knee",
+ "knife",
+ "knock",
+ "know",
+ "lab",
+ "label",
+ "labor",
+ "ladder",
+ "lady",
+ "lake",
+ "lamp",
+ "language",
+ "laptop",
+ "large",
+ "later",
+ "latin",
+ "laugh",
+ "laundry",
+ "lava",
+ "law",
+ "lawn",
+ "lawsuit",
+ "layer",
+ "lazy",
+ "leader",
+ "leaf",
+ "learn",
+ "leave",
+ "lecture",
+ "left",
+ "leg",
+ "legal",
+ "legend",
+ "leisure",
+ "lemon",
+ "lend",
+ "length",
+ "lens",
+ "leopard",
+ "lesson",
+ "letter",
+ "level",
+ "liar",
+ "liberty",
+ "library",
+ "license",
+ "life",
+ "lift",
+ "light",
+ "like",
+ "limb",
+ "limit",
+ "link",
+ "lion",
+ "liquid",
+ "list",
+ "little",
+ "live",
+ "lizard",
+ "load",
+ "loan",
+ "lobster",
+ "local",
+ "lock",
+ "logic",
+ "lonely",
+ "long",
+ "loop",
+ "lottery",
+ "loud",
+ "lounge",
+ "love",
+ "loyal",
+ "lucky",
+ "luggage",
+ "lumber",
+ "lunar",
+ "lunch",
+ "luxury",
+ "lyrics",
+ "machine",
+ "mad",
+ "magic",
+ "magnet",
+ "maid",
+ "mail",
+ "main",
+ "major",
+ "make",
+ "mammal",
+ "man",
+ "manage",
+ "mandate",
+ "mango",
+ "mansion",
+ "manual",
+ "maple",
+ "marble",
+ "march",
+ "margin",
+ "marine",
+ "market",
+ "marriage",
+ "mask",
+ "mass",
+ "master",
+ "match",
+ "material",
+ "math",
+ "matrix",
+ "matter",
+ "maximum",
+ "maze",
+ "meadow",
+ "mean",
+ "measure",
+ "meat",
+ "mechanic",
+ "medal",
+ "media",
+ "melody",
+ "melt",
+ "member",
+ "memory",
+ "mention",
+ "menu",
+ "mercy",
+ "merge",
+ "merit",
+ "merry",
+ "mesh",
+ "message",
+ "metal",
+ "method",
+ "middle",
+ "midnight",
+ "milk",
+ "million",
+ "mimic",
+ "mind",
+ "minimum",
+ "minor",
+ "minute",
+ "miracle",
+ "mirror",
+ "misery",
+ "miss",
+ "mistake",
+ "mix",
+ "mixed",
+ "mixture",
+ "mobile",
+ "model",
+ "modify",
+ "mom",
+ "moment",
+ "monitor",
+ "monkey",
+ "monster",
+ "month",
+ "moon",
+ "moral",
+ "more",
+ "morning",
+ "mosquito",
+ "mother",
+ "motion",
+ "motor",
+ "mountain",
+ "mouse",
+ "move",
+ "movie",
+ "much",
+ "muffin",
+ "mule",
+ "multiply",
+ "muscle",
+ "museum",
+ "mushroom",
+ "music",
+ "must",
+ "mutual",
+ "myself",
+ "mystery",
+ "myth",
+ "naive",
+ "name",
+ "napkin",
+ "narrow",
+ "nasty",
+ "nation",
+ "nature",
+ "near",
+ "neck",
+ "need",
+ "negative",
+ "neglect",
+ "neither",
+ "nephew",
+ "nerve",
+ "nest",
+ "net",
+ "network",
+ "neutral",
+ "never",
+ "news",
+ "next",
+ "nice",
+ "night",
+ "noble",
+ "noise",
+ "nominee",
+ "noodle",
+ "normal",
+ "north",
+ "nose",
+ "notable",
+ "note",
+ "nothing",
+ "notice",
+ "novel",
+ "now",
+ "nuclear",
+ "number",
+ "nurse",
+ "nut",
+ "oak",
+ "obey",
+ "object",
+ "oblige",
+ "obscure",
+ "observe",
+ "obtain",
+ "obvious",
+ "occur",
+ "ocean",
+ "october",
+ "odor",
+ "off",
+ "offer",
+ "office",
+ "often",
+ "oil",
+ "okay",
+ "old",
+ "olive",
+ "olympic",
+ "omit",
+ "once",
+ "one",
+ "onion",
+ "online",
+ "only",
+ "open",
+ "opera",
+ "opinion",
+ "oppose",
+ "option",
+ "orange",
+ "orbit",
+ "orchard",
+ "order",
+ "ordinary",
+ "organ",
+ "orient",
+ "original",
+ "orphan",
+ "ostrich",
+ "other",
+ "outdoor",
+ "outer",
+ "output",
+ "outside",
+ "oval",
+ "oven",
+ "over",
+ "own",
+ "owner",
+ "oxygen",
+ "oyster",
+ "ozone",
+ "pact",
+ "paddle",
+ "page",
+ "pair",
+ "palace",
+ "palm",
+ "panda",
+ "panel",
+ "panic",
+ "panther",
+ "paper",
+ "parade",
+ "parent",
+ "park",
+ "parrot",
+ "party",
+ "pass",
+ "patch",
+ "path",
+ "patient",
+ "patrol",
+ "pattern",
+ "pause",
+ "pave",
+ "payment",
+ "peace",
+ "peanut",
+ "pear",
+ "peasant",
+ "pelican",
+ "pen",
+ "penalty",
+ "pencil",
+ "people",
+ "pepper",
+ "perfect",
+ "permit",
+ "person",
+ "pet",
+ "phone",
+ "photo",
+ "phrase",
+ "physical",
+ "piano",
+ "picnic",
+ "picture",
+ "piece",
+ "pig",
+ "pigeon",
+ "pill",
+ "pilot",
+ "pink",
+ "pioneer",
+ "pipe",
+ "pistol",
+ "pitch",
+ "pizza",
+ "place",
+ "planet",
+ "plastic",
+ "plate",
+ "play",
+ "please",
+ "pledge",
+ "pluck",
+ "plug",
+ "plunge",
+ "poem",
+ "poet",
+ "point",
+ "polar",
+ "pole",
+ "police",
+ "pond",
+ "pony",
+ "pool",
+ "popular",
+ "portion",
+ "position",
+ "possible",
+ "post",
+ "potato",
+ "pottery",
+ "poverty",
+ "powder",
+ "power",
+ "practice",
+ "praise",
+ "predict",
+ "prefer",
+ "prepare",
+ "present",
+ "pretty",
+ "prevent",
+ "price",
+ "pride",
+ "primary",
+ "print",
+ "priority",
+ "prison",
+ "private",
+ "prize",
+ "problem",
+ "process",
+ "produce",
+ "profit",
+ "program",
+ "project",
+ "promote",
+ "proof",
+ "property",
+ "prosper",
+ "protect",
+ "proud",
+ "provide",
+ "public",
+ "pudding",
+ "pull",
+ "pulp",
+ "pulse",
+ "pumpkin",
+ "punch",
+ "pupil",
+ "puppy",
+ "purchase",
+ "purity",
+ "purpose",
+ "purse",
+ "push",
+ "put",
+ "puzzle",
+ "pyramid",
+ "quality",
+ "quantum",
+ "quarter",
+ "question",
+ "quick",
+ "quit",
+ "quiz",
+ "quote",
+ "rabbit",
+ "raccoon",
+ "race",
+ "rack",
+ "radar",
+ "radio",
+ "rail",
+ "rain",
+ "raise",
+ "rally",
+ "ramp",
+ "ranch",
+ "random",
+ "range",
+ "rapid",
+ "rare",
+ "rate",
+ "rather",
+ "raven",
+ "raw",
+ "razor",
+ "ready",
+ "real",
+ "reason",
+ "rebel",
+ "rebuild",
+ "recall",
+ "receive",
+ "recipe",
+ "record",
+ "recycle",
+ "reduce",
+ "reflect",
+ "reform",
+ "refuse",
+ "region",
+ "regret",
+ "regular",
+ "reject",
+ "relax",
+ "release",
+ "relief",
+ "rely",
+ "remain",
+ "remember",
+ "remind",
+ "remove",
+ "render",
+ "renew",
+ "rent",
+ "reopen",
+ "repair",
+ "repeat",
+ "replace",
+ "report",
+ "require",
+ "rescue",
+ "resemble",
+ "resist",
+ "resource",
+ "response",
+ "result",
+ "retire",
+ "retreat",
+ "return",
+ "reunion",
+ "reveal",
+ "review",
+ "reward",
+ "rhythm",
+ "rib",
+ "ribbon",
+ "rice",
+ "rich",
+ "ride",
+ "ridge",
+ "rifle",
+ "right",
+ "rigid",
+ "ring",
+ "riot",
+ "ripple",
+ "risk",
+ "ritual",
+ "rival",
+ "river",
+ "road",
+ "roast",
+ "robot",
+ "robust",
+ "rocket",
+ "romance",
+ "roof",
+ "rookie",
+ "room",
+ "rose",
+ "rotate",
+ "rough",
+ "round",
+ "route",
+ "royal",
+ "rubber",
+ "rude",
+ "rug",
+ "rule",
+ "run",
+ "runway",
+ "rural",
+ "sad",
+ "saddle",
+ "sadness",
+ "safe",
+ "sail",
+ "salad",
+ "salmon",
+ "salon",
+ "salt",
+ "salute",
+ "same",
+ "sample",
+ "sand",
+ "satisfy",
+ "satoshi",
+ "sauce",
+ "sausage",
+ "save",
+ "say",
+ "scale",
+ "scan",
+ "scare",
+ "scatter",
+ "scene",
+ "scheme",
+ "school",
+ "science",
+ "scissors",
+ "scorpion",
+ "scout",
+ "scrap",
+ "screen",
+ "script",
+ "scrub",
+ "sea",
+ "search",
+ "season",
+ "seat",
+ "second",
+ "secret",
+ "section",
+ "security",
+ "seed",
+ "seek",
+ "segment",
+ "select",
+ "sell",
+ "seminar",
+ "senior",
+ "sense",
+ "sentence",
+ "series",
+ "service",
+ "session",
+ "settle",
+ "setup",
+ "seven",
+ "shadow",
+ "shaft",
+ "shallow",
+ "share",
+ "shed",
+ "shell",
+ "sheriff",
+ "shield",
+ "shift",
+ "shine",
+ "ship",
+ "shiver",
+ "shock",
+ "shoe",
+ "shoot",
+ "shop",
+ "short",
+ "shoulder",
+ "shove",
+ "shrimp",
+ "shrug",
+ "shuffle",
+ "shy",
+ "sibling",
+ "sick",
+ "side",
+ "siege",
+ "sight",
+ "sign",
+ "silent",
+ "silk",
+ "silly",
+ "silver",
+ "similar",
+ "simple",
+ "since",
+ "sing",
+ "siren",
+ "sister",
+ "situate",
+ "six",
+ "size",
+ "skate",
+ "sketch",
+ "ski",
+ "skill",
+ "skin",
+ "skirt",
+ "skull",
+ "slab",
+ "slam",
+ "sleep",
+ "slender",
+ "slice",
+ "slide",
+ "slight",
+ "slim",
+ "slogan",
+ "slot",
+ "slow",
+ "slush",
+ "small",
+ "smart",
+ "smile",
+ "smoke",
+ "smooth",
+ "snack",
+ "snake",
+ "snap",
+ "sniff",
+ "snow",
+ "soap",
+ "soccer",
+ "social",
+ "sock",
+ "soda",
+ "soft",
+ "solar",
+ "soldier",
+ "solid",
+ "solution",
+ "solve",
+ "someone",
+ "song",
+ "soon",
+ "sorry",
+ "sort",
+ "soul",
+ "sound",
+ "soup",
+ "source",
+ "south",
+ "space",
+ "spare",
+ "spatial",
+ "spawn",
+ "speak",
+ "special",
+ "speed",
+ "spell",
+ "spend",
+ "sphere",
+ "spice",
+ "spider",
+ "spike",
+ "spin",
+ "spirit",
+ "split",
+ "spoil",
+ "sponsor",
+ "spoon",
+ "sport",
+ "spot",
+ "spray",
+ "spread",
+ "spring",
+ "spy",
+ "square",
+ "squeeze",
+ "squirrel",
+ "stable",
+ "stadium",
+ "staff",
+ "stage",
+ "stairs",
+ "stamp",
+ "stand",
+ "start",
+ "state",
+ "stay",
+ "steak",
+ "steel",
+ "stem",
+ "step",
+ "stereo",
+ "stick",
+ "still",
+ "sting",
+ "stock",
+ "stomach",
+ "stone",
+ "stool",
+ "story",
+ "stove",
+ "strategy",
+ "street",
+ "strike",
+ "strong",
+ "struggle",
+ "student",
+ "stuff",
+ "stumble",
+ "style",
+ "subject",
+ "submit",
+ "subway",
+ "success",
+ "such",
+ "sudden",
+ "suffer",
+ "sugar",
+ "suggest",
+ "suit",
+ "summer",
+ "sun",
+ "sunny",
+ "sunset",
+ "super",
+ "supply",
+ "supreme",
+ "sure",
+ "surface",
+ "surge",
+ "surprise",
+ "surround",
+ "survey",
+ "suspect",
+ "sustain",
+ "swallow",
+ "swamp",
+ "swap",
+ "swarm",
+ "swear",
+ "sweet",
+ "swift",
+ "swim",
+ "swing",
+ "switch",
+ "sword",
+ "symbol",
+ "symptom",
+ "syrup",
+ "system",
+ "table",
+ "tackle",
+ "tag",
+ "tail",
+ "talent",
+ "talk",
+ "tank",
+ "tape",
+ "target",
+ "task",
+ "taste",
+ "tattoo",
+ "taxi",
+ "teach",
+ "team",
+ "tell",
+ "ten",
+ "tenant",
+ "tennis",
+ "tent",
+ "term",
+ "test",
+ "text",
+ "thank",
+ "that",
+ "theme",
+ "then",
+ "theory",
+ "there",
+ "they",
+ "thing",
+ "this",
+ "thought",
+ "three",
+ "thrive",
+ "throw",
+ "thumb",
+ "thunder",
+ "ticket",
+ "tide",
+ "tiger",
+ "tilt",
+ "timber",
+ "time",
+ "tiny",
+ "tip",
+ "tired",
+ "tissue",
+ "title",
+ "toast",
+ "tobacco",
+ "today",
+ "toddler",
+ "toe",
+ "together",
+ "toilet",
+ "token",
+ "tomato",
+ "tomorrow",
+ "tone",
+ "tongue",
+ "tonight",
+ "tool",
+ "tooth",
+ "top",
+ "topic",
+ "topple",
+ "torch",
+ "tornado",
+ "tortoise",
+ "toss",
+ "total",
+ "tourist",
+ "toward",
+ "tower",
+ "town",
+ "toy",
+ "track",
+ "trade",
+ "traffic",
+ "tragic",
+ "train",
+ "transfer",
+ "trap",
+ "trash",
+ "travel",
+ "tray",
+ "treat",
+ "tree",
+ "trend",
+ "trial",
+ "tribe",
+ "trick",
+ "trigger",
+ "trim",
+ "trip",
+ "trophy",
+ "trouble",
+ "truck",
+ "true",
+ "truly",
+ "trumpet",
+ "trust",
+ "truth",
+ "try",
+ "tube",
+ "tuition",
+ "tumble",
+ "tuna",
+ "tunnel",
+ "turkey",
+ "turn",
+ "turtle",
+ "twelve",
+ "twenty",
+ "twice",
+ "twin",
+ "twist",
+ "two",
+ "type",
+ "typical",
+ "ugly",
+ "umbrella",
+ "unable",
+ "unaware",
+ "uncle",
+ "uncover",
+ "under",
+ "undo",
+ "unfair",
+ "unfold",
+ "unhappy",
+ "uniform",
+ "unique",
+ "unit",
+ "universe",
+ "unknown",
+ "unlock",
+ "until",
+ "unusual",
+ "unveil",
+ "update",
+ "upgrade",
+ "uphold",
+ "upon",
+ "upper",
+ "upset",
+ "urban",
+ "urge",
+ "usage",
+ "use",
+ "used",
+ "useful",
+ "useless",
+ "usual",
+ "utility",
+ "vacant",
+ "vacuum",
+ "vague",
+ "valid",
+ "valley",
+ "valve",
+ "van",
+ "vanish",
+ "vapor",
+ "various",
+ "vast",
+ "vault",
+ "vehicle",
+ "velvet",
+ "vendor",
+ "venture",
+ "venue",
+ "verb",
+ "verify",
+ "version",
+ "very",
+ "vessel",
+ "veteran",
+ "viable",
+ "vibrant",
+ "vicious",
+ "victory",
+ "video",
+ "view",
+ "village",
+ "vintage",
+ "violin",
+ "virtual",
+ "virus",
+ "visa",
+ "visit",
+ "visual",
+ "vital",
+ "vivid",
+ "vocal",
+ "voice",
+ "void",
+ "volcano",
+ "volume",
+ "vote",
+ "voyage",
+ "wage",
+ "wagon",
+ "wait",
+ "walk",
+ "wall",
+ "walnut",
+ "want",
+ "warfare",
+ "warm",
+ "warrior",
+ "wash",
+ "wasp",
+ "waste",
+ "water",
+ "wave",
+ "way",
+ "wealth",
+ "weapon",
+ "wear",
+ "weasel",
+ "weather",
+ "web",
+ "wedding",
+ "weekend",
+ "weird",
+ "welcome",
+ "west",
+ "wet",
+ "whale",
+ "what",
+ "wheat",
+ "wheel",
+ "when",
+ "where",
+ "whip",
+ "whisper",
+ "wide",
+ "width",
+ "wife",
+ "wild",
+ "will",
+ "win",
+ "window",
+ "wine",
+ "wing",
+ "wink",
+ "winner",
+ "winter",
+ "wire",
+ "wisdom",
+ "wise",
+ "wish",
+ "witness",
+ "wolf",
+ "woman",
+ "wonder",
+ "wood",
+ "wool",
+ "word",
+ "work",
+ "world",
+ "worry",
+ "worth",
+ "wrap",
+ "wreck",
+ "wrestle",
+ "wrist",
+ "write",
+ "wrong",
+ "yard",
+ "year",
+ "yellow",
+ "you",
+ "young",
+ "youth",
+ "zebra",
+ "zero",
+ "zone",
+ "zoo",
+];
diff --git a/dist/esm/src/misc/crc8.d.ts b/dist/esm/src/misc/crc8.d.ts
new file mode 100644
index 00000000..24d4acac
--- /dev/null
+++ b/dist/esm/src/misc/crc8.d.ts
@@ -0,0 +1 @@
+export declare function crc8(current: Uint8Array, previous?: number): number;
diff --git a/dist/esm/src/misc/crc8.js b/dist/esm/src/misc/crc8.js
new file mode 100644
index 00000000..3f2760a0
--- /dev/null
+++ b/dist/esm/src/misc/crc8.js
@@ -0,0 +1,269 @@
+// This is a partial reimplementation of CRC-8 (node-crc) in Deno: https://github.com/alexgorbatchev/node-crc
+let TABLE = [
+ 0x00,
+ 0x07,
+ 0x0e,
+ 0x09,
+ 0x1c,
+ 0x1b,
+ 0x12,
+ 0x15,
+ 0x38,
+ 0x3f,
+ 0x36,
+ 0x31,
+ 0x24,
+ 0x23,
+ 0x2a,
+ 0x2d,
+ 0x70,
+ 0x77,
+ 0x7e,
+ 0x79,
+ 0x6c,
+ 0x6b,
+ 0x62,
+ 0x65,
+ 0x48,
+ 0x4f,
+ 0x46,
+ 0x41,
+ 0x54,
+ 0x53,
+ 0x5a,
+ 0x5d,
+ 0xe0,
+ 0xe7,
+ 0xee,
+ 0xe9,
+ 0xfc,
+ 0xfb,
+ 0xf2,
+ 0xf5,
+ 0xd8,
+ 0xdf,
+ 0xd6,
+ 0xd1,
+ 0xc4,
+ 0xc3,
+ 0xca,
+ 0xcd,
+ 0x90,
+ 0x97,
+ 0x9e,
+ 0x99,
+ 0x8c,
+ 0x8b,
+ 0x82,
+ 0x85,
+ 0xa8,
+ 0xaf,
+ 0xa6,
+ 0xa1,
+ 0xb4,
+ 0xb3,
+ 0xba,
+ 0xbd,
+ 0xc7,
+ 0xc0,
+ 0xc9,
+ 0xce,
+ 0xdb,
+ 0xdc,
+ 0xd5,
+ 0xd2,
+ 0xff,
+ 0xf8,
+ 0xf1,
+ 0xf6,
+ 0xe3,
+ 0xe4,
+ 0xed,
+ 0xea,
+ 0xb7,
+ 0xb0,
+ 0xb9,
+ 0xbe,
+ 0xab,
+ 0xac,
+ 0xa5,
+ 0xa2,
+ 0x8f,
+ 0x88,
+ 0x81,
+ 0x86,
+ 0x93,
+ 0x94,
+ 0x9d,
+ 0x9a,
+ 0x27,
+ 0x20,
+ 0x29,
+ 0x2e,
+ 0x3b,
+ 0x3c,
+ 0x35,
+ 0x32,
+ 0x1f,
+ 0x18,
+ 0x11,
+ 0x16,
+ 0x03,
+ 0x04,
+ 0x0d,
+ 0x0a,
+ 0x57,
+ 0x50,
+ 0x59,
+ 0x5e,
+ 0x4b,
+ 0x4c,
+ 0x45,
+ 0x42,
+ 0x6f,
+ 0x68,
+ 0x61,
+ 0x66,
+ 0x73,
+ 0x74,
+ 0x7d,
+ 0x7a,
+ 0x89,
+ 0x8e,
+ 0x87,
+ 0x80,
+ 0x95,
+ 0x92,
+ 0x9b,
+ 0x9c,
+ 0xb1,
+ 0xb6,
+ 0xbf,
+ 0xb8,
+ 0xad,
+ 0xaa,
+ 0xa3,
+ 0xa4,
+ 0xf9,
+ 0xfe,
+ 0xf7,
+ 0xf0,
+ 0xe5,
+ 0xe2,
+ 0xeb,
+ 0xec,
+ 0xc1,
+ 0xc6,
+ 0xcf,
+ 0xc8,
+ 0xdd,
+ 0xda,
+ 0xd3,
+ 0xd4,
+ 0x69,
+ 0x6e,
+ 0x67,
+ 0x60,
+ 0x75,
+ 0x72,
+ 0x7b,
+ 0x7c,
+ 0x51,
+ 0x56,
+ 0x5f,
+ 0x58,
+ 0x4d,
+ 0x4a,
+ 0x43,
+ 0x44,
+ 0x19,
+ 0x1e,
+ 0x17,
+ 0x10,
+ 0x05,
+ 0x02,
+ 0x0b,
+ 0x0c,
+ 0x21,
+ 0x26,
+ 0x2f,
+ 0x28,
+ 0x3d,
+ 0x3a,
+ 0x33,
+ 0x34,
+ 0x4e,
+ 0x49,
+ 0x40,
+ 0x47,
+ 0x52,
+ 0x55,
+ 0x5c,
+ 0x5b,
+ 0x76,
+ 0x71,
+ 0x78,
+ 0x7f,
+ 0x6a,
+ 0x6d,
+ 0x64,
+ 0x63,
+ 0x3e,
+ 0x39,
+ 0x30,
+ 0x37,
+ 0x22,
+ 0x25,
+ 0x2c,
+ 0x2b,
+ 0x06,
+ 0x01,
+ 0x08,
+ 0x0f,
+ 0x1a,
+ 0x1d,
+ 0x14,
+ 0x13,
+ 0xae,
+ 0xa9,
+ 0xa0,
+ 0xa7,
+ 0xb2,
+ 0xb5,
+ 0xbc,
+ 0xbb,
+ 0x96,
+ 0x91,
+ 0x98,
+ 0x9f,
+ 0x8a,
+ 0x8d,
+ 0x84,
+ 0x83,
+ 0xde,
+ 0xd9,
+ 0xd0,
+ 0xd7,
+ 0xc2,
+ 0xc5,
+ 0xcc,
+ 0xcb,
+ 0xe6,
+ 0xe1,
+ 0xe8,
+ 0xef,
+ 0xfa,
+ 0xfd,
+ 0xf4,
+ 0xf3,
+];
+if (typeof Int32Array !== "undefined") {
+ TABLE = new Int32Array(TABLE);
+}
+export function crc8(current, previous = 0) {
+ let crc = ~~previous;
+ for (let index = 0; index < current.length; index++) {
+ crc = TABLE[(crc ^ current[index]) & 0xff] & 0xff;
+ }
+ return crc;
+}
diff --git a/dist/esm/src/misc/sign_data.d.ts b/dist/esm/src/misc/sign_data.d.ts
new file mode 100644
index 00000000..221bcb63
--- /dev/null
+++ b/dist/esm/src/misc/sign_data.d.ts
@@ -0,0 +1,3 @@
+import { KeyHash, Payload, PrivateKey, SignedMessage } from "../mod.js";
+export declare function signData(addressHex: string, payload: Payload, privateKey: PrivateKey): SignedMessage;
+export declare function verifyData(addressHex: string, keyHash: KeyHash, payload: Payload, signedMessage: SignedMessage): boolean;
diff --git a/dist/esm/src/misc/sign_data.js b/dist/esm/src/misc/sign_data.js
new file mode 100644
index 00000000..b4cf73fb
--- /dev/null
+++ b/dist/esm/src/misc/sign_data.js
@@ -0,0 +1,113 @@
+import { C, fromHex, M, toHex, } from "../mod.js";
+export function signData(addressHex, payload, privateKey) {
+ const protectedHeaders = M.HeaderMap.new();
+ protectedHeaders.set_algorithm_id(M.Label.from_algorithm_id(M.AlgorithmId.EdDSA));
+ protectedHeaders.set_header(M.Label.new_text("address"), M.CBORValue.new_bytes(fromHex(addressHex)));
+ const protectedSerialized = M.ProtectedHeaderMap.new(protectedHeaders);
+ const unprotectedHeaders = M.HeaderMap.new();
+ const headers = M.Headers.new(protectedSerialized, unprotectedHeaders);
+ const builder = M.COSESign1Builder.new(headers, fromHex(payload), false);
+ const toSign = builder.make_data_to_sign().to_bytes();
+ const priv = C.PrivateKey.from_bech32(privateKey);
+ const signedSigStruc = priv.sign(toSign).to_bytes();
+ const coseSign1 = builder.build(signedSigStruc);
+ const key = M.COSEKey.new(M.Label.from_key_type(M.KeyType.OKP));
+ key.set_algorithm_id(M.Label.from_algorithm_id(M.AlgorithmId.EdDSA));
+ key.set_header(M.Label.new_int(M.Int.new_negative(M.BigNum.from_str("1"))), M.CBORValue.new_int(M.Int.new_i32(6))); // crv (-1) set to Ed25519 (6)
+ key.set_header(M.Label.new_int(M.Int.new_negative(M.BigNum.from_str("2"))), M.CBORValue.new_bytes(priv.to_public().as_bytes())); // x (-2) set to public key
+ return {
+ signature: toHex(coseSign1.to_bytes()),
+ key: toHex(key.to_bytes()),
+ };
+}
+export function verifyData(addressHex, keyHash, payload, signedMessage) {
+ const cose1 = M.COSESign1.from_bytes(fromHex(signedMessage.signature));
+ const key = M.COSEKey.from_bytes(fromHex(signedMessage.key));
+ const protectedHeaders = cose1.headers().protected()
+ .deserialized_headers();
+ const cose1Address = (() => {
+ try {
+ return toHex(protectedHeaders.header(M.Label.new_text("address"))?.as_bytes());
+ }
+ catch (_e) {
+ throw new Error("No address found in signature.");
+ }
+ })();
+ const cose1AlgorithmId = (() => {
+ try {
+ const int = protectedHeaders.algorithm_id()?.as_int();
+ if (int?.is_positive())
+ return parseInt(int.as_positive()?.to_str());
+ return parseInt(int?.as_negative()?.to_str());
+ }
+ catch (_e) {
+ throw new Error("Failed to retrieve Algorithm Id.");
+ }
+ })();
+ const keyAlgorithmId = (() => {
+ try {
+ const int = key.algorithm_id()?.as_int();
+ if (int?.is_positive())
+ return parseInt(int.as_positive()?.to_str());
+ return parseInt(int?.as_negative()?.to_str());
+ }
+ catch (_e) {
+ throw new Error("Failed to retrieve Algorithm Id.");
+ }
+ })();
+ const keyCurve = (() => {
+ try {
+ const int = key.header(M.Label.new_int(M.Int.new_negative(M.BigNum.from_str("1"))))?.as_int();
+ if (int?.is_positive())
+ return parseInt(int.as_positive()?.to_str());
+ return parseInt(int?.as_negative()?.to_str());
+ }
+ catch (_e) {
+ throw new Error("Failed to retrieve Curve.");
+ }
+ })();
+ const keyType = (() => {
+ try {
+ const int = key.key_type().as_int();
+ if (int?.is_positive())
+ return parseInt(int.as_positive()?.to_str());
+ return parseInt(int?.as_negative()?.to_str());
+ }
+ catch (_e) {
+ throw new Error("Failed to retrieve Key Type.");
+ }
+ })();
+ const publicKey = (() => {
+ try {
+ return C.PublicKey.from_bytes(key.header(M.Label.new_int(M.Int.new_negative(M.BigNum.from_str("2"))))?.as_bytes());
+ }
+ catch (_e) {
+ throw new Error("No public key found.");
+ }
+ })();
+ const cose1Payload = (() => {
+ try {
+ return toHex(cose1.payload());
+ }
+ catch (_e) {
+ throw new Error("No payload found.");
+ }
+ })();
+ const signature = C.Ed25519Signature.from_bytes(cose1.signature());
+ const data = cose1.signed_data(undefined, undefined).to_bytes();
+ if (cose1Address !== addressHex)
+ return false;
+ if (keyHash !== publicKey.hash().to_hex())
+ return false;
+ if (cose1AlgorithmId !== keyAlgorithmId &&
+ cose1AlgorithmId !== M.AlgorithmId.EdDSA) {
+ return false;
+ }
+ if (keyCurve !== 6)
+ return false;
+ if (keyType !== 1)
+ return false;
+ if (cose1Payload !== payload)
+ return false;
+ return publicKey.verify(data, signature);
+}
diff --git a/dist/esm/src/misc/wallet.d.ts b/dist/esm/src/misc/wallet.d.ts
new file mode 100644
index 00000000..4f8e08a6
--- /dev/null
+++ b/dist/esm/src/misc/wallet.d.ts
@@ -0,0 +1,15 @@
+import { Address, C, KeyHash, Network, PrivateKey, RewardAddress, UTxO } from "../mod.js";
+type FromSeed = {
+ address: Address;
+ rewardAddress: RewardAddress | null;
+ paymentKey: PrivateKey;
+ stakeKey: PrivateKey | null;
+};
+export declare function walletFromSeed(seed: string, options?: {
+ password?: string;
+ addressType?: "Base" | "Enterprise";
+ accountIndex?: number;
+ network?: Network;
+}): FromSeed;
+export declare function discoverOwnUsedTxKeyHashes(tx: C.Transaction, ownKeyHashes: Array, ownUtxos: Array): Array;
+export {};
diff --git a/dist/esm/src/misc/wallet.js b/dist/esm/src/misc/wallet.js
new file mode 100644
index 00000000..d8042529
--- /dev/null
+++ b/dist/esm/src/misc/wallet.js
@@ -0,0 +1,173 @@
+import { C, fromHex, getAddressDetails, toHex, } from "../mod.js";
+import { mnemonicToEntropy } from "./bip39.js";
+export function walletFromSeed(seed, options = { addressType: "Base", accountIndex: 0, network: "Mainnet" }) {
+ function harden(num) {
+ if (typeof num !== "number")
+ throw new Error("Type number required here!");
+ return 0x80000000 + num;
+ }
+ const entropy = mnemonicToEntropy(seed);
+ const rootKey = C.Bip32PrivateKey.from_bip39_entropy(fromHex(entropy), options.password
+ ? new TextEncoder().encode(options.password)
+ : new Uint8Array());
+ const accountKey = rootKey.derive(harden(1852))
+ .derive(harden(1815))
+ .derive(harden(options.accountIndex));
+ const paymentKey = accountKey.derive(0).derive(0).to_raw_key();
+ const stakeKey = accountKey.derive(2).derive(0).to_raw_key();
+ const paymentKeyHash = paymentKey.to_public().hash();
+ const stakeKeyHash = stakeKey.to_public().hash();
+ const networkId = options.network === "Mainnet" ? 1 : 0;
+ const address = options.addressType === "Base"
+ ? C.BaseAddress.new(networkId, C.StakeCredential.from_keyhash(paymentKeyHash), C.StakeCredential.from_keyhash(stakeKeyHash)).to_address().to_bech32(undefined)
+ : C.EnterpriseAddress.new(networkId, C.StakeCredential.from_keyhash(paymentKeyHash)).to_address().to_bech32(undefined);
+ const rewardAddress = options.addressType === "Base"
+ ? C.RewardAddress.new(networkId, C.StakeCredential.from_keyhash(stakeKeyHash)).to_address().to_bech32(undefined)
+ : null;
+ return {
+ address,
+ rewardAddress,
+ paymentKey: paymentKey.to_bech32(),
+ stakeKey: options.addressType === "Base" ? stakeKey.to_bech32() : null,
+ };
+}
+export function discoverOwnUsedTxKeyHashes(tx, ownKeyHashes, ownUtxos) {
+ const usedKeyHashes = [];
+ // key hashes from inputs
+ const inputs = tx.body().inputs();
+ for (let i = 0; i < inputs.len(); i++) {
+ const input = inputs.get(i);
+ const txHash = toHex(input.transaction_id().to_bytes());
+ const outputIndex = parseInt(input.index().to_str());
+ const utxo = ownUtxos.find((utxo) => utxo.txHash === txHash && utxo.outputIndex === outputIndex);
+ if (utxo) {
+ const { paymentCredential } = getAddressDetails(utxo.address);
+ usedKeyHashes.push(paymentCredential?.hash);
+ }
+ }
+ const txBody = tx.body();
+ // key hashes from certificates
+ function keyHashFromCert(txBody) {
+ const certs = txBody.certs();
+ if (!certs)
+ return;
+ for (let i = 0; i < certs.len(); i++) {
+ const cert = certs.get(i);
+ if (cert.kind() === 0) {
+ const credential = cert.as_stake_registration()?.stake_credential();
+ if (credential?.kind() === 0) {
+ // Key hash not needed for registration
+ }
+ }
+ else if (cert.kind() === 1) {
+ const credential = cert.as_stake_deregistration()?.stake_credential();
+ if (credential?.kind() === 0) {
+ const keyHash = toHex(credential.to_keyhash().to_bytes());
+ usedKeyHashes.push(keyHash);
+ }
+ }
+ else if (cert.kind() === 2) {
+ const credential = cert.as_stake_delegation()?.stake_credential();
+ if (credential?.kind() === 0) {
+ const keyHash = toHex(credential.to_keyhash().to_bytes());
+ usedKeyHashes.push(keyHash);
+ }
+ }
+ else if (cert.kind() === 3) {
+ const poolParams = cert
+ .as_pool_registration()?.pool_params();
+ const owners = poolParams
+ ?.pool_owners();
+ if (!owners)
+ break;
+ for (let i = 0; i < owners.len(); i++) {
+ const keyHash = toHex(owners.get(i).to_bytes());
+ usedKeyHashes.push(keyHash);
+ }
+ const operator = poolParams.operator().to_hex();
+ usedKeyHashes.push(operator);
+ }
+ else if (cert.kind() === 4) {
+ const operator = cert.as_pool_retirement().pool_keyhash().to_hex();
+ usedKeyHashes.push(operator);
+ }
+ else if (cert.kind() === 6) {
+ const instantRewards = cert
+ .as_move_instantaneous_rewards_cert()
+ ?.move_instantaneous_reward().as_to_stake_creds()
+ ?.keys();
+ if (!instantRewards)
+ break;
+ for (let i = 0; i < instantRewards.len(); i++) {
+ const credential = instantRewards.get(i);
+ if (credential.kind() === 0) {
+ const keyHash = toHex(credential.to_keyhash().to_bytes());
+ usedKeyHashes.push(keyHash);
+ }
+ }
+ }
+ }
+ }
+ if (txBody.certs())
+ keyHashFromCert(txBody);
+ // key hashes from withdrawals
+ const withdrawals = txBody.withdrawals();
+ function keyHashFromWithdrawal(withdrawals) {
+ const rewardAddresses = withdrawals.keys();
+ for (let i = 0; i < rewardAddresses.len(); i++) {
+ const credential = rewardAddresses.get(i).payment_cred();
+ if (credential.kind() === 0) {
+ usedKeyHashes.push(credential.to_keyhash().to_hex());
+ }
+ }
+ }
+ if (withdrawals)
+ keyHashFromWithdrawal(withdrawals);
+ // key hashes from scripts
+ const scripts = tx.witness_set().native_scripts();
+ function keyHashFromScript(scripts) {
+ for (let i = 0; i < scripts.len(); i++) {
+ const script = scripts.get(i);
+ if (script.kind() === 0) {
+ const keyHash = toHex(script.as_script_pubkey().addr_keyhash().to_bytes());
+ usedKeyHashes.push(keyHash);
+ }
+ if (script.kind() === 1) {
+ keyHashFromScript(script.as_script_all().native_scripts());
+ return;
+ }
+ if (script.kind() === 2) {
+ keyHashFromScript(script.as_script_any().native_scripts());
+ return;
+ }
+ if (script.kind() === 3) {
+ keyHashFromScript(script.as_script_n_of_k().native_scripts());
+ return;
+ }
+ }
+ }
+ if (scripts)
+ keyHashFromScript(scripts);
+ // keyHashes from required signers
+ const requiredSigners = txBody.required_signers();
+ if (requiredSigners) {
+ for (let i = 0; i < requiredSigners.len(); i++) {
+ usedKeyHashes.push(toHex(requiredSigners.get(i).to_bytes()));
+ }
+ }
+ // keyHashes from collateral
+ const collateral = txBody.collateral();
+ if (collateral) {
+ for (let i = 0; i < collateral.len(); i++) {
+ const input = collateral.get(i);
+ const txHash = toHex(input.transaction_id().to_bytes());
+ const outputIndex = parseInt(input.index().to_str());
+ const utxo = ownUtxos.find((utxo) => utxo.txHash === txHash && utxo.outputIndex === outputIndex);
+ if (utxo) {
+ const { paymentCredential } = getAddressDetails(utxo.address);
+ usedKeyHashes.push(paymentCredential?.hash);
+ }
+ }
+ }
+ return usedKeyHashes.filter((k) => ownKeyHashes.includes(k));
+}
diff --git a/dist/esm/src/mod.d.ts b/dist/esm/src/mod.d.ts
new file mode 100644
index 00000000..98bc70c9
--- /dev/null
+++ b/dist/esm/src/mod.d.ts
@@ -0,0 +1,6 @@
+export * from "./core/mod.js";
+export * from "./lucid/mod.js";
+export * from "./provider/mod.js";
+export * from "./types/mod.js";
+export * from "./utils/mod.js";
+export * from "./plutus/mod.js";
diff --git a/dist/esm/src/mod.js b/dist/esm/src/mod.js
new file mode 100644
index 00000000..98bc70c9
--- /dev/null
+++ b/dist/esm/src/mod.js
@@ -0,0 +1,6 @@
+export * from "./core/mod.js";
+export * from "./lucid/mod.js";
+export * from "./provider/mod.js";
+export * from "./types/mod.js";
+export * from "./utils/mod.js";
+export * from "./plutus/mod.js";
diff --git a/dist/esm/src/plutus/data.d.ts b/dist/esm/src/plutus/data.d.ts
new file mode 100644
index 00000000..70ea083c
--- /dev/null
+++ b/dist/esm/src/plutus/data.d.ts
@@ -0,0 +1,93 @@
+import { Static as _Static, TLiteral, TLiteralValue, TProperties, TSchema } from "../../deps/deno.land/x/typebox@0.25.13/src/typebox.js";
+import { Datum, Exact, Json, Redeemer } from "../types/mod.js";
+export declare class Constr {
+ index: number;
+ fields: T[];
+ constructor(index: number, fields: T[]);
+}
+export declare namespace Data {
+ type Static = _Static;
+}
+export type Data = bigint | string | Array | Map | Constr;
+export declare const Data: {
+ Integer: (options?: {
+ minimum?: number;
+ maximum?: number;
+ exclusiveMinimum?: number;
+ exclusiveMaximum?: number;
+ }) => import("../../deps/deno.land/x/typebox@0.25.13/src/typebox.js").TUnsafe;
+ Bytes: (options?: {
+ minLength?: number;
+ maxLength?: number;
+ enum?: string[];
+ }) => import("../../deps/deno.land/x/typebox@0.25.13/src/typebox.js").TUnsafe;
+ Boolean: () => import("../../deps/deno.land/x/typebox@0.25.13/src/typebox.js").TUnsafe;
+ Any: () => import("../../deps/deno.land/x/typebox@0.25.13/src/typebox.js").TUnsafe;
+ Array: (items: T, options?: {
+ minItems?: number;
+ maxItems?: number;
+ uniqueItems?: boolean;
+ }) => import("../../deps/deno.land/x/typebox@0.25.13/src/typebox.js").TArray;
+ Map: (keys: T_1, values: U, options?: {
+ minItems?: number;
+ maxItems?: number;
+ }) => import("../../deps/deno.land/x/typebox@0.25.13/src/typebox.js").TUnsafe