diff --git a/api/background/handlers/ethereum/utils.ts b/api/background/handlers/ethereum/utils.ts index 8abc97ac..82f362b2 100644 --- a/api/background/handlers/ethereum/utils.ts +++ b/api/background/handlers/ethereum/utils.ts @@ -27,29 +27,3 @@ export const isUserDeniedResponse = (response: unknown) => { const result = ApiResponseSchema.safeParse(response); return result.success && result.data.error === "User Denied"; }; - -export const TESTNET_SUPPORTED_EVM_L2_CHAINS = [ - kairos, - - // Kasplex Testnet - { - id: 167_012, - name: "Kasplex Network Testnet", - network: "kasplex-testnet", - nativeCurrency: { - decimals: 18, - name: "Bridged KAS", - symbol: "WKAS", - }, - rpcUrls: { - default: { http: ["https://rpc.kasplextest.xyz"] }, - }, - blockExplorers: { - default: { - name: "Kasplex Testnet Explorer", - url: "https:/frontend.kasplextest.xyz", - }, - }, - testnet: true, - }, -]; diff --git a/assets/kaspa_bg.wasm b/assets/kaspa_bg.wasm index fb20a3fd..c7fb50b7 100644 Binary files a/assets/kaspa_bg.wasm and b/assets/kaspa_bg.wasm differ diff --git a/components/screens/browser-api/ethereum/send-transaction/HotWalletSendTransaction.tsx b/components/screens/browser-api/ethereum/send-transaction/HotWalletSendTransaction.tsx index 85ec30fe..4e60efa0 100644 --- a/components/screens/browser-api/ethereum/send-transaction/HotWalletSendTransaction.tsx +++ b/components/screens/browser-api/ethereum/send-transaction/HotWalletSendTransaction.tsx @@ -1,49 +1,82 @@ import React, { useEffect, useState } from "react"; import useKeyring from "@/hooks/useKeyring"; import useWalletManager from "@/hooks/useWalletManager"; -import { AccountFactory } from "@/lib/ethereum/wallet/account-factory"; -import { IWallet } from "@/lib/ethereum/wallet/wallet-interface"; +import { AccountFactory as EthAccountFactory } from "@/lib/ethereum/wallet/account-factory"; +import { IWallet as EthWallet } from "@/lib/ethereum/wallet/wallet-interface"; +import { IWallet as KasWallet } from "@/lib/wallet/wallet-interface"; import SendTransaction from "./SendTransaction"; import Splash from "@/components/screens/Splash"; +import { useSettings } from "@/hooks/useSettings"; +import { kasplexTestnet } from "@/lib/layer2"; +import useRpcClient from "@/hooks/useRpcClientStateful"; +import { AccountFactory as KasAccountFactory } from "@/lib/wallet/wallet-factory"; +import SendKasplexL2Transaction from "./SendKasplexL2Transaction"; export default function HotWalletSendTransaction() { const { getWalletSecret } = useKeyring(); const { wallet: walletInfo, account } = useWalletManager(); - const [walletSigner, setWalletSigner] = useState(null); + const [ethSigner, setEthSigner] = useState(null); + const { rpcClient, networkId } = useRpcClient(); + const [kasSigner, setKasSigner] = useState(null); + const [settings] = useSettings(); + const callOnce = React.useRef(false); useEffect(() => { - const init = async () => { - if (!walletInfo || !account) { - return; - } + if (!walletInfo || !account || !networkId || !rpcClient) { + return; + } + const init = async () => { const { walletSecret } = await getWalletSecret({ walletId: walletInfo.id, }); + + const kasAccountFactory = new KasAccountFactory(rpcClient, networkId); + switch (walletInfo.type) { case "mnemonic": - setWalletSigner( - AccountFactory.createFromMnemonic( + setEthSigner( + EthAccountFactory.createFromMnemonic( + walletSecret.value, + account.index, + ), + ); + setKasSigner( + kasAccountFactory.createFromMnemonic( walletSecret.value, account.index, ), ); break; case "privateKey": - setWalletSigner( - AccountFactory.createFromPrivateKey(walletSecret.value), + setEthSigner( + EthAccountFactory.createFromPrivateKey(walletSecret.value), + ); + setKasSigner( + kasAccountFactory.createFromPrivateKey(walletSecret.value), ); break; } }; + + if (callOnce.current) { + return; + } init(); + callOnce.current = true; }, [getWalletSecret]); - const isLoading = !walletSigner; + const isKasplexLayer2 = + settings?.evmL2ChainId?.[settings.networkId] === kasplexTestnet.id; + + const isLoading = !ethSigner || !kasSigner; return ( <> {isLoading && } - {!isLoading && } + {!isLoading && !isKasplexLayer2 && } + {!isLoading && isKasplexLayer2 && ( + + )} ); } diff --git a/components/screens/browser-api/ethereum/send-transaction/SendKasplexL2Transaction.tsx b/components/screens/browser-api/ethereum/send-transaction/SendKasplexL2Transaction.tsx new file mode 100644 index 00000000..f0373372 --- /dev/null +++ b/components/screens/browser-api/ethereum/send-transaction/SendKasplexL2Transaction.tsx @@ -0,0 +1,216 @@ +import { IWallet as EthSigner } from "@/lib/ethereum/wallet/wallet-interface"; +import useWalletManager from "@/hooks/useWalletManager"; +import ledgerSignImage from "@/assets/images/ledger-on-sign.svg"; +import signImage from "@/assets/images/sign.png"; +import Header from "@/components/GeneralHeader"; +import { useBoolean } from "usehooks-ts"; +import { ApiExtensionUtils } from "@/api/extension"; +import { ApiUtils } from "@/api/background/utils"; +import { RPC_ERRORS } from "@/api/message"; +import { + TransactionSerializable, + hexToBigInt, + createPublicClient, + http, + hexToNumber, +} from "viem"; +import { estimateFeesPerGas } from "viem/actions"; +import { ethereumTransactionRequestSchema } from "@/api/background/handlers/ethereum/sendTransaction"; +import { TESTNET_SUPPORTED_EVM_L2_CHAINS } from "@/lib/layer2"; +import { IWallet as KasWallet } from "@/lib/wallet/wallet-interface"; +import { sendKasplexTransaction } from "@/lib/kasplex"; + +type SendTransactionProps = { + ethSigner: EthSigner; + kasSigner: KasWallet; +}; + +export default function SendKasplexL2Transaction({ + ethSigner, + kasSigner, +}: SendTransactionProps) { + const [settings] = useSettings(); + const { wallet } = useWalletManager(); + + const { value: isSigning, toggle: toggleIsSigning } = useBoolean(false); + + const requestId = + new URLSearchParams(window.location.search).get("requestId") ?? ""; + const encodedPayload = new URLSearchParams(window.location.search).get( + "payload", + ); + + const payload = encodedPayload + ? JSON.parse(decodeURIComponent(encodedPayload)) + : null; + + const onConfirm = async () => { + if (isSigning || !settings || !kasSigner) { + return; + } + + const result = ethereumTransactionRequestSchema.safeParse(payload); + if (!result.success) { + await ApiExtensionUtils.sendMessage( + requestId, + ApiUtils.createApiResponse(requestId, null, RPC_ERRORS.INVALID_PARAMS), + ); + window.close(); + return; + } + const parsedRequest = result.data; + + const supportedChains = + settings.networkId === "mainnet" ? [] : TESTNET_SUPPORTED_EVM_L2_CHAINS; + + const txChainId = parsedRequest.chainId + ? hexToNumber(parsedRequest.chainId) + : settings.evmL2ChainId?.[settings.networkId]; + + if (!txChainId) { + await ApiExtensionUtils.sendMessage( + requestId, + ApiUtils.createApiResponse(requestId, null, RPC_ERRORS.INVALID_PARAMS), + ); + window.close(); + return; + } + + const network = supportedChains.find((chain) => chain.id === txChainId); + if (!network) { + await ApiExtensionUtils.sendMessage( + requestId, + ApiUtils.createApiResponse( + requestId, + null, + RPC_ERRORS.UNSUPPORTED_CHAIN, + ), + ); + window.close(); + return; + } + + toggleIsSigning(); + try { + const ethClient = createPublicClient({ + chain: network, + transport: http(), + }); + + const nonce = await ethClient.getTransactionCount({ + address: (await ethSigner.getAddress()) as `0x${string}`, + }); + + const estimatedGas = await estimateFeesPerGas(ethClient); + const gasLimit = await ethClient.estimateGas({ + account: parsedRequest.from, + to: parsedRequest.to, + value: parsedRequest.value && hexToBigInt(parsedRequest.value), + data: parsedRequest.data, + }); + + // Build eip1559 transaction + const transaction: TransactionSerializable = { + to: parsedRequest.to, + value: parsedRequest.value && hexToBigInt(parsedRequest.value), + data: parsedRequest.data, + + gas: gasLimit, + maxFeePerGas: parsedRequest.maxFeePerGas + ? hexToBigInt(parsedRequest.maxFeePerGas) + : estimatedGas.maxFeePerGas, + maxPriorityFeePerGas: parsedRequest.maxPriorityFeePerGas + ? hexToBigInt(parsedRequest.maxPriorityFeePerGas) + : estimatedGas.maxPriorityFeePerGas, + chainId: txChainId, + type: "eip1559", + nonce, + }; + + // Sign the message + const [ethTxId] = await sendKasplexTransaction( + transaction, + ethSigner, + kasSigner, + ); + await ApiExtensionUtils.sendMessage( + requestId, + ApiUtils.createApiResponse(requestId, ethTxId), + ); + toggleIsSigning(); + } catch (err) { + await ApiExtensionUtils.sendMessage( + requestId, + ApiUtils.createApiResponse(requestId, null, RPC_ERRORS.INTERNAL_ERROR), + ); + } finally { + } + }; + + const cancel = async () => { + await ApiExtensionUtils.sendMessage( + requestId, + ApiUtils.createApiResponse( + requestId, + null, + RPC_ERRORS.USER_REJECTED_REQUEST, + ), + ); + window.close(); + }; + + return ( +
+
+
+
+ {wallet?.type !== "ledger" && ( + Sign + )} + {wallet?.type === "ledger" && ( + Sign + )} +
+ + {/* Confirm Content */} +
+

Send Transaction

+

+ Please confirm the transaction you are signing +

+
+

+ {JSON.stringify(payload, null, 2)} +

+
+
+
+ + {/* Buttons */} +
+ + +
+
+ ); +} diff --git a/components/screens/browser-api/ethereum/send-transaction/SendTransaction.tsx b/components/screens/browser-api/ethereum/send-transaction/SendTransaction.tsx index de1d1f1b..55c4f0f4 100644 --- a/components/screens/browser-api/ethereum/send-transaction/SendTransaction.tsx +++ b/components/screens/browser-api/ethereum/send-transaction/SendTransaction.tsx @@ -17,13 +17,14 @@ import { import { estimateFeesPerGas } from "viem/actions"; import { ethereumTransactionRequestSchema } from "@/api/background/handlers/ethereum/sendTransaction"; import { TESTNET_SUPPORTED_EVM_L2_CHAINS } from "@/lib/layer2"; -type SignTransactionProps = { - walletSigner: IWallet; + +type SendTransactionProps = { + signer: IWallet; }; export default function SendTransaction({ - walletSigner, -}: SignTransactionProps) { + signer: walletSigner, +}: SendTransactionProps) { const [settings] = useSettings(); const { wallet } = useWalletManager(); const { value: isSigning, toggle: toggleIsSigning } = useBoolean(false); diff --git a/components/send/ConfirmStep.tsx b/components/send/ConfirmStep.tsx index 8da6a43d..0bc6cde9 100644 --- a/components/send/ConfirmStep.tsx +++ b/components/send/ConfirmStep.tsx @@ -62,6 +62,7 @@ export const ConfirmStep = ({ txIds: await signer.send( kaspaToSompi(amount) ?? BigInt(0), address, + "", priorityFee, ), }; diff --git a/docs/index.js b/docs/index.js index 85d5db6e..8509a859 100644 --- a/docs/index.js +++ b/docs/index.js @@ -73,6 +73,8 @@ document priorityFee: kaspaWasm.kaspaToSompi("0.1"), changeAddress: address, networkId: network, + payload: + "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", }); const transaction = pending.transactions[0]; diff --git a/lib/kasplex.ts b/lib/kasplex.ts new file mode 100644 index 00000000..0be72b5a --- /dev/null +++ b/lib/kasplex.ts @@ -0,0 +1,34 @@ +import { TransactionSerializable } from "viem"; +import { IWallet as EthWallet } from "./ethereum/wallet/wallet-interface"; +import { IWallet as KasWallet } from "./wallet/wallet-interface"; +import { hexToBytes, bytesToHex, keccak256 } from "viem"; +import * as zlib from "zlib"; +import { kaspaToSompi } from "@/wasm/core/kaspa"; + +function appendUint8Arrays(a: Uint8Array, b: Uint8Array): Uint8Array { + let combined = new Uint8Array(a.length + b.length); + combined.set(a, 0); + combined.set(b, a.length); + return combined; +} + +export async function sendKasplexTransaction( + transaction: TransactionSerializable, + ethWallet: EthWallet, + kasWallet: KasWallet, +) { + const ethTx = await ethWallet.signTransaction(transaction); + const ethTxBytes = hexToBytes(ethTx as `0x${string}`); + let payload: Uint8Array = new Uint8Array(new TextEncoder().encode("kasplex")); + + payload = appendUint8Arrays(payload, new Uint8Array([0x01])); + payload = appendUint8Arrays(payload, ethTxBytes); + + const [txId] = await kasWallet.send( + kaspaToSompi("0.2")!, + await kasWallet.getAddress(), + bytesToHex(payload).replace("0x", ""), + ); + + return [keccak256(ethTxBytes), txId] as const; +} diff --git a/lib/wallet/account/hot-wallet-account.ts b/lib/wallet/account/hot-wallet-account.ts index 9fb549a5..dc59ac53 100644 --- a/lib/wallet/account/hot-wallet-account.ts +++ b/lib/wallet/account/hot-wallet-account.ts @@ -136,7 +136,11 @@ export class HotWalletAccount implements IWallet { return entries.reduce((acc, curr) => acc + curr.balance, 0n); } - async send(amount: bigint, receiverAddress: string): Promise { + async send( + amount: bigint, + receiverAddress: string, + payload?: string, + ): Promise { if (!Address.validate(receiverAddress)) { throw new Error("Invalid receiver address " + receiverAddress); } @@ -154,6 +158,7 @@ export class HotWalletAccount implements IWallet { priorityFee: 0n, changeAddress: this.getAddress(), networkId: this.networkId, + payload, }); const txIds = []; diff --git a/lib/wallet/account/hot-wallet-private-key.ts b/lib/wallet/account/hot-wallet-private-key.ts index 6456d761..4c9a48a6 100644 --- a/lib/wallet/account/hot-wallet-private-key.ts +++ b/lib/wallet/account/hot-wallet-private-key.ts @@ -123,6 +123,7 @@ export class HotWalletPrivateKey implements IWallet { async send( amount: bigint, receiverAddress: string, + payload?: string, priorityFee?: bigint, ): Promise { if (!Address.validate(receiverAddress)) { @@ -139,6 +140,7 @@ export class HotWalletPrivateKey implements IWallet { ], priorityFee: priorityFee ?? 0n, changeAddress: this.getAddress(), + payload, networkId: this.networkId, }); diff --git a/lib/wallet/account/ledger-account.ts b/lib/wallet/account/ledger-account.ts index 63bf172d..b176e895 100644 --- a/lib/wallet/account/ledger-account.ts +++ b/lib/wallet/account/ledger-account.ts @@ -52,6 +52,7 @@ export class LedgerAccount implements IWallet { public async send( amount: bigint, receiverAddress: string, + payload?: string, priorityFee?: bigint, ): Promise { if (!Address.validate(receiverAddress)) { @@ -71,6 +72,7 @@ export class LedgerAccount implements IWallet { priorityFee: priorityFee ?? 0n, changeAddress: await this.getAddress(), networkId: this.networkId, + payload, }); const txIds = []; diff --git a/lib/wallet/wallet-interface.ts b/lib/wallet/wallet-interface.ts index 3385af91..db50c4ac 100644 --- a/lib/wallet/wallet-interface.ts +++ b/lib/wallet/wallet-interface.ts @@ -31,6 +31,7 @@ export interface IWallet { send( amount: bigint, receiverAddress: string, + payload?: string, priorityFee?: bigint, ): Promise; diff --git a/wasm/core/kaspa.d.ts b/wasm/core/kaspa.d.ts index 31820d74..4dd914af 100644 --- a/wasm/core/kaspa.d.ts +++ b/wasm/core/kaspa.d.ts @@ -1,460 +1,440 @@ /* tslint:disable */ /* eslint-disable */ /** -* Returns true if the script passed is a pay-to-script-hash (P2SH) format, false otherwise. -* @param script - The script ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} script -* @returns {boolean} -*/ + * Returns true if the script passed is a pay-to-script-hash (P2SH) format, false otherwise. + * @param script - The script ({@link HexString} or Uint8Array). + * @category Wallet SDK + */ export function isScriptPayToScriptHash(script: HexString | Uint8Array): boolean; /** -* Returns returns true if the script passed is an ECDSA pay-to-pubkey. -* @param script - The script ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} script -* @returns {boolean} -*/ + * Returns returns true if the script passed is an ECDSA pay-to-pubkey. + * @param script - The script ({@link HexString} or Uint8Array). + * @category Wallet SDK + */ export function isScriptPayToPubkeyECDSA(script: HexString | Uint8Array): boolean; /** -* Returns true if the script passed is a pay-to-pubkey. -* @param script - The script ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} script -* @returns {boolean} -*/ + * Returns true if the script passed is a pay-to-pubkey. + * @param script - The script ({@link HexString} or Uint8Array). + * @category Wallet SDK + */ export function isScriptPayToPubkey(script: HexString | Uint8Array): boolean; /** -* Returns the address encoded in a script public key. -* @param script_public_key - The script public key ({@link ScriptPublicKey}). -* @param network - The network type. -* @category Wallet SDK -* @param {ScriptPublicKey | HexString} script_public_key -* @param {NetworkType | NetworkId | string} network -* @returns {Address | undefined} -*/ + * Returns the address encoded in a script public key. + * @param script_public_key - The script public key ({@link ScriptPublicKey}). + * @param network - The network type. + * @category Wallet SDK + */ export function addressFromScriptPublicKey(script_public_key: ScriptPublicKey | HexString, network: NetworkType | NetworkId | string): Address | undefined; /** -* Generates a signature script that fits a pay-to-script-hash script. -* @param redeem_script - The redeem script ({@link HexString} or Uint8Array). -* @param signature - The signature ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} redeem_script -* @param {HexString | Uint8Array} signature -* @returns {HexString} -*/ + * Generates a signature script that fits a pay-to-script-hash script. + * @param redeem_script - The redeem script ({@link HexString} or Uint8Array). + * @param signature - The signature ({@link HexString} or Uint8Array). + * @category Wallet SDK + */ export function payToScriptHashSignatureScript(redeem_script: HexString | Uint8Array, signature: HexString | Uint8Array): HexString; /** -* Takes a script and returns an equivalent pay-to-script-hash script. -* @param redeem_script - The redeem script ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} redeem_script -* @returns {ScriptPublicKey} -*/ + * Takes a script and returns an equivalent pay-to-script-hash script. + * @param redeem_script - The redeem script ({@link HexString} or Uint8Array). + * @category Wallet SDK + */ export function payToScriptHashScript(redeem_script: HexString | Uint8Array): ScriptPublicKey; /** -* Creates a new script to pay a transaction output to the specified address. -* @category Wallet SDK -* @param {Address | string} address -* @returns {ScriptPublicKey} -*/ + * Creates a new script to pay a transaction output to the specified address. + * @category Wallet SDK + */ export function payToAddressScript(address: Address | string): ScriptPublicKey; /** -* Calculates target from difficulty, based on set_difficulty function on -* -* @category Mining -* @param {number} difficulty -* @returns {bigint} -*/ + * Calculates target from difficulty, based on set_difficulty function on + * + * @category Mining + */ export function calculateTarget(difficulty: number): bigint; /** -* -* Format a Sompi amount to a string representation of the amount in Kaspa with a suffix -* based on the network type (e.g. `KAS` for mainnet, `TKAS` for testnet, -* `SKAS` for simnet, `DKAS` for devnet). -* -* @category Wallet SDK -* @param {bigint | number | HexString} sompi -* @param {NetworkType | NetworkId | string} network -* @returns {string} -*/ -export function sompiToKaspaStringWithSuffix(sompi: bigint | number | HexString, network: NetworkType | NetworkId | string): string; -/** -* -* Convert Sompi to a string representation of the amount in Kaspa. -* -* @category Wallet SDK -* @param {bigint | number | HexString} sompi -* @returns {string} -*/ -export function sompiToKaspaString(sompi: bigint | number | HexString): string; -/** -* Convert a Kaspa string to Sompi represented by bigint. -* This function provides correct precision handling and -* can be used to parse user input. -* @category Wallet SDK -* @param {string} kaspa -* @returns {bigint | undefined} -*/ -export function kaspaToSompi(kaspa: string): bigint | undefined; -/** -* Verifies with a public key the signature of the given message -* @category Message Signing -*/ -export function verifyMessage(value: IVerifyMessage): boolean; -/** -* Signs a message with the given private key -* @category Message Signing -* @param {ISignMessage} value -* @returns {HexString} -*/ -export function signMessage(value: ISignMessage): HexString; -/** -* Helper function that creates an estimate using the transaction {@link Generator} -* by producing only the {@link GeneratorSummary} containing the estimate. -* @see {@link IGeneratorSettingsObject}, {@link Generator}, {@link createTransactions} -* @category Wallet SDK -* @param {IGeneratorSettingsObject} settings -* @returns {Promise} -*/ -export function estimateTransactions(settings: IGeneratorSettingsObject): Promise; -/** -* Helper function that creates a set of transactions using the transaction {@link Generator}. -* @see {@link IGeneratorSettingsObject}, {@link Generator}, {@link estimateTransactions} -* @category Wallet SDK -* @param {IGeneratorSettingsObject} settings -* @returns {Promise} -*/ -export function createTransactions(settings: IGeneratorSettingsObject): Promise; -/** -* Create a basic transaction without any mass limit checks. -* @category Wallet SDK -* @param {IUtxoEntry[]} utxo_entry_source -* @param {IPaymentOutput[]} outputs -* @param {bigint} priority_fee -* @param {HexString | Uint8Array | undefined} [payload] -* @param {number | undefined} [sig_op_count] -* @returns {Transaction} -*/ -export function createTransaction(utxo_entry_source: IUtxoEntry[], outputs: IPaymentOutput[], priority_fee: bigint, payload?: HexString | Uint8Array, sig_op_count?: number): Transaction; + * `calculateStorageMass()` is a helper function to compute the storage mass of inputs and outputs. + * This function can be use to calculate the storage mass of transaction inputs and outputs. + * Note that the storage mass is only a component of the total transaction mass. You are not + * meant to use this function by itself and should use `calculateTransactionMass()` instead. + * This function purely exists for diagnostic purposes and to help with complex algorithms that + * may require a manual UTXO selection for identifying UTXOs and outputs needed for low storage mass. + * + * @category Wallet SDK + * @see {@link maximumStandardTransactionMass} + * @see {@link calculateTransactionMass} + */ +export function calculateStorageMass(network_id: NetworkId | string, input_values: Array, output_values: Array): bigint | undefined; /** -* Set a custom storage folder for the wallet SDK -* subsystem. Encrypted wallet files and transaction -* data will be stored in this folder. If not set -* the storage folder will default to `~/.kaspa` -* (note that the folder is hidden). -* -* This must be called before using any other wallet -* SDK functions. -* -* NOTE: This function will create a folder if it -* doesn't exist. This function will have no effect -* if invoked in the browser environment. -* -* @param {String} folder - the path to the storage folder -* -* @category Wallet API -*/ -export function setDefaultStorageFolder(folder: string): void; + * `calculateTransactionFee()` returns minimum fees needed for the transaction to be + * accepted by the network. If the transaction is invalid or the mass can not be calculated, + * the function throws an error. If the mass exceeds the maximum standard transaction mass, + * the function returns `undefined`. + * + * @category Wallet SDK + * @see {@link maximumStandardTransactionMass} + * @see {@link calculateTransactionMass} + * @see {@link updateTransactionMass} + */ +export function calculateTransactionFee(network_id: NetworkId | string, tx: ITransaction | Transaction, minimum_signatures?: number | null): bigint | undefined; +/** + * `updateTransactionMass()` updates the mass property of the passed transaction. + * If the transaction is invalid, the function throws an error. + * + * The function returns `true` if the mass is within the maximum standard transaction mass and + * the transaction mass is updated. Otherwise, the function returns `false`. + * + * This is similar to `calculateTransactionMass()` but modifies the supplied + * `Transaction` object. + * + * @category Wallet SDK + * @see {@link maximumStandardTransactionMass} + * @see {@link calculateTransactionMass} + * @see {@link calculateTransactionFee} + */ +export function updateTransactionMass(network_id: NetworkId | string, tx: Transaction, minimum_signatures?: number | null): boolean; +/** + * `calculateTransactionMass()` returns the mass of the passed transaction. + * If the transaction is invalid, or the mass can not be calculated + * the function throws an error. + * + * The mass value must not exceed the maximum standard transaction mass + * that can be obtained using `maximumStandardTransactionMass()`. + * + * @category Wallet SDK + * @see {@link maximumStandardTransactionMass} + */ +export function calculateTransactionMass(network_id: NetworkId | string, tx: ITransaction | Transaction, minimum_signatures?: number | null): bigint; /** -* Set the name of the default wallet file name -* or the `localStorage` key. If `Wallet::open` -* is called without a wallet file name, this name -* will be used. Please note that this name -* will be suffixed with `.wallet` suffix. -* -* This function should be called before using any -* other wallet SDK functions. -* -* @param {String} folder - the name to the wallet file or key. -* -* @category Wallet API -* @param {string} folder -*/ -export function setDefaultWalletFile(folder: string): void; + * `maximumStandardTransactionMass()` returns the maximum transaction + * size allowed by the network. + * + * @category Wallet SDK + * @see {@link calculateTransactionMass} + * @see {@link updateTransactionMass} + * @see {@link calculateTransactionFee} + */ +export function maximumStandardTransactionMass(): bigint; /** -* `calculateTransactionFee()` returns minimum fees needed for the transaction to be -* accepted by the network. If the transaction is invalid or the mass can not be calculated, -* the function throws an error. If the mass exceeds the maximum standard transaction mass, -* the function returns `undefined`. -* -* @category Wallet SDK -* @see {@link maximumStandardTransactionMass} -* @see {@link calculateTransactionMass} -* @see {@link updateTransactionMass} -* @param {NetworkId | string} network_id -* @param {ITransaction | Transaction} tx -* @param {number | undefined} [minimum_signatures] -* @returns {bigint | undefined} -*/ -export function calculateTransactionFee(network_id: NetworkId | string, tx: ITransaction | Transaction, minimum_signatures?: number): bigint | undefined; + * @category Wallet SDK + */ +export function createAddress(key: PublicKey | string, network: NetworkType | NetworkId | string, ecdsa?: boolean | null, account_kind?: AccountKind | null): Address; /** -* `updateTransactionMass()` updates the mass property of the passed transaction. -* If the transaction is invalid, the function throws an error. -* -* The function returns `true` if the mass is within the maximum standard transaction mass and -* the transaction mass is updated. Otherwise, the function returns `false`. -* -* This is similar to `calculateTransactionMass()` but modifies the supplied -* `Transaction` object. -* -* @category Wallet SDK -* @see {@link maximumStandardTransactionMass} -* @see {@link calculateTransactionMass} -* @see {@link calculateTransactionFee} -* @param {NetworkId | string} network_id -* @param {Transaction} tx -* @param {number | undefined} [minimum_signatures] -* @returns {boolean} -*/ -export function updateTransactionMass(network_id: NetworkId | string, tx: Transaction, minimum_signatures?: number): boolean; + * @category Wallet SDK + */ +export function createMultisigAddress(minimum_signatures: number, keys: (PublicKey | string)[], network_type: NetworkType, ecdsa?: boolean | null, account_kind?: AccountKind | null): Address; +export function getTransactionMaturityProgress(blockDaaScore: bigint, currentDaaScore: bigint, networkId: NetworkId | string, isCoinbase: boolean): string; +export function getNetworkParams(networkId: NetworkId | string): INetworkParams; +/** + * + * Format a Sompi amount to a string representation of the amount in Kaspa with a suffix + * based on the network type (e.g. `KAS` for mainnet, `TKAS` for testnet, + * `SKAS` for simnet, `DKAS` for devnet). + * + * @category Wallet SDK + */ +export function sompiToKaspaStringWithSuffix(sompi: bigint | number | HexString, network: NetworkType | NetworkId | string): string; /** -* `calculateTransactionMass()` returns the mass of the passed transaction. -* If the transaction is invalid, or the mass can not be calculated -* the function throws an error. -* -* The mass value must not exceed the maximum standard transaction mass -* that can be obtained using `maximumStandardTransactionMass()`. -* -* @category Wallet SDK -* @see {@link maximumStandardTransactionMass} -* @param {NetworkId | string} network_id -* @param {ITransaction | Transaction} tx -* @param {number | undefined} [minimum_signatures] -* @returns {bigint} -*/ -export function calculateTransactionMass(network_id: NetworkId | string, tx: ITransaction | Transaction, minimum_signatures?: number): bigint; + * + * Convert Sompi to a string representation of the amount in Kaspa. + * + * @category Wallet SDK + */ +export function sompiToKaspaString(sompi: bigint | number | HexString): string; /** -* `maximumStandardTransactionMass()` returns the maximum transaction -* size allowed by the network. -* -* @category Wallet SDK -* @see {@link calculateTransactionMass} -* @see {@link updateTransactionMass} -* @see {@link calculateTransactionFee} -* @returns {bigint} -*/ -export function maximumStandardTransactionMass(): bigint; + * Convert a Kaspa string to Sompi represented by bigint. + * This function provides correct precision handling and + * can be used to parse user input. + * @category Wallet SDK + */ +export function kaspaToSompi(kaspa: string): bigint | undefined; /** -* @category Wallet SDK -* @param {any} script_hash -* @param {PrivateKey} privkey -* @returns {string} -*/ + * @category Wallet SDK + */ export function signScriptHash(script_hash: any, privkey: PrivateKey): string; /** -* `createInputSignature()` is a helper function to sign a transaction input with a specific SigHash type using a private key. -* @category Wallet SDK -* @param {Transaction} tx -* @param {number} input_index -* @param {PrivateKey} private_key -* @param {SighashType | undefined} [sighash_type] -* @returns {HexString} -*/ -export function createInputSignature(tx: Transaction, input_index: number, private_key: PrivateKey, sighash_type?: SighashType): HexString; + * `createInputSignature()` is a helper function to sign a transaction input with a specific SigHash type using a private key. + * @category Wallet SDK + */ +export function createInputSignature(tx: Transaction, input_index: number, private_key: PrivateKey, sighash_type?: SighashType | null): HexString; /** -* `signTransaction()` is a helper function to sign a transaction using a private key array or a signer array. -* @category Wallet SDK -* @param {Transaction} tx -* @param {(PrivateKey | HexString | Uint8Array)[]} signer -* @param {boolean} verify_sig -* @returns {Transaction} -*/ + * `signTransaction()` is a helper function to sign a transaction using a private key array or a signer array. + * @category Wallet SDK + */ export function signTransaction(tx: Transaction, signer: (PrivateKey | HexString | Uint8Array)[], verify_sig: boolean): Transaction; /** -* @category Wallet SDK -* @param {PublicKey | string} key -* @param {NetworkType | NetworkId | string} network -* @param {boolean | undefined} [ecdsa] -* @param {AccountKind | undefined} [account_kind] -* @returns {Address} -*/ -export function createAddress(key: PublicKey | string, network: NetworkType | NetworkId | string, ecdsa?: boolean, account_kind?: AccountKind): Address; -/** -* @category Wallet SDK -* @param {number} minimum_signatures -* @param {(PublicKey | string)[]} keys -* @param {NetworkType} network_type -* @param {boolean | undefined} [ecdsa] -* @param {AccountKind | undefined} [account_kind] -* @returns {Address} -*/ -export function createMultisigAddress(minimum_signatures: number, keys: (PublicKey | string)[], network_type: NetworkType, ecdsa?: boolean, account_kind?: AccountKind): Address; -/** -* WASM32 binding for `argon2sha256iv` hash function. -* @param text - The text string to hash. -* @category Encryption -* @param {string} text -* @param {number} byteLength -* @returns {HexString} -*/ + * WASM32 binding for `argon2sha256iv` hash function. + * @param text - The text string to hash. + * @category Encryption + */ export function argon2sha256ivFromText(text: string, byteLength: number): HexString; /** -* WASM32 binding for `argon2sha256iv` hash function. -* @param data - The data to hash ({@link HexString} or Uint8Array). -* @category Encryption -* @param {HexString | Uint8Array} data -* @param {number} hashLength -* @returns {HexString} -*/ + * WASM32 binding for `argon2sha256iv` hash function. + * @param data - The data to hash ({@link HexString} or Uint8Array). + * @category Encryption + */ export function argon2sha256ivFromBinary(data: HexString | Uint8Array, hashLength: number): HexString; /** -* WASM32 binding for `SHA256d` hash function. -* @param {string} text - The text string to hash. -* @category Encryption -* @param {string} text -* @returns {HexString} -*/ + * WASM32 binding for `SHA256d` hash function. + * @param {string} text - The text string to hash. + * @category Encryption + */ export function sha256dFromText(text: string): HexString; /** -* WASM32 binding for `SHA256d` hash function. -* @param data - The data to hash ({@link HexString} or Uint8Array). -* @category Encryption -* @param {HexString | Uint8Array} data -* @returns {HexString} -*/ + * WASM32 binding for `SHA256d` hash function. + * @param data - The data to hash ({@link HexString} or Uint8Array). + * @category Encryption + */ export function sha256dFromBinary(data: HexString | Uint8Array): HexString; /** -* WASM32 binding for `SHA256` hash function. -* @param {string} text - The text string to hash. -* @category Encryption -* @param {string} text -* @returns {HexString} -*/ + * WASM32 binding for `SHA256` hash function. + * @param {string} text - The text string to hash. + * @category Encryption + */ export function sha256FromText(text: string): HexString; /** -* WASM32 binding for `SHA256` hash function. -* @param data - The data to hash ({@link HexString} or Uint8Array). -* @category Encryption -* @param {HexString | Uint8Array} data -* @returns {HexString} -*/ + * WASM32 binding for `SHA256` hash function. + * @param data - The data to hash ({@link HexString} or Uint8Array). + * @category Encryption + */ export function sha256FromBinary(data: HexString | Uint8Array): HexString; /** -* WASM32 binding for `decryptXChaCha20Poly1305` function. -* @category Encryption -* @param {string} base64string -* @param {string} password -* @returns {string} -*/ + * WASM32 binding for `decryptXChaCha20Poly1305` function. + * @category Encryption + */ export function decryptXChaCha20Poly1305(base64string: string, password: string): string; /** -* WASM32 binding for `encryptXChaCha20Poly1305` function. -* @returns The encrypted text as a base64 string. -* @category Encryption -* @param {string} plainText -* @param {string} password -* @returns {string} -*/ + * WASM32 binding for `encryptXChaCha20Poly1305` function. + * @returns The encrypted text as a base64 string. + * @category Encryption + */ export function encryptXChaCha20Poly1305(plainText: string, password: string): string; /** -* Returns the version of the Rusty Kaspa framework. -* @category General -* @returns {string} -*/ + * Set a custom storage folder for the wallet SDK + * subsystem. Encrypted wallet files and transaction + * data will be stored in this folder. If not set + * the storage folder will default to `~/.kaspa` + * (note that the folder is hidden). + * + * This must be called before using any other wallet + * SDK functions. + * + * NOTE: This function will create a folder if it + * doesn't exist. This function will have no effect + * if invoked in the browser environment. + * + * @param {String} folder - the path to the storage folder + * + * @category Wallet API + */ +export function setDefaultStorageFolder(folder: string): void; +/** + * Set the name of the default wallet file name + * or the `localStorage` key. If `Wallet::open` + * is called without a wallet file name, this name + * will be used. Please note that this name + * will be suffixed with `.wallet` suffix. + * + * This function should be called before using any + * other wallet SDK functions. + * + * @param {String} folder - the name to the wallet file or key. + * + * @category Wallet API + */ +export function setDefaultWalletFile(folder: string): void; +/** + * Helper function that creates an estimate using the transaction {@link Generator} + * by producing only the {@link GeneratorSummary} containing the estimate. + * @see {@link IGeneratorSettingsObject}, {@link Generator}, {@link createTransactions} + * @category Wallet SDK + */ +export function estimateTransactions(settings: IGeneratorSettingsObject): Promise; +/** + * Helper function that creates a set of transactions using the transaction {@link Generator}. + * @see {@link IGeneratorSettingsObject}, {@link Generator}, {@link estimateTransactions} + * @category Wallet SDK + */ +export function createTransactions(settings: IGeneratorSettingsObject): Promise; +/** + * Create a basic transaction without any mass limit checks. + * @category Wallet SDK + */ +export function createTransaction(utxo_entry_source: IUtxoEntry[], outputs: IPaymentOutput[], priority_fee: bigint, payload?: HexString | Uint8Array | null, sig_op_count?: number | null): Transaction; +/** + * Verifies with a public key the signature of the given message + * @category Message Signing + */ +export function verifyMessage(value: IVerifyMessage): boolean; +/** + * Signs a message with the given private key + * @category Message Signing + */ +export function signMessage(value: ISignMessage): HexString; +/** + * Returns the version of the Rusty Kaspa framework. + * @category General + */ export function version(): string; /** -*Set the logger log level using a string representation. -*Available variants are: 'off', 'error', 'warn', 'info', 'debug', 'trace' -*@category General -* @param {"off" | "error" | "warn" | "info" | "debug" | "trace"} level -*/ + * Set the logger log level using a string representation. + * Available variants are: 'off', 'error', 'warn', 'info', 'debug', 'trace' + * @category General + */ export function setLogLevel(level: "off" | "error" | "warn" | "info" | "debug" | "trace"): void; /** -* Initialize Rust panic handler in console mode. -* -* This will output additional debug information during a panic to the console. -* This function should be called right after loading WASM libraries. -* @category General -*/ + * Configuration for the WASM32 bindings runtime interface. + * @see {@link IWASM32BindingsConfig} + * @category General + */ +export function initWASM32Bindings(config: IWASM32BindingsConfig): void; +/** + * Initialize Rust panic handler in console mode. + * + * This will output additional debug information during a panic to the console. + * This function should be called right after loading WASM libraries. + * @category General + */ export function initConsolePanicHook(): void; /** -* Initialize Rust panic handler in browser mode. -* -* This will output additional debug information during a panic in the browser -* by creating a full-screen `DIV`. This is useful on mobile devices or where -* the user otherwise has no access to console/developer tools. Use -* {@link presentPanicHookLogs} to activate the panic logs in the -* browser environment. -* @see {@link presentPanicHookLogs} -* @category General -*/ + * Initialize Rust panic handler in browser mode. + * + * This will output additional debug information during a panic in the browser + * by creating a full-screen `DIV`. This is useful on mobile devices or where + * the user otherwise has no access to console/developer tools. Use + * {@link presentPanicHookLogs} to activate the panic logs in the + * browser environment. + * @see {@link presentPanicHookLogs} + * @category General + */ export function initBrowserPanicHook(): void; /** -* Present panic logs to the user in the browser. -* -* This function should be called after a panic has occurred and the -* browser-based panic hook has been activated. It will present the -* collected panic logs in a full-screen `DIV` in the browser. -* @see {@link initBrowserPanicHook} -* @category General -*/ + * Present panic logs to the user in the browser. + * + * This function should be called after a panic has occurred and the + * browser-based panic hook has been activated. It will present the + * collected panic logs in a full-screen `DIV` in the browser. + * @see {@link initBrowserPanicHook} + * @category General + */ export function presentPanicHookLogs(): void; /** -*r" Deferred promise - an object that has `resolve()` and `reject()` -*r" functions that can be called outside of the promise body. -*r" WARNING: This function uses `eval` and can not be used in environments -*r" where dynamically-created code can not be executed such as web browser -*r" extensions. -*r" @category General -* @returns {Promise} -*/ + * r" Deferred promise - an object that has `resolve()` and `reject()` + * r" functions that can be called outside of the promise body. + * r" WARNING: This function uses `eval` and can not be used in environments + * r" where dynamically-created code can not be executed such as web browser + * r" extensions. + * r" @category General + */ export function defer(): Promise; /** -* Configuration for the WASM32 bindings runtime interface. -* @see {@link IWASM32BindingsConfig} -* @category General -* @param {IWASM32BindingsConfig} config -*/ -export function initWASM32Bindings(config: IWASM32BindingsConfig): void; + * @category Wallet API + */ +export enum AccountsDiscoveryKind { + Bip44 = 0, +} /** -* -* Languages supported by BIP39. -* -* Presently only English is specified by the BIP39 standard. -* -* @see {@link Mnemonic} -* -* @category Wallet SDK -*/ -export enum Language { + * + * Kaspa `Address` version (`PubKey`, `PubKey ECDSA`, `ScriptHash`) + * + * @category Address + */ +export enum AddressVersion { + /** + * PubKey addresses always have the version byte set to 0 + */ + PubKey = 0, + /** + * PubKey ECDSA addresses always have the version byte set to 1 + */ + PubKeyECDSA = 1, + /** + * ScriptHash addresses always have the version byte set to 8 + */ + ScriptHash = 8, +} /** -* English is presently the only supported language -*/ - English = 0, + * Specifies the type of an account address to be used in + * commit reveal redeem script and also to spend reveal + * operation to. + * + * @category Wallet API + */ +export enum CommitRevealAddressKind { + Receive = 0, + Change = 1, } /** -* `ConnectionStrategy` specifies how the WebSocket `async fn connect()` -* function should behave during the first-time connectivity phase. -* @category WebSocket -*/ + * `ConnectionStrategy` specifies how the WebSocket `async fn connect()` + * function should behave during the first-time connectivity phase. + * @category WebSocket + */ export enum ConnectStrategy { -/** -* Continuously attempt to connect to the server. This behavior will -* block `connect()` function until the connection is established. -*/ + /** + * Continuously attempt to connect to the server. This behavior will + * block `connect()` function until the connection is established. + */ Retry = 0, -/** -* Causes `connect()` to return immediately if the first-time connection -* has failed. -*/ + /** + * Causes `connect()` to return immediately if the first-time connection + * has failed. + */ Fallback = 1, } /** -* Specifies the type of an account address to create. -* The address can bea receive address or a change address. -* -* @category Wallet API -*/ + * wRPC protocol encoding: `Borsh` or `JSON` + * @category Transport + */ +export enum Encoding { + Borsh = 0, + SerdeJson = 1, +} +/** + * + * @see {@link IFees}, {@link IGeneratorSettingsObject}, {@link Generator}, {@link estimateTransactions}, {@link createTransactions} + * @category Wallet SDK + */ +export enum FeeSource { + SenderPays = 0, + ReceiverPays = 1, +} +/** + * + * Languages supported by BIP39. + * + * Presently only English is specified by the BIP39 standard. + * + * @see {@link Mnemonic} + * + * @category Wallet SDK + */ +export enum Language { + /** + * English is presently the only supported language + */ + English = 0, +} +/** + * @category Consensus + */ +export enum NetworkType { + Mainnet = 0, + Testnet = 1, + Devnet = 2, + Simnet = 3, +} +/** + * Specifies the type of an account address to create. + * The address can bea receive address or a change address. + * + * @category Wallet API + */ export enum NewAddressKind { Receive = 0, Change = 1, } /** -* Kaspa Transaction Script Opcodes -* @see {@link ScriptBuilder} -* @category Consensus -*/ + * Kaspa Transaction Script Opcodes + * @see {@link ScriptBuilder} + * @category Consensus + */ export enum Opcodes { OpFalse = 0, OpData1 = 1, @@ -582,17 +562,17 @@ export enum Opcodes { OpRot = 123, OpSwap = 124, OpTuck = 125, -/** -* Splice opcodes. -*/ + /** + * Splice opcodes. + */ OpCat = 126, OpSubStr = 127, OpLeft = 128, OpRight = 129, OpSize = 130, -/** -* Bitwise logic opcodes. -*/ + /** + * Bitwise logic opcodes. + */ OpInvert = 131, OpAnd = 132, OpOr = 133, @@ -601,9 +581,9 @@ export enum Opcodes { OpEqualVerify = 136, OpReserved1 = 137, OpReserved2 = 138, -/** -* Numeric related opcodes. -*/ + /** + * Numeric related opcodes. + */ Op1Add = 139, Op1Sub = 140, Op2Mul = 141, @@ -631,14 +611,14 @@ export enum Opcodes { OpMin = 163, OpMax = 164, OpWithin = 165, -/** -* Undefined opcodes. -*/ + /** + * Undefined opcodes. + */ OpUnknown166 = 166, OpUnknown167 = 167, -/** -* Crypto opcodes. -*/ + /** + * Crypto opcodes. + */ OpSHA256 = 168, OpCheckMultiSigECDSA = 169, OpBlake2b = 170, @@ -649,9 +629,9 @@ export enum Opcodes { OpCheckMultiSigVerify = 175, OpCheckLockTimeVerify = 176, OpCheckSequenceVerify = 177, -/** -* Undefined opcodes. -*/ + /** + * Undefined opcodes. + */ OpUnknown178 = 178, OpUnknown179 = 179, OpUnknown180 = 180, @@ -732,18 +712,9 @@ export enum Opcodes { OpInvalidOpCode = 255, } /** -* -* @see {@link IFees}, {@link IGeneratorSettingsObject}, {@link Generator}, {@link estimateTransactions}, {@link createTransactions} -* @category Wallet SDK -*/ -export enum FeeSource { - SenderPays = 0, - ReceiverPays = 1, -} -/** -* Kaspa Sighash types allowed by consensus -* @category Consensus -*/ + * Kaspa Sighash types allowed by consensus + * @category Consensus + */ export enum SighashType { All = 0, None = 1, @@ -752,49 +723,32 @@ export enum SighashType { NoneAnyOneCanPay = 4, SingleAnyOneCanPay = 5, } + /** -* @category Wallet API -*/ -export enum AccountsDiscoveryKind { - Bip44 = 0, -} -/** -* @category Consensus -*/ -export enum NetworkType { - Mainnet = 0, - Testnet = 1, - Devnet = 2, - Simnet = 3, -} -/** -* -* Kaspa `Address` version (`PubKey`, `PubKey ECDSA`, `ScriptHash`) -* -* @category Address -*/ -export enum AddressVersion { -/** -* PubKey addresses always have the version byte set to 0 -*/ - PubKey = 0, -/** -* PubKey ECDSA addresses always have the version byte set to 1 -*/ - PubKeyECDSA = 1, -/** -* ScriptHash addresses always have the version byte set to 8 -*/ - ScriptHash = 8, + * Interface defines the structure of a transaction input. + * + * @category Consensus + */ +export interface ITransactionInput { + previousOutpoint: ITransactionOutpoint; + signatureScript?: HexString; + sequence: bigint; + sigOpCount: number; + utxo?: UtxoEntryReference; + + /** Optional verbose data provided by RPC */ + verboseData?: ITransactionInputVerboseData; } + /** -* wRPC protocol encoding: `Borsh` or `JSON` -* @category Transport -*/ -export enum Encoding { - Borsh = 0, - SerdeJson = 1, -} + * Option transaction input verbose data. + * + * @category Node RPC + */ +export interface ITransactionInputVerboseData { } + + + /** * Interface defines the structure of a UTXO entry. @@ -820,52 +774,92 @@ export interface IUtxoEntry { /** - * Interface defining the structure of a transaction. + * Interface defines the structure of a transaction outpoint (used by transaction input). * * @category Consensus */ -export interface ITransaction { - version: number; - inputs: ITransactionInput[]; - outputs: ITransactionOutput[]; - lockTime: bigint; - subnetworkId: HexString; - gas: bigint; - payload: HexString; - /** The mass of the transaction (the mass is undefined or zero unless explicitly set or obtained from the node) */ - mass?: bigint; +export interface ITransactionOutpoint { + transactionId: HexString; + index: number; +} - /** Optional verbose data provided by RPC */ - verboseData?: ITransactionVerboseData; + + + +/** + * Interface defines the structure of a serializable UTXO entry. + * + * @see {@link ISerializableTransactionInput}, {@link ISerializableTransaction} + * @category Wallet SDK + */ +export interface ISerializableUtxoEntry { + address?: Address; + amount: bigint; + scriptPublicKey: ScriptPublicKey; + blockDaaScore: bigint; + isCoinbase: boolean; } /** - * Optional transaction verbose data. + * Interface defines the structure of a serializable transaction input. * - * @category Node RPC + * @see {@link ISerializableTransaction} + * @category Wallet SDK */ -export interface ITransactionVerboseData { +export interface ISerializableTransactionInput { transactionId : HexString; - hash : HexString; - computeMass : bigint; - blockHash : HexString; - blockTime : bigint; + index: number; + sequence: bigint; + sigOpCount: number; + signatureScript?: HexString; + utxo: ISerializableUtxoEntry; } - +/** + * Interface defines the structure of a serializable transaction output. + * + * @see {@link ISerializableTransaction} + * @category Wallet SDK + */ +export interface ISerializableTransactionOutput { + value: bigint; + scriptPublicKey: IScriptPublicKey; +} /** - * Interface defines the structure of a transaction outpoint (used by transaction input). + * Interface defines the structure of a serializable transaction. * - * @category Consensus + * Serializable transactions can be produced using + * {@link Transaction.serializeToJSON}, + * {@link Transaction.serializeToSafeJSON} and + * {@link Transaction.serializeToObject} + * functions for processing (signing) in external systems. + * + * Once the transaction is signed, it can be deserialized + * into {@link Transaction} using {@link Transaction.deserializeFromJSON} + * and {@link Transaction.deserializeFromSafeJSON} functions. + * + * @see {@link Transaction}, + * {@link ISerializableTransactionInput}, + * {@link ISerializableTransactionOutput}, + * {@link ISerializableUtxoEntry} + * + * @category Wallet SDK */ -export interface ITransactionOutpoint { - transactionId: HexString; - index: number; +export interface ISerializableTransaction { + id? : HexString; + version: number; + inputs: ISerializableTransactionInput[]; + outputs: ISerializableTransactionOutput[]; + lockTime: bigint; + subnetworkId: HexString; + gas: bigint; + payload: HexString; } + /** * Interface defining the structure of a block header. * @@ -913,28 +907,37 @@ export interface IRawHeader { /** - * Interface defines the structure of a transaction input. + * Interface defining the structure of a transaction. * * @category Consensus */ -export interface ITransactionInput { - previousOutpoint: ITransactionOutpoint; - signatureScript?: HexString; - sequence: bigint; - sigOpCount: number; - utxo?: UtxoEntryReference; +export interface ITransaction { + version: number; + inputs: ITransactionInput[]; + outputs: ITransactionOutput[]; + lockTime: bigint; + subnetworkId: HexString; + gas: bigint; + payload: HexString; + /** The mass of the transaction (the mass is undefined or zero unless explicitly set or obtained from the node) */ + mass?: bigint; /** Optional verbose data provided by RPC */ - verboseData?: ITransactionInputVerboseData; + verboseData?: ITransactionVerboseData; } /** - * Option transaction input verbose data. + * Optional transaction verbose data. * * @category Node RPC */ -export interface ITransactionInputVerboseData { } - +export interface ITransactionVerboseData { + transactionId : HexString; + hash : HexString; + computeMass : bigint; + blockHash : HexString; + blockTime : bigint; +} @@ -963,105 +966,30 @@ export interface ITransactionOutputVerboseData { - /** - * Interface defines the structure of a serializable UTXO entry. + * Interface defines the structure of a Script Public Key. * - * @see {@link ISerializableTransactionInput}, {@link ISerializableTransaction} - * @category Wallet SDK + * @category Consensus */ -export interface ISerializableUtxoEntry { - address?: Address; - amount: bigint; - scriptPublicKey: ScriptPublicKey; - blockDaaScore: bigint; - isCoinbase: boolean; +export interface IScriptPublicKey { + version : number; + script: HexString; } -/** - * Interface defines the structure of a serializable transaction input. - * - * @see {@link ISerializableTransaction} - * @category Wallet SDK - */ -export interface ISerializableTransactionInput { - transactionId : HexString; - index: number; - sequence: bigint; - sigOpCount: number; - signatureScript?: HexString; - utxo: ISerializableUtxoEntry; -} + /** - * Interface defines the structure of a serializable transaction output. - * - * @see {@link ISerializableTransaction} - * @category Wallet SDK - */ -export interface ISerializableTransactionOutput { - value: bigint; - scriptPublicKey: IScriptPublicKey; -} - -/** - * Interface defines the structure of a serializable transaction. - * - * Serializable transactions can be produced using - * {@link Transaction.serializeToJSON}, - * {@link Transaction.serializeToSafeJSON} and - * {@link Transaction.serializeToObject} - * functions for processing (signing) in external systems. - * - * Once the transaction is signed, it can be deserialized - * into {@link Transaction} using {@link Transaction.deserializeFromJSON} - * and {@link Transaction.deserializeFromSafeJSON} functions. - * - * @see {@link Transaction}, - * {@link ISerializableTransactionInput}, - * {@link ISerializableTransactionOutput}, - * {@link ISerializableUtxoEntry} - * - * @category Wallet SDK - */ -export interface ISerializableTransaction { - id? : HexString; - version: number; - inputs: ISerializableTransactionInput[]; - outputs: ISerializableTransactionOutput[]; - lockTime: bigint; - subnetworkId: HexString; - gas: bigint; - payload: HexString; -} - - - - -/** - * Interface defines the structure of a Script Public Key. - * - * @category Consensus - */ -export interface IScriptPublicKey { - version : number; - script: HexString; -} - - - -/** -* Return interface for the {@link RpcClient.getFeeEstimateExperimental} RPC method. -* -* -* @category Node RPC -*/ - export interface IGetFeeEstimateExperimentalResponse { - estimate : IFeeEstimate; - verbose? : IFeeEstimateVerboseExperimentalData - } - - +* Return interface for the {@link RpcClient.getFeeEstimateExperimental} RPC method. +* +* +* @category Node RPC +*/ + export interface IGetFeeEstimateExperimentalResponse { + estimate : IFeeEstimate; + verbose? : IFeeEstimateVerboseExperimentalData + } + + /** * Argument interface for the {@link RpcClient.getFeeEstimateExperimental} RPC method. @@ -2132,1902 +2060,2147 @@ export interface IScriptPublicKey { /** -* Return interface for the {@link Wallet.addressBookEnumerate} method. -* -* -* @category Wallet API -*/ - export interface IAddressBookEnumerateResponse { - // TODO + * + * Defines a single payment output. + * + * @see {@link IGeneratorSettingsObject}, {@link Generator} + * @category Wallet SDK + */ +export interface IPaymentOutput { + /** + * Destination address. The address prefix must match the network + * you are transacting on (e.g. `kaspa:` for mainnet, `kaspatest:` for testnet, etc). + */ + address: Address | string; + /** + * Output amount in SOMPI. + */ + amount: bigint; +} + + + + /** + * UtxoContext constructor arguments. + * + * @see {@link UtxoProcessor}, {@link UtxoContext}, {@link RpcClient} + * @category Wallet SDK + */ + export interface IUtxoContextArgs { + /** + * Associated UtxoProcessor. + */ + processor: UtxoProcessor; + /** + * Optional id for the UtxoContext. + * **The id must be a valid 32-byte hex string.** + * You can use {@link sha256FromBinary} or {@link sha256FromText} to generate a valid id. + * + * If not provided, a random id will be generated. + * The IDs are deterministic, based on the order UtxoContexts are created. + */ + id?: HexString; } /** -* Argument interface for the {@link Wallet.addressBookEnumerate} method. -* -* -* @category Wallet API -*/ - export interface IAddressBookEnumerateRequest { } - + * Configuration for the transaction {@link Generator}. This interface + * allows you to specify UTXO sources, transaction outputs, change address, + * priority fee, and other transaction parameters. + * + * If the total number of UTXOs needed to satisfy the transaction outputs + * exceeds maximum allowed number of UTXOs per transaction (limited by + * the maximum transaction mass), the {@link Generator} will produce + * multiple chained transactions to the change address and then used these + * transactions as a source for the "final" transaction. + * + * @see + * {@link kaspaToSompi}, + * {@link Generator}, + * {@link PendingTransaction}, + * {@link UtxoContext}, + * {@link UtxoEntry}, + * {@link createTransactions}, + * {@link estimateTransactions} + * @category Wallet SDK + */ +interface IGeneratorSettingsObject { + /** + * Final transaction outputs (do not supply change transaction). + * + * Typical usage: { address: "kaspa:...", amount: 1000n } + */ + outputs: PaymentOutput | IPaymentOutput[]; + /** + * Address to be used for change, if any. + */ + changeAddress: Address | string; + /** + * Fee rate in SOMPI per 1 gram of mass. + * + * Fee rate is applied to all transactions generated by the {@link Generator}. + * This includes batch and final transactions. If not set, the fee rate is + * not applied. + */ + feeRate?: number; + /** + * Priority fee in SOMPI. + * + * If supplying `bigint` value, it will be interpreted as a sender-pays fee. + * Alternatively you can supply an object with `amount` and `source` properties + * where `source` contains the {@link FeeSource} enum. + * + * **IMPORTANT:* When sending an outbound transaction (transaction that + * contains outputs), the `priorityFee` must be set, even if it is zero. + * However, if the transaction is missing outputs (and thus you are + * creating a compound transaction against your change address), + * `priorityFee` should not be set (i.e. it should be `undefined`). + * + * @see {@link IFees}, {@link FeeSource} + */ + priorityFee?: IFees | bigint; + /** + * UTXO entries to be used for the transaction. This can be an + * array of UtxoEntry instances, objects matching {@link IUtxoEntry} + * interface, or a {@link UtxoContext} instance. + */ + entries: IUtxoEntry[] | UtxoEntryReference[] | UtxoContext; + /** + * Optional UTXO entries that will be consumed before those available in `entries`. + * You can use this property to apply custom input selection logic. + * Please note that these inputs are consumed first, then `entries` are consumed + * to generate a desirable transaction output amount. If transaction mass + * overflows, these inputs will be consumed into a batch/sweep transaction + * where the destination if the `changeAddress`. + */ + priorityEntries?: IUtxoEntry[] | UtxoEntryReference[], + /** + * Optional number of signature operations in the transaction. + */ + sigOpCount?: number; + /** + * Optional minimum number of signatures required for the transaction. + */ + minimumSignatures?: number; + /** + * Optional data payload to be included in the transaction. + */ + payload?: Uint8Array | HexString; + + /** + * Optional NetworkId or network id as string (i.e. `mainnet` or `testnet-11`). Required when {@link IGeneratorSettingsObject.entries} is array + */ + networkId?: NetworkId | string +} -/** -* Return interface for the {@link Wallet.transactionsReplaceMetadata} method. -* -* -* @category Wallet API -*/ - export interface ITransactionsReplaceMetadataResponse { } + + /** + * Emitted by {@link UtxoProcessor} when node is syncing cryptographic trust data as a part of the IBD (Initial Block Download) process. + * + * @category Wallet Events + */ + export interface ISyncTrustSyncEvent { + processed : number; + total : number; + } -/** -* Argument interface for the {@link Wallet.transactionsReplaceMetadata} method. -* Metadata is a wallet-specific string that can be used to store arbitrary data. -* It should contain a serialized JSON string with `key` containing the custom -* data stored by the wallet. When interacting with metadata, the wallet should -* always deserialize the JSON string and then serialize it again after making -* changes, preserving any foreign keys that it might encounter. -* -* To preserve foreign metadata, the pattern of access should be: -* `Get -> Modify -> Replace` -* -* @category Wallet API -*/ - export interface ITransactionsReplaceMetadataRequest { -/** -* The id of account the transaction belongs to. -*/ - accountId: HexString, -/** -* The network id of the transaction. -*/ - networkId: NetworkId | string, -/** -* The id of the transaction. -*/ - transactionId: HexString, -/** -* Optional metadata string to replace the existing metadata. -* If not supplied, the metadata will be removed. -*/ - metadata?: string, + /** + * Emitted by {@link UtxoProcessor} when node is syncing the UTXO set as a part of the IBD (Initial Block Download) process. + * + * @category Wallet Events + */ + export interface ISyncUtxoSyncEvent { + chunks : number; + total : number; } -/** -* Return interface for the {@link Wallet.transactionsReplaceNote} method. -* -* -* @category Wallet API -*/ - export interface ITransactionsReplaceNoteResponse { } + /** + * Emitted by {@link UtxoProcessor} when node is syncing blocks as a part of the IBD (Initial Block Download) process. + * + * @category Wallet Events + */ + export interface ISyncBlocksEvent { + blocks : number; + progress : number; + } -/** -* Argument interface for the {@link Wallet.transactionsReplaceNote} method. -* -* -* @category Wallet API -*/ - export interface ITransactionsReplaceNoteRequest { -/** -* The id of account the transaction belongs to. -*/ - accountId: HexString, -/** -* The network id of the transaction. -*/ - networkId: NetworkId | string, -/** -* The id of the transaction. -*/ - transactionId: HexString, -/** -* Optional note string to replace the existing note. -* If not supplied, the note will be removed. -*/ - note?: string, + /** + * Emitted by {@link UtxoProcessor} when node is syncing headers as a part of the IBD (Initial Block Download) process. + * + * @category Wallet Events + */ + export interface ISyncHeadersEvent { + headers : number; + progress : number; } -/** -* Return interface for the {@link Wallet.transactionsDataGet} method. -* -* -* @category Wallet API -*/ - export interface ITransactionsDataGetResponse { - accountId : HexString; - transactions : ITransactionRecord[]; - start : bigint; - total : bigint; + /** + * Emitted by {@link UtxoProcessor} when node is syncing and processing cryptographic proofs. + * + * @category Wallet Events + */ + export interface ISyncProofEvent { + level : number; } -/** -* Argument interface for the {@link Wallet.transactionsDataGet} method. -* -* -* @category Wallet API -*/ - export interface ITransactionsDataGetRequest { - accountId : HexString; - networkId : NetworkId | string; - filter? : TransactionKind[]; - start : bigint; - end : bigint; + /** + * Emitted when detecting a general error condition. + * + * @category Wallet Events + */ + export interface IErrorEvent { + message : string; } -/** -* Return interface for the {@link Wallet.accountsEstimate} method. -* -* -* @category Wallet API -*/ - export interface IAccountsEstimateResponse { - generatorSummary : GeneratorSummary; + /** + * Emitted by {@link UtxoContext} when detecting a balance change. + * This notification is produced during the UTXO scan, when UtxoContext + * detects incoming or outgoing transactions or when transactions + * change their state (e.g. from pending to confirmed). + * + * @category Wallet Events + */ + export interface IBalanceEvent { + id : HexString; + balance? : IBalance; } -/** -* Argument interface for the {@link Wallet.accountsEstimate} method. -* -* -* @category Wallet API -*/ - export interface IAccountsEstimateRequest { - accountId : HexString; - destination : IPaymentOutput[]; - priorityFeeSompi : IFees | bigint; - payload? : Uint8Array | string; - } + /** + * Emitted by {@link UtxoContext} when detecting a new transaction during + * the initialization phase. Discovery transactions indicate that UTXOs + * have been discovered during the initial UTXO scan. + * + * When receiving such notifications, the application should check its + * internal storage to see if the transaction already exists. If it doesn't, + * it should create a correspond in record and notify the user of a new + * transaction. + * + * This event is emitted when an address has existing UTXO entries that + * may have been received during previous sessions or while the wallet + * was offline. + * + * @category Wallet Events + */ + export type IDiscoveryEvent = TransactionRecord; -/** -* Return interface for the {@link Wallet.accountsTransfer} method. -* -* -* @category Wallet API -*/ - export interface IAccountsTransferResponse { - generatorSummary : GeneratorSummary; - transactionIds : HexString[]; - } + /** + * Emitted by {@link UtxoContext} when transaction is considered to be confirmed. + * This notification will be followed by the "balance" event. + * + * @category Wallet Events + */ + export type IMaturityEvent = TransactionRecord; -/** -* Argument interface for the {@link Wallet.accountsTransfer} method. -* -* -* @category Wallet API -*/ - export interface IAccountsTransferRequest { - sourceAccountId : HexString; - destinationAccountId : HexString; - walletSecret : string; - paymentSecret? : string; - priorityFeeSompi? : IFees | bigint; - transferAmountSompi : bigint; - } + /** + * Emitted by {@link UtxoContext} when detecting a new coinbase transaction. + * Transactions are kept in "stasis" for the half of the coinbase maturity DAA period. + * A wallet should ignore these transactions until they are re-broadcasted + * via the "pending" event. + * + * @category Wallet Events + */ + export type IStasisEvent = TransactionRecord; -/** -* Return interface for the {@link Wallet.accountsSend} method. -* -* -* @category Wallet API -*/ - export interface IAccountsSendResponse { -/** -* Summary produced by the transaction generator. -*/ - generatorSummary : GeneratorSummary; -/** -* Hex identifiers of successfully submitted transactions. -*/ - transactionIds : HexString[]; - } + /** + * Emitted by {@link UtxoContext} when detecting a reorg transaction condition. + * A transaction is considered reorg if it has been removed from the UTXO set + * as a part of the network reorg process. Transactions notified with this event + * should be considered as invalid and should be removed from the application state. + * Associated UTXOs will be automatically removed from the UtxoContext state. + * + * @category Wallet Events + */ + export type IReorgEvent = TransactionRecord; -/** -* Argument interface for the {@link Wallet.accountsSend} method. -* -* -* @category Wallet API -*/ - export interface IAccountsSendRequest { -/** -* Hex identifier of the account. -*/ - accountId : HexString; -/** -* Wallet encryption secret. -*/ - walletSecret : string; -/** -* Optional key encryption secret or BIP39 passphrase. -*/ - paymentSecret? : string; -/** -* Priority fee. -*/ - priorityFeeSompi? : IFees | bigint; -/** -* -*/ - payload? : Uint8Array | HexString; -/** -* If not supplied, the destination will be the change address resulting in a UTXO compound transaction. -*/ - destination? : IPaymentOutput[]; - } + /** + * Emitted by {@link UtxoContext} when detecting a pending transaction. + * This notification will be followed by the "balance" event. + * + * @category Wallet Events + */ + export type IPendingEvent = TransactionRecord; -/** -* Return interface for the {@link Wallet.accountsCreateNewAddress} method. -* -* -* @category Wallet API -*/ - export interface IAccountsCreateNewAddressResponse { - address: Address; + /** + * Emitted by {@link UtxoProcessor} on DAA score change. + * + * @category Wallet Events + */ + export interface IDaaScoreChangeEvent { + currentDaaScore : number; } -/** -* Argument interface for the {@link Wallet.accountsCreateNewAddress} method. -* -* -* @category Wallet API -*/ - export interface IAccountsCreateNewAddressRequest { - accountId: string; - addressKind?: NewAddressKind | string, + /** + * Emitted by {@link UtxoProcessor} indicating a non-recoverable internal error. + * If such event is emitted, the application should stop the UtxoProcessor + * and restart all related subsystem. This event is emitted when the UtxoProcessor + * encounters a critical condition such as "out of memory". + * + * @category Wallet Events + */ + export interface IUtxoProcErrorEvent { + message : string; } -/** -* Return interface for the {@link Wallet.accountsGet} method. -* -* -* @category Wallet API -*/ - export interface IAccountsGetResponse { - accountDescriptor: IAccountDescriptor; + /** + * Emitted by {@link UtxoProcessor} after successfully opening an RPC + * connection to the Kaspa node. This event contains general information + * about the Kaspa node. + * + * @category Wallet Events + */ + export interface IServerStatusEvent { + networkId : string; + serverVersion : string; + isSynced : boolean; + url? : string; } -/** -* Argument interface for the {@link Wallet.accountsGet} method. -* -* -* @category Wallet API -*/ - export interface IAccountsGetRequest { - accountId: string; + /** + * Emitted by {@link Wallet} when an account data has been updated. + * This event signifies a chance in the internal account state that + * includes new address generation. + * + * @category Wallet Events + */ + export interface IAccountUpdateEvent { + accountDescriptor : IAccountDescriptor; } -/** -* Return interface for the {@link Wallet.accountsDeactivate} method. -* -* -* @category Wallet API -*/ - export interface IAccountsDeactivateResponse { } + /** + * Emitted by {@link Wallet} when an account has been created. + * + * @category Wallet Events + */ + export interface IAccountCreateEvent { + accountDescriptor : IAccountDescriptor; + } -/** -* Argument interface for the {@link Wallet.accountsDeactivate} method. -* -* -* @category Wallet API -*/ - export interface IAccountsDeactivateRequest { - accountIds?: string[]; + /** + * Emitted by {@link Wallet} when an account has been selected. + * This event is used internally in Rust SDK to track currently + * selected account in the Rust CLI wallet. + * + * @category Wallet Events + */ + export interface IAccountSelectionEvent { + id? : HexString; } -/** -* Return interface for the {@link Wallet.accountsActivate} method. -* -* -* @category Wallet API -*/ - export interface IAccountsActivateResponse { } + /** + * Emitted by {@link Wallet} when an account has been deactivated. + * + * @category Wallet Events + */ + export interface IAccountDeactivationEvent { + ids : HexString[]; + } -/** -* Argument interface for the {@link Wallet.accountsActivate} method. -* -* -* @category Wallet API -*/ - export interface IAccountsActivateRequest { - accountIds?: HexString[], + /** + * Emitted by {@link Wallet} when an account has been activated. + * + * @category Wallet Events + */ + export interface IAccountActivationEvent { + ids : HexString[]; } -/** -* Return interface for the {@link Wallet.accountsImport} method. -* -* -* @category Wallet API -*/ - export interface IAccountsImportResponse { - // TODO + /** + * Emitted by {@link Wallet} when the wallet has created a private key. + * + * @category Wallet Events + */ + export interface IPrvKeyDataCreateEvent { + prvKeyDataInfo : IPrvKeyDataInfo; } -/** -* Argument interface for the {@link Wallet.accountsImport} method. -* -* -* @category Wallet API -*/ - export interface IAccountsImportRequest { - walletSecret: string; - // TODO + /** + * Emitted by {@link Wallet} when an error occurs (for example, the wallet has failed to open). + * + * @category Wallet Events + */ + export interface IWalletErrorEvent { + message : string; } -/** -* Return interface for the {@link Wallet.accountsEnsureDefault} method. -* -* -* @category Wallet API -*/ - export interface IAccountsEnsureDefaultResponse { - accountDescriptor : IAccountDescriptor; + /** + * Emitted by {@link Wallet} when the wallet is successfully reloaded. + * + * @category Wallet Events + */ + export interface IWalletReloadEvent { + walletDescriptor : IWalletDescriptor; + accountDescriptors : IAccountDescriptor[]; } -/** -* Argument interface for the {@link Wallet.accountsEnsureDefault} method. -* -* -* @category Wallet API -*/ - export interface IAccountsEnsureDefaultRequest { - walletSecret: string; - paymentSecret?: string; - type : AccountKind | string; - mnemonic? : string; + /** + * Emitted by {@link Wallet} when the wallet data storage has been successfully created. + * + * @category Wallet Events + */ + export interface IWalletCreateEvent { + walletDescriptor : IWalletDescriptor; + storageDescriptor : IStorageDescriptor; } -/** -* Return interface for the {@link Wallet.accountsCreate} method. -* -* -* @category Wallet API -*/ - export interface IAccountsCreateResponse { - accountDescriptor : IAccountDescriptor; + /** + * Emitted by {@link Wallet} when the fee rate changes. + * + * @category Wallet Events + */ + export interface IFeeRateEvent { + priority: { + feerate: bigint, + seconds: bigint, + }, + normal: { + feerate: bigint, + seconds: bigint, + }, + low: { + feerate: bigint, + seconds: bigint, + }, } -/** -* Argument interface for the {@link Wallet.accountsCreate} method. -* -* -* @category Wallet API -*/ - export type IAccountsCreateRequest = { - walletSecret: string; - type: "bip32"; - accountName:string; - accountIndex?:number; - prvKeyDataId:string; - paymentSecret?:string; - }; - // |{ - // walletSecret: string; - // type: "multisig"; - // accountName:string; - // accountIndex?:number; - // prvKeyDataId:string; - // pubkeys:HexString[]; - // paymentSecret?:string; - // } - - // |{ - // walletSecret: string; - // type: "bip32-readonly"; - // accountName:string; - // accountIndex?:number; - // pubkey:HexString; - // paymentSecret?:string; - // } + /** + * Emitted by {@link Wallet} when the wallet is successfully opened. + * + * @category Wallet Events + */ + export interface IWalletOpenEvent { + walletDescriptor : IWalletDescriptor; + accountDescriptors : IAccountDescriptor[]; + } -/** -* Return interface for the {@link Wallet.accountsDiscovery} method. -* -* -* @category Wallet API -*/ - export interface IAccountsDiscoveryResponse { - lastAccountIndexFound : number; + /** + * Emitted by {@link Wallet} when it opens and contains an optional anti-phishing 'hint' set by the user. + * + * @category Wallet Events + */ + export interface IWalletHintEvent { + hint? : string; } -/** -* Argument interface for the {@link Wallet.accountsDiscovery} method. -* -* -* @category Wallet API -*/ - export interface IAccountsDiscoveryRequest { - discoveryKind: AccountsDiscoveryKind, - accountScanExtent: number, - addressScanExtent: number, - bip39_passphrase?: string, - bip39_mnemonic: string, + + /** + * + * @category Wallet Events + */ + export interface ISyncState { + event : string; + data? : ISyncProofEvent | ISyncHeadersEvent | ISyncBlocksEvent | ISyncUtxoSyncEvent | ISyncTrustSyncEvent; + } + + /** + * + * @category Wallet Events + */ + export interface ISyncStateEvent { + syncState : ISyncState; } -/** -* Return interface for the {@link Wallet.accountsRename} method. -* -* -* @category Wallet API -*/ - export interface IAccountsRenameResponse { } + /** + * Emitted by {@link UtxoProcessor} when it detects that connected node does not have UTXO index enabled. + * + * @category Wallet Events + */ + export interface IUtxoIndexNotEnabledEvent { + url? : string; + } + + + + /** + * Emitted by {@link UtxoProcessor} when it disconnects from RPC. + * + * @category Wallet Events + */ + export interface IDisconnectEvent { + networkId : string; + url? : string; + } + + + + /** + * Emitted by {@link UtxoProcessor} when it negotiates a successful RPC connection. + * + * @category Wallet Events + */ + export interface IConnectEvent { + networkId : string; + url? : string; + } + + /** + * Events emitted by the {@link Wallet}. + * @category Wallet API + */ + export enum WalletEventType { + Connect = "connect", + Disconnect = "disconnect", + UtxoIndexNotEnabled = "utxo-index-not-enabled", + SyncState = "sync-state", + WalletHint = "wallet-hint", + WalletOpen = "wallet-open", + WalletCreate = "wallet-create", + WalletReload = "wallet-reload", + WalletError = "wallet-error", + WalletClose = "wallet-close", + PrvKeyDataCreate = "prv-key-data-create", + AccountActivation = "account-activation", + AccountDeactivation = "account-deactivation", + AccountSelection = "account-selection", + AccountCreate = "account-create", + AccountUpdate = "account-update", + ServerStatus = "server-status", + UtxoProcStart = "utxo-proc-start", + UtxoProcStop = "utxo-proc-stop", + UtxoProcError = "utxo-proc-error", + DaaScoreChange = "daa-score-change", + Pending = "pending", + Reorg = "reorg", + Stasis = "stasis", + Maturity = "maturity", + Discovery = "discovery", + Balance = "balance", + Error = "error", + FeeRate = "fee-rate", + } + + /** + * Wallet notification event data map. + * @see {@link Wallet.addEventListener} + * @category Wallet API + */ + export type WalletEventMap = { + "connect": IConnectEvent, + "disconnect": IDisconnectEvent, + "utxo-index-not-enabled": IUtxoIndexNotEnabledEvent, + "sync-state": ISyncStateEvent, + "wallet-hint": IWalletHintEvent, + "wallet-open": IWalletOpenEvent, + "wallet-create": IWalletCreateEvent, + "wallet-reload": IWalletReloadEvent, + "wallet-error": IWalletErrorEvent, + "wallet-close": undefined, + "prv-key-data-create": IPrvKeyDataCreateEvent, + "account-activation": IAccountActivationEvent, + "account-deactivation": IAccountDeactivationEvent, + "account-selection": IAccountSelectionEvent, + "account-create": IAccountCreateEvent, + "account-update": IAccountUpdateEvent, + "server-status": IServerStatusEvent, + "utxo-proc-start": undefined, + "utxo-proc-stop": undefined, + "utxo-proc-error": IUtxoProcErrorEvent, + "daa-score-change": IDaaScoreChangeEvent, + "pending": IPendingEvent, + "reorg": IReorgEvent, + "stasis": IStasisEvent, + "maturity": IMaturityEvent, + "discovery": IDiscoveryEvent, + "balance": IBalanceEvent, + "error": IErrorEvent, + "fee-rate": IFeeRateEvent, + } + + /** + * {@link Wallet} notification event interface. + * @category Wallet API + */ + export type IWalletEvent = { + [K in T]: { + type: K, + data: WalletEventMap[K] + } + }[T]; + + + /** + * Wallet notification callback type. + * + * This type declares the callback function that is called when notification is emitted + * from the Wallet (and the underlying UtxoProcessor or UtxoContext subsystems). + * + * @see {@link Wallet} + * + * @category Wallet API + */ + export type WalletNotificationCallback = (event: IWalletEvent) => void; + + + + + /** + * Events emitted by the {@link UtxoProcessor}. + * @category Wallet SDK + */ + export enum UtxoProcessorEventType { + Connect = "connect", + Disconnect = "disconnect", + UtxoIndexNotEnabled = "utxo-index-not-enabled", + SyncState = "sync-state", + UtxoProcStart = "utxo-proc-start", + UtxoProcStop = "utxo-proc-stop", + UtxoProcError = "utxo-proc-error", + DaaScoreChange = "daa-score-change", + Pending = "pending", + Reorg = "reorg", + Stasis = "stasis", + Maturity = "maturity", + Discovery = "discovery", + Balance = "balance", + Error = "error", + } + + /** + * {@link UtxoProcessor} notification event data map. + * + * @category Wallet API + */ + export type UtxoProcessorEventMap = { + "connect": IConnectEvent, + "disconnect": IDisconnectEvent, + "utxo-index-not-enabled": IUtxoIndexNotEnabledEvent, + "sync-state": ISyncStateEvent, + "server-status": IServerStatusEvent, + "utxo-proc-start": undefined, + "utxo-proc-stop": undefined, + "utxo-proc-error": IUtxoProcErrorEvent, + "daa-score-change": IDaaScoreChangeEvent, + "pending": IPendingEvent, + "reorg": IReorgEvent, + "stasis": IStasisEvent, + "maturity": IMaturityEvent, + "discovery": IDiscoveryEvent, + "balance": IBalanceEvent, + "error": IErrorEvent + } + + /** + * + * @category Wallet API + */ + + export type UtxoProcessorEvent = { + [K in T]: { + type: K, + data: UtxoProcessorEventMap[K] + } + }[T]; + + /** + * {@link UtxoProcessor} notification callback type. + * + * This type declares the callback function that is called when notification is emitted + * from the UtxoProcessor or UtxoContext subsystems. + * + * @see {@link UtxoProcessor}, {@link UtxoContext}, + * + * @category Wallet SDK + */ + + export type UtxoProcessorNotificationCallback = (event: UtxoProcessorEvent) => void; + + + /** -* Argument interface for the {@link Wallet.accountsRename} method. +* Return interface for the {@link Wallet.accountsCommitRevealManual} method. * * * @category Wallet API */ - export interface IAccountsRenameRequest { - accountId: string; - name?: string; - walletSecret: string; + export interface IAccountsCommitRevealManualResponse { + transactionIds : HexString[]; } /** -* Return interface for the {@link Wallet.accountsEnumerate} method. +* Argument interface for the {@link Wallet.accountsCommitRevealManual} method. +* +* Atomic commit reveal operation using given payment outputs. +* +* The startDestination stands for the commit transaction and the endDestination +* for the reveal transaction. * +* The scriptSig will be used to spend the UTXO of the first transaction and +* must therefore match the startDestination output P2SH. +* +* Set revealFeeSompi or reflect the reveal fee transaction on endDestination +* output amount. +* +* The default revealFeeSompi is 100_000 sompi. * * @category Wallet API */ - export interface IAccountsEnumerateResponse { - accountDescriptors: IAccountDescriptor[]; + export interface IAccountsCommitRevealManualRequest { + accountId : HexString; + scriptSig : Uint8Array | HexString; + startDestination: IPaymentOutput; + endDestination: IPaymentOutput; + walletSecret : string; + paymentSecret? : string; + feeRate? : number; + revealFeeSompi : bigint; + payload? : Uint8Array | HexString; } /** -* Argument interface for the {@link Wallet.accountsEnumerate} method. +* Return interface for the {@link Wallet.accountsCommitReveal} method. * * * @category Wallet API */ - export interface IAccountsEnumerateRequest { } + export interface IAccountsCommitRevealResponse { + transactionIds : HexString[]; + } /** -* Return interface for the {@link Wallet.prvKeyDataGet} method. +* Argument interface for the {@link Wallet.accountsCommitReveal} method. +* +* Atomic commit reveal operation using parameterized account address to +* dynamically generate the commit P2SH address. +* +* The account address is selected through addressType and addressIndex +* and will be used to complete the script signature. +* +* A placeholder of format {{pubkey}} is to be provided inside ScriptSig +* in order to be superseded by the selected address' payload. * +* The selected address will also be used to spend reveal transaction to. +* +* The default revealFeeSompi is 100_000 sompi. * * @category Wallet API */ - export interface IPrvKeyDataGetResponse { - // prvKeyData: PrvKeyData, + export interface IAccountsCommitRevealRequest { + accountId : HexString; + addressType : CommitRevealAddressKind; + addressIndex : number; + scriptSig : Uint8Array | HexString; + walletSecret : string; + commitAmountSompi : bigint; + paymentSecret? : string; + feeRate? : number; + revealFeeSompi : bigint; + payload? : Uint8Array | HexString; } /** -* Argument interface for the {@link Wallet.prvKeyDataGet} method. +* Return interface for the {@link Wallet.addressBookEnumerate} method. * * * @category Wallet API */ - export interface IPrvKeyDataGetRequest { - walletSecret: string; - prvKeyDataId: HexString; + export interface IAddressBookEnumerateResponse { + // TODO } /** -* Return interface for the {@link Wallet.prvKeyDataRemove} method. +* Argument interface for the {@link Wallet.addressBookEnumerate} method. * * * @category Wallet API */ - export interface IPrvKeyDataRemoveResponse { } + export interface IAddressBookEnumerateRequest { } /** -* Argument interface for the {@link Wallet.prvKeyDataRemove} method. +* Return interface for the {@link Wallet.transactionsReplaceMetadata} method. * * * @category Wallet API */ - export interface IPrvKeyDataRemoveRequest { - walletSecret: string; - prvKeyDataId: HexString; - } + export interface ITransactionsReplaceMetadataResponse { } /** -* Return interface for the {@link Wallet.prvKeyDataCreate} method. +* Argument interface for the {@link Wallet.transactionsReplaceMetadata} method. +* Metadata is a wallet-specific string that can be used to store arbitrary data. +* It should contain a serialized JSON string with `key` containing the custom +* data stored by the wallet. When interacting with metadata, the wallet should +* always deserialize the JSON string and then serialize it again after making +* changes, preserving any foreign keys that it might encounter. * +* To preserve foreign metadata, the pattern of access should be: +* `Get -> Modify -> Replace` * * @category Wallet API */ - export interface IPrvKeyDataCreateResponse { - prvKeyDataId: HexString; - } - - - + export interface ITransactionsReplaceMetadataRequest { /** -* Argument interface for the {@link Wallet.prvKeyDataCreate} method. -* -* -* @category Wallet API +* The id of account the transaction belongs to. */ - export interface IPrvKeyDataCreateRequest { -/** Wallet encryption secret */ - walletSecret: string; -/** Optional name of the private key */ - name? : string; + accountId: HexString, /** -* Optional key secret (BIP39 passphrase). -* -* If supplied, all operations requiring access -* to the key will require the `paymentSecret` -* to be provided. +* The network id of the transaction. */ - paymentSecret? : string; -/** BIP39 mnemonic phrase (12 or 24 words)*/ - mnemonic : string; + networkId: NetworkId | string, +/** +* The id of the transaction. +*/ + transactionId: HexString, +/** +* Optional metadata string to replace the existing metadata. +* If not supplied, the metadata will be removed. +*/ + metadata?: string, } /** -* Return interface for the {@link Wallet.prvKeyDataEnumerate} method. +* Return interface for the {@link Wallet.transactionsReplaceNote} method. * -* Response returning a list of private key ids, their optional names and properties. * -* @see {@link IPrvKeyDataInfo} * @category Wallet API */ - export interface IPrvKeyDataEnumerateResponse { - prvKeyDataList: IPrvKeyDataInfo[], - } + export interface ITransactionsReplaceNoteResponse { } /** -* Argument interface for the {@link Wallet.prvKeyDataEnumerate} method. +* Argument interface for the {@link Wallet.transactionsReplaceNote} method. * * * @category Wallet API */ - export interface IPrvKeyDataEnumerateRequest { } + export interface ITransactionsReplaceNoteRequest { +/** +* The id of account the transaction belongs to. +*/ + accountId: HexString, +/** +* The network id of the transaction. +*/ + networkId: NetworkId | string, +/** +* The id of the transaction. +*/ + transactionId: HexString, +/** +* Optional note string to replace the existing note. +* If not supplied, the note will be removed. +*/ + note?: string, + } -/** -* Return interface for the {@link Wallet.walletImport} method. -* -* -* @category Wallet API -*/ - export interface IWalletImportResponse { } + /** + * + * + * @category Wallet API + */ + export interface INetworkParams { + coinbaseTransactionMaturityPeriodDaa : number; + coinbaseTransactionStasisPeriodDaa : number; + userTransactionMaturityPeriodDaa : number; + additionalCompoundTransactionMass : number; + } /** -* Argument interface for the {@link Wallet.walletImport} method. +* Return interface for the {@link Wallet.transactionsDataGet} method. * * * @category Wallet API */ - export interface IWalletImportRequest { - walletSecret: string; - walletData: HexString | Uint8Array; + export interface ITransactionsDataGetResponse { + accountId : HexString; + transactions : ITransactionRecord[]; + start : bigint; + total : bigint; } /** -* Return interface for the {@link Wallet.walletExport} method. +* Argument interface for the {@link Wallet.transactionsDataGet} method. * * * @category Wallet API */ - export interface IWalletExportResponse { - walletData: HexString; + export interface ITransactionsDataGetRequest { + accountId : HexString; + networkId : NetworkId | string; + filter? : TransactionKind[]; + start : bigint; + end : bigint; } -/** -* Argument interface for the {@link Wallet.walletExport} method. -* -* -* @category Wallet API -*/ - export interface IWalletExportRequest { - walletSecret: string; - includeTransactions: boolean; + export interface IFeeRatePollerDisableResponse { } + + + + export interface IFeeRatePollerDisableRequest { } + + + + export interface IFeeRatePollerEnableResponse { } + + + + export interface IFeeRatePollerEnableRequest { + intervalSeconds : number; } -/** -* Return interface for the {@link Wallet.walletChangeSecret} method. -* -* -* @category Wallet API -*/ - export interface IWalletChangeSecretResponse { } + export interface IFeeRateEstimateResponse { + priority : IFeeRateEstimateBucket, + normal : IFeeRateEstimateBucket, + low : IFeeRateEstimateBucket, + } -/** -* Argument interface for the {@link Wallet.walletChangeSecret} method. -* -* -* @category Wallet API -*/ - export interface IWalletChangeSecretRequest { - oldWalletSecret: string; - newWalletSecret: string; + export interface IFeeRateEstimateRequest { } + + + + export interface IFeeRateEstimateBucket { + feeRate : number; + seconds : number; } /** -* Return interface for the {@link Wallet.walletReload} method. +* Return interface for the {@link Wallet.accountsEstimate} method. * * * @category Wallet API */ - export interface IWalletReloadResponse { } + export interface IAccountsEstimateResponse { + generatorSummary : GeneratorSummary; + } /** -* Argument interface for the {@link Wallet.walletReload} method. +* Argument interface for the {@link Wallet.accountsEstimate} method. * * * @category Wallet API */ - export interface IWalletReloadRequest { -/** -* Reactivate accounts that are active before the reload. -*/ - reactivate: boolean; + export interface IAccountsEstimateRequest { + accountId : HexString; + destination : IPaymentOutput[]; + feeRate? : number; + priorityFeeSompi : IFees | bigint; + payload? : Uint8Array | string; } /** -* Return interface for the {@link Wallet.walletClose} method. +* Return interface for the {@link Wallet.accountsTransfer} method. * * * @category Wallet API */ - export interface IWalletCloseResponse { } + export interface IAccountsTransferResponse { + generatorSummary : GeneratorSummary; + transactionIds : HexString[]; + } /** -* Argument interface for the {@link Wallet.walletClose} method. +* Argument interface for the {@link Wallet.accountsTransfer} method. * * * @category Wallet API */ - export interface IWalletCloseRequest { } + export interface IAccountsTransferRequest { + sourceAccountId : HexString; + destinationAccountId : HexString; + walletSecret : string; + paymentSecret? : string; + feeRate? : number; + priorityFeeSompi? : IFees | bigint; + transferAmountSompi : bigint; + } /** -* Return interface for the {@link Wallet.walletOpen} method. +* Return interface for the {@link Wallet.accountsGetUtxos} method. * * * @category Wallet API */ - export interface IWalletOpenResponse { - accountDescriptors: IAccountDescriptor[]; + export interface IAccountsGetUtxosResponse { + utxos : UtxoEntry[]; } /** -* Argument interface for the {@link Wallet.walletOpen} method. +* Argument interface for the {@link Wallet.accountsGetUtxos} method. +* * * @category Wallet API */ - export interface IWalletOpenRequest { - walletSecret: string; - filename?: string; - accountDescriptors: boolean; + export interface IAccountsGetUtxosRequest { + accountId : HexString; + addresses : Address[] | string[]; + minAmountSompi? : bigint; } /** -* Return interface for the {@link Wallet.walletCreate} method. +* Return interface for the {@link Wallet.accountsPskbSend} method. * * * @category Wallet API */ - export interface IWalletCreateResponse { - walletDescriptor: IWalletDescriptor; - storageDescriptor: IStorageDescriptor; + export interface IAccountsPskbSendResponse { + transactionIds : HexString[]; } /** -* Argument interface for the {@link Wallet.walletCreate} method. +* Argument interface for the {@link Wallet.accountsPskbSend} method. * -* If filename is not supplied, the filename will be derived from the wallet title. -* If both wallet title and filename are not supplied, the wallet will be create -* with the default filename `kaspa`. * * @category Wallet API */ - export interface IWalletCreateRequest { -/** Wallet encryption secret */ - walletSecret: string; -/** Optional wallet title */ - title?: string; -/** Optional wallet filename */ - filename?: string; -/** Optional user hint */ - userHint?: string; + export interface IAccountsPskbSendRequest { /** -* Overwrite wallet data if the wallet with the same filename already exists. -* (Use with caution!) +* Hex identifier of the account. */ - overwriteWalletStorage?: boolean; - } - + accountId : HexString; +/** +* Wallet encryption secret. +*/ + walletSecret : string; +/** +* Optional key encryption secret or BIP39 passphrase. +*/ + paymentSecret? : string; +/** +* PSKB to sign. +*/ + pskb : string; /** -* Return interface for the {@link Wallet.walletEnumerate} method. -* -* -* @category Wallet API +* Address to sign for. */ - export interface IWalletEnumerateResponse { - walletDescriptors: WalletDescriptor[]; + signForAddress? : Address | string; } /** -* Argument interface for the {@link Wallet.walletEnumerate} method. +* Return interface for the {@link Wallet.accountsPskbBroadcast} method. * * * @category Wallet API */ - export interface IWalletEnumerateRequest { } + export interface IAccountsPskbBroadcastResponse { + transactionIds : HexString[]; + } /** -* Return interface for the {@link Wallet.retainContext} method. +* Argument interface for the {@link Wallet.accountsPskbBroadcast} method. * * * @category Wallet API */ - export interface IRetainContextResponse { + export interface IAccountsPskbBroadcastRequest { + accountId : HexString; + pskb : string; } /** -* Argument interface for the {@link Wallet.retainContext} method. +* Return interface for the {@link Wallet.accountsPskbSign} method. * * * @category Wallet API */ - export interface IRetainContextRequest { -/** -* Optional context creation name. -*/ - name : string; + export interface IAccountsPskbSignResponse { /** -* Optional context data to retain. +* signed PSKB. */ - data? : string; + pskb: string; } /** -* Return interface for the {@link Wallet.getStatus} method. +* Argument interface for the {@link Wallet.accountsPskbSign} method. * * * @category Wallet API */ - export interface IGetStatusResponse { - isConnected : boolean; - isSynced : boolean; - isOpen : boolean; - url? : string; - networkId? : NetworkId; - context? : HexString; + export interface IAccountsPskbSignRequest { +/** +* Hex identifier of the account. +*/ + accountId : HexString; +/** +* Wallet encryption secret. +*/ + walletSecret : string; +/** +* Optional key encryption secret or BIP39 passphrase. +*/ + paymentSecret? : string; + +/** +* PSKB to sign. +*/ + pskb : string; + +/** +* Address to sign for. +*/ + signForAddress? : Address | string; } /** -* Argument interface for the {@link Wallet.getStatus} method. +* Return interface for the {@link Wallet.accountsSend} method. * * * @category Wallet API */ - export interface IGetStatusRequest { + export interface IAccountsSendResponse { /** -* Optional context creation name. -* @see {@link IRetainContextRequest} +* Summary produced by the transaction generator. */ - name? : string; + generatorSummary : GeneratorSummary; +/** +* Hex identifiers of successfully submitted transactions. +*/ + transactionIds : HexString[]; } /** -* Return interface for the {@link Wallet.disconnect} method. +* Argument interface for the {@link Wallet.accountsSend} method. * * * @category Wallet API */ - export interface IDisconnectResponse { } + export interface IAccountsSendRequest { +/** +* Hex identifier of the account. +*/ + accountId : HexString; +/** +* Wallet encryption secret. +*/ + walletSecret : string; +/** +* Optional key encryption secret or BIP39 passphrase. +*/ + paymentSecret? : string; +/** +* Fee rate in sompi per 1 gram of mass. +*/ + feeRate? : number; +/** +* Priority fee. +*/ + priorityFeeSompi? : IFees | bigint; +/** +* +*/ + payload? : Uint8Array | HexString; +/** +* If not supplied, the destination will be the change address resulting in a UTXO compound transaction. +*/ + destination? : IPaymentOutput[]; + } /** -* Argument interface for the {@link Wallet.disconnect} method. +* Return interface for the {@link Wallet.accountsCreateNewAddress} method. * * * @category Wallet API */ - export interface IDisconnectRequest { } + export interface IAccountsCreateNewAddressResponse { + address: Address; + } /** -* Return interface for the {@link Wallet.connect} method. +* Argument interface for the {@link Wallet.accountsCreateNewAddress} method. * * * @category Wallet API */ - export interface IConnectResponse { } + export interface IAccountsCreateNewAddressRequest { + accountId: string; + addressKind?: NewAddressKind | string, + } /** -* Argument interface for the {@link Wallet.connect} method. +* Return interface for the {@link Wallet.accountsGet} method. * * * @category Wallet API */ - export interface IConnectRequest { - // destination wRPC node URL (if omitted, the resolver is used) - url? : string; - // network identifier - networkId : NetworkId | string; - // retry on error - retryOnError? : boolean; - // block async connect (method will not return until the connection is established) - block? : boolean; - // require node to be synced (fail otherwise) - requireSync? : boolean; + export interface IAccountsGetResponse { + accountDescriptor: IAccountDescriptor; } /** -* Return interface for the {@link Wallet.flush} method. +* Argument interface for the {@link Wallet.accountsGet} method. * * * @category Wallet API */ - export interface IFlushResponse { } + export interface IAccountsGetRequest { + accountId: string; + } /** -* Argument interface for the {@link Wallet.flush} method. +* Return interface for the {@link Wallet.accountsDeactivate} method. * * * @category Wallet API */ - export interface IFlushRequest { - walletSecret : string; - } + export interface IAccountsDeactivateResponse { } /** -* Return interface for the {@link Wallet.batch} method. +* Argument interface for the {@link Wallet.accountsDeactivate} method. * * * @category Wallet API */ - export interface IBatchResponse { } + export interface IAccountsDeactivateRequest { + accountIds?: string[]; + } /** -* Argument interface for the {@link Wallet.batch} method. -* Suspend storage operations until invocation of flush(). +* Return interface for the {@link Wallet.accountsActivate} method. +* * * @category Wallet API */ - export interface IBatchRequest { } + export interface IAccountsActivateResponse { } /** - * @categoryDescription Wallet API - * Wallet API for interfacing with Rusty Kaspa Wallet implementation. - */ - - - - /** - * Private key data information. - * @category Wallet API - */ - export interface IPrvKeyDataInfo { - /** Deterministic wallet id of the private key */ - id: HexString; - /** Optional name of the private key */ - name?: string; - /** - * Indicates if the key requires additional payment or a recovery secret - * to perform wallet operations that require access to it. - * For BIP39 keys this indicates that the key was created with a BIP39 passphrase. - */ - isEncrypted: boolean; +* Argument interface for the {@link Wallet.accountsActivate} method. +* +* +* @category Wallet API +*/ + export interface IAccountsActivateRequest { + accountIds?: HexString[], } /** - * - * Defines a single payment output. - * - * @see {@link IGeneratorSettingsObject}, {@link Generator} - * @category Wallet SDK - */ -export interface IPaymentOutput { - /** - * Destination address. The address prefix must match the network - * you are transacting on (e.g. `kaspa:` for mainnet, `kaspatest:` for testnet, etc). - */ - address: Address | string; - /** - * Output amount in SOMPI. - */ - amount: bigint; -} - +* Return interface for the {@link Wallet.accountsImport} method. +* +* +* @category Wallet API +*/ + export interface IAccountsImportResponse { + // TODO + } + - interface UtxoProcessor { - /** - * @param {UtxoProcessorNotificationCallback} callback - */ - addEventListener(callback: UtxoProcessorNotificationCallback): void; - /** - * @param {UtxoProcessorEventType} event - * @param {UtxoProcessorNotificationCallback} [callback] - */ - addEventListener( - event: E, - callback: UtxoProcessorNotificationCallback - ) - } +/** +* Argument interface for the {@link Wallet.accountsImport} method. +* +* +* @category Wallet API +*/ + export interface IAccountsImportRequest { + walletSecret: string; + // TODO + } + - /** - * UtxoProcessor constructor arguments. - * - * @see {@link UtxoProcessor}, {@link UtxoContext}, {@link RpcClient}, {@link NetworkId} - * @category Wallet SDK - */ - export interface IUtxoProcessorArgs { - /** - * The RPC client to use for network communication. - */ - rpc : RpcClient; - networkId : NetworkId | string; +/** +* Return interface for the {@link Wallet.accountsEnsureDefault} method. +* +* +* @category Wallet API +*/ + export interface IAccountsEnsureDefaultResponse { + accountDescriptor : IAccountDescriptor; } /** - * Interface declaration for {@link verifyMessage} function arguments. - * - * @category Message Signing - */ -export interface IVerifyMessage { - message: string; - signature: HexString; - publicKey: PublicKey | string; -} - +* Argument interface for the {@link Wallet.accountsEnsureDefault} method. +* +* +* @category Wallet API +*/ + export interface IAccountsEnsureDefaultRequest { + walletSecret: string; + paymentSecret?: string; + type : AccountKind | string; + mnemonic? : string; + } + /** - * Interface declaration for {@link signMessage} function arguments. - * - * @category Message Signing - */ -export interface ISignMessage { - message: string; - privateKey: PrivateKey | string; - noAuxRand?: boolean; -} - +* Return interface for the {@link Wallet.accountsCreate} method. +* +* +* @category Wallet API +*/ + export interface IAccountsCreateResponse { + accountDescriptor : IAccountDescriptor; + } + - -export interface IPrvKeyDataArgs { - prvKeyDataId: HexString; - paymentSecret?: string; -} - -export interface IAccountCreateArgsBip32 { - accountName?: string; - accountIndex?: number; -} - /** - * @category Wallet API - */ -export interface IAccountCreateArgs { - type : "bip32"; - args : IAccountCreateArgsBip32; - prvKeyDataArgs? : IPrvKeyDataArgs; -} - - - +* Argument interface for the {@link Wallet.accountsCreate} method. +* +* +* @category Wallet API +*/ + export type IAccountsCreateRequest = { + walletSecret: string; + type: "bip32"; + accountName:string; + accountIndex?:number; + prvKeyDataId:string; + paymentSecret?:string; + } | { + walletSecret: string; + type: "kaspa-keypair-standard"; + accountName:string; + prvKeyDataId:string; + paymentSecret?:string; + ecdsa?:boolean; + }; + // |{ + // walletSecret: string; + // type: "bip32-readonly"; + // accountName:string; + // accountIndex?:number; + // pubkey:HexString; + // paymentSecret?:string; + // } + - /** - * Interface defining response from the {@link createTransactions} function. - * - * @category Wallet SDK - */ - export interface ICreateTransactions { - /** - * Array of pending unsigned transactions. - */ - transactions : PendingTransaction[]; - /** - * Summary of the transaction generation process. - */ - summary : GeneratorSummary; +/** +* Return interface for the {@link Wallet.accountsDiscovery} method. +* +* +* @category Wallet API +*/ + export interface IAccountsDiscoveryResponse { + lastAccountIndexFound : number; } - -/** - * Type of a binding record. - * @see {@link IBinding}, {@link ITransactionDataVariant}, {@link ITransactionRecord} - * @category Wallet SDK - */ -export enum BindingType { - /** - * The data structure is associated with a user-supplied id. - * @see {@link IBinding} - */ - Custom = "custom", - /** - * The data structure is associated with a wallet account. - * @see {@link IBinding}, {@link Account} - */ - Account = "account", -} - /** - * Internal transaction data contained within the transaction record. - * @see {@link ITransactionRecord} - * @category Wallet SDK - */ -export interface IBinding { - type : BindingType; - data : HexString; -} - +* Argument interface for the {@link Wallet.accountsDiscovery} method. +* +* +* @category Wallet API +*/ + export interface IAccountsDiscoveryRequest { + discoveryKind: AccountsDiscoveryKind, + accountScanExtent: number, + addressScanExtent: number, + bip39_passphrase?: string, + bip39_mnemonic: string, + } + /** - * - * - * @category Wallet SDK - * - */ -export enum TransactionKind { - Reorg = "reorg", - Stasis = "stasis", - Batch = "batch", - Change = "change", - Incoming = "incoming", - Outgoing = "outgoing", - External = "external", - TransferIncoming = "transfer-incoming", - TransferOutgoing = "transfer-outgoing", -} - +* Return interface for the {@link Wallet.accountsRename} method. +* +* +* @category Wallet API +*/ + export interface IAccountsRenameResponse { } + /** - * {@link UtxoContext} (wallet account) balance. - * @category Wallet SDK - */ -export interface IBalance { - /** - * Total amount of Kaspa (in SOMPI) available for - * spending. - */ - mature: bigint; - /** - * Total amount of Kaspa (in SOMPI) that has been - * received and is pending confirmation. - */ - pending: bigint; - /** - * Total amount of Kaspa (in SOMPI) currently - * being sent as a part of the outgoing transaction - * but has not yet been accepted by the network. - */ - outgoing: bigint; - /** - * Number of UTXOs available for spending. - */ - matureUtxoCount: number; - /** - * Number of UTXOs that have been received and - * are pending confirmation. - */ - pendingUtxoCount: number; - /** - * Number of UTXOs currently in stasis (coinbase - * transactions received as a result of mining). - * Unlike regular user transactions, coinbase - * transactions go through `stasis->pending->mature` - * stages. Client applications should ignore `stasis` - * stages and should process transactions only when - * they have reached the `pending` stage. However, - * `stasis` information can be used for informative - * purposes to indicate that coinbase transactions - * have arrived. - */ - stasisUtxoCount: number; -} - +* Argument interface for the {@link Wallet.accountsRename} method. +* +* +* @category Wallet API +*/ + export interface IAccountsRenameRequest { + accountId: string; + name?: string; + walletSecret: string; + } + - /** - * Emitted by {@link UtxoProcessor} when node is syncing cryptographic trust data as a part of the IBD (Initial Block Download) process. - * - * @category Wallet Events - */ - export interface ISyncTrustSyncEvent { - processed : number; - total : number; +/** +* Return interface for the {@link Wallet.accountsEnumerate} method. +* +* +* @category Wallet API +*/ + export interface IAccountsEnumerateResponse { + accountDescriptors: IAccountDescriptor[]; } - /** - * Emitted by {@link UtxoProcessor} when node is syncing the UTXO set as a part of the IBD (Initial Block Download) process. - * - * @category Wallet Events - */ - export interface ISyncUtxoSyncEvent { - chunks : number; - total : number; - } +/** +* Argument interface for the {@link Wallet.accountsEnumerate} method. +* +* +* @category Wallet API +*/ + export interface IAccountsEnumerateRequest { } - /** - * Emitted by {@link UtxoProcessor} when node is syncing blocks as a part of the IBD (Initial Block Download) process. - * - * @category Wallet Events - */ - export interface ISyncBlocksEvent { - blocks : number; - progress : number; +/** +* Return interface for the {@link Wallet.prvKeyDataGet} method. +* +* +* @category Wallet API +*/ + export interface IPrvKeyDataGetResponse { + // prvKeyData: PrvKeyData, } - /** - * Emitted by {@link UtxoProcessor} when node is syncing headers as a part of the IBD (Initial Block Download) process. - * - * @category Wallet Events - */ - export interface ISyncHeadersEvent { - headers : number; - progress : number; +/** +* Argument interface for the {@link Wallet.prvKeyDataGet} method. +* +* +* @category Wallet API +*/ + export interface IPrvKeyDataGetRequest { + walletSecret: string; + prvKeyDataId: HexString; } - /** - * Emitted by {@link UtxoProcessor} when node is syncing and processing cryptographic proofs. - * - * @category Wallet Events - */ - export interface ISyncProofEvent { - level : number; - } +/** +* Return interface for the {@link Wallet.prvKeyDataRemove} method. +* +* +* @category Wallet API +*/ + export interface IPrvKeyDataRemoveResponse { } - /** - * Emitted when detecting a general error condition. - * - * @category Wallet Events - */ - export interface IErrorEvent { - message : string; +/** +* Argument interface for the {@link Wallet.prvKeyDataRemove} method. +* +* +* @category Wallet API +*/ + export interface IPrvKeyDataRemoveRequest { + walletSecret: string; + prvKeyDataId: HexString; } - /** - * Emitted by {@link UtxoContext} when detecting a balance change. - * This notification is produced during the UTXO scan, when UtxoContext - * detects incoming or outgoing transactions or when transactions - * change their state (e.g. from pending to confirmed). - * - * @category Wallet Events - */ - export interface IBalanceEvent { - id : HexString; - balance? : IBalance; +/** +* Return interface for the {@link Wallet.prvKeyDataCreate} method. +* +* +* @category Wallet API +*/ + export interface IPrvKeyDataCreateResponse { + prvKeyDataId: HexString; } - /** - * Emitted by {@link UtxoContext} when detecting a new transaction during - * the initialization phase. Discovery transactions indicate that UTXOs - * have been discovered during the initial UTXO scan. - * - * When receiving such notifications, the application should check its - * internal storage to see if the transaction already exists. If it doesn't, - * it should create a correspond in record and notify the user of a new - * transaction. - * - * This event is emitted when an address has existing UTXO entries that - * may have been received during previous sessions or while the wallet - * was offline. - * - * @category Wallet Events - */ - export type IDiscoveryEvent = TransactionRecord; - - - - /** - * Emitted by {@link UtxoContext} when transaction is considered to be confirmed. - * This notification will be followed by the "balance" event. - * - * @category Wallet Events - */ - export type IMaturityEvent = TransactionRecord; +/** +* Argument interface for the {@link Wallet.prvKeyDataCreate} method. +* +* +* @category Wallet API +*/ + export interface IPrvKeyDataCreateRequest { +/** Wallet encryption secret */ + walletSecret: string; +/** Optional name of the private key */ + name? : string; +/** +* Optional key secret (BIP39 passphrase). +* +* If supplied, all operations requiring access +* to the key will require the `paymentSecret` +* to be provided. +*/ + paymentSecret? : string; +/** BIP39 mnemonic phrase (12 or 24 words) if kind is mnemonic */ + mnemonic? : string; +/** Secret key if kind is secretKey */ + secretKey? : string; +/** Kind of the private key data */ + kind : "mnemonic" | "secretKey"; + } - /** - * Emitted by {@link UtxoContext} when detecting a new coinbase transaction. - * Transactions are kept in "stasis" for the half of the coinbase maturity DAA period. - * A wallet should ignore these transactions until they are re-broadcasted - * via the "pending" event. - * - * @category Wallet Events - */ - export type IStasisEvent = TransactionRecord; +/** +* Return interface for the {@link Wallet.prvKeyDataEnumerate} method. +* +* Response returning a list of private key ids, their optional names and properties. +* +* @see {@link IPrvKeyDataInfo} +* @category Wallet API +*/ + export interface IPrvKeyDataEnumerateResponse { + prvKeyDataList: IPrvKeyDataInfo[], + } - /** - * Emitted by {@link UtxoContext} when detecting a reorg transaction condition. - * A transaction is considered reorg if it has been removed from the UTXO set - * as a part of the network reorg process. Transactions notified with this event - * should be considered as invalid and should be removed from the application state. - * Associated UTXOs will be automatically removed from the UtxoContext state. - * - * @category Wallet Events - */ - export type IReorgEvent = TransactionRecord; +/** +* Argument interface for the {@link Wallet.prvKeyDataEnumerate} method. +* +* +* @category Wallet API +*/ + export interface IPrvKeyDataEnumerateRequest { } - /** - * Emitted by {@link UtxoContext} when detecting a pending transaction. - * This notification will be followed by the "balance" event. - * - * @category Wallet Events - */ - export type IPendingEvent = TransactionRecord; +/** +* Return interface for the {@link Wallet.walletImport} method. +* +* +* @category Wallet API +*/ + export interface IWalletImportResponse { } - /** - * Emitted by {@link UtxoProcessor} on DAA score change. - * - * @category Wallet Events - */ - export interface IDaaScoreChangeEvent { - currentDaaScore : number; +/** +* Argument interface for the {@link Wallet.walletImport} method. +* +* +* @category Wallet API +*/ + export interface IWalletImportRequest { + walletSecret: string; + walletData: HexString | Uint8Array; } - /** - * Emitted by {@link UtxoProcessor} indicating a non-recoverable internal error. - * If such event is emitted, the application should stop the UtxoProcessor - * and restart all related subsystem. This event is emitted when the UtxoProcessor - * encounters a critical condition such as "out of memory". - * - * @category Wallet Events - */ - export interface IUtxoProcErrorEvent { - message : string; +/** +* Return interface for the {@link Wallet.walletExport} method. +* +* +* @category Wallet API +*/ + export interface IWalletExportResponse { + walletData: HexString; } - /** - * Emitted by {@link UtxoProcessor} after successfully opening an RPC - * connection to the Kaspa node. This event contains general information - * about the Kaspa node. - * - * @category Wallet Events - */ - export interface IServerStatusEvent { - networkId : string; - serverVersion : string; - isSynced : boolean; - url? : string; +/** +* Argument interface for the {@link Wallet.walletExport} method. +* +* +* @category Wallet API +*/ + export interface IWalletExportRequest { + walletSecret: string; + includeTransactions: boolean; } - /** - * Emitted by {@link Wallet} when an account data has been updated. - * This event signifies a chance in the internal account state that - * includes new address generation. - * - * @category Wallet Events - */ - export interface IAccountUpdateEvent { - accountDescriptor : IAccountDescriptor; - } +/** +* Return interface for the {@link Wallet.walletChangeSecret} method. +* +* +* @category Wallet API +*/ + export interface IWalletChangeSecretResponse { } - /** - * Emitted by {@link Wallet} when an account has been created. - * - * @category Wallet Events - */ - export interface IAccountCreateEvent { - accountDescriptor : IAccountDescriptor; +/** +* Argument interface for the {@link Wallet.walletChangeSecret} method. +* +* +* @category Wallet API +*/ + export interface IWalletChangeSecretRequest { + oldWalletSecret: string; + newWalletSecret: string; } - /** - * Emitted by {@link Wallet} when an account has been selected. - * This event is used internally in Rust SDK to track currently - * selected account in the Rust CLI wallet. - * - * @category Wallet Events - */ - export interface IAccountSelectionEvent { - id? : HexString; - } +/** +* Return interface for the {@link Wallet.walletReload} method. +* +* +* @category Wallet API +*/ + export interface IWalletReloadResponse { } - /** - * Emitted by {@link Wallet} when an account has been deactivated. - * - * @category Wallet Events - */ - export interface IAccountDeactivationEvent { - ids : HexString[]; +/** +* Argument interface for the {@link Wallet.walletReload} method. +* +* +* @category Wallet API +*/ + export interface IWalletReloadRequest { +/** +* Reactivate accounts that are active before the reload. +*/ + reactivate: boolean; } - /** - * Emitted by {@link Wallet} when an account has been activated. - * - * @category Wallet Events - */ - export interface IAccountActivationEvent { - ids : HexString[]; - } +/** +* Return interface for the {@link Wallet.walletClose} method. +* +* +* @category Wallet API +*/ + export interface IWalletCloseResponse { } - /** - * Emitted by {@link Wallet} when the wallet has created a private key. - * - * @category Wallet Events - */ - export interface IPrvKeyDataCreateEvent { - prvKeyDataInfo : IPrvKeyDataInfo; - } +/** +* Argument interface for the {@link Wallet.walletClose} method. +* +* +* @category Wallet API +*/ + export interface IWalletCloseRequest { } - /** - * Emitted by {@link Wallet} when an error occurs (for example, the wallet has failed to open). - * - * @category Wallet Events - */ - export interface IWalletErrorEvent { - message : string; +/** +* Return interface for the {@link Wallet.walletOpen} method. +* +* +* @category Wallet API +*/ + export interface IWalletOpenResponse { + accountDescriptors: IAccountDescriptor[]; } - /** - * Emitted by {@link Wallet} when the wallet is successfully reloaded. - * - * @category Wallet Events - */ - export interface IWalletReloadEvent { - walletDescriptor : IWalletDescriptor; - accountDescriptors : IAccountDescriptor[]; +/** +* Argument interface for the {@link Wallet.walletOpen} method. +* +* @category Wallet API +*/ + export interface IWalletOpenRequest { + walletSecret: string; + filename?: string; + accountDescriptors: boolean; } - /** - * Emitted by {@link Wallet} when the wallet data storage has been successfully created. - * - * @category Wallet Events - */ - export interface IWalletCreateEvent { - walletDescriptor : IWalletDescriptor; - storageDescriptor : IStorageDescriptor; +/** +* Return interface for the {@link Wallet.walletCreate} method. +* +* +* @category Wallet API +*/ + export interface IWalletCreateResponse { + walletDescriptor: IWalletDescriptor; + storageDescriptor: IStorageDescriptor; } - /** - * Emitted by {@link Wallet} when the wallet is successfully opened. - * - * @category Wallet Events - */ - export interface IWalletOpenEvent { - walletDescriptor : IWalletDescriptor; - accountDescriptors : IAccountDescriptor[]; +/** +* Argument interface for the {@link Wallet.walletCreate} method. +* +* If filename is not supplied, the filename will be derived from the wallet title. +* If both wallet title and filename are not supplied, the wallet will be create +* with the default filename `kaspa`. +* +* @category Wallet API +*/ + export interface IWalletCreateRequest { +/** Wallet encryption secret */ + walletSecret: string; +/** Optional wallet title */ + title?: string; +/** Optional wallet filename */ + filename?: string; +/** Optional user hint */ + userHint?: string; +/** +* Overwrite wallet data if the wallet with the same filename already exists. +* (Use with caution!) +*/ + overwriteWalletStorage?: boolean; } - /** - * Emitted by {@link Wallet} when it opens and contains an optional anti-phishing 'hint' set by the user. - * - * @category Wallet Events - */ - export interface IWalletHintEvent { - hint? : string; +/** +* Return interface for the {@link Wallet.walletEnumerate} method. +* +* +* @category Wallet API +*/ + export interface IWalletEnumerateResponse { + walletDescriptors: WalletDescriptor[]; } +/** +* Argument interface for the {@link Wallet.walletEnumerate} method. +* +* +* @category Wallet API +*/ + export interface IWalletEnumerateRequest { } + + - /** - * - * @category Wallet Events - */ - export interface ISyncState { - event : string; - data? : ISyncProofEvent | ISyncHeadersEvent | ISyncBlocksEvent | ISyncUtxoSyncEvent | ISyncTrustSyncEvent; +/** +* Return interface for the {@link Wallet.retainContext} method. +* +* +* @category Wallet API +*/ + export interface IRetainContextResponse { } - /** - * - * @category Wallet Events - */ - export interface ISyncStateEvent { - syncState : ISyncState; + + +/** +* Argument interface for the {@link Wallet.retainContext} method. +* +* +* @category Wallet API +*/ + export interface IRetainContextRequest { +/** +* Optional context creation name. +*/ + name : string; +/** +* Optional context data to retain. +*/ + data? : string; } - /** - * Emitted by {@link UtxoProcessor} when it detects that connected node does not have UTXO index enabled. - * - * @category Wallet Events - */ - export interface IUtxoIndexNotEnabledEvent { +/** +* Return interface for the {@link Wallet.getStatus} method. +* +* +* @category Wallet API +*/ + export interface IGetStatusResponse { + isConnected : boolean; + isSynced : boolean; + isOpen : boolean; url? : string; + networkId? : NetworkId; + context? : HexString; } - /** - * Emitted by {@link UtxoProcessor} when it disconnects from RPC. - * - * @category Wallet Events - */ - export interface IDisconnectEvent { - networkId : string; - url? : string; +/** +* Argument interface for the {@link Wallet.getStatus} method. +* +* +* @category Wallet API +*/ + export interface IGetStatusRequest { +/** +* Optional context creation name. +* @see {@link IRetainContextRequest} +*/ + name? : string; } - /** - * Emitted by {@link UtxoProcessor} when it negotiates a successful RPC connection. - * - * @category Wallet Events - */ - export interface IConnectEvent { - networkId : string; - url? : string; - } +/** +* Return interface for the {@link Wallet.disconnect} method. +* +* +* @category Wallet API +*/ + export interface IDisconnectResponse { } +/** +* Argument interface for the {@link Wallet.disconnect} method. +* +* +* @category Wallet API +*/ + export interface IDisconnectRequest { } + - /** - * Events emitted by the {@link Wallet}. - * @category Wallet API - */ - export enum WalletEventType { - Connect = "connect", - Disconnect = "disconnect", - UtxoIndexNotEnabled = "utxo-index-not-enabled", - SyncState = "sync-state", - WalletHint = "wallet-hint", - WalletOpen = "wallet-open", - WalletCreate = "wallet-create", - WalletReload = "wallet-reload", - WalletError = "wallet-error", - WalletClose = "wallet-close", - PrvKeyDataCreate = "prv-key-data-create", - AccountActivation = "account-activation", - AccountDeactivation = "account-deactivation", - AccountSelection = "account-selection", - AccountCreate = "account-create", - AccountUpdate = "account-update", - ServerStatus = "server-status", - UtxoProcStart = "utxo-proc-start", - UtxoProcStop = "utxo-proc-stop", - UtxoProcError = "utxo-proc-error", - DaaScoreChange = "daa-score-change", - Pending = "pending", - Reorg = "reorg", - Stasis = "stasis", - Maturity = "maturity", - Discovery = "discovery", - Balance = "balance", - Error = "error", - } - /** - * Wallet notification event data map. - * @see {@link Wallet.addEventListener} - * @category Wallet API - */ - export type WalletEventMap = { - "connect": IConnectEvent, - "disconnect": IDisconnectEvent, - "utxo-index-not-enabled": IUtxoIndexNotEnabledEvent, - "sync-state": ISyncStateEvent, - "wallet-hint": IWalletHintEvent, - "wallet-open": IWalletOpenEvent, - "wallet-create": IWalletCreateEvent, - "wallet-reload": IWalletReloadEvent, - "wallet-error": IWalletErrorEvent, - "wallet-close": undefined, - "prv-key-data-create": IPrvKeyDataCreateEvent, - "account-activation": IAccountActivationEvent, - "account-deactivation": IAccountDeactivationEvent, - "account-selection": IAccountSelectionEvent, - "account-create": IAccountCreateEvent, - "account-update": IAccountUpdateEvent, - "server-status": IServerStatusEvent, - "utxo-proc-start": undefined, - "utxo-proc-stop": undefined, - "utxo-proc-error": IUtxoProcErrorEvent, - "daa-score-change": IDaaScoreChangeEvent, - "pending": IPendingEvent, - "reorg": IReorgEvent, - "stasis": IStasisEvent, - "maturity": IMaturityEvent, - "discovery": IDiscoveryEvent, - "balance": IBalanceEvent, - "error": IErrorEvent, - } - - /** - * {@link Wallet} notification event interface. - * @category Wallet API - */ - export type IWalletEvent = { - [K in T]: { - type: K, - data: WalletEventMap[K] - } - }[T]; +/** +* Return interface for the {@link Wallet.connect} method. +* +* +* @category Wallet API +*/ + export interface IConnectResponse { } + - /** - * Wallet notification callback type. - * - * This type declares the callback function that is called when notification is emitted - * from the Wallet (and the underlying UtxoProcessor or UtxoContext subsystems). - * - * @see {@link Wallet} - * - * @category Wallet API - */ - export type WalletNotificationCallback = (event: IWalletEvent) => void; - +/** +* Argument interface for the {@link Wallet.connect} method. +* +* +* @category Wallet API +*/ + export interface IConnectRequest { + // destination wRPC node URL (if omitted, the resolver is used) + url? : string; + // network identifier + networkId : NetworkId | string; + // retry on error + retryOnError? : boolean; + // block async connect (method will not return until the connection is established) + block? : boolean; + // require node to be synced (fail otherwise) + requireSync? : boolean; + } + +/** +* Return interface for the {@link Wallet.flush} method. +* +* +* @category Wallet API +*/ + export interface IFlushResponse { } + - /** - * Events emitted by the {@link UtxoProcessor}. - * @category Wallet SDK - */ - export enum UtxoProcessorEventType { - Connect = "connect", - Disconnect = "disconnect", - UtxoIndexNotEnabled = "utxo-index-not-enabled", - SyncState = "sync-state", - UtxoProcStart = "utxo-proc-start", - UtxoProcStop = "utxo-proc-stop", - UtxoProcError = "utxo-proc-error", - DaaScoreChange = "daa-score-change", - Pending = "pending", - Reorg = "reorg", - Stasis = "stasis", - Maturity = "maturity", - Discovery = "discovery", - Balance = "balance", - Error = "error", - } - /** - * {@link UtxoProcessor} notification event data map. - * - * @category Wallet API - */ - export type UtxoProcessorEventMap = { - "connect": IConnectEvent, - "disconnect": IDisconnectEvent, - "utxo-index-not-enabled": IUtxoIndexNotEnabledEvent, - "sync-state": ISyncStateEvent, - "server-status": IServerStatusEvent, - "utxo-proc-start": undefined, - "utxo-proc-stop": undefined, - "utxo-proc-error": IUtxoProcErrorEvent, - "daa-score-change": IDaaScoreChangeEvent, - "pending": IPendingEvent, - "reorg": IReorgEvent, - "stasis": IStasisEvent, - "maturity": IMaturityEvent, - "discovery": IDiscoveryEvent, - "balance": IBalanceEvent, - "error": IErrorEvent - } +/** +* Argument interface for the {@link Wallet.flush} method. +* +* +* @category Wallet API +*/ + export interface IFlushRequest { + walletSecret : string; + } + - /** - * - * @category Wallet API + +/** +* Return interface for the {@link Wallet.batch} method. +* +* +* @category Wallet API +*/ + export interface IBatchResponse { } + + + +/** +* Argument interface for the {@link Wallet.batch} method. +* Suspend storage operations until invocation of flush(). +* +* @category Wallet API +*/ + export interface IBatchRequest { } + + + +/** + * @categoryDescription Wallet API + * Wallet API for interfacing with Rusty Kaspa Wallet implementation. + */ + + + + /** + * + * + * @category Wallet API + */ + export interface IAccountDescriptor { + kind : AccountKind, + accountId : HexString, + accountName? : string, + receiveAddress? : Address, + changeAddress? : Address, + addresses? : Address[], + prvKeyDataIds : HexString[], + // balance? : Balance, + [key: string]: any + } + + + + /** + * Private key data information. + * @category Wallet API + */ + export interface IPrvKeyDataInfo { + /** Deterministic wallet id of the private key */ + id: HexString; + /** Optional name of the private key */ + name?: string; + /** + * Indicates if the key requires additional payment or a recovery secret + * to perform wallet operations that require access to it. + * For BIP39 keys this indicates that the key was created with a BIP39 passphrase. */ + isEncrypted: boolean; + } + + + +/** + * + * + * @category Wallet SDK + * + */ +export enum TransactionKind { + Reorg = "reorg", + Stasis = "stasis", + Batch = "batch", + Change = "change", + Incoming = "incoming", + Outgoing = "outgoing", + External = "external", + TransferIncoming = "transfer-incoming", + TransferOutgoing = "transfer-outgoing", +} + + + + +export interface IPrvKeyDataArgs { + prvKeyDataId: HexString; + paymentSecret?: string; +} + +export interface IAccountCreateArgsBip32 { + accountName?: string; + accountIndex?: number; +} - export type UtxoProcessorEvent = { - [K in T]: { - type: K, - data: UtxoProcessorEventMap[K] - } - }[T]; - - /** - * {@link UtxoProcessor} notification callback type. - * - * This type declares the callback function that is called when notification is emitted - * from the UtxoProcessor or UtxoContext subsystems. - * - * @see {@link UtxoProcessor}, {@link UtxoContext}, - * - * @category Wallet SDK - */ +/** + * @category Wallet API + */ +export interface IAccountCreateArgs { + type : "bip32"; + args : IAccountCreateArgsBip32; + prvKeyDataArgs? : IPrvKeyDataArgs; +} - export type UtxoProcessorNotificationCallback = (event: UtxoProcessorEvent) => void; - /** * - * - * @category Wallet API + * @category Wallet SDK */ - export interface IAccountDescriptor { - kind : AccountKind, - accountId : HexString, - accountName? : string, - receiveAddress? : Address, - changeAddress? : Address, - prvKeyDataIds : HexString[], - // balance? : Balance, - [key: string]: any + export interface IFees { + amount: bigint; + source?: FeeSource; } + interface Wallet { + /** + * @param {WalletNotificationCallback} callback + */ + addEventListener(callback:WalletNotificationCallback): void; + /** + * @param {WalletEventType} event + * @param {WalletNotificationCallback} [callback] + */ + addEventListener( + event: M, + callback: (eventData: WalletEventMap[M]) => void + ) + } + + /** - * UtxoContext constructor arguments. * - * @see {@link UtxoProcessor}, {@link UtxoContext}, {@link RpcClient} - * @category Wallet SDK + * + * @category Wallet API */ - export interface IUtxoContextArgs { - /** - * Associated UtxoProcessor. - */ - processor: UtxoProcessor; + export interface IWalletConfig { /** - * Optional id for the UtxoContext. - * **The id must be a valid 32-byte hex string.** - * You can use {@link sha256FromBinary} or {@link sha256FromText} to generate a valid id. - * - * If not provided, a random id will be generated. - * The IDs are deterministic, based on the order UtxoContexts are created. + * `resident` is a boolean indicating if the wallet should not be stored on the permanent medium. */ - id?: HexString; + resident?: boolean; + networkId?: NetworkId | string; + encoding?: Encoding | string; + url?: string; + resolver?: Resolver; } -/** - * Configuration for the transaction {@link Generator}. This interface - * allows you to specify UTXO sources, transaction outputs, change address, - * priority fee, and other transaction parameters. - * - * If the total number of UTXOs needed to satisfy the transaction outputs - * exceeds maximum allowed number of UTXOs per transaction (limited by - * the maximum transaction mass), the {@link Generator} will produce - * multiple chained transactions to the change address and then used these - * transactions as a source for the "final" transaction. - * - * @see - * {@link kaspaToSompi}, - * {@link Generator}, - * {@link PendingTransaction}, - * {@link UtxoContext}, - * {@link UtxoEntry}, - * {@link createTransactions}, - * {@link estimateTransactions} - * @category Wallet SDK - */ -interface IGeneratorSettingsObject { - /** - * Final transaction outputs (do not supply change transaction). - * - * Typical usage: { address: "kaspa:...", amount: 1000n } - */ - outputs: PaymentOutput | IPaymentOutput[]; - /** - * Address to be used for change, if any. - */ - changeAddress: Address | string; - /** - * Priority fee in SOMPI. - * - * If supplying `bigint` value, it will be interpreted as a sender-pays fee. - * Alternatively you can supply an object with `amount` and `source` properties - * where `source` contains the {@link FeeSource} enum. - * - * **IMPORTANT:* When sending an outbound transaction (transaction that - * contains outputs), the `priorityFee` must be set, even if it is zero. - * However, if the transaction is missing outputs (and thus you are - * creating a compound transaction against your change address), - * `priorityFee` should not be set (i.e. it should be `undefined`). - * - * @see {@link IFees}, {@link FeeSource} - */ - priorityFee?: IFees | bigint; - /** - * UTXO entries to be used for the transaction. This can be an - * array of UtxoEntry instances, objects matching {@link IUtxoEntry} - * interface, or a {@link UtxoContext} instance. - */ - entries: IUtxoEntry[] | UtxoEntryReference[] | UtxoContext; - /** - * Optional UTXO entries that will be consumed before those available in `entries`. - * You can use this property to apply custom input selection logic. - * Please note that these inputs are consumed first, then `entries` are consumed - * to generate a desirable transaction output amount. If transaction mass - * overflows, these inputs will be consumed into a batch/sweep transaction - * where the destination if the `changeAddress`. - */ - priorityEntries?: IUtxoEntry[] | UtxoEntryReference[], - /** - * Optional number of signature operations in the transaction. - */ - sigOpCount?: number; - /** - * Optional minimum number of signatures required for the transaction. - */ - minimumSignatures?: number; - /** - * Optional data payload to be included in the transaction. - */ - payload?: Uint8Array | HexString; + interface UtxoProcessor { + /** + * @param {UtxoProcessorNotificationCallback} callback + */ + addEventListener(callback: UtxoProcessorNotificationCallback): void; + /** + * @param {UtxoProcessorEventType} event + * @param {UtxoProcessorNotificationCallback} [callback] + */ + addEventListener( + event: E, + callback: UtxoProcessorNotificationCallback + ) + } + /** - * Optional NetworkId or network id as string (i.e. `mainnet` or `testnet-11`). Required when {@link IGeneratorSettingsObject.entries} is array + * UtxoProcessor constructor arguments. + * + * @see {@link UtxoProcessor}, {@link UtxoContext}, {@link RpcClient}, {@link NetworkId} + * @category Wallet SDK */ - networkId?: NetworkId | string -} - + export interface IUtxoProcessorArgs { + /** + * The RPC client to use for network communication. + */ + rpc : RpcClient; + networkId : NetworkId | string; + } + /** @@ -4319,54 +4492,134 @@ export interface ITransactionRecord { /** * Transaction data type. */ - type: string; + type: string; +} + + + + +/** + * Type of a binding record. + * @see {@link IBinding}, {@link ITransactionDataVariant}, {@link ITransactionRecord} + * @category Wallet SDK + */ +export enum BindingType { + /** + * The data structure is associated with a user-supplied id. + * @see {@link IBinding} + */ + Custom = "custom", + /** + * The data structure is associated with a wallet account. + * @see {@link IBinding}, {@link Account} + */ + Account = "account", +} + +/** + * Internal transaction data contained within the transaction record. + * @see {@link ITransactionRecord} + * @category Wallet SDK + */ +export interface IBinding { + type : BindingType; + id : HexString; +} + + + +/** + * {@link UtxoContext} (wallet account) balance. + * @category Wallet SDK + */ +export interface IBalance { + /** + * Total amount of Kaspa (in SOMPI) available for + * spending. + */ + mature: bigint; + /** + * Total amount of Kaspa (in SOMPI) that has been + * received and is pending confirmation. + */ + pending: bigint; + /** + * Total amount of Kaspa (in SOMPI) currently + * being sent as a part of the outgoing transaction + * but has not yet been accepted by the network. + */ + outgoing: bigint; + /** + * Number of UTXOs available for spending. + */ + matureUtxoCount: number; + /** + * Number of UTXOs that have been received and + * are pending confirmation. + */ + pendingUtxoCount: number; + /** + * Number of UTXOs currently in stasis (coinbase + * transactions received as a result of mining). + * Unlike regular user transactions, coinbase + * transactions go through `stasis->pending->mature` + * stages. Client applications should ignore `stasis` + * stages and should process transactions only when + * they have reached the `pending` stage. However, + * `stasis` information can be used for informative + * purposes to indicate that coinbase transactions + * have arrived. + */ + stasisUtxoCount: number; } - interface Wallet { - /** - * @param {WalletNotificationCallback} callback - */ - addEventListener(callback:WalletNotificationCallback): void; - /** - * @param {WalletEventType} event - * @param {WalletNotificationCallback} [callback] - */ - addEventListener( - event: M, - callback: (eventData: WalletEventMap[M]) => void - ) - } + /** + * Interface defining response from the {@link createTransactions} function. * - * - * @category Wallet API + * @category Wallet SDK */ - export interface IWalletConfig { + export interface ICreateTransactions { /** - * `resident` is a boolean indicating if the wallet should not be stored on the permanent medium. + * Array of pending unsigned transactions. */ - resident?: boolean; - networkId?: NetworkId | string; - encoding?: Encoding | string; - url?: string; - resolver?: Resolver; + transactions : PendingTransaction[]; + /** + * Summary of the transaction generation process. + */ + summary : GeneratorSummary; } - /** - * - * @category Wallet SDK - */ - export interface IFees { - amount: bigint; - source?: FeeSource; - } - +/** + * Interface declaration for {@link verifyMessage} function arguments. + * + * @category Message Signing + */ +export interface IVerifyMessage { + message: string; + signature: HexString; + publicKey: PublicKey | string; +} + + + +/** + * Interface declaration for {@link signMessage} function arguments. + * + * @category Message Signing + */ +export interface ISignMessage { + message: string; + privateKey: PrivateKey | string; + noAuxRand?: boolean; +} + /** @@ -4448,52 +4701,6 @@ export interface IHexViewConfig { - /** - * RPC Resolver connection options - * - * @category Node RPC - */ - export interface IResolverConnect { - /** - * RPC encoding: `borsh` (default) or `json` - */ - encoding?: Encoding | string; - /** - * Network identifier: `mainnet` or `testnet-11` etc. - */ - networkId?: NetworkId | string; - } - - - - /** - * RPC Resolver configuration options - * - * @category Node RPC - */ - export interface IResolverConfig { - /** - * Optional URLs for one or multiple resolvers. - */ - urls?: string[]; - /** - * Use strict TLS for RPC connections. - * If not set or `false` (default), the resolver will - * provide the best available connection regardless of - * whether this connection supports TLS or not. - * If set to `true`, the resolver will only provide - * TLS-enabled connections. - * - * This setting is ignored in the browser environment - * when the browser navigator location is `https`. - * In which case the resolver will always use TLS-enabled - * connections. - */ - tls?: boolean; - } - - - /** * New block template notification event is produced when a new block * template is generated for mining in the Kaspa BlockDAG. @@ -4689,6 +4896,52 @@ export type RpcEventCallback = (event: RpcEvent) => void; + /** + * RPC Resolver connection options + * + * @category Node RPC + */ + export interface IResolverConnect { + /** + * RPC encoding: `borsh` (default) or `json` + */ + encoding?: Encoding | string; + /** + * Network identifier: `mainnet` or `testnet-11` etc. + */ + networkId?: NetworkId | string; + } + + + + /** + * RPC Resolver configuration options + * + * @category Node RPC + */ + export interface IResolverConfig { + /** + * Optional URLs for one or multiple resolvers. + */ + urls?: string[]; + /** + * Use strict TLS for RPC connections. + * If not set or `false` (default), the resolver will + * provide the best available connection regardless of + * whether this connection supports TLS or not. + * If set to `true`, the resolver will only provide + * TLS-enabled connections. + * + * This setting is ignored in the browser environment + * when the browser navigator location is `https`. + * In which case the resolver will always use TLS-enabled + * connections. + */ + tls?: boolean; + } + + + /** * Interface for configuring workflow-rs WASM32 bindings. * @@ -4709,21 +4962,6 @@ export interface IWASM32BindingsConfig { - /** - * `WebSocketConfig` is used to configure the `WebSocket`. - * - * @category WebSocket - */ - export interface IWebSocketConfig { - /** Maximum size of the WebSocket message. */ - maxMessageSize: number, - /** Maximum size of the WebSocket frame. */ - maxFrameSize: number, - } - - - - /** * `ConnectOptions` is used to configure the `WebSocket` connectivity behavior. * @@ -4758,379 +4996,240 @@ export interface IWASM32BindingsConfig { } + + + /** + * `WebSocketConfig` is used to configure the `WebSocket`. + * + * @category WebSocket + */ + export interface IWebSocketConfig { + /** Maximum size of the WebSocket message. */ + maxMessageSize: number, + /** Maximum size of the WebSocket frame. */ + maxFrameSize: number, + } + + /** -* -* Abortable trigger wraps an `Arc`, which can be cloned -* to signal task terminating using an atomic bool. -* -* ```text -* let abortable = Abortable::default(); -* let result = my_task(abortable).await?; -* // ... elsewhere -* abortable.abort(); -* ``` -* -* @category General -*/ + * + * Abortable trigger wraps an `Arc`, which can be cloned + * to signal task terminating using an atomic bool. + * + * ```text + * let abortable = Abortable::default(); + * let result = my_task(abortable).await?; + * // ... elsewhere + * abortable.abort(); + * ``` + * + * @category General + */ export class Abortable { free(): void; -/** -*/ constructor(); -/** -* @returns {boolean} -*/ isAborted(): boolean; -/** -*/ abort(): void; -/** -*/ check(): void; -/** -*/ reset(): void; } /** -* Error emitted by [`Abortable`]. -* @category General -*/ + * Error emitted by [`Abortable`]. + * @category General + */ export class Aborted { + private constructor(); free(): void; } /** -* -* Account kind is a string signature that represents an account type. -* Account kind is used to identify the account type during -* serialization, deserialization and various API calls. -* -* @category Wallet SDK -*/ + * + * Account kind is a string signature that represents an account type. + * Account kind is used to identify the account type during + * serialization, deserialization and various API calls. + * + * @category Wallet SDK + */ export class AccountKind { free(): void; -/** -* @param {string} kind -*/ constructor(kind: string); -/** -* @returns {string} -*/ toString(): string; } /** -* Kaspa [`Address`] struct that serializes to and from an address format string: `kaspa:qz0s...t8cv`. -* -* @category Address -*/ + * Kaspa [`Address`] struct that serializes to and from an address format string: `kaspa:qz0s...t8cv`. + * + * @category Address + */ export class Address { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** -* Return stringified version of self. -*/ - toString(): string; - free(): void; -/** -* @param {string} address -*/ - constructor(address: string); -/** -* @param {string} address -* @returns {boolean} -*/ - static validate(address: string): boolean; -/** -* Convert an address to a string. -* @returns {string} -*/ - toString(): string; -/** -* @param {number} n -* @returns {string} -*/ - short(n: number): string; -/** -*/ - readonly payload: string; -/** -*/ - readonly prefix: string; -/** -*/ - setPrefix: string; -/** +* Return stringified version of self. */ + toString(): string; + free(): void; + constructor(address: string); + static validate(address: string): boolean; + /** + * Convert an address to a string. + */ + toString(): string; + short(n: number): string; readonly version: string; + readonly prefix: string; + set setPrefix(value: string); + readonly payload: string; } -/** -*/ export class AgentConstructorOptions { + private constructor(); free(): void; -/** -*/ - keep_alive: boolean; -/** -*/ keep_alive_msecs: number; -/** -*/ + keep_alive: boolean; max_free_sockets: number; -/** -*/ max_sockets: number; -/** -*/ timeout: number; } -/** -*/ export class AppendFileOptions { free(): void; -/** -* @param {string | undefined} [encoding] -* @param {number | undefined} [mode] -* @param {string | undefined} [flag] -*/ - constructor(encoding?: string, mode?: number, flag?: string); -/** -* @returns {AppendFileOptions} -*/ + constructor(encoding?: string | null, mode?: number | null, flag?: string | null); static new(): AppendFileOptions; -/** -*/ - encoding?: string; -/** -*/ - flag?: string; -/** -*/ - mode?: number; + get encoding(): string | undefined; + set encoding(value: string | null | undefined); + get mode(): number | undefined; + set mode(value: number | null | undefined); + get flag(): string | undefined; + set flag(value: string | null | undefined); } -/** -*/ export class AssertionErrorOptions { free(): void; -/** -* @param {string | undefined} message -* @param {any} actual -* @param {any} expected -* @param {string} operator -*/ - constructor(message: string | undefined, actual: any, expected: any, operator: string); -/** -* The actual property on the error instance. -*/ + constructor(message: string | null | undefined, actual: any, expected: any, operator: string); + /** + * If provided, the error message is set to this value. + */ + get message(): string | undefined; + set message(value: string | null | undefined); + /** + * The actual property on the error instance. + */ actual: any; -/** -* The expected property on the error instance. -*/ + /** + * The expected property on the error instance. + */ expected: any; -/** -* If provided, the error message is set to this value. -*/ - message?: string; -/** -* The operator property on the error instance. -*/ + /** + * The operator property on the error instance. + */ operator: string; } /** -* -* Represents a {@link UtxoContext} (account) balance. -* -* @see {@link IBalance}, {@link UtxoContext} -* -* @category Wallet SDK -*/ + * + * Represents a {@link UtxoContext} (account) balance. + * + * @see {@link IBalance}, {@link UtxoContext} + * + * @category Wallet SDK + */ export class Balance { + private constructor(); free(): void; -/** -* @param {NetworkType | NetworkId | string} network_type -* @returns {BalanceStrings} -*/ toBalanceStrings(network_type: NetworkType | NetworkId | string): BalanceStrings; -/** -* Confirmed amount of funds available for spending. -*/ + /** + * Confirmed amount of funds available for spending. + */ readonly mature: bigint; -/** -* Amount of funds that are being send and are not yet accepted by the network. -*/ - readonly outgoing: bigint; -/** -* Amount of funds that are being received and are not yet confirmed. -*/ + /** + * Amount of funds that are being received and are not yet confirmed. + */ readonly pending: bigint; + /** + * Amount of funds that are being send and are not yet accepted by the network. + */ + readonly outgoing: bigint; } /** -* -* Formatted string representation of the {@link Balance}. -* -* The value is formatted as `123,456.789`. -* -* @category Wallet SDK -*/ + * + * Formatted string representation of the {@link Balance}. + * + * The value is formatted as `123,456.789`. + * + * @category Wallet SDK + */ export class BalanceStrings { + private constructor(); free(): void; -/** -*/ readonly mature: string; -/** -*/ readonly pending: string | undefined; } -/** -*/ export class ConsoleConstructorOptions { free(): void; -/** -* @param {any} stdout -* @param {any} stderr -* @param {boolean | undefined} ignore_errors -* @param {any} color_mod -* @param {object | undefined} [inspect_options] -*/ - constructor(stdout: any, stderr: any, ignore_errors: boolean | undefined, color_mod: any, inspect_options?: object); -/** -* @param {any} stdout -* @param {any} stderr -* @returns {ConsoleConstructorOptions} -*/ + constructor(stdout: any, stderr: any, ignore_errors: boolean | null | undefined, color_mod: any, inspect_options?: object | null); static new(stdout: any, stderr: any): ConsoleConstructorOptions; -/** -*/ - color_mod: any; -/** -*/ - ignore_errors?: boolean; -/** -*/ - inspect_options?: object; -/** -*/ - stderr: any; -/** -*/ stdout: any; + stderr: any; + get ignore_errors(): boolean | undefined; + set ignore_errors(value: boolean | null | undefined); + color_mod: any; + get inspect_options(): object | undefined; + set inspect_options(value: object | null | undefined); } -/** -*/ export class CreateHookCallbacks { free(): void; -/** -* @param {Function} init -* @param {Function} before -* @param {Function} after -* @param {Function} destroy -* @param {Function} promise_resolve -*/ constructor(init: Function, before: Function, after: Function, destroy: Function, promise_resolve: Function); -/** -*/ - after: Function; -/** -*/ + init: Function; before: Function; -/** -*/ + after: Function; destroy: Function; -/** -*/ - init: Function; -/** -*/ promise_resolve: Function; } -/** -*/ export class CreateReadStreamOptions { free(): void; -/** -* @param {boolean | undefined} [auto_close] -* @param {boolean | undefined} [emit_close] -* @param {string | undefined} [encoding] -* @param {number | undefined} [end] -* @param {number | undefined} [fd] -* @param {string | undefined} [flags] -* @param {number | undefined} [high_water_mark] -* @param {number | undefined} [mode] -* @param {number | undefined} [start] -*/ - constructor(auto_close?: boolean, emit_close?: boolean, encoding?: string, end?: number, fd?: number, flags?: string, high_water_mark?: number, mode?: number, start?: number); -/** -*/ - auto_close?: boolean; -/** -*/ - emit_close?: boolean; -/** -*/ - encoding?: string; -/** -*/ - end?: number; -/** -*/ - fd?: number; -/** -*/ - flags?: string; -/** -*/ - high_water_mark?: number; -/** -*/ - mode?: number; -/** -*/ - start?: number; + constructor(auto_close?: boolean | null, emit_close?: boolean | null, encoding?: string | null, end?: number | null, fd?: number | null, flags?: string | null, high_water_mark?: number | null, mode?: number | null, start?: number | null); + get auto_close(): boolean | undefined; + set auto_close(value: boolean | null | undefined); + get emit_close(): boolean | undefined; + set emit_close(value: boolean | null | undefined); + get encoding(): string | undefined; + set encoding(value: string | null | undefined); + get end(): number | undefined; + set end(value: number | null | undefined); + get fd(): number | undefined; + set fd(value: number | null | undefined); + get flags(): string | undefined; + set flags(value: string | null | undefined); + get high_water_mark(): number | undefined; + set high_water_mark(value: number | null | undefined); + get mode(): number | undefined; + set mode(value: number | null | undefined); + get start(): number | undefined; + set start(value: number | null | undefined); } -/** -*/ export class CreateWriteStreamOptions { free(): void; -/** -* @param {boolean | undefined} [auto_close] -* @param {boolean | undefined} [emit_close] -* @param {string | undefined} [encoding] -* @param {number | undefined} [fd] -* @param {string | undefined} [flags] -* @param {number | undefined} [mode] -* @param {number | undefined} [start] -*/ - constructor(auto_close?: boolean, emit_close?: boolean, encoding?: string, fd?: number, flags?: string, mode?: number, start?: number); -/** -*/ - auto_close?: boolean; -/** -*/ - emit_close?: boolean; -/** -*/ - encoding?: string; -/** -*/ - fd?: number; -/** -*/ - flags?: string; -/** -*/ - mode?: number; -/** -*/ - start?: number; + constructor(auto_close?: boolean | null, emit_close?: boolean | null, encoding?: string | null, fd?: number | null, flags?: string | null, mode?: number | null, start?: number | null); + get auto_close(): boolean | undefined; + set auto_close(value: boolean | null | undefined); + get emit_close(): boolean | undefined; + set emit_close(value: boolean | null | undefined); + get encoding(): string | undefined; + set encoding(value: string | null | undefined); + get fd(): number | undefined; + set fd(value: number | null | undefined); + get flags(): string | undefined; + set flags(value: string | null | undefined); + get mode(): number | undefined; + set mode(value: number | null | undefined); + get start(): number | undefined; + set start(value: number | null | undefined); } /** -* -* CryptoBox allows for encrypting and decrypting messages using the `crypto_box` crate. -* -* -* -* @category Wallet SDK -*/ + * + * CryptoBox allows for encrypting and decrypting messages using the `crypto_box` crate. + * + * + * + * @category Wallet SDK + */ export class CryptoBox { /** ** Return copy of self without private attributes. @@ -5141,200 +5240,137 @@ export class CryptoBox { */ toString(): string; free(): void; -/** -* @param {CryptoBoxPrivateKey | HexString | Uint8Array} secretKey -* @param {CryptoBoxPublicKey | HexString | Uint8Array} peerPublicKey -*/ constructor(secretKey: CryptoBoxPrivateKey | HexString | Uint8Array, peerPublicKey: CryptoBoxPublicKey | HexString | Uint8Array); -/** -* @param {string} plaintext -* @returns {string} -*/ encrypt(plaintext: string): string; -/** -* @param {string} base64string -* @returns {string} -*/ decrypt(base64string: string): string; -/** -*/ readonly publicKey: string; } /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class CryptoBoxPrivateKey { free(): void; -/** -* @param {HexString | Uint8Array} secretKey -*/ constructor(secretKey: HexString | Uint8Array); -/** -* @returns {CryptoBoxPublicKey} -*/ to_public_key(): CryptoBoxPublicKey; } /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class CryptoBoxPublicKey { free(): void; -/** -* @param {HexString | Uint8Array} publicKey -*/ constructor(publicKey: HexString | Uint8Array); -/** -* @returns {string} -*/ toString(): string; } /** -* -* Key derivation path -* -* @category Wallet SDK -*/ + * + * Key derivation path + * + * @category Wallet SDK + */ export class DerivationPath { free(): void; -/** -* @param {string} path -*/ constructor(path: string); -/** -* Is this derivation path empty? (i.e. the root) -* @returns {boolean} -*/ + /** + * Is this derivation path empty? (i.e. the root) + */ isEmpty(): boolean; -/** -* Get the count of [`ChildNumber`] values in this derivation path. -* @returns {number} -*/ + /** + * Get the count of [`ChildNumber`] values in this derivation path. + */ length(): number; -/** -* Get the parent [`DerivationPath`] for the current one. -* -* Returns `Undefined` if this is already the root path. -* @returns {DerivationPath | undefined} -*/ + /** + * Get the parent [`DerivationPath`] for the current one. + * + * Returns `Undefined` if this is already the root path. + */ parent(): DerivationPath | undefined; -/** -* Push a [`ChildNumber`] onto an existing derivation path. -* @param {number} child_number -* @param {boolean | undefined} [hardened] -*/ - push(child_number: number, hardened?: boolean): void; -/** -* @returns {string} -*/ + /** + * Push a [`ChildNumber`] onto an existing derivation path. + */ + push(child_number: number, hardened?: boolean | null): void; toString(): string; } -/** -*/ export class FormatInputPathObject { free(): void; -/** -* @param {string | undefined} [base] -* @param {string | undefined} [dir] -* @param {string | undefined} [ext] -* @param {string | undefined} [name] -* @param {string | undefined} [root] -*/ - constructor(base?: string, dir?: string, ext?: string, name?: string, root?: string); -/** -* @returns {FormatInputPathObject} -*/ + constructor(base?: string | null, dir?: string | null, ext?: string | null, name?: string | null, root?: string | null); static new(): FormatInputPathObject; -/** -*/ - base?: string; -/** -*/ - dir?: string; -/** -*/ - ext?: string; -/** -*/ - name?: string; -/** -*/ - root?: string; + get base(): string | undefined; + set base(value: string | null | undefined); + get dir(): string | undefined; + set dir(value: string | null | undefined); + get ext(): string | undefined; + set ext(value: string | null | undefined); + get name(): string | undefined; + set name(value: string | null | undefined); + get root(): string | undefined; + set root(value: string | null | undefined); } /** -* Generator is a type capable of generating transactions based on a supplied -* set of UTXO entries or a UTXO entry producer (such as {@link UtxoContext}). The Generator -* accumulates UTXO entries until it can generate a transaction that meets the -* requested amount or until the total mass of created inputs exceeds the allowed -* transaction mass, at which point it will produce a compound transaction by forwarding -* all selected UTXO entries to the supplied change address and prepare to start generating -* a new transaction. Such sequence of daisy-chained transactions is known as a "batch". -* Each compound transaction results in a new UTXO, which is immediately reused in the -* subsequent transaction. -* -* The Generator constructor accepts a single {@link IGeneratorSettingsObject} object. -* -* ```javascript -* -* let generator = new Generator({ -* utxoEntries : [...], -* changeAddress : "kaspa:...", -* outputs : [ -* { amount : kaspaToSompi(10.0), address: "kaspa:..."}, -* { amount : kaspaToSompi(20.0), address: "kaspa:..."}, -* ... -* ], -* priorityFee : 1000n, -* }); -* -* let pendingTransaction; -* while(pendingTransaction = await generator.next()) { -* await pendingTransaction.sign(privateKeys); -* await pendingTransaction.submit(rpc); -* } -* -* let summary = generator.summary(); -* console.log(summary); -* -* ``` -* @see -* {@link IGeneratorSettingsObject}, -* {@link PendingTransaction}, -* {@link UtxoContext}, -* {@link createTransactions}, -* {@link estimateTransactions}, -* @category Wallet SDK -*/ + * Generator is a type capable of generating transactions based on a supplied + * set of UTXO entries or a UTXO entry producer (such as {@link UtxoContext}). The Generator + * accumulates UTXO entries until it can generate a transaction that meets the + * requested amount or until the total mass of created inputs exceeds the allowed + * transaction mass, at which point it will produce a compound transaction by forwarding + * all selected UTXO entries to the supplied change address and prepare to start generating + * a new transaction. Such sequence of daisy-chained transactions is known as a "batch". + * Each compound transaction results in a new UTXO, which is immediately reused in the + * subsequent transaction. + * + * The Generator constructor accepts a single {@link IGeneratorSettingsObject} object. + * + * ```javascript + * + * let generator = new Generator({ + * utxoEntries : [...], + * changeAddress : "kaspa:...", + * outputs : [ + * { amount : kaspaToSompi(10.0), address: "kaspa:..."}, + * { amount : kaspaToSompi(20.0), address: "kaspa:..."}, + * ... + * ], + * priorityFee : 1000n, + * }); + * + * let pendingTransaction; + * while(pendingTransaction = await generator.next()) { + * await pendingTransaction.sign(privateKeys); + * await pendingTransaction.submit(rpc); + * } + * + * let summary = generator.summary(); + * console.log(summary); + * + * ``` + * @see + * {@link IGeneratorSettingsObject}, + * {@link PendingTransaction}, + * {@link UtxoContext}, + * {@link createTransactions}, + * {@link estimateTransactions}, + * @category Wallet SDK + */ export class Generator { free(): void; -/** -* @param {IGeneratorSettingsObject} args -*/ constructor(args: IGeneratorSettingsObject); -/** -* Generate next transaction -* @returns {Promise} -*/ + /** + * Generate next transaction + */ next(): Promise; -/** -* @returns {Promise} -*/ estimate(): Promise; -/** -* @returns {GeneratorSummary} -*/ summary(): GeneratorSummary; } /** -* -* A class containing a summary produced by transaction {@link Generator}. -* This class contains the number of transactions, the aggregated fees, -* the aggregated UTXOs and the final transaction amount that includes -* both network and QoS (priority) fees. -* -* @see {@link createTransactions}, {@link IGeneratorSettingsObject}, {@link Generator} -* @category Wallet SDK -*/ + * + * A class containing a summary produced by transaction {@link Generator}. + * This class contains the number of transactions, the aggregated fees, + * the aggregated UTXOs and the final transaction amount that includes + * both network and QoS (priority) fees. + * + * @see {@link createTransactions}, {@link IGeneratorSettingsObject}, {@link Generator} + * @category Wallet SDK + */ export class GeneratorSummary { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -5344,69 +5380,37 @@ export class GeneratorSummary { */ toString(): string; free(): void; -/** -*/ + readonly networkType: NetworkType; + readonly utxos: number; readonly fees: bigint; -/** -*/ + readonly mass: bigint; + readonly transactions: number; readonly finalAmount: bigint | undefined; -/** -*/ readonly finalTransactionId: string | undefined; -/** -*/ - readonly networkType: NetworkType; -/** -*/ - readonly transactions: number; -/** -*/ - readonly utxos: number; -} -/** -*/ +} export class GetNameOptions { + private constructor(); free(): void; -/** -* @param {number | undefined} family -* @param {string} host -* @param {string} local_address -* @param {number} port -* @returns {GetNameOptions} -*/ - static new(family: number | undefined, host: string, local_address: string, port: number): GetNameOptions; -/** -*/ - family?: number; -/** -*/ + static new(family: number | null | undefined, host: string, local_address: string, port: number): GetNameOptions; + get family(): number | undefined; + set family(value: number | null | undefined); host: string; -/** -*/ local_address: string; -/** -*/ port: number; } /** -* @category General -*/ + * @category General + */ export class Hash { free(): void; -/** -* @param {string} hex_str -*/ constructor(hex_str: string); -/** -* @returns {string} -*/ toString(): string; } /** -* Kaspa Block Header -* -* @category Consensus -*/ + * Kaspa Block Header + * + * @category Consensus + */ export class Header { /** ** Return copy of self without private attributes. @@ -5417,72 +5421,44 @@ export class Header { */ toString(): string; free(): void; -/** -* @param {Header | IHeader | IRawHeader} js_value -*/ constructor(js_value: Header | IHeader | IRawHeader); -/** -* Finalizes the header and recomputes (updates) the header hash -* @return { String } header hash -* @returns {string} -*/ + /** + * Finalizes the header and recomputes (updates) the header hash + * @return { String } header hash + */ finalize(): string; -/** -* Obtain `JSON` representation of the header. JSON representation -* should be obtained using WASM, to ensure proper serialization of -* big integers. -* @returns {string} -*/ + /** + * Obtain `JSON` representation of the header. JSON representation + * should be obtained using WASM, to ensure proper serialization of + * big integers. + */ asJSON(): string; -/** -* @returns {string} -*/ getBlueWorkAsHex(): string; -/** -*/ - acceptedIdMerkleRoot: any; -/** -*/ + version: number; + timestamp: bigint; bits: number; -/** -*/ - blueScore: bigint; -/** -*/ - blueWork: any; -/** -*/ + nonce: bigint; daaScore: bigint; -/** -*/ + blueScore: bigint; readonly hash: string; -/** -*/ - hashMerkleRoot: any; -/** -*/ - nonce: bigint; -/** -*/ + get hashMerkleRoot(): string; + set hashMerkleRoot(value: any); + get acceptedIdMerkleRoot(): string; + set acceptedIdMerkleRoot(value: any); + get utxoCommitment(): string; + set utxoCommitment(value: any); + get pruningPoint(): string; + set pruningPoint(value: any); parentsByLevel: any; -/** -*/ - pruningPoint: any; -/** -*/ - timestamp: bigint; -/** -*/ - utxoCommitment: any; -/** -*/ - version: number; + get blueWork(): bigint; + set blueWork(value: any); } /** -* Data structure that contains a secret and public keys. -* @category Wallet SDK -*/ + * Data structure that contains a secret and public keys. + * @category Wallet SDK + */ export class Keypair { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -5492,70 +5468,54 @@ export class Keypair { */ toString(): string; free(): void; -/** -* Get the [`Address`] of this Keypair's [`PublicKey`]. -* Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) -* to determine the prefix of the address. -* JavaScript: `let address = keypair.toAddress(NetworkType.MAINNET);`. -* @param {NetworkType | NetworkId | string} network -* @returns {Address} -*/ + /** + * Get the [`Address`] of this Keypair's [`PublicKey`]. + * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) + * to determine the prefix of the address. + * JavaScript: `let address = keypair.toAddress(NetworkType.MAINNET);`. + */ toAddress(network: NetworkType | NetworkId | string): Address; -/** -* Get `ECDSA` [`Address`] of this Keypair's [`PublicKey`]. -* Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) -* to determine the prefix of the address. -* JavaScript: `let address = keypair.toAddress(NetworkType.MAINNET);`. -* @param {NetworkType | NetworkId | string} network -* @returns {Address} -*/ + /** + * Get `ECDSA` [`Address`] of this Keypair's [`PublicKey`]. + * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) + * to determine the prefix of the address. + * JavaScript: `let address = keypair.toAddress(NetworkType.MAINNET);`. + */ toAddressECDSA(network: NetworkType | NetworkId | string): Address; -/** -* Create a new random [`Keypair`]. -* JavaScript: `let keypair = Keypair::random();`. -* @returns {Keypair} -*/ + /** + * Create a new random [`Keypair`]. + * JavaScript: `let keypair = Keypair::random();`. + */ static random(): Keypair; -/** -* Create a new [`Keypair`] from a [`PrivateKey`]. -* JavaScript: `let privkey = new PrivateKey(hexString); let keypair = privkey.toKeypair();`. -* @param {PrivateKey} secret_key -* @returns {Keypair} -*/ + /** + * Create a new [`Keypair`] from a [`PrivateKey`]. + * JavaScript: `let privkey = new PrivateKey(hexString); let keypair = privkey.toKeypair();`. + */ static fromPrivateKey(secret_key: PrivateKey): Keypair; -/** -* Get the [`PrivateKey`] of this [`Keypair`]. -*/ - readonly privateKey: string; -/** -* Get the [`PublicKey`] of this [`Keypair`]. -*/ + /** + * Get the [`PublicKey`] of this [`Keypair`]. + */ readonly publicKey: string; -/** -* Get the `XOnlyPublicKey` of this [`Keypair`]. -*/ + /** + * Get the [`PrivateKey`] of this [`Keypair`]. + */ + readonly privateKey: string; + /** + * Get the `XOnlyPublicKey` of this [`Keypair`]. + */ readonly xOnlyPublicKey: any; } -/** -*/ export class MkdtempSyncOptions { free(): void; -/** -* @param {string | undefined} [encoding] -*/ - constructor(encoding?: string); -/** -* @returns {MkdtempSyncOptions} -*/ + constructor(encoding?: string | null); static new(): MkdtempSyncOptions; -/** -*/ - encoding?: string; + get encoding(): string | undefined; + set encoding(value: string | null | undefined); } /** -* BIP39 mnemonic phrases: sequences of words representing cryptographic keys. -* @category Wallet SDK -*/ + * BIP39 mnemonic phrases: sequences of words representing cryptographic keys. + * @category Wallet SDK + */ export class Mnemonic { /** ** Return copy of self without private attributes. @@ -5566,53 +5526,31 @@ export class Mnemonic { */ toString(): string; free(): void; -/** -* @param {string} phrase -* @param {Language | undefined} [language] -*/ - constructor(phrase: string, language?: Language); -/** -* Validate mnemonic phrase. Returns `true` if the phrase is valid, `false` otherwise. -* @param {string} phrase -* @param {Language | undefined} [language] -* @returns {boolean} -*/ - static validate(phrase: string, language?: Language): boolean; -/** -* @param {number | undefined} [word_count] -* @returns {Mnemonic} -*/ - static random(word_count?: number): Mnemonic; -/** -* @param {string | undefined} [password] -* @returns {string} -*/ - toSeed(password?: string): string; -/** -*/ + constructor(phrase: string, language?: Language | null); + /** + * Validate mnemonic phrase. Returns `true` if the phrase is valid, `false` otherwise. + */ + static validate(phrase: string, language?: Language | null): boolean; + static random(word_count?: number | null): Mnemonic; + toSeed(password?: string | null): string; entropy: string; -/** -*/ phrase: string; } -/** -*/ export class NetServerOptions { + private constructor(); free(): void; -/** -*/ - allow_half_open?: boolean; -/** -*/ - pause_on_connect?: boolean; + get allow_half_open(): boolean | undefined; + set allow_half_open(value: boolean | null | undefined); + get pause_on_connect(): boolean | undefined; + set pause_on_connect(value: boolean | null | undefined); } /** -* -* NetworkId is a unique identifier for a kaspa network instance. -* It is composed of a network type and an optional suffix. -* -* @category Consensus -*/ + * + * NetworkId is a unique identifier for a kaspa network instance. + * It is composed of a network type and an optional suffix. + * + * @category Consensus + */ export class NetworkId { /** ** Return copy of self without private attributes. @@ -5623,36 +5561,23 @@ export class NetworkId { */ toString(): string; free(): void; -/** -* @param {any} value -*/ constructor(value: any); -/** -* @returns {string} -*/ toString(): string; -/** -* @returns {string} -*/ addressPrefix(): string; -/** -*/ - readonly id: string; -/** -*/ - suffix?: number; -/** -*/ type: NetworkType; + get suffix(): number | undefined; + set suffix(value: number | null | undefined); + readonly id: string; } /** -* -* Data structure representing a Node connection endpoint -* as provided by the {@link Resolver}. -* -* @category Node RPC -*/ + * + * Data structure representing a Node connection endpoint + * as provided by the {@link Resolver}. + * + * @category Node RPC + */ export class NodeDescriptor { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -5662,17 +5587,25 @@ export class NodeDescriptor { */ toString(): string; free(): void; -/** -* The unique identifier of the node. -*/ + /** + * The unique identifier of the node. + */ uid: string; -/** -* The URL of the node WebSocket (wRPC URL). -*/ + /** + * The URL of the node WebSocket (wRPC URL). + */ url: string; } -/** -*/ +export class PSKB { + free(): void; + constructor(); + serialize(): string; + displayFormat(network_id: NetworkId | string): string; + static deserialize(hex_data: string): PSKB; + add(pskt: PSKT): void; + merge(other: PSKB): void; + readonly length: number; +} export class PSKT { /** ** Return copy of self without private attributes. @@ -5683,100 +5616,57 @@ export class PSKT { */ toString(): string; free(): void; -/** -* @param {PSKT | Transaction | string | undefined} payload -*/ constructor(payload: PSKT | Transaction | string | undefined); -/** -* Change role to `CREATOR` -* #[wasm_bindgen(js_name = toCreator)] -* @returns {PSKT} -*/ + serialize(): string; + /** + * Change role to `CREATOR` + * #[wasm_bindgen(js_name = toCreator)] + */ creator(): PSKT; -/** -* Change role to `CONSTRUCTOR` -* @returns {PSKT} -*/ + /** + * Change role to `CONSTRUCTOR` + */ toConstructor(): PSKT; -/** -* Change role to `UPDATER` -* @returns {PSKT} -*/ + /** + * Change role to `UPDATER` + */ toUpdater(): PSKT; -/** -* Change role to `SIGNER` -* @returns {PSKT} -*/ + /** + * Change role to `SIGNER` + */ toSigner(): PSKT; -/** -* Change role to `COMBINER` -* @returns {PSKT} -*/ + /** + * Change role to `COMBINER` + */ toCombiner(): PSKT; -/** -* Change role to `FINALIZER` -* @returns {PSKT} -*/ + /** + * Change role to `FINALIZER` + */ toFinalizer(): PSKT; -/** -* Change role to `EXTRACTOR` -* @returns {PSKT} -*/ + /** + * Change role to `EXTRACTOR` + */ toExtractor(): PSKT; -/** -* @param {bigint} lock_time -* @returns {PSKT} -*/ fallbackLockTime(lock_time: bigint): PSKT; -/** -* @returns {PSKT} -*/ inputsModifiable(): PSKT; -/** -* @returns {PSKT} -*/ outputsModifiable(): PSKT; -/** -* @returns {PSKT} -*/ noMoreInputs(): PSKT; -/** -* @returns {PSKT} -*/ noMoreOutputs(): PSKT; -/** -* @param {ITransactionInput | TransactionInput} input -* @returns {PSKT} -*/ + inputAndRedeemScript(input: ITransactionInput | TransactionInput, data: any): PSKT; input(input: ITransactionInput | TransactionInput): PSKT; -/** -* @param {ITransactionOutput | TransactionOutput} output -* @returns {PSKT} -*/ output(output: ITransactionOutput | TransactionOutput): PSKT; -/** -* @param {bigint} n -* @param {number} input_index -* @returns {PSKT} -*/ setSequence(n: bigint, input_index: number): PSKT; -/** -* @returns {Hash} -*/ calculateId(): Hash; -/** -*/ - readonly payload: any; -/** -*/ + calculateMass(data: any): bigint; readonly role: string; + readonly payload: any; } /** -* A Rust data structure representing a single payment -* output containing a destination address and amount. -* -* @category Wallet SDK -*/ + * A Rust data structure representing a single payment + * output containing a destination address and amount. + * + * @category Wallet SDK + */ export class PaymentOutput { /** ** Return copy of self without private attributes. @@ -5787,32 +5677,22 @@ export class PaymentOutput { */ toString(): string; free(): void; -/** -* @param {Address} address -* @param {bigint} amount -*/ constructor(address: Address, amount: bigint); -/** -*/ address: Address; -/** -*/ amount: bigint; } /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class PaymentOutputs { free(): void; -/** -* @param {IPaymentOutput[]} output_array -*/ constructor(output_array: IPaymentOutput[]); } /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class PendingTransaction { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -5822,147 +5702,123 @@ export class PendingTransaction { */ toString(): string; free(): void; -/** -* List of unique addresses used by transaction inputs. -* This method can be used to determine addresses used by transaction inputs -* in order to select private keys needed for transaction signing. -* @returns {Array} -*/ + /** + * List of unique addresses used by transaction inputs. + * This method can be used to determine addresses used by transaction inputs + * in order to select private keys needed for transaction signing. + */ addresses(): Array; -/** -* Provides a list of UTXO entries used by the transaction. -* @returns {Array} -*/ + /** + * Provides a list of UTXO entries used by the transaction. + */ getUtxoEntries(): Array; -/** -* Creates and returns a signature for the input at the specified index. -* @param {number} input_index -* @param {PrivateKey} private_key -* @param {SighashType | undefined} [sighash_type] -* @returns {HexString} -*/ - createInputSignature(input_index: number, private_key: PrivateKey, sighash_type?: SighashType): HexString; -/** -* Sets a signature to the input at the specified index. -* @param {number} input_index -* @param {HexString | Uint8Array} signature_script -*/ + /** + * Creates and returns a signature for the input at the specified index. + */ + createInputSignature(input_index: number, private_key: PrivateKey, sighash_type?: SighashType | null): HexString; + /** + * Sets a signature to the input at the specified index. + */ fillInput(input_index: number, signature_script: HexString | Uint8Array): void; -/** -* Signs the input at the specified index with the supplied private key -* and an optional SighashType. -* @param {number} input_index -* @param {PrivateKey} private_key -* @param {SighashType | undefined} [sighash_type] -*/ - signInput(input_index: number, private_key: PrivateKey, sighash_type?: SighashType): void; -/** -* Signs transaction with supplied [`Array`] or [`PrivateKey`] or an array of -* raw private key bytes (encoded as `Uint8Array` or as hex strings) -* @param {(PrivateKey | HexString | Uint8Array)[]} js_value -* @param {boolean | undefined} [check_fully_signed] -*/ - sign(js_value: (PrivateKey | HexString | Uint8Array)[], check_fully_signed?: boolean): void; -/** -* Submit transaction to the supplied [`RpcClient`] -* **IMPORTANT:** This method will remove UTXOs from the associated -* {@link UtxoContext} if one was used to create the transaction -* and will return UTXOs back to {@link UtxoContext} in case of -* a failed submission. -* -* # Important -* -* Make sure to consume the returned `txid` value. Always invoke this method -* as follows `let txid = await pendingTransaction.submit(rpc);`. If you do not -* consume the returned value and the rpc object is temporary, the GC will -* collect the `rpc` object passed to submit() potentially causing a panic. -* -* @see {@link RpcClient.submitTransaction} -* @param {RpcClient} wasm_rpc_client -* @returns {Promise} -*/ + /** + * Signs the input at the specified index with the supplied private key + * and an optional SighashType. + */ + signInput(input_index: number, private_key: PrivateKey, sighash_type?: SighashType | null): void; + /** + * Signs transaction with supplied [`Array`] or [`PrivateKey`] or an array of + * raw private key bytes (encoded as `Uint8Array` or as hex strings) + */ + sign(js_value: (PrivateKey | HexString | Uint8Array)[], check_fully_signed?: boolean | null): void; + /** + * Submit transaction to the supplied [`RpcClient`] + * **IMPORTANT:** This method will remove UTXOs from the associated + * {@link UtxoContext} if one was used to create the transaction + * and will return UTXOs back to {@link UtxoContext} in case of + * a failed submission. + * + * # Important + * + * Make sure to consume the returned `txid` value. Always invoke this method + * as follows `let txid = await pendingTransaction.submit(rpc);`. If you do not + * consume the returned value and the rpc object is temporary, the GC will + * collect the `rpc` object passed to submit() potentially causing a panic. + * + * @see {@link RpcClient.submitTransaction} + */ submit(wasm_rpc_client: RpcClient): Promise; -/** -* Serializes the transaction to a pure JavaScript Object. -* The schema of the JavaScript object is defined by {@link ISerializableTransaction}. -* @see {@link ISerializableTransaction} -* @see {@link Transaction}, {@link ISerializableTransaction} -* @returns {ITransaction | Transaction} -*/ + /** + * Serializes the transaction to a pure JavaScript Object. + * The schema of the JavaScript object is defined by {@link ISerializableTransaction}. + * @see {@link ISerializableTransaction} + * @see {@link Transaction}, {@link ISerializableTransaction} + */ serializeToObject(): ITransaction | Transaction; -/** -* Serializes the transaction to a JSON string. -* The schema of the JSON is defined by {@link ISerializableTransaction}. -* Once serialized, the transaction can be deserialized using {@link Transaction.deserializeFromJSON}. -* @see {@link Transaction}, {@link ISerializableTransaction} -* @returns {string} -*/ + /** + * Serializes the transaction to a JSON string. + * The schema of the JSON is defined by {@link ISerializableTransaction}. + * Once serialized, the transaction can be deserialized using {@link Transaction.deserializeFromJSON}. + * @see {@link Transaction}, {@link ISerializableTransaction} + */ serializeToJSON(): string; -/** -* Serializes the transaction to a "Safe" JSON schema where it converts all `bigint` values to `string` to avoid potential client-side precision loss. -* Once serialized, the transaction can be deserialized using {@link Transaction.deserializeFromSafeJSON}. -* @see {@link Transaction}, {@link ISerializableTransaction} -* @returns {string} -*/ + /** + * Serializes the transaction to a "Safe" JSON schema where it converts all `bigint` values to `string` to avoid potential client-side precision loss. + * Once serialized, the transaction can be deserialized using {@link Transaction.deserializeFromSafeJSON}. + * @see {@link Transaction}, {@link ISerializableTransaction} + */ serializeToSafeJSON(): string; -/** -* Total aggregate input amount. -*/ - readonly aggregateInputAmount: bigint; -/** -* Total aggregate output amount. -*/ - readonly aggregateOutputAmount: bigint; -/** -* Change amount (if any). -*/ - readonly changeAmount: bigint; -/** -* Total transaction fees (network fees + priority fees). -*/ - readonly feeAmount: bigint; -/** -* Transaction Id -*/ - readonly id: string; -/** -* Calculated transaction mass. -*/ - readonly mass: bigint; -/** -* Minimum number of signatures required by the transaction. -* (as specified during the transaction creation). -*/ - readonly minimumSignatures: number; -/** -* Total amount transferred to the destination (aggregate output - change). -*/ - readonly paymentAmount: any; -/** -* Returns encapsulated network [`Transaction`] -*/ - readonly transaction: Transaction; -/** -* Transaction type ("batch" or "final"). -*/ + /** + * Transaction Id + */ + readonly id: string; + /** + * Total amount transferred to the destination (aggregate output - change). + */ + readonly paymentAmount: any; + /** + * Change amount (if any). + */ + readonly changeAmount: bigint; + /** + * Total transaction fees (network fees + priority fees). + */ + readonly feeAmount: bigint; + /** + * Calculated transaction mass. + */ + readonly mass: bigint; + /** + * Minimum number of signatures required by the transaction. + * (as specified during the transaction creation). + */ + readonly minimumSignatures: number; + /** + * Total aggregate input amount. + */ + readonly aggregateInputAmount: bigint; + /** + * Total aggregate output amount. + */ + readonly aggregateOutputAmount: bigint; + /** + * Transaction type ("batch" or "final"). + */ readonly type: string; + /** + * Returns encapsulated network [`Transaction`] + */ + readonly transaction: Transaction; } -/** -*/ export class PipeOptions { free(): void; -/** -* @param {boolean | undefined} [end] -*/ - constructor(end?: boolean); -/** -*/ - end?: boolean; + constructor(end?: boolean | null); + get end(): boolean | undefined; + set end(value: boolean | null | undefined); } /** -* Represents a Kaspa header PoW manager -* @category Mining -*/ + * Represents a Kaspa header PoW manager + * @category Mining + */ export class PoW { /** ** Return copy of self without private attributes. @@ -5973,356 +5829,234 @@ export class PoW { */ toString(): string; free(): void; -/** -* @param {Header | IHeader | IRawHeader} header -* @param {bigint | undefined} [timestamp] -*/ - constructor(header: Header | IHeader | IRawHeader, timestamp?: bigint); -/** -* Checks if the computed target meets or exceeds the difficulty specified in the template. -* @returns A boolean indicating if it reached the target and a bigint representing the reached target. -* @param {bigint} nonce -* @returns {[boolean, bigint]} -*/ + constructor(header: Header | IHeader | IRawHeader, timestamp?: bigint | null); + /** + * Checks if the computed target meets or exceeds the difficulty specified in the template. + * @returns A boolean indicating if it reached the target and a bigint representing the reached target. + */ checkWork(nonce: bigint): [boolean, bigint]; -/** -* Can be used for parsing Stratum templates. -* @param {string} pre_pow_hash -* @param {bigint} timestamp -* @param {number | undefined} [target_bits] -* @returns {PoW} -*/ - static fromRaw(pre_pow_hash: string, timestamp: bigint, target_bits?: number): PoW; -/** -* Hash of the header without timestamp and nonce. -*/ - readonly prePoWHash: string; -/** -* The target based on the provided bits. -*/ + /** + * Can be used for parsing Stratum templates. + */ + static fromRaw(pre_pow_hash: string, timestamp: bigint, target_bits?: number | null): PoW; + /** + * The target based on the provided bits. + */ readonly target: bigint; + /** + * Hash of the header without timestamp and nonce. + */ + readonly prePoWHash: string; } /** -* Data structure that envelops a Private Key. -* @category Wallet SDK -*/ + * Data structure that envelops a Private Key. + * @category Wallet SDK + */ export class PrivateKey { free(): void; -/** -* Create a new [`PrivateKey`] from a hex-encoded string. -* @param {string} key -*/ + /** + * Create a new [`PrivateKey`] from a hex-encoded string. + */ constructor(key: string); -/** -* Returns the [`PrivateKey`] key encoded as a hex string. -* @returns {string} -*/ + /** + * Returns the [`PrivateKey`] key encoded as a hex string. + */ toString(): string; -/** -* Generate a [`Keypair`] from this [`PrivateKey`]. -* @returns {Keypair} -*/ + /** + * Generate a [`Keypair`] from this [`PrivateKey`]. + */ toKeypair(): Keypair; -/** -* @returns {PublicKey} -*/ toPublicKey(): PublicKey; -/** -* Get the [`Address`] of the PublicKey generated from this PrivateKey. -* Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) -* to determine the prefix of the address. -* JavaScript: `let address = privateKey.toAddress(NetworkType.MAINNET);`. -* @param {NetworkType | NetworkId | string} network -* @returns {Address} -*/ + /** + * Get the [`Address`] of the PublicKey generated from this PrivateKey. + * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) + * to determine the prefix of the address. + * JavaScript: `let address = privateKey.toAddress(NetworkType.MAINNET);`. + */ toAddress(network: NetworkType | NetworkId | string): Address; -/** -* Get `ECDSA` [`Address`] of the PublicKey generated from this PrivateKey. -* Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) -* to determine the prefix of the address. -* JavaScript: `let address = privateKey.toAddress(NetworkType.MAINNET);`. -* @param {NetworkType | NetworkId | string} network -* @returns {Address} -*/ + /** + * Get `ECDSA` [`Address`] of the PublicKey generated from this PrivateKey. + * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) + * to determine the prefix of the address. + * JavaScript: `let address = privateKey.toAddress(NetworkType.MAINNET);`. + */ toAddressECDSA(network: NetworkType | NetworkId | string): Address; } /** -* -* Helper class to generate private keys from an extended private key (XPrv). -* This class accepts the master Kaspa XPrv string (e.g. `xprv1...`) and generates -* private keys for the receive and change paths given the pre-set parameters -* such as account index, multisig purpose and cosigner index. -* -* Please note that in Kaspa master private keys use `kprv` prefix. -* -* @see {@link PublicKeyGenerator}, {@link XPub}, {@link XPrv}, {@link Mnemonic} -* @category Wallet SDK -*/ + * + * Helper class to generate private keys from an extended private key (XPrv). + * This class accepts the master Kaspa XPrv string (e.g. `xprv1...`) and generates + * private keys for the receive and change paths given the pre-set parameters + * such as account index, multisig purpose and cosigner index. + * + * Please note that in Kaspa master private keys use `kprv` prefix. + * + * @see {@link PublicKeyGenerator}, {@link XPub}, {@link XPrv}, {@link Mnemonic} + * @category Wallet SDK + */ export class PrivateKeyGenerator { free(): void; -/** -* @param {XPrv | string} xprv -* @param {boolean} is_multisig -* @param {bigint} account_index -* @param {number | undefined} [cosigner_index] -*/ - constructor(xprv: XPrv | string, is_multisig: boolean, account_index: bigint, cosigner_index?: number); -/** -* @param {number} index -* @returns {PrivateKey} -*/ + constructor(xprv: XPrv | string, is_multisig: boolean, account_index: bigint, cosigner_index?: number | null); receiveKey(index: number): PrivateKey; -/** -* @param {number} index -* @returns {PrivateKey} -*/ changeKey(index: number): PrivateKey; } -/** -*/ export class ProcessSendOptions { free(): void; -/** -* @param {boolean | undefined} [swallow_errors] -*/ - constructor(swallow_errors?: boolean); -/** -*/ - swallow_errors?: boolean; + constructor(swallow_errors?: boolean | null); + get swallow_errors(): boolean | undefined; + set swallow_errors(value: boolean | null | undefined); } /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class PrvKeyDataInfo { + private constructor(); free(): void; -/** -* @param {string} _name -*/ setName(_name: string): void; -/** -*/ readonly id: string; -/** -*/ - readonly isEncrypted: any; -/** -*/ readonly name: any; + readonly isEncrypted: any; } /** -* Data structure that envelopes a PublicKey. -* Only supports Schnorr-based addresses. -* @category Wallet SDK -*/ + * Data structure that envelopes a PublicKey. + * Only supports Schnorr-based addresses. + * @category Wallet SDK + */ export class PublicKey { free(): void; -/** -* Create a new [`PublicKey`] from a hex-encoded string. -* @param {string} key -*/ + /** + * Create a new [`PublicKey`] from a hex-encoded string. + */ constructor(key: string); -/** -* @returns {string} -*/ toString(): string; -/** -* Get the [`Address`] of this PublicKey. -* Receives a [`NetworkType`] to determine the prefix of the address. -* JavaScript: `let address = publicKey.toAddress(NetworkType.MAINNET);`. -* @param {NetworkType | NetworkId | string} network -* @returns {Address} -*/ + /** + * Get the [`Address`] of this PublicKey. + * Receives a [`NetworkType`] to determine the prefix of the address. + * JavaScript: `let address = publicKey.toAddress(NetworkType.MAINNET);`. + */ toAddress(network: NetworkType | NetworkId | string): Address; -/** -* Get `ECDSA` [`Address`] of this PublicKey. -* Receives a [`NetworkType`] to determine the prefix of the address. -* JavaScript: `let address = publicKey.toAddress(NetworkType.MAINNET);`. -* @param {NetworkType | NetworkId | string} network -* @returns {Address} -*/ + /** + * Get `ECDSA` [`Address`] of this PublicKey. + * Receives a [`NetworkType`] to determine the prefix of the address. + * JavaScript: `let address = publicKey.toAddress(NetworkType.MAINNET);`. + */ toAddressECDSA(network: NetworkType | NetworkId | string): Address; -/** -* @returns {XOnlyPublicKey} -*/ toXOnlyPublicKey(): XOnlyPublicKey; -/** -* Compute a 4-byte key fingerprint for this public key as a hex string. -* Default implementation uses `RIPEMD160(SHA256(public_key))`. -* @returns {HexString | undefined} -*/ + /** + * Compute a 4-byte key fingerprint for this public key as a hex string. + * Default implementation uses `RIPEMD160(SHA256(public_key))`. + */ fingerprint(): HexString | undefined; } /** -* -* Helper class to generate public keys from an extended public key (XPub) -* that has been derived up to the co-signer index. -* -* Please note that in Kaspa master public keys use `kpub` prefix. -* -* @see {@link PrivateKeyGenerator}, {@link XPub}, {@link XPrv}, {@link Mnemonic} -* @category Wallet SDK -*/ + * + * Helper class to generate public keys from an extended public key (XPub) + * that has been derived up to the co-signer index. + * + * Please note that in Kaspa master public keys use `kpub` prefix. + * + * @see {@link PrivateKeyGenerator}, {@link XPub}, {@link XPrv}, {@link Mnemonic} + * @category Wallet SDK + */ export class PublicKeyGenerator { + private constructor(); free(): void; -/** -* @param {XPub | string} kpub -* @param {number | undefined} [cosigner_index] -* @returns {PublicKeyGenerator} -*/ - static fromXPub(kpub: XPub | string, cosigner_index?: number): PublicKeyGenerator; -/** -* @param {XPrv | string} xprv -* @param {boolean} is_multisig -* @param {bigint} account_index -* @param {number | undefined} [cosigner_index] -* @returns {PublicKeyGenerator} -*/ - static fromMasterXPrv(xprv: XPrv | string, is_multisig: boolean, account_index: bigint, cosigner_index?: number): PublicKeyGenerator; -/** -* Generate Receive Public Key derivations for a given range. -* @param {number} start -* @param {number} end -* @returns {(PublicKey | string)[]} -*/ + static fromXPub(kpub: XPub | string, cosigner_index?: number | null): PublicKeyGenerator; + static fromMasterXPrv(xprv: XPrv | string, is_multisig: boolean, account_index: bigint, cosigner_index?: number | null): PublicKeyGenerator; + /** + * Generate Receive Public Key derivations for a given range. + */ receivePubkeys(start: number, end: number): (PublicKey | string)[]; -/** -* Generate a single Receive Public Key derivation at a given index. -* @param {number} index -* @returns {PublicKey} -*/ + /** + * Generate a single Receive Public Key derivation at a given index. + */ receivePubkey(index: number): PublicKey; -/** -* Generate a range of Receive Public Key derivations and return them as strings. -* @param {number} start -* @param {number} end -* @returns {Array} -*/ + /** + * Generate a range of Receive Public Key derivations and return them as strings. + */ receivePubkeysAsStrings(start: number, end: number): Array; -/** -* Generate a single Receive Public Key derivation at a given index and return it as a string. -* @param {number} index -* @returns {string} -*/ + /** + * Generate a single Receive Public Key derivation at a given index and return it as a string. + */ receivePubkeyAsString(index: number): string; -/** -* Generate Receive Address derivations for a given range. -* @param {NetworkType | NetworkId | string} networkType -* @param {number} start -* @param {number} end -* @returns {Address[]} -*/ + /** + * Generate Receive Address derivations for a given range. + */ receiveAddresses(networkType: NetworkType | NetworkId | string, start: number, end: number): Address[]; -/** -* Generate a single Receive Address derivation at a given index. -* @param {NetworkType | NetworkId | string} networkType -* @param {number} index -* @returns {Address} -*/ + /** + * Generate a single Receive Address derivation at a given index. + */ receiveAddress(networkType: NetworkType | NetworkId | string, index: number): Address; -/** -* Generate a range of Receive Address derivations and return them as strings. -* @param {NetworkType | NetworkId | string} networkType -* @param {number} start -* @param {number} end -* @returns {Array} -*/ + /** + * Generate a range of Receive Address derivations and return them as strings. + */ receiveAddressAsStrings(networkType: NetworkType | NetworkId | string, start: number, end: number): Array; -/** -* Generate a single Receive Address derivation at a given index and return it as a string. -* @param {NetworkType | NetworkId | string} networkType -* @param {number} index -* @returns {string} -*/ + /** + * Generate a single Receive Address derivation at a given index and return it as a string. + */ receiveAddressAsString(networkType: NetworkType | NetworkId | string, index: number): string; -/** -* Generate Change Public Key derivations for a given range. -* @param {number} start -* @param {number} end -* @returns {(PublicKey | string)[]} -*/ + /** + * Generate Change Public Key derivations for a given range. + */ changePubkeys(start: number, end: number): (PublicKey | string)[]; -/** -* Generate a single Change Public Key derivation at a given index. -* @param {number} index -* @returns {PublicKey} -*/ + /** + * Generate a single Change Public Key derivation at a given index. + */ changePubkey(index: number): PublicKey; -/** -* Generate a range of Change Public Key derivations and return them as strings. -* @param {number} start -* @param {number} end -* @returns {Array} -*/ + /** + * Generate a range of Change Public Key derivations and return them as strings. + */ changePubkeysAsStrings(start: number, end: number): Array; -/** -* Generate a single Change Public Key derivation at a given index and return it as a string. -* @param {number} index -* @returns {string} -*/ + /** + * Generate a single Change Public Key derivation at a given index and return it as a string. + */ changePubkeyAsString(index: number): string; -/** -* Generate Change Address derivations for a given range. -* @param {NetworkType | NetworkId | string} networkType -* @param {number} start -* @param {number} end -* @returns {Address[]} -*/ + /** + * Generate Change Address derivations for a given range. + */ changeAddresses(networkType: NetworkType | NetworkId | string, start: number, end: number): Address[]; -/** -* Generate a single Change Address derivation at a given index. -* @param {NetworkType | NetworkId | string} networkType -* @param {number} index -* @returns {Address} -*/ + /** + * Generate a single Change Address derivation at a given index. + */ changeAddress(networkType: NetworkType | NetworkId | string, index: number): Address; -/** -* Generate a range of Change Address derivations and return them as strings. -* @param {NetworkType | NetworkId | string} networkType -* @param {number} start -* @param {number} end -* @returns {Array} -*/ + /** + * Generate a range of Change Address derivations and return them as strings. + */ changeAddressAsStrings(networkType: NetworkType | NetworkId | string, start: number, end: number): Array; -/** -* Generate a single Change Address derivation at a given index and return it as a string. -* @param {NetworkType | NetworkId | string} networkType -* @param {number} index -* @returns {string} -*/ + /** + * Generate a single Change Address derivation at a given index and return it as a string. + */ changeAddressAsString(networkType: NetworkType | NetworkId | string, index: number): string; -/** -* @returns {string} -*/ toString(): string; } /** -* -* Resolver is a client for obtaining public Kaspa wRPC URL. -* -* Resolver queries a list of public Kaspa Resolver URLs using HTTP to fetch -* wRPC endpoints for the given encoding, network identifier and other -* parameters. It then provides this information to the {@link RpcClient}. -* -* Each time {@link RpcClient} disconnects, it will query the resolver -* to fetch a new wRPC URL. -* -* ```javascript -* // using integrated public URLs -* let rpc = RpcClient({ -* resolver: new Resolver(), -* networkId : "mainnet" -* }); -* -* // specifying custom resolver URLs -* let rpc = RpcClient({ -* resolver: new Resolver({urls: ["",...]}), -* networkId : "mainnet" -* }); -* ``` -* -* @see {@link IResolverConfig}, {@link IResolverConnect}, {@link RpcClient} -* @category Node RPC -*/ + * + * Resolver is a client for obtaining public Kaspa wRPC URL. + * + * Resolver queries a list of public Kaspa Resolver URLs using HTTP to fetch + * wRPC endpoints for the given encoding, network identifier and other + * parameters. It then provides this information to the {@link RpcClient}. + * + * Each time {@link RpcClient} disconnects, it will query the resolver + * to fetch a new wRPC URL. + * + * ```javascript + * // using integrated public URLs + * let rpc = RpcClient({ + * resolver: new Resolver(), + * networkId : "mainnet" + * }); + * + * // specifying custom resolver URLs + * let rpc = RpcClient({ + * resolver: new Resolver({urls: ["",...]}), + * networkId : "mainnet" + * }); + * ``` + * + * @see {@link IResolverConfig}, {@link IResolverConnect}, {@link RpcClient} + * @category Node RPC + */ export class Resolver { /** ** Return copy of self without private attributes. @@ -6333,130 +6067,121 @@ export class Resolver { */ toString(): string; free(): void; -/** -* Fetches a public Kaspa wRPC endpoint for the given encoding and network identifier. -* @see {@link Encoding}, {@link NetworkId}, {@link Node} -* @param {Encoding} encoding -* @param {NetworkId | string} network_id -* @returns {Promise} -*/ + /** + * Fetches a public Kaspa wRPC endpoint for the given encoding and network identifier. + * @see {@link Encoding}, {@link NetworkId}, {@link Node} + */ getNode(encoding: Encoding, network_id: NetworkId | string): Promise; -/** -* Fetches a public Kaspa wRPC endpoint URL for the given encoding and network identifier. -* @see {@link Encoding}, {@link NetworkId} -* @param {Encoding} encoding -* @param {NetworkId | string} network_id -* @returns {Promise} -*/ + /** + * Fetches a public Kaspa wRPC endpoint URL for the given encoding and network identifier. + * @see {@link Encoding}, {@link NetworkId} + */ getUrl(encoding: Encoding, network_id: NetworkId | string): Promise; -/** -* Connect to a public Kaspa wRPC endpoint for the given encoding and network identifier -* supplied via {@link IResolverConnect} interface. -* @see {@link IResolverConnect}, {@link RpcClient} -* @param {IResolverConnect | NetworkId | string} options -* @returns {Promise} -*/ + /** + * Connect to a public Kaspa wRPC endpoint for the given encoding and network identifier + * supplied via {@link IResolverConnect} interface. + * @see {@link IResolverConnect}, {@link RpcClient} + */ connect(options: IResolverConnect | NetworkId | string): Promise; -/** -* Creates a new Resolver client with the given -* configuration supplied as {@link IResolverConfig} -* interface. If not supplied, the default configuration -* containing a list of community-operated resolvers -* will be used. -* @param {IResolverConfig | string[] | undefined} [args] -*/ - constructor(args?: IResolverConfig | string[]); -/** -* List of public Kaspa Resolver URLs. -*/ + /** + * Creates a new Resolver client with the given + * configuration supplied as {@link IResolverConfig} + * interface. If not supplied, the default configuration + * containing a list of community-operated resolvers + * will be used. + */ + constructor(args?: IResolverConfig | string[] | null); + /** + * List of public Kaspa Resolver URLs. + */ readonly urls: string[] | undefined; } /** -* -* -* Kaspa RPC client uses ([wRPC](https://github.com/workflow-rs/workflow-rs/tree/master/rpc)) -* interface to connect directly with Kaspa Node. wRPC supports -* two types of encodings: `borsh` (binary, default) and `json`. -* -* There are two ways to connect: Directly to any Kaspa Node or to a -* community-maintained public node infrastructure using the {@link Resolver} class. -* -* **Connecting to a public node using a resolver** -* -* ```javascript -* let rpc = new RpcClient({ -* resolver : new Resolver(), -* networkId : "mainnet", -* }); -* -* await rpc.connect(); -* ``` -* -* **Connecting to a Kaspa Node directly** -* -* ```javascript -* let rpc = new RpcClient({ -* // if port is not provided it will default -* // to the default port for the networkId -* url : "127.0.0.1", -* networkId : "mainnet", -* }); -* ``` -* -* **Example usage** -* -* ```javascript -* -* // Create a new RPC client with a URL -* let rpc = new RpcClient({ url : "wss://" }); -* -* // Create a new RPC client with a resolver -* // (networkId is required when using a resolver) -* let rpc = new RpcClient({ -* resolver : new Resolver(), -* networkId : "mainnet", -* }); -* -* rpc.addEventListener("connect", async (event) => { -* console.log("Connected to", rpc.url); -* await rpc.subscribeDaaScore(); -* }); -* -* rpc.addEventListener("disconnect", (event) => { -* console.log("Disconnected from", rpc.url); -* }); -* -* try { -* await rpc.connect(); -* } catch(err) { -* console.log("Error connecting:", err); -* } -* -* ``` -* -* You can register event listeners to receive notifications from the RPC client -* using {@link RpcClient.addEventListener} and {@link RpcClient.removeEventListener} functions. -* -* **IMPORTANT:** If RPC is disconnected, upon reconnection you do not need -* to re-register event listeners, but your have to re-subscribe for Kaspa node -* notifications: -* -* ```typescript -* rpc.addEventListener("connect", async (event) => { -* console.log("Connected to", rpc.url); -* // re-subscribe each time we connect -* await rpc.subscribeDaaScore(); -* // ... perform wallet address subscriptions -* }); -* -* ``` -* -* If using NodeJS, it is important that {@link RpcClient.disconnect} is called before -* the process exits to ensure that the WebSocket connection is properly closed. -* Failure to do this will prevent the process from exiting. -* -* @category Node RPC -*/ + * + * + * Kaspa RPC client uses ([wRPC](https://github.com/workflow-rs/workflow-rs/tree/master/rpc)) + * interface to connect directly with Kaspa Node. wRPC supports + * two types of encodings: `borsh` (binary, default) and `json`. + * + * There are two ways to connect: Directly to any Kaspa Node or to a + * community-maintained public node infrastructure using the {@link Resolver} class. + * + * **Connecting to a public node using a resolver** + * + * ```javascript + * let rpc = new RpcClient({ + * resolver : new Resolver(), + * networkId : "mainnet", + * }); + * + * await rpc.connect(); + * ``` + * + * **Connecting to a Kaspa Node directly** + * + * ```javascript + * let rpc = new RpcClient({ + * // if port is not provided it will default + * // to the default port for the networkId + * url : "127.0.0.1", + * networkId : "mainnet", + * }); + * ``` + * + * **Example usage** + * + * ```javascript + * + * // Create a new RPC client with a URL + * let rpc = new RpcClient({ url : "wss://" }); + * + * // Create a new RPC client with a resolver + * // (networkId is required when using a resolver) + * let rpc = new RpcClient({ + * resolver : new Resolver(), + * networkId : "mainnet", + * }); + * + * rpc.addEventListener("connect", async (event) => { + * console.log("Connected to", rpc.url); + * await rpc.subscribeDaaScore(); + * }); + * + * rpc.addEventListener("disconnect", (event) => { + * console.log("Disconnected from", rpc.url); + * }); + * + * try { + * await rpc.connect(); + * } catch(err) { + * console.log("Error connecting:", err); + * } + * + * ``` + * + * You can register event listeners to receive notifications from the RPC client + * using {@link RpcClient.addEventListener} and {@link RpcClient.removeEventListener} functions. + * + * **IMPORTANT:** If RPC is disconnected, upon reconnection you do not need + * to re-register event listeners, but your have to re-subscribe for Kaspa node + * notifications: + * + * ```typescript + * rpc.addEventListener("connect", async (event) => { + * console.log("Connected to", rpc.url); + * // re-subscribe each time we connect + * await rpc.subscribeDaaScore(); + * // ... perform wallet address subscriptions + * }); + * + * ``` + * + * If using NodeJS, it is important that {@link RpcClient.disconnect} is called before + * the process exits to ensure that the WebSocket connection is properly closed. + * Failure to do this will prevent the process from exiting. + * + * @category Node RPC + */ export class RpcClient { /** ** Return copy of self without private attributes. @@ -6467,614 +6192,482 @@ export class RpcClient { */ toString(): string; free(): void; -/** -* Retrieves the current number of blocks in the Kaspa BlockDAG. -* This is not a block count, not a "block height" and can not be -* used for transaction validation. -* Returned information: Current block count. -*@see {@link IGetBlockCountRequest}, {@link IGetBlockCountResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetBlockCountRequest | undefined} [request] -* @returns {Promise} -*/ - getBlockCount(request?: IGetBlockCountRequest): Promise; -/** -* Provides information about the Directed Acyclic Graph (DAG) -* structure of the Kaspa BlockDAG. -* Returned information: Number of blocks in the DAG, -* number of tips in the DAG, hash of the selected parent block, -* difficulty of the selected parent block, selected parent block -* blue score, selected parent block time. -*@see {@link IGetBlockDagInfoRequest}, {@link IGetBlockDagInfoResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetBlockDagInfoRequest | undefined} [request] -* @returns {Promise} -*/ - getBlockDagInfo(request?: IGetBlockDagInfoRequest): Promise; -/** -* Returns the total current coin supply of Kaspa network. -* Returned information: Total coin supply. -*@see {@link IGetCoinSupplyRequest}, {@link IGetCoinSupplyResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetCoinSupplyRequest | undefined} [request] -* @returns {Promise} -*/ - getCoinSupply(request?: IGetCoinSupplyRequest): Promise; -/** -* Retrieves information about the peers connected to the Kaspa node. -* Returned information: Peer ID, IP address and port, connection -* status, protocol version. -*@see {@link IGetConnectedPeerInfoRequest}, {@link IGetConnectedPeerInfoResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetConnectedPeerInfoRequest | undefined} [request] -* @returns {Promise} -*/ - getConnectedPeerInfo(request?: IGetConnectedPeerInfoRequest): Promise; -/** -* Retrieves general information about the Kaspa node. -* Returned information: Version of the Kaspa node, protocol -* version, network identifier. -* This call is primarily used by gRPC clients. -* For wRPC clients, use {@link RpcClient.getServerInfo}. -*@see {@link IGetInfoRequest}, {@link IGetInfoResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetInfoRequest | undefined} [request] -* @returns {Promise} -*/ - getInfo(request?: IGetInfoRequest): Promise; -/** -* Provides a list of addresses of known peers in the Kaspa -* network that the node can potentially connect to. -* Returned information: List of peer addresses. -*@see {@link IGetPeerAddressesRequest}, {@link IGetPeerAddressesResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetPeerAddressesRequest | undefined} [request] -* @returns {Promise} -*/ - getPeerAddresses(request?: IGetPeerAddressesRequest): Promise; -/** -* Retrieves various metrics and statistics related to the -* performance and status of the Kaspa node. -* Returned information: Memory usage, CPU usage, network activity. -*@see {@link IGetMetricsRequest}, {@link IGetMetricsResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetMetricsRequest | undefined} [request] -* @returns {Promise} -*/ - getMetrics(request?: IGetMetricsRequest): Promise; -/** -* Retrieves current number of network connections -*@see {@link IGetConnectionsRequest}, {@link IGetConnectionsResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetConnectionsRequest | undefined} [request] -* @returns {Promise} -*/ - getConnections(request?: IGetConnectionsRequest): Promise; -/** -* Retrieves the current sink block, which is the block with -* the highest cumulative difficulty in the Kaspa BlockDAG. -* Returned information: Sink block hash, sink block height. -*@see {@link IGetSinkRequest}, {@link IGetSinkResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetSinkRequest | undefined} [request] -* @returns {Promise} -*/ - getSink(request?: IGetSinkRequest): Promise; -/** -* Returns the blue score of the current sink block, indicating -* the total amount of work that has been done on the main chain -* leading up to that block. -* Returned information: Blue score of the sink block. -*@see {@link IGetSinkBlueScoreRequest}, {@link IGetSinkBlueScoreResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetSinkBlueScoreRequest | undefined} [request] -* @returns {Promise} -*/ - getSinkBlueScore(request?: IGetSinkBlueScoreRequest): Promise; -/** -* Tests the connection and responsiveness of a Kaspa node. -* Returned information: None. -*@see {@link IPingRequest}, {@link IPingResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IPingRequest | undefined} [request] -* @returns {Promise} -*/ - ping(request?: IPingRequest): Promise; -/** -* Gracefully shuts down the Kaspa node. -* Returned information: None. -*@see {@link IShutdownRequest}, {@link IShutdownResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IShutdownRequest | undefined} [request] -* @returns {Promise} -*/ - shutdown(request?: IShutdownRequest): Promise; -/** -* Retrieves information about the Kaspa server. -* Returned information: Version of the Kaspa server, protocol -* version, network identifier. -*@see {@link IGetServerInfoRequest}, {@link IGetServerInfoResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetServerInfoRequest | undefined} [request] -* @returns {Promise} -*/ - getServerInfo(request?: IGetServerInfoRequest): Promise; -/** -* Obtains basic information about the synchronization status of the Kaspa node. -* Returned information: Syncing status. -*@see {@link IGetSyncStatusRequest}, {@link IGetSyncStatusResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetSyncStatusRequest | undefined} [request] -* @returns {Promise} -*/ - getSyncStatus(request?: IGetSyncStatusRequest): Promise; -/** -* Feerate estimates -*@see {@link IGetFeeEstimateRequest}, {@link IGetFeeEstimateResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetFeeEstimateRequest | undefined} [request] -* @returns {Promise} -*/ - getFeeEstimate(request?: IGetFeeEstimateRequest): Promise; -/** -* Retrieves the current network configuration. -* Returned information: Current network configuration. -*@see {@link IGetCurrentNetworkRequest}, {@link IGetCurrentNetworkResponse} -*@throws `string` on an RPC error or a server-side error. -* @param {IGetCurrentNetworkRequest | undefined} [request] -* @returns {Promise} -*/ - getCurrentNetwork(request?: IGetCurrentNetworkRequest): Promise; -/** -* Adds a peer to the Kaspa node's list of known peers. -* Returned information: None. -*@see {@link IAddPeerRequest}, {@link IAddPeerResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IAddPeerRequest} request -* @returns {Promise} -*/ + /** + * Retrieves the current number of blocks in the Kaspa BlockDAG. + * This is not a block count, not a "block height" and can not be + * used for transaction validation. + * Returned information: Current block count. + * @see {@link IGetBlockCountRequest}, {@link IGetBlockCountResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getBlockCount(request?: IGetBlockCountRequest | null): Promise; + /** + * Provides information about the Directed Acyclic Graph (DAG) + * structure of the Kaspa BlockDAG. + * Returned information: Number of blocks in the DAG, + * number of tips in the DAG, hash of the selected parent block, + * difficulty of the selected parent block, selected parent block + * blue score, selected parent block time. + * @see {@link IGetBlockDagInfoRequest}, {@link IGetBlockDagInfoResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getBlockDagInfo(request?: IGetBlockDagInfoRequest | null): Promise; + /** + * Returns the total current coin supply of Kaspa network. + * Returned information: Total coin supply. + * @see {@link IGetCoinSupplyRequest}, {@link IGetCoinSupplyResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getCoinSupply(request?: IGetCoinSupplyRequest | null): Promise; + /** + * Retrieves information about the peers connected to the Kaspa node. + * Returned information: Peer ID, IP address and port, connection + * status, protocol version. + * @see {@link IGetConnectedPeerInfoRequest}, {@link IGetConnectedPeerInfoResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getConnectedPeerInfo(request?: IGetConnectedPeerInfoRequest | null): Promise; + /** + * Retrieves general information about the Kaspa node. + * Returned information: Version of the Kaspa node, protocol + * version, network identifier. + * This call is primarily used by gRPC clients. + * For wRPC clients, use {@link RpcClient.getServerInfo}. + * @see {@link IGetInfoRequest}, {@link IGetInfoResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getInfo(request?: IGetInfoRequest | null): Promise; + /** + * Provides a list of addresses of known peers in the Kaspa + * network that the node can potentially connect to. + * Returned information: List of peer addresses. + * @see {@link IGetPeerAddressesRequest}, {@link IGetPeerAddressesResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getPeerAddresses(request?: IGetPeerAddressesRequest | null): Promise; + /** + * Retrieves various metrics and statistics related to the + * performance and status of the Kaspa node. + * Returned information: Memory usage, CPU usage, network activity. + * @see {@link IGetMetricsRequest}, {@link IGetMetricsResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getMetrics(request?: IGetMetricsRequest | null): Promise; + /** + * Retrieves current number of network connections + * @see {@link IGetConnectionsRequest}, {@link IGetConnectionsResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getConnections(request?: IGetConnectionsRequest | null): Promise; + /** + * Retrieves the current sink block, which is the block with + * the highest cumulative difficulty in the Kaspa BlockDAG. + * Returned information: Sink block hash, sink block height. + * @see {@link IGetSinkRequest}, {@link IGetSinkResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getSink(request?: IGetSinkRequest | null): Promise; + /** + * Returns the blue score of the current sink block, indicating + * the total amount of work that has been done on the main chain + * leading up to that block. + * Returned information: Blue score of the sink block. + * @see {@link IGetSinkBlueScoreRequest}, {@link IGetSinkBlueScoreResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getSinkBlueScore(request?: IGetSinkBlueScoreRequest | null): Promise; + /** + * Tests the connection and responsiveness of a Kaspa node. + * Returned information: None. + * @see {@link IPingRequest}, {@link IPingResponse} + * @throws `string` on an RPC error or a server-side error. + */ + ping(request?: IPingRequest | null): Promise; + /** + * Gracefully shuts down the Kaspa node. + * Returned information: None. + * @see {@link IShutdownRequest}, {@link IShutdownResponse} + * @throws `string` on an RPC error or a server-side error. + */ + shutdown(request?: IShutdownRequest | null): Promise; + /** + * Retrieves information about the Kaspa server. + * Returned information: Version of the Kaspa server, protocol + * version, network identifier. + * @see {@link IGetServerInfoRequest}, {@link IGetServerInfoResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getServerInfo(request?: IGetServerInfoRequest | null): Promise; + /** + * Obtains basic information about the synchronization status of the Kaspa node. + * Returned information: Syncing status. + * @see {@link IGetSyncStatusRequest}, {@link IGetSyncStatusResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getSyncStatus(request?: IGetSyncStatusRequest | null): Promise; + /** + * Feerate estimates + * @see {@link IGetFeeEstimateRequest}, {@link IGetFeeEstimateResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getFeeEstimate(request?: IGetFeeEstimateRequest | null): Promise; + /** + * Retrieves the current network configuration. + * Returned information: Current network configuration. + * @see {@link IGetCurrentNetworkRequest}, {@link IGetCurrentNetworkResponse} + * @throws `string` on an RPC error or a server-side error. + */ + getCurrentNetwork(request?: IGetCurrentNetworkRequest | null): Promise; + /** + * Adds a peer to the Kaspa node's list of known peers. + * Returned information: None. + * @see {@link IAddPeerRequest}, {@link IAddPeerResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ addPeer(request: IAddPeerRequest): Promise; -/** -* Bans a peer from connecting to the Kaspa node for a specified duration. -* Returned information: None. -*@see {@link IBanRequest}, {@link IBanResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IBanRequest} request -* @returns {Promise} -*/ + /** + * Bans a peer from connecting to the Kaspa node for a specified duration. + * Returned information: None. + * @see {@link IBanRequest}, {@link IBanResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ ban(request: IBanRequest): Promise; -/** -* Estimates the network's current hash rate in hashes per second. -* Returned information: Estimated network hashes per second. -*@see {@link IEstimateNetworkHashesPerSecondRequest}, {@link IEstimateNetworkHashesPerSecondResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IEstimateNetworkHashesPerSecondRequest} request -* @returns {Promise} -*/ + /** + * Estimates the network's current hash rate in hashes per second. + * Returned information: Estimated network hashes per second. + * @see {@link IEstimateNetworkHashesPerSecondRequest}, {@link IEstimateNetworkHashesPerSecondResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ estimateNetworkHashesPerSecond(request: IEstimateNetworkHashesPerSecondRequest): Promise; -/** -* Retrieves the balance of a specific address in the Kaspa BlockDAG. -* Returned information: Balance of the address. -*@see {@link IGetBalanceByAddressRequest}, {@link IGetBalanceByAddressResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetBalanceByAddressRequest} request -* @returns {Promise} -*/ + /** + * Retrieves the balance of a specific address in the Kaspa BlockDAG. + * Returned information: Balance of the address. + * @see {@link IGetBalanceByAddressRequest}, {@link IGetBalanceByAddressResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getBalanceByAddress(request: IGetBalanceByAddressRequest): Promise; -/** -* Retrieves balances for multiple addresses in the Kaspa BlockDAG. -* Returned information: Balances of the addresses. -*@see {@link IGetBalancesByAddressesRequest}, {@link IGetBalancesByAddressesResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetBalancesByAddressesRequest | Address[] | string[]} request -* @returns {Promise} -*/ + /** + * Retrieves balances for multiple addresses in the Kaspa BlockDAG. + * Returned information: Balances of the addresses. + * @see {@link IGetBalancesByAddressesRequest}, {@link IGetBalancesByAddressesResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getBalancesByAddresses(request: IGetBalancesByAddressesRequest | Address[] | string[]): Promise; -/** -* Retrieves a specific block from the Kaspa BlockDAG. -* Returned information: Block information. -*@see {@link IGetBlockRequest}, {@link IGetBlockResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetBlockRequest} request -* @returns {Promise} -*/ + /** + * Retrieves a specific block from the Kaspa BlockDAG. + * Returned information: Block information. + * @see {@link IGetBlockRequest}, {@link IGetBlockResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getBlock(request: IGetBlockRequest): Promise; -/** -* Retrieves multiple blocks from the Kaspa BlockDAG. -* Returned information: List of block information. -*@see {@link IGetBlocksRequest}, {@link IGetBlocksResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetBlocksRequest} request -* @returns {Promise} -*/ + /** + * Retrieves multiple blocks from the Kaspa BlockDAG. + * Returned information: List of block information. + * @see {@link IGetBlocksRequest}, {@link IGetBlocksResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getBlocks(request: IGetBlocksRequest): Promise; -/** -* Generates a new block template for mining. -* Returned information: Block template information. -*@see {@link IGetBlockTemplateRequest}, {@link IGetBlockTemplateResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetBlockTemplateRequest} request -* @returns {Promise} -*/ + /** + * Generates a new block template for mining. + * Returned information: Block template information. + * @see {@link IGetBlockTemplateRequest}, {@link IGetBlockTemplateResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getBlockTemplate(request: IGetBlockTemplateRequest): Promise; -/** -* Checks if block is blue or not. -* Returned information: Block blueness. -*@see {@link IGetCurrentBlockColorRequest}, {@link IGetCurrentBlockColorResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetCurrentBlockColorRequest} request -* @returns {Promise} -*/ + /** + * Checks if block is blue or not. + * Returned information: Block blueness. + * @see {@link IGetCurrentBlockColorRequest}, {@link IGetCurrentBlockColorResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getCurrentBlockColor(request: IGetCurrentBlockColorRequest): Promise; -/** -* Retrieves the estimated DAA (Difficulty Adjustment Algorithm) -* score timestamp estimate. -* Returned information: DAA score timestamp estimate. -*@see {@link IGetDaaScoreTimestampEstimateRequest}, {@link IGetDaaScoreTimestampEstimateResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetDaaScoreTimestampEstimateRequest} request -* @returns {Promise} -*/ + /** + * Retrieves the estimated DAA (Difficulty Adjustment Algorithm) + * score timestamp estimate. + * Returned information: DAA score timestamp estimate. + * @see {@link IGetDaaScoreTimestampEstimateRequest}, {@link IGetDaaScoreTimestampEstimateResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getDaaScoreTimestampEstimate(request: IGetDaaScoreTimestampEstimateRequest): Promise; -/** -* Feerate estimates (experimental) -*@see {@link IGetFeeEstimateExperimentalRequest}, {@link IGetFeeEstimateExperimentalResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetFeeEstimateExperimentalRequest} request -* @returns {Promise} -*/ + /** + * Feerate estimates (experimental) + * @see {@link IGetFeeEstimateExperimentalRequest}, {@link IGetFeeEstimateExperimentalResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getFeeEstimateExperimental(request: IGetFeeEstimateExperimentalRequest): Promise; -/** -* Retrieves block headers from the Kaspa BlockDAG. -* Returned information: List of block headers. -*@see {@link IGetHeadersRequest}, {@link IGetHeadersResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetHeadersRequest} request -* @returns {Promise} -*/ + /** + * Retrieves block headers from the Kaspa BlockDAG. + * Returned information: List of block headers. + * @see {@link IGetHeadersRequest}, {@link IGetHeadersResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getHeaders(request: IGetHeadersRequest): Promise; -/** -* Retrieves mempool entries from the Kaspa node's mempool. -* Returned information: List of mempool entries. -*@see {@link IGetMempoolEntriesRequest}, {@link IGetMempoolEntriesResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetMempoolEntriesRequest} request -* @returns {Promise} -*/ + /** + * Retrieves mempool entries from the Kaspa node's mempool. + * Returned information: List of mempool entries. + * @see {@link IGetMempoolEntriesRequest}, {@link IGetMempoolEntriesResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getMempoolEntries(request: IGetMempoolEntriesRequest): Promise; -/** -* Retrieves mempool entries associated with specific addresses. -* Returned information: List of mempool entries. -*@see {@link IGetMempoolEntriesByAddressesRequest}, {@link IGetMempoolEntriesByAddressesResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetMempoolEntriesByAddressesRequest} request -* @returns {Promise} -*/ + /** + * Retrieves mempool entries associated with specific addresses. + * Returned information: List of mempool entries. + * @see {@link IGetMempoolEntriesByAddressesRequest}, {@link IGetMempoolEntriesByAddressesResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getMempoolEntriesByAddresses(request: IGetMempoolEntriesByAddressesRequest): Promise; -/** -* Retrieves a specific mempool entry by transaction ID. -* Returned information: Mempool entry information. -*@see {@link IGetMempoolEntryRequest}, {@link IGetMempoolEntryResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetMempoolEntryRequest} request -* @returns {Promise} -*/ + /** + * Retrieves a specific mempool entry by transaction ID. + * Returned information: Mempool entry information. + * @see {@link IGetMempoolEntryRequest}, {@link IGetMempoolEntryResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getMempoolEntry(request: IGetMempoolEntryRequest): Promise; -/** -* Retrieves information about a subnetwork in the Kaspa BlockDAG. -* Returned information: Subnetwork information. -*@see {@link IGetSubnetworkRequest}, {@link IGetSubnetworkResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetSubnetworkRequest} request -* @returns {Promise} -*/ + /** + * Retrieves information about a subnetwork in the Kaspa BlockDAG. + * Returned information: Subnetwork information. + * @see {@link IGetSubnetworkRequest}, {@link IGetSubnetworkResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getSubnetwork(request: IGetSubnetworkRequest): Promise; -/** -* Retrieves unspent transaction outputs (UTXOs) associated with -* specific addresses. -* Returned information: List of UTXOs. -*@see {@link IGetUtxosByAddressesRequest}, {@link IGetUtxosByAddressesResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetUtxosByAddressesRequest | Address[] | string[]} request -* @returns {Promise} -*/ + /** + * Retrieves unspent transaction outputs (UTXOs) associated with + * specific addresses. + * Returned information: List of UTXOs. + * @see {@link IGetUtxosByAddressesRequest}, {@link IGetUtxosByAddressesResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getUtxosByAddresses(request: IGetUtxosByAddressesRequest | Address[] | string[]): Promise; -/** -* Retrieves the virtual chain corresponding to a specified block hash. -* Returned information: Virtual chain information. -*@see {@link IGetVirtualChainFromBlockRequest}, {@link IGetVirtualChainFromBlockResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IGetVirtualChainFromBlockRequest} request -* @returns {Promise} -*/ + /** + * Retrieves the virtual chain corresponding to a specified block hash. + * Returned information: Virtual chain information. + * @see {@link IGetVirtualChainFromBlockRequest}, {@link IGetVirtualChainFromBlockResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ getVirtualChainFromBlock(request: IGetVirtualChainFromBlockRequest): Promise; -/** -* Resolves a finality conflict in the Kaspa BlockDAG. -* Returned information: None. -*@see {@link IResolveFinalityConflictRequest}, {@link IResolveFinalityConflictResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IResolveFinalityConflictRequest} request -* @returns {Promise} -*/ + /** + * Resolves a finality conflict in the Kaspa BlockDAG. + * Returned information: None. + * @see {@link IResolveFinalityConflictRequest}, {@link IResolveFinalityConflictResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ resolveFinalityConflict(request: IResolveFinalityConflictRequest): Promise; -/** -* Submits a block to the Kaspa network. -* Returned information: None. -*@see {@link ISubmitBlockRequest}, {@link ISubmitBlockResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {ISubmitBlockRequest} request -* @returns {Promise} -*/ + /** + * Submits a block to the Kaspa network. + * Returned information: None. + * @see {@link ISubmitBlockRequest}, {@link ISubmitBlockResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ submitBlock(request: ISubmitBlockRequest): Promise; -/** -* Submits a transaction to the Kaspa network. -* Returned information: Submitted Transaction Id. -*@see {@link ISubmitTransactionRequest}, {@link ISubmitTransactionResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {ISubmitTransactionRequest} request -* @returns {Promise} -*/ + /** + * Submits a transaction to the Kaspa network. + * Returned information: Submitted Transaction Id. + * @see {@link ISubmitTransactionRequest}, {@link ISubmitTransactionResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ submitTransaction(request: ISubmitTransactionRequest): Promise; -/** -* Submits an RBF transaction to the Kaspa network. -* Returned information: Submitted Transaction Id, Transaction that was replaced. -*@see {@link ISubmitTransactionReplacementRequest}, {@link ISubmitTransactionReplacementResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {ISubmitTransactionReplacementRequest} request -* @returns {Promise} -*/ + /** + * Submits an RBF transaction to the Kaspa network. + * Returned information: Submitted Transaction Id, Transaction that was replaced. + * @see {@link ISubmitTransactionReplacementRequest}, {@link ISubmitTransactionReplacementResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ submitTransactionReplacement(request: ISubmitTransactionReplacementRequest): Promise; -/** -* Unbans a previously banned peer, allowing it to connect -* to the Kaspa node again. -* Returned information: None. -*@see {@link IUnbanRequest}, {@link IUnbanResponse} -*@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. -* @param {IUnbanRequest} request -* @returns {Promise} -*/ + /** + * Unbans a previously banned peer, allowing it to connect + * to the Kaspa node again. + * Returned information: None. + * @see {@link IUnbanRequest}, {@link IUnbanResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + */ unban(request: IUnbanRequest): Promise; -/** -* Manage subscription for a block added notification event. -* Block added notification event is produced when a new -* block is added to the Kaspa BlockDAG. -* @returns {Promise} -*/ + /** + * Manage subscription for a block added notification event. + * Block added notification event is produced when a new + * block is added to the Kaspa BlockDAG. + */ subscribeBlockAdded(): Promise; -/** -* @returns {Promise} -*/ unsubscribeBlockAdded(): Promise; -/** -* Manage subscription for a finality conflict notification event. -* Finality conflict notification event is produced when a finality -* conflict occurs in the Kaspa BlockDAG. -* @returns {Promise} -*/ + /** + * Manage subscription for a finality conflict notification event. + * Finality conflict notification event is produced when a finality + * conflict occurs in the Kaspa BlockDAG. + */ subscribeFinalityConflict(): Promise; -/** -* @returns {Promise} -*/ unsubscribeFinalityConflict(): Promise; -/** -* Manage subscription for a finality conflict resolved notification event. -* Finality conflict resolved notification event is produced when a finality -* conflict in the Kaspa BlockDAG is resolved. -* @returns {Promise} -*/ + /** + * Manage subscription for a finality conflict resolved notification event. + * Finality conflict resolved notification event is produced when a finality + * conflict in the Kaspa BlockDAG is resolved. + */ subscribeFinalityConflictResolved(): Promise; -/** -* @returns {Promise} -*/ unsubscribeFinalityConflictResolved(): Promise; -/** -* Manage subscription for a sink blue score changed notification event. -* Sink blue score changed notification event is produced when the blue -* score of the sink block changes in the Kaspa BlockDAG. -* @returns {Promise} -*/ + /** + * Manage subscription for a sink blue score changed notification event. + * Sink blue score changed notification event is produced when the blue + * score of the sink block changes in the Kaspa BlockDAG. + */ subscribeSinkBlueScoreChanged(): Promise; -/** -* @returns {Promise} -*/ unsubscribeSinkBlueScoreChanged(): Promise; -/** -* Manage subscription for a pruning point UTXO set override notification event. -* Pruning point UTXO set override notification event is produced when the -* UTXO set override for the pruning point changes in the Kaspa BlockDAG. -* @returns {Promise} -*/ + /** + * Manage subscription for a pruning point UTXO set override notification event. + * Pruning point UTXO set override notification event is produced when the + * UTXO set override for the pruning point changes in the Kaspa BlockDAG. + */ subscribePruningPointUtxoSetOverride(): Promise; -/** -* @returns {Promise} -*/ unsubscribePruningPointUtxoSetOverride(): Promise; -/** -* Manage subscription for a new block template notification event. -* New block template notification event is produced when a new block -* template is generated for mining in the Kaspa BlockDAG. -* @returns {Promise} -*/ + /** + * Manage subscription for a new block template notification event. + * New block template notification event is produced when a new block + * template is generated for mining in the Kaspa BlockDAG. + */ subscribeNewBlockTemplate(): Promise; -/** -* @returns {Promise} -*/ unsubscribeNewBlockTemplate(): Promise; -/** -* Manage subscription for a virtual DAA score changed notification event. -* Virtual DAA score changed notification event is produced when the virtual -* Difficulty Adjustment Algorithm (DAA) score changes in the Kaspa BlockDAG. -* @returns {Promise} -*/ + /** + * Manage subscription for a virtual DAA score changed notification event. + * Virtual DAA score changed notification event is produced when the virtual + * Difficulty Adjustment Algorithm (DAA) score changes in the Kaspa BlockDAG. + */ subscribeVirtualDaaScoreChanged(): Promise; -/** -* Manage subscription for a virtual DAA score changed notification event. -* Virtual DAA score changed notification event is produced when the virtual -* Difficulty Adjustment Algorithm (DAA) score changes in the Kaspa BlockDAG. -* @returns {Promise} -*/ + /** + * Manage subscription for a virtual DAA score changed notification event. + * Virtual DAA score changed notification event is produced when the virtual + * Difficulty Adjustment Algorithm (DAA) score changes in the Kaspa BlockDAG. + */ unsubscribeVirtualDaaScoreChanged(): Promise; -/** -* Subscribe for a UTXOs changed notification event. -* UTXOs changed notification event is produced when the set -* of unspent transaction outputs (UTXOs) changes in the -* Kaspa BlockDAG. The event notification will be scoped to the -* provided list of addresses. -* @param {(Address | string)[]} addresses -* @returns {Promise} -*/ + /** + * Subscribe for a UTXOs changed notification event. + * UTXOs changed notification event is produced when the set + * of unspent transaction outputs (UTXOs) changes in the + * Kaspa BlockDAG. The event notification will be scoped to the + * provided list of addresses. + */ subscribeUtxosChanged(addresses: (Address | string)[]): Promise; -/** -* Unsubscribe from UTXOs changed notification event -* for a specific set of addresses. -* @param {(Address | string)[]} addresses -* @returns {Promise} -*/ + /** + * Unsubscribe from UTXOs changed notification event + * for a specific set of addresses. + */ unsubscribeUtxosChanged(addresses: (Address | string)[]): Promise; -/** -* Manage subscription for a virtual chain changed notification event. -* Virtual chain changed notification event is produced when the virtual -* chain changes in the Kaspa BlockDAG. -* @param {boolean} include_accepted_transaction_ids -* @returns {Promise} -*/ + /** + * Manage subscription for a virtual chain changed notification event. + * Virtual chain changed notification event is produced when the virtual + * chain changes in the Kaspa BlockDAG. + */ subscribeVirtualChainChanged(include_accepted_transaction_ids: boolean): Promise; -/** -* Manage subscription for a virtual chain changed notification event. -* Virtual chain changed notification event is produced when the virtual -* chain changes in the Kaspa BlockDAG. -* @param {boolean} include_accepted_transaction_ids -* @returns {Promise} -*/ + /** + * Manage subscription for a virtual chain changed notification event. + * Virtual chain changed notification event is produced when the virtual + * chain changes in the Kaspa BlockDAG. + */ unsubscribeVirtualChainChanged(include_accepted_transaction_ids: boolean): Promise; -/** -* @param {Encoding} encoding -* @param {NetworkType | NetworkId | string} network -* @returns {number} -*/ static defaultPort(encoding: Encoding, network: NetworkType | NetworkId | string): number; -/** -* Constructs an WebSocket RPC URL given the partial URL or an IP, RPC encoding -* and a network type. -* -* # Arguments -* -* * `url` - Partial URL or an IP address -* * `encoding` - RPC encoding -* * `network_type` - Network type -* @param {string} url -* @param {Encoding} encoding -* @param {NetworkId} network -* @returns {string} -*/ + /** + * Constructs an WebSocket RPC URL given the partial URL or an IP, RPC encoding + * and a network type. + * + * # Arguments + * + * * `url` - Partial URL or an IP address + * * `encoding` - RPC encoding + * * `network_type` - Network type + */ static parseUrl(url: string, encoding: Encoding, network: NetworkId): string; -/** -* -* Create a new RPC client with optional {@link Encoding} and a `url`. -* -* @see {@link IRpcConfig} interface for more details. -* @param {IRpcConfig | undefined} [config] -*/ - constructor(config?: IRpcConfig); -/** -* Set the resolver for the RPC client. -* This setting will take effect on the next connection. -* @param {Resolver} resolver -*/ + /** + * + * Create a new RPC client with optional {@link Encoding} and a `url`. + * + * @see {@link IRpcConfig} interface for more details. + */ + constructor(config?: IRpcConfig | null); + /** + * Set the resolver for the RPC client. + * This setting will take effect on the next connection. + */ setResolver(resolver: Resolver): void; -/** -* Set the network id for the RPC client. -* This setting will take effect on the next connection. -* @param {NetworkId} network_id -*/ - setNetworkId(network_id: NetworkId): void; -/** -* Connect to the Kaspa RPC server. This function starts a background -* task that connects and reconnects to the server if the connection -* is terminated. Use [`disconnect()`](Self::disconnect()) to -* terminate the connection. -* @see {@link IConnectOptions} interface for more details. -* @param {IConnectOptions | undefined | undefined} [args] -* @returns {Promise} -*/ - connect(args?: IConnectOptions | undefined): Promise; -/** -* Disconnect from the Kaspa RPC server. -* @returns {Promise} -*/ + /** + * Set the network id for the RPC client. + * This setting will take effect on the next connection. + */ + setNetworkId(network_id: NetworkId | string): void; + /** + * Connect to the Kaspa RPC server. This function starts a background + * task that connects and reconnects to the server if the connection + * is terminated. Use [`disconnect()`](Self::disconnect()) to + * terminate the connection. + * @see {@link IConnectOptions} interface for more details. + */ + connect(args?: IConnectOptions | undefined | null): Promise; + /** + * Disconnect from the Kaspa RPC server. + */ disconnect(): Promise; -/** -* Start background RPC services (automatically started when invoking {@link RpcClient.connect}). -* @returns {Promise} -*/ + /** + * Start background RPC services (automatically started when invoking {@link RpcClient.connect}). + */ start(): Promise; -/** -* Stop background RPC services (automatically stopped when invoking {@link RpcClient.disconnect}). -* @returns {Promise} -*/ + /** + * Stop background RPC services (automatically stopped when invoking {@link RpcClient.disconnect}). + */ stop(): Promise; -/** -* Triggers a disconnection on the underlying WebSocket -* if the WebSocket is in connected state. -* This is intended for debug purposes only. -* Can be used to test application reconnection logic. -*/ + /** + * Triggers a disconnection on the underlying WebSocket + * if the WebSocket is in connected state. + * This is intended for debug purposes only. + * Can be used to test application reconnection logic. + */ triggerAbort(): void; -/** -* -* Unregister an event listener. -* This function will remove the callback for the specified event. -* If the `callback` is not supplied, all callbacks will be -* removed for the specified event. -* -* @see {@link RpcClient.addEventListener} -* @param {RpcEventType | string} event -* @param {RpcEventCallback | undefined} [callback] -*/ - removeEventListener(event: RpcEventType | string, callback?: RpcEventCallback): void; -/** -* -* Unregister a single event listener callback from all events. -* -* -* @param {RpcEventCallback} callback -*/ + /** + * + * Unregister an event listener. + * This function will remove the callback for the specified event. + * If the `callback` is not supplied, all callbacks will be + * removed for the specified event. + * + * @see {@link RpcClient.addEventListener} + */ + removeEventListener(event: RpcEventType | string, callback?: RpcEventCallback | null): void; + /** + * + * Unregister a single event listener callback from all events. + * + * + */ clearEventListener(callback: RpcEventCallback): void; -/** -* -* Unregister all notification callbacks for all events. -*/ + /** + * + * Unregister all notification callbacks for all events. + */ removeAllEventListeners(): void; -/** -* The current protocol encoding. -*/ - readonly encoding: string; -/** -* The current connection status of the RPC client. -*/ + /** + * The current URL of the RPC client. + */ + readonly url: string | undefined; + /** + * Current rpc resolver + */ + readonly resolver: Resolver | undefined; + /** + * The current connection status of the RPC client. + */ readonly isConnected: boolean; -/** -* Optional: Resolver node id. -*/ + /** + * The current protocol encoding. + */ + readonly encoding: string; + /** + * Optional: Resolver node id. + */ readonly nodeId: string | undefined; -/** -* Current rpc resolver -*/ - readonly resolver: Resolver | undefined; -/** -* The current URL of the RPC client. -*/ - readonly url: string | undefined; } /** -* ScriptBuilder provides a facility for building custom scripts. It allows -* you to push opcodes, ints, and data while respecting canonical encoding. In -* general it does not ensure the script will execute correctly, however any -* data pushes which would exceed the maximum allowed script engine limits and -* are therefore guaranteed not to execute will not be pushed and will result in -* the Script function returning an error. -* @category Consensus -*/ + * ScriptBuilder provides a facility for building custom scripts. It allows + * you to push opcodes, ints, and data while respecting canonical encoding. In + * general it does not ensure the script will execute correctly, however any + * data pushes which would exceed the maximum allowed script engine limits and + * are therefore guaranteed not to execute will not be pushed and will result in + * the Script function returning an error. + * @category Consensus + */ export class ScriptBuilder { /** ** Return copy of self without private attributes. @@ -7085,99 +6678,64 @@ export class ScriptBuilder { */ toString(): string; free(): void; -/** -*/ constructor(); -/** -* Creates a new ScriptBuilder over an existing script. -* Supplied script can be represented as an `Uint8Array` or a `HexString`. -* @param {HexString | Uint8Array} script -* @returns {ScriptBuilder} -*/ + /** + * Creates a new ScriptBuilder over an existing script. + * Supplied script can be represented as an `Uint8Array` or a `HexString`. + */ static fromScript(script: HexString | Uint8Array): ScriptBuilder; -/** -* Pushes the passed opcode to the end of the script. The script will not -* be modified if pushing the opcode would cause the script to exceed the -* maximum allowed script engine size. -* @param {number} op -* @returns {ScriptBuilder} -*/ + /** + * Pushes the passed opcode to the end of the script. The script will not + * be modified if pushing the opcode would cause the script to exceed the + * maximum allowed script engine size. + */ addOp(op: number): ScriptBuilder; -/** -* Adds the passed opcodes to the end of the script. -* Supplied opcodes can be represented as an `Uint8Array` or a `HexString`. -* @param {HexString | Uint8Array} opcodes -* @returns {ScriptBuilder} -*/ + /** + * Adds the passed opcodes to the end of the script. + * Supplied opcodes can be represented as an `Uint8Array` or a `HexString`. + */ addOps(opcodes: HexString | Uint8Array): ScriptBuilder; -/** -* AddData pushes the passed data to the end of the script. It automatically -* chooses canonical opcodes depending on the length of the data. -* -* A zero length buffer will lead to a push of empty data onto the stack (Op0 = OpFalse) -* and any push of data greater than [`MAX_SCRIPT_ELEMENT_SIZE`](kaspa_txscript::MAX_SCRIPT_ELEMENT_SIZE) will not modify -* the script since that is not allowed by the script engine. -* -* Also, the script will not be modified if pushing the data would cause the script to -* exceed the maximum allowed script engine size [`MAX_SCRIPTS_SIZE`](kaspa_txscript::MAX_SCRIPTS_SIZE). -* @param {HexString | Uint8Array} data -* @returns {ScriptBuilder} -*/ + /** + * AddData pushes the passed data to the end of the script. It automatically + * chooses canonical opcodes depending on the length of the data. + * + * A zero length buffer will lead to a push of empty data onto the stack (Op0 = OpFalse) + * and any push of data greater than [`MAX_SCRIPT_ELEMENT_SIZE`](kaspa_txscript::MAX_SCRIPT_ELEMENT_SIZE) will not modify + * the script since that is not allowed by the script engine. + * + * Also, the script will not be modified if pushing the data would cause the script to + * exceed the maximum allowed script engine size [`MAX_SCRIPTS_SIZE`](kaspa_txscript::MAX_SCRIPTS_SIZE). + */ addData(data: HexString | Uint8Array): ScriptBuilder; -/** -* @param {bigint} value -* @returns {ScriptBuilder} -*/ addI64(value: bigint): ScriptBuilder; -/** -* @param {bigint} lock_time -* @returns {ScriptBuilder} -*/ addLockTime(lock_time: bigint): ScriptBuilder; -/** -* @param {bigint} sequence -* @returns {ScriptBuilder} -*/ addSequence(sequence: bigint): ScriptBuilder; -/** -* @param {HexString | Uint8Array} data -* @returns {number} -*/ static canonicalDataSize(data: HexString | Uint8Array): number; -/** -* Get script bytes represented by a hex string. -* @returns {HexString} -*/ + /** + * Get script bytes represented by a hex string. + */ toString(): HexString; -/** -* Drains (empties) the script builder, returning the -* script bytes represented by a hex string. -* @returns {HexString} -*/ + /** + * Drains (empties) the script builder, returning the + * script bytes represented by a hex string. + */ drain(): HexString; -/** -* Creates an equivalent pay-to-script-hash script. -* Can be used to create an P2SH address. -* @see {@link addressFromScriptPublicKey} -* @returns {ScriptPublicKey} -*/ + /** + * Creates an equivalent pay-to-script-hash script. + * Can be used to create an P2SH address. + * @see {@link addressFromScriptPublicKey} + */ createPayToScriptHashScript(): ScriptPublicKey; -/** -* Generates a signature script that fits a pay-to-script-hash script. -* @param {HexString | Uint8Array} signature -* @returns {HexString} -*/ + /** + * Generates a signature script that fits a pay-to-script-hash script. + */ encodePayToScriptHashSignatureScript(signature: HexString | Uint8Array): HexString; -/** -* @param {IHexViewConfig | undefined} [args] -* @returns {string} -*/ - hexView(args?: IHexViewConfig): string; + hexView(args?: IHexViewConfig | null): string; } /** -* Represents a Kaspad ScriptPublicKey -* @category Consensus -*/ + * Represents a Kaspad ScriptPublicKey + * @category Consensus + */ export class ScriptPublicKey { /** ** Return copy of self without private attributes. @@ -7188,51 +6746,28 @@ export class ScriptPublicKey { */ toString(): string; free(): void; -/** -* @param {number} version -* @param {any} script -*/ constructor(version: number, script: any); -/** -*/ - readonly script: string; -/** -*/ version: number; + readonly script: string; } -/** -*/ export class SetAadOptions { free(): void; -/** -* @param {Function} flush -* @param {number} plaintext_length -* @param {Function} transform -*/ constructor(flush: Function, plaintext_length: number, transform: Function); -/** -*/ flush: Function; -/** -*/ readonly plaintextLength: number; -/** -*/ - plaintext_length: number; -/** -*/ + set plaintext_length(value: number); transform: Function; } -/** -*/ export class SigHashType { + private constructor(); free(): void; } /** -* Wallet file storage interface -* @category Wallet SDK -*/ + * Wallet file storage interface + * @category Wallet SDK + */ export class Storage { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -7242,33 +6777,21 @@ export class Storage { */ toString(): string; free(): void; -/** -*/ readonly filename: string; } -/** -*/ export class StreamTransformOptions { free(): void; -/** -* @param {Function} flush -* @param {Function} transform -*/ constructor(flush: Function, transform: Function); -/** -*/ flush: Function; -/** -*/ transform: Function; } /** -* Represents a Kaspa transaction. -* This is an artificial construct that includes additional -* transaction-related data such as additional data from UTXOs -* used by transaction inputs. -* @category Consensus -*/ + * Represents a Kaspa transaction. + * This is an artificial construct that includes additional + * transaction-related data such as additional data from UTXOs + * used by transaction inputs. + * @category Consensus + */ export class Transaction { /** ** Return copy of self without private attributes. @@ -7279,100 +6802,72 @@ export class Transaction { */ toString(): string; free(): void; -/** -* Determines whether or not a transaction is a coinbase transaction. A coinbase -* transaction is a special transaction created by miners that distributes fees and block subsidy -* to the previous blocks' miners, and specifies the script_pub_key that will be used to pay the current -* miner in future blocks. -* @returns {boolean} -*/ + /** + * Determines whether or not a transaction is a coinbase transaction. A coinbase + * transaction is a special transaction created by miners that distributes fees and block subsidy + * to the previous blocks' miners, and specifies the script_pub_key that will be used to pay the current + * miner in future blocks. + */ is_coinbase(): boolean; -/** -* Recompute and finalize the tx id based on updated tx fields -* @returns {Hash} -*/ + /** + * Recompute and finalize the tx id based on updated tx fields + */ finalize(): Hash; -/** -* @param {ITransaction | Transaction} js_value -*/ constructor(js_value: ITransaction | Transaction); -/** -* Returns a list of unique addresses used by transaction inputs. -* This method can be used to determine addresses used by transaction inputs -* in order to select private keys needed for transaction signing. -* @param {NetworkType | NetworkId | string} network_type -* @returns {Address[]} -*/ + /** + * Returns a list of unique addresses used by transaction inputs. + * This method can be used to determine addresses used by transaction inputs + * in order to select private keys needed for transaction signing. + */ addresses(network_type: NetworkType | NetworkId | string): Address[]; -/** -* Serializes the transaction to a pure JavaScript Object. -* The schema of the JavaScript object is defined by {@link ISerializableTransaction}. -* @see {@link ISerializableTransaction} -* @returns {ISerializableTransaction} -*/ + /** + * Serializes the transaction to a pure JavaScript Object. + * The schema of the JavaScript object is defined by {@link ISerializableTransaction}. + * @see {@link ISerializableTransaction} + */ serializeToObject(): ISerializableTransaction; -/** -* Serializes the transaction to a JSON string. -* The schema of the JSON is defined by {@link ISerializableTransaction}. -* @returns {string} -*/ + /** + * Serializes the transaction to a JSON string. + * The schema of the JSON is defined by {@link ISerializableTransaction}. + */ serializeToJSON(): string; -/** -* Serializes the transaction to a "Safe" JSON schema where it converts all `bigint` values to `string` to avoid potential client-side precision loss. -* @returns {string} -*/ + /** + * Serializes the transaction to a "Safe" JSON schema where it converts all `bigint` values to `string` to avoid potential client-side precision loss. + */ serializeToSafeJSON(): string; -/** -* Deserialize the {@link Transaction} Object from a pure JavaScript Object. -* @param {any} js_value -* @returns {Transaction} -*/ + /** + * Deserialize the {@link Transaction} Object from a pure JavaScript Object. + */ static deserializeFromObject(js_value: any): Transaction; -/** -* Deserialize the {@link Transaction} Object from a JSON string. -* @param {string} json -* @returns {Transaction} -*/ + /** + * Deserialize the {@link Transaction} Object from a JSON string. + */ static deserializeFromJSON(json: string): Transaction; -/** -* Deserialize the {@link Transaction} Object from a "Safe" JSON schema where all `bigint` values are represented as `string`. -* @param {string} json -* @returns {Transaction} -*/ + /** + * Deserialize the {@link Transaction} Object from a "Safe" JSON schema where all `bigint` values are represented as `string`. + */ static deserializeFromSafeJSON(json: string): Transaction; -/** -*/ - gas: bigint; -/** -* Returns the transaction ID -*/ + /** + * Returns the transaction ID + */ readonly id: string; -/** -*/ - inputs: (ITransactionInput | TransactionInput)[]; -/** -*/ + get inputs(): TransactionInput[]; + set inputs(value: (ITransactionInput | TransactionInput)[]); + get outputs(): TransactionOutput[]; + set outputs(value: (ITransactionOutput | TransactionOutput)[]); + version: number; lockTime: bigint; -/** -*/ + gas: bigint; + get subnetworkId(): string; + set subnetworkId(value: any); + get payload(): string; + set payload(value: any); mass: bigint; -/** -*/ - outputs: (ITransactionOutput | TransactionOutput)[]; -/** -*/ - payload: any; -/** -*/ - subnetworkId: any; -/** -*/ - version: number; } /** -* Represents a Kaspa transaction input -* @category Consensus -*/ + * Represents a Kaspa transaction input + * @category Consensus + */ export class TransactionInput { /** ** Return copy of self without private attributes. @@ -7383,33 +6878,22 @@ export class TransactionInput { */ toString(): string; free(): void; -/** -* @param {ITransactionInput | TransactionInput} value -*/ constructor(value: ITransactionInput | TransactionInput); -/** -*/ - previousOutpoint: any; -/** -*/ + get previousOutpoint(): TransactionOutpoint; + set previousOutpoint(value: any); + get signatureScript(): string | undefined; + set signatureScript(value: any); sequence: bigint; -/** -*/ sigOpCount: number; -/** -*/ - signatureScript: any; -/** -*/ readonly utxo: UtxoEntryReference | undefined; } /** -* Represents a Kaspa transaction outpoint. -* NOTE: This struct is immutable - to create a custom outpoint -* use the `TransactionOutpoint::new` constructor. (in JavaScript -* use `new TransactionOutpoint(transactionId, index)`). -* @category Consensus -*/ + * Represents a Kaspa transaction outpoint. + * NOTE: This struct is immutable - to create a custom outpoint + * use the `TransactionOutpoint::new` constructor. (in JavaScript + * use `new TransactionOutpoint(transactionId, index)`). + * @category Consensus + */ export class TransactionOutpoint { /** ** Return copy of self without private attributes. @@ -7420,108 +6904,77 @@ export class TransactionOutpoint { */ toString(): string; free(): void; -/** -* @param {Hash} transaction_id -* @param {number} index -*/ constructor(transaction_id: Hash, index: number); -/** -* @returns {string} -*/ getId(): string; -/** -*/ - readonly index: number; -/** -*/ readonly transactionId: string; + readonly index: number; } /** -* Represents a Kaspad transaction output -* @category Consensus -*/ -export class TransactionOutput { -/** -** Return copy of self without private attributes. -*/ - toJSON(): Object; -/** -* Return stringified version of self. -*/ - toString(): string; - free(): void; -/** -* TransactionOutput constructor -* @param {bigint} value -* @param {ScriptPublicKey} script_public_key -*/ - constructor(value: bigint, script_public_key: ScriptPublicKey); -/** -*/ - scriptPublicKey: ScriptPublicKey; -/** -*/ - value: bigint; -} -/** -* @category Wallet SDK -*/ -export class TransactionRecord { -/** -** Return copy of self without private attributes. -*/ - toJSON(): Object; -/** -* Return stringified version of self. -*/ - toString(): string; - free(): void; -/** -* Check if the transaction record has the given address within the associated UTXO set. -* @param {Address} address -* @returns {boolean} -*/ - hasAddress(address: Address): boolean; -/** -* Serialize the transaction record to a JavaScript object. -* @returns {any} -*/ - serialize(): any; -/** -*/ - readonly binding: IBinding; -/** -*/ - readonly blockDaaScore: bigint; -/** -*/ - readonly data: ITransactionData; -/** -*/ - id: Hash; -/** -*/ - metadata?: string; + * Represents a Kaspad transaction output + * @category Consensus + */ +export class TransactionOutput { /** +** Return copy of self without private attributes. */ - network: NetworkId; + toJSON(): Object; /** +* Return stringified version of self. */ - note?: string; + toString(): string; + free(): void; + /** + * TransactionOutput constructor + */ + constructor(value: bigint, script_public_key: ScriptPublicKey); + value: bigint; + scriptPublicKey: ScriptPublicKey; +} /** -*/ - readonly type: string; + * @category Wallet SDK + */ +export class TransactionRecord { + private constructor(); /** -* Unix time in milliseconds +** Return copy of self without private attributes. */ - unixtimeMsec?: bigint; + toJSON(): Object; /** +* Return stringified version of self. */ + toString(): string; + free(): void; + maturityProgress(currentDaaScore: bigint): string; + /** + * Check if the transaction record has the given address within the associated UTXO set. + */ + hasAddress(address: Address): boolean; + /** + * Serialize the transaction record to a JavaScript object. + */ + serialize(): any; + id: Hash; + /** + * Unix time in milliseconds + */ + get unixtimeMsec(): bigint | undefined; + /** + * Unix time in milliseconds + */ + set unixtimeMsec(value: bigint | null | undefined); + network: NetworkId; + get note(): string | undefined; + set note(value: string | null | undefined); + get metadata(): string | undefined; + set metadata(value: string | null | undefined); readonly value: bigint; + readonly blockDaaScore: bigint; + readonly binding: IBinding; + readonly data: ITransactionData; + readonly type: string; } -/** -*/ export class TransactionRecordNotification { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -7531,55 +6984,36 @@ export class TransactionRecordNotification { */ toString(): string; free(): void; -/** -*/ - data: TransactionRecord; -/** -*/ type: string; + data: TransactionRecord; } /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class TransactionSigningHash { free(): void; -/** -*/ constructor(); -/** -* @param {HexString | Uint8Array} data -*/ update(data: HexString | Uint8Array): void; -/** -* @returns {string} -*/ finalize(): string; } /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class TransactionSigningHashECDSA { free(): void; -/** -*/ constructor(); -/** -* @param {HexString | Uint8Array} data -*/ update(data: HexString | Uint8Array): void; -/** -* @returns {string} -*/ finalize(): string; } /** -* Holds details about an individual transaction output in a utxo -* set such as whether or not it was contained in a coinbase tx, the daa -* score of the block that accepts the tx, its public key script, and how -* much it pays. -* @category Consensus -*/ + * Holds details about an individual transaction output in a utxo + * set such as whether or not it was contained in a coinbase tx, the daa + * score of the block that accepts the tx, its public key script, and how + * much it pays. + * @category Consensus + */ export class TransactionUtxoEntry { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -7589,91 +7023,74 @@ export class TransactionUtxoEntry { */ toString(): string; free(): void; -/** -*/ amount: bigint; -/** -*/ + scriptPublicKey: ScriptPublicKey; blockDaaScore: bigint; -/** -*/ isCoinbase: boolean; -/** -*/ - scriptPublicKey: ScriptPublicKey; } -/** -*/ export class UserInfoOptions { free(): void; -/** -* @param {string | undefined} [encoding] -*/ - constructor(encoding?: string); -/** -* @returns {UserInfoOptions} -*/ + constructor(encoding?: string | null); static new(): UserInfoOptions; -/** -*/ - encoding?: string; + get encoding(): string | undefined; + set encoding(value: string | null | undefined); } /** -* -* UtxoContext is a class that provides a way to track addresses activity -* on the Kaspa network. When an address is registered with UtxoContext -* it aggregates all UTXO entries for that address and emits events when -* any activity against these addresses occurs. -* -* UtxoContext constructor accepts {@link IUtxoContextArgs} interface that -* can contain an optional id parameter. If supplied, this `id` parameter -* will be included in all notifications emitted by the UtxoContext as -* well as included as a part of {@link ITransactionRecord} emitted when -* transactions occur. If not provided, a random id will be generated. This id -* typically represents an account id in the context of a wallet application. -* The integrated Wallet API uses UtxoContext to represent wallet accounts. -* -* **Exchanges:** if you are building an exchange wallet, it is recommended -* to use UtxoContext for each user account. This way you can track and isolate -* each user activity (use address set, balances, transaction records). -* -* UtxoContext maintains a real-time cumulative balance of all addresses -* registered against it and provides balance update notification events -* when the balance changes. -* -* The UtxoContext balance is comprised of 3 values: -* - `mature`: amount of funds available for spending. -* - `pending`: amount of funds that are being received. -* - `outgoing`: amount of funds that are being sent but are not yet accepted by the network. -* -* Please see {@link IBalance} interface for more details. -* -* UtxoContext can be supplied as a UTXO source to the transaction {@link Generator} -* allowing the {@link Generator} to create transactions using the -* UTXO entries it manages. -* -* **IMPORTANT:** UtxoContext is meant to represent a single account. It is not -* designed to be used as a global UTXO manager for all addresses in a very large -* wallet (such as an exchange wallet). For such use cases, it is recommended to -* perform manual UTXO management by subscribing to UTXO notifications using -* {@link RpcClient.subscribeUtxosChanged} and {@link RpcClient.getUtxosByAddresses}. -* -* @see {@link IUtxoContextArgs}, -* {@link UtxoProcessor}, -* {@link Generator}, -* {@link createTransactions}, -* {@link IBalance}, -* {@link IBalanceEvent}, -* {@link IPendingEvent}, -* {@link IReorgEvent}, -* {@link IStasisEvent}, -* {@link IMaturityEvent}, -* {@link IDiscoveryEvent}, -* {@link IBalanceEvent}, -* {@link ITransactionRecord} -* -* @category Wallet SDK -*/ + * + * UtxoContext is a class that provides a way to track addresses activity + * on the Kaspa network. When an address is registered with UtxoContext + * it aggregates all UTXO entries for that address and emits events when + * any activity against these addresses occurs. + * + * UtxoContext constructor accepts {@link IUtxoContextArgs} interface that + * can contain an optional id parameter. If supplied, this `id` parameter + * will be included in all notifications emitted by the UtxoContext as + * well as included as a part of {@link ITransactionRecord} emitted when + * transactions occur. If not provided, a random id will be generated. This id + * typically represents an account id in the context of a wallet application. + * The integrated Wallet API uses UtxoContext to represent wallet accounts. + * + * **Exchanges:** if you are building an exchange wallet, it is recommended + * to use UtxoContext for each user account. This way you can track and isolate + * each user activity (use address set, balances, transaction records). + * + * UtxoContext maintains a real-time cumulative balance of all addresses + * registered against it and provides balance update notification events + * when the balance changes. + * + * The UtxoContext balance is comprised of 3 values: + * - `mature`: amount of funds available for spending. + * - `pending`: amount of funds that are being received. + * - `outgoing`: amount of funds that are being sent but are not yet accepted by the network. + * + * Please see {@link IBalance} interface for more details. + * + * UtxoContext can be supplied as a UTXO source to the transaction {@link Generator} + * allowing the {@link Generator} to create transactions using the + * UTXO entries it manages. + * + * **IMPORTANT:** UtxoContext is meant to represent a single account. It is not + * designed to be used as a global UTXO manager for all addresses in a very large + * wallet (such as an exchange wallet). For such use cases, it is recommended to + * perform manual UTXO management by subscribing to UTXO notifications using + * {@link RpcClient.subscribeUtxosChanged} and {@link RpcClient.getUtxosByAddresses}. + * + * @see {@link IUtxoContextArgs}, + * {@link UtxoProcessor}, + * {@link Generator}, + * {@link createTransactions}, + * {@link IBalance}, + * {@link IBalanceEvent}, + * {@link IPendingEvent}, + * {@link IReorgEvent}, + * {@link IStasisEvent}, + * {@link IMaturityEvent}, + * {@link IDiscoveryEvent}, + * {@link IBalanceEvent}, + * {@link ITransactionRecord} + * + * @category Wallet SDK + */ export class UtxoContext { /** ** Return copy of self without private attributes. @@ -7684,80 +7101,65 @@ export class UtxoContext { */ toString(): string; free(): void; -/** -* @param {IUtxoContextArgs} js_value -*/ constructor(js_value: IUtxoContextArgs); -/** -* Performs a scan of the given addresses and registers them in the context for event notifications. -* @param {(Address | string)[]} addresses -* @param {bigint | undefined} [optional_current_daa_score] -* @returns {Promise} -*/ - trackAddresses(addresses: (Address | string)[], optional_current_daa_score?: bigint): Promise; -/** -* Unregister a list of addresses from the context. This will stop tracking of these addresses. -* @param {(Address | string)[]} addresses -* @returns {Promise} -*/ + /** + * Performs a scan of the given addresses and registers them in the context for event notifications. + */ + trackAddresses(addresses: (Address | string)[], optional_current_daa_score?: bigint | null): Promise; + /** + * Unregister a list of addresses from the context. This will stop tracking of these addresses. + */ unregisterAddresses(addresses: (Address | string)[]): Promise; -/** -* Clear the UtxoContext. Unregister all addresses and clear all UTXO entries. -* IMPORTANT: This function must be manually called when disconnecting or re-connecting to the node -* (followed by address re-registration). -* @returns {Promise} -*/ + /** + * Clear the UtxoContext. Unregister all addresses and clear all UTXO entries. + * IMPORTANT: This function must be manually called when disconnecting or re-connecting to the node + * (followed by address re-registration). + */ clear(): Promise; -/** -* -* Returns a range of mature UTXO entries that are currently -* managed by the UtxoContext and are available for spending. -* -* NOTE: This function is provided for informational purposes only. -* **You should not manage UTXO entries manually if they are owned by UtxoContext.** -* -* The resulting range may be less than requested if UTXO entries -* have been spent asynchronously by UtxoContext or by other means -* (i.e. UtxoContext has received notification from the network that -* UtxoEntries have been spent externally). -* -* UtxoEntries are kept in in the ascending sorted order by their amount. -* @param {number} from -* @param {number} to -* @returns {UtxoEntryReference[]} -*/ + /** + * + * Returns a range of mature UTXO entries that are currently + * managed by the UtxoContext and are available for spending. + * + * NOTE: This function is provided for informational purposes only. + * **You should not manage UTXO entries manually if they are owned by UtxoContext.** + * + * The resulting range may be less than requested if UTXO entries + * have been spent asynchronously by UtxoContext or by other means + * (i.e. UtxoContext has received notification from the network that + * UtxoEntries have been spent externally). + * + * UtxoEntries are kept in in the ascending sorted order by their amount. + */ getMatureRange(from: number, to: number): UtxoEntryReference[]; -/** -* Returns pending UTXO entries that are currently managed by the UtxoContext. -* @returns {UtxoEntryReference[]} -*/ + /** + * Returns pending UTXO entries that are currently managed by the UtxoContext. + */ getPending(): UtxoEntryReference[]; -/** -* Current {@link Balance} of the UtxoContext. -*/ - readonly balance: Balance | undefined; -/** -* Current {@link BalanceStrings} of the UtxoContext. -*/ - readonly balanceStrings: BalanceStrings | undefined; -/** -*/ readonly isActive: boolean; -/** -* Obtain the length of the mature UTXO entries that are currently -* managed by the UtxoContext. -*/ + /** + * Obtain the length of the mature UTXO entries that are currently + * managed by the UtxoContext. + */ readonly matureLength: number; + /** + * Current {@link Balance} of the UtxoContext. + */ + readonly balance: Balance | undefined; + /** + * Current {@link BalanceStrings} of the UtxoContext. + */ + readonly balanceStrings: BalanceStrings | undefined; } /** -* A simple collection of UTXO entries. This struct is used to -* retain a set of UTXO entries in the WASM memory for faster -* processing. This struct keeps a list of entries represented -* by `UtxoEntryReference` struct. This data structure is used -* internally by the framework, but is exposed for convenience. -* Please consider using `UtxoContext` instead. -* @category Wallet SDK -*/ + * A simple collection of UTXO entries. This struct is used to + * retain a set of UTXO entries in the WASM memory for faster + * processing. This struct keeps a list of entries represented + * by `UtxoEntryReference` struct. This data structure is used + * internally by the framework, but is exposed for convenience. + * Please consider using `UtxoContext` instead. + * @category Wallet SDK + */ export class UtxoEntries { /** ** Return copy of self without private attributes. @@ -7768,31 +7170,26 @@ export class UtxoEntries { */ toString(): string; free(): void; -/** -* Create a new `UtxoEntries` struct with a set of entries. -* @param {any} js_value -*/ + /** + * Create a new `UtxoEntries` struct with a set of entries. + */ constructor(js_value: any); -/** -* Sort the contained entries by amount. Please note that -* this function is not intended for use with large UTXO sets -* as it duplicates the whole contained UTXO set while sorting. -*/ + /** + * Sort the contained entries by amount. Please note that + * this function is not intended for use with large UTXO sets + * as it duplicates the whole contained UTXO set while sorting. + */ sort(): void; -/** -* @returns {bigint} -*/ amount(): bigint; -/** -*/ items: any; } /** -* [`UtxoEntry`] struct represents a client-side UTXO entry. -* -* @category Wallet SDK -*/ + * [`UtxoEntry`] struct represents a client-side UTXO entry. + * + * @category Wallet SDK + */ export class UtxoEntry { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -7802,35 +7199,22 @@ export class UtxoEntry { */ toString(): string; free(): void; -/** -* @returns {string} -*/ toString(): string; -/** -*/ - address?: Address; -/** -*/ + get address(): Address | undefined; + set address(value: Address | null | undefined); + outpoint: TransactionOutpoint; amount: bigint; -/** -*/ + scriptPublicKey: ScriptPublicKey; blockDaaScore: bigint; -/** -*/ isCoinbase: boolean; -/** -*/ - outpoint: TransactionOutpoint; -/** -*/ - scriptPublicKey: ScriptPublicKey; } /** -* [`Arc`] reference to a [`UtxoEntry`] used by the wallet subsystems. -* -* @category Wallet SDK -*/ + * [`Arc`] reference to a [`UtxoEntry`] used by the wallet subsystems. + * + * @category Wallet SDK + */ export class UtxoEntryReference { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -7840,46 +7224,29 @@ export class UtxoEntryReference { */ toString(): string; free(): void; -/** -* @returns {string} -*/ toString(): string; -/** -*/ + readonly entry: UtxoEntry; + readonly outpoint: TransactionOutpoint; readonly address: Address | undefined; -/** -*/ readonly amount: bigint; -/** -*/ - readonly blockDaaScore: bigint; -/** -*/ - readonly entry: UtxoEntry; -/** -*/ readonly isCoinbase: boolean; -/** -*/ - readonly outpoint: TransactionOutpoint; -/** -*/ + readonly blockDaaScore: bigint; readonly scriptPublicKey: ScriptPublicKey; } /** -* -* UtxoProcessor class is the main coordinator that manages UTXO processing -* between multiple UtxoContext instances. It acts as a bridge between the -* Kaspa node RPC connection, address subscriptions and UtxoContext instances. -* -* @see {@link IUtxoProcessorArgs}, -* {@link UtxoContext}, -* {@link RpcClient}, -* {@link NetworkId}, -* {@link IConnectEvent} -* {@link IDisconnectEvent} -* @category Wallet SDK -*/ + * + * UtxoProcessor class is the main coordinator that manages UTXO processing + * between multiple UtxoContext instances. It acts as a bridge between the + * Kaspa node RPC connection, address subscriptions and UtxoContext instances. + * + * @see {@link IUtxoProcessorArgs}, + * {@link UtxoContext}, + * {@link RpcClient}, + * {@link NetworkId}, + * {@link IConnectEvent} + * {@link IDisconnectEvent} + * @category Wallet SDK + */ export class UtxoProcessor { /** ** Return copy of self without private attributes. @@ -7890,107 +7257,87 @@ export class UtxoProcessor { */ toString(): string; free(): void; -/** -* @param {UtxoProcessorEventType | UtxoProcessorEventType[] | string | string[]} event -* @param {UtxoProcessorNotificationCallback | undefined} [callback] -*/ - removeEventListener(event: UtxoProcessorEventType | UtxoProcessorEventType[] | string | string[], callback?: UtxoProcessorNotificationCallback): void; -/** -* UtxoProcessor constructor. -* -* -* -* @see {@link IUtxoProcessorArgs} -* @param {IUtxoProcessorArgs} js_value -*/ + removeEventListener(event: UtxoProcessorEventType | UtxoProcessorEventType[] | string | string[], callback?: UtxoProcessorNotificationCallback | null): void; + /** + * UtxoProcessor constructor. + * + * + * + * @see {@link IUtxoProcessorArgs} + */ constructor(js_value: IUtxoProcessorArgs); -/** -* Starts the UtxoProcessor and begins processing UTXO and other notifications. -* @returns {Promise} -*/ + /** + * Starts the UtxoProcessor and begins processing UTXO and other notifications. + */ start(): Promise; -/** -* Stops the UtxoProcessor and ends processing UTXO and other notifications. -* @returns {Promise} -*/ + /** + * Stops the UtxoProcessor and ends processing UTXO and other notifications. + */ stop(): Promise; -/** -* @param {NetworkId | string} network_id -*/ setNetworkId(network_id: NetworkId | string): void; -/** -* -* Set the coinbase transaction maturity period DAA score for a given network. -* This controls the DAA period after which the user transactions are considered mature -* and the wallet subsystem emits the transaction maturity event. -* -* @see {@link TransactionRecord} -* @see {@link IUtxoProcessorEvent} -* -* @category Wallet SDK -* @param {NetworkId | string} network_id -* @param {bigint} value -*/ + /** + * + * Set the coinbase transaction maturity period DAA score for a given network. + * This controls the DAA period after which the user transactions are considered mature + * and the wallet subsystem emits the transaction maturity event. + * + * @see {@link TransactionRecord} + * @see {@link IUtxoProcessorEvent} + * + * @category Wallet SDK + */ static setCoinbaseTransactionMaturityDAA(network_id: NetworkId | string, value: bigint): void; -/** -* -* Set the user transaction maturity period DAA score for a given network. -* This controls the DAA period after which the user transactions are considered mature -* and the wallet subsystem emits the transaction maturity event. -* -* @see {@link TransactionRecord} -* @see {@link IUtxoProcessorEvent} -* -* @category Wallet SDK -* @param {NetworkId | string} network_id -* @param {bigint} value -*/ + /** + * + * Set the user transaction maturity period DAA score for a given network. + * This controls the DAA period after which the user transactions are considered mature + * and the wallet subsystem emits the transaction maturity event. + * + * @see {@link TransactionRecord} + * @see {@link IUtxoProcessorEvent} + * + * @category Wallet SDK + */ static setUserTransactionMaturityDAA(network_id: NetworkId | string, value: bigint): void; -/** -*/ - readonly isActive: boolean; -/** -*/ - readonly networkId: string | undefined; -/** -*/ readonly rpc: RpcClient; + readonly networkId: string | undefined; + readonly isActive: boolean; } /** -* -* Wallet class is the main coordinator that manages integrated wallet operations. -* -* The Wallet class encapsulates {@link UtxoProcessor} and provides internal -* account management using {@link UtxoContext} instances. It acts as a bridge -* between the integrated Wallet subsystem providing a high-level interface -* for wallet key and account management. -* -* The Rusty Kaspa is developed in Rust, and the Wallet class is a Rust implementation -* exposed to the JavaScript/TypeScript environment using the WebAssembly (WASM32) interface. -* As such, the Wallet implementation can be powered up using native Rust or built -* as a WebAssembly module and used in the browser or Node.js environment. -* -* When using Rust native or NodeJS environment, all wallet data is stored on the local -* filesystem. When using WASM32 build in the web browser, the wallet data is stored -* in the browser's `localStorage` and transaction records are stored in the `IndexedDB`. -* -* The Wallet API can create multiple wallet instances, however, only one wallet instance -* can be active at a time. -* -* The wallet implementation is designed to be efficient and support a large number -* of accounts. Accounts reside in storage and can be loaded and activated as needed. -* A `loaded` account contains all account information loaded from the permanent storage -* whereas an `active` account monitors the UTXO set and provides notifications for -* incoming and outgoing transactions as well as balance updates. -* -* The Wallet API communicates with the client using resource identifiers. These include -* account IDs, private key IDs, transaction IDs, etc. It is the responsibility of the -* client to track these resource identifiers at runtime. -* -* @see {@link IWalletConfig}, -* -* @category Wallet API -*/ + * + * Wallet class is the main coordinator that manages integrated wallet operations. + * + * The Wallet class encapsulates {@link UtxoProcessor} and provides internal + * account management using {@link UtxoContext} instances. It acts as a bridge + * between the integrated Wallet subsystem providing a high-level interface + * for wallet key and account management. + * + * The Rusty Kaspa is developed in Rust, and the Wallet class is a Rust implementation + * exposed to the JavaScript/TypeScript environment using the WebAssembly (WASM32) interface. + * As such, the Wallet implementation can be powered up using native Rust or built + * as a WebAssembly module and used in the browser or Node.js environment. + * + * When using Rust native or NodeJS environment, all wallet data is stored on the local + * filesystem. When using WASM32 build in the web browser, the wallet data is stored + * in the browser's `localStorage` and transaction records are stored in the `IndexedDB`. + * + * The Wallet API can create multiple wallet instances, however, only one wallet instance + * can be active at a time. + * + * The wallet implementation is designed to be efficient and support a large number + * of accounts. Accounts reside in storage and can be loaded and activated as needed. + * A `loaded` account contains all account information loaded from the permanent storage + * whereas an `active` account monitors the UTXO set and provides notifications for + * incoming and outgoing transactions as well as balance updates. + * + * The Wallet API communicates with the client using resource identifiers. These include + * account IDs, private key IDs, transaction IDs, etc. It is the responsibility of the + * client to track these resource identifiers at runtime. + * + * @see {@link IWalletConfig}, + * + * @category Wallet API + */ export class Wallet { /** ** Return copy of self without private attributes. @@ -8001,291 +7348,246 @@ export class Wallet { */ toString(): string; free(): void; -/** -* @param {IWalletConfig} config -*/ - constructor(config: IWalletConfig); -/** -* Check if a wallet with a given name exists. -* @param {string | undefined} [name] -* @returns {Promise} -*/ - exists(name?: string): Promise; -/** -* @returns {Promise} -*/ - start(): Promise; -/** -* @returns {Promise} -*/ - stop(): Promise; -/** -* @param {IConnectOptions | undefined | undefined} [args] -* @returns {Promise} -*/ - connect(args?: IConnectOptions | undefined): Promise; -/** -* @returns {Promise} -*/ - disconnect(): Promise; -/** -* @param {WalletEventType | WalletEventType[] | string | string[]} event -* @param {WalletNotificationCallback | undefined} [callback] -*/ - removeEventListener(event: WalletEventType | WalletEventType[] | string | string[], callback?: WalletNotificationCallback): void; -/** -* Ping backend -*@see {@link IBatchRequest} {@link IBatchResponse} -*@throws `string` in case of an error. -* @param {IBatchRequest} request -* @returns {Promise} -*/ + /** + * Ping backend + * @see {@link IBatchRequest} {@link IBatchResponse} + * @throws `string` in case of an error. + */ batch(request: IBatchRequest): Promise; -/** -*@see {@link IFlushRequest} {@link IFlushResponse} -*@throws `string` in case of an error. -* @param {IFlushRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IFlushRequest} {@link IFlushResponse} + * @throws `string` in case of an error. + */ flush(request: IFlushRequest): Promise; -/** -*@see {@link IRetainContextRequest} {@link IRetainContextResponse} -*@throws `string` in case of an error. -* @param {IRetainContextRequest} request -* @returns {Promise} -*/ - retainContext(request: IRetainContextRequest): Promise; -/** -*@see {@link IGetStatusRequest} {@link IGetStatusResponse} -*@throws `string` in case of an error. -* @param {IGetStatusRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IRetainContextRequest} {@link IRetainContextResponse} + * @throws `string` in case of an error. + */ + retainContext(request: IRetainContextRequest): Promise; + /** + * @see {@link IGetStatusRequest} {@link IGetStatusResponse} + * @throws `string` in case of an error. + */ getStatus(request: IGetStatusRequest): Promise; -/** -*@see {@link IWalletEnumerateRequest} {@link IWalletEnumerateResponse} -*@throws `string` in case of an error. -* @param {IWalletEnumerateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IWalletEnumerateRequest} {@link IWalletEnumerateResponse} + * @throws `string` in case of an error. + */ walletEnumerate(request: IWalletEnumerateRequest): Promise; -/** -*@see {@link IWalletCreateRequest} {@link IWalletCreateResponse} -*@throws `string` in case of an error. -* @param {IWalletCreateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IWalletCreateRequest} {@link IWalletCreateResponse} + * @throws `string` in case of an error. + */ walletCreate(request: IWalletCreateRequest): Promise; -/** -*@see {@link IWalletOpenRequest} {@link IWalletOpenResponse} -*@throws `string` in case of an error. -* @param {IWalletOpenRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IWalletOpenRequest} {@link IWalletOpenResponse} + * @throws `string` in case of an error. + */ walletOpen(request: IWalletOpenRequest): Promise; -/** -*@see {@link IWalletReloadRequest} {@link IWalletReloadResponse} -*@throws `string` in case of an error. -* @param {IWalletReloadRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IWalletReloadRequest} {@link IWalletReloadResponse} + * @throws `string` in case of an error. + */ walletReload(request: IWalletReloadRequest): Promise; -/** -*@see {@link IWalletCloseRequest} {@link IWalletCloseResponse} -*@throws `string` in case of an error. -* @param {IWalletCloseRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IWalletCloseRequest} {@link IWalletCloseResponse} + * @throws `string` in case of an error. + */ walletClose(request: IWalletCloseRequest): Promise; -/** -*@see {@link IWalletChangeSecretRequest} {@link IWalletChangeSecretResponse} -*@throws `string` in case of an error. -* @param {IWalletChangeSecretRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IWalletChangeSecretRequest} {@link IWalletChangeSecretResponse} + * @throws `string` in case of an error. + */ walletChangeSecret(request: IWalletChangeSecretRequest): Promise; -/** -*@see {@link IWalletExportRequest} {@link IWalletExportResponse} -*@throws `string` in case of an error. -* @param {IWalletExportRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IWalletExportRequest} {@link IWalletExportResponse} + * @throws `string` in case of an error. + */ walletExport(request: IWalletExportRequest): Promise; -/** -*@see {@link IWalletImportRequest} {@link IWalletImportResponse} -*@throws `string` in case of an error. -* @param {IWalletImportRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IWalletImportRequest} {@link IWalletImportResponse} + * @throws `string` in case of an error. + */ walletImport(request: IWalletImportRequest): Promise; -/** -*@see {@link IPrvKeyDataEnumerateRequest} {@link IPrvKeyDataEnumerateResponse} -*@throws `string` in case of an error. -* @param {IPrvKeyDataEnumerateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IPrvKeyDataEnumerateRequest} {@link IPrvKeyDataEnumerateResponse} + * @throws `string` in case of an error. + */ prvKeyDataEnumerate(request: IPrvKeyDataEnumerateRequest): Promise; -/** -*@see {@link IPrvKeyDataCreateRequest} {@link IPrvKeyDataCreateResponse} -*@throws `string` in case of an error. -* @param {IPrvKeyDataCreateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IPrvKeyDataCreateRequest} {@link IPrvKeyDataCreateResponse} + * @throws `string` in case of an error. + */ prvKeyDataCreate(request: IPrvKeyDataCreateRequest): Promise; -/** -*@see {@link IPrvKeyDataRemoveRequest} {@link IPrvKeyDataRemoveResponse} -*@throws `string` in case of an error. -* @param {IPrvKeyDataRemoveRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IPrvKeyDataRemoveRequest} {@link IPrvKeyDataRemoveResponse} + * @throws `string` in case of an error. + */ prvKeyDataRemove(request: IPrvKeyDataRemoveRequest): Promise; -/** -*@see {@link IPrvKeyDataGetRequest} {@link IPrvKeyDataGetResponse} -*@throws `string` in case of an error. -* @param {IPrvKeyDataGetRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IPrvKeyDataGetRequest} {@link IPrvKeyDataGetResponse} + * @throws `string` in case of an error. + */ prvKeyDataGet(request: IPrvKeyDataGetRequest): Promise; -/** -*@see {@link IAccountsEnumerateRequest} {@link IAccountsEnumerateResponse} -*@throws `string` in case of an error. -* @param {IAccountsEnumerateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsEnumerateRequest} {@link IAccountsEnumerateResponse} + * @throws `string` in case of an error. + */ accountsEnumerate(request: IAccountsEnumerateRequest): Promise; -/** -*@see {@link IAccountsRenameRequest} {@link IAccountsRenameResponse} -*@throws `string` in case of an error. -* @param {IAccountsRenameRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsRenameRequest} {@link IAccountsRenameResponse} + * @throws `string` in case of an error. + */ accountsRename(request: IAccountsRenameRequest): Promise; -/** -*@see {@link IAccountsDiscoveryRequest} {@link IAccountsDiscoveryResponse} -*@throws `string` in case of an error. -* @param {IAccountsDiscoveryRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsDiscoveryRequest} {@link IAccountsDiscoveryResponse} + * @throws `string` in case of an error. + */ accountsDiscovery(request: IAccountsDiscoveryRequest): Promise; -/** -*@see {@link IAccountsCreateRequest} {@link IAccountsCreateResponse} -*@throws `string` in case of an error. -* @param {IAccountsCreateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsCreateRequest} {@link IAccountsCreateResponse} + * @throws `string` in case of an error. + */ accountsCreate(request: IAccountsCreateRequest): Promise; -/** -*@see {@link IAccountsEnsureDefaultRequest} {@link IAccountsEnsureDefaultResponse} -*@throws `string` in case of an error. -* @param {IAccountsEnsureDefaultRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsEnsureDefaultRequest} {@link IAccountsEnsureDefaultResponse} + * @throws `string` in case of an error. + */ accountsEnsureDefault(request: IAccountsEnsureDefaultRequest): Promise; -/** -*@see {@link IAccountsImportRequest} {@link IAccountsImportResponse} -*@throws `string` in case of an error. -* @param {IAccountsImportRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsImportRequest} {@link IAccountsImportResponse} + * @throws `string` in case of an error. + */ accountsImport(request: IAccountsImportRequest): Promise; -/** -*@see {@link IAccountsActivateRequest} {@link IAccountsActivateResponse} -*@throws `string` in case of an error. -* @param {IAccountsActivateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsActivateRequest} {@link IAccountsActivateResponse} + * @throws `string` in case of an error. + */ accountsActivate(request: IAccountsActivateRequest): Promise; -/** -*@see {@link IAccountsDeactivateRequest} {@link IAccountsDeactivateResponse} -*@throws `string` in case of an error. -* @param {IAccountsDeactivateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsDeactivateRequest} {@link IAccountsDeactivateResponse} + * @throws `string` in case of an error. + */ accountsDeactivate(request: IAccountsDeactivateRequest): Promise; -/** -*@see {@link IAccountsGetRequest} {@link IAccountsGetResponse} -*@throws `string` in case of an error. -* @param {IAccountsGetRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsGetRequest} {@link IAccountsGetResponse} + * @throws `string` in case of an error. + */ accountsGet(request: IAccountsGetRequest): Promise; -/** -*@see {@link IAccountsCreateNewAddressRequest} {@link IAccountsCreateNewAddressResponse} -*@throws `string` in case of an error. -* @param {IAccountsCreateNewAddressRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsCreateNewAddressRequest} {@link IAccountsCreateNewAddressResponse} + * @throws `string` in case of an error. + */ accountsCreateNewAddress(request: IAccountsCreateNewAddressRequest): Promise; -/** -*@see {@link IAccountsSendRequest} {@link IAccountsSendResponse} -*@throws `string` in case of an error. -* @param {IAccountsSendRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsSendRequest} {@link IAccountsSendResponse} + * @throws `string` in case of an error. + */ accountsSend(request: IAccountsSendRequest): Promise; -/** -*@see {@link IAccountsTransferRequest} {@link IAccountsTransferResponse} -*@throws `string` in case of an error. -* @param {IAccountsTransferRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsPskbSignRequest} {@link IAccountsPskbSignResponse} + * @throws `string` in case of an error. + */ + accountsPskbSign(request: IAccountsPskbSignRequest): Promise; + /** + * @see {@link IAccountsPskbBroadcastRequest} {@link IAccountsPskbBroadcastResponse} + * @throws `string` in case of an error. + */ + accountsPskbBroadcast(request: IAccountsPskbBroadcastRequest): Promise; + /** + * @see {@link IAccountsPskbSendRequest} {@link IAccountsPskbSendResponse} + * @throws `string` in case of an error. + */ + accountsPskbSend(request: IAccountsPskbSendRequest): Promise; + /** + * @see {@link IAccountsGetUtxosRequest} {@link IAccountsGetUtxosResponse} + * @throws `string` in case of an error. + */ + accountsGetUtxos(request: IAccountsGetUtxosRequest): Promise; + /** + * @see {@link IAccountsTransferRequest} {@link IAccountsTransferResponse} + * @throws `string` in case of an error. + */ accountsTransfer(request: IAccountsTransferRequest): Promise; -/** -*@see {@link IAccountsEstimateRequest} {@link IAccountsEstimateResponse} -*@throws `string` in case of an error. -* @param {IAccountsEstimateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAccountsEstimateRequest} {@link IAccountsEstimateResponse} + * @throws `string` in case of an error. + */ accountsEstimate(request: IAccountsEstimateRequest): Promise; -/** -*@see {@link ITransactionsDataGetRequest} {@link ITransactionsDataGetResponse} -*@throws `string` in case of an error. -* @param {ITransactionsDataGetRequest} request -* @returns {Promise} -*/ + /** + * @see {@link ITransactionsDataGetRequest} {@link ITransactionsDataGetResponse} + * @throws `string` in case of an error. + */ transactionsDataGet(request: ITransactionsDataGetRequest): Promise; -/** -*@see {@link ITransactionsReplaceNoteRequest} {@link ITransactionsReplaceNoteResponse} -*@throws `string` in case of an error. -* @param {ITransactionsReplaceNoteRequest} request -* @returns {Promise} -*/ + /** + * @see {@link ITransactionsReplaceNoteRequest} {@link ITransactionsReplaceNoteResponse} + * @throws `string` in case of an error. + */ transactionsReplaceNote(request: ITransactionsReplaceNoteRequest): Promise; -/** -*@see {@link ITransactionsReplaceMetadataRequest} {@link ITransactionsReplaceMetadataResponse} -*@throws `string` in case of an error. -* @param {ITransactionsReplaceMetadataRequest} request -* @returns {Promise} -*/ + /** + * @see {@link ITransactionsReplaceMetadataRequest} {@link ITransactionsReplaceMetadataResponse} + * @throws `string` in case of an error. + */ transactionsReplaceMetadata(request: ITransactionsReplaceMetadataRequest): Promise; -/** -*@see {@link IAddressBookEnumerateRequest} {@link IAddressBookEnumerateResponse} -*@throws `string` in case of an error. -* @param {IAddressBookEnumerateRequest} request -* @returns {Promise} -*/ + /** + * @see {@link IAddressBookEnumerateRequest} {@link IAddressBookEnumerateResponse} + * @throws `string` in case of an error. + */ addressBookEnumerate(request: IAddressBookEnumerateRequest): Promise; -/** -*/ - readonly descriptor: WalletDescriptor | undefined; -/** -* @remarks This is a local property indicating -* if the wallet is currently open. -*/ + /** + * @see {@link IFeeRateEstimateRequest} {@link IFeeRateEstimateResponse} + * @throws `string` in case of an error. + */ + feeRateEstimate(request: IFeeRateEstimateRequest): Promise; + /** + * @see {@link IFeeRatePollerEnableRequest} {@link IFeeRatePollerEnableResponse} + * @throws `string` in case of an error. + */ + feeRatePollerEnable(request: IFeeRatePollerEnableRequest): Promise; + /** + * @see {@link IFeeRatePollerDisableRequest} {@link IFeeRatePollerDisableResponse} + * @throws `string` in case of an error. + */ + feeRatePollerDisable(request: IFeeRatePollerDisableRequest): Promise; + /** + * @see {@link IAccountsCommitRevealRequest} {@link IAccountsCommitRevealResponse} + * @throws `string` in case of an error. + */ + accountsCommitReveal(request: IAccountsCommitRevealRequest): Promise; + /** + * @see {@link IAccountsCommitRevealManualRequest} {@link IAccountsCommitRevealManualResponse} + * @throws `string` in case of an error. + */ + accountsCommitRevealManual(request: IAccountsCommitRevealManualRequest): Promise; + constructor(config: IWalletConfig); + /** + * Check if a wallet with a given name exists. + */ + exists(name?: string | null): Promise; + start(): Promise; + stop(): Promise; + connect(args?: IConnectOptions | undefined | null): Promise; + disconnect(): Promise; + removeEventListener(event: WalletEventType | WalletEventType[] | string | string[], callback?: WalletNotificationCallback | null): void; + setNetworkId(network_id: NetworkId | string): void; + readonly rpc: RpcClient; + /** + * @remarks This is a local property indicating + * if the wallet is currently open. + */ readonly isOpen: boolean; -/** -* @remarks This is a local property indicating -* if the node is currently synced. -*/ + /** + * @remarks This is a local property indicating + * if the node is currently synced. + */ readonly isSynced: boolean; -/** -*/ - readonly rpc: RpcClient; + readonly descriptor: WalletDescriptor | undefined; } /** -* @category Wallet API -*/ + * @category Wallet API + */ export class WalletDescriptor { + private constructor(); /** ** Return copy of self without private attributes. */ @@ -8295,111 +7597,69 @@ export class WalletDescriptor { */ toString(): string; free(): void; -/** -*/ + get title(): string | undefined; + set title(value: string | null | undefined); filename: string; -/** -*/ - title?: string; } -/** -*/ export class WasiOptions { free(): void; -/** -* @param {any[] | undefined} args -* @param {object | undefined} env -* @param {object} preopens -*/ - constructor(args: any[] | undefined, env: object | undefined, preopens: object); -/** -* @param {object} preopens -* @returns {WasiOptions} -*/ + constructor(args: any[] | null | undefined, env: object | null | undefined, preopens: object); static new(preopens: object): WasiOptions; -/** -*/ - args?: any[]; -/** -*/ - env?: object; -/** -*/ + get args(): any[] | undefined; + set args(value: any[] | null | undefined); + get env(): object | undefined; + set env(value: object | null | undefined); preopens: object; } -/** -*/ export class WriteFileSyncOptions { free(): void; -/** -* @param {string | undefined} [encoding] -* @param {string | undefined} [flag] -* @param {number | undefined} [mode] -*/ - constructor(encoding?: string, flag?: string, mode?: number); -/** -*/ - encoding?: string; -/** -*/ - flag?: string; -/** -*/ - mode?: number; + constructor(encoding?: string | null, flag?: string | null, mode?: number | null); + get encoding(): string | undefined; + set encoding(value: string | null | undefined); + get flag(): string | undefined; + set flag(value: string | null | undefined); + get mode(): number | undefined; + set mode(value: number | null | undefined); } /** -* -* Data structure that envelopes a XOnlyPublicKey. -* -* XOnlyPublicKey is used as a payload part of the {@link Address}. -* -* @see {@link PublicKey} -* @category Wallet SDK -*/ + * + * Data structure that envelopes a XOnlyPublicKey. + * + * XOnlyPublicKey is used as a payload part of the {@link Address}. + * + * @see {@link PublicKey} + * @category Wallet SDK + */ export class XOnlyPublicKey { free(): void; -/** -* @param {string} key -*/ constructor(key: string); -/** -* @returns {string} -*/ toString(): string; -/** -* Get the [`Address`] of this XOnlyPublicKey. -* Receives a [`NetworkType`] to determine the prefix of the address. -* JavaScript: `let address = xOnlyPublicKey.toAddress(NetworkType.MAINNET);`. -* @param {NetworkType | NetworkId | string} network -* @returns {Address} -*/ + /** + * Get the [`Address`] of this XOnlyPublicKey. + * Receives a [`NetworkType`] to determine the prefix of the address. + * JavaScript: `let address = xOnlyPublicKey.toAddress(NetworkType.MAINNET);`. + */ toAddress(network: NetworkType | NetworkId | string): Address; -/** -* Get `ECDSA` [`Address`] of this XOnlyPublicKey. -* Receives a [`NetworkType`] to determine the prefix of the address. -* JavaScript: `let address = xOnlyPublicKey.toAddress(NetworkType.MAINNET);`. -* @param {NetworkType | NetworkId | string} network -* @returns {Address} -*/ + /** + * Get `ECDSA` [`Address`] of this XOnlyPublicKey. + * Receives a [`NetworkType`] to determine the prefix of the address. + * JavaScript: `let address = xOnlyPublicKey.toAddress(NetworkType.MAINNET);`. + */ toAddressECDSA(network: NetworkType | NetworkId | string): Address; -/** -* @param {Address} address -* @returns {XOnlyPublicKey} -*/ static fromAddress(address: Address): XOnlyPublicKey; } /** -* -* Extended private key (XPrv). -* -* This class allows accepts a master seed and provides -* functions for derivation of dependent child private keys. -* -* Please note that Kaspa extended private keys use `kprv` prefix. -* -* @see {@link PrivateKeyGenerator}, {@link PublicKeyGenerator}, {@link XPub}, {@link Mnemonic} -* @category Wallet SDK -*/ + * + * Extended private key (XPrv). + * + * This class allows accepts a master seed and provides + * functions for derivation of dependent child private keys. + * + * Please note that Kaspa extended private keys use `kprv` prefix. + * + * @see {@link PrivateKeyGenerator}, {@link PublicKeyGenerator}, {@link XPub}, {@link Mnemonic} + * @category Wallet SDK + */ export class XPrv { /** ** Return copy of self without private attributes. @@ -8410,75 +7670,36 @@ export class XPrv { */ toString(): string; free(): void; -/** -* @param {HexString} seed -*/ constructor(seed: HexString); -/** -* Create {@link XPrv} from `xprvxxxx..` string -* @param {string} xprv -* @returns {XPrv} -*/ + /** + * Create {@link XPrv} from `xprvxxxx..` string + */ static fromXPrv(xprv: string): XPrv; -/** -* @param {number} child_number -* @param {boolean | undefined} [hardened] -* @returns {XPrv} -*/ - deriveChild(child_number: number, hardened?: boolean): XPrv; -/** -* @param {any} path -* @returns {XPrv} -*/ + deriveChild(child_number: number, hardened?: boolean | null): XPrv; derivePath(path: any): XPrv; -/** -* @param {string} prefix -* @returns {string} -*/ intoString(prefix: string): string; -/** -* @returns {string} -*/ toString(): string; -/** -* @returns {XPub} -*/ toXPub(): XPub; -/** -* @returns {PrivateKey} -*/ toPrivateKey(): PrivateKey; -/** -*/ - readonly chainCode: string; -/** -*/ - readonly childNumber: number; -/** -*/ + readonly xprv: string; + readonly privateKey: string; readonly depth: number; -/** -*/ readonly parentFingerprint: string; -/** -*/ - readonly privateKey: string; -/** -*/ - readonly xprv: string; + readonly childNumber: number; + readonly chainCode: string; } /** -* -* Extended public key (XPub). -* -* This class allows accepts another XPub and and provides -* functions for derivation of dependent child public keys. -* -* Please note that Kaspa extended public keys use `kpub` prefix. -* -* @see {@link PrivateKeyGenerator}, {@link PublicKeyGenerator}, {@link XPrv}, {@link Mnemonic} -* @category Wallet SDK -*/ + * + * Extended public key (XPub). + * + * This class allows accepts another XPub and and provides + * functions for derivation of dependent child public keys. + * + * Please note that Kaspa extended public keys use `kpub` prefix. + * + * @see {@link PrivateKeyGenerator}, {@link PublicKeyGenerator}, {@link XPrv}, {@link Mnemonic} + * @category Wallet SDK + */ export class XPub { /** ** Return copy of self without private attributes. @@ -8489,45 +7710,16 @@ export class XPub { */ toString(): string; free(): void; -/** -* @param {string} xpub -*/ constructor(xpub: string); -/** -* @param {number} child_number -* @param {boolean | undefined} [hardened] -* @returns {XPub} -*/ - deriveChild(child_number: number, hardened?: boolean): XPub; -/** -* @param {any} path -* @returns {XPub} -*/ + deriveChild(child_number: number, hardened?: boolean | null): XPub; derivePath(path: any): XPub; -/** -* @param {string} prefix -* @returns {string} -*/ intoString(prefix: string): string; -/** -* @returns {PublicKey} -*/ toPublicKey(): PublicKey; -/** -*/ - readonly chainCode: string; -/** -*/ - readonly childNumber: number; -/** -*/ + readonly xpub: string; readonly depth: number; -/** -*/ readonly parentFingerprint: string; -/** -*/ - readonly xpub: string; + readonly childNumber: number; + readonly chainCode: string; } export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; @@ -8548,67 +7740,65 @@ export interface InitOutput { readonly mnemonic_validate: (a: number, b: number, c: number) => number; readonly mnemonic_entropy: (a: number, b: number) => void; readonly mnemonic_set_entropy: (a: number, b: number, c: number) => void; - readonly mnemonic_random: (a: number, b: number, c: number) => void; + readonly mnemonic_random: (a: number, b: number) => void; readonly mnemonic_phrase: (a: number, b: number) => void; readonly mnemonic_set_phrase: (a: number, b: number, c: number) => void; readonly mnemonic_toSeed: (a: number, b: number, c: number, d: number) => void; + readonly __wbg_transactioninput_free: (a: number, b: number) => void; + readonly transactioninput_constructor: (a: number, b: number) => void; + readonly transactioninput_get_previous_outpoint: (a: number) => number; + readonly transactioninput_set_previous_outpoint: (a: number, b: number, c: number) => void; + readonly transactioninput_get_signature_script_as_hex: (a: number, b: number) => void; + readonly transactioninput_set_signature_script_from_js_value: (a: number, b: number, c: number) => void; + readonly transactioninput_get_sequence: (a: number) => bigint; + readonly transactioninput_set_sequence: (a: number, b: bigint) => void; + readonly transactioninput_get_sig_op_count: (a: number) => number; + readonly transactioninput_set_sig_op_count: (a: number, b: number) => void; + readonly transactioninput_get_utxo: (a: number) => number; + readonly transactionsigninghashecdsa_new: () => number; + readonly transactionsigninghashecdsa_update: (a: number, b: number, c: number) => void; + readonly transactionsigninghashecdsa_finalize: (a: number, b: number) => void; + readonly __wbg_transactionsigninghashecdsa_free: (a: number, b: number) => void; + readonly transactionsigninghash_new: () => number; + readonly transactionsigninghash_update: (a: number, b: number, c: number) => void; + readonly transactionsigninghash_finalize: (a: number, b: number) => void; + readonly __wbg_transactionsigninghash_free: (a: number, b: number) => void; readonly __wbg_utxoentry_free: (a: number, b: number) => void; readonly __wbg_get_utxoentry_address: (a: number) => number; readonly __wbg_set_utxoentry_address: (a: number, b: number) => void; - readonly __wbg_get_utxoentry_outpoint: (a: number) => number; - readonly __wbg_set_utxoentry_outpoint: (a: number, b: number) => void; - readonly __wbg_get_utxoentry_amount: (a: number) => number; - readonly __wbg_set_utxoentry_amount: (a: number, b: number) => void; - readonly __wbg_get_utxoentry_scriptPublicKey: (a: number) => number; - readonly __wbg_set_utxoentry_scriptPublicKey: (a: number, b: number) => void; - readonly __wbg_get_utxoentry_blockDaaScore: (a: number) => number; - readonly __wbg_set_utxoentry_blockDaaScore: (a: number, b: number) => void; - readonly __wbg_get_utxoentry_isCoinbase: (a: number) => number; - readonly __wbg_set_utxoentry_isCoinbase: (a: number, b: number) => void; - readonly utxoentry_toString: (a: number, b: number) => void; - readonly __wbg_utxoentryreference_free: (a: number, b: number) => void; - readonly utxoentryreference_toString: (a: number, b: number) => void; - readonly utxoentryreference_entry: (a: number) => number; - readonly utxoentryreference_outpoint: (a: number) => number; - readonly utxoentryreference_address: (a: number) => number; - readonly utxoentryreference_amount: (a: number) => number; - readonly utxoentryreference_isCoinbase: (a: number) => number; - readonly utxoentryreference_blockDaaScore: (a: number) => number; - readonly utxoentryreference_scriptPublicKey: (a: number) => number; - readonly __wbg_utxoentries_free: (a: number, b: number) => void; - readonly utxoentries_js_ctor: (a: number, b: number) => void; - readonly utxoentries_get_items_as_js_array: (a: number) => number; - readonly utxoentries_set_items_from_js_array: (a: number, b: number) => void; - readonly utxoentries_sort: (a: number) => void; - readonly utxoentries_amount: (a: number) => number; - readonly __wbg_transaction_free: (a: number, b: number) => void; - readonly transaction_is_coinbase: (a: number) => number; - readonly transaction_finalize: (a: number, b: number) => void; - readonly transaction_id: (a: number, b: number) => void; - readonly transaction_constructor: (a: number, b: number) => void; - readonly transaction_get_inputs_as_js_array: (a: number) => number; - readonly transaction_addresses: (a: number, b: number, c: number) => void; - readonly transaction_set_inputs_from_js_array: (a: number, b: number) => void; - readonly transaction_get_outputs_as_js_array: (a: number) => number; - readonly transaction_set_outputs_from_js_array: (a: number, b: number) => void; - readonly transaction_version: (a: number) => number; - readonly transaction_set_version: (a: number, b: number) => void; - readonly transaction_lockTime: (a: number) => number; - readonly transaction_set_lockTime: (a: number, b: number) => void; - readonly transaction_gas: (a: number) => number; - readonly transaction_set_gas: (a: number, b: number) => void; - readonly transaction_get_subnetwork_id_as_hex: (a: number, b: number) => void; - readonly transaction_set_subnetwork_id_from_js_value: (a: number, b: number) => void; - readonly transaction_get_payload_as_hex_string: (a: number, b: number) => void; - readonly transaction_set_payload_from_js_value: (a: number, b: number) => void; - readonly transaction_get_mass: (a: number) => number; - readonly transaction_set_mass: (a: number, b: number) => void; - readonly transaction_serializeToObject: (a: number, b: number) => void; - readonly transaction_serializeToJSON: (a: number, b: number) => void; - readonly transaction_serializeToSafeJSON: (a: number, b: number) => void; - readonly transaction_deserializeFromObject: (a: number, b: number) => void; - readonly transaction_deserializeFromJSON: (a: number, b: number, c: number) => void; - readonly transaction_deserializeFromSafeJSON: (a: number, b: number, c: number) => void; + readonly __wbg_get_utxoentry_outpoint: (a: number) => number; + readonly __wbg_set_utxoentry_outpoint: (a: number, b: number) => void; + readonly __wbg_get_utxoentry_amount: (a: number) => bigint; + readonly __wbg_set_utxoentry_amount: (a: number, b: bigint) => void; + readonly __wbg_get_utxoentry_scriptPublicKey: (a: number) => number; + readonly __wbg_set_utxoentry_scriptPublicKey: (a: number, b: number) => void; + readonly __wbg_get_utxoentry_blockDaaScore: (a: number) => bigint; + readonly __wbg_set_utxoentry_blockDaaScore: (a: number, b: bigint) => void; + readonly __wbg_get_utxoentry_isCoinbase: (a: number) => number; + readonly __wbg_set_utxoentry_isCoinbase: (a: number, b: number) => void; + readonly utxoentry_toString: (a: number, b: number) => void; + readonly __wbg_utxoentryreference_free: (a: number, b: number) => void; + readonly utxoentryreference_toString: (a: number, b: number) => void; + readonly utxoentryreference_entry: (a: number) => number; + readonly utxoentryreference_outpoint: (a: number) => number; + readonly utxoentryreference_address: (a: number) => number; + readonly utxoentryreference_amount: (a: number) => bigint; + readonly utxoentryreference_isCoinbase: (a: number) => number; + readonly utxoentryreference_blockDaaScore: (a: number) => bigint; + readonly utxoentryreference_scriptPublicKey: (a: number) => number; + readonly __wbg_utxoentries_free: (a: number, b: number) => void; + readonly utxoentries_js_ctor: (a: number, b: number) => void; + readonly utxoentries_get_items_as_js_array: (a: number) => number; + readonly utxoentries_set_items_from_js_array: (a: number, b: number) => void; + readonly utxoentries_sort: (a: number) => void; + readonly utxoentries_amount: (a: number) => bigint; + readonly isScriptPayToScriptHash: (a: number, b: number) => void; + readonly isScriptPayToPubkeyECDSA: (a: number, b: number) => void; + readonly isScriptPayToPubkey: (a: number, b: number) => void; + readonly addressFromScriptPublicKey: (a: number, b: number, c: number) => void; + readonly payToScriptHashSignatureScript: (a: number, b: number, c: number) => void; + readonly payToScriptHashScript: (a: number, b: number) => void; + readonly payToAddressScript: (a: number, b: number) => void; readonly __wbg_transactionoutpoint_free: (a: number, b: number) => void; readonly transactionoutpoint_ctor: (a: number, b: number) => number; readonly transactionoutpoint_getId: (a: number, b: number) => void; @@ -8619,16 +7809,16 @@ export interface InitOutput { readonly header_asJSON: (a: number, b: number) => void; readonly header_get_version: (a: number) => number; readonly header_set_version: (a: number, b: number) => void; - readonly header_get_timestamp: (a: number) => number; - readonly header_set_timestamp: (a: number, b: number) => void; + readonly header_get_timestamp: (a: number) => bigint; + readonly header_set_timestamp: (a: number, b: bigint) => void; readonly header_bits: (a: number) => number; readonly header_set_bits: (a: number, b: number) => void; - readonly header_nonce: (a: number) => number; - readonly header_set_nonce: (a: number, b: number) => void; - readonly header_daa_score: (a: number) => number; - readonly header_set_daa_score: (a: number, b: number) => void; - readonly header_blue_score: (a: number) => number; - readonly header_set_blue_score: (a: number, b: number) => void; + readonly header_nonce: (a: number) => bigint; + readonly header_set_nonce: (a: number, b: bigint) => void; + readonly header_daa_score: (a: number) => bigint; + readonly header_set_daa_score: (a: number, b: bigint) => void; + readonly header_blue_score: (a: number) => bigint; + readonly header_set_blue_score: (a: number, b: bigint) => void; readonly header_get_hash_as_hex: (a: number, b: number) => void; readonly header_get_hash_merkle_root_as_hex: (a: number, b: number) => void; readonly header_set_hash_merkle_root_from_js_value: (a: number, b: number) => void; @@ -8644,79 +7834,81 @@ export interface InitOutput { readonly header_getBlueWorkAsHex: (a: number, b: number) => void; readonly header_set_blue_work_from_js_value: (a: number, b: number) => void; readonly __wbg_header_free: (a: number, b: number) => void; - readonly __wbg_transactioninput_free: (a: number, b: number) => void; - readonly transactioninput_constructor: (a: number, b: number) => void; - readonly transactioninput_get_previous_outpoint: (a: number) => number; - readonly transactioninput_set_previous_outpoint: (a: number, b: number, c: number) => void; - readonly transactioninput_get_signature_script_as_hex: (a: number, b: number) => void; - readonly transactioninput_set_signature_script_from_js_value: (a: number, b: number, c: number) => void; - readonly transactioninput_get_sequence: (a: number) => number; - readonly transactioninput_set_sequence: (a: number, b: number) => void; - readonly transactioninput_get_sig_op_count: (a: number) => number; - readonly transactioninput_set_sig_op_count: (a: number, b: number) => void; - readonly transactioninput_get_utxo: (a: number) => number; + readonly __wbg_transaction_free: (a: number, b: number) => void; + readonly transaction_is_coinbase: (a: number) => number; + readonly transaction_finalize: (a: number, b: number) => void; + readonly transaction_id: (a: number, b: number) => void; + readonly transaction_constructor: (a: number, b: number) => void; + readonly transaction_get_inputs_as_js_array: (a: number) => number; + readonly transaction_addresses: (a: number, b: number, c: number) => void; + readonly transaction_set_inputs_from_js_array: (a: number, b: number) => void; + readonly transaction_get_outputs_as_js_array: (a: number) => number; + readonly transaction_set_outputs_from_js_array: (a: number, b: number) => void; + readonly transaction_version: (a: number) => number; + readonly transaction_set_version: (a: number, b: number) => void; + readonly transaction_lockTime: (a: number) => bigint; + readonly transaction_set_lockTime: (a: number, b: bigint) => void; + readonly transaction_gas: (a: number) => bigint; + readonly transaction_set_gas: (a: number, b: bigint) => void; + readonly transaction_get_subnetwork_id_as_hex: (a: number, b: number) => void; + readonly transaction_set_subnetwork_id_from_js_value: (a: number, b: number) => void; + readonly transaction_get_payload_as_hex_string: (a: number, b: number) => void; + readonly transaction_set_payload_from_js_value: (a: number, b: number) => void; + readonly transaction_get_mass: (a: number) => bigint; + readonly transaction_set_mass: (a: number, b: bigint) => void; + readonly transaction_serializeToObject: (a: number, b: number) => void; + readonly transaction_serializeToJSON: (a: number, b: number) => void; + readonly transaction_serializeToSafeJSON: (a: number, b: number) => void; + readonly transaction_deserializeFromObject: (a: number, b: number) => void; + readonly transaction_deserializeFromJSON: (a: number, b: number, c: number) => void; + readonly transaction_deserializeFromSafeJSON: (a: number, b: number, c: number) => void; readonly __wbg_transactionoutput_free: (a: number, b: number) => void; - readonly transactionoutput_ctor: (a: number, b: number) => number; - readonly transactionoutput_value: (a: number) => number; - readonly transactionoutput_set_value: (a: number, b: number) => void; + readonly transactionoutput_ctor: (a: bigint, b: number) => number; + readonly transactionoutput_value: (a: number) => bigint; + readonly transactionoutput_set_value: (a: number, b: bigint) => void; readonly transactionoutput_scriptPublicKey: (a: number) => number; readonly transactionoutput_set_scriptPublicKey: (a: number, b: number) => void; - readonly isScriptPayToScriptHash: (a: number, b: number) => void; - readonly isScriptPayToPubkeyECDSA: (a: number, b: number) => void; - readonly isScriptPayToPubkey: (a: number, b: number) => void; - readonly addressFromScriptPublicKey: (a: number, b: number, c: number) => void; - readonly payToScriptHashSignatureScript: (a: number, b: number, c: number) => void; - readonly payToScriptHashScript: (a: number, b: number) => void; - readonly payToAddressScript: (a: number, b: number) => void; - readonly transactionsigninghashecdsa_new: () => number; - readonly transactionsigninghashecdsa_update: (a: number, b: number, c: number) => void; - readonly transactionsigninghashecdsa_finalize: (a: number, b: number) => void; - readonly __wbg_transactionsigninghashecdsa_free: (a: number, b: number) => void; - readonly transactionsigninghash_new: () => number; - readonly transactionsigninghash_update: (a: number, b: number, c: number) => void; - readonly transactionsigninghash_finalize: (a: number, b: number) => void; - readonly __wbg_transactionsigninghash_free: (a: number, b: number) => void; readonly __wbg_networkid_free: (a: number, b: number) => void; readonly __wbg_get_networkid_type: (a: number) => number; readonly __wbg_set_networkid_type: (a: number, b: number) => void; - readonly __wbg_get_networkid_suffix: (a: number, b: number) => void; - readonly __wbg_set_networkid_suffix: (a: number, b: number, c: number) => void; + readonly __wbg_get_networkid_suffix: (a: number) => number; + readonly __wbg_set_networkid_suffix: (a: number, b: number) => void; readonly networkid_ctor: (a: number, b: number) => void; readonly networkid_id: (a: number, b: number) => void; readonly networkid_addressPrefix: (a: number, b: number) => void; readonly networkid_toString: (a: number, b: number) => void; + readonly __wbg_sighashtype_free: (a: number, b: number) => void; readonly __wbg_scriptpublickey_free: (a: number, b: number) => void; readonly __wbg_get_scriptpublickey_version: (a: number) => number; readonly __wbg_set_scriptpublickey_version: (a: number, b: number) => void; readonly scriptpublickey_constructor: (a: number, b: number, c: number) => void; readonly scriptpublickey_script_as_hex: (a: number, b: number) => void; - readonly __wbg_sighashtype_free: (a: number, b: number) => void; readonly __wbg_transactionutxoentry_free: (a: number, b: number) => void; - readonly __wbg_get_transactionutxoentry_amount: (a: number) => number; - readonly __wbg_set_transactionutxoentry_amount: (a: number, b: number) => void; + readonly __wbg_get_transactionutxoentry_amount: (a: number) => bigint; + readonly __wbg_set_transactionutxoentry_amount: (a: number, b: bigint) => void; readonly __wbg_get_transactionutxoentry_scriptPublicKey: (a: number) => number; readonly __wbg_set_transactionutxoentry_scriptPublicKey: (a: number, b: number) => void; - readonly __wbg_get_transactionutxoentry_blockDaaScore: (a: number) => number; - readonly __wbg_set_transactionutxoentry_blockDaaScore: (a: number, b: number) => void; + readonly __wbg_get_transactionutxoentry_blockDaaScore: (a: number) => bigint; + readonly __wbg_set_transactionutxoentry_blockDaaScore: (a: number, b: bigint) => void; readonly __wbg_get_transactionutxoentry_isCoinbase: (a: number) => number; readonly __wbg_set_transactionutxoentry_isCoinbase: (a: number, b: number) => void; readonly __wbg_hash_free: (a: number, b: number) => void; readonly hash_constructor: (a: number, b: number) => number; readonly hash_toString: (a: number, b: number) => void; readonly __wbg_pow_free: (a: number, b: number) => void; - readonly pow_new: (a: number, b: number, c: number, d: number) => void; + readonly pow_new: (a: number, b: number, c: number, d: bigint) => void; readonly pow_target: (a: number, b: number) => void; - readonly pow_checkWork: (a: number, b: number, c: number) => void; + readonly pow_checkWork: (a: number, b: number, c: bigint) => void; readonly pow_get_pre_pow_hash: (a: number, b: number) => void; - readonly pow_fromRaw: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly pow_fromRaw: (a: number, b: number, c: number, d: bigint, e: number) => void; readonly calculateTarget: (a: number, b: number) => void; readonly scriptbuilder_new: () => number; readonly scriptbuilder_fromScript: (a: number, b: number) => void; readonly scriptbuilder_addOp: (a: number, b: number, c: number) => void; readonly scriptbuilder_addOps: (a: number, b: number, c: number) => void; readonly scriptbuilder_addData: (a: number, b: number, c: number) => void; - readonly scriptbuilder_addI64: (a: number, b: number, c: number) => void; - readonly scriptbuilder_addLockTime: (a: number, b: number, c: number) => void; + readonly scriptbuilder_addI64: (a: number, b: number, c: bigint) => void; + readonly scriptbuilder_addLockTime: (a: number, b: number, c: bigint) => void; readonly scriptbuilder_canonicalDataSize: (a: number, b: number) => void; readonly scriptbuilder_toString: (a: number) => number; readonly scriptbuilder_drain: (a: number) => number; @@ -8724,17 +7916,112 @@ export interface InitOutput { readonly scriptbuilder_encodePayToScriptHashSignatureScript: (a: number, b: number, c: number) => void; readonly scriptbuilder_hexView: (a: number, b: number, c: number) => void; readonly __wbg_scriptbuilder_free: (a: number, b: number) => void; - readonly scriptbuilder_addSequence: (a: number, b: number, c: number) => void; + readonly scriptbuilder_addSequence: (a: number, b: number, c: bigint) => void; readonly __wbg_storage_free: (a: number, b: number) => void; readonly storage_filename: (a: number, b: number) => void; readonly __wbg_paymentoutput_free: (a: number, b: number) => void; readonly __wbg_get_paymentoutput_address: (a: number) => number; readonly __wbg_set_paymentoutput_address: (a: number, b: number) => void; - readonly __wbg_get_paymentoutput_amount: (a: number) => number; - readonly __wbg_set_paymentoutput_amount: (a: number, b: number) => void; - readonly paymentoutput_new: (a: number, b: number) => number; + readonly __wbg_get_paymentoutput_amount: (a: number) => bigint; + readonly __wbg_set_paymentoutput_amount: (a: number, b: bigint) => void; + readonly paymentoutput_new: (a: number, b: bigint) => number; readonly __wbg_paymentoutputs_free: (a: number, b: number) => void; readonly paymentoutputs_constructor: (a: number, b: number) => void; + readonly utxocontext_ctor: (a: number, b: number) => void; + readonly utxocontext_trackAddresses: (a: number, b: number, c: number) => number; + readonly utxocontext_unregisterAddresses: (a: number, b: number) => number; + readonly utxocontext_clear: (a: number) => number; + readonly utxocontext_isActive: (a: number) => number; + readonly utxocontext_getMatureRange: (a: number, b: number, c: number, d: number) => void; + readonly utxocontext_matureLength: (a: number) => number; + readonly utxocontext_getPending: (a: number, b: number) => void; + readonly utxocontext_balance: (a: number) => number; + readonly utxocontext_balanceStrings: (a: number, b: number) => void; + readonly __wbg_utxocontext_free: (a: number, b: number) => void; + readonly generator_ctor: (a: number, b: number) => void; + readonly generator_next: (a: number) => number; + readonly generator_estimate: (a: number) => number; + readonly generator_summary: (a: number) => number; + readonly __wbg_generator_free: (a: number, b: number) => void; + readonly calculateStorageMass: (a: number, b: number, c: number, d: number) => void; + readonly calculateTransactionFee: (a: number, b: number, c: number, d: number) => void; + readonly updateTransactionMass: (a: number, b: number, c: number, d: number) => void; + readonly calculateTransactionMass: (a: number, b: number, c: number, d: number) => void; + readonly maximumStandardTransactionMass: () => bigint; + readonly generatorsummary_networkType: (a: number) => number; + readonly generatorsummary_utxos: (a: number) => number; + readonly generatorsummary_fees: (a: number) => number; + readonly generatorsummary_mass: (a: number) => number; + readonly generatorsummary_transactions: (a: number) => number; + readonly generatorsummary_finalAmount: (a: number) => number; + readonly generatorsummary_finalTransactionId: (a: number, b: number) => void; + readonly __wbg_generatorsummary_free: (a: number, b: number) => void; + readonly __wbg_accountkind_free: (a: number, b: number) => void; + readonly accountkind_ctor: (a: number, b: number, c: number) => void; + readonly accountkind_toString: (a: number, b: number) => void; + readonly prvkeydatainfo_id: (a: number, b: number) => void; + readonly prvkeydatainfo_name: (a: number) => number; + readonly prvkeydatainfo_isEncrypted: (a: number) => number; + readonly prvkeydatainfo_setName: (a: number, b: number, c: number, d: number) => void; + readonly __wbg_prvkeydatainfo_free: (a: number, b: number) => void; + readonly wallet_batch: (a: number, b: number) => number; + readonly wallet_flush: (a: number, b: number) => number; + readonly wallet_retainContext: (a: number, b: number) => number; + readonly wallet_getStatus: (a: number, b: number) => number; + readonly wallet_walletEnumerate: (a: number, b: number) => number; + readonly wallet_walletCreate: (a: number, b: number) => number; + readonly wallet_walletOpen: (a: number, b: number) => number; + readonly wallet_walletReload: (a: number, b: number) => number; + readonly wallet_walletClose: (a: number, b: number) => number; + readonly wallet_walletChangeSecret: (a: number, b: number) => number; + readonly wallet_walletExport: (a: number, b: number) => number; + readonly wallet_walletImport: (a: number, b: number) => number; + readonly wallet_prvKeyDataEnumerate: (a: number, b: number) => number; + readonly wallet_prvKeyDataCreate: (a: number, b: number) => number; + readonly wallet_prvKeyDataRemove: (a: number, b: number) => number; + readonly wallet_prvKeyDataGet: (a: number, b: number) => number; + readonly wallet_accountsEnumerate: (a: number, b: number) => number; + readonly wallet_accountsRename: (a: number, b: number) => number; + readonly wallet_accountsDiscovery: (a: number, b: number) => number; + readonly wallet_accountsCreate: (a: number, b: number) => number; + readonly wallet_accountsEnsureDefault: (a: number, b: number) => number; + readonly wallet_accountsImport: (a: number, b: number) => number; + readonly wallet_accountsActivate: (a: number, b: number) => number; + readonly wallet_accountsDeactivate: (a: number, b: number) => number; + readonly wallet_accountsGet: (a: number, b: number) => number; + readonly wallet_accountsCreateNewAddress: (a: number, b: number) => number; + readonly wallet_accountsSend: (a: number, b: number) => number; + readonly wallet_accountsPskbSign: (a: number, b: number) => number; + readonly wallet_accountsPskbBroadcast: (a: number, b: number) => number; + readonly wallet_accountsPskbSend: (a: number, b: number) => number; + readonly wallet_accountsGetUtxos: (a: number, b: number) => number; + readonly wallet_accountsTransfer: (a: number, b: number) => number; + readonly wallet_accountsEstimate: (a: number, b: number) => number; + readonly wallet_transactionsDataGet: (a: number, b: number) => number; + readonly wallet_transactionsReplaceNote: (a: number, b: number) => number; + readonly wallet_transactionsReplaceMetadata: (a: number, b: number) => number; + readonly wallet_addressBookEnumerate: (a: number, b: number) => number; + readonly wallet_feeRateEstimate: (a: number, b: number) => number; + readonly wallet_feeRatePollerEnable: (a: number, b: number) => number; + readonly wallet_feeRatePollerDisable: (a: number, b: number) => number; + readonly wallet_accountsCommitReveal: (a: number, b: number) => number; + readonly wallet_accountsCommitRevealManual: (a: number, b: number) => number; + readonly createAddress: (a: number, b: number, c: number, d: number, e: number) => void; + readonly createMultisigAddress: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly wallet_constructor: (a: number, b: number) => void; + readonly wallet_rpc: (a: number) => number; + readonly wallet_isOpen: (a: number) => number; + readonly wallet_isSynced: (a: number) => number; + readonly wallet_descriptor: (a: number) => number; + readonly wallet_exists: (a: number, b: number, c: number) => number; + readonly wallet_start: (a: number) => number; + readonly wallet_stop: (a: number) => number; + readonly wallet_connect: (a: number, b: number) => number; + readonly wallet_disconnect: (a: number) => number; + readonly wallet_addEventListener: (a: number, b: number, c: number, d: number) => void; + readonly wallet_removeEventListener: (a: number, b: number, c: number, d: number) => void; + readonly wallet_setNetworkId: (a: number, b: number, c: number) => void; + readonly __wbg_wallet_free: (a: number, b: number) => void; readonly cryptobox_ctor: (a: number, b: number, c: number) => void; readonly cryptobox_publicKey: (a: number, b: number) => void; readonly cryptobox_encrypt: (a: number, b: number, c: number, d: number) => void; @@ -8755,9 +8042,11 @@ export interface InitOutput { readonly utxoprocessor_networkId: (a: number, b: number) => void; readonly utxoprocessor_setNetworkId: (a: number, b: number, c: number) => void; readonly utxoprocessor_isActive: (a: number) => number; - readonly utxoprocessor_setCoinbaseTransactionMaturityDAA: (a: number, b: number, c: number) => void; - readonly utxoprocessor_setUserTransactionMaturityDAA: (a: number, b: number, c: number) => void; + readonly utxoprocessor_setCoinbaseTransactionMaturityDAA: (a: number, b: number, c: bigint) => void; + readonly utxoprocessor_setUserTransactionMaturityDAA: (a: number, b: number, c: bigint) => void; readonly __wbg_utxoprocessor_free: (a: number, b: number) => void; + readonly getTransactionMaturityProgress: (a: number, b: number, c: number, d: number, e: number) => void; + readonly getNetworkParams: (a: number, b: number) => void; readonly sompiToKaspaStringWithSuffix: (a: number, b: number, c: number) => void; readonly sompiToKaspaString: (a: number, b: number) => void; readonly kaspaToSompi: (a: number, b: number) => number; @@ -8782,16 +8071,9 @@ export interface InitOutput { readonly pendingtransaction_serializeToJSON: (a: number, b: number) => void; readonly pendingtransaction_serializeToSafeJSON: (a: number, b: number) => void; readonly __wbg_pendingtransaction_free: (a: number, b: number) => void; - readonly verifyMessage: (a: number, b: number) => void; - readonly signMessage: (a: number, b: number) => void; - readonly estimateTransactions: (a: number) => number; - readonly createTransactions: (a: number) => number; - readonly createTransaction: (a: number, b: number, c: number, d: number, e: number, f: number) => void; - readonly __wbg_accountkind_free: (a: number, b: number) => void; - readonly accountkind_ctor: (a: number, b: number, c: number) => void; - readonly accountkind_toString: (a: number, b: number) => void; - readonly setDefaultStorageFolder: (a: number, b: number, c: number) => void; - readonly setDefaultWalletFile: (a: number, b: number, c: number) => void; + readonly signScriptHash: (a: number, b: number, c: number) => void; + readonly createInputSignature: (a: number, b: number, c: number, d: number, e: number) => void; + readonly signTransaction: (a: number, b: number, c: number, d: number) => void; readonly balancestrings_mature: (a: number, b: number) => void; readonly balancestrings_pending: (a: number, b: number) => void; readonly __wbg_balancestrings_free: (a: number, b: number) => void; @@ -8800,36 +8082,6 @@ export interface InitOutput { readonly balance_outgoing: (a: number) => number; readonly balance_toBalanceStrings: (a: number, b: number, c: number) => void; readonly __wbg_balance_free: (a: number, b: number) => void; - readonly prvkeydatainfo_id: (a: number, b: number) => void; - readonly prvkeydatainfo_name: (a: number) => number; - readonly prvkeydatainfo_isEncrypted: (a: number) => number; - readonly prvkeydatainfo_setName: (a: number, b: number, c: number, d: number) => void; - readonly __wbg_prvkeydatainfo_free: (a: number, b: number) => void; - readonly calculateTransactionFee: (a: number, b: number, c: number, d: number) => void; - readonly updateTransactionMass: (a: number, b: number, c: number, d: number) => void; - readonly calculateTransactionMass: (a: number, b: number, c: number, d: number) => void; - readonly maximumStandardTransactionMass: () => number; - readonly signScriptHash: (a: number, b: number, c: number) => void; - readonly createInputSignature: (a: number, b: number, c: number, d: number, e: number) => void; - readonly signTransaction: (a: number, b: number, c: number, d: number) => void; - readonly createAddress: (a: number, b: number, c: number, d: number, e: number) => void; - readonly createMultisigAddress: (a: number, b: number, c: number, d: number, e: number, f: number) => void; - readonly utxocontext_ctor: (a: number, b: number) => void; - readonly utxocontext_trackAddresses: (a: number, b: number, c: number) => number; - readonly utxocontext_unregisterAddresses: (a: number, b: number) => number; - readonly utxocontext_clear: (a: number) => number; - readonly utxocontext_isActive: (a: number) => number; - readonly utxocontext_getMatureRange: (a: number, b: number, c: number, d: number) => void; - readonly utxocontext_matureLength: (a: number) => number; - readonly utxocontext_getPending: (a: number, b: number) => void; - readonly utxocontext_balance: (a: number) => number; - readonly utxocontext_balanceStrings: (a: number, b: number) => void; - readonly __wbg_utxocontext_free: (a: number, b: number) => void; - readonly generator_ctor: (a: number, b: number) => void; - readonly generator_next: (a: number) => number; - readonly generator_estimate: (a: number) => number; - readonly generator_summary: (a: number) => number; - readonly __wbg_generator_free: (a: number, b: number) => void; readonly __wbg_walletdescriptor_free: (a: number, b: number) => void; readonly __wbg_get_walletdescriptor_title: (a: number, b: number) => void; readonly __wbg_set_walletdescriptor_title: (a: number, b: number, c: number) => void; @@ -8844,13 +8096,14 @@ export interface InitOutput { readonly __wbg_get_transactionrecord_id: (a: number) => number; readonly __wbg_set_transactionrecord_id: (a: number, b: number) => void; readonly __wbg_get_transactionrecord_unixtimeMsec: (a: number, b: number) => void; - readonly __wbg_set_transactionrecord_unixtimeMsec: (a: number, b: number, c: number) => void; + readonly __wbg_set_transactionrecord_unixtimeMsec: (a: number, b: number, c: bigint) => void; readonly __wbg_get_transactionrecord_network: (a: number) => number; readonly __wbg_set_transactionrecord_network: (a: number, b: number) => void; readonly __wbg_get_transactionrecord_note: (a: number, b: number) => void; readonly __wbg_set_transactionrecord_note: (a: number, b: number, c: number) => void; readonly __wbg_get_transactionrecord_metadata: (a: number, b: number) => void; readonly __wbg_set_transactionrecord_metadata: (a: number, b: number, c: number) => void; + readonly transactionrecord_maturityProgress: (a: number, b: number, c: number) => void; readonly transactionrecord_value: (a: number) => number; readonly transactionrecord_blockDaaScore: (a: number) => number; readonly transactionrecord_binding: (a: number) => number; @@ -8858,67 +8111,21 @@ export interface InitOutput { readonly transactionrecord_type: (a: number, b: number) => void; readonly transactionrecord_hasAddress: (a: number, b: number) => number; readonly transactionrecord_serialize: (a: number) => number; - readonly wallet_constructor: (a: number, b: number) => void; - readonly wallet_rpc: (a: number) => number; - readonly wallet_isOpen: (a: number) => number; - readonly wallet_isSynced: (a: number) => number; - readonly wallet_descriptor: (a: number) => number; - readonly wallet_exists: (a: number, b: number, c: number) => number; - readonly wallet_start: (a: number) => number; - readonly wallet_stop: (a: number) => number; - readonly wallet_connect: (a: number, b: number) => number; - readonly wallet_disconnect: (a: number) => number; - readonly wallet_addEventListener: (a: number, b: number, c: number, d: number) => void; - readonly wallet_removeEventListener: (a: number, b: number, c: number, d: number) => void; - readonly __wbg_wallet_free: (a: number, b: number) => void; readonly argon2sha256ivFromText: (a: number, b: number, c: number, d: number) => void; readonly argon2sha256ivFromBinary: (a: number, b: number, c: number) => void; readonly sha256dFromText: (a: number, b: number, c: number) => void; - readonly sha256dFromBinary: (a: number, b: number) => void; - readonly sha256FromText: (a: number, b: number, c: number) => void; - readonly sha256FromBinary: (a: number, b: number) => void; - readonly decryptXChaCha20Poly1305: (a: number, b: number, c: number, d: number, e: number) => void; - readonly encryptXChaCha20Poly1305: (a: number, b: number, c: number, d: number, e: number) => void; - readonly wallet_batch: (a: number, b: number) => number; - readonly wallet_flush: (a: number, b: number) => number; - readonly wallet_retainContext: (a: number, b: number) => number; - readonly wallet_getStatus: (a: number, b: number) => number; - readonly wallet_walletEnumerate: (a: number, b: number) => number; - readonly wallet_walletCreate: (a: number, b: number) => number; - readonly wallet_walletOpen: (a: number, b: number) => number; - readonly wallet_walletReload: (a: number, b: number) => number; - readonly wallet_walletClose: (a: number, b: number) => number; - readonly wallet_walletChangeSecret: (a: number, b: number) => number; - readonly wallet_walletExport: (a: number, b: number) => number; - readonly wallet_walletImport: (a: number, b: number) => number; - readonly wallet_prvKeyDataEnumerate: (a: number, b: number) => number; - readonly wallet_prvKeyDataCreate: (a: number, b: number) => number; - readonly wallet_prvKeyDataRemove: (a: number, b: number) => number; - readonly wallet_prvKeyDataGet: (a: number, b: number) => number; - readonly wallet_accountsEnumerate: (a: number, b: number) => number; - readonly wallet_accountsRename: (a: number, b: number) => number; - readonly wallet_accountsDiscovery: (a: number, b: number) => number; - readonly wallet_accountsCreate: (a: number, b: number) => number; - readonly wallet_accountsEnsureDefault: (a: number, b: number) => number; - readonly wallet_accountsImport: (a: number, b: number) => number; - readonly wallet_accountsActivate: (a: number, b: number) => number; - readonly wallet_accountsDeactivate: (a: number, b: number) => number; - readonly wallet_accountsGet: (a: number, b: number) => number; - readonly wallet_accountsCreateNewAddress: (a: number, b: number) => number; - readonly wallet_accountsSend: (a: number, b: number) => number; - readonly wallet_accountsTransfer: (a: number, b: number) => number; - readonly wallet_accountsEstimate: (a: number, b: number) => number; - readonly wallet_transactionsDataGet: (a: number, b: number) => number; - readonly wallet_transactionsReplaceNote: (a: number, b: number) => number; - readonly wallet_transactionsReplaceMetadata: (a: number, b: number) => number; - readonly wallet_addressBookEnumerate: (a: number, b: number) => number; - readonly generatorsummary_networkType: (a: number) => number; - readonly generatorsummary_utxos: (a: number) => number; - readonly generatorsummary_fees: (a: number) => number; - readonly generatorsummary_transactions: (a: number) => number; - readonly generatorsummary_finalAmount: (a: number) => number; - readonly generatorsummary_finalTransactionId: (a: number, b: number) => void; - readonly __wbg_generatorsummary_free: (a: number, b: number) => void; + readonly sha256dFromBinary: (a: number, b: number) => void; + readonly sha256FromText: (a: number, b: number, c: number) => void; + readonly sha256FromBinary: (a: number, b: number) => void; + readonly decryptXChaCha20Poly1305: (a: number, b: number, c: number, d: number, e: number) => void; + readonly encryptXChaCha20Poly1305: (a: number, b: number, c: number, d: number, e: number) => void; + readonly setDefaultStorageFolder: (a: number, b: number, c: number) => void; + readonly setDefaultWalletFile: (a: number, b: number, c: number) => void; + readonly estimateTransactions: (a: number) => number; + readonly createTransactions: (a: number) => number; + readonly createTransaction: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly verifyMessage: (a: number, b: number) => void; + readonly signMessage: (a: number, b: number) => void; readonly __wbg_publickey_free: (a: number, b: number) => void; readonly publickey_try_new: (a: number, b: number, c: number) => void; readonly publickey_toString: (a: number, b: number) => void; @@ -8932,6 +8139,20 @@ export interface InitOutput { readonly xonlypublickey_toAddress: (a: number, b: number, c: number) => void; readonly xonlypublickey_toAddressECDSA: (a: number, b: number, c: number) => void; readonly xonlypublickey_fromAddress: (a: number, b: number) => void; + readonly __wbg_privatekey_free: (a: number, b: number) => void; + readonly privatekey_try_new: (a: number, b: number, c: number) => void; + readonly privatekey_toString: (a: number, b: number) => void; + readonly privatekey_toKeypair: (a: number, b: number) => void; + readonly privatekey_toPublicKey: (a: number, b: number) => void; + readonly privatekey_toAddress: (a: number, b: number, c: number) => void; + readonly privatekey_toAddressECDSA: (a: number, b: number, c: number) => void; + readonly __wbg_derivationpath_free: (a: number, b: number) => void; + readonly derivationpath_new: (a: number, b: number, c: number) => void; + readonly derivationpath_isEmpty: (a: number) => number; + readonly derivationpath_length: (a: number) => number; + readonly derivationpath_parent: (a: number) => number; + readonly derivationpath_push: (a: number, b: number, c: number, d: number) => void; + readonly derivationpath_toString: (a: number, b: number) => void; readonly __wbg_keypair_free: (a: number, b: number) => void; readonly keypair_get_public_key: (a: number, b: number) => void; readonly keypair_get_private_key: (a: number, b: number) => void; @@ -8951,23 +8172,9 @@ export interface InitOutput { readonly xpub_parentFingerprint: (a: number, b: number) => void; readonly xpub_childNumber: (a: number) => number; readonly xpub_chainCode: (a: number, b: number) => void; - readonly __wbg_derivationpath_free: (a: number, b: number) => void; - readonly derivationpath_new: (a: number, b: number, c: number) => void; - readonly derivationpath_isEmpty: (a: number) => number; - readonly derivationpath_length: (a: number) => number; - readonly derivationpath_parent: (a: number) => number; - readonly derivationpath_push: (a: number, b: number, c: number, d: number) => void; - readonly derivationpath_toString: (a: number, b: number) => void; - readonly __wbg_privatekey_free: (a: number, b: number) => void; - readonly privatekey_try_new: (a: number, b: number, c: number) => void; - readonly privatekey_toString: (a: number, b: number) => void; - readonly privatekey_toKeypair: (a: number, b: number) => void; - readonly privatekey_toPublicKey: (a: number, b: number) => void; - readonly privatekey_toAddress: (a: number, b: number, c: number) => void; - readonly privatekey_toAddressECDSA: (a: number, b: number, c: number) => void; readonly __wbg_publickeygenerator_free: (a: number, b: number) => void; - readonly publickeygenerator_fromXPub: (a: number, b: number, c: number, d: number) => void; - readonly publickeygenerator_fromMasterXPrv: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly publickeygenerator_fromXPub: (a: number, b: number, c: number) => void; + readonly publickeygenerator_fromMasterXPrv: (a: number, b: number, c: number, d: bigint, e: number) => void; readonly publickeygenerator_receivePubkeys: (a: number, b: number, c: number, d: number) => void; readonly publickeygenerator_receivePubkey: (a: number, b: number, c: number) => void; readonly publickeygenerator_receivePubkeysAsStrings: (a: number, b: number, c: number, d: number) => void; @@ -8986,7 +8193,7 @@ export interface InitOutput { readonly publickeygenerator_changeAddressAsString: (a: number, b: number, c: number, d: number) => void; readonly publickeygenerator_toString: (a: number, b: number) => void; readonly __wbg_privatekeygenerator_free: (a: number, b: number) => void; - readonly privatekeygenerator_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly privatekeygenerator_new: (a: number, b: number, c: number, d: bigint, e: number) => void; readonly privatekeygenerator_receiveKey: (a: number, b: number, c: number) => void; readonly privatekeygenerator_changeKey: (a: number, b: number, c: number) => void; readonly __wbg_xprv_free: (a: number, b: number) => void; @@ -9008,6 +8215,7 @@ export interface InitOutput { readonly pskt_new: (a: number, b: number) => void; readonly pskt_role: (a: number, b: number) => void; readonly pskt_payload: (a: number) => number; + readonly pskt_serialize: (a: number, b: number) => void; readonly pskt_creator: (a: number, b: number) => void; readonly pskt_toConstructor: (a: number, b: number) => void; readonly pskt_toUpdater: (a: number, b: number) => void; @@ -9015,15 +8223,25 @@ export interface InitOutput { readonly pskt_toCombiner: (a: number, b: number) => void; readonly pskt_toFinalizer: (a: number, b: number) => void; readonly pskt_toExtractor: (a: number, b: number) => void; - readonly pskt_fallbackLockTime: (a: number, b: number, c: number) => void; + readonly pskt_fallbackLockTime: (a: number, b: number, c: bigint) => void; readonly pskt_inputsModifiable: (a: number, b: number) => void; readonly pskt_outputsModifiable: (a: number, b: number) => void; readonly pskt_noMoreInputs: (a: number, b: number) => void; readonly pskt_noMoreOutputs: (a: number, b: number) => void; + readonly pskt_inputAndRedeemScript: (a: number, b: number, c: number, d: number) => void; readonly pskt_input: (a: number, b: number, c: number) => void; readonly pskt_output: (a: number, b: number, c: number) => void; - readonly pskt_setSequence: (a: number, b: number, c: number, d: number) => void; + readonly pskt_setSequence: (a: number, b: number, c: bigint, d: number) => void; readonly pskt_calculateId: (a: number, b: number) => void; + readonly pskt_calculateMass: (a: number, b: number, c: number) => void; + readonly __wbg_pskb_free: (a: number, b: number) => void; + readonly pskb_new: (a: number) => void; + readonly pskb_serialize: (a: number, b: number) => void; + readonly pskb_displayFormat: (a: number, b: number, c: number) => void; + readonly pskb_deserialize: (a: number, b: number, c: number) => void; + readonly pskb_length: (a: number) => number; + readonly pskb_add: (a: number, b: number, c: number) => void; + readonly pskb_merge: (a: number, b: number) => void; readonly version: (a: number) => void; readonly __wbg_nodedescriptor_free: (a: number, b: number) => void; readonly __wbg_get_nodedescriptor_uid: (a: number, b: number) => void; @@ -9113,6 +8331,42 @@ export interface InitOutput { readonly resolver_connect: (a: number, b: number) => number; readonly resolver_ctor: (a: number, b: number) => void; readonly __wbg_resolver_free: (a: number, b: number) => void; + readonly __wbg_appendfileoptions_free: (a: number, b: number) => void; + readonly appendfileoptions_new_with_values: (a: number, b: number, c: number) => number; + readonly appendfileoptions_new: () => number; + readonly appendfileoptions_encoding: (a: number) => number; + readonly appendfileoptions_set_encoding: (a: number, b: number) => void; + readonly appendfileoptions_mode: (a: number) => number; + readonly appendfileoptions_set_mode: (a: number, b: number) => void; + readonly appendfileoptions_flag: (a: number) => number; + readonly appendfileoptions_set_flag: (a: number, b: number) => void; + readonly __wbg_formatinputpathobject_free: (a: number, b: number) => void; + readonly formatinputpathobject_new_with_values: (a: number, b: number, c: number, d: number, e: number) => number; + readonly formatinputpathobject_new: () => number; + readonly formatinputpathobject_base: (a: number) => number; + readonly formatinputpathobject_set_base: (a: number, b: number) => void; + readonly formatinputpathobject_dir: (a: number) => number; + readonly formatinputpathobject_set_dir: (a: number, b: number) => void; + readonly formatinputpathobject_ext: (a: number) => number; + readonly formatinputpathobject_set_ext: (a: number, b: number) => void; + readonly formatinputpathobject_name: (a: number) => number; + readonly formatinputpathobject_set_name: (a: number, b: number) => void; + readonly formatinputpathobject_root: (a: number) => number; + readonly formatinputpathobject_set_root: (a: number, b: number) => void; + readonly __wbg_mkdtempsyncoptions_free: (a: number, b: number) => void; + readonly mkdtempsyncoptions_new_with_values: (a: number) => number; + readonly mkdtempsyncoptions_new: () => number; + readonly mkdtempsyncoptions_encoding: (a: number) => number; + readonly mkdtempsyncoptions_set_encoding: (a: number, b: number) => void; + readonly __wbg_wasioptions_free: (a: number, b: number) => void; + readonly wasioptions_new_with_values: (a: number, b: number, c: number, d: number) => number; + readonly wasioptions_new: (a: number) => number; + readonly wasioptions_args: (a: number, b: number) => void; + readonly wasioptions_set_args: (a: number, b: number, c: number) => void; + readonly wasioptions_env: (a: number) => number; + readonly wasioptions_set_env: (a: number, b: number) => void; + readonly wasioptions_preopens: (a: number) => number; + readonly wasioptions_set_preopens: (a: number, b: number) => void; readonly __wbg_assertionerroroptions_free: (a: number, b: number) => void; readonly assertionerroroptions_new: (a: number, b: number, c: number, d: number) => number; readonly assertionerroroptions_message: (a: number) => number; @@ -9124,7 +8378,7 @@ export interface InitOutput { readonly assertionerroroptions_operator: (a: number) => number; readonly assertionerroroptions_set_operator: (a: number, b: number) => void; readonly __wbg_createreadstreamoptions_free: (a: number, b: number) => void; - readonly createreadstreamoptions_new_with_values: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => number; + readonly createreadstreamoptions_new_with_values: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number; readonly createreadstreamoptions_auto_close: (a: number) => number; readonly createreadstreamoptions_set_auto_close: (a: number, b: number) => void; readonly createreadstreamoptions_emit_close: (a: number) => number; @@ -9133,106 +8387,16 @@ export interface InitOutput { readonly createreadstreamoptions_set_encoding: (a: number, b: number) => void; readonly createreadstreamoptions_end: (a: number, b: number) => void; readonly createreadstreamoptions_set_end: (a: number, b: number, c: number) => void; - readonly createreadstreamoptions_fd: (a: number, b: number) => void; - readonly createreadstreamoptions_set_fd: (a: number, b: number, c: number) => void; + readonly createreadstreamoptions_fd: (a: number) => number; + readonly createreadstreamoptions_set_fd: (a: number, b: number) => void; readonly createreadstreamoptions_flags: (a: number) => number; readonly createreadstreamoptions_set_flags: (a: number, b: number) => void; readonly createreadstreamoptions_high_water_mark: (a: number, b: number) => void; readonly createreadstreamoptions_set_high_water_mark: (a: number, b: number, c: number) => void; - readonly createreadstreamoptions_mode: (a: number, b: number) => void; - readonly createreadstreamoptions_set_mode: (a: number, b: number, c: number) => void; + readonly createreadstreamoptions_mode: (a: number) => number; + readonly createreadstreamoptions_set_mode: (a: number, b: number) => void; readonly createreadstreamoptions_start: (a: number, b: number) => void; readonly createreadstreamoptions_set_start: (a: number, b: number, c: number) => void; - readonly __wbg_processsendoptions_free: (a: number, b: number) => void; - readonly processsendoptions_new: (a: number) => number; - readonly processsendoptions_swallow_errors: (a: number) => number; - readonly processsendoptions_set_swallow_errors: (a: number, b: number) => void; - readonly __wbg_consoleconstructoroptions_free: (a: number, b: number) => void; - readonly consoleconstructoroptions_new_with_values: (a: number, b: number, c: number, d: number, e: number) => number; - readonly consoleconstructoroptions_new: (a: number, b: number) => number; - readonly consoleconstructoroptions_stdout: (a: number) => number; - readonly consoleconstructoroptions_set_stdout: (a: number, b: number) => void; - readonly consoleconstructoroptions_stderr: (a: number) => number; - readonly consoleconstructoroptions_set_stderr: (a: number, b: number) => void; - readonly consoleconstructoroptions_ignore_errors: (a: number) => number; - readonly consoleconstructoroptions_set_ignore_errors: (a: number, b: number) => void; - readonly consoleconstructoroptions_color_mod: (a: number) => number; - readonly consoleconstructoroptions_set_color_mod: (a: number, b: number) => void; - readonly consoleconstructoroptions_inspect_options: (a: number) => number; - readonly consoleconstructoroptions_set_inspect_options: (a: number, b: number) => void; - readonly __wbg_agentconstructoroptions_free: (a: number, b: number) => void; - readonly agentconstructoroptions_keep_alive_msecs: (a: number) => number; - readonly agentconstructoroptions_set_keep_alive_msecs: (a: number, b: number) => void; - readonly agentconstructoroptions_keep_alive: (a: number) => number; - readonly agentconstructoroptions_set_keep_alive: (a: number, b: number) => void; - readonly agentconstructoroptions_max_free_sockets: (a: number) => number; - readonly agentconstructoroptions_set_max_free_sockets: (a: number, b: number) => void; - readonly agentconstructoroptions_max_sockets: (a: number) => number; - readonly agentconstructoroptions_set_max_sockets: (a: number, b: number) => void; - readonly agentconstructoroptions_timeout: (a: number) => number; - readonly agentconstructoroptions_set_timeout: (a: number, b: number) => void; - readonly __wbg_setaadoptions_free: (a: number, b: number) => void; - readonly setaadoptions_new: (a: number, b: number, c: number) => number; - readonly setaadoptions_flush: (a: number) => number; - readonly setaadoptions_set_flush: (a: number, b: number) => void; - readonly setaadoptions_transform: (a: number) => number; - readonly setaadoptions_set_transform: (a: number, b: number) => void; - readonly setaadoptions_plaintextLength: (a: number) => number; - readonly setaadoptions_set_plaintext_length: (a: number, b: number) => void; - readonly __wbg_createhookcallbacks_free: (a: number, b: number) => void; - readonly createhookcallbacks_new: (a: number, b: number, c: number, d: number, e: number) => number; - readonly createhookcallbacks_init: (a: number) => number; - readonly createhookcallbacks_set_init: (a: number, b: number) => void; - readonly createhookcallbacks_before: (a: number) => number; - readonly createhookcallbacks_set_before: (a: number, b: number) => void; - readonly createhookcallbacks_after: (a: number) => number; - readonly createhookcallbacks_set_after: (a: number, b: number) => void; - readonly createhookcallbacks_destroy: (a: number) => number; - readonly createhookcallbacks_set_destroy: (a: number, b: number) => void; - readonly createhookcallbacks_promise_resolve: (a: number) => number; - readonly createhookcallbacks_set_promise_resolve: (a: number, b: number) => void; - readonly __wbg_pipeoptions_free: (a: number, b: number) => void; - readonly pipeoptions_new: (a: number) => number; - readonly pipeoptions_end: (a: number) => number; - readonly pipeoptions_set_end: (a: number, b: number) => void; - readonly __wbg_streamtransformoptions_free: (a: number, b: number) => void; - readonly streamtransformoptions_new: (a: number, b: number) => number; - readonly streamtransformoptions_flush: (a: number) => number; - readonly streamtransformoptions_set_flush: (a: number, b: number) => void; - readonly streamtransformoptions_transform: (a: number) => number; - readonly streamtransformoptions_set_transform: (a: number, b: number) => void; - readonly writestream_add_listener_with_open: (a: number, b: number) => number; - readonly writestream_add_listener_with_close: (a: number, b: number) => number; - readonly writestream_on_with_open: (a: number, b: number) => number; - readonly writestream_on_with_close: (a: number, b: number) => number; - readonly writestream_once_with_open: (a: number, b: number) => number; - readonly writestream_once_with_close: (a: number, b: number) => number; - readonly writestream_prepend_listener_with_open: (a: number, b: number) => number; - readonly writestream_prepend_listener_with_close: (a: number, b: number) => number; - readonly writestream_prepend_once_listener_with_open: (a: number, b: number) => number; - readonly writestream_prepend_once_listener_with_close: (a: number, b: number) => number; - readonly __wbg_appendfileoptions_free: (a: number, b: number) => void; - readonly appendfileoptions_new_with_values: (a: number, b: number, c: number, d: number) => number; - readonly appendfileoptions_new: () => number; - readonly appendfileoptions_encoding: (a: number) => number; - readonly appendfileoptions_set_encoding: (a: number, b: number) => void; - readonly appendfileoptions_mode: (a: number, b: number) => void; - readonly appendfileoptions_set_mode: (a: number, b: number, c: number) => void; - readonly appendfileoptions_flag: (a: number) => number; - readonly appendfileoptions_set_flag: (a: number, b: number) => void; - readonly __wbg_formatinputpathobject_free: (a: number, b: number) => void; - readonly formatinputpathobject_new_with_values: (a: number, b: number, c: number, d: number, e: number) => number; - readonly formatinputpathobject_new: () => number; - readonly formatinputpathobject_base: (a: number) => number; - readonly formatinputpathobject_set_base: (a: number, b: number) => void; - readonly formatinputpathobject_dir: (a: number) => number; - readonly formatinputpathobject_set_dir: (a: number, b: number) => void; - readonly formatinputpathobject_ext: (a: number) => number; - readonly formatinputpathobject_set_ext: (a: number, b: number) => void; - readonly formatinputpathobject_name: (a: number) => number; - readonly formatinputpathobject_set_name: (a: number, b: number) => void; - readonly formatinputpathobject_root: (a: number) => number; - readonly formatinputpathobject_set_root: (a: number, b: number) => void; readonly __wbg_getnameoptions_free: (a: number, b: number) => void; readonly getnameoptions_new: (a: number, b: number, c: number, d: number) => number; readonly getnameoptions_family: (a: number) => number; @@ -9243,11 +8407,15 @@ export interface InitOutput { readonly getnameoptions_set_local_address: (a: number, b: number) => void; readonly getnameoptions_port: (a: number) => number; readonly getnameoptions_set_port: (a: number, b: number) => void; - readonly __wbg_mkdtempsyncoptions_free: (a: number, b: number) => void; - readonly mkdtempsyncoptions_new_with_values: (a: number) => number; - readonly mkdtempsyncoptions_new: () => number; - readonly mkdtempsyncoptions_encoding: (a: number) => number; - readonly mkdtempsyncoptions_set_encoding: (a: number, b: number) => void; + readonly __wbg_netserveroptions_free: (a: number, b: number) => void; + readonly netserveroptions_allow_half_open: (a: number) => number; + readonly netserveroptions_set_allow_half_open: (a: number, b: number) => void; + readonly netserveroptions_pause_on_connect: (a: number) => number; + readonly __wbg_processsendoptions_free: (a: number, b: number) => void; + readonly processsendoptions_new: (a: number) => number; + readonly processsendoptions_swallow_errors: (a: number) => number; + readonly processsendoptions_set_swallow_errors: (a: number, b: number) => void; + readonly netserveroptions_set_pause_on_connect: (a: number, b: number) => void; readonly readstream_add_listener_with_open: (a: number, b: number) => number; readonly readstream_add_listener_with_close: (a: number, b: number) => number; readonly readstream_on_with_open: (a: number, b: number) => number; @@ -9258,49 +8426,99 @@ export interface InitOutput { readonly readstream_prepend_listener_with_close: (a: number, b: number) => number; readonly readstream_prepend_once_listener_with_open: (a: number, b: number) => number; readonly readstream_prepend_once_listener_with_close: (a: number, b: number) => number; + readonly __wbg_agentconstructoroptions_free: (a: number, b: number) => void; + readonly agentconstructoroptions_keep_alive_msecs: (a: number) => number; + readonly agentconstructoroptions_set_keep_alive_msecs: (a: number, b: number) => void; + readonly agentconstructoroptions_keep_alive: (a: number) => number; + readonly agentconstructoroptions_set_keep_alive: (a: number, b: number) => void; + readonly agentconstructoroptions_max_free_sockets: (a: number) => number; + readonly agentconstructoroptions_set_max_free_sockets: (a: number, b: number) => void; + readonly agentconstructoroptions_max_sockets: (a: number) => number; + readonly agentconstructoroptions_set_max_sockets: (a: number, b: number) => void; + readonly agentconstructoroptions_timeout: (a: number) => number; + readonly agentconstructoroptions_set_timeout: (a: number, b: number) => void; readonly __wbg_createwritestreamoptions_free: (a: number, b: number) => void; - readonly createwritestreamoptions_new_with_values: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number; + readonly createwritestreamoptions_new_with_values: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number; readonly createwritestreamoptions_auto_close: (a: number) => number; readonly createwritestreamoptions_set_auto_close: (a: number, b: number) => void; readonly createwritestreamoptions_emit_close: (a: number) => number; readonly createwritestreamoptions_set_emit_close: (a: number, b: number) => void; readonly createwritestreamoptions_encoding: (a: number) => number; readonly createwritestreamoptions_set_encoding: (a: number, b: number) => void; - readonly createwritestreamoptions_fd: (a: number, b: number) => void; - readonly createwritestreamoptions_set_fd: (a: number, b: number, c: number) => void; + readonly createwritestreamoptions_fd: (a: number) => number; + readonly createwritestreamoptions_set_fd: (a: number, b: number) => void; readonly createwritestreamoptions_flags: (a: number) => number; readonly createwritestreamoptions_set_flags: (a: number, b: number) => void; - readonly createwritestreamoptions_mode: (a: number, b: number) => void; - readonly createwritestreamoptions_set_mode: (a: number, b: number, c: number) => void; + readonly createwritestreamoptions_mode: (a: number) => number; + readonly createwritestreamoptions_set_mode: (a: number, b: number) => void; readonly createwritestreamoptions_start: (a: number, b: number) => void; readonly createwritestreamoptions_set_start: (a: number, b: number, c: number) => void; - readonly __wbg_netserveroptions_free: (a: number, b: number) => void; - readonly netserveroptions_allow_half_open: (a: number) => number; - readonly netserveroptions_set_allow_half_open: (a: number, b: number) => void; - readonly netserveroptions_pause_on_connect: (a: number) => number; readonly __wbg_userinfooptions_free: (a: number, b: number) => void; readonly userinfooptions_new_with_values: (a: number) => number; readonly userinfooptions_new: () => number; readonly userinfooptions_encoding: (a: number) => number; readonly userinfooptions_set_encoding: (a: number, b: number) => void; readonly __wbg_writefilesyncoptions_free: (a: number, b: number) => void; - readonly writefilesyncoptions_new: (a: number, b: number, c: number, d: number) => number; + readonly writefilesyncoptions_new: (a: number, b: number, c: number) => number; readonly writefilesyncoptions_encoding: (a: number) => number; readonly writefilesyncoptions_set_encoding: (a: number, b: number) => void; readonly writefilesyncoptions_flag: (a: number) => number; readonly writefilesyncoptions_set_flag: (a: number, b: number) => void; - readonly writefilesyncoptions_mode: (a: number, b: number) => void; - readonly writefilesyncoptions_set_mode: (a: number, b: number, c: number) => void; - readonly netserveroptions_set_pause_on_connect: (a: number, b: number) => void; - readonly __wbg_wasioptions_free: (a: number, b: number) => void; - readonly wasioptions_new_with_values: (a: number, b: number, c: number, d: number) => number; - readonly wasioptions_new: (a: number) => number; - readonly wasioptions_args: (a: number, b: number) => void; - readonly wasioptions_set_args: (a: number, b: number, c: number) => void; - readonly wasioptions_env: (a: number) => number; - readonly wasioptions_set_env: (a: number, b: number) => void; - readonly wasioptions_preopens: (a: number) => number; - readonly wasioptions_set_preopens: (a: number, b: number) => void; + readonly writefilesyncoptions_mode: (a: number) => number; + readonly writefilesyncoptions_set_mode: (a: number, b: number) => void; + readonly __wbg_consoleconstructoroptions_free: (a: number, b: number) => void; + readonly consoleconstructoroptions_new_with_values: (a: number, b: number, c: number, d: number, e: number) => number; + readonly consoleconstructoroptions_new: (a: number, b: number) => number; + readonly consoleconstructoroptions_stdout: (a: number) => number; + readonly consoleconstructoroptions_set_stdout: (a: number, b: number) => void; + readonly consoleconstructoroptions_stderr: (a: number) => number; + readonly consoleconstructoroptions_set_stderr: (a: number, b: number) => void; + readonly consoleconstructoroptions_ignore_errors: (a: number) => number; + readonly consoleconstructoroptions_set_ignore_errors: (a: number, b: number) => void; + readonly consoleconstructoroptions_color_mod: (a: number) => number; + readonly consoleconstructoroptions_set_color_mod: (a: number, b: number) => void; + readonly consoleconstructoroptions_inspect_options: (a: number) => number; + readonly consoleconstructoroptions_set_inspect_options: (a: number, b: number) => void; + readonly __wbg_pipeoptions_free: (a: number, b: number) => void; + readonly pipeoptions_new: (a: number) => number; + readonly pipeoptions_end: (a: number) => number; + readonly pipeoptions_set_end: (a: number, b: number) => void; + readonly writestream_add_listener_with_open: (a: number, b: number) => number; + readonly writestream_add_listener_with_close: (a: number, b: number) => number; + readonly writestream_on_with_open: (a: number, b: number) => number; + readonly writestream_on_with_close: (a: number, b: number) => number; + readonly writestream_once_with_open: (a: number, b: number) => number; + readonly writestream_once_with_close: (a: number, b: number) => number; + readonly writestream_prepend_listener_with_open: (a: number, b: number) => number; + readonly writestream_prepend_listener_with_close: (a: number, b: number) => number; + readonly writestream_prepend_once_listener_with_open: (a: number, b: number) => number; + readonly writestream_prepend_once_listener_with_close: (a: number, b: number) => number; + readonly __wbg_createhookcallbacks_free: (a: number, b: number) => void; + readonly createhookcallbacks_new: (a: number, b: number, c: number, d: number, e: number) => number; + readonly createhookcallbacks_init: (a: number) => number; + readonly createhookcallbacks_set_init: (a: number, b: number) => void; + readonly createhookcallbacks_before: (a: number) => number; + readonly createhookcallbacks_set_before: (a: number, b: number) => void; + readonly createhookcallbacks_after: (a: number) => number; + readonly createhookcallbacks_set_after: (a: number, b: number) => void; + readonly createhookcallbacks_destroy: (a: number) => number; + readonly createhookcallbacks_set_destroy: (a: number, b: number) => void; + readonly createhookcallbacks_promise_resolve: (a: number) => number; + readonly createhookcallbacks_set_promise_resolve: (a: number, b: number) => void; + readonly __wbg_streamtransformoptions_free: (a: number, b: number) => void; + readonly streamtransformoptions_new: (a: number, b: number) => number; + readonly streamtransformoptions_flush: (a: number) => number; + readonly streamtransformoptions_set_flush: (a: number, b: number) => void; + readonly streamtransformoptions_transform: (a: number) => number; + readonly streamtransformoptions_set_transform: (a: number, b: number) => void; + readonly __wbg_setaadoptions_free: (a: number, b: number) => void; + readonly setaadoptions_new: (a: number, b: number, c: number) => number; + readonly setaadoptions_flush: (a: number) => number; + readonly setaadoptions_set_flush: (a: number, b: number) => void; + readonly setaadoptions_plaintextLength: (a: number) => number; + readonly setaadoptions_set_plaintext_length: (a: number, b: number) => void; + readonly setaadoptions_transform: (a: number) => number; + readonly setaadoptions_set_transform: (a: number, b: number) => void; readonly rustsecp256k1_v0_10_0_context_create: (a: number) => number; readonly rustsecp256k1_v0_10_0_context_destroy: (a: number) => void; readonly rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void; @@ -9313,31 +8531,26 @@ export interface InitOutput { readonly abortable_check: (a: number, b: number) => void; readonly abortable_reset: (a: number) => void; readonly setLogLevel: (a: number) => void; + readonly initWASM32Bindings: (a: number, b: number) => void; readonly defer: () => number; readonly presentPanicHookLogs: () => void; readonly initConsolePanicHook: () => void; readonly initBrowserPanicHook: () => void; - readonly initWASM32Bindings: (a: number, b: number) => void; - readonly __wbindgen_export_0: (a: number, b: number) => number; - readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number; - readonly __wbindgen_export_2: WebAssembly.Table; - readonly __wbindgen_export_3: (a: number, b: number) => void; - readonly __wbindgen_export_4: (a: number, b: number, c: number) => void; - readonly __wbindgen_export_5: (a: number, b: number, c: number) => void; - readonly __wbindgen_export_6: (a: number, b: number) => void; + readonly __wbindgen_export_0: (a: number) => void; + readonly __wbindgen_export_1: (a: number, b: number) => number; + readonly __wbindgen_export_2: (a: number, b: number, c: number, d: number) => number; + readonly __wbindgen_export_3: (a: number, b: number, c: number) => void; + readonly __wbindgen_export_4: WebAssembly.Table; readonly __wbindgen_add_to_stack_pointer: (a: number) => number; - readonly __wbindgen_export_7: (a: number, b: number, c: number, d: number) => void; - readonly __wbindgen_export_8: (a: number, b: number) => void; + readonly __wbindgen_export_5: (a: number, b: number) => void; + readonly __wbindgen_export_6: (a: number, b: number) => void; + readonly __wbindgen_export_7: (a: number, b: number, c: number) => void; + readonly __wbindgen_export_8: (a: number, b: number, c: number, d: number) => void; readonly __wbindgen_export_9: (a: number, b: number, c: number) => void; readonly __wbindgen_export_10: (a: number, b: number, c: number) => void; - readonly __wbindgen_export_11: (a: number, b: number, c: number) => void; - readonly __wbindgen_export_12: (a: number, b: number) => void; - readonly __wbindgen_export_13: (a: number, b: number, c: number, d: number) => number; - readonly __wbindgen_export_14: (a: number, b: number, c: number) => void; - readonly __wbindgen_export_15: (a: number, b: number) => void; - readonly __wbindgen_export_16: (a: number) => void; - readonly __wbindgen_export_17: (a: number, b: number, c: number) => void; - readonly __wbindgen_export_18: (a: number, b: number, c: number, d: number) => void; + readonly __wbindgen_export_11: (a: number, b: number, c: number, d: number) => number; + readonly __wbindgen_export_12: (a: number, b: number, c: number) => void; + readonly __wbindgen_export_13: (a: number, b: number, c: number, d: number) => void; } export type SyncInitInput = BufferSource | WebAssembly.Module; diff --git a/wasm/core/kaspa.js b/wasm/core/kaspa.js index eab49c32..f9b16eaa 100644 --- a/wasm/core/kaspa.js +++ b/wasm/core/kaspa.js @@ -17,21 +17,15 @@ function addHeapObject(obj) { return 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; +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_export_0(addHeapObject(e)); + } } -const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } }); - -if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; +let WASM_VECTOR_LEN = 0; let cachedUint8ArrayMemory0 = null; @@ -42,40 +36,20 @@ function getUint8ArrayMemory0() { return cachedUint8ArrayMemory0; } -function getStringFromWasm0(ptr, len) { - ptr = ptr >>> 0; - return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); -} - -function isLikeNone(x) { - return x === undefined || x === null; -} - -let cachedDataViewMemory0 = null; - -function getDataViewMemory0() { - if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { - cachedDataViewMemory0 = new DataView(wasm.memory.buffer); - } - return cachedDataViewMemory0; -} - -let WASM_VECTOR_LEN = 0; - -const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } }); +const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' ? function (arg, view) { - return cachedTextEncoder.encodeInto(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 - }; - }); + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); function passStringToWasm0(arg, malloc, realloc) { @@ -116,11 +90,103 @@ function passStringToWasm0(arg, malloc, realloc) { return ptr; } +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + +if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +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; +} + +function getArrayU8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); +} + +const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(state => { + wasm.__wbindgen_export_4.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_4.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 makeClosure(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++; + try { + return f(state.a, state.b, ...args); + } finally { + if (--state.cnt === 0) { + wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b); + state.a = 0; + CLOSURE_DTORS.unregister(state); + } + } + }; + real.original = state; + CLOSURE_DTORS.register(real, state, state); + return real; +} + function debugString(val) { // primitive types const type = typeof val; if (type == 'number' || type == 'boolean' || val == null) { - return `${val}`; + return `${val}`; } if (type == 'string') { return `"${val}"`; @@ -148,7 +214,7 @@ function debugString(val) { if (length > 0) { debug += debugString(val[0]); } - for (let i = 1; i < length; i++) { + for(let i = 1; i < length; i++) { debug += ', ' + debugString(val[i]); } debug += ']'; @@ -157,7 +223,7 @@ function debugString(val) { // Test for built-in const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); let className; - if (builtInMatches.length > 1) { + if (builtInMatches && builtInMatches.length > 1) { className = builtInMatches[1]; } else { // Failed to match the standard '[object ClassName]' @@ -181,156 +247,26 @@ function debugString(val) { return className; } -const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } - : new FinalizationRegistry(state => { - wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b) - }); - -function makeClosure(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++; - try { - return f(state.a, state.b, ...args); - } finally { - if (--state.cnt === 0) { - wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b); - state.a = 0; - CLOSURE_DTORS.unregister(state); - } - } - }; - real.original = state; - CLOSURE_DTORS.register(real, state, state); - return real; -} -function __wbg_adapter_60(arg0, arg1) { - wasm.__wbindgen_export_3(arg0, arg1); -} - -function __wbg_adapter_63(arg0, arg1, arg2) { - wasm.__wbindgen_export_4(arg0, arg1, addHeapObject(arg2)); -} - -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_66(arg0, arg1, arg2) { - wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2)); -} - -function __wbg_adapter_69(arg0, arg1) { - wasm.__wbindgen_export_6(arg0, arg1); -} - -function __wbg_adapter_76(arg0, arg1, arg2) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.__wbindgen_export_7(retptr, arg0, arg1, addHeapObject(arg2)); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - if (r1) { - throw takeObject(r0); - } - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } -} - -function __wbg_adapter_79(arg0, arg1) { - wasm.__wbindgen_export_8(arg0, arg1); -} - -function __wbg_adapter_82(arg0, arg1, arg2) { - wasm.__wbindgen_export_9(arg0, arg1, addHeapObject(arg2)); -} - -function __wbg_adapter_89(arg0, arg1, arg2) { - wasm.__wbindgen_export_10(arg0, arg1, addHeapObject(arg2)); -} - -function __wbg_adapter_92(arg0, arg1, arg2) { - wasm.__wbindgen_export_11(arg0, arg1, addHeapObject(arg2)); -} - -function __wbg_adapter_95(arg0, arg1) { - wasm.__wbindgen_export_12(arg0, arg1); -} - -function __wbg_adapter_98(arg0, arg1, arg2) { - wasm.__wbindgen_export_11(arg0, arg1, arg2); -} - -function __wbg_adapter_101(arg0, arg1, arg2, arg3) { - const ret = wasm.__wbindgen_export_13(arg0, arg1, addHeapObject(arg2), arg3); - return takeObject(ret); -} - -function __wbg_adapter_104(arg0, arg1, arg2) { - wasm.__wbindgen_export_14(arg0, arg1, addHeapObject(arg2)); -} - -function __wbg_adapter_109(arg0, arg1) { - wasm.__wbindgen_export_15(arg0, arg1); -} +let stack_pointer = 128; -function handleError(f, args) { - try { - return f.apply(this, args); - } catch (e) { - wasm.__wbindgen_export_16(addHeapObject(e)); - } -} -function __wbg_adapter_218(arg0, arg1, arg2, arg3) { - wasm.__wbindgen_export_18(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); +function addBorrowedObject(obj) { + if (stack_pointer == 1) throw new Error('out of js stack'); + heap[--stack_pointer] = obj; + return stack_pointer; } function _assertClass(instance, klass) { if (!(instance instanceof klass)) { throw new Error(`expected instance of ${klass.name}`); } - return instance.ptr; -} - -let stack_pointer = 128; - -function addBorrowedObject(obj) { - if (stack_pointer == 1) throw new Error('out of js stack'); - heap[--stack_pointer] = obj; - return stack_pointer; } /** -* Returns true if the script passed is a pay-to-script-hash (P2SH) format, false otherwise. -* @param script - The script ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} script -* @returns {boolean} -*/ + * Returns true if the script passed is a pay-to-script-hash (P2SH) format, false otherwise. + * @param script - The script ({@link HexString} or Uint8Array). + * @category Wallet SDK + * @param {HexString | Uint8Array} script + * @returns {boolean} + */ export function isScriptPayToScriptHash(script) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -348,12 +284,12 @@ export function isScriptPayToScriptHash(script) { } /** -* Returns returns true if the script passed is an ECDSA pay-to-pubkey. -* @param script - The script ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} script -* @returns {boolean} -*/ + * Returns returns true if the script passed is an ECDSA pay-to-pubkey. + * @param script - The script ({@link HexString} or Uint8Array). + * @category Wallet SDK + * @param {HexString | Uint8Array} script + * @returns {boolean} + */ export function isScriptPayToPubkeyECDSA(script) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -371,12 +307,12 @@ export function isScriptPayToPubkeyECDSA(script) { } /** -* Returns true if the script passed is a pay-to-pubkey. -* @param script - The script ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} script -* @returns {boolean} -*/ + * Returns true if the script passed is a pay-to-pubkey. + * @param script - The script ({@link HexString} or Uint8Array). + * @category Wallet SDK + * @param {HexString | Uint8Array} script + * @returns {boolean} + */ export function isScriptPayToPubkey(script) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -394,14 +330,14 @@ export function isScriptPayToPubkey(script) { } /** -* Returns the address encoded in a script public key. -* @param script_public_key - The script public key ({@link ScriptPublicKey}). -* @param network - The network type. -* @category Wallet SDK -* @param {ScriptPublicKey | HexString} script_public_key -* @param {NetworkType | NetworkId | string} network -* @returns {Address | undefined} -*/ + * Returns the address encoded in a script public key. + * @param script_public_key - The script public key ({@link ScriptPublicKey}). + * @param network - The network type. + * @category Wallet SDK + * @param {ScriptPublicKey | HexString} script_public_key + * @param {NetworkType | NetworkId | string} network + * @returns {Address | undefined} + */ export function addressFromScriptPublicKey(script_public_key, network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -421,14 +357,14 @@ export function addressFromScriptPublicKey(script_public_key, network) { } /** -* Generates a signature script that fits a pay-to-script-hash script. -* @param redeem_script - The redeem script ({@link HexString} or Uint8Array). -* @param signature - The signature ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} redeem_script -* @param {HexString | Uint8Array} signature -* @returns {HexString} -*/ + * Generates a signature script that fits a pay-to-script-hash script. + * @param redeem_script - The redeem script ({@link HexString} or Uint8Array). + * @param signature - The signature ({@link HexString} or Uint8Array). + * @category Wallet SDK + * @param {HexString | Uint8Array} redeem_script + * @param {HexString | Uint8Array} signature + * @returns {HexString} + */ export function payToScriptHashSignatureScript(redeem_script, signature) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -446,12 +382,12 @@ export function payToScriptHashSignatureScript(redeem_script, signature) { } /** -* Takes a script and returns an equivalent pay-to-script-hash script. -* @param redeem_script - The redeem script ({@link HexString} or Uint8Array). -* @category Wallet SDK -* @param {HexString | Uint8Array} redeem_script -* @returns {ScriptPublicKey} -*/ + * Takes a script and returns an equivalent pay-to-script-hash script. + * @param redeem_script - The redeem script ({@link HexString} or Uint8Array). + * @category Wallet SDK + * @param {HexString | Uint8Array} redeem_script + * @returns {ScriptPublicKey} + */ export function payToScriptHashScript(redeem_script) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -469,11 +405,11 @@ export function payToScriptHashScript(redeem_script) { } /** -* Creates a new script to pay a transaction output to the specified address. -* @category Wallet SDK -* @param {Address | string} address -* @returns {ScriptPublicKey} -*/ + * Creates a new script to pay a transaction output to the specified address. + * @category Wallet SDK + * @param {Address | string} address + * @returns {ScriptPublicKey} + */ export function payToAddressScript(address) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -492,12 +428,12 @@ export function payToAddressScript(address) { } /** -* Calculates target from difficulty, based on set_difficulty function on -* -* @category Mining -* @param {number} difficulty -* @returns {bigint} -*/ + * Calculates target from difficulty, based on set_difficulty function on + * + * @category Mining + * @param {number} difficulty + * @returns {bigint} + */ export function calculateTarget(difficulty) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -515,98 +451,97 @@ export function calculateTarget(difficulty) { } /** -* -* Format a Sompi amount to a string representation of the amount in Kaspa with a suffix -* based on the network type (e.g. `KAS` for mainnet, `TKAS` for testnet, -* `SKAS` for simnet, `DKAS` for devnet). -* -* @category Wallet SDK -* @param {bigint | number | HexString} sompi -* @param {NetworkType | NetworkId | string} network -* @returns {string} -*/ -export function sompiToKaspaStringWithSuffix(sompi, network) { - let deferred2_0; - let deferred2_1; + * `calculateStorageMass()` is a helper function to compute the storage mass of inputs and outputs. + * This function can be use to calculate the storage mass of transaction inputs and outputs. + * Note that the storage mass is only a component of the total transaction mass. You are not + * meant to use this function by itself and should use `calculateTransactionMass()` instead. + * This function purely exists for diagnostic purposes and to help with complex algorithms that + * may require a manual UTXO selection for identifying UTXOs and outputs needed for low storage mass. + * + * @category Wallet SDK + * @see {@link maximumStandardTransactionMass} + * @see {@link calculateTransactionMass} + * @param {NetworkId | string} network_id + * @param {Array} input_values + * @param {Array} output_values + * @returns {bigint | undefined} + */ +export function calculateStorageMass(network_id, input_values, output_values) { try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.sompiToKaspaStringWithSuffix(retptr, addHeapObject(sompi), addBorrowedObject(network)); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-32); + wasm.calculateStorageMass(retptr, addHeapObject(network_id), addBorrowedObject(input_values), addBorrowedObject(output_values)); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); - var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); - var ptr1 = r0; - var len1 = r1; - if (r3) { - ptr1 = 0; len1 = 0; - throw takeObject(r2); - } - deferred2_0 = ptr1; - deferred2_1 = len1; - return getStringFromWasm0(ptr1, len1); + var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true); + var r4 = getDataViewMemory0().getInt32(retptr + 4 * 4, true); + var r5 = getDataViewMemory0().getInt32(retptr + 4 * 5, true); + if (r5) { + throw takeObject(r4); + } + return r0 === 0 ? undefined : BigInt.asUintN(64, r2); } finally { - wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_add_to_stack_pointer(32); + heap[stack_pointer++] = undefined; heap[stack_pointer++] = undefined; - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); } } /** -* -* Convert Sompi to a string representation of the amount in Kaspa. -* -* @category Wallet SDK -* @param {bigint | number | HexString} sompi -* @returns {string} -*/ -export function sompiToKaspaString(sompi) { - let deferred2_0; - let deferred2_1; + * `calculateTransactionFee()` returns minimum fees needed for the transaction to be + * accepted by the network. If the transaction is invalid or the mass can not be calculated, + * the function throws an error. If the mass exceeds the maximum standard transaction mass, + * the function returns `undefined`. + * + * @category Wallet SDK + * @see {@link maximumStandardTransactionMass} + * @see {@link calculateTransactionMass} + * @see {@link updateTransactionMass} + * @param {NetworkId | string} network_id + * @param {ITransaction | Transaction} tx + * @param {number | null} [minimum_signatures] + * @returns {bigint | undefined} + */ +export function calculateTransactionFee(network_id, tx, minimum_signatures) { try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.sompiToKaspaString(retptr, addHeapObject(sompi)); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-32); + wasm.calculateTransactionFee(retptr, addHeapObject(network_id), addBorrowedObject(tx), isLikeNone(minimum_signatures) ? 0xFFFFFF : minimum_signatures); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); - var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); - var ptr1 = r0; - var len1 = r1; - if (r3) { - ptr1 = 0; len1 = 0; - throw takeObject(r2); + var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true); + var r4 = getDataViewMemory0().getInt32(retptr + 4 * 4, true); + var r5 = getDataViewMemory0().getInt32(retptr + 4 * 5, true); + if (r5) { + throw takeObject(r4); } - deferred2_0 = ptr1; - deferred2_1 = len1; - return getStringFromWasm0(ptr1, len1); + return r0 === 0 ? undefined : BigInt.asUintN(64, r2); } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_add_to_stack_pointer(32); + heap[stack_pointer++] = undefined; } } /** -* Convert a Kaspa string to Sompi represented by bigint. -* This function provides correct precision handling and -* can be used to parse user input. -* @category Wallet SDK -* @param {string} kaspa -* @returns {bigint | undefined} -*/ -export function kaspaToSompi(kaspa) { - const ptr0 = passStringToWasm0(kaspa, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.kaspaToSompi(ptr0, len0); - return takeObject(ret); -} - -/** -* Verifies with a public key the signature of the given message -* @category Message Signing -*/ -export function verifyMessage(value) { + * `updateTransactionMass()` updates the mass property of the passed transaction. + * If the transaction is invalid, the function throws an error. + * + * The function returns `true` if the mass is within the maximum standard transaction mass and + * the transaction mass is updated. Otherwise, the function returns `false`. + * + * This is similar to `calculateTransactionMass()` but modifies the supplied + * `Transaction` object. + * + * @category Wallet SDK + * @see {@link maximumStandardTransactionMass} + * @see {@link calculateTransactionMass} + * @see {@link calculateTransactionFee} + * @param {NetworkId | string} network_id + * @param {Transaction} tx + * @param {number | null} [minimum_signatures] + * @returns {boolean} + */ +export function updateTransactionMass(network_id, tx, minimum_signatures) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.verifyMessage(retptr, addHeapObject(value)); + _assertClass(tx, Transaction); + wasm.updateTransactionMass(retptr, addHeapObject(network_id), tx.__wbg_ptr, isLikeNone(minimum_signatures) ? 0xFFFFFF : minimum_signatures); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); @@ -620,265 +555,257 @@ export function verifyMessage(value) { } /** -* Signs a message with the given private key -* @category Message Signing -* @param {ISignMessage} value -* @returns {HexString} -*/ -export function signMessage(value) { + * `calculateTransactionMass()` returns the mass of the passed transaction. + * If the transaction is invalid, or the mass can not be calculated + * the function throws an error. + * + * The mass value must not exceed the maximum standard transaction mass + * that can be obtained using `maximumStandardTransactionMass()`. + * + * @category Wallet SDK + * @see {@link maximumStandardTransactionMass} + * @param {NetworkId | string} network_id + * @param {ITransaction | Transaction} tx + * @param {number | null} [minimum_signatures] + * @returns {bigint} + */ +export function calculateTransactionMass(network_id, tx, minimum_signatures) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.signMessage(retptr, addHeapObject(value)); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + wasm.calculateTransactionMass(retptr, addHeapObject(network_id), addBorrowedObject(tx), isLikeNone(minimum_signatures) ? 0xFFFFFF : minimum_signatures); + var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); - if (r2) { - throw takeObject(r1); + var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + if (r3) { + throw takeObject(r2); } - return takeObject(r0); + return BigInt.asUintN(64, r0); } finally { wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; } } /** -* Helper function that creates an estimate using the transaction {@link Generator} -* by producing only the {@link GeneratorSummary} containing the estimate. -* @see {@link IGeneratorSettingsObject}, {@link Generator}, {@link createTransactions} -* @category Wallet SDK -* @param {IGeneratorSettingsObject} settings -* @returns {Promise} -*/ -export function estimateTransactions(settings) { - const ret = wasm.estimateTransactions(addHeapObject(settings)); - return takeObject(ret); -} - -/** -* Helper function that creates a set of transactions using the transaction {@link Generator}. -* @see {@link IGeneratorSettingsObject}, {@link Generator}, {@link estimateTransactions} -* @category Wallet SDK -* @param {IGeneratorSettingsObject} settings -* @returns {Promise} -*/ -export function createTransactions(settings) { - const ret = wasm.createTransactions(addHeapObject(settings)); - return takeObject(ret); + * `maximumStandardTransactionMass()` returns the maximum transaction + * size allowed by the network. + * + * @category Wallet SDK + * @see {@link calculateTransactionMass} + * @see {@link updateTransactionMass} + * @see {@link calculateTransactionFee} + * @returns {bigint} + */ +export function maximumStandardTransactionMass() { + const ret = wasm.maximumStandardTransactionMass(); + return BigInt.asUintN(64, ret); } /** -* Create a basic transaction without any mass limit checks. -* @category Wallet SDK -* @param {IUtxoEntry[]} utxo_entry_source -* @param {IPaymentOutput[]} outputs -* @param {bigint} priority_fee -* @param {HexString | Uint8Array | undefined} [payload] -* @param {number | undefined} [sig_op_count] -* @returns {Transaction} -*/ -export function createTransaction(utxo_entry_source, outputs, priority_fee, payload, sig_op_count) { + * @category Wallet SDK + * @param {PublicKey | string} key + * @param {NetworkType | NetworkId | string} network + * @param {boolean | null} [ecdsa] + * @param {AccountKind | null} [account_kind] + * @returns {Address} + */ +export function createAddress(key, network, ecdsa, account_kind) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.createTransaction(retptr, addHeapObject(utxo_entry_source), addHeapObject(outputs), addHeapObject(priority_fee), isLikeNone(payload) ? 0 : addHeapObject(payload), isLikeNone(sig_op_count) ? 0xFFFFFF : sig_op_count); + let ptr0 = 0; + if (!isLikeNone(account_kind)) { + _assertClass(account_kind, AccountKind); + ptr0 = account_kind.__destroy_into_raw(); + } + wasm.createAddress(retptr, addBorrowedObject(key), addBorrowedObject(network), isLikeNone(ecdsa) ? 0xFFFFFF : ecdsa ? 1 : 0, ptr0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); if (r2) { throw takeObject(r1); } - return Transaction.__wrap(r0); + return Address.__wrap(r0); } finally { wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; + heap[stack_pointer++] = undefined; } } /** -* Set a custom storage folder for the wallet SDK -* subsystem. Encrypted wallet files and transaction -* data will be stored in this folder. If not set -* the storage folder will default to `~/.kaspa` -* (note that the folder is hidden). -* -* This must be called before using any other wallet -* SDK functions. -* -* NOTE: This function will create a folder if it -* doesn't exist. This function will have no effect -* if invoked in the browser environment. -* -* @param {String} folder - the path to the storage folder -* -* @category Wallet API -*/ -export function setDefaultStorageFolder(folder) { + * @category Wallet SDK + * @param {number} minimum_signatures + * @param {(PublicKey | string)[]} keys + * @param {NetworkType} network_type + * @param {boolean | null} [ecdsa] + * @param {AccountKind | null} [account_kind] + * @returns {Address} + */ +export function createMultisigAddress(minimum_signatures, keys, network_type, ecdsa, account_kind) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(folder, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - const len0 = WASM_VECTOR_LEN; - wasm.setDefaultStorageFolder(retptr, ptr0, len0); + let ptr0 = 0; + if (!isLikeNone(account_kind)) { + _assertClass(account_kind, AccountKind); + ptr0 = account_kind.__destroy_into_raw(); + } + wasm.createMultisigAddress(retptr, minimum_signatures, addBorrowedObject(keys), network_type, isLikeNone(ecdsa) ? 0xFFFFFF : ecdsa ? 1 : 0, ptr0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - if (r1) { - throw takeObject(r0); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); } + return Address.__wrap(r0); } finally { wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; } } /** -* Set the name of the default wallet file name -* or the `localStorage` key. If `Wallet::open` -* is called without a wallet file name, this name -* will be used. Please note that this name -* will be suffixed with `.wallet` suffix. -* -* This function should be called before using any -* other wallet SDK functions. -* -* @param {String} folder - the name to the wallet file or key. -* -* @category Wallet API -* @param {string} folder -*/ -export function setDefaultWalletFile(folder) { + * @param {bigint} blockDaaScore + * @param {bigint} currentDaaScore + * @param {NetworkId | string} networkId + * @param {boolean} isCoinbase + * @returns {string} + */ +export function getTransactionMaturityProgress(blockDaaScore, currentDaaScore, networkId, isCoinbase) { + let deferred2_0; + let deferred2_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(folder, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - const len0 = WASM_VECTOR_LEN; - wasm.setDefaultWalletFile(retptr, ptr0, len0); + wasm.getTransactionMaturityProgress(retptr, addHeapObject(blockDaaScore), addHeapObject(currentDaaScore), addHeapObject(networkId), isCoinbase); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - if (r1) { - throw takeObject(r0); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + var ptr1 = r0; + var len1 = r1; + if (r3) { + ptr1 = 0; len1 = 0; + throw takeObject(r2); } + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** -* `calculateTransactionFee()` returns minimum fees needed for the transaction to be -* accepted by the network. If the transaction is invalid or the mass can not be calculated, -* the function throws an error. If the mass exceeds the maximum standard transaction mass, -* the function returns `undefined`. -* -* @category Wallet SDK -* @see {@link maximumStandardTransactionMass} -* @see {@link calculateTransactionMass} -* @see {@link updateTransactionMass} -* @param {NetworkId | string} network_id -* @param {ITransaction | Transaction} tx -* @param {number | undefined} [minimum_signatures] -* @returns {bigint | undefined} -*/ -export function calculateTransactionFee(network_id, tx, minimum_signatures) { + * @param {NetworkId | string} networkId + * @returns {INetworkParams} + */ +export function getNetworkParams(networkId) { try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-32); - wasm.calculateTransactionFee(retptr, addHeapObject(network_id), addBorrowedObject(tx), isLikeNone(minimum_signatures) ? 0xFFFFFF : minimum_signatures); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.getNetworkParams(retptr, addHeapObject(networkId)); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true); - var r4 = getDataViewMemory0().getInt32(retptr + 4 * 4, true); - var r5 = getDataViewMemory0().getInt32(retptr + 4 * 5, true); - if (r5) { - throw takeObject(r4); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); } - return r0 === 0 ? undefined : BigInt.asUintN(64, r2); + return takeObject(r0); } finally { - wasm.__wbindgen_add_to_stack_pointer(32); - heap[stack_pointer++] = undefined; + wasm.__wbindgen_add_to_stack_pointer(16); } } /** -* `updateTransactionMass()` updates the mass property of the passed transaction. -* If the transaction is invalid, the function throws an error. -* -* The function returns `true` if the mass is within the maximum standard transaction mass and -* the transaction mass is updated. Otherwise, the function returns `false`. -* -* This is similar to `calculateTransactionMass()` but modifies the supplied -* `Transaction` object. -* -* @category Wallet SDK -* @see {@link maximumStandardTransactionMass} -* @see {@link calculateTransactionMass} -* @see {@link calculateTransactionFee} -* @param {NetworkId | string} network_id -* @param {Transaction} tx -* @param {number | undefined} [minimum_signatures] -* @returns {boolean} -*/ -export function updateTransactionMass(network_id, tx, minimum_signatures) { + * + * Format a Sompi amount to a string representation of the amount in Kaspa with a suffix + * based on the network type (e.g. `KAS` for mainnet, `TKAS` for testnet, + * `SKAS` for simnet, `DKAS` for devnet). + * + * @category Wallet SDK + * @param {bigint | number | HexString} sompi + * @param {NetworkType | NetworkId | string} network + * @returns {string} + */ +export function sompiToKaspaStringWithSuffix(sompi, network) { + let deferred2_0; + let deferred2_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - _assertClass(tx, Transaction); - wasm.updateTransactionMass(retptr, addHeapObject(network_id), tx.__wbg_ptr, isLikeNone(minimum_signatures) ? 0xFFFFFF : minimum_signatures); + wasm.sompiToKaspaStringWithSuffix(retptr, addHeapObject(sompi), addBorrowedObject(network)); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); - if (r2) { - throw takeObject(r1); + var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + var ptr1 = r0; + var len1 = r1; + if (r3) { + ptr1 = 0; len1 = 0; + throw takeObject(r2); } - return r0 !== 0; + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** -* `calculateTransactionMass()` returns the mass of the passed transaction. -* If the transaction is invalid, or the mass can not be calculated -* the function throws an error. -* -* The mass value must not exceed the maximum standard transaction mass -* that can be obtained using `maximumStandardTransactionMass()`. -* -* @category Wallet SDK -* @see {@link maximumStandardTransactionMass} -* @param {NetworkId | string} network_id -* @param {ITransaction | Transaction} tx -* @param {number | undefined} [minimum_signatures] -* @returns {bigint} -*/ -export function calculateTransactionMass(network_id, tx, minimum_signatures) { + * + * Convert Sompi to a string representation of the amount in Kaspa. + * + * @category Wallet SDK + * @param {bigint | number | HexString} sompi + * @returns {string} + */ +export function sompiToKaspaString(sompi) { + let deferred2_0; + let deferred2_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.calculateTransactionMass(retptr, addHeapObject(network_id), addBorrowedObject(tx), isLikeNone(minimum_signatures) ? 0xFFFFFF : minimum_signatures); - var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true); + wasm.sompiToKaspaString(retptr, addHeapObject(sompi)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + var ptr1 = r0; + var len1 = r1; if (r3) { + ptr1 = 0; len1 = 0; throw takeObject(r2); } - return BigInt.asUintN(64, r0); + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - heap[stack_pointer++] = undefined; + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** -* `maximumStandardTransactionMass()` returns the maximum transaction -* size allowed by the network. -* -* @category Wallet SDK -* @see {@link calculateTransactionMass} -* @see {@link updateTransactionMass} -* @see {@link calculateTransactionFee} -* @returns {bigint} -*/ -export function maximumStandardTransactionMass() { - const ret = wasm.maximumStandardTransactionMass(); - return BigInt.asUintN(64, ret); + * Convert a Kaspa string to Sompi represented by bigint. + * This function provides correct precision handling and + * can be used to parse user input. + * @category Wallet SDK + * @param {string} kaspa + * @returns {bigint | undefined} + */ +export function kaspaToSompi(kaspa) { + const ptr0 = passStringToWasm0(kaspa, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.kaspaToSompi(ptr0, len0); + return takeObject(ret); } /** -* @category Wallet SDK -* @param {any} script_hash -* @param {PrivateKey} privkey -* @returns {string} -*/ + * @category Wallet SDK + * @param {any} script_hash + * @param {PrivateKey} privkey + * @returns {string} + */ export function signScriptHash(script_hash, privkey) { let deferred2_0; let deferred2_1; @@ -901,19 +828,19 @@ export function signScriptHash(script_hash, privkey) { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** -* `createInputSignature()` is a helper function to sign a transaction input with a specific SigHash type using a private key. -* @category Wallet SDK -* @param {Transaction} tx -* @param {number} input_index -* @param {PrivateKey} private_key -* @param {SighashType | undefined} [sighash_type] -* @returns {HexString} -*/ + * `createInputSignature()` is a helper function to sign a transaction input with a specific SigHash type using a private key. + * @category Wallet SDK + * @param {Transaction} tx + * @param {number} input_index + * @param {PrivateKey} private_key + * @param {SighashType | null} [sighash_type] + * @returns {HexString} + */ export function createInputSignature(tx, input_index, private_key, sighash_type) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -933,13 +860,13 @@ export function createInputSignature(tx, input_index, private_key, sighash_type) } /** -* `signTransaction()` is a helper function to sign a transaction using a private key array or a signer array. -* @category Wallet SDK -* @param {Transaction} tx -* @param {(PrivateKey | HexString | Uint8Array)[]} signer -* @param {boolean} verify_sig -* @returns {Transaction} -*/ + * `signTransaction()` is a helper function to sign a transaction using a private key array or a signer array. + * @category Wallet SDK + * @param {Transaction} tx + * @param {(PrivateKey | HexString | Uint8Array)[]} signer + * @param {boolean} verify_sig + * @returns {Transaction} + */ export function signTransaction(tx, signer, verify_sig) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -959,79 +886,17 @@ export function signTransaction(tx, signer, verify_sig) { } /** -* @category Wallet SDK -* @param {PublicKey | string} key -* @param {NetworkType | NetworkId | string} network -* @param {boolean | undefined} [ecdsa] -* @param {AccountKind | undefined} [account_kind] -* @returns {Address} -*/ -export function createAddress(key, network, ecdsa, account_kind) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - let ptr0 = 0; - if (!isLikeNone(account_kind)) { - _assertClass(account_kind, AccountKind); - ptr0 = account_kind.__destroy_into_raw(); - } - wasm.createAddress(retptr, addBorrowedObject(key), addBorrowedObject(network), isLikeNone(ecdsa) ? 0xFFFFFF : ecdsa ? 1 : 0, ptr0); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); - if (r2) { - throw takeObject(r1); - } - return Address.__wrap(r0); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - heap[stack_pointer++] = undefined; - heap[stack_pointer++] = undefined; - } -} - -/** -* @category Wallet SDK -* @param {number} minimum_signatures -* @param {(PublicKey | string)[]} keys -* @param {NetworkType} network_type -* @param {boolean | undefined} [ecdsa] -* @param {AccountKind | undefined} [account_kind] -* @returns {Address} -*/ -export function createMultisigAddress(minimum_signatures, keys, network_type, ecdsa, account_kind) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - let ptr0 = 0; - if (!isLikeNone(account_kind)) { - _assertClass(account_kind, AccountKind); - ptr0 = account_kind.__destroy_into_raw(); - } - wasm.createMultisigAddress(retptr, minimum_signatures, addBorrowedObject(keys), network_type, isLikeNone(ecdsa) ? 0xFFFFFF : ecdsa ? 1 : 0, ptr0); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); - if (r2) { - throw takeObject(r1); - } - return Address.__wrap(r0); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - heap[stack_pointer++] = undefined; - } -} - -/** -* WASM32 binding for `argon2sha256iv` hash function. -* @param text - The text string to hash. -* @category Encryption -* @param {string} text -* @param {number} byteLength -* @returns {HexString} -*/ + * WASM32 binding for `argon2sha256iv` hash function. + * @param text - The text string to hash. + * @category Encryption + * @param {string} text + * @param {number} byteLength + * @returns {HexString} + */ export function argon2sha256ivFromText(text, byteLength) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.argon2sha256ivFromText(retptr, ptr0, len0, byteLength); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -1047,13 +912,13 @@ export function argon2sha256ivFromText(text, byteLength) { } /** -* WASM32 binding for `argon2sha256iv` hash function. -* @param data - The data to hash ({@link HexString} or Uint8Array). -* @category Encryption -* @param {HexString | Uint8Array} data -* @param {number} hashLength -* @returns {HexString} -*/ + * WASM32 binding for `argon2sha256iv` hash function. + * @param data - The data to hash ({@link HexString} or Uint8Array). + * @category Encryption + * @param {HexString | Uint8Array} data + * @param {number} hashLength + * @returns {HexString} + */ export function argon2sha256ivFromBinary(data, hashLength) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -1071,16 +936,16 @@ export function argon2sha256ivFromBinary(data, hashLength) { } /** -* WASM32 binding for `SHA256d` hash function. -* @param {string} text - The text string to hash. -* @category Encryption -* @param {string} text -* @returns {HexString} -*/ + * WASM32 binding for `SHA256d` hash function. + * @param {string} text - The text string to hash. + * @category Encryption + * @param {string} text + * @returns {HexString} + */ export function sha256dFromText(text) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.sha256dFromText(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -1096,12 +961,12 @@ export function sha256dFromText(text) { } /** -* WASM32 binding for `SHA256d` hash function. -* @param data - The data to hash ({@link HexString} or Uint8Array). -* @category Encryption -* @param {HexString | Uint8Array} data -* @returns {HexString} -*/ + * WASM32 binding for `SHA256d` hash function. + * @param data - The data to hash ({@link HexString} or Uint8Array). + * @category Encryption + * @param {HexString | Uint8Array} data + * @returns {HexString} + */ export function sha256dFromBinary(data) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -1119,16 +984,16 @@ export function sha256dFromBinary(data) { } /** -* WASM32 binding for `SHA256` hash function. -* @param {string} text - The text string to hash. -* @category Encryption -* @param {string} text -* @returns {HexString} -*/ + * WASM32 binding for `SHA256` hash function. + * @param {string} text - The text string to hash. + * @category Encryption + * @param {string} text + * @returns {HexString} + */ export function sha256FromText(text) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.sha256FromText(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -1144,12 +1009,12 @@ export function sha256FromText(text) { } /** -* WASM32 binding for `SHA256` hash function. -* @param data - The data to hash ({@link HexString} or Uint8Array). -* @category Encryption -* @param {HexString | Uint8Array} data -* @returns {HexString} -*/ + * WASM32 binding for `SHA256` hash function. + * @param data - The data to hash ({@link HexString} or Uint8Array). + * @category Encryption + * @param {HexString | Uint8Array} data + * @returns {HexString} + */ export function sha256FromBinary(data) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -1167,20 +1032,20 @@ export function sha256FromBinary(data) { } /** -* WASM32 binding for `decryptXChaCha20Poly1305` function. -* @category Encryption -* @param {string} base64string -* @param {string} password -* @returns {string} -*/ + * WASM32 binding for `decryptXChaCha20Poly1305` function. + * @category Encryption + * @param {string} base64string + * @param {string} password + * @returns {string} + */ export function decryptXChaCha20Poly1305(base64string, password) { let deferred4_0; let deferred4_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(base64string, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(base64string, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len1 = WASM_VECTOR_LEN; wasm.decryptXChaCha20Poly1305(retptr, ptr0, len0, ptr1, len1); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -1198,26 +1063,26 @@ export function decryptXChaCha20Poly1305(base64string, password) { return getStringFromWasm0(ptr3, len3); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred4_0, deferred4_1, 1); + wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1); } } /** -* WASM32 binding for `encryptXChaCha20Poly1305` function. -* @returns The encrypted text as a base64 string. -* @category Encryption -* @param {string} plainText -* @param {string} password -* @returns {string} -*/ + * WASM32 binding for `encryptXChaCha20Poly1305` function. + * @returns The encrypted text as a base64 string. + * @category Encryption + * @param {string} plainText + * @param {string} password + * @returns {string} + */ export function encryptXChaCha20Poly1305(plainText, password) { let deferred4_0; let deferred4_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(plainText, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(plainText, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len1 = WASM_VECTOR_LEN; wasm.encryptXChaCha20Poly1305(retptr, ptr0, len0, ptr1, len1); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -1235,41 +1100,199 @@ export function encryptXChaCha20Poly1305(plainText, password) { return getStringFromWasm0(ptr3, len3); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred4_0, deferred4_1, 1); + wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1); } } /** -* Returns the version of the Rusty Kaspa framework. -* @category General -* @returns {string} -*/ -export function version() { - let deferred1_0; - let deferred1_1; + * Set a custom storage folder for the wallet SDK + * subsystem. Encrypted wallet files and transaction + * data will be stored in this folder. If not set + * the storage folder will default to `~/.kaspa` + * (note that the folder is hidden). + * + * This must be called before using any other wallet + * SDK functions. + * + * NOTE: This function will create a folder if it + * doesn't exist. This function will have no effect + * if invoked in the browser environment. + * + * @param {String} folder - the path to the storage folder + * + * @category Wallet API + */ +export function setDefaultStorageFolder(folder) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.version(retptr); + const ptr0 = passStringToWasm0(folder, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + wasm.setDefaultStorageFolder(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - deferred1_0 = r0; - deferred1_1 = r1; - return getStringFromWasm0(r0, r1); + if (r1) { + throw takeObject(r0); + } } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); } } -function passArrayJsValueToWasm0(array, malloc) { - const ptr = malloc(array.length * 4, 4) >>> 0; - const mem = getDataViewMemory0(); - for (let i = 0; i < array.length; i++) { - mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true); - } - WASM_VECTOR_LEN = array.length; - return ptr; -} +/** + * Set the name of the default wallet file name + * or the `localStorage` key. If `Wallet::open` + * is called without a wallet file name, this name + * will be used. Please note that this name + * will be suffixed with `.wallet` suffix. + * + * This function should be called before using any + * other wallet SDK functions. + * + * @param {String} folder - the name to the wallet file or key. + * + * @category Wallet API + * @param {string} folder + */ +export function setDefaultWalletFile(folder) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + const ptr0 = passStringToWasm0(folder, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + wasm.setDefaultWalletFile(retptr, ptr0, len0); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } +} + +/** + * Helper function that creates an estimate using the transaction {@link Generator} + * by producing only the {@link GeneratorSummary} containing the estimate. + * @see {@link IGeneratorSettingsObject}, {@link Generator}, {@link createTransactions} + * @category Wallet SDK + * @param {IGeneratorSettingsObject} settings + * @returns {Promise} + */ +export function estimateTransactions(settings) { + const ret = wasm.estimateTransactions(addHeapObject(settings)); + return takeObject(ret); +} + +/** + * Helper function that creates a set of transactions using the transaction {@link Generator}. + * @see {@link IGeneratorSettingsObject}, {@link Generator}, {@link estimateTransactions} + * @category Wallet SDK + * @param {IGeneratorSettingsObject} settings + * @returns {Promise} + */ +export function createTransactions(settings) { + const ret = wasm.createTransactions(addHeapObject(settings)); + return takeObject(ret); +} + +/** + * Create a basic transaction without any mass limit checks. + * @category Wallet SDK + * @param {IUtxoEntry[]} utxo_entry_source + * @param {IPaymentOutput[]} outputs + * @param {bigint} priority_fee + * @param {HexString | Uint8Array | null} [payload] + * @param {number | null} [sig_op_count] + * @returns {Transaction} + */ +export function createTransaction(utxo_entry_source, outputs, priority_fee, payload, sig_op_count) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.createTransaction(retptr, addHeapObject(utxo_entry_source), addHeapObject(outputs), addHeapObject(priority_fee), isLikeNone(payload) ? 0 : addHeapObject(payload), isLikeNone(sig_op_count) ? 0xFFFFFF : sig_op_count); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return Transaction.__wrap(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } +} + +/** + * Verifies with a public key the signature of the given message + * @category Message Signing + */ +export function verifyMessage(value) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.verifyMessage(retptr, addHeapObject(value)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return r0 !== 0; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } +} + +/** + * Signs a message with the given private key + * @category Message Signing + * @param {ISignMessage} value + * @returns {HexString} + */ +export function signMessage(value) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.signMessage(retptr, addHeapObject(value)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return takeObject(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } +} + +/** + * Returns the version of the Rusty Kaspa framework. + * @category General + * @returns {string} + */ +export function version() { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.version(retptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); + } +} + +function passArrayJsValueToWasm0(array, malloc) { + const ptr = malloc(array.length * 4, 4) >>> 0; + const mem = getDataViewMemory0(); + for (let i = 0; i < array.length; i++) { + mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true); + } + WASM_VECTOR_LEN = array.length; + return ptr; +} function getArrayJsValueFromWasm0(ptr, len) { ptr = ptr >>> 0; @@ -1281,78 +1304,104 @@ function getArrayJsValueFromWasm0(ptr, len) { return result; } /** -*Set the logger log level using a string representation. -*Available variants are: 'off', 'error', 'warn', 'info', 'debug', 'trace' -*@category General -* @param {"off" | "error" | "warn" | "info" | "debug" | "trace"} level -*/ + * Set the logger log level using a string representation. + * Available variants are: 'off', 'error', 'warn', 'info', 'debug', 'trace' + * @category General + * @param {"off" | "error" | "warn" | "info" | "debug" | "trace"} level + */ export function setLogLevel(level) { wasm.setLogLevel(addHeapObject(level)); } /** -* Initialize Rust panic handler in console mode. -* -* This will output additional debug information during a panic to the console. -* This function should be called right after loading WASM libraries. -* @category General -*/ + * Configuration for the WASM32 bindings runtime interface. + * @see {@link IWASM32BindingsConfig} + * @category General + * @param {IWASM32BindingsConfig} config + */ +export function initWASM32Bindings(config) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.initWASM32Bindings(retptr, addHeapObject(config)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } +} + +/** + * Initialize Rust panic handler in console mode. + * + * This will output additional debug information during a panic to the console. + * This function should be called right after loading WASM libraries. + * @category General + */ export function initConsolePanicHook() { wasm.initConsolePanicHook(); } /** -* Initialize Rust panic handler in browser mode. -* -* This will output additional debug information during a panic in the browser -* by creating a full-screen `DIV`. This is useful on mobile devices or where -* the user otherwise has no access to console/developer tools. Use -* {@link presentPanicHookLogs} to activate the panic logs in the -* browser environment. -* @see {@link presentPanicHookLogs} -* @category General -*/ + * Initialize Rust panic handler in browser mode. + * + * This will output additional debug information during a panic in the browser + * by creating a full-screen `DIV`. This is useful on mobile devices or where + * the user otherwise has no access to console/developer tools. Use + * {@link presentPanicHookLogs} to activate the panic logs in the + * browser environment. + * @see {@link presentPanicHookLogs} + * @category General + */ export function initBrowserPanicHook() { wasm.initBrowserPanicHook(); } /** -* Present panic logs to the user in the browser. -* -* This function should be called after a panic has occurred and the -* browser-based panic hook has been activated. It will present the -* collected panic logs in a full-screen `DIV` in the browser. -* @see {@link initBrowserPanicHook} -* @category General -*/ + * Present panic logs to the user in the browser. + * + * This function should be called after a panic has occurred and the + * browser-based panic hook has been activated. It will present the + * collected panic logs in a full-screen `DIV` in the browser. + * @see {@link initBrowserPanicHook} + * @category General + */ export function presentPanicHookLogs() { wasm.presentPanicHookLogs(); } /** -*r" Deferred promise - an object that has `resolve()` and `reject()` -*r" functions that can be called outside of the promise body. -*r" WARNING: This function uses `eval` and can not be used in environments -*r" where dynamically-created code can not be executed such as web browser -*r" extensions. -*r" @category General -* @returns {Promise} -*/ + * r" Deferred promise - an object that has `resolve()` and `reject()` + * r" functions that can be called outside of the promise body. + * r" WARNING: This function uses `eval` and can not be used in environments + * r" where dynamically-created code can not be executed such as web browser + * r" extensions. + * r" @category General + * @returns {Promise} + */ export function defer() { const ret = wasm.defer(); return takeObject(ret); } -/** -* Configuration for the WASM32 bindings runtime interface. -* @see {@link IWASM32BindingsConfig} -* @category General -* @param {IWASM32BindingsConfig} config -*/ -export function initWASM32Bindings(config) { +function __wbg_adapter_66(arg0, arg1) { + wasm.__wbindgen_export_5(arg0, arg1); +} + +function __wbg_adapter_69(arg0, arg1) { + wasm.__wbindgen_export_6(arg0, arg1); +} + +function __wbg_adapter_72(arg0, arg1, arg2) { + wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_75(arg0, arg1, arg2) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.initWASM32Bindings(retptr, addHeapObject(config)); + wasm.__wbindgen_export_8(retptr, arg0, arg1, addHeapObject(arg2)); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); if (r1) { @@ -1363,144 +1412,471 @@ export function initWASM32Bindings(config) { } } -function getArrayU8FromWasm0(ptr, len) { - ptr = ptr >>> 0; - return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); +function __wbg_adapter_78(arg0, arg1, arg2) { + wasm.__wbindgen_export_9(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_81(arg0, arg1, arg2) { + wasm.__wbindgen_export_10(arg0, arg1, arg2); +} + +function __wbg_adapter_84(arg0, arg1, arg2, arg3) { + const ret = wasm.__wbindgen_export_11(arg0, arg1, addHeapObject(arg2), arg3); + return takeObject(ret); +} + +function __wbg_adapter_87(arg0, arg1, arg2) { + wasm.__wbindgen_export_10(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_90(arg0, arg1, arg2) { + wasm.__wbindgen_export_12(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_199(arg0, arg1, arg2, arg3) { + wasm.__wbindgen_export_13(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); } + /** -* -* Languages supported by BIP39. -* -* Presently only English is specified by the BIP39 standard. -* -* @see {@link Mnemonic} -* -* @category Wallet SDK -*/ -export const Language = Object.freeze({ + * @category Wallet API + * @enum {0} + */ +export const AccountsDiscoveryKind = Object.freeze({ + Bip44: 0, "0": "Bip44", +}); +/** + * + * Kaspa `Address` version (`PubKey`, `PubKey ECDSA`, `ScriptHash`) + * + * @category Address + * @enum {0 | 1 | 8} + */ +export const AddressVersion = Object.freeze({ /** - * English is presently the only supported language - */ - English: 0, "0": "English", + * PubKey addresses always have the version byte set to 0 + */ + PubKey: 0, "0": "PubKey", + /** + * PubKey ECDSA addresses always have the version byte set to 1 + */ + PubKeyECDSA: 1, "1": "PubKeyECDSA", + /** + * ScriptHash addresses always have the version byte set to 8 + */ + ScriptHash: 8, "8": "ScriptHash", +}); +/** + * Specifies the type of an account address to be used in + * commit reveal redeem script and also to spend reveal + * operation to. + * + * @category Wallet API + * @enum {0 | 1} + */ +export const CommitRevealAddressKind = Object.freeze({ + Receive: 0, "0": "Receive", + Change: 1, "1": "Change", }); /** -* `ConnectionStrategy` specifies how the WebSocket `async fn connect()` -* function should behave during the first-time connectivity phase. -* @category WebSocket -*/ + * `ConnectionStrategy` specifies how the WebSocket `async fn connect()` + * function should behave during the first-time connectivity phase. + * @category WebSocket + * @enum {0 | 1} + */ export const ConnectStrategy = Object.freeze({ /** - * Continuously attempt to connect to the server. This behavior will - * block `connect()` function until the connection is established. - */ + * Continuously attempt to connect to the server. This behavior will + * block `connect()` function until the connection is established. + */ Retry: 0, "0": "Retry", /** - * Causes `connect()` to return immediately if the first-time connection - * has failed. - */ + * Causes `connect()` to return immediately if the first-time connection + * has failed. + */ Fallback: 1, "1": "Fallback", }); /** -* Specifies the type of an account address to create. -* The address can bea receive address or a change address. -* -* @category Wallet API -*/ -export const NewAddressKind = Object.freeze({ Receive: 0, "0": "Receive", Change: 1, "1": "Change", }); -/** -* Kaspa Transaction Script Opcodes -* @see {@link ScriptBuilder} -* @category Consensus -*/ -export const Opcodes = Object.freeze({ - OpFalse: 0, "0": "OpFalse", OpData1: 1, "1": "OpData1", OpData2: 2, "2": "OpData2", OpData3: 3, "3": "OpData3", OpData4: 4, "4": "OpData4", OpData5: 5, "5": "OpData5", OpData6: 6, "6": "OpData6", OpData7: 7, "7": "OpData7", OpData8: 8, "8": "OpData8", OpData9: 9, "9": "OpData9", OpData10: 10, "10": "OpData10", OpData11: 11, "11": "OpData11", OpData12: 12, "12": "OpData12", OpData13: 13, "13": "OpData13", OpData14: 14, "14": "OpData14", OpData15: 15, "15": "OpData15", OpData16: 16, "16": "OpData16", OpData17: 17, "17": "OpData17", OpData18: 18, "18": "OpData18", OpData19: 19, "19": "OpData19", OpData20: 20, "20": "OpData20", OpData21: 21, "21": "OpData21", OpData22: 22, "22": "OpData22", OpData23: 23, "23": "OpData23", OpData24: 24, "24": "OpData24", OpData25: 25, "25": "OpData25", OpData26: 26, "26": "OpData26", OpData27: 27, "27": "OpData27", OpData28: 28, "28": "OpData28", OpData29: 29, "29": "OpData29", OpData30: 30, "30": "OpData30", OpData31: 31, "31": "OpData31", OpData32: 32, "32": "OpData32", OpData33: 33, "33": "OpData33", OpData34: 34, "34": "OpData34", OpData35: 35, "35": "OpData35", OpData36: 36, "36": "OpData36", OpData37: 37, "37": "OpData37", OpData38: 38, "38": "OpData38", OpData39: 39, "39": "OpData39", OpData40: 40, "40": "OpData40", OpData41: 41, "41": "OpData41", OpData42: 42, "42": "OpData42", OpData43: 43, "43": "OpData43", OpData44: 44, "44": "OpData44", OpData45: 45, "45": "OpData45", OpData46: 46, "46": "OpData46", OpData47: 47, "47": "OpData47", OpData48: 48, "48": "OpData48", OpData49: 49, "49": "OpData49", OpData50: 50, "50": "OpData50", OpData51: 51, "51": "OpData51", OpData52: 52, "52": "OpData52", OpData53: 53, "53": "OpData53", OpData54: 54, "54": "OpData54", OpData55: 55, "55": "OpData55", OpData56: 56, "56": "OpData56", OpData57: 57, "57": "OpData57", OpData58: 58, "58": "OpData58", OpData59: 59, "59": "OpData59", OpData60: 60, "60": "OpData60", OpData61: 61, "61": "OpData61", OpData62: 62, "62": "OpData62", OpData63: 63, "63": "OpData63", OpData64: 64, "64": "OpData64", OpData65: 65, "65": "OpData65", OpData66: 66, "66": "OpData66", OpData67: 67, "67": "OpData67", OpData68: 68, "68": "OpData68", OpData69: 69, "69": "OpData69", OpData70: 70, "70": "OpData70", OpData71: 71, "71": "OpData71", OpData72: 72, "72": "OpData72", OpData73: 73, "73": "OpData73", OpData74: 74, "74": "OpData74", OpData75: 75, "75": "OpData75", OpPushData1: 76, "76": "OpPushData1", OpPushData2: 77, "77": "OpPushData2", OpPushData4: 78, "78": "OpPushData4", Op1Negate: 79, "79": "Op1Negate", OpReserved: 80, "80": "OpReserved", OpTrue: 81, "81": "OpTrue", Op2: 82, "82": "Op2", Op3: 83, "83": "Op3", Op4: 84, "84": "Op4", Op5: 85, "85": "Op5", Op6: 86, "86": "Op6", Op7: 87, "87": "Op7", Op8: 88, "88": "Op8", Op9: 89, "89": "Op9", Op10: 90, "90": "Op10", Op11: 91, "91": "Op11", Op12: 92, "92": "Op12", Op13: 93, "93": "Op13", Op14: 94, "94": "Op14", Op15: 95, "95": "Op15", Op16: 96, "96": "Op16", OpNop: 97, "97": "OpNop", OpVer: 98, "98": "OpVer", OpIf: 99, "99": "OpIf", OpNotIf: 100, "100": "OpNotIf", OpVerIf: 101, "101": "OpVerIf", OpVerNotIf: 102, "102": "OpVerNotIf", OpElse: 103, "103": "OpElse", OpEndIf: 104, "104": "OpEndIf", OpVerify: 105, "105": "OpVerify", OpReturn: 106, "106": "OpReturn", OpToAltStack: 107, "107": "OpToAltStack", OpFromAltStack: 108, "108": "OpFromAltStack", Op2Drop: 109, "109": "Op2Drop", Op2Dup: 110, "110": "Op2Dup", Op3Dup: 111, "111": "Op3Dup", Op2Over: 112, "112": "Op2Over", Op2Rot: 113, "113": "Op2Rot", Op2Swap: 114, "114": "Op2Swap", OpIfDup: 115, "115": "OpIfDup", OpDepth: 116, "116": "OpDepth", OpDrop: 117, "117": "OpDrop", OpDup: 118, "118": "OpDup", OpNip: 119, "119": "OpNip", OpOver: 120, "120": "OpOver", OpPick: 121, "121": "OpPick", OpRoll: 122, "122": "OpRoll", OpRot: 123, "123": "OpRot", OpSwap: 124, "124": "OpSwap", OpTuck: 125, "125": "OpTuck", - /** - * Splice opcodes. - */ - OpCat: 126, "126": "OpCat", OpSubStr: 127, "127": "OpSubStr", OpLeft: 128, "128": "OpLeft", OpRight: 129, "129": "OpRight", OpSize: 130, "130": "OpSize", - /** - * Bitwise logic opcodes. - */ - OpInvert: 131, "131": "OpInvert", OpAnd: 132, "132": "OpAnd", OpOr: 133, "133": "OpOr", OpXor: 134, "134": "OpXor", OpEqual: 135, "135": "OpEqual", OpEqualVerify: 136, "136": "OpEqualVerify", OpReserved1: 137, "137": "OpReserved1", OpReserved2: 138, "138": "OpReserved2", - /** - * Numeric related opcodes. - */ - Op1Add: 139, "139": "Op1Add", Op1Sub: 140, "140": "Op1Sub", Op2Mul: 141, "141": "Op2Mul", Op2Div: 142, "142": "Op2Div", OpNegate: 143, "143": "OpNegate", OpAbs: 144, "144": "OpAbs", OpNot: 145, "145": "OpNot", Op0NotEqual: 146, "146": "Op0NotEqual", OpAdd: 147, "147": "OpAdd", OpSub: 148, "148": "OpSub", OpMul: 149, "149": "OpMul", OpDiv: 150, "150": "OpDiv", OpMod: 151, "151": "OpMod", OpLShift: 152, "152": "OpLShift", OpRShift: 153, "153": "OpRShift", OpBoolAnd: 154, "154": "OpBoolAnd", OpBoolOr: 155, "155": "OpBoolOr", OpNumEqual: 156, "156": "OpNumEqual", OpNumEqualVerify: 157, "157": "OpNumEqualVerify", OpNumNotEqual: 158, "158": "OpNumNotEqual", OpLessThan: 159, "159": "OpLessThan", OpGreaterThan: 160, "160": "OpGreaterThan", OpLessThanOrEqual: 161, "161": "OpLessThanOrEqual", OpGreaterThanOrEqual: 162, "162": "OpGreaterThanOrEqual", OpMin: 163, "163": "OpMin", OpMax: 164, "164": "OpMax", OpWithin: 165, "165": "OpWithin", - /** - * Undefined opcodes. - */ - OpUnknown166: 166, "166": "OpUnknown166", OpUnknown167: 167, "167": "OpUnknown167", - /** - * Crypto opcodes. - */ - OpSHA256: 168, "168": "OpSHA256", OpCheckMultiSigECDSA: 169, "169": "OpCheckMultiSigECDSA", OpBlake2b: 170, "170": "OpBlake2b", OpCheckSigECDSA: 171, "171": "OpCheckSigECDSA", OpCheckSig: 172, "172": "OpCheckSig", OpCheckSigVerify: 173, "173": "OpCheckSigVerify", OpCheckMultiSig: 174, "174": "OpCheckMultiSig", OpCheckMultiSigVerify: 175, "175": "OpCheckMultiSigVerify", OpCheckLockTimeVerify: 176, "176": "OpCheckLockTimeVerify", OpCheckSequenceVerify: 177, "177": "OpCheckSequenceVerify", - /** - * Undefined opcodes. - */ - OpUnknown178: 178, "178": "OpUnknown178", OpUnknown179: 179, "179": "OpUnknown179", OpUnknown180: 180, "180": "OpUnknown180", OpUnknown181: 181, "181": "OpUnknown181", OpUnknown182: 182, "182": "OpUnknown182", OpUnknown183: 183, "183": "OpUnknown183", OpUnknown184: 184, "184": "OpUnknown184", OpUnknown185: 185, "185": "OpUnknown185", OpUnknown186: 186, "186": "OpUnknown186", OpUnknown187: 187, "187": "OpUnknown187", OpUnknown188: 188, "188": "OpUnknown188", OpUnknown189: 189, "189": "OpUnknown189", OpUnknown190: 190, "190": "OpUnknown190", OpUnknown191: 191, "191": "OpUnknown191", OpUnknown192: 192, "192": "OpUnknown192", OpUnknown193: 193, "193": "OpUnknown193", OpUnknown194: 194, "194": "OpUnknown194", OpUnknown195: 195, "195": "OpUnknown195", OpUnknown196: 196, "196": "OpUnknown196", OpUnknown197: 197, "197": "OpUnknown197", OpUnknown198: 198, "198": "OpUnknown198", OpUnknown199: 199, "199": "OpUnknown199", OpUnknown200: 200, "200": "OpUnknown200", OpUnknown201: 201, "201": "OpUnknown201", OpUnknown202: 202, "202": "OpUnknown202", OpUnknown203: 203, "203": "OpUnknown203", OpUnknown204: 204, "204": "OpUnknown204", OpUnknown205: 205, "205": "OpUnknown205", OpUnknown206: 206, "206": "OpUnknown206", OpUnknown207: 207, "207": "OpUnknown207", OpUnknown208: 208, "208": "OpUnknown208", OpUnknown209: 209, "209": "OpUnknown209", OpUnknown210: 210, "210": "OpUnknown210", OpUnknown211: 211, "211": "OpUnknown211", OpUnknown212: 212, "212": "OpUnknown212", OpUnknown213: 213, "213": "OpUnknown213", OpUnknown214: 214, "214": "OpUnknown214", OpUnknown215: 215, "215": "OpUnknown215", OpUnknown216: 216, "216": "OpUnknown216", OpUnknown217: 217, "217": "OpUnknown217", OpUnknown218: 218, "218": "OpUnknown218", OpUnknown219: 219, "219": "OpUnknown219", OpUnknown220: 220, "220": "OpUnknown220", OpUnknown221: 221, "221": "OpUnknown221", OpUnknown222: 222, "222": "OpUnknown222", OpUnknown223: 223, "223": "OpUnknown223", OpUnknown224: 224, "224": "OpUnknown224", OpUnknown225: 225, "225": "OpUnknown225", OpUnknown226: 226, "226": "OpUnknown226", OpUnknown227: 227, "227": "OpUnknown227", OpUnknown228: 228, "228": "OpUnknown228", OpUnknown229: 229, "229": "OpUnknown229", OpUnknown230: 230, "230": "OpUnknown230", OpUnknown231: 231, "231": "OpUnknown231", OpUnknown232: 232, "232": "OpUnknown232", OpUnknown233: 233, "233": "OpUnknown233", OpUnknown234: 234, "234": "OpUnknown234", OpUnknown235: 235, "235": "OpUnknown235", OpUnknown236: 236, "236": "OpUnknown236", OpUnknown237: 237, "237": "OpUnknown237", OpUnknown238: 238, "238": "OpUnknown238", OpUnknown239: 239, "239": "OpUnknown239", OpUnknown240: 240, "240": "OpUnknown240", OpUnknown241: 241, "241": "OpUnknown241", OpUnknown242: 242, "242": "OpUnknown242", OpUnknown243: 243, "243": "OpUnknown243", OpUnknown244: 244, "244": "OpUnknown244", OpUnknown245: 245, "245": "OpUnknown245", OpUnknown246: 246, "246": "OpUnknown246", OpUnknown247: 247, "247": "OpUnknown247", OpUnknown248: 248, "248": "OpUnknown248", OpUnknown249: 249, "249": "OpUnknown249", OpSmallInteger: 250, "250": "OpSmallInteger", OpPubKeys: 251, "251": "OpPubKeys", OpUnknown252: 252, "252": "OpUnknown252", OpPubKeyHash: 253, "253": "OpPubKeyHash", OpPubKey: 254, "254": "OpPubKey", OpInvalidOpCode: 255, "255": "OpInvalidOpCode", + * wRPC protocol encoding: `Borsh` or `JSON` + * @category Transport + * @enum {0 | 1} + */ +export const Encoding = Object.freeze({ + Borsh: 0, "0": "Borsh", + SerdeJson: 1, "1": "SerdeJson", }); /** -* -* @see {@link IFees}, {@link IGeneratorSettingsObject}, {@link Generator}, {@link estimateTransactions}, {@link createTransactions} -* @category Wallet SDK -*/ -export const FeeSource = Object.freeze({ SenderPays: 0, "0": "SenderPays", ReceiverPays: 1, "1": "ReceiverPays", }); + * + * @see {@link IFees}, {@link IGeneratorSettingsObject}, {@link Generator}, {@link estimateTransactions}, {@link createTransactions} + * @category Wallet SDK + * @enum {0 | 1} + */ +export const FeeSource = Object.freeze({ + SenderPays: 0, "0": "SenderPays", + ReceiverPays: 1, "1": "ReceiverPays", +}); /** -* Kaspa Sighash types allowed by consensus -* @category Consensus -*/ -export const SighashType = Object.freeze({ All: 0, "0": "All", None: 1, "1": "None", Single: 2, "2": "Single", AllAnyOneCanPay: 3, "3": "AllAnyOneCanPay", NoneAnyOneCanPay: 4, "4": "NoneAnyOneCanPay", SingleAnyOneCanPay: 5, "5": "SingleAnyOneCanPay", }); + * + * Languages supported by BIP39. + * + * Presently only English is specified by the BIP39 standard. + * + * @see {@link Mnemonic} + * + * @category Wallet SDK + * @enum {0} + */ +export const Language = Object.freeze({ + /** + * English is presently the only supported language + */ + English: 0, "0": "English", +}); /** -* @category Wallet API -*/ -export const AccountsDiscoveryKind = Object.freeze({ Bip44: 0, "0": "Bip44", }); + * @category Consensus + * @enum {0 | 1 | 2 | 3} + */ +export const NetworkType = Object.freeze({ + Mainnet: 0, "0": "Mainnet", + Testnet: 1, "1": "Testnet", + Devnet: 2, "2": "Devnet", + Simnet: 3, "3": "Simnet", +}); /** -* @category Consensus -*/ -export const NetworkType = Object.freeze({ Mainnet: 0, "0": "Mainnet", Testnet: 1, "1": "Testnet", Devnet: 2, "2": "Devnet", Simnet: 3, "3": "Simnet", }); + * Specifies the type of an account address to create. + * The address can bea receive address or a change address. + * + * @category Wallet API + * @enum {0 | 1} + */ +export const NewAddressKind = Object.freeze({ + Receive: 0, "0": "Receive", + Change: 1, "1": "Change", +}); /** -* -* Kaspa `Address` version (`PubKey`, `PubKey ECDSA`, `ScriptHash`) -* -* @category Address -*/ -export const AddressVersion = Object.freeze({ - /** - * PubKey addresses always have the version byte set to 0 - */ - PubKey: 0, "0": "PubKey", - /** - * PubKey ECDSA addresses always have the version byte set to 1 - */ - PubKeyECDSA: 1, "1": "PubKeyECDSA", - /** - * ScriptHash addresses always have the version byte set to 8 - */ - ScriptHash: 8, "8": "ScriptHash", + * Kaspa Transaction Script Opcodes + * @see {@link ScriptBuilder} + * @category Consensus + * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255} + */ +export const Opcodes = Object.freeze({ + OpFalse: 0, "0": "OpFalse", + OpData1: 1, "1": "OpData1", + OpData2: 2, "2": "OpData2", + OpData3: 3, "3": "OpData3", + OpData4: 4, "4": "OpData4", + OpData5: 5, "5": "OpData5", + OpData6: 6, "6": "OpData6", + OpData7: 7, "7": "OpData7", + OpData8: 8, "8": "OpData8", + OpData9: 9, "9": "OpData9", + OpData10: 10, "10": "OpData10", + OpData11: 11, "11": "OpData11", + OpData12: 12, "12": "OpData12", + OpData13: 13, "13": "OpData13", + OpData14: 14, "14": "OpData14", + OpData15: 15, "15": "OpData15", + OpData16: 16, "16": "OpData16", + OpData17: 17, "17": "OpData17", + OpData18: 18, "18": "OpData18", + OpData19: 19, "19": "OpData19", + OpData20: 20, "20": "OpData20", + OpData21: 21, "21": "OpData21", + OpData22: 22, "22": "OpData22", + OpData23: 23, "23": "OpData23", + OpData24: 24, "24": "OpData24", + OpData25: 25, "25": "OpData25", + OpData26: 26, "26": "OpData26", + OpData27: 27, "27": "OpData27", + OpData28: 28, "28": "OpData28", + OpData29: 29, "29": "OpData29", + OpData30: 30, "30": "OpData30", + OpData31: 31, "31": "OpData31", + OpData32: 32, "32": "OpData32", + OpData33: 33, "33": "OpData33", + OpData34: 34, "34": "OpData34", + OpData35: 35, "35": "OpData35", + OpData36: 36, "36": "OpData36", + OpData37: 37, "37": "OpData37", + OpData38: 38, "38": "OpData38", + OpData39: 39, "39": "OpData39", + OpData40: 40, "40": "OpData40", + OpData41: 41, "41": "OpData41", + OpData42: 42, "42": "OpData42", + OpData43: 43, "43": "OpData43", + OpData44: 44, "44": "OpData44", + OpData45: 45, "45": "OpData45", + OpData46: 46, "46": "OpData46", + OpData47: 47, "47": "OpData47", + OpData48: 48, "48": "OpData48", + OpData49: 49, "49": "OpData49", + OpData50: 50, "50": "OpData50", + OpData51: 51, "51": "OpData51", + OpData52: 52, "52": "OpData52", + OpData53: 53, "53": "OpData53", + OpData54: 54, "54": "OpData54", + OpData55: 55, "55": "OpData55", + OpData56: 56, "56": "OpData56", + OpData57: 57, "57": "OpData57", + OpData58: 58, "58": "OpData58", + OpData59: 59, "59": "OpData59", + OpData60: 60, "60": "OpData60", + OpData61: 61, "61": "OpData61", + OpData62: 62, "62": "OpData62", + OpData63: 63, "63": "OpData63", + OpData64: 64, "64": "OpData64", + OpData65: 65, "65": "OpData65", + OpData66: 66, "66": "OpData66", + OpData67: 67, "67": "OpData67", + OpData68: 68, "68": "OpData68", + OpData69: 69, "69": "OpData69", + OpData70: 70, "70": "OpData70", + OpData71: 71, "71": "OpData71", + OpData72: 72, "72": "OpData72", + OpData73: 73, "73": "OpData73", + OpData74: 74, "74": "OpData74", + OpData75: 75, "75": "OpData75", + OpPushData1: 76, "76": "OpPushData1", + OpPushData2: 77, "77": "OpPushData2", + OpPushData4: 78, "78": "OpPushData4", + Op1Negate: 79, "79": "Op1Negate", + OpReserved: 80, "80": "OpReserved", + OpTrue: 81, "81": "OpTrue", + Op2: 82, "82": "Op2", + Op3: 83, "83": "Op3", + Op4: 84, "84": "Op4", + Op5: 85, "85": "Op5", + Op6: 86, "86": "Op6", + Op7: 87, "87": "Op7", + Op8: 88, "88": "Op8", + Op9: 89, "89": "Op9", + Op10: 90, "90": "Op10", + Op11: 91, "91": "Op11", + Op12: 92, "92": "Op12", + Op13: 93, "93": "Op13", + Op14: 94, "94": "Op14", + Op15: 95, "95": "Op15", + Op16: 96, "96": "Op16", + OpNop: 97, "97": "OpNop", + OpVer: 98, "98": "OpVer", + OpIf: 99, "99": "OpIf", + OpNotIf: 100, "100": "OpNotIf", + OpVerIf: 101, "101": "OpVerIf", + OpVerNotIf: 102, "102": "OpVerNotIf", + OpElse: 103, "103": "OpElse", + OpEndIf: 104, "104": "OpEndIf", + OpVerify: 105, "105": "OpVerify", + OpReturn: 106, "106": "OpReturn", + OpToAltStack: 107, "107": "OpToAltStack", + OpFromAltStack: 108, "108": "OpFromAltStack", + Op2Drop: 109, "109": "Op2Drop", + Op2Dup: 110, "110": "Op2Dup", + Op3Dup: 111, "111": "Op3Dup", + Op2Over: 112, "112": "Op2Over", + Op2Rot: 113, "113": "Op2Rot", + Op2Swap: 114, "114": "Op2Swap", + OpIfDup: 115, "115": "OpIfDup", + OpDepth: 116, "116": "OpDepth", + OpDrop: 117, "117": "OpDrop", + OpDup: 118, "118": "OpDup", + OpNip: 119, "119": "OpNip", + OpOver: 120, "120": "OpOver", + OpPick: 121, "121": "OpPick", + OpRoll: 122, "122": "OpRoll", + OpRot: 123, "123": "OpRot", + OpSwap: 124, "124": "OpSwap", + OpTuck: 125, "125": "OpTuck", + /** + * Splice opcodes. + */ + OpCat: 126, "126": "OpCat", + OpSubStr: 127, "127": "OpSubStr", + OpLeft: 128, "128": "OpLeft", + OpRight: 129, "129": "OpRight", + OpSize: 130, "130": "OpSize", + /** + * Bitwise logic opcodes. + */ + OpInvert: 131, "131": "OpInvert", + OpAnd: 132, "132": "OpAnd", + OpOr: 133, "133": "OpOr", + OpXor: 134, "134": "OpXor", + OpEqual: 135, "135": "OpEqual", + OpEqualVerify: 136, "136": "OpEqualVerify", + OpReserved1: 137, "137": "OpReserved1", + OpReserved2: 138, "138": "OpReserved2", + /** + * Numeric related opcodes. + */ + Op1Add: 139, "139": "Op1Add", + Op1Sub: 140, "140": "Op1Sub", + Op2Mul: 141, "141": "Op2Mul", + Op2Div: 142, "142": "Op2Div", + OpNegate: 143, "143": "OpNegate", + OpAbs: 144, "144": "OpAbs", + OpNot: 145, "145": "OpNot", + Op0NotEqual: 146, "146": "Op0NotEqual", + OpAdd: 147, "147": "OpAdd", + OpSub: 148, "148": "OpSub", + OpMul: 149, "149": "OpMul", + OpDiv: 150, "150": "OpDiv", + OpMod: 151, "151": "OpMod", + OpLShift: 152, "152": "OpLShift", + OpRShift: 153, "153": "OpRShift", + OpBoolAnd: 154, "154": "OpBoolAnd", + OpBoolOr: 155, "155": "OpBoolOr", + OpNumEqual: 156, "156": "OpNumEqual", + OpNumEqualVerify: 157, "157": "OpNumEqualVerify", + OpNumNotEqual: 158, "158": "OpNumNotEqual", + OpLessThan: 159, "159": "OpLessThan", + OpGreaterThan: 160, "160": "OpGreaterThan", + OpLessThanOrEqual: 161, "161": "OpLessThanOrEqual", + OpGreaterThanOrEqual: 162, "162": "OpGreaterThanOrEqual", + OpMin: 163, "163": "OpMin", + OpMax: 164, "164": "OpMax", + OpWithin: 165, "165": "OpWithin", + /** + * Undefined opcodes. + */ + OpUnknown166: 166, "166": "OpUnknown166", + OpUnknown167: 167, "167": "OpUnknown167", + /** + * Crypto opcodes. + */ + OpSHA256: 168, "168": "OpSHA256", + OpCheckMultiSigECDSA: 169, "169": "OpCheckMultiSigECDSA", + OpBlake2b: 170, "170": "OpBlake2b", + OpCheckSigECDSA: 171, "171": "OpCheckSigECDSA", + OpCheckSig: 172, "172": "OpCheckSig", + OpCheckSigVerify: 173, "173": "OpCheckSigVerify", + OpCheckMultiSig: 174, "174": "OpCheckMultiSig", + OpCheckMultiSigVerify: 175, "175": "OpCheckMultiSigVerify", + OpCheckLockTimeVerify: 176, "176": "OpCheckLockTimeVerify", + OpCheckSequenceVerify: 177, "177": "OpCheckSequenceVerify", + /** + * Undefined opcodes. + */ + OpUnknown178: 178, "178": "OpUnknown178", + OpUnknown179: 179, "179": "OpUnknown179", + OpUnknown180: 180, "180": "OpUnknown180", + OpUnknown181: 181, "181": "OpUnknown181", + OpUnknown182: 182, "182": "OpUnknown182", + OpUnknown183: 183, "183": "OpUnknown183", + OpUnknown184: 184, "184": "OpUnknown184", + OpUnknown185: 185, "185": "OpUnknown185", + OpUnknown186: 186, "186": "OpUnknown186", + OpUnknown187: 187, "187": "OpUnknown187", + OpUnknown188: 188, "188": "OpUnknown188", + OpUnknown189: 189, "189": "OpUnknown189", + OpUnknown190: 190, "190": "OpUnknown190", + OpUnknown191: 191, "191": "OpUnknown191", + OpUnknown192: 192, "192": "OpUnknown192", + OpUnknown193: 193, "193": "OpUnknown193", + OpUnknown194: 194, "194": "OpUnknown194", + OpUnknown195: 195, "195": "OpUnknown195", + OpUnknown196: 196, "196": "OpUnknown196", + OpUnknown197: 197, "197": "OpUnknown197", + OpUnknown198: 198, "198": "OpUnknown198", + OpUnknown199: 199, "199": "OpUnknown199", + OpUnknown200: 200, "200": "OpUnknown200", + OpUnknown201: 201, "201": "OpUnknown201", + OpUnknown202: 202, "202": "OpUnknown202", + OpUnknown203: 203, "203": "OpUnknown203", + OpUnknown204: 204, "204": "OpUnknown204", + OpUnknown205: 205, "205": "OpUnknown205", + OpUnknown206: 206, "206": "OpUnknown206", + OpUnknown207: 207, "207": "OpUnknown207", + OpUnknown208: 208, "208": "OpUnknown208", + OpUnknown209: 209, "209": "OpUnknown209", + OpUnknown210: 210, "210": "OpUnknown210", + OpUnknown211: 211, "211": "OpUnknown211", + OpUnknown212: 212, "212": "OpUnknown212", + OpUnknown213: 213, "213": "OpUnknown213", + OpUnknown214: 214, "214": "OpUnknown214", + OpUnknown215: 215, "215": "OpUnknown215", + OpUnknown216: 216, "216": "OpUnknown216", + OpUnknown217: 217, "217": "OpUnknown217", + OpUnknown218: 218, "218": "OpUnknown218", + OpUnknown219: 219, "219": "OpUnknown219", + OpUnknown220: 220, "220": "OpUnknown220", + OpUnknown221: 221, "221": "OpUnknown221", + OpUnknown222: 222, "222": "OpUnknown222", + OpUnknown223: 223, "223": "OpUnknown223", + OpUnknown224: 224, "224": "OpUnknown224", + OpUnknown225: 225, "225": "OpUnknown225", + OpUnknown226: 226, "226": "OpUnknown226", + OpUnknown227: 227, "227": "OpUnknown227", + OpUnknown228: 228, "228": "OpUnknown228", + OpUnknown229: 229, "229": "OpUnknown229", + OpUnknown230: 230, "230": "OpUnknown230", + OpUnknown231: 231, "231": "OpUnknown231", + OpUnknown232: 232, "232": "OpUnknown232", + OpUnknown233: 233, "233": "OpUnknown233", + OpUnknown234: 234, "234": "OpUnknown234", + OpUnknown235: 235, "235": "OpUnknown235", + OpUnknown236: 236, "236": "OpUnknown236", + OpUnknown237: 237, "237": "OpUnknown237", + OpUnknown238: 238, "238": "OpUnknown238", + OpUnknown239: 239, "239": "OpUnknown239", + OpUnknown240: 240, "240": "OpUnknown240", + OpUnknown241: 241, "241": "OpUnknown241", + OpUnknown242: 242, "242": "OpUnknown242", + OpUnknown243: 243, "243": "OpUnknown243", + OpUnknown244: 244, "244": "OpUnknown244", + OpUnknown245: 245, "245": "OpUnknown245", + OpUnknown246: 246, "246": "OpUnknown246", + OpUnknown247: 247, "247": "OpUnknown247", + OpUnknown248: 248, "248": "OpUnknown248", + OpUnknown249: 249, "249": "OpUnknown249", + OpSmallInteger: 250, "250": "OpSmallInteger", + OpPubKeys: 251, "251": "OpPubKeys", + OpUnknown252: 252, "252": "OpUnknown252", + OpPubKeyHash: 253, "253": "OpPubKeyHash", + OpPubKey: 254, "254": "OpPubKey", + OpInvalidOpCode: 255, "255": "OpInvalidOpCode", }); /** -* wRPC protocol encoding: `Borsh` or `JSON` -* @category Transport -*/ -export const Encoding = Object.freeze({ Borsh: 0, "0": "Borsh", SerdeJson: 1, "1": "SerdeJson", }); + * Kaspa Sighash types allowed by consensus + * @category Consensus + * @enum {0 | 1 | 2 | 3 | 4 | 5} + */ +export const SighashType = Object.freeze({ + All: 0, "0": "All", + None: 1, "1": "None", + Single: 2, "2": "Single", + AllAnyOneCanPay: 3, "3": "AllAnyOneCanPay", + NoneAnyOneCanPay: 4, "4": "NoneAnyOneCanPay", + SingleAnyOneCanPay: 5, "5": "SingleAnyOneCanPay", +}); + +const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"]; + +const __wbindgen_enum_IdbCursorDirection = ["next", "nextunique", "prev", "prevunique"]; + +const __wbindgen_enum_IdbRequestReadyState = ["pending", "done"]; + +const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"]; + +const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"]; + +const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"]; const AbortableFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_abortable_free(ptr >>> 0, 1)); /** -* -* Abortable trigger wraps an `Arc`, which can be cloned -* to signal task terminating using an atomic bool. -* -* ```text -* let abortable = Abortable::default(); -* let result = my_task(abortable).await?; -* // ... elsewhere -* abortable.abort(); -* ``` -* -* @category General -*/ + * + * Abortable trigger wraps an `Arc`, which can be cloned + * to signal task terminating using an atomic bool. + * + * ```text + * let abortable = Abortable::default(); + * let result = my_task(abortable).await?; + * // ... elsewhere + * abortable.abort(); + * ``` + * + * @category General + */ export class Abortable { __destroy_into_raw() { @@ -1514,8 +1890,6 @@ export class Abortable { const ptr = this.__destroy_into_raw(); wasm.__wbg_abortable_free(ptr, 0); } - /** - */ constructor() { const ret = wasm.abortable_new(); this.__wbg_ptr = ret >>> 0; @@ -1523,19 +1897,15 @@ export class Abortable { return this; } /** - * @returns {boolean} - */ + * @returns {boolean} + */ isAborted() { const ret = wasm.abortable_isAborted(this.__wbg_ptr); return ret !== 0; } - /** - */ abort() { wasm.abortable_abort(this.__wbg_ptr); } - /** - */ check() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -1549,20 +1919,18 @@ export class Abortable { wasm.__wbindgen_add_to_stack_pointer(16); } } - /** - */ reset() { wasm.abortable_reset(this.__wbg_ptr); } } const AbortedFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_aborted_free(ptr >>> 0, 1)); /** -* Error emitted by [`Abortable`]. -* @category General -*/ + * Error emitted by [`Abortable`]. + * @category General + */ export class Aborted { static __wrap(ptr) { @@ -1587,16 +1955,16 @@ export class Aborted { } const AccountKindFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_accountkind_free(ptr >>> 0, 1)); /** -* -* Account kind is a string signature that represents an account type. -* Account kind is used to identify the account type during -* serialization, deserialization and various API calls. -* -* @category Wallet SDK -*/ + * + * Account kind is a string signature that represents an account type. + * Account kind is used to identify the account type during + * serialization, deserialization and various API calls. + * + * @category Wallet SDK + */ export class AccountKind { static __wrap(ptr) { @@ -1619,12 +1987,12 @@ export class AccountKind { wasm.__wbg_accountkind_free(ptr, 0); } /** - * @param {string} kind - */ + * @param {string} kind + */ constructor(kind) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.accountkind_ctor(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -1641,8 +2009,8 @@ export class AccountKind { } } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -1656,19 +2024,19 @@ export class AccountKind { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const AddressFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_address_free(ptr >>> 0, 1)); /** -* Kaspa [`Address`] struct that serializes to and from an address format string: `kaspa:qz0s...t8cv`. -* -* @category Address -*/ + * Kaspa [`Address`] struct that serializes to and from an address format string: `kaspa:qz0s...t8cv`. + * + * @category Address + */ export class Address { static __wrap(ptr) { @@ -1703,10 +2071,10 @@ export class Address { wasm.__wbg_address_free(ptr, 0); } /** - * @param {string} address - */ + * @param {string} address + */ constructor(address) { - const ptr0 = passStringToWasm0(address, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(address, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; const ret = wasm.address_constructor(ptr0, len0); this.__wbg_ptr = ret >>> 0; @@ -1714,19 +2082,19 @@ export class Address { return this; } /** - * @param {string} address - * @returns {boolean} - */ + * @param {string} address + * @returns {boolean} + */ static validate(address) { - const ptr0 = passStringToWasm0(address, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(address, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; const ret = wasm.address_validate(ptr0, len0); return ret !== 0; } /** - * Convert an address to a string. - * @returns {string} - */ + * Convert an address to a string. + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -1740,12 +2108,12 @@ export class Address { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ get version() { let deferred1_0; let deferred1_1; @@ -1759,12 +2127,12 @@ export class Address { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ get prefix() { let deferred1_0; let deferred1_1; @@ -1778,20 +2146,20 @@ export class Address { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {string} prefix - */ + * @param {string} prefix + */ set setPrefix(prefix) { - const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.address_set_setPrefix(this.__wbg_ptr, ptr0, len0); } /** - * @returns {string} - */ + * @returns {string} + */ get payload() { let deferred1_0; let deferred1_1; @@ -1805,13 +2173,13 @@ export class Address { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {number} n - * @returns {string} - */ + * @param {number} n + * @returns {string} + */ short(n) { let deferred1_0; let deferred1_1; @@ -1825,16 +2193,15 @@ export class Address { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const AgentConstructorOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_agentconstructoroptions_free(ptr >>> 0, 1)); -/** -*/ + export class AgentConstructorOptions { __destroy_into_raw() { @@ -1849,77 +2216,76 @@ export class AgentConstructorOptions { wasm.__wbg_agentconstructoroptions_free(ptr, 0); } /** - * @returns {number} - */ + * @returns {number} + */ get keep_alive_msecs() { const ret = wasm.agentconstructoroptions_keep_alive_msecs(this.__wbg_ptr); return ret; } /** - * @param {number} value - */ + * @param {number} value + */ set keep_alive_msecs(value) { wasm.agentconstructoroptions_set_keep_alive_msecs(this.__wbg_ptr, value); } /** - * @returns {boolean} - */ + * @returns {boolean} + */ get keep_alive() { const ret = wasm.agentconstructoroptions_keep_alive(this.__wbg_ptr); return ret !== 0; } /** - * @param {boolean} value - */ + * @param {boolean} value + */ set keep_alive(value) { wasm.agentconstructoroptions_set_keep_alive(this.__wbg_ptr, value); } /** - * @returns {number} - */ + * @returns {number} + */ get max_free_sockets() { const ret = wasm.agentconstructoroptions_max_free_sockets(this.__wbg_ptr); return ret; } /** - * @param {number} value - */ + * @param {number} value + */ set max_free_sockets(value) { wasm.agentconstructoroptions_set_max_free_sockets(this.__wbg_ptr, value); } /** - * @returns {number} - */ + * @returns {number} + */ get max_sockets() { const ret = wasm.agentconstructoroptions_max_sockets(this.__wbg_ptr); return ret; } /** - * @param {number} value - */ + * @param {number} value + */ set max_sockets(value) { wasm.agentconstructoroptions_set_max_sockets(this.__wbg_ptr, value); } /** - * @returns {number} - */ + * @returns {number} + */ get timeout() { const ret = wasm.agentconstructoroptions_timeout(this.__wbg_ptr); return ret; } /** - * @param {number} value - */ + * @param {number} value + */ set timeout(value) { wasm.agentconstructoroptions_set_timeout(this.__wbg_ptr, value); } } const AppendFileOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_appendfileoptions_free(ptr >>> 0, 1)); -/** -*/ + export class AppendFileOptions { static __wrap(ptr) { @@ -1942,76 +2308,68 @@ export class AppendFileOptions { wasm.__wbg_appendfileoptions_free(ptr, 0); } /** - * @param {string | undefined} [encoding] - * @param {number | undefined} [mode] - * @param {string | undefined} [flag] - */ + * @param {string | null} [encoding] + * @param {number | null} [mode] + * @param {string | null} [flag] + */ constructor(encoding, mode, flag) { - const ret = wasm.appendfileoptions_new_with_values(isLikeNone(encoding) ? 0 : addHeapObject(encoding), !isLikeNone(mode), isLikeNone(mode) ? 0 : mode, isLikeNone(flag) ? 0 : addHeapObject(flag)); + const ret = wasm.appendfileoptions_new_with_values(isLikeNone(encoding) ? 0 : addHeapObject(encoding), isLikeNone(mode) ? 0x100000001 : (mode) >>> 0, isLikeNone(flag) ? 0 : addHeapObject(flag)); this.__wbg_ptr = ret >>> 0; AppendFileOptionsFinalization.register(this, this.__wbg_ptr, this); return this; } /** - * @returns {AppendFileOptions} - */ + * @returns {AppendFileOptions} + */ static new() { const ret = wasm.appendfileoptions_new(); return AppendFileOptions.__wrap(ret); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get encoding() { const ret = wasm.appendfileoptions_encoding(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set encoding(value) { wasm.appendfileoptions_set_encoding(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get mode() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.appendfileoptions_mode(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.appendfileoptions_mode(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set mode(value) { - wasm.appendfileoptions_set_mode(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); + wasm.appendfileoptions_set_mode(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get flag() { const ret = wasm.appendfileoptions_flag(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set flag(value) { wasm.appendfileoptions_set_flag(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } } const AssertionErrorOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_assertionerroroptions_free(ptr >>> 0, 1)); -/** -*/ + export class AssertionErrorOptions { __destroy_into_raw() { @@ -2026,11 +2384,11 @@ export class AssertionErrorOptions { wasm.__wbg_assertionerroroptions_free(ptr, 0); } /** - * @param {string | undefined} message - * @param {any} actual - * @param {any} expected - * @param {string} operator - */ + * @param {string | null | undefined} message + * @param {any} actual + * @param {any} expected + * @param {string} operator + */ constructor(message, actual, expected, operator) { const ret = wasm.assertionerroroptions_new(isLikeNone(message) ? 0 : addHeapObject(message), addHeapObject(actual), addHeapObject(expected), addHeapObject(operator)); this.__wbg_ptr = ret >>> 0; @@ -2038,74 +2396,74 @@ export class AssertionErrorOptions { return this; } /** - * If provided, the error message is set to this value. - * @returns {string | undefined} - */ + * If provided, the error message is set to this value. + * @returns {string | undefined} + */ get message() { const ret = wasm.assertionerroroptions_message(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set message(value) { wasm.assertionerroroptions_set_message(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * The actual property on the error instance. - * @returns {any} - */ + * The actual property on the error instance. + * @returns {any} + */ get actual() { const ret = wasm.assertionerroroptions_actual(this.__wbg_ptr); return takeObject(ret); } /** - * @param {any} value - */ + * @param {any} value + */ set actual(value) { wasm.assertionerroroptions_set_actual(this.__wbg_ptr, addHeapObject(value)); } /** - * The expected property on the error instance. - * @returns {any} - */ + * The expected property on the error instance. + * @returns {any} + */ get expected() { const ret = wasm.assertionerroroptions_expected(this.__wbg_ptr); return takeObject(ret); } /** - * @param {any} value - */ + * @param {any} value + */ set expected(value) { wasm.assertionerroroptions_set_expected(this.__wbg_ptr, addHeapObject(value)); } /** - * The operator property on the error instance. - * @returns {string} - */ + * The operator property on the error instance. + * @returns {string} + */ get operator() { const ret = wasm.assertionerroroptions_operator(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string} value - */ + * @param {string} value + */ set operator(value) { wasm.assertionerroroptions_set_operator(this.__wbg_ptr, addHeapObject(value)); } } const BalanceFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_balance_free(ptr >>> 0, 1)); /** -* -* Represents a {@link UtxoContext} (account) balance. -* -* @see {@link IBalance}, {@link UtxoContext} -* -* @category Wallet SDK -*/ + * + * Represents a {@link UtxoContext} (account) balance. + * + * @see {@link IBalance}, {@link UtxoContext} + * + * @category Wallet SDK + */ export class Balance { static __wrap(ptr) { @@ -2128,33 +2486,33 @@ export class Balance { wasm.__wbg_balance_free(ptr, 0); } /** - * Confirmed amount of funds available for spending. - * @returns {bigint} - */ + * Confirmed amount of funds available for spending. + * @returns {bigint} + */ get mature() { const ret = wasm.balance_mature(this.__wbg_ptr); return takeObject(ret); } /** - * Amount of funds that are being received and are not yet confirmed. - * @returns {bigint} - */ + * Amount of funds that are being received and are not yet confirmed. + * @returns {bigint} + */ get pending() { const ret = wasm.balance_pending(this.__wbg_ptr); return takeObject(ret); } /** - * Amount of funds that are being send and are not yet accepted by the network. - * @returns {bigint} - */ + * Amount of funds that are being send and are not yet accepted by the network. + * @returns {bigint} + */ get outgoing() { const ret = wasm.balance_outgoing(this.__wbg_ptr); return takeObject(ret); } /** - * @param {NetworkType | NetworkId | string} network_type - * @returns {BalanceStrings} - */ + * @param {NetworkType | NetworkId | string} network_type + * @returns {BalanceStrings} + */ toBalanceStrings(network_type) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -2174,16 +2532,16 @@ export class Balance { } const BalanceStringsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_balancestrings_free(ptr >>> 0, 1)); /** -* -* Formatted string representation of the {@link Balance}. -* -* The value is formatted as `123,456.789`. -* -* @category Wallet SDK -*/ + * + * Formatted string representation of the {@link Balance}. + * + * The value is formatted as `123,456.789`. + * + * @category Wallet SDK + */ export class BalanceStrings { static __wrap(ptr) { @@ -2206,8 +2564,8 @@ export class BalanceStrings { wasm.__wbg_balancestrings_free(ptr, 0); } /** - * @returns {string} - */ + * @returns {string} + */ get mature() { let deferred1_0; let deferred1_1; @@ -2221,12 +2579,12 @@ export class BalanceStrings { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get pending() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -2236,7 +2594,7 @@ export class BalanceStrings { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -2246,10 +2604,9 @@ export class BalanceStrings { } const ConsoleConstructorOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_consoleconstructoroptions_free(ptr >>> 0, 1)); -/** -*/ + export class ConsoleConstructorOptions { static __wrap(ptr) { @@ -2272,12 +2629,12 @@ export class ConsoleConstructorOptions { wasm.__wbg_consoleconstructoroptions_free(ptr, 0); } /** - * @param {any} stdout - * @param {any} stderr - * @param {boolean | undefined} ignore_errors - * @param {any} color_mod - * @param {object | undefined} [inspect_options] - */ + * @param {any} stdout + * @param {any} stderr + * @param {boolean | null | undefined} ignore_errors + * @param {any} color_mod + * @param {object | null} [inspect_options] + */ constructor(stdout, stderr, ignore_errors, color_mod, inspect_options) { const ret = wasm.consoleconstructoroptions_new_with_values(addHeapObject(stdout), addHeapObject(stderr), isLikeNone(ignore_errors) ? 0xFFFFFF : ignore_errors ? 1 : 0, addHeapObject(color_mod), isLikeNone(inspect_options) ? 0 : addHeapObject(inspect_options)); this.__wbg_ptr = ret >>> 0; @@ -2285,86 +2642,85 @@ export class ConsoleConstructorOptions { return this; } /** - * @param {any} stdout - * @param {any} stderr - * @returns {ConsoleConstructorOptions} - */ + * @param {any} stdout + * @param {any} stderr + * @returns {ConsoleConstructorOptions} + */ static new(stdout, stderr) { const ret = wasm.consoleconstructoroptions_new(addHeapObject(stdout), addHeapObject(stderr)); return ConsoleConstructorOptions.__wrap(ret); } /** - * @returns {any} - */ + * @returns {any} + */ get stdout() { const ret = wasm.consoleconstructoroptions_stdout(this.__wbg_ptr); return takeObject(ret); } /** - * @param {any} value - */ + * @param {any} value + */ set stdout(value) { wasm.consoleconstructoroptions_set_stdout(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {any} - */ + * @returns {any} + */ get stderr() { const ret = wasm.consoleconstructoroptions_stderr(this.__wbg_ptr); return takeObject(ret); } /** - * @param {any} value - */ + * @param {any} value + */ set stderr(value) { wasm.consoleconstructoroptions_set_stderr(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get ignore_errors() { const ret = wasm.consoleconstructoroptions_ignore_errors(this.__wbg_ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set ignore_errors(value) { wasm.consoleconstructoroptions_set_ignore_errors(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); } /** - * @returns {any} - */ + * @returns {any} + */ get color_mod() { const ret = wasm.consoleconstructoroptions_color_mod(this.__wbg_ptr); return takeObject(ret); } /** - * @param {any} value - */ + * @param {any} value + */ set color_mod(value) { wasm.consoleconstructoroptions_set_color_mod(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {object | undefined} - */ + * @returns {object | undefined} + */ get inspect_options() { const ret = wasm.consoleconstructoroptions_inspect_options(this.__wbg_ptr); return takeObject(ret); } /** - * @param {object | undefined} [value] - */ + * @param {object | null} [value] + */ set inspect_options(value) { wasm.consoleconstructoroptions_set_inspect_options(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } } const CreateHookCallbacksFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_createhookcallbacks_free(ptr >>> 0, 1)); -/** -*/ + export class CreateHookCallbacks { __destroy_into_raw() { @@ -2379,12 +2735,12 @@ export class CreateHookCallbacks { wasm.__wbg_createhookcallbacks_free(ptr, 0); } /** - * @param {Function} init - * @param {Function} before - * @param {Function} after - * @param {Function} destroy - * @param {Function} promise_resolve - */ + * @param {Function} init + * @param {Function} before + * @param {Function} after + * @param {Function} destroy + * @param {Function} promise_resolve + */ constructor(init, before, after, destroy, promise_resolve) { try { const ret = wasm.createhookcallbacks_new(addBorrowedObject(init), addBorrowedObject(before), addBorrowedObject(after), addBorrowedObject(destroy), addBorrowedObject(promise_resolve)); @@ -2400,77 +2756,76 @@ export class CreateHookCallbacks { } } /** - * @returns {Function} - */ + * @returns {Function} + */ get init() { const ret = wasm.createhookcallbacks_init(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set init(value) { wasm.createhookcallbacks_set_init(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {Function} - */ + * @returns {Function} + */ get before() { const ret = wasm.createhookcallbacks_before(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set before(value) { wasm.createhookcallbacks_set_before(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {Function} - */ + * @returns {Function} + */ get after() { const ret = wasm.createhookcallbacks_after(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set after(value) { wasm.createhookcallbacks_set_after(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {Function} - */ + * @returns {Function} + */ get destroy() { const ret = wasm.createhookcallbacks_destroy(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set destroy(value) { wasm.createhookcallbacks_set_destroy(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {Function} - */ + * @returns {Function} + */ get promise_resolve() { const ret = wasm.createhookcallbacks_promise_resolve(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set promise_resolve(value) { wasm.createhookcallbacks_set_promise_resolve(this.__wbg_ptr, addHeapObject(value)); } } const CreateReadStreamOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_createreadstreamoptions_free(ptr >>> 0, 1)); -/** -*/ + export class CreateReadStreamOptions { __destroy_into_raw() { @@ -2485,64 +2840,64 @@ export class CreateReadStreamOptions { wasm.__wbg_createreadstreamoptions_free(ptr, 0); } /** - * @param {boolean | undefined} [auto_close] - * @param {boolean | undefined} [emit_close] - * @param {string | undefined} [encoding] - * @param {number | undefined} [end] - * @param {number | undefined} [fd] - * @param {string | undefined} [flags] - * @param {number | undefined} [high_water_mark] - * @param {number | undefined} [mode] - * @param {number | undefined} [start] - */ + * @param {boolean | null} [auto_close] + * @param {boolean | null} [emit_close] + * @param {string | null} [encoding] + * @param {number | null} [end] + * @param {number | null} [fd] + * @param {string | null} [flags] + * @param {number | null} [high_water_mark] + * @param {number | null} [mode] + * @param {number | null} [start] + */ constructor(auto_close, emit_close, encoding, end, fd, flags, high_water_mark, mode, start) { - const ret = wasm.createreadstreamoptions_new_with_values(isLikeNone(auto_close) ? 0xFFFFFF : auto_close ? 1 : 0, isLikeNone(emit_close) ? 0xFFFFFF : emit_close ? 1 : 0, isLikeNone(encoding) ? 0 : addHeapObject(encoding), !isLikeNone(end), isLikeNone(end) ? 0 : end, !isLikeNone(fd), isLikeNone(fd) ? 0 : fd, isLikeNone(flags) ? 0 : addHeapObject(flags), !isLikeNone(high_water_mark), isLikeNone(high_water_mark) ? 0 : high_water_mark, !isLikeNone(mode), isLikeNone(mode) ? 0 : mode, !isLikeNone(start), isLikeNone(start) ? 0 : start); + const ret = wasm.createreadstreamoptions_new_with_values(isLikeNone(auto_close) ? 0xFFFFFF : auto_close ? 1 : 0, isLikeNone(emit_close) ? 0xFFFFFF : emit_close ? 1 : 0, isLikeNone(encoding) ? 0 : addHeapObject(encoding), !isLikeNone(end), isLikeNone(end) ? 0 : end, isLikeNone(fd) ? 0x100000001 : (fd) >>> 0, isLikeNone(flags) ? 0 : addHeapObject(flags), !isLikeNone(high_water_mark), isLikeNone(high_water_mark) ? 0 : high_water_mark, isLikeNone(mode) ? 0x100000001 : (mode) >>> 0, !isLikeNone(start), isLikeNone(start) ? 0 : start); this.__wbg_ptr = ret >>> 0; CreateReadStreamOptionsFinalization.register(this, this.__wbg_ptr, this); return this; } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get auto_close() { const ret = wasm.createreadstreamoptions_auto_close(this.__wbg_ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set auto_close(value) { wasm.createreadstreamoptions_set_auto_close(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get emit_close() { const ret = wasm.createreadstreamoptions_emit_close(this.__wbg_ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set emit_close(value) { wasm.createreadstreamoptions_set_emit_close(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get encoding() { const ret = wasm.createreadstreamoptions_encoding(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set encoding(value) { wasm.createreadstreamoptions_set_encoding(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get end() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -2555,47 +2910,40 @@ export class CreateReadStreamOptions { } } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set end(value) { wasm.createreadstreamoptions_set_end(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get fd() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.createreadstreamoptions_fd(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.createreadstreamoptions_fd(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set fd(value) { - wasm.createreadstreamoptions_set_fd(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); + wasm.createreadstreamoptions_set_fd(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get flags() { const ret = wasm.createreadstreamoptions_flags(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set flags(value) { wasm.createreadstreamoptions_set_flags(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get high_water_mark() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -2608,34 +2956,27 @@ export class CreateReadStreamOptions { } } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set high_water_mark(value) { wasm.createreadstreamoptions_set_high_water_mark(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get mode() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.createreadstreamoptions_mode(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.createreadstreamoptions_mode(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set mode(value) { - wasm.createreadstreamoptions_set_mode(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); + wasm.createreadstreamoptions_set_mode(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get start() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -2648,18 +2989,17 @@ export class CreateReadStreamOptions { } } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set start(value) { wasm.createreadstreamoptions_set_start(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); } } const CreateWriteStreamOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_createwritestreamoptions_free(ptr >>> 0, 1)); -/** -*/ + export class CreateWriteStreamOptions { __destroy_into_raw() { @@ -2674,115 +3014,101 @@ export class CreateWriteStreamOptions { wasm.__wbg_createwritestreamoptions_free(ptr, 0); } /** - * @param {boolean | undefined} [auto_close] - * @param {boolean | undefined} [emit_close] - * @param {string | undefined} [encoding] - * @param {number | undefined} [fd] - * @param {string | undefined} [flags] - * @param {number | undefined} [mode] - * @param {number | undefined} [start] - */ + * @param {boolean | null} [auto_close] + * @param {boolean | null} [emit_close] + * @param {string | null} [encoding] + * @param {number | null} [fd] + * @param {string | null} [flags] + * @param {number | null} [mode] + * @param {number | null} [start] + */ constructor(auto_close, emit_close, encoding, fd, flags, mode, start) { - const ret = wasm.createwritestreamoptions_new_with_values(isLikeNone(auto_close) ? 0xFFFFFF : auto_close ? 1 : 0, isLikeNone(emit_close) ? 0xFFFFFF : emit_close ? 1 : 0, isLikeNone(encoding) ? 0 : addHeapObject(encoding), !isLikeNone(fd), isLikeNone(fd) ? 0 : fd, isLikeNone(flags) ? 0 : addHeapObject(flags), !isLikeNone(mode), isLikeNone(mode) ? 0 : mode, !isLikeNone(start), isLikeNone(start) ? 0 : start); + const ret = wasm.createwritestreamoptions_new_with_values(isLikeNone(auto_close) ? 0xFFFFFF : auto_close ? 1 : 0, isLikeNone(emit_close) ? 0xFFFFFF : emit_close ? 1 : 0, isLikeNone(encoding) ? 0 : addHeapObject(encoding), isLikeNone(fd) ? 0x100000001 : (fd) >>> 0, isLikeNone(flags) ? 0 : addHeapObject(flags), isLikeNone(mode) ? 0x100000001 : (mode) >>> 0, !isLikeNone(start), isLikeNone(start) ? 0 : start); this.__wbg_ptr = ret >>> 0; CreateWriteStreamOptionsFinalization.register(this, this.__wbg_ptr, this); return this; } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get auto_close() { const ret = wasm.createwritestreamoptions_auto_close(this.__wbg_ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set auto_close(value) { wasm.createwritestreamoptions_set_auto_close(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get emit_close() { const ret = wasm.createwritestreamoptions_emit_close(this.__wbg_ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set emit_close(value) { wasm.createwritestreamoptions_set_emit_close(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get encoding() { const ret = wasm.createwritestreamoptions_encoding(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set encoding(value) { wasm.createwritestreamoptions_set_encoding(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get fd() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.createwritestreamoptions_fd(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.createwritestreamoptions_fd(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set fd(value) { - wasm.createwritestreamoptions_set_fd(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); + wasm.createwritestreamoptions_set_fd(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get flags() { const ret = wasm.createwritestreamoptions_flags(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set flags(value) { wasm.createwritestreamoptions_set_flags(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get mode() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.createwritestreamoptions_mode(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.createwritestreamoptions_mode(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set mode(value) { - wasm.createwritestreamoptions_set_mode(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); + wasm.createwritestreamoptions_set_mode(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get start() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -2795,24 +3121,24 @@ export class CreateWriteStreamOptions { } } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set start(value) { wasm.createwritestreamoptions_set_start(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); } } const CryptoBoxFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_cryptobox_free(ptr >>> 0, 1)); /** -* -* CryptoBox allows for encrypting and decrypting messages using the `crypto_box` crate. -* -* -* -* @category Wallet SDK -*/ + * + * CryptoBox allows for encrypting and decrypting messages using the `crypto_box` crate. + * + * + * + * @category Wallet SDK + */ export class CryptoBox { toJSON() { @@ -2837,9 +3163,9 @@ export class CryptoBox { wasm.__wbg_cryptobox_free(ptr, 0); } /** - * @param {CryptoBoxPrivateKey | HexString | Uint8Array} secretKey - * @param {CryptoBoxPublicKey | HexString | Uint8Array} peerPublicKey - */ + * @param {CryptoBoxPrivateKey | HexString | Uint8Array} secretKey + * @param {CryptoBoxPublicKey | HexString | Uint8Array} peerPublicKey + */ constructor(secretKey, peerPublicKey) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -2860,8 +3186,8 @@ export class CryptoBox { } } /** - * @returns {string} - */ + * @returns {string} + */ get publicKey() { let deferred1_0; let deferred1_1; @@ -2875,19 +3201,19 @@ export class CryptoBox { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {string} plaintext - * @returns {string} - */ + * @param {string} plaintext + * @returns {string} + */ encrypt(plaintext) { let deferred3_0; let deferred3_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(plaintext, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(plaintext, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.cryptobox_encrypt(retptr, this.__wbg_ptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -2905,19 +3231,19 @@ export class CryptoBox { return getStringFromWasm0(ptr2, len2); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred3_0, deferred3_1, 1); + wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1); } } /** - * @param {string} base64string - * @returns {string} - */ + * @param {string} base64string + * @returns {string} + */ decrypt(base64string) { let deferred3_0; let deferred3_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(base64string, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(base64string, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.cryptobox_decrypt(retptr, this.__wbg_ptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -2935,17 +3261,17 @@ export class CryptoBox { return getStringFromWasm0(ptr2, len2); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred3_0, deferred3_1, 1); + wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1); } } } const CryptoBoxPrivateKeyFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_cryptoboxprivatekey_free(ptr >>> 0, 1)); /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class CryptoBoxPrivateKey { __destroy_into_raw() { @@ -2960,8 +3286,8 @@ export class CryptoBoxPrivateKey { wasm.__wbg_cryptoboxprivatekey_free(ptr, 0); } /** - * @param {HexString | Uint8Array} secretKey - */ + * @param {HexString | Uint8Array} secretKey + */ constructor(secretKey) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -2980,8 +3306,8 @@ export class CryptoBoxPrivateKey { } } /** - * @returns {CryptoBoxPublicKey} - */ + * @returns {CryptoBoxPublicKey} + */ to_public_key() { const ret = wasm.cryptoboxprivatekey_to_public_key(this.__wbg_ptr); return CryptoBoxPublicKey.__wrap(ret); @@ -2989,11 +3315,11 @@ export class CryptoBoxPrivateKey { } const CryptoBoxPublicKeyFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_cryptoboxpublickey_free(ptr >>> 0, 1)); /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class CryptoBoxPublicKey { static __wrap(ptr) { @@ -3016,8 +3342,8 @@ export class CryptoBoxPublicKey { wasm.__wbg_cryptoboxpublickey_free(ptr, 0); } /** - * @param {HexString | Uint8Array} publicKey - */ + * @param {HexString | Uint8Array} publicKey + */ constructor(publicKey) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -3036,8 +3362,8 @@ export class CryptoBoxPublicKey { } } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -3051,20 +3377,20 @@ export class CryptoBoxPublicKey { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const DerivationPathFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_derivationpath_free(ptr >>> 0, 1)); /** -* -* Key derivation path -* -* @category Wallet SDK -*/ + * + * Key derivation path + * + * @category Wallet SDK + */ export class DerivationPath { static __wrap(ptr) { @@ -3087,12 +3413,12 @@ export class DerivationPath { wasm.__wbg_derivationpath_free(ptr, 0); } /** - * @param {string} path - */ + * @param {string} path + */ constructor(path) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(path, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.derivationpath_new(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -3109,36 +3435,36 @@ export class DerivationPath { } } /** - * Is this derivation path empty? (i.e. the root) - * @returns {boolean} - */ + * Is this derivation path empty? (i.e. the root) + * @returns {boolean} + */ isEmpty() { const ret = wasm.derivationpath_isEmpty(this.__wbg_ptr); return ret !== 0; } /** - * Get the count of [`ChildNumber`] values in this derivation path. - * @returns {number} - */ + * Get the count of [`ChildNumber`] values in this derivation path. + * @returns {number} + */ length() { const ret = wasm.derivationpath_length(this.__wbg_ptr); return ret >>> 0; } /** - * Get the parent [`DerivationPath`] for the current one. - * - * Returns `Undefined` if this is already the root path. - * @returns {DerivationPath | undefined} - */ + * Get the parent [`DerivationPath`] for the current one. + * + * Returns `Undefined` if this is already the root path. + * @returns {DerivationPath | undefined} + */ parent() { const ret = wasm.derivationpath_parent(this.__wbg_ptr); return ret === 0 ? undefined : DerivationPath.__wrap(ret); } /** - * Push a [`ChildNumber`] onto an existing derivation path. - * @param {number} child_number - * @param {boolean | undefined} [hardened] - */ + * Push a [`ChildNumber`] onto an existing derivation path. + * @param {number} child_number + * @param {boolean | null} [hardened] + */ push(child_number, hardened) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -3153,8 +3479,8 @@ export class DerivationPath { } } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -3168,16 +3494,15 @@ export class DerivationPath { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const FormatInputPathObjectFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_formatinputpathobject_free(ptr >>> 0, 1)); -/** -*/ + export class FormatInputPathObject { static __wrap(ptr) { @@ -3200,12 +3525,12 @@ export class FormatInputPathObject { wasm.__wbg_formatinputpathobject_free(ptr, 0); } /** - * @param {string | undefined} [base] - * @param {string | undefined} [dir] - * @param {string | undefined} [ext] - * @param {string | undefined} [name] - * @param {string | undefined} [root] - */ + * @param {string | null} [base] + * @param {string | null} [dir] + * @param {string | null} [ext] + * @param {string | null} [name] + * @param {string | null} [root] + */ constructor(base, dir, ext, name, root) { const ret = wasm.formatinputpathobject_new_with_values(isLikeNone(base) ? 0 : addHeapObject(base), isLikeNone(dir) ? 0 : addHeapObject(dir), isLikeNone(ext) ? 0 : addHeapObject(ext), isLikeNone(name) ? 0 : addHeapObject(name), isLikeNone(root) ? 0 : addHeapObject(root)); this.__wbg_ptr = ret >>> 0; @@ -3213,126 +3538,126 @@ export class FormatInputPathObject { return this; } /** - * @returns {FormatInputPathObject} - */ + * @returns {FormatInputPathObject} + */ static new() { const ret = wasm.formatinputpathobject_new(); return FormatInputPathObject.__wrap(ret); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get base() { const ret = wasm.formatinputpathobject_base(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set base(value) { wasm.formatinputpathobject_set_base(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get dir() { const ret = wasm.formatinputpathobject_dir(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set dir(value) { wasm.formatinputpathobject_set_dir(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get ext() { const ret = wasm.formatinputpathobject_ext(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set ext(value) { wasm.formatinputpathobject_set_ext(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get name() { const ret = wasm.formatinputpathobject_name(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set name(value) { wasm.formatinputpathobject_set_name(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get root() { const ret = wasm.formatinputpathobject_root(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set root(value) { wasm.formatinputpathobject_set_root(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } } const GeneratorFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_generator_free(ptr >>> 0, 1)); /** -* Generator is a type capable of generating transactions based on a supplied -* set of UTXO entries or a UTXO entry producer (such as {@link UtxoContext}). The Generator -* accumulates UTXO entries until it can generate a transaction that meets the -* requested amount or until the total mass of created inputs exceeds the allowed -* transaction mass, at which point it will produce a compound transaction by forwarding -* all selected UTXO entries to the supplied change address and prepare to start generating -* a new transaction. Such sequence of daisy-chained transactions is known as a "batch". -* Each compound transaction results in a new UTXO, which is immediately reused in the -* subsequent transaction. -* -* The Generator constructor accepts a single {@link IGeneratorSettingsObject} object. -* -* ```javascript -* -* let generator = new Generator({ -* utxoEntries : [...], -* changeAddress : "kaspa:...", -* outputs : [ -* { amount : kaspaToSompi(10.0), address: "kaspa:..."}, -* { amount : kaspaToSompi(20.0), address: "kaspa:..."}, -* ... -* ], -* priorityFee : 1000n, -* }); -* -* let pendingTransaction; -* while(pendingTransaction = await generator.next()) { -* await pendingTransaction.sign(privateKeys); -* await pendingTransaction.submit(rpc); -* } -* -* let summary = generator.summary(); -* console.log(summary); -* -* ``` -* @see -* {@link IGeneratorSettingsObject}, -* {@link PendingTransaction}, -* {@link UtxoContext}, -* {@link createTransactions}, -* {@link estimateTransactions}, -* @category Wallet SDK -*/ + * Generator is a type capable of generating transactions based on a supplied + * set of UTXO entries or a UTXO entry producer (such as {@link UtxoContext}). The Generator + * accumulates UTXO entries until it can generate a transaction that meets the + * requested amount or until the total mass of created inputs exceeds the allowed + * transaction mass, at which point it will produce a compound transaction by forwarding + * all selected UTXO entries to the supplied change address and prepare to start generating + * a new transaction. Such sequence of daisy-chained transactions is known as a "batch". + * Each compound transaction results in a new UTXO, which is immediately reused in the + * subsequent transaction. + * + * The Generator constructor accepts a single {@link IGeneratorSettingsObject} object. + * + * ```javascript + * + * let generator = new Generator({ + * utxoEntries : [...], + * changeAddress : "kaspa:...", + * outputs : [ + * { amount : kaspaToSompi(10.0), address: "kaspa:..."}, + * { amount : kaspaToSompi(20.0), address: "kaspa:..."}, + * ... + * ], + * priorityFee : 1000n, + * }); + * + * let pendingTransaction; + * while(pendingTransaction = await generator.next()) { + * await pendingTransaction.sign(privateKeys); + * await pendingTransaction.submit(rpc); + * } + * + * let summary = generator.summary(); + * console.log(summary); + * + * ``` + * @see + * {@link IGeneratorSettingsObject}, + * {@link PendingTransaction}, + * {@link UtxoContext}, + * {@link createTransactions}, + * {@link estimateTransactions}, + * @category Wallet SDK + */ export class Generator { __destroy_into_raw() { @@ -3347,8 +3672,8 @@ export class Generator { wasm.__wbg_generator_free(ptr, 0); } /** - * @param {IGeneratorSettingsObject} args - */ + * @param {IGeneratorSettingsObject} args + */ constructor(args) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -3367,23 +3692,23 @@ export class Generator { } } /** - * Generate next transaction - * @returns {Promise} - */ + * Generate next transaction + * @returns {Promise} + */ next() { const ret = wasm.generator_next(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {Promise} - */ + * @returns {Promise} + */ estimate() { const ret = wasm.generator_estimate(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {GeneratorSummary} - */ + * @returns {GeneratorSummary} + */ summary() { const ret = wasm.generator_summary(this.__wbg_ptr); return GeneratorSummary.__wrap(ret); @@ -3391,18 +3716,18 @@ export class Generator { } const GeneratorSummaryFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_generatorsummary_free(ptr >>> 0, 1)); /** -* -* A class containing a summary produced by transaction {@link Generator}. -* This class contains the number of transactions, the aggregated fees, -* the aggregated UTXOs and the final transaction amount that includes -* both network and QoS (priority) fees. -* -* @see {@link createTransactions}, {@link IGeneratorSettingsObject}, {@link Generator} -* @category Wallet SDK -*/ + * + * A class containing a summary produced by transaction {@link Generator}. + * This class contains the number of transactions, the aggregated fees, + * the aggregated UTXOs and the final transaction amount that includes + * both network and QoS (priority) fees. + * + * @see {@link createTransactions}, {@link IGeneratorSettingsObject}, {@link Generator} + * @category Wallet SDK + */ export class GeneratorSummary { static __wrap(ptr) { @@ -3418,6 +3743,7 @@ export class GeneratorSummary { networkType: this.networkType, utxos: this.utxos, fees: this.fees, + mass: this.mass, transactions: this.transactions, finalAmount: this.finalAmount, finalTransactionId: this.finalTransactionId, @@ -3440,43 +3766,50 @@ export class GeneratorSummary { wasm.__wbg_generatorsummary_free(ptr, 0); } /** - * @returns {NetworkType} - */ + * @returns {NetworkType} + */ get networkType() { const ret = wasm.generatorsummary_networkType(this.__wbg_ptr); return ret; } /** - * @returns {number} - */ + * @returns {number} + */ get utxos() { const ret = wasm.generatorsummary_utxos(this.__wbg_ptr); return ret >>> 0; } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get fees() { const ret = wasm.generatorsummary_fees(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {number} - */ + * @returns {bigint} + */ + get mass() { + const ret = wasm.generatorsummary_mass(this.__wbg_ptr); + return takeObject(ret); + } + /** + * @returns {number} + */ get transactions() { const ret = wasm.generatorsummary_transactions(this.__wbg_ptr); return ret >>> 0; } /** - * @returns {bigint | undefined} - */ + * @returns {bigint | undefined} + */ get finalAmount() { const ret = wasm.generatorsummary_finalAmount(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get finalTransactionId() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -3486,7 +3819,7 @@ export class GeneratorSummary { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -3496,10 +3829,9 @@ export class GeneratorSummary { } const GetNameOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_getnameoptions_free(ptr >>> 0, 1)); -/** -*/ + export class GetNameOptions { static __wrap(ptr) { @@ -3522,76 +3854,76 @@ export class GetNameOptions { wasm.__wbg_getnameoptions_free(ptr, 0); } /** - * @param {number | undefined} family - * @param {string} host - * @param {string} local_address - * @param {number} port - * @returns {GetNameOptions} - */ + * @param {number | null | undefined} family + * @param {string} host + * @param {string} local_address + * @param {number} port + * @returns {GetNameOptions} + */ static new(family, host, local_address, port) { const ret = wasm.getnameoptions_new(isLikeNone(family) ? 0xFFFFFF : family, addHeapObject(host), addHeapObject(local_address), port); return GetNameOptions.__wrap(ret); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get family() { const ret = wasm.getnameoptions_family(this.__wbg_ptr); return ret === 0xFFFFFF ? undefined : ret; } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set family(value) { wasm.getnameoptions_set_family(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value); } /** - * @returns {string} - */ + * @returns {string} + */ get host() { const ret = wasm.getnameoptions_host(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string} value - */ + * @param {string} value + */ set host(value) { wasm.getnameoptions_set_host(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {string} - */ + * @returns {string} + */ get local_address() { const ret = wasm.getnameoptions_local_address(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string} value - */ + * @param {string} value + */ set local_address(value) { wasm.getnameoptions_set_local_address(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {number} - */ + * @returns {number} + */ get port() { const ret = wasm.getnameoptions_port(this.__wbg_ptr); return ret >>> 0; } /** - * @param {number} value - */ + * @param {number} value + */ set port(value) { wasm.getnameoptions_set_port(this.__wbg_ptr, value); } } const HashFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_hash_free(ptr >>> 0, 1)); /** -* @category General -*/ + * @category General + */ export class Hash { static __wrap(ptr) { @@ -3614,10 +3946,10 @@ export class Hash { wasm.__wbg_hash_free(ptr, 0); } /** - * @param {string} hex_str - */ + * @param {string} hex_str + */ constructor(hex_str) { - const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; const ret = wasm.hash_constructor(ptr0, len0); this.__wbg_ptr = ret >>> 0; @@ -3625,8 +3957,8 @@ export class Hash { return this; } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -3640,19 +3972,19 @@ export class Hash { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const HeaderFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_header_free(ptr >>> 0, 1)); /** -* Kaspa Block Header -* -* @category Consensus -*/ + * Kaspa Block Header + * + * @category Consensus + */ export class Header { toJSON() { @@ -3689,8 +4021,8 @@ export class Header { wasm.__wbg_header_free(ptr, 0); } /** - * @param {Header | IHeader | IRawHeader} js_value - */ + * @param {Header | IHeader | IRawHeader} js_value + */ constructor(js_value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -3709,10 +4041,10 @@ export class Header { } } /** - * Finalizes the header and recomputes (updates) the header hash - * @return { String } header hash - * @returns {string} - */ + * Finalizes the header and recomputes (updates) the header hash + * @return { String } header hash + * @returns {string} + */ finalize() { let deferred1_0; let deferred1_1; @@ -3726,15 +4058,15 @@ export class Header { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Obtain `JSON` representation of the header. JSON representation - * should be obtained using WASM, to ensure proper serialization of - * big integers. - * @returns {string} - */ + * Obtain `JSON` representation of the header. JSON representation + * should be obtained using WASM, to ensure proper serialization of + * big integers. + * @returns {string} + */ asJSON() { let deferred1_0; let deferred1_1; @@ -3748,90 +4080,90 @@ export class Header { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {number} - */ + * @returns {number} + */ get version() { const ret = wasm.header_get_version(this.__wbg_ptr); return ret; } /** - * @param {number} version - */ + * @param {number} version + */ set version(version) { wasm.header_set_version(this.__wbg_ptr, version); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get timestamp() { const ret = wasm.header_get_timestamp(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} timestamp - */ + * @param {bigint} timestamp + */ set timestamp(timestamp) { wasm.header_set_timestamp(this.__wbg_ptr, timestamp); } /** - * @returns {number} - */ + * @returns {number} + */ get bits() { const ret = wasm.header_bits(this.__wbg_ptr); return ret >>> 0; } /** - * @param {number} bits - */ + * @param {number} bits + */ set bits(bits) { wasm.header_set_bits(this.__wbg_ptr, bits); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get nonce() { const ret = wasm.header_nonce(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} nonce - */ + * @param {bigint} nonce + */ set nonce(nonce) { wasm.header_set_nonce(this.__wbg_ptr, nonce); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get daaScore() { const ret = wasm.header_daa_score(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} daa_score - */ + * @param {bigint} daa_score + */ set daaScore(daa_score) { wasm.header_set_daa_score(this.__wbg_ptr, daa_score); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get blueScore() { const ret = wasm.header_blue_score(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} blue_score - */ + * @param {bigint} blue_score + */ set blueScore(blue_score) { wasm.header_set_blue_score(this.__wbg_ptr, blue_score); } /** - * @returns {string} - */ + * @returns {string} + */ get hash() { let deferred1_0; let deferred1_1; @@ -3845,12 +4177,12 @@ export class Header { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ get hashMerkleRoot() { let deferred1_0; let deferred1_1; @@ -3864,18 +4196,18 @@ export class Header { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set hashMerkleRoot(js_value) { wasm.header_set_hash_merkle_root_from_js_value(this.__wbg_ptr, addHeapObject(js_value)); } /** - * @returns {string} - */ + * @returns {string} + */ get acceptedIdMerkleRoot() { let deferred1_0; let deferred1_1; @@ -3889,18 +4221,18 @@ export class Header { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set acceptedIdMerkleRoot(js_value) { wasm.header_set_accepted_id_merkle_root_from_js_value(this.__wbg_ptr, addHeapObject(js_value)); } /** - * @returns {string} - */ + * @returns {string} + */ get utxoCommitment() { let deferred1_0; let deferred1_1; @@ -3914,18 +4246,18 @@ export class Header { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set utxoCommitment(js_value) { wasm.header_set_utxo_commitment_from_js_value(this.__wbg_ptr, addHeapObject(js_value)); } /** - * @returns {string} - */ + * @returns {string} + */ get pruningPoint() { let deferred1_0; let deferred1_1; @@ -3939,38 +4271,38 @@ export class Header { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set pruningPoint(js_value) { wasm.header_set_pruning_point_from_js_value(this.__wbg_ptr, addHeapObject(js_value)); } /** - * @returns {any} - */ + * @returns {any} + */ get parentsByLevel() { const ret = wasm.header_get_parents_by_level_as_js_value(this.__wbg_ptr); return takeObject(ret); } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set parentsByLevel(js_value) { wasm.header_set_parents_by_level_from_js_value(this.__wbg_ptr, addHeapObject(js_value)); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get blueWork() { const ret = wasm.header_blue_work(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {string} - */ + * @returns {string} + */ getBlueWorkAsHex() { let deferred1_0; let deferred1_1; @@ -3984,24 +4316,24 @@ export class Header { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set blueWork(js_value) { wasm.header_set_blue_work_from_js_value(this.__wbg_ptr, addHeapObject(js_value)); } } const KeypairFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_keypair_free(ptr >>> 0, 1)); /** -* Data structure that contains a secret and public keys. -* @category Wallet SDK -*/ + * Data structure that contains a secret and public keys. + * @category Wallet SDK + */ export class Keypair { static __wrap(ptr) { @@ -4036,9 +4368,9 @@ export class Keypair { wasm.__wbg_keypair_free(ptr, 0); } /** - * Get the [`PublicKey`] of this [`Keypair`]. - * @returns {string} - */ + * Get the [`PublicKey`] of this [`Keypair`]. + * @returns {string} + */ get publicKey() { let deferred1_0; let deferred1_1; @@ -4052,13 +4384,13 @@ export class Keypair { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Get the [`PrivateKey`] of this [`Keypair`]. - * @returns {string} - */ + * Get the [`PrivateKey`] of this [`Keypair`]. + * @returns {string} + */ get privateKey() { let deferred1_0; let deferred1_1; @@ -4072,25 +4404,25 @@ export class Keypair { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Get the `XOnlyPublicKey` of this [`Keypair`]. - * @returns {any} - */ + * Get the `XOnlyPublicKey` of this [`Keypair`]. + * @returns {any} + */ get xOnlyPublicKey() { const ret = wasm.keypair_get_xonly_public_key(this.__wbg_ptr); return takeObject(ret); } /** - * Get the [`Address`] of this Keypair's [`PublicKey`]. - * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) - * to determine the prefix of the address. - * JavaScript: `let address = keypair.toAddress(NetworkType.MAINNET);`. - * @param {NetworkType | NetworkId | string} network - * @returns {Address} - */ + * Get the [`Address`] of this Keypair's [`PublicKey`]. + * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) + * to determine the prefix of the address. + * JavaScript: `let address = keypair.toAddress(NetworkType.MAINNET);`. + * @param {NetworkType | NetworkId | string} network + * @returns {Address} + */ toAddress(network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4108,13 +4440,13 @@ export class Keypair { } } /** - * Get `ECDSA` [`Address`] of this Keypair's [`PublicKey`]. - * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) - * to determine the prefix of the address. - * JavaScript: `let address = keypair.toAddress(NetworkType.MAINNET);`. - * @param {NetworkType | NetworkId | string} network - * @returns {Address} - */ + * Get `ECDSA` [`Address`] of this Keypair's [`PublicKey`]. + * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) + * to determine the prefix of the address. + * JavaScript: `let address = keypair.toAddress(NetworkType.MAINNET);`. + * @param {NetworkType | NetworkId | string} network + * @returns {Address} + */ toAddressECDSA(network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4132,10 +4464,10 @@ export class Keypair { } } /** - * Create a new random [`Keypair`]. - * JavaScript: `let keypair = Keypair::random();`. - * @returns {Keypair} - */ + * Create a new random [`Keypair`]. + * JavaScript: `let keypair = Keypair::random();`. + * @returns {Keypair} + */ static random() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4152,11 +4484,11 @@ export class Keypair { } } /** - * Create a new [`Keypair`] from a [`PrivateKey`]. - * JavaScript: `let privkey = new PrivateKey(hexString); let keypair = privkey.toKeypair();`. - * @param {PrivateKey} secret_key - * @returns {Keypair} - */ + * Create a new [`Keypair`] from a [`PrivateKey`]. + * JavaScript: `let privkey = new PrivateKey(hexString); let keypair = privkey.toKeypair();`. + * @param {PrivateKey} secret_key + * @returns {Keypair} + */ static fromPrivateKey(secret_key) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4176,10 +4508,9 @@ export class Keypair { } const MkdtempSyncOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_mkdtempsyncoptions_free(ptr >>> 0, 1)); -/** -*/ + export class MkdtempSyncOptions { static __wrap(ptr) { @@ -4202,8 +4533,8 @@ export class MkdtempSyncOptions { wasm.__wbg_mkdtempsyncoptions_free(ptr, 0); } /** - * @param {string | undefined} [encoding] - */ + * @param {string | null} [encoding] + */ constructor(encoding) { const ret = wasm.mkdtempsyncoptions_new_with_values(isLikeNone(encoding) ? 0 : addHeapObject(encoding)); this.__wbg_ptr = ret >>> 0; @@ -4211,34 +4542,34 @@ export class MkdtempSyncOptions { return this; } /** - * @returns {MkdtempSyncOptions} - */ + * @returns {MkdtempSyncOptions} + */ static new() { const ret = wasm.mkdtempsyncoptions_new(); return MkdtempSyncOptions.__wrap(ret); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get encoding() { const ret = wasm.mkdtempsyncoptions_encoding(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set encoding(value) { wasm.mkdtempsyncoptions_set_encoding(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } } const MnemonicFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_mnemonic_free(ptr >>> 0, 1)); /** -* BIP39 mnemonic phrases: sequences of words representing cryptographic keys. -* @category Wallet SDK -*/ + * BIP39 mnemonic phrases: sequences of words representing cryptographic keys. + * @category Wallet SDK + */ export class Mnemonic { static __wrap(ptr) { @@ -4272,13 +4603,13 @@ export class Mnemonic { wasm.__wbg_mnemonic_free(ptr, 0); } /** - * @param {string} phrase - * @param {Language | undefined} [language] - */ + * @param {string} phrase + * @param {Language | null} [language] + */ constructor(phrase, language) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.mnemonic_constructor(retptr, ptr0, len0, isLikeNone(language) ? 1 : language); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -4295,20 +4626,20 @@ export class Mnemonic { } } /** - * Validate mnemonic phrase. Returns `true` if the phrase is valid, `false` otherwise. - * @param {string} phrase - * @param {Language | undefined} [language] - * @returns {boolean} - */ + * Validate mnemonic phrase. Returns `true` if the phrase is valid, `false` otherwise. + * @param {string} phrase + * @param {Language | null} [language] + * @returns {boolean} + */ static validate(phrase, language) { - const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; const ret = wasm.mnemonic_validate(ptr0, len0, isLikeNone(language) ? 1 : language); return ret !== 0; } /** - * @returns {string} - */ + * @returns {string} + */ get entropy() { let deferred1_0; let deferred1_1; @@ -4322,25 +4653,25 @@ export class Mnemonic { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {string} entropy - */ + * @param {string} entropy + */ set entropy(entropy) { - const ptr0 = passStringToWasm0(entropy, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(entropy, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.mnemonic_set_entropy(this.__wbg_ptr, ptr0, len0); } /** - * @param {number | undefined} [word_count] - * @returns {Mnemonic} - */ + * @param {number | null} [word_count] + * @returns {Mnemonic} + */ static random(word_count) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.mnemonic_random(retptr, !isLikeNone(word_count), isLikeNone(word_count) ? 0 : word_count); + wasm.mnemonic_random(retptr, isLikeNone(word_count) ? 0x100000001 : (word_count) >>> 0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); @@ -4353,8 +4684,8 @@ export class Mnemonic { } } /** - * @returns {string} - */ + * @returns {string} + */ get phrase() { let deferred1_0; let deferred1_1; @@ -4368,27 +4699,27 @@ export class Mnemonic { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {string} phrase - */ + * @param {string} phrase + */ set phrase(phrase) { - const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.mnemonic_set_phrase(this.__wbg_ptr, ptr0, len0); } /** - * @param {string | undefined} [password] - * @returns {string} - */ + * @param {string | null} [password] + * @returns {string} + */ toSeed(password) { let deferred2_0; let deferred2_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - var ptr0 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + var ptr0 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); var len0 = WASM_VECTOR_LEN; wasm.mnemonic_toSeed(retptr, this.__wbg_ptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -4398,16 +4729,15 @@ export class Mnemonic { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } } const NetServerOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_netserveroptions_free(ptr >>> 0, 1)); -/** -*/ + export class NetServerOptions { __destroy_into_raw() { @@ -4422,31 +4752,31 @@ export class NetServerOptions { wasm.__wbg_netserveroptions_free(ptr, 0); } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get allow_half_open() { const ptr = this.__destroy_into_raw(); const ret = wasm.netserveroptions_allow_half_open(ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set allow_half_open(value) { const ptr = this.__destroy_into_raw(); wasm.netserveroptions_set_allow_half_open(ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get pause_on_connect() { const ptr = this.__destroy_into_raw(); const ret = wasm.netserveroptions_pause_on_connect(ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set pause_on_connect(value) { const ptr = this.__destroy_into_raw(); wasm.netserveroptions_set_allow_half_open(ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); @@ -4454,15 +4784,15 @@ export class NetServerOptions { } const NetworkIdFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_networkid_free(ptr >>> 0, 1)); /** -* -* NetworkId is a unique identifier for a kaspa network instance. -* It is composed of a network type and an optional suffix. -* -* @category Consensus -*/ + * + * NetworkId is a unique identifier for a kaspa network instance. + * It is composed of a network type and an optional suffix. + * + * @category Consensus + */ export class NetworkId { static __wrap(ptr) { @@ -4497,41 +4827,34 @@ export class NetworkId { wasm.__wbg_networkid_free(ptr, 0); } /** - * @returns {NetworkType} - */ + * @returns {NetworkType} + */ get type() { const ret = wasm.__wbg_get_networkid_type(this.__wbg_ptr); return ret; } /** - * @param {NetworkType} arg0 - */ + * @param {NetworkType} arg0 + */ set type(arg0) { wasm.__wbg_set_networkid_type(this.__wbg_ptr, arg0); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get suffix() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.__wbg_get_networkid_suffix(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.__wbg_get_networkid_suffix(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** - * @param {number | undefined} [arg0] - */ + * @param {number | null} [arg0] + */ set suffix(arg0) { - wasm.__wbg_set_networkid_suffix(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? 0 : arg0); + wasm.__wbg_set_networkid_suffix(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : (arg0) >>> 0); } /** - * @param {any} value - */ + * @param {any} value + */ constructor(value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4551,8 +4874,8 @@ export class NetworkId { } } /** - * @returns {string} - */ + * @returns {string} + */ get id() { let deferred1_0; let deferred1_1; @@ -4566,12 +4889,12 @@ export class NetworkId { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -4585,12 +4908,12 @@ export class NetworkId { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ addressPrefix() { let deferred1_0; let deferred1_1; @@ -4604,21 +4927,21 @@ export class NetworkId { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const NodeDescriptorFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_nodedescriptor_free(ptr >>> 0, 1)); /** -* -* Data structure representing a Node connection endpoint -* as provided by the {@link Resolver}. -* -* @category Node RPC -*/ + * + * Data structure representing a Node connection endpoint + * as provided by the {@link Resolver}. + * + * @category Node RPC + */ export class NodeDescriptor { static __wrap(ptr) { @@ -4652,9 +4975,9 @@ export class NodeDescriptor { wasm.__wbg_nodedescriptor_free(ptr, 0); } /** - * The unique identifier of the node. - * @returns {string} - */ + * The unique identifier of the node. + * @returns {string} + */ get uid() { let deferred1_0; let deferred1_1; @@ -4668,22 +4991,22 @@ export class NodeDescriptor { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * The unique identifier of the node. - * @param {string} arg0 - */ + * The unique identifier of the node. + * @param {string} arg0 + */ set uid(arg0) { - const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.__wbg_set_nodedescriptor_uid(this.__wbg_ptr, ptr0, len0); } /** - * The URL of the node WebSocket (wRPC URL). - * @returns {string} - */ + * The URL of the node WebSocket (wRPC URL). + * @returns {string} + */ get url() { let deferred1_0; let deferred1_1; @@ -4697,25 +5020,176 @@ export class NodeDescriptor { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * The URL of the node WebSocket (wRPC URL). - * @param {string} arg0 - */ + * The URL of the node WebSocket (wRPC URL). + * @param {string} arg0 + */ set url(arg0) { - const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.__wbg_set_nodedescriptor_url(this.__wbg_ptr, ptr0, len0); } } +const PSKBFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_pskb_free(ptr >>> 0, 1)); + +export class PSKB { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(PSKB.prototype); + obj.__wbg_ptr = ptr; + PSKBFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + PSKBFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_pskb_free(ptr, 0); + } + constructor() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.pskb_new(retptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + this.__wbg_ptr = r0 >>> 0; + PSKBFinalization.register(this, this.__wbg_ptr, this); + return this; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {string} + */ + serialize() { + let deferred2_0; + let deferred2_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.pskb_serialize(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + var ptr1 = r0; + var len1 = r1; + if (r3) { + ptr1 = 0; len1 = 0; + throw takeObject(r2); + } + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); + } + } + /** + * @param {NetworkId | string} network_id + * @returns {string} + */ + displayFormat(network_id) { + let deferred2_0; + let deferred2_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.pskb_displayFormat(retptr, this.__wbg_ptr, addBorrowedObject(network_id)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + var ptr1 = r0; + var len1 = r1; + if (r3) { + ptr1 = 0; len1 = 0; + throw takeObject(r2); + } + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); + } + } + /** + * @param {string} hex_data + * @returns {PSKB} + */ + static deserialize(hex_data) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + const ptr0 = passStringToWasm0(hex_data, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + wasm.pskb_deserialize(retptr, ptr0, len0); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return PSKB.__wrap(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get length() { + const ret = wasm.pskb_length(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {PSKT} pskt + */ + add(pskt) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertClass(pskt, PSKT); + wasm.pskb_add(retptr, this.__wbg_ptr, pskt.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {PSKB} other + */ + merge(other) { + _assertClass(other, PSKB); + wasm.pskb_merge(this.__wbg_ptr, other.__wbg_ptr); + } +} + const PSKTFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_pskt_free(ptr >>> 0, 1)); -/** -*/ + export class PSKT { static __wrap(ptr) { @@ -4749,8 +5223,8 @@ export class PSKT { wasm.__wbg_pskt_free(ptr, 0); } /** - * @param {PSKT | Transaction | string | undefined} payload - */ + * @param {PSKT | Transaction | string | undefined} payload + */ constructor(payload) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4769,8 +5243,8 @@ export class PSKT { } } /** - * @returns {string} - */ + * @returns {string} + */ get role() { let deferred1_0; let deferred1_1; @@ -4784,21 +5258,40 @@ export class PSKT { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {any} - */ + * @returns {any} + */ get payload() { const ret = wasm.pskt_payload(this.__wbg_ptr); return takeObject(ret); } /** - * Change role to `CREATOR` - * #[wasm_bindgen(js_name = toCreator)] - * @returns {PSKT} - */ + * @returns {string} + */ + serialize() { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.pskt_serialize(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); + } + } + /** + * Change role to `CREATOR` + * #[wasm_bindgen(js_name = toCreator)] + * @returns {PSKT} + */ creator() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4815,9 +5308,9 @@ export class PSKT { } } /** - * Change role to `CONSTRUCTOR` - * @returns {PSKT} - */ + * Change role to `CONSTRUCTOR` + * @returns {PSKT} + */ toConstructor() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4834,9 +5327,9 @@ export class PSKT { } } /** - * Change role to `UPDATER` - * @returns {PSKT} - */ + * Change role to `UPDATER` + * @returns {PSKT} + */ toUpdater() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4853,9 +5346,9 @@ export class PSKT { } } /** - * Change role to `SIGNER` - * @returns {PSKT} - */ + * Change role to `SIGNER` + * @returns {PSKT} + */ toSigner() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4872,9 +5365,9 @@ export class PSKT { } } /** - * Change role to `COMBINER` - * @returns {PSKT} - */ + * Change role to `COMBINER` + * @returns {PSKT} + */ toCombiner() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4891,9 +5384,9 @@ export class PSKT { } } /** - * Change role to `FINALIZER` - * @returns {PSKT} - */ + * Change role to `FINALIZER` + * @returns {PSKT} + */ toFinalizer() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4910,9 +5403,9 @@ export class PSKT { } } /** - * Change role to `EXTRACTOR` - * @returns {PSKT} - */ + * Change role to `EXTRACTOR` + * @returns {PSKT} + */ toExtractor() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4929,9 +5422,9 @@ export class PSKT { } } /** - * @param {bigint} lock_time - * @returns {PSKT} - */ + * @param {bigint} lock_time + * @returns {PSKT} + */ fallbackLockTime(lock_time) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4948,8 +5441,8 @@ export class PSKT { } } /** - * @returns {PSKT} - */ + * @returns {PSKT} + */ inputsModifiable() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4966,8 +5459,8 @@ export class PSKT { } } /** - * @returns {PSKT} - */ + * @returns {PSKT} + */ outputsModifiable() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -4984,8 +5477,8 @@ export class PSKT { } } /** - * @returns {PSKT} - */ + * @returns {PSKT} + */ noMoreInputs() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5002,8 +5495,8 @@ export class PSKT { } } /** - * @returns {PSKT} - */ + * @returns {PSKT} + */ noMoreOutputs() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5020,9 +5513,31 @@ export class PSKT { } } /** - * @param {ITransactionInput | TransactionInput} input - * @returns {PSKT} - */ + * @param {ITransactionInput | TransactionInput} input + * @param {any} data + * @returns {PSKT} + */ + inputAndRedeemScript(input, data) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.pskt_inputAndRedeemScript(retptr, this.__wbg_ptr, addBorrowedObject(input), addBorrowedObject(data)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return PSKT.__wrap(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; + heap[stack_pointer++] = undefined; + } + } + /** + * @param {ITransactionInput | TransactionInput} input + * @returns {PSKT} + */ input(input) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5040,9 +5555,9 @@ export class PSKT { } } /** - * @param {ITransactionOutput | TransactionOutput} output - * @returns {PSKT} - */ + * @param {ITransactionOutput | TransactionOutput} output + * @returns {PSKT} + */ output(output) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5060,10 +5575,10 @@ export class PSKT { } } /** - * @param {bigint} n - * @param {number} input_index - * @returns {PSKT} - */ + * @param {bigint} n + * @param {number} input_index + * @returns {PSKT} + */ setSequence(n, input_index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5080,8 +5595,8 @@ export class PSKT { } } /** - * @returns {Hash} - */ + * @returns {Hash} + */ calculateId() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5097,17 +5612,37 @@ export class PSKT { wasm.__wbindgen_add_to_stack_pointer(16); } } + /** + * @param {any} data + * @returns {bigint} + */ + calculateMass(data) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.pskt_calculateMass(retptr, this.__wbg_ptr, addBorrowedObject(data)); + var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + if (r3) { + throw takeObject(r2); + } + return BigInt.asUintN(64, r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; + } + } } const PaymentOutputFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_paymentoutput_free(ptr >>> 0, 1)); /** -* A Rust data structure representing a single payment -* output containing a destination address and amount. -* -* @category Wallet SDK -*/ + * A Rust data structure representing a single payment + * output containing a destination address and amount. + * + * @category Wallet SDK + */ export class PaymentOutput { toJSON() { @@ -5133,37 +5668,37 @@ export class PaymentOutput { wasm.__wbg_paymentoutput_free(ptr, 0); } /** - * @returns {Address} - */ + * @returns {Address} + */ get address() { const ret = wasm.__wbg_get_paymentoutput_address(this.__wbg_ptr); return Address.__wrap(ret); } /** - * @param {Address} arg0 - */ + * @param {Address} arg0 + */ set address(arg0) { _assertClass(arg0, Address); var ptr0 = arg0.__destroy_into_raw(); wasm.__wbg_set_paymentoutput_address(this.__wbg_ptr, ptr0); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get amount() { const ret = wasm.__wbg_get_paymentoutput_amount(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} arg0 - */ + * @param {bigint} arg0 + */ set amount(arg0) { wasm.__wbg_set_paymentoutput_amount(this.__wbg_ptr, arg0); } /** - * @param {Address} address - * @param {bigint} amount - */ + * @param {Address} address + * @param {bigint} amount + */ constructor(address, amount) { _assertClass(address, Address); var ptr0 = address.__destroy_into_raw(); @@ -5175,11 +5710,11 @@ export class PaymentOutput { } const PaymentOutputsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_paymentoutputs_free(ptr >>> 0, 1)); /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class PaymentOutputs { __destroy_into_raw() { @@ -5194,8 +5729,8 @@ export class PaymentOutputs { wasm.__wbg_paymentoutputs_free(ptr, 0); } /** - * @param {IPaymentOutput[]} output_array - */ + * @param {IPaymentOutput[]} output_array + */ constructor(output_array) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5216,11 +5751,11 @@ export class PaymentOutputs { } const PendingTransactionFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_pendingtransaction_free(ptr >>> 0, 1)); /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class PendingTransaction { static __wrap(ptr) { @@ -5262,9 +5797,9 @@ export class PendingTransaction { wasm.__wbg_pendingtransaction_free(ptr, 0); } /** - * Transaction Id - * @returns {string} - */ + * Transaction Id + * @returns {string} + */ get id() { let deferred1_0; let deferred1_1; @@ -5278,70 +5813,70 @@ export class PendingTransaction { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Total amount transferred to the destination (aggregate output - change). - * @returns {any} - */ + * Total amount transferred to the destination (aggregate output - change). + * @returns {any} + */ get paymentAmount() { const ret = wasm.pendingtransaction_paymentAmount(this.__wbg_ptr); return takeObject(ret); } /** - * Change amount (if any). - * @returns {bigint} - */ + * Change amount (if any). + * @returns {bigint} + */ get changeAmount() { const ret = wasm.pendingtransaction_changeAmount(this.__wbg_ptr); return takeObject(ret); } /** - * Total transaction fees (network fees + priority fees). - * @returns {bigint} - */ + * Total transaction fees (network fees + priority fees). + * @returns {bigint} + */ get feeAmount() { const ret = wasm.pendingtransaction_feeAmount(this.__wbg_ptr); return takeObject(ret); } /** - * Calculated transaction mass. - * @returns {bigint} - */ + * Calculated transaction mass. + * @returns {bigint} + */ get mass() { const ret = wasm.pendingtransaction_mass(this.__wbg_ptr); return takeObject(ret); } /** - * Minimum number of signatures required by the transaction. - * (as specified during the transaction creation). - * @returns {number} - */ + * Minimum number of signatures required by the transaction. + * (as specified during the transaction creation). + * @returns {number} + */ get minimumSignatures() { const ret = wasm.pendingtransaction_minimumSignatures(this.__wbg_ptr); return ret; } /** - * Total aggregate input amount. - * @returns {bigint} - */ + * Total aggregate input amount. + * @returns {bigint} + */ get aggregateInputAmount() { const ret = wasm.pendingtransaction_aggregateInputAmount(this.__wbg_ptr); return takeObject(ret); } /** - * Total aggregate output amount. - * @returns {bigint} - */ + * Total aggregate output amount. + * @returns {bigint} + */ get aggregateOutputAmount() { const ret = wasm.pendingtransaction_aggregateOutputAmount(this.__wbg_ptr); return takeObject(ret); } /** - * Transaction type ("batch" or "final"). - * @returns {string} - */ + * Transaction type ("batch" or "final"). + * @returns {string} + */ get type() { let deferred1_0; let deferred1_1; @@ -5355,34 +5890,34 @@ export class PendingTransaction { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * List of unique addresses used by transaction inputs. - * This method can be used to determine addresses used by transaction inputs - * in order to select private keys needed for transaction signing. - * @returns {Array} - */ + * List of unique addresses used by transaction inputs. + * This method can be used to determine addresses used by transaction inputs + * in order to select private keys needed for transaction signing. + * @returns {Array} + */ addresses() { const ret = wasm.pendingtransaction_addresses(this.__wbg_ptr); return takeObject(ret); } /** - * Provides a list of UTXO entries used by the transaction. - * @returns {Array} - */ + * Provides a list of UTXO entries used by the transaction. + * @returns {Array} + */ getUtxoEntries() { const ret = wasm.pendingtransaction_getUtxoEntries(this.__wbg_ptr); return takeObject(ret); } /** - * Creates and returns a signature for the input at the specified index. - * @param {number} input_index - * @param {PrivateKey} private_key - * @param {SighashType | undefined} [sighash_type] - * @returns {HexString} - */ + * Creates and returns a signature for the input at the specified index. + * @param {number} input_index + * @param {PrivateKey} private_key + * @param {SighashType | null} [sighash_type] + * @returns {HexString} + */ createInputSignature(input_index, private_key, sighash_type) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5400,10 +5935,10 @@ export class PendingTransaction { } } /** - * Sets a signature to the input at the specified index. - * @param {number} input_index - * @param {HexString | Uint8Array} signature_script - */ + * Sets a signature to the input at the specified index. + * @param {number} input_index + * @param {HexString | Uint8Array} signature_script + */ fillInput(input_index, signature_script) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5418,12 +5953,12 @@ export class PendingTransaction { } } /** - * Signs the input at the specified index with the supplied private key - * and an optional SighashType. - * @param {number} input_index - * @param {PrivateKey} private_key - * @param {SighashType | undefined} [sighash_type] - */ + * Signs the input at the specified index with the supplied private key + * and an optional SighashType. + * @param {number} input_index + * @param {PrivateKey} private_key + * @param {SighashType | null} [sighash_type] + */ signInput(input_index, private_key, sighash_type) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5439,11 +5974,11 @@ export class PendingTransaction { } } /** - * Signs transaction with supplied [`Array`] or [`PrivateKey`] or an array of - * raw private key bytes (encoded as `Uint8Array` or as hex strings) - * @param {(PrivateKey | HexString | Uint8Array)[]} js_value - * @param {boolean | undefined} [check_fully_signed] - */ + * Signs transaction with supplied [`Array`] or [`PrivateKey`] or an array of + * raw private key bytes (encoded as `Uint8Array` or as hex strings) + * @param {(PrivateKey | HexString | Uint8Array)[]} js_value + * @param {boolean | null} [check_fully_signed] + */ sign(js_value, check_fully_signed) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5458,32 +5993,32 @@ export class PendingTransaction { } } /** - * Submit transaction to the supplied [`RpcClient`] - * **IMPORTANT:** This method will remove UTXOs from the associated - * {@link UtxoContext} if one was used to create the transaction - * and will return UTXOs back to {@link UtxoContext} in case of - * a failed submission. - * - * # Important - * - * Make sure to consume the returned `txid` value. Always invoke this method - * as follows `let txid = await pendingTransaction.submit(rpc);`. If you do not - * consume the returned value and the rpc object is temporary, the GC will - * collect the `rpc` object passed to submit() potentially causing a panic. - * - * @see {@link RpcClient.submitTransaction} - * @param {RpcClient} wasm_rpc_client - * @returns {Promise} - */ + * Submit transaction to the supplied [`RpcClient`] + * **IMPORTANT:** This method will remove UTXOs from the associated + * {@link UtxoContext} if one was used to create the transaction + * and will return UTXOs back to {@link UtxoContext} in case of + * a failed submission. + * + * # Important + * + * Make sure to consume the returned `txid` value. Always invoke this method + * as follows `let txid = await pendingTransaction.submit(rpc);`. If you do not + * consume the returned value and the rpc object is temporary, the GC will + * collect the `rpc` object passed to submit() potentially causing a panic. + * + * @see {@link RpcClient.submitTransaction} + * @param {RpcClient} wasm_rpc_client + * @returns {Promise} + */ submit(wasm_rpc_client) { _assertClass(wasm_rpc_client, RpcClient); const ret = wasm.pendingtransaction_submit(this.__wbg_ptr, wasm_rpc_client.__wbg_ptr); return takeObject(ret); } /** - * Returns encapsulated network [`Transaction`] - * @returns {Transaction} - */ + * Returns encapsulated network [`Transaction`] + * @returns {Transaction} + */ get transaction() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5500,12 +6035,12 @@ export class PendingTransaction { } } /** - * Serializes the transaction to a pure JavaScript Object. - * The schema of the JavaScript object is defined by {@link ISerializableTransaction}. - * @see {@link ISerializableTransaction} - * @see {@link Transaction}, {@link ISerializableTransaction} - * @returns {ITransaction | Transaction} - */ + * Serializes the transaction to a pure JavaScript Object. + * The schema of the JavaScript object is defined by {@link ISerializableTransaction}. + * @see {@link ISerializableTransaction} + * @see {@link Transaction}, {@link ISerializableTransaction} + * @returns {ITransaction | Transaction} + */ serializeToObject() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5522,12 +6057,12 @@ export class PendingTransaction { } } /** - * Serializes the transaction to a JSON string. - * The schema of the JSON is defined by {@link ISerializableTransaction}. - * Once serialized, the transaction can be deserialized using {@link Transaction.deserializeFromJSON}. - * @see {@link Transaction}, {@link ISerializableTransaction} - * @returns {string} - */ + * Serializes the transaction to a JSON string. + * The schema of the JSON is defined by {@link ISerializableTransaction}. + * Once serialized, the transaction can be deserialized using {@link Transaction.deserializeFromJSON}. + * @see {@link Transaction}, {@link ISerializableTransaction} + * @returns {string} + */ serializeToJSON() { let deferred2_0; let deferred2_1; @@ -5549,15 +6084,15 @@ export class PendingTransaction { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * Serializes the transaction to a "Safe" JSON schema where it converts all `bigint` values to `string` to avoid potential client-side precision loss. - * Once serialized, the transaction can be deserialized using {@link Transaction.deserializeFromSafeJSON}. - * @see {@link Transaction}, {@link ISerializableTransaction} - * @returns {string} - */ + * Serializes the transaction to a "Safe" JSON schema where it converts all `bigint` values to `string` to avoid potential client-side precision loss. + * Once serialized, the transaction can be deserialized using {@link Transaction.deserializeFromSafeJSON}. + * @see {@link Transaction}, {@link ISerializableTransaction} + * @returns {string} + */ serializeToSafeJSON() { let deferred2_0; let deferred2_1; @@ -5579,16 +6114,15 @@ export class PendingTransaction { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } } const PipeOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_pipeoptions_free(ptr >>> 0, 1)); -/** -*/ + export class PipeOptions { __destroy_into_raw() { @@ -5603,8 +6137,8 @@ export class PipeOptions { wasm.__wbg_pipeoptions_free(ptr, 0); } /** - * @param {boolean | undefined} [end] - */ + * @param {boolean | null} [end] + */ constructor(end) { const ret = wasm.pipeoptions_new(isLikeNone(end) ? 0xFFFFFF : end ? 1 : 0); this.__wbg_ptr = ret >>> 0; @@ -5612,16 +6146,16 @@ export class PipeOptions { return this; } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get end() { const ptr = this.__destroy_into_raw(); const ret = wasm.pipeoptions_end(ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set end(value) { const ptr = this.__destroy_into_raw(); wasm.pipeoptions_set_end(ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); @@ -5629,12 +6163,12 @@ export class PipeOptions { } const PoWFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_pow_free(ptr >>> 0, 1)); /** -* Represents a Kaspa header PoW manager -* @category Mining -*/ + * Represents a Kaspa header PoW manager + * @category Mining + */ export class PoW { static __wrap(ptr) { @@ -5668,9 +6202,9 @@ export class PoW { wasm.__wbg_pow_free(ptr, 0); } /** - * @param {Header | IHeader | IRawHeader} header - * @param {bigint | undefined} [timestamp] - */ + * @param {Header | IHeader | IRawHeader} header + * @param {bigint | null} [timestamp] + */ constructor(header, timestamp) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5690,9 +6224,9 @@ export class PoW { } } /** - * The target based on the provided bits. - * @returns {bigint} - */ + * The target based on the provided bits. + * @returns {bigint} + */ get target() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5709,11 +6243,11 @@ export class PoW { } } /** - * Checks if the computed target meets or exceeds the difficulty specified in the template. - * @returns A boolean indicating if it reached the target and a bigint representing the reached target. - * @param {bigint} nonce - * @returns {[boolean, bigint]} - */ + * Checks if the computed target meets or exceeds the difficulty specified in the template. + * @returns A boolean indicating if it reached the target and a bigint representing the reached target. + * @param {bigint} nonce + * @returns {[boolean, bigint]} + */ checkWork(nonce) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5730,9 +6264,9 @@ export class PoW { } } /** - * Hash of the header without timestamp and nonce. - * @returns {string} - */ + * Hash of the header without timestamp and nonce. + * @returns {string} + */ get prePoWHash() { let deferred1_0; let deferred1_1; @@ -5746,22 +6280,22 @@ export class PoW { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Can be used for parsing Stratum templates. - * @param {string} pre_pow_hash - * @param {bigint} timestamp - * @param {number | undefined} [target_bits] - * @returns {PoW} - */ + * Can be used for parsing Stratum templates. + * @param {string} pre_pow_hash + * @param {bigint} timestamp + * @param {number | null} [target_bits] + * @returns {PoW} + */ static fromRaw(pre_pow_hash, timestamp, target_bits) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(pre_pow_hash, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(pre_pow_hash, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; - wasm.pow_fromRaw(retptr, ptr0, len0, timestamp, !isLikeNone(target_bits), isLikeNone(target_bits) ? 0 : target_bits); + wasm.pow_fromRaw(retptr, ptr0, len0, timestamp, isLikeNone(target_bits) ? 0x100000001 : (target_bits) >>> 0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); @@ -5776,12 +6310,12 @@ export class PoW { } const PrivateKeyFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_privatekey_free(ptr >>> 0, 1)); /** -* Data structure that envelops a Private Key. -* @category Wallet SDK -*/ + * Data structure that envelops a Private Key. + * @category Wallet SDK + */ export class PrivateKey { static __wrap(ptr) { @@ -5804,13 +6338,13 @@ export class PrivateKey { wasm.__wbg_privatekey_free(ptr, 0); } /** - * Create a new [`PrivateKey`] from a hex-encoded string. - * @param {string} key - */ + * Create a new [`PrivateKey`] from a hex-encoded string. + * @param {string} key + */ constructor(key) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.privatekey_try_new(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -5827,9 +6361,9 @@ export class PrivateKey { } } /** - * Returns the [`PrivateKey`] key encoded as a hex string. - * @returns {string} - */ + * Returns the [`PrivateKey`] key encoded as a hex string. + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -5843,13 +6377,13 @@ export class PrivateKey { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Generate a [`Keypair`] from this [`PrivateKey`]. - * @returns {Keypair} - */ + * Generate a [`Keypair`] from this [`PrivateKey`]. + * @returns {Keypair} + */ toKeypair() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5866,8 +6400,8 @@ export class PrivateKey { } } /** - * @returns {PublicKey} - */ + * @returns {PublicKey} + */ toPublicKey() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5884,13 +6418,13 @@ export class PrivateKey { } } /** - * Get the [`Address`] of the PublicKey generated from this PrivateKey. - * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) - * to determine the prefix of the address. - * JavaScript: `let address = privateKey.toAddress(NetworkType.MAINNET);`. - * @param {NetworkType | NetworkId | string} network - * @returns {Address} - */ + * Get the [`Address`] of the PublicKey generated from this PrivateKey. + * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) + * to determine the prefix of the address. + * JavaScript: `let address = privateKey.toAddress(NetworkType.MAINNET);`. + * @param {NetworkType | NetworkId | string} network + * @returns {Address} + */ toAddress(network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5908,13 +6442,13 @@ export class PrivateKey { } } /** - * Get `ECDSA` [`Address`] of the PublicKey generated from this PrivateKey. - * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) - * to determine the prefix of the address. - * JavaScript: `let address = privateKey.toAddress(NetworkType.MAINNET);`. - * @param {NetworkType | NetworkId | string} network - * @returns {Address} - */ + * Get `ECDSA` [`Address`] of the PublicKey generated from this PrivateKey. + * Receives a [`NetworkType`](kaspa_consensus_core::network::NetworkType) + * to determine the prefix of the address. + * JavaScript: `let address = privateKey.toAddress(NetworkType.MAINNET);`. + * @param {NetworkType | NetworkId | string} network + * @returns {Address} + */ toAddressECDSA(network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -5934,20 +6468,20 @@ export class PrivateKey { } const PrivateKeyGeneratorFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_privatekeygenerator_free(ptr >>> 0, 1)); /** -* -* Helper class to generate private keys from an extended private key (XPrv). -* This class accepts the master Kaspa XPrv string (e.g. `xprv1...`) and generates -* private keys for the receive and change paths given the pre-set parameters -* such as account index, multisig purpose and cosigner index. -* -* Please note that in Kaspa master private keys use `kprv` prefix. -* -* @see {@link PublicKeyGenerator}, {@link XPub}, {@link XPrv}, {@link Mnemonic} -* @category Wallet SDK -*/ + * + * Helper class to generate private keys from an extended private key (XPrv). + * This class accepts the master Kaspa XPrv string (e.g. `xprv1...`) and generates + * private keys for the receive and change paths given the pre-set parameters + * such as account index, multisig purpose and cosigner index. + * + * Please note that in Kaspa master private keys use `kprv` prefix. + * + * @see {@link PublicKeyGenerator}, {@link XPub}, {@link XPrv}, {@link Mnemonic} + * @category Wallet SDK + */ export class PrivateKeyGenerator { __destroy_into_raw() { @@ -5962,15 +6496,15 @@ export class PrivateKeyGenerator { wasm.__wbg_privatekeygenerator_free(ptr, 0); } /** - * @param {XPrv | string} xprv - * @param {boolean} is_multisig - * @param {bigint} account_index - * @param {number | undefined} [cosigner_index] - */ + * @param {XPrv | string} xprv + * @param {boolean} is_multisig + * @param {bigint} account_index + * @param {number | null} [cosigner_index] + */ constructor(xprv, is_multisig, account_index, cosigner_index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.privatekeygenerator_new(retptr, addBorrowedObject(xprv), is_multisig, account_index, !isLikeNone(cosigner_index), isLikeNone(cosigner_index) ? 0 : cosigner_index); + wasm.privatekeygenerator_new(retptr, addBorrowedObject(xprv), is_multisig, account_index, isLikeNone(cosigner_index) ? 0x100000001 : (cosigner_index) >>> 0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); @@ -5986,9 +6520,9 @@ export class PrivateKeyGenerator { } } /** - * @param {number} index - * @returns {PrivateKey} - */ + * @param {number} index + * @returns {PrivateKey} + */ receiveKey(index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6005,9 +6539,9 @@ export class PrivateKeyGenerator { } } /** - * @param {number} index - * @returns {PrivateKey} - */ + * @param {number} index + * @returns {PrivateKey} + */ changeKey(index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6026,10 +6560,9 @@ export class PrivateKeyGenerator { } const ProcessSendOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_processsendoptions_free(ptr >>> 0, 1)); -/** -*/ + export class ProcessSendOptions { __destroy_into_raw() { @@ -6044,8 +6577,8 @@ export class ProcessSendOptions { wasm.__wbg_processsendoptions_free(ptr, 0); } /** - * @param {boolean | undefined} [swallow_errors] - */ + * @param {boolean | null} [swallow_errors] + */ constructor(swallow_errors) { const ret = wasm.processsendoptions_new(isLikeNone(swallow_errors) ? 0xFFFFFF : swallow_errors ? 1 : 0); this.__wbg_ptr = ret >>> 0; @@ -6053,26 +6586,26 @@ export class ProcessSendOptions { return this; } /** - * @returns {boolean | undefined} - */ + * @returns {boolean | undefined} + */ get swallow_errors() { const ret = wasm.processsendoptions_swallow_errors(this.__wbg_ptr); return ret === 0xFFFFFF ? undefined : ret !== 0; } /** - * @param {boolean | undefined} [value] - */ + * @param {boolean | null} [value] + */ set swallow_errors(value) { wasm.processsendoptions_set_swallow_errors(this.__wbg_ptr, isLikeNone(value) ? 0xFFFFFF : value ? 1 : 0); } } const PrvKeyDataInfoFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_prvkeydatainfo_free(ptr >>> 0, 1)); /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class PrvKeyDataInfo { __destroy_into_raw() { @@ -6087,8 +6620,8 @@ export class PrvKeyDataInfo { wasm.__wbg_prvkeydatainfo_free(ptr, 0); } /** - * @returns {string} - */ + * @returns {string} + */ get id() { let deferred1_0; let deferred1_1; @@ -6102,30 +6635,30 @@ export class PrvKeyDataInfo { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {any} - */ + * @returns {any} + */ get name() { const ret = wasm.prvkeydatainfo_name(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {any} - */ + * @returns {any} + */ get isEncrypted() { const ret = wasm.prvkeydatainfo_isEncrypted(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string} _name - */ + * @param {string} _name + */ setName(_name) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(_name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(_name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.prvkeydatainfo_setName(retptr, this.__wbg_ptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -6140,13 +6673,13 @@ export class PrvKeyDataInfo { } const PublicKeyFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_publickey_free(ptr >>> 0, 1)); /** -* Data structure that envelopes a PublicKey. -* Only supports Schnorr-based addresses. -* @category Wallet SDK -*/ + * Data structure that envelopes a PublicKey. + * Only supports Schnorr-based addresses. + * @category Wallet SDK + */ export class PublicKey { static __wrap(ptr) { @@ -6169,13 +6702,13 @@ export class PublicKey { wasm.__wbg_publickey_free(ptr, 0); } /** - * Create a new [`PublicKey`] from a hex-encoded string. - * @param {string} key - */ + * Create a new [`PublicKey`] from a hex-encoded string. + * @param {string} key + */ constructor(key) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.publickey_try_new(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -6192,8 +6725,8 @@ export class PublicKey { } } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -6207,16 +6740,16 @@ export class PublicKey { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Get the [`Address`] of this PublicKey. - * Receives a [`NetworkType`] to determine the prefix of the address. - * JavaScript: `let address = publicKey.toAddress(NetworkType.MAINNET);`. - * @param {NetworkType | NetworkId | string} network - * @returns {Address} - */ + * Get the [`Address`] of this PublicKey. + * Receives a [`NetworkType`] to determine the prefix of the address. + * JavaScript: `let address = publicKey.toAddress(NetworkType.MAINNET);`. + * @param {NetworkType | NetworkId | string} network + * @returns {Address} + */ toAddress(network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6234,12 +6767,12 @@ export class PublicKey { } } /** - * Get `ECDSA` [`Address`] of this PublicKey. - * Receives a [`NetworkType`] to determine the prefix of the address. - * JavaScript: `let address = publicKey.toAddress(NetworkType.MAINNET);`. - * @param {NetworkType | NetworkId | string} network - * @returns {Address} - */ + * Get `ECDSA` [`Address`] of this PublicKey. + * Receives a [`NetworkType`] to determine the prefix of the address. + * JavaScript: `let address = publicKey.toAddress(NetworkType.MAINNET);`. + * @param {NetworkType | NetworkId | string} network + * @returns {Address} + */ toAddressECDSA(network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6257,17 +6790,17 @@ export class PublicKey { } } /** - * @returns {XOnlyPublicKey} - */ + * @returns {XOnlyPublicKey} + */ toXOnlyPublicKey() { const ret = wasm.publickey_toXOnlyPublicKey(this.__wbg_ptr); return XOnlyPublicKey.__wrap(ret); } /** - * Compute a 4-byte key fingerprint for this public key as a hex string. - * Default implementation uses `RIPEMD160(SHA256(public_key))`. - * @returns {HexString | undefined} - */ + * Compute a 4-byte key fingerprint for this public key as a hex string. + * Default implementation uses `RIPEMD160(SHA256(public_key))`. + * @returns {HexString | undefined} + */ fingerprint() { const ret = wasm.publickey_fingerprint(this.__wbg_ptr); return takeObject(ret); @@ -6275,18 +6808,18 @@ export class PublicKey { } const PublicKeyGeneratorFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_publickeygenerator_free(ptr >>> 0, 1)); /** -* -* Helper class to generate public keys from an extended public key (XPub) -* that has been derived up to the co-signer index. -* -* Please note that in Kaspa master public keys use `kpub` prefix. -* -* @see {@link PrivateKeyGenerator}, {@link XPub}, {@link XPrv}, {@link Mnemonic} -* @category Wallet SDK -*/ + * + * Helper class to generate public keys from an extended public key (XPub) + * that has been derived up to the co-signer index. + * + * Please note that in Kaspa master public keys use `kpub` prefix. + * + * @see {@link PrivateKeyGenerator}, {@link XPub}, {@link XPrv}, {@link Mnemonic} + * @category Wallet SDK + */ export class PublicKeyGenerator { static __wrap(ptr) { @@ -6309,14 +6842,14 @@ export class PublicKeyGenerator { wasm.__wbg_publickeygenerator_free(ptr, 0); } /** - * @param {XPub | string} kpub - * @param {number | undefined} [cosigner_index] - * @returns {PublicKeyGenerator} - */ + * @param {XPub | string} kpub + * @param {number | null} [cosigner_index] + * @returns {PublicKeyGenerator} + */ static fromXPub(kpub, cosigner_index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.publickeygenerator_fromXPub(retptr, addBorrowedObject(kpub), !isLikeNone(cosigner_index), isLikeNone(cosigner_index) ? 0 : cosigner_index); + wasm.publickeygenerator_fromXPub(retptr, addBorrowedObject(kpub), isLikeNone(cosigner_index) ? 0x100000001 : (cosigner_index) >>> 0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); @@ -6330,16 +6863,16 @@ export class PublicKeyGenerator { } } /** - * @param {XPrv | string} xprv - * @param {boolean} is_multisig - * @param {bigint} account_index - * @param {number | undefined} [cosigner_index] - * @returns {PublicKeyGenerator} - */ + * @param {XPrv | string} xprv + * @param {boolean} is_multisig + * @param {bigint} account_index + * @param {number | null} [cosigner_index] + * @returns {PublicKeyGenerator} + */ static fromMasterXPrv(xprv, is_multisig, account_index, cosigner_index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.publickeygenerator_fromMasterXPrv(retptr, addBorrowedObject(xprv), is_multisig, account_index, !isLikeNone(cosigner_index), isLikeNone(cosigner_index) ? 0 : cosigner_index); + wasm.publickeygenerator_fromMasterXPrv(retptr, addBorrowedObject(xprv), is_multisig, account_index, isLikeNone(cosigner_index) ? 0x100000001 : (cosigner_index) >>> 0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); @@ -6353,11 +6886,11 @@ export class PublicKeyGenerator { } } /** - * Generate Receive Public Key derivations for a given range. - * @param {number} start - * @param {number} end - * @returns {(PublicKey | string)[]} - */ + * Generate Receive Public Key derivations for a given range. + * @param {number} start + * @param {number} end + * @returns {(PublicKey | string)[]} + */ receivePubkeys(start, end) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6374,10 +6907,10 @@ export class PublicKeyGenerator { } } /** - * Generate a single Receive Public Key derivation at a given index. - * @param {number} index - * @returns {PublicKey} - */ + * Generate a single Receive Public Key derivation at a given index. + * @param {number} index + * @returns {PublicKey} + */ receivePubkey(index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6394,11 +6927,11 @@ export class PublicKeyGenerator { } } /** - * Generate a range of Receive Public Key derivations and return them as strings. - * @param {number} start - * @param {number} end - * @returns {Array} - */ + * Generate a range of Receive Public Key derivations and return them as strings. + * @param {number} start + * @param {number} end + * @returns {Array} + */ receivePubkeysAsStrings(start, end) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6415,10 +6948,10 @@ export class PublicKeyGenerator { } } /** - * Generate a single Receive Public Key derivation at a given index and return it as a string. - * @param {number} index - * @returns {string} - */ + * Generate a single Receive Public Key derivation at a given index and return it as a string. + * @param {number} index + * @returns {string} + */ receivePubkeyAsString(index) { let deferred2_0; let deferred2_1; @@ -6440,16 +6973,16 @@ export class PublicKeyGenerator { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * Generate Receive Address derivations for a given range. - * @param {NetworkType | NetworkId | string} networkType - * @param {number} start - * @param {number} end - * @returns {Address[]} - */ + * Generate Receive Address derivations for a given range. + * @param {NetworkType | NetworkId | string} networkType + * @param {number} start + * @param {number} end + * @returns {Address[]} + */ receiveAddresses(networkType, start, end) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6467,11 +7000,11 @@ export class PublicKeyGenerator { } } /** - * Generate a single Receive Address derivation at a given index. - * @param {NetworkType | NetworkId | string} networkType - * @param {number} index - * @returns {Address} - */ + * Generate a single Receive Address derivation at a given index. + * @param {NetworkType | NetworkId | string} networkType + * @param {number} index + * @returns {Address} + */ receiveAddress(networkType, index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6489,12 +7022,12 @@ export class PublicKeyGenerator { } } /** - * Generate a range of Receive Address derivations and return them as strings. - * @param {NetworkType | NetworkId | string} networkType - * @param {number} start - * @param {number} end - * @returns {Array} - */ + * Generate a range of Receive Address derivations and return them as strings. + * @param {NetworkType | NetworkId | string} networkType + * @param {number} start + * @param {number} end + * @returns {Array} + */ receiveAddressAsStrings(networkType, start, end) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6512,11 +7045,11 @@ export class PublicKeyGenerator { } } /** - * Generate a single Receive Address derivation at a given index and return it as a string. - * @param {NetworkType | NetworkId | string} networkType - * @param {number} index - * @returns {string} - */ + * Generate a single Receive Address derivation at a given index and return it as a string. + * @param {NetworkType | NetworkId | string} networkType + * @param {number} index + * @returns {string} + */ receiveAddressAsString(networkType, index) { let deferred2_0; let deferred2_1; @@ -6539,15 +7072,15 @@ export class PublicKeyGenerator { } finally { wasm.__wbindgen_add_to_stack_pointer(16); heap[stack_pointer++] = undefined; - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * Generate Change Public Key derivations for a given range. - * @param {number} start - * @param {number} end - * @returns {(PublicKey | string)[]} - */ + * Generate Change Public Key derivations for a given range. + * @param {number} start + * @param {number} end + * @returns {(PublicKey | string)[]} + */ changePubkeys(start, end) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6564,10 +7097,10 @@ export class PublicKeyGenerator { } } /** - * Generate a single Change Public Key derivation at a given index. - * @param {number} index - * @returns {PublicKey} - */ + * Generate a single Change Public Key derivation at a given index. + * @param {number} index + * @returns {PublicKey} + */ changePubkey(index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6584,11 +7117,11 @@ export class PublicKeyGenerator { } } /** - * Generate a range of Change Public Key derivations and return them as strings. - * @param {number} start - * @param {number} end - * @returns {Array} - */ + * Generate a range of Change Public Key derivations and return them as strings. + * @param {number} start + * @param {number} end + * @returns {Array} + */ changePubkeysAsStrings(start, end) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6605,10 +7138,10 @@ export class PublicKeyGenerator { } } /** - * Generate a single Change Public Key derivation at a given index and return it as a string. - * @param {number} index - * @returns {string} - */ + * Generate a single Change Public Key derivation at a given index and return it as a string. + * @param {number} index + * @returns {string} + */ changePubkeyAsString(index) { let deferred2_0; let deferred2_1; @@ -6630,16 +7163,16 @@ export class PublicKeyGenerator { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * Generate Change Address derivations for a given range. - * @param {NetworkType | NetworkId | string} networkType - * @param {number} start - * @param {number} end - * @returns {Address[]} - */ + * Generate Change Address derivations for a given range. + * @param {NetworkType | NetworkId | string} networkType + * @param {number} start + * @param {number} end + * @returns {Address[]} + */ changeAddresses(networkType, start, end) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6657,11 +7190,11 @@ export class PublicKeyGenerator { } } /** - * Generate a single Change Address derivation at a given index. - * @param {NetworkType | NetworkId | string} networkType - * @param {number} index - * @returns {Address} - */ + * Generate a single Change Address derivation at a given index. + * @param {NetworkType | NetworkId | string} networkType + * @param {number} index + * @returns {Address} + */ changeAddress(networkType, index) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6679,12 +7212,12 @@ export class PublicKeyGenerator { } } /** - * Generate a range of Change Address derivations and return them as strings. - * @param {NetworkType | NetworkId | string} networkType - * @param {number} start - * @param {number} end - * @returns {Array} - */ + * Generate a range of Change Address derivations and return them as strings. + * @param {NetworkType | NetworkId | string} networkType + * @param {number} start + * @param {number} end + * @returns {Array} + */ changeAddressAsStrings(networkType, start, end) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -6702,11 +7235,11 @@ export class PublicKeyGenerator { } } /** - * Generate a single Change Address derivation at a given index and return it as a string. - * @param {NetworkType | NetworkId | string} networkType - * @param {number} index - * @returns {string} - */ + * Generate a single Change Address derivation at a given index and return it as a string. + * @param {NetworkType | NetworkId | string} networkType + * @param {number} index + * @returns {string} + */ changeAddressAsString(networkType, index) { let deferred2_0; let deferred2_1; @@ -6729,12 +7262,12 @@ export class PublicKeyGenerator { } finally { wasm.__wbindgen_add_to_stack_pointer(16); heap[stack_pointer++] = undefined; - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred2_0; let deferred2_1; @@ -6756,13 +7289,13 @@ export class PublicKeyGenerator { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } } const ReadStreamFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_readstream_free(ptr >>> 0, 1)); export class ReadStream { @@ -6779,9 +7312,9 @@ export class ReadStream { wasm.__wbg_readstream_free(ptr, 0); } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ add_listener_with_open(listener) { try { const ret = wasm.readstream_add_listener_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6791,9 +7324,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ add_listener_with_close(listener) { try { const ret = wasm.readstream_add_listener_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6803,9 +7336,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ on_with_open(listener) { try { const ret = wasm.readstream_on_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6815,9 +7348,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ on_with_close(listener) { try { const ret = wasm.readstream_on_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6827,9 +7360,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ once_with_open(listener) { try { const ret = wasm.readstream_once_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6839,9 +7372,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ once_with_close(listener) { try { const ret = wasm.readstream_once_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6851,9 +7384,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ prepend_listener_with_open(listener) { try { const ret = wasm.readstream_prepend_listener_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6863,9 +7396,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ prepend_listener_with_close(listener) { try { const ret = wasm.readstream_prepend_listener_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6875,9 +7408,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ prepend_once_listener_with_open(listener) { try { const ret = wasm.readstream_prepend_once_listener_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6887,9 +7420,9 @@ export class ReadStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ prepend_once_listener_with_close(listener) { try { const ret = wasm.readstream_prepend_once_listener_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -6901,36 +7434,36 @@ export class ReadStream { } const ResolverFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_resolver_free(ptr >>> 0, 1)); /** -* -* Resolver is a client for obtaining public Kaspa wRPC URL. -* -* Resolver queries a list of public Kaspa Resolver URLs using HTTP to fetch -* wRPC endpoints for the given encoding, network identifier and other -* parameters. It then provides this information to the {@link RpcClient}. -* -* Each time {@link RpcClient} disconnects, it will query the resolver -* to fetch a new wRPC URL. -* -* ```javascript -* // using integrated public URLs -* let rpc = RpcClient({ -* resolver: new Resolver(), -* networkId : "mainnet" -* }); -* -* // specifying custom resolver URLs -* let rpc = RpcClient({ -* resolver: new Resolver({urls: ["",...]}), -* networkId : "mainnet" -* }); -* ``` -* -* @see {@link IResolverConfig}, {@link IResolverConnect}, {@link RpcClient} -* @category Node RPC -*/ + * + * Resolver is a client for obtaining public Kaspa wRPC URL. + * + * Resolver queries a list of public Kaspa Resolver URLs using HTTP to fetch + * wRPC endpoints for the given encoding, network identifier and other + * parameters. It then provides this information to the {@link RpcClient}. + * + * Each time {@link RpcClient} disconnects, it will query the resolver + * to fetch a new wRPC URL. + * + * ```javascript + * // using integrated public URLs + * let rpc = RpcClient({ + * resolver: new Resolver(), + * networkId : "mainnet" + * }); + * + * // specifying custom resolver URLs + * let rpc = RpcClient({ + * resolver: new Resolver({urls: ["",...]}), + * networkId : "mainnet" + * }); + * ``` + * + * @see {@link IResolverConfig}, {@link IResolverConnect}, {@link RpcClient} + * @category Node RPC + */ export class Resolver { static __wrap(ptr) { @@ -6963,54 +7496,54 @@ export class Resolver { wasm.__wbg_resolver_free(ptr, 0); } /** - * List of public Kaspa Resolver URLs. - * @returns {string[] | undefined} - */ + * List of public Kaspa Resolver URLs. + * @returns {string[] | undefined} + */ get urls() { const ret = wasm.resolver_urls(this.__wbg_ptr); return takeObject(ret); } /** - * Fetches a public Kaspa wRPC endpoint for the given encoding and network identifier. - * @see {@link Encoding}, {@link NetworkId}, {@link Node} - * @param {Encoding} encoding - * @param {NetworkId | string} network_id - * @returns {Promise} - */ + * Fetches a public Kaspa wRPC endpoint for the given encoding and network identifier. + * @see {@link Encoding}, {@link NetworkId}, {@link Node} + * @param {Encoding} encoding + * @param {NetworkId | string} network_id + * @returns {Promise} + */ getNode(encoding, network_id) { const ret = wasm.resolver_getNode(this.__wbg_ptr, encoding, addHeapObject(network_id)); return takeObject(ret); } /** - * Fetches a public Kaspa wRPC endpoint URL for the given encoding and network identifier. - * @see {@link Encoding}, {@link NetworkId} - * @param {Encoding} encoding - * @param {NetworkId | string} network_id - * @returns {Promise} - */ + * Fetches a public Kaspa wRPC endpoint URL for the given encoding and network identifier. + * @see {@link Encoding}, {@link NetworkId} + * @param {Encoding} encoding + * @param {NetworkId | string} network_id + * @returns {Promise} + */ getUrl(encoding, network_id) { const ret = wasm.resolver_getUrl(this.__wbg_ptr, encoding, addHeapObject(network_id)); return takeObject(ret); } /** - * Connect to a public Kaspa wRPC endpoint for the given encoding and network identifier - * supplied via {@link IResolverConnect} interface. - * @see {@link IResolverConnect}, {@link RpcClient} - * @param {IResolverConnect | NetworkId | string} options - * @returns {Promise} - */ + * Connect to a public Kaspa wRPC endpoint for the given encoding and network identifier + * supplied via {@link IResolverConnect} interface. + * @see {@link IResolverConnect}, {@link RpcClient} + * @param {IResolverConnect | NetworkId | string} options + * @returns {Promise} + */ connect(options) { const ret = wasm.resolver_connect(this.__wbg_ptr, addHeapObject(options)); return takeObject(ret); } /** - * Creates a new Resolver client with the given - * configuration supplied as {@link IResolverConfig} - * interface. If not supplied, the default configuration - * containing a list of community-operated resolvers - * will be used. - * @param {IResolverConfig | string[] | undefined} [args] - */ + * Creates a new Resolver client with the given + * configuration supplied as {@link IResolverConfig} + * interface. If not supplied, the default configuration + * containing a list of community-operated resolvers + * will be used. + * @param {IResolverConfig | string[] | null} [args] + */ constructor(args) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -7031,94 +7564,94 @@ export class Resolver { } const RpcClientFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_rpcclient_free(ptr >>> 0, 1)); /** -* -* -* Kaspa RPC client uses ([wRPC](https://github.com/workflow-rs/workflow-rs/tree/master/rpc)) -* interface to connect directly with Kaspa Node. wRPC supports -* two types of encodings: `borsh` (binary, default) and `json`. -* -* There are two ways to connect: Directly to any Kaspa Node or to a -* community-maintained public node infrastructure using the {@link Resolver} class. -* -* **Connecting to a public node using a resolver** -* -* ```javascript -* let rpc = new RpcClient({ -* resolver : new Resolver(), -* networkId : "mainnet", -* }); -* -* await rpc.connect(); -* ``` -* -* **Connecting to a Kaspa Node directly** -* -* ```javascript -* let rpc = new RpcClient({ -* // if port is not provided it will default -* // to the default port for the networkId -* url : "127.0.0.1", -* networkId : "mainnet", -* }); -* ``` -* -* **Example usage** -* -* ```javascript -* -* // Create a new RPC client with a URL -* let rpc = new RpcClient({ url : "wss://" }); -* -* // Create a new RPC client with a resolver -* // (networkId is required when using a resolver) -* let rpc = new RpcClient({ -* resolver : new Resolver(), -* networkId : "mainnet", -* }); -* -* rpc.addEventListener("connect", async (event) => { -* console.log("Connected to", rpc.url); -* await rpc.subscribeDaaScore(); -* }); -* -* rpc.addEventListener("disconnect", (event) => { -* console.log("Disconnected from", rpc.url); -* }); -* -* try { -* await rpc.connect(); -* } catch(err) { -* console.log("Error connecting:", err); -* } -* -* ``` -* -* You can register event listeners to receive notifications from the RPC client -* using {@link RpcClient.addEventListener} and {@link RpcClient.removeEventListener} functions. -* -* **IMPORTANT:** If RPC is disconnected, upon reconnection you do not need -* to re-register event listeners, but your have to re-subscribe for Kaspa node -* notifications: -* -* ```typescript -* rpc.addEventListener("connect", async (event) => { -* console.log("Connected to", rpc.url); -* // re-subscribe each time we connect -* await rpc.subscribeDaaScore(); -* // ... perform wallet address subscriptions -* }); -* -* ``` -* -* If using NodeJS, it is important that {@link RpcClient.disconnect} is called before -* the process exits to ensure that the WebSocket connection is properly closed. -* Failure to do this will prevent the process from exiting. -* -* @category Node RPC -*/ + * + * + * Kaspa RPC client uses ([wRPC](https://github.com/workflow-rs/workflow-rs/tree/master/rpc)) + * interface to connect directly with Kaspa Node. wRPC supports + * two types of encodings: `borsh` (binary, default) and `json`. + * + * There are two ways to connect: Directly to any Kaspa Node or to a + * community-maintained public node infrastructure using the {@link Resolver} class. + * + * **Connecting to a public node using a resolver** + * + * ```javascript + * let rpc = new RpcClient({ + * resolver : new Resolver(), + * networkId : "mainnet", + * }); + * + * await rpc.connect(); + * ``` + * + * **Connecting to a Kaspa Node directly** + * + * ```javascript + * let rpc = new RpcClient({ + * // if port is not provided it will default + * // to the default port for the networkId + * url : "127.0.0.1", + * networkId : "mainnet", + * }); + * ``` + * + * **Example usage** + * + * ```javascript + * + * // Create a new RPC client with a URL + * let rpc = new RpcClient({ url : "wss://" }); + * + * // Create a new RPC client with a resolver + * // (networkId is required when using a resolver) + * let rpc = new RpcClient({ + * resolver : new Resolver(), + * networkId : "mainnet", + * }); + * + * rpc.addEventListener("connect", async (event) => { + * console.log("Connected to", rpc.url); + * await rpc.subscribeDaaScore(); + * }); + * + * rpc.addEventListener("disconnect", (event) => { + * console.log("Disconnected from", rpc.url); + * }); + * + * try { + * await rpc.connect(); + * } catch(err) { + * console.log("Error connecting:", err); + * } + * + * ``` + * + * You can register event listeners to receive notifications from the RPC client + * using {@link RpcClient.addEventListener} and {@link RpcClient.removeEventListener} functions. + * + * **IMPORTANT:** If RPC is disconnected, upon reconnection you do not need + * to re-register event listeners, but your have to re-subscribe for Kaspa node + * notifications: + * + * ```typescript + * rpc.addEventListener("connect", async (event) => { + * console.log("Connected to", rpc.url); + * // re-subscribe each time we connect + * await rpc.subscribeDaaScore(); + * // ... perform wallet address subscriptions + * }); + * + * ``` + * + * If using NodeJS, it is important that {@link RpcClient.disconnect} is called before + * the process exits to ensure that the WebSocket connection is properly closed. + * Failure to do this will prevent the process from exiting. + * + * @category Node RPC + */ export class RpcClient { static __wrap(ptr) { @@ -7155,661 +7688,661 @@ export class RpcClient { wasm.__wbg_rpcclient_free(ptr, 0); } /** - * Retrieves the current number of blocks in the Kaspa BlockDAG. - * This is not a block count, not a "block height" and can not be - * used for transaction validation. - * Returned information: Current block count. - *@see {@link IGetBlockCountRequest}, {@link IGetBlockCountResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetBlockCountRequest | undefined} [request] - * @returns {Promise} - */ + * Retrieves the current number of blocks in the Kaspa BlockDAG. + * This is not a block count, not a "block height" and can not be + * used for transaction validation. + * Returned information: Current block count. + * @see {@link IGetBlockCountRequest}, {@link IGetBlockCountResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetBlockCountRequest | null} [request] + * @returns {Promise} + */ getBlockCount(request) { const ret = wasm.rpcclient_getBlockCount(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Provides information about the Directed Acyclic Graph (DAG) - * structure of the Kaspa BlockDAG. - * Returned information: Number of blocks in the DAG, - * number of tips in the DAG, hash of the selected parent block, - * difficulty of the selected parent block, selected parent block - * blue score, selected parent block time. - *@see {@link IGetBlockDagInfoRequest}, {@link IGetBlockDagInfoResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetBlockDagInfoRequest | undefined} [request] - * @returns {Promise} - */ + * Provides information about the Directed Acyclic Graph (DAG) + * structure of the Kaspa BlockDAG. + * Returned information: Number of blocks in the DAG, + * number of tips in the DAG, hash of the selected parent block, + * difficulty of the selected parent block, selected parent block + * blue score, selected parent block time. + * @see {@link IGetBlockDagInfoRequest}, {@link IGetBlockDagInfoResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetBlockDagInfoRequest | null} [request] + * @returns {Promise} + */ getBlockDagInfo(request) { const ret = wasm.rpcclient_getBlockDagInfo(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Returns the total current coin supply of Kaspa network. - * Returned information: Total coin supply. - *@see {@link IGetCoinSupplyRequest}, {@link IGetCoinSupplyResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetCoinSupplyRequest | undefined} [request] - * @returns {Promise} - */ + * Returns the total current coin supply of Kaspa network. + * Returned information: Total coin supply. + * @see {@link IGetCoinSupplyRequest}, {@link IGetCoinSupplyResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetCoinSupplyRequest | null} [request] + * @returns {Promise} + */ getCoinSupply(request) { const ret = wasm.rpcclient_getCoinSupply(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Retrieves information about the peers connected to the Kaspa node. - * Returned information: Peer ID, IP address and port, connection - * status, protocol version. - *@see {@link IGetConnectedPeerInfoRequest}, {@link IGetConnectedPeerInfoResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetConnectedPeerInfoRequest | undefined} [request] - * @returns {Promise} - */ + * Retrieves information about the peers connected to the Kaspa node. + * Returned information: Peer ID, IP address and port, connection + * status, protocol version. + * @see {@link IGetConnectedPeerInfoRequest}, {@link IGetConnectedPeerInfoResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetConnectedPeerInfoRequest | null} [request] + * @returns {Promise} + */ getConnectedPeerInfo(request) { const ret = wasm.rpcclient_getConnectedPeerInfo(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Retrieves general information about the Kaspa node. - * Returned information: Version of the Kaspa node, protocol - * version, network identifier. - * This call is primarily used by gRPC clients. - * For wRPC clients, use {@link RpcClient.getServerInfo}. - *@see {@link IGetInfoRequest}, {@link IGetInfoResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetInfoRequest | undefined} [request] - * @returns {Promise} - */ + * Retrieves general information about the Kaspa node. + * Returned information: Version of the Kaspa node, protocol + * version, network identifier. + * This call is primarily used by gRPC clients. + * For wRPC clients, use {@link RpcClient.getServerInfo}. + * @see {@link IGetInfoRequest}, {@link IGetInfoResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetInfoRequest | null} [request] + * @returns {Promise} + */ getInfo(request) { const ret = wasm.rpcclient_getInfo(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Provides a list of addresses of known peers in the Kaspa - * network that the node can potentially connect to. - * Returned information: List of peer addresses. - *@see {@link IGetPeerAddressesRequest}, {@link IGetPeerAddressesResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetPeerAddressesRequest | undefined} [request] - * @returns {Promise} - */ + * Provides a list of addresses of known peers in the Kaspa + * network that the node can potentially connect to. + * Returned information: List of peer addresses. + * @see {@link IGetPeerAddressesRequest}, {@link IGetPeerAddressesResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetPeerAddressesRequest | null} [request] + * @returns {Promise} + */ getPeerAddresses(request) { const ret = wasm.rpcclient_getPeerAddresses(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Retrieves various metrics and statistics related to the - * performance and status of the Kaspa node. - * Returned information: Memory usage, CPU usage, network activity. - *@see {@link IGetMetricsRequest}, {@link IGetMetricsResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetMetricsRequest | undefined} [request] - * @returns {Promise} - */ + * Retrieves various metrics and statistics related to the + * performance and status of the Kaspa node. + * Returned information: Memory usage, CPU usage, network activity. + * @see {@link IGetMetricsRequest}, {@link IGetMetricsResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetMetricsRequest | null} [request] + * @returns {Promise} + */ getMetrics(request) { const ret = wasm.rpcclient_getMetrics(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Retrieves current number of network connections - *@see {@link IGetConnectionsRequest}, {@link IGetConnectionsResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetConnectionsRequest | undefined} [request] - * @returns {Promise} - */ + * Retrieves current number of network connections + * @see {@link IGetConnectionsRequest}, {@link IGetConnectionsResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetConnectionsRequest | null} [request] + * @returns {Promise} + */ getConnections(request) { const ret = wasm.rpcclient_getConnections(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Retrieves the current sink block, which is the block with - * the highest cumulative difficulty in the Kaspa BlockDAG. - * Returned information: Sink block hash, sink block height. - *@see {@link IGetSinkRequest}, {@link IGetSinkResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetSinkRequest | undefined} [request] - * @returns {Promise} - */ + * Retrieves the current sink block, which is the block with + * the highest cumulative difficulty in the Kaspa BlockDAG. + * Returned information: Sink block hash, sink block height. + * @see {@link IGetSinkRequest}, {@link IGetSinkResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetSinkRequest | null} [request] + * @returns {Promise} + */ getSink(request) { const ret = wasm.rpcclient_getSink(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Returns the blue score of the current sink block, indicating - * the total amount of work that has been done on the main chain - * leading up to that block. - * Returned information: Blue score of the sink block. - *@see {@link IGetSinkBlueScoreRequest}, {@link IGetSinkBlueScoreResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetSinkBlueScoreRequest | undefined} [request] - * @returns {Promise} - */ + * Returns the blue score of the current sink block, indicating + * the total amount of work that has been done on the main chain + * leading up to that block. + * Returned information: Blue score of the sink block. + * @see {@link IGetSinkBlueScoreRequest}, {@link IGetSinkBlueScoreResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetSinkBlueScoreRequest | null} [request] + * @returns {Promise} + */ getSinkBlueScore(request) { const ret = wasm.rpcclient_getSinkBlueScore(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Tests the connection and responsiveness of a Kaspa node. - * Returned information: None. - *@see {@link IPingRequest}, {@link IPingResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IPingRequest | undefined} [request] - * @returns {Promise} - */ + * Tests the connection and responsiveness of a Kaspa node. + * Returned information: None. + * @see {@link IPingRequest}, {@link IPingResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IPingRequest | null} [request] + * @returns {Promise} + */ ping(request) { const ret = wasm.rpcclient_ping(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Gracefully shuts down the Kaspa node. - * Returned information: None. - *@see {@link IShutdownRequest}, {@link IShutdownResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IShutdownRequest | undefined} [request] - * @returns {Promise} - */ + * Gracefully shuts down the Kaspa node. + * Returned information: None. + * @see {@link IShutdownRequest}, {@link IShutdownResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IShutdownRequest | null} [request] + * @returns {Promise} + */ shutdown(request) { const ret = wasm.rpcclient_shutdown(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Retrieves information about the Kaspa server. - * Returned information: Version of the Kaspa server, protocol - * version, network identifier. - *@see {@link IGetServerInfoRequest}, {@link IGetServerInfoResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetServerInfoRequest | undefined} [request] - * @returns {Promise} - */ + * Retrieves information about the Kaspa server. + * Returned information: Version of the Kaspa server, protocol + * version, network identifier. + * @see {@link IGetServerInfoRequest}, {@link IGetServerInfoResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetServerInfoRequest | null} [request] + * @returns {Promise} + */ getServerInfo(request) { const ret = wasm.rpcclient_getServerInfo(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Obtains basic information about the synchronization status of the Kaspa node. - * Returned information: Syncing status. - *@see {@link IGetSyncStatusRequest}, {@link IGetSyncStatusResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetSyncStatusRequest | undefined} [request] - * @returns {Promise} - */ + * Obtains basic information about the synchronization status of the Kaspa node. + * Returned information: Syncing status. + * @see {@link IGetSyncStatusRequest}, {@link IGetSyncStatusResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetSyncStatusRequest | null} [request] + * @returns {Promise} + */ getSyncStatus(request) { const ret = wasm.rpcclient_getSyncStatus(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Feerate estimates - *@see {@link IGetFeeEstimateRequest}, {@link IGetFeeEstimateResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetFeeEstimateRequest | undefined} [request] - * @returns {Promise} - */ + * Feerate estimates + * @see {@link IGetFeeEstimateRequest}, {@link IGetFeeEstimateResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetFeeEstimateRequest | null} [request] + * @returns {Promise} + */ getFeeEstimate(request) { const ret = wasm.rpcclient_getFeeEstimate(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Retrieves the current network configuration. - * Returned information: Current network configuration. - *@see {@link IGetCurrentNetworkRequest}, {@link IGetCurrentNetworkResponse} - *@throws `string` on an RPC error or a server-side error. - * @param {IGetCurrentNetworkRequest | undefined} [request] - * @returns {Promise} - */ + * Retrieves the current network configuration. + * Returned information: Current network configuration. + * @see {@link IGetCurrentNetworkRequest}, {@link IGetCurrentNetworkResponse} + * @throws `string` on an RPC error or a server-side error. + * @param {IGetCurrentNetworkRequest | null} [request] + * @returns {Promise} + */ getCurrentNetwork(request) { const ret = wasm.rpcclient_getCurrentNetwork(this.__wbg_ptr, isLikeNone(request) ? 0 : addHeapObject(request)); return takeObject(ret); } /** - * Adds a peer to the Kaspa node's list of known peers. - * Returned information: None. - *@see {@link IAddPeerRequest}, {@link IAddPeerResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IAddPeerRequest} request - * @returns {Promise} - */ + * Adds a peer to the Kaspa node's list of known peers. + * Returned information: None. + * @see {@link IAddPeerRequest}, {@link IAddPeerResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IAddPeerRequest} request + * @returns {Promise} + */ addPeer(request) { const ret = wasm.rpcclient_addPeer(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Bans a peer from connecting to the Kaspa node for a specified duration. - * Returned information: None. - *@see {@link IBanRequest}, {@link IBanResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IBanRequest} request - * @returns {Promise} - */ + * Bans a peer from connecting to the Kaspa node for a specified duration. + * Returned information: None. + * @see {@link IBanRequest}, {@link IBanResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IBanRequest} request + * @returns {Promise} + */ ban(request) { const ret = wasm.rpcclient_ban(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Estimates the network's current hash rate in hashes per second. - * Returned information: Estimated network hashes per second. - *@see {@link IEstimateNetworkHashesPerSecondRequest}, {@link IEstimateNetworkHashesPerSecondResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IEstimateNetworkHashesPerSecondRequest} request - * @returns {Promise} - */ + * Estimates the network's current hash rate in hashes per second. + * Returned information: Estimated network hashes per second. + * @see {@link IEstimateNetworkHashesPerSecondRequest}, {@link IEstimateNetworkHashesPerSecondResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IEstimateNetworkHashesPerSecondRequest} request + * @returns {Promise} + */ estimateNetworkHashesPerSecond(request) { const ret = wasm.rpcclient_estimateNetworkHashesPerSecond(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves the balance of a specific address in the Kaspa BlockDAG. - * Returned information: Balance of the address. - *@see {@link IGetBalanceByAddressRequest}, {@link IGetBalanceByAddressResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetBalanceByAddressRequest} request - * @returns {Promise} - */ + * Retrieves the balance of a specific address in the Kaspa BlockDAG. + * Returned information: Balance of the address. + * @see {@link IGetBalanceByAddressRequest}, {@link IGetBalanceByAddressResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetBalanceByAddressRequest} request + * @returns {Promise} + */ getBalanceByAddress(request) { const ret = wasm.rpcclient_getBalanceByAddress(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves balances for multiple addresses in the Kaspa BlockDAG. - * Returned information: Balances of the addresses. - *@see {@link IGetBalancesByAddressesRequest}, {@link IGetBalancesByAddressesResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetBalancesByAddressesRequest | Address[] | string[]} request - * @returns {Promise} - */ + * Retrieves balances for multiple addresses in the Kaspa BlockDAG. + * Returned information: Balances of the addresses. + * @see {@link IGetBalancesByAddressesRequest}, {@link IGetBalancesByAddressesResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetBalancesByAddressesRequest | Address[] | string[]} request + * @returns {Promise} + */ getBalancesByAddresses(request) { const ret = wasm.rpcclient_getBalancesByAddresses(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves a specific block from the Kaspa BlockDAG. - * Returned information: Block information. - *@see {@link IGetBlockRequest}, {@link IGetBlockResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetBlockRequest} request - * @returns {Promise} - */ + * Retrieves a specific block from the Kaspa BlockDAG. + * Returned information: Block information. + * @see {@link IGetBlockRequest}, {@link IGetBlockResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetBlockRequest} request + * @returns {Promise} + */ getBlock(request) { const ret = wasm.rpcclient_getBlock(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves multiple blocks from the Kaspa BlockDAG. - * Returned information: List of block information. - *@see {@link IGetBlocksRequest}, {@link IGetBlocksResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetBlocksRequest} request - * @returns {Promise} - */ + * Retrieves multiple blocks from the Kaspa BlockDAG. + * Returned information: List of block information. + * @see {@link IGetBlocksRequest}, {@link IGetBlocksResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetBlocksRequest} request + * @returns {Promise} + */ getBlocks(request) { const ret = wasm.rpcclient_getBlocks(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Generates a new block template for mining. - * Returned information: Block template information. - *@see {@link IGetBlockTemplateRequest}, {@link IGetBlockTemplateResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetBlockTemplateRequest} request - * @returns {Promise} - */ + * Generates a new block template for mining. + * Returned information: Block template information. + * @see {@link IGetBlockTemplateRequest}, {@link IGetBlockTemplateResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetBlockTemplateRequest} request + * @returns {Promise} + */ getBlockTemplate(request) { const ret = wasm.rpcclient_getBlockTemplate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Checks if block is blue or not. - * Returned information: Block blueness. - *@see {@link IGetCurrentBlockColorRequest}, {@link IGetCurrentBlockColorResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetCurrentBlockColorRequest} request - * @returns {Promise} - */ + * Checks if block is blue or not. + * Returned information: Block blueness. + * @see {@link IGetCurrentBlockColorRequest}, {@link IGetCurrentBlockColorResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetCurrentBlockColorRequest} request + * @returns {Promise} + */ getCurrentBlockColor(request) { const ret = wasm.rpcclient_getCurrentBlockColor(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves the estimated DAA (Difficulty Adjustment Algorithm) - * score timestamp estimate. - * Returned information: DAA score timestamp estimate. - *@see {@link IGetDaaScoreTimestampEstimateRequest}, {@link IGetDaaScoreTimestampEstimateResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetDaaScoreTimestampEstimateRequest} request - * @returns {Promise} - */ + * Retrieves the estimated DAA (Difficulty Adjustment Algorithm) + * score timestamp estimate. + * Returned information: DAA score timestamp estimate. + * @see {@link IGetDaaScoreTimestampEstimateRequest}, {@link IGetDaaScoreTimestampEstimateResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetDaaScoreTimestampEstimateRequest} request + * @returns {Promise} + */ getDaaScoreTimestampEstimate(request) { const ret = wasm.rpcclient_getDaaScoreTimestampEstimate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Feerate estimates (experimental) - *@see {@link IGetFeeEstimateExperimentalRequest}, {@link IGetFeeEstimateExperimentalResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetFeeEstimateExperimentalRequest} request - * @returns {Promise} - */ + * Feerate estimates (experimental) + * @see {@link IGetFeeEstimateExperimentalRequest}, {@link IGetFeeEstimateExperimentalResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetFeeEstimateExperimentalRequest} request + * @returns {Promise} + */ getFeeEstimateExperimental(request) { const ret = wasm.rpcclient_getFeeEstimateExperimental(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves block headers from the Kaspa BlockDAG. - * Returned information: List of block headers. - *@see {@link IGetHeadersRequest}, {@link IGetHeadersResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetHeadersRequest} request - * @returns {Promise} - */ + * Retrieves block headers from the Kaspa BlockDAG. + * Returned information: List of block headers. + * @see {@link IGetHeadersRequest}, {@link IGetHeadersResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetHeadersRequest} request + * @returns {Promise} + */ getHeaders(request) { const ret = wasm.rpcclient_getHeaders(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves mempool entries from the Kaspa node's mempool. - * Returned information: List of mempool entries. - *@see {@link IGetMempoolEntriesRequest}, {@link IGetMempoolEntriesResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetMempoolEntriesRequest} request - * @returns {Promise} - */ + * Retrieves mempool entries from the Kaspa node's mempool. + * Returned information: List of mempool entries. + * @see {@link IGetMempoolEntriesRequest}, {@link IGetMempoolEntriesResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetMempoolEntriesRequest} request + * @returns {Promise} + */ getMempoolEntries(request) { const ret = wasm.rpcclient_getMempoolEntries(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves mempool entries associated with specific addresses. - * Returned information: List of mempool entries. - *@see {@link IGetMempoolEntriesByAddressesRequest}, {@link IGetMempoolEntriesByAddressesResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetMempoolEntriesByAddressesRequest} request - * @returns {Promise} - */ + * Retrieves mempool entries associated with specific addresses. + * Returned information: List of mempool entries. + * @see {@link IGetMempoolEntriesByAddressesRequest}, {@link IGetMempoolEntriesByAddressesResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetMempoolEntriesByAddressesRequest} request + * @returns {Promise} + */ getMempoolEntriesByAddresses(request) { const ret = wasm.rpcclient_getMempoolEntriesByAddresses(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves a specific mempool entry by transaction ID. - * Returned information: Mempool entry information. - *@see {@link IGetMempoolEntryRequest}, {@link IGetMempoolEntryResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetMempoolEntryRequest} request - * @returns {Promise} - */ + * Retrieves a specific mempool entry by transaction ID. + * Returned information: Mempool entry information. + * @see {@link IGetMempoolEntryRequest}, {@link IGetMempoolEntryResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetMempoolEntryRequest} request + * @returns {Promise} + */ getMempoolEntry(request) { const ret = wasm.rpcclient_getMempoolEntry(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves information about a subnetwork in the Kaspa BlockDAG. - * Returned information: Subnetwork information. - *@see {@link IGetSubnetworkRequest}, {@link IGetSubnetworkResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetSubnetworkRequest} request - * @returns {Promise} - */ + * Retrieves information about a subnetwork in the Kaspa BlockDAG. + * Returned information: Subnetwork information. + * @see {@link IGetSubnetworkRequest}, {@link IGetSubnetworkResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetSubnetworkRequest} request + * @returns {Promise} + */ getSubnetwork(request) { const ret = wasm.rpcclient_getSubnetwork(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves unspent transaction outputs (UTXOs) associated with - * specific addresses. - * Returned information: List of UTXOs. - *@see {@link IGetUtxosByAddressesRequest}, {@link IGetUtxosByAddressesResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetUtxosByAddressesRequest | Address[] | string[]} request - * @returns {Promise} - */ + * Retrieves unspent transaction outputs (UTXOs) associated with + * specific addresses. + * Returned information: List of UTXOs. + * @see {@link IGetUtxosByAddressesRequest}, {@link IGetUtxosByAddressesResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetUtxosByAddressesRequest | Address[] | string[]} request + * @returns {Promise} + */ getUtxosByAddresses(request) { const ret = wasm.rpcclient_getUtxosByAddresses(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Retrieves the virtual chain corresponding to a specified block hash. - * Returned information: Virtual chain information. - *@see {@link IGetVirtualChainFromBlockRequest}, {@link IGetVirtualChainFromBlockResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IGetVirtualChainFromBlockRequest} request - * @returns {Promise} - */ + * Retrieves the virtual chain corresponding to a specified block hash. + * Returned information: Virtual chain information. + * @see {@link IGetVirtualChainFromBlockRequest}, {@link IGetVirtualChainFromBlockResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IGetVirtualChainFromBlockRequest} request + * @returns {Promise} + */ getVirtualChainFromBlock(request) { const ret = wasm.rpcclient_getVirtualChainFromBlock(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Resolves a finality conflict in the Kaspa BlockDAG. - * Returned information: None. - *@see {@link IResolveFinalityConflictRequest}, {@link IResolveFinalityConflictResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IResolveFinalityConflictRequest} request - * @returns {Promise} - */ + * Resolves a finality conflict in the Kaspa BlockDAG. + * Returned information: None. + * @see {@link IResolveFinalityConflictRequest}, {@link IResolveFinalityConflictResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IResolveFinalityConflictRequest} request + * @returns {Promise} + */ resolveFinalityConflict(request) { const ret = wasm.rpcclient_resolveFinalityConflict(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Submits a block to the Kaspa network. - * Returned information: None. - *@see {@link ISubmitBlockRequest}, {@link ISubmitBlockResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {ISubmitBlockRequest} request - * @returns {Promise} - */ + * Submits a block to the Kaspa network. + * Returned information: None. + * @see {@link ISubmitBlockRequest}, {@link ISubmitBlockResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {ISubmitBlockRequest} request + * @returns {Promise} + */ submitBlock(request) { const ret = wasm.rpcclient_submitBlock(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Submits a transaction to the Kaspa network. - * Returned information: Submitted Transaction Id. - *@see {@link ISubmitTransactionRequest}, {@link ISubmitTransactionResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {ISubmitTransactionRequest} request - * @returns {Promise} - */ + * Submits a transaction to the Kaspa network. + * Returned information: Submitted Transaction Id. + * @see {@link ISubmitTransactionRequest}, {@link ISubmitTransactionResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {ISubmitTransactionRequest} request + * @returns {Promise} + */ submitTransaction(request) { const ret = wasm.rpcclient_submitTransaction(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Submits an RBF transaction to the Kaspa network. - * Returned information: Submitted Transaction Id, Transaction that was replaced. - *@see {@link ISubmitTransactionReplacementRequest}, {@link ISubmitTransactionReplacementResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {ISubmitTransactionReplacementRequest} request - * @returns {Promise} - */ + * Submits an RBF transaction to the Kaspa network. + * Returned information: Submitted Transaction Id, Transaction that was replaced. + * @see {@link ISubmitTransactionReplacementRequest}, {@link ISubmitTransactionReplacementResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {ISubmitTransactionReplacementRequest} request + * @returns {Promise} + */ submitTransactionReplacement(request) { const ret = wasm.rpcclient_submitTransactionReplacement(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Unbans a previously banned peer, allowing it to connect - * to the Kaspa node again. - * Returned information: None. - *@see {@link IUnbanRequest}, {@link IUnbanResponse} - *@throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. - * @param {IUnbanRequest} request - * @returns {Promise} - */ + * Unbans a previously banned peer, allowing it to connect + * to the Kaspa node again. + * Returned information: None. + * @see {@link IUnbanRequest}, {@link IUnbanResponse} + * @throws `string` on an RPC error, a server-side error or when supplying incorrect arguments. + * @param {IUnbanRequest} request + * @returns {Promise} + */ unban(request) { const ret = wasm.rpcclient_unban(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * Manage subscription for a block added notification event. - * Block added notification event is produced when a new - * block is added to the Kaspa BlockDAG. - * @returns {Promise} - */ + * Manage subscription for a block added notification event. + * Block added notification event is produced when a new + * block is added to the Kaspa BlockDAG. + * @returns {Promise} + */ subscribeBlockAdded() { const ret = wasm.rpcclient_subscribeBlockAdded(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {Promise} - */ + * @returns {Promise} + */ unsubscribeBlockAdded() { const ret = wasm.rpcclient_unsubscribeBlockAdded(this.__wbg_ptr); return takeObject(ret); } /** - * Manage subscription for a finality conflict notification event. - * Finality conflict notification event is produced when a finality - * conflict occurs in the Kaspa BlockDAG. - * @returns {Promise} - */ + * Manage subscription for a finality conflict notification event. + * Finality conflict notification event is produced when a finality + * conflict occurs in the Kaspa BlockDAG. + * @returns {Promise} + */ subscribeFinalityConflict() { const ret = wasm.rpcclient_subscribeFinalityConflict(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {Promise} - */ + * @returns {Promise} + */ unsubscribeFinalityConflict() { const ret = wasm.rpcclient_unsubscribeFinalityConflict(this.__wbg_ptr); return takeObject(ret); } /** - * Manage subscription for a finality conflict resolved notification event. - * Finality conflict resolved notification event is produced when a finality - * conflict in the Kaspa BlockDAG is resolved. - * @returns {Promise} - */ + * Manage subscription for a finality conflict resolved notification event. + * Finality conflict resolved notification event is produced when a finality + * conflict in the Kaspa BlockDAG is resolved. + * @returns {Promise} + */ subscribeFinalityConflictResolved() { const ret = wasm.rpcclient_subscribeFinalityConflictResolved(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {Promise} - */ + * @returns {Promise} + */ unsubscribeFinalityConflictResolved() { const ret = wasm.rpcclient_unsubscribeFinalityConflictResolved(this.__wbg_ptr); return takeObject(ret); } /** - * Manage subscription for a sink blue score changed notification event. - * Sink blue score changed notification event is produced when the blue - * score of the sink block changes in the Kaspa BlockDAG. - * @returns {Promise} - */ + * Manage subscription for a sink blue score changed notification event. + * Sink blue score changed notification event is produced when the blue + * score of the sink block changes in the Kaspa BlockDAG. + * @returns {Promise} + */ subscribeSinkBlueScoreChanged() { const ret = wasm.rpcclient_subscribeSinkBlueScoreChanged(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {Promise} - */ + * @returns {Promise} + */ unsubscribeSinkBlueScoreChanged() { const ret = wasm.rpcclient_unsubscribeSinkBlueScoreChanged(this.__wbg_ptr); return takeObject(ret); } /** - * Manage subscription for a pruning point UTXO set override notification event. - * Pruning point UTXO set override notification event is produced when the - * UTXO set override for the pruning point changes in the Kaspa BlockDAG. - * @returns {Promise} - */ + * Manage subscription for a pruning point UTXO set override notification event. + * Pruning point UTXO set override notification event is produced when the + * UTXO set override for the pruning point changes in the Kaspa BlockDAG. + * @returns {Promise} + */ subscribePruningPointUtxoSetOverride() { const ret = wasm.rpcclient_subscribePruningPointUtxoSetOverride(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {Promise} - */ + * @returns {Promise} + */ unsubscribePruningPointUtxoSetOverride() { const ret = wasm.rpcclient_unsubscribePruningPointUtxoSetOverride(this.__wbg_ptr); return takeObject(ret); } /** - * Manage subscription for a new block template notification event. - * New block template notification event is produced when a new block - * template is generated for mining in the Kaspa BlockDAG. - * @returns {Promise} - */ + * Manage subscription for a new block template notification event. + * New block template notification event is produced when a new block + * template is generated for mining in the Kaspa BlockDAG. + * @returns {Promise} + */ subscribeNewBlockTemplate() { const ret = wasm.rpcclient_subscribeNewBlockTemplate(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {Promise} - */ + * @returns {Promise} + */ unsubscribeNewBlockTemplate() { const ret = wasm.rpcclient_unsubscribeNewBlockTemplate(this.__wbg_ptr); return takeObject(ret); } /** - * Manage subscription for a virtual DAA score changed notification event. - * Virtual DAA score changed notification event is produced when the virtual - * Difficulty Adjustment Algorithm (DAA) score changes in the Kaspa BlockDAG. - * @returns {Promise} - */ + * Manage subscription for a virtual DAA score changed notification event. + * Virtual DAA score changed notification event is produced when the virtual + * Difficulty Adjustment Algorithm (DAA) score changes in the Kaspa BlockDAG. + * @returns {Promise} + */ subscribeVirtualDaaScoreChanged() { const ret = wasm.rpcclient_subscribeVirtualDaaScoreChanged(this.__wbg_ptr); return takeObject(ret); } /** - * Manage subscription for a virtual DAA score changed notification event. - * Virtual DAA score changed notification event is produced when the virtual - * Difficulty Adjustment Algorithm (DAA) score changes in the Kaspa BlockDAG. - * @returns {Promise} - */ + * Manage subscription for a virtual DAA score changed notification event. + * Virtual DAA score changed notification event is produced when the virtual + * Difficulty Adjustment Algorithm (DAA) score changes in the Kaspa BlockDAG. + * @returns {Promise} + */ unsubscribeVirtualDaaScoreChanged() { const ret = wasm.rpcclient_unsubscribeVirtualDaaScoreChanged(this.__wbg_ptr); return takeObject(ret); } /** - * Subscribe for a UTXOs changed notification event. - * UTXOs changed notification event is produced when the set - * of unspent transaction outputs (UTXOs) changes in the - * Kaspa BlockDAG. The event notification will be scoped to the - * provided list of addresses. - * @param {(Address | string)[]} addresses - * @returns {Promise} - */ + * Subscribe for a UTXOs changed notification event. + * UTXOs changed notification event is produced when the set + * of unspent transaction outputs (UTXOs) changes in the + * Kaspa BlockDAG. The event notification will be scoped to the + * provided list of addresses. + * @param {(Address | string)[]} addresses + * @returns {Promise} + */ subscribeUtxosChanged(addresses) { const ret = wasm.rpcclient_subscribeUtxosChanged(this.__wbg_ptr, addHeapObject(addresses)); return takeObject(ret); } /** - * Unsubscribe from UTXOs changed notification event - * for a specific set of addresses. - * @param {(Address | string)[]} addresses - * @returns {Promise} - */ + * Unsubscribe from UTXOs changed notification event + * for a specific set of addresses. + * @param {(Address | string)[]} addresses + * @returns {Promise} + */ unsubscribeUtxosChanged(addresses) { const ret = wasm.rpcclient_unsubscribeUtxosChanged(this.__wbg_ptr, addHeapObject(addresses)); return takeObject(ret); } /** - * Manage subscription for a virtual chain changed notification event. - * Virtual chain changed notification event is produced when the virtual - * chain changes in the Kaspa BlockDAG. - * @param {boolean} include_accepted_transaction_ids - * @returns {Promise} - */ + * Manage subscription for a virtual chain changed notification event. + * Virtual chain changed notification event is produced when the virtual + * chain changes in the Kaspa BlockDAG. + * @param {boolean} include_accepted_transaction_ids + * @returns {Promise} + */ subscribeVirtualChainChanged(include_accepted_transaction_ids) { const ret = wasm.rpcclient_subscribeVirtualChainChanged(this.__wbg_ptr, include_accepted_transaction_ids); return takeObject(ret); } /** - * Manage subscription for a virtual chain changed notification event. - * Virtual chain changed notification event is produced when the virtual - * chain changes in the Kaspa BlockDAG. - * @param {boolean} include_accepted_transaction_ids - * @returns {Promise} - */ + * Manage subscription for a virtual chain changed notification event. + * Virtual chain changed notification event is produced when the virtual + * chain changes in the Kaspa BlockDAG. + * @param {boolean} include_accepted_transaction_ids + * @returns {Promise} + */ unsubscribeVirtualChainChanged(include_accepted_transaction_ids) { const ret = wasm.rpcclient_unsubscribeVirtualChainChanged(this.__wbg_ptr, include_accepted_transaction_ids); return takeObject(ret); } /** - * @param {Encoding} encoding - * @param {NetworkType | NetworkId | string} network - * @returns {number} - */ + * @param {Encoding} encoding + * @param {NetworkType | NetworkId | string} network + * @returns {number} + */ static defaultPort(encoding, network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -7827,25 +8360,25 @@ export class RpcClient { } } /** - * Constructs an WebSocket RPC URL given the partial URL or an IP, RPC encoding - * and a network type. - * - * # Arguments - * - * * `url` - Partial URL or an IP address - * * `encoding` - RPC encoding - * * `network_type` - Network type - * @param {string} url - * @param {Encoding} encoding - * @param {NetworkId} network - * @returns {string} - */ + * Constructs an WebSocket RPC URL given the partial URL or an IP, RPC encoding + * and a network type. + * + * # Arguments + * + * * `url` - Partial URL or an IP address + * * `encoding` - RPC encoding + * * `network_type` - Network type + * @param {string} url + * @param {Encoding} encoding + * @param {NetworkId} network + * @returns {string} + */ static parseUrl(url, encoding, network) { let deferred4_0; let deferred4_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(url, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(url, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; _assertClass(network, NetworkId); var ptr1 = network.__destroy_into_raw(); @@ -7865,16 +8398,16 @@ export class RpcClient { return getStringFromWasm0(ptr3, len3); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred4_0, deferred4_1, 1); + wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1); } } /** - * - * Create a new RPC client with optional {@link Encoding} and a `url`. - * - * @see {@link IRpcConfig} interface for more details. - * @param {IRpcConfig | undefined} [config] - */ + * + * Create a new RPC client with optional {@link Encoding} and a `url`. + * + * @see {@link IRpcConfig} interface for more details. + * @param {IRpcConfig | null} [config] + */ constructor(config) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -7893,9 +8426,9 @@ export class RpcClient { } } /** - * The current URL of the RPC client. - * @returns {string | undefined} - */ + * The current URL of the RPC client. + * @returns {string | undefined} + */ get url() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -7905,7 +8438,7 @@ export class RpcClient { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -7913,18 +8446,18 @@ export class RpcClient { } } /** - * Current rpc resolver - * @returns {Resolver | undefined} - */ + * Current rpc resolver + * @returns {Resolver | undefined} + */ get resolver() { const ret = wasm.rpcclient_resolver(this.__wbg_ptr); return ret === 0 ? undefined : Resolver.__wrap(ret); } /** - * Set the resolver for the RPC client. - * This setting will take effect on the next connection. - * @param {Resolver} resolver - */ + * Set the resolver for the RPC client. + * This setting will take effect on the next connection. + * @param {Resolver} resolver + */ setResolver(resolver) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -7941,15 +8474,14 @@ export class RpcClient { } } /** - * Set the network id for the RPC client. - * This setting will take effect on the next connection. - * @param {NetworkId} network_id - */ + * Set the network id for the RPC client. + * This setting will take effect on the next connection. + * @param {NetworkId | string} network_id + */ setNetworkId(network_id) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - _assertClass(network_id, NetworkId); - wasm.rpcclient_setNetworkId(retptr, this.__wbg_ptr, network_id.__wbg_ptr); + wasm.rpcclient_setNetworkId(retptr, this.__wbg_ptr, addBorrowedObject(network_id)); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); if (r1) { @@ -7957,20 +8489,21 @@ export class RpcClient { } } finally { wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; } } /** - * The current connection status of the RPC client. - * @returns {boolean} - */ + * The current connection status of the RPC client. + * @returns {boolean} + */ get isConnected() { const ret = wasm.rpcclient_isConnected(this.__wbg_ptr); return ret !== 0; } /** - * The current protocol encoding. - * @returns {string} - */ + * The current protocol encoding. + * @returns {string} + */ get encoding() { let deferred1_0; let deferred1_1; @@ -7984,13 +8517,13 @@ export class RpcClient { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Optional: Resolver node id. - * @returns {string | undefined} - */ + * Optional: Resolver node id. + * @returns {string | undefined} + */ get nodeId() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8000,7 +8533,7 @@ export class RpcClient { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -8008,164 +8541,164 @@ export class RpcClient { } } /** - * Connect to the Kaspa RPC server. This function starts a background - * task that connects and reconnects to the server if the connection - * is terminated. Use [`disconnect()`](Self::disconnect()) to - * terminate the connection. - * @see {@link IConnectOptions} interface for more details. - * @param {IConnectOptions | undefined | undefined} [args] - * @returns {Promise} - */ + * Connect to the Kaspa RPC server. This function starts a background + * task that connects and reconnects to the server if the connection + * is terminated. Use [`disconnect()`](Self::disconnect()) to + * terminate the connection. + * @see {@link IConnectOptions} interface for more details. + * @param {IConnectOptions | undefined | null} [args] + * @returns {Promise} + */ connect(args) { const ret = wasm.rpcclient_connect(this.__wbg_ptr, isLikeNone(args) ? 0 : addHeapObject(args)); return takeObject(ret); } /** - * Disconnect from the Kaspa RPC server. - * @returns {Promise} - */ + * Disconnect from the Kaspa RPC server. + * @returns {Promise} + */ disconnect() { const ret = wasm.rpcclient_disconnect(this.__wbg_ptr); return takeObject(ret); } /** - * Start background RPC services (automatically started when invoking {@link RpcClient.connect}). - * @returns {Promise} - */ + * Start background RPC services (automatically started when invoking {@link RpcClient.connect}). + * @returns {Promise} + */ start() { const ret = wasm.rpcclient_start(this.__wbg_ptr); return takeObject(ret); } /** - * Stop background RPC services (automatically stopped when invoking {@link RpcClient.disconnect}). - * @returns {Promise} - */ + * Stop background RPC services (automatically stopped when invoking {@link RpcClient.disconnect}). + * @returns {Promise} + */ stop() { const ret = wasm.rpcclient_stop(this.__wbg_ptr); return takeObject(ret); } /** - * Triggers a disconnection on the underlying WebSocket - * if the WebSocket is in connected state. - * This is intended for debug purposes only. - * Can be used to test application reconnection logic. - */ + * Triggers a disconnection on the underlying WebSocket + * if the WebSocket is in connected state. + * This is intended for debug purposes only. + * Can be used to test application reconnection logic. + */ triggerAbort() { wasm.rpcclient_triggerAbort(this.__wbg_ptr); } /** - * - * Register an event listener callback. - * - * Registers a callback function to be executed when a specific event occurs. - * The callback function will receive an {@link RpcEvent} object with the event `type` and `data`. - * - * **RPC Subscriptions vs Event Listeners** - * - * Subscriptions are used to receive notifications from the RPC client. - * Event listeners are client-side application registrations that are - * triggered when notifications are received. - * - * If node is disconnected, upon reconnection you do not need to re-register event listeners, - * however, you have to re-subscribe for Kaspa node notifications. As such, it is recommended - * to register event listeners when the RPC `open` event is received. - * - * ```javascript - * rpc.addEventListener("connect", async (event) => { - * console.log("Connected to", rpc.url); - * await rpc.subscribeDaaScore(); - * // ... perform wallet address subscriptions - * }); - * ``` - * - * **Multiple events and listeners** - * - * `addEventListener` can be used to register multiple event listeners for the same event - * as well as the same event listener for multiple events. - * - * ```javascript - * // Registering a single event listener for multiple events: - * rpc.addEventListener(["connect", "disconnect"], (event) => { - * console.log(event); - * }); - * - * // Registering event listener for all events: - * // (by omitting the event type) - * rpc.addEventListener((event) => { - * console.log(event); - * }); - * - * // Registering multiple event listeners for the same event: - * rpc.addEventListener("connect", (event) => { // first listener - * console.log(event); - * }); - * rpc.addEventListener("connect", (event) => { // second listener - * console.log(event); - * }); - * ``` - * - * **Use of context objects** - * - * You can also register an event with a `context` object. When the event is triggered, - * the `handleEvent` method of the `context` object will be called while `this` value - * will be set to the `context` object. - * ```javascript - * // Registering events with a context object: - * - * const context = { - * someProperty: "someValue", - * handleEvent: (event) => { - * // the following will log "someValue" - * console.log(this.someProperty); - * console.log(event); - * } - * }; - * rpc.addEventListener(["connect","disconnect"], context); - * - * ``` - * - * **General use examples** - * - * In TypeScript you can use {@link RpcEventType} enum (such as `RpcEventType.Connect`) - * or `string` (such as "connect") to register event listeners. - * In JavaScript you can only use `string`. - * - * ```typescript - * // Example usage (TypeScript): - * - * rpc.addEventListener(RpcEventType.Connect, (event) => { - * console.log("Connected to", rpc.url); - * }); - * - * rpc.addEventListener(RpcEventType.VirtualDaaScoreChanged, (event) => { - * console.log(event.type,event.data); - * }); - * await rpc.subscribeDaaScore(); - * - * rpc.addEventListener(RpcEventType.BlockAdded, (event) => { - * console.log(event.type,event.data); - * }); - * await rpc.subscribeBlockAdded(); - * - * // Example usage (JavaScript): - * - * rpc.addEventListener("virtual-daa-score-changed", (event) => { - * console.log(event.type,event.data); - * }); - * - * await rpc.subscribeDaaScore(); - * rpc.addEventListener("block-added", (event) => { - * console.log(event.type,event.data); - * }); - * await rpc.subscribeBlockAdded(); - * ``` - * - * @see {@link RpcEventType} for a list of supported events. - * @see {@link RpcEventData} for the event data interface specification. - * @see {@link RpcClient.removeEventListener}, {@link RpcClient.removeAllEventListeners} - * @param {RpcEventType | string | RpcEventCallback} event - * @param {RpcEventCallback | undefined} [callback] - */ + * + * Register an event listener callback. + * + * Registers a callback function to be executed when a specific event occurs. + * The callback function will receive an {@link RpcEvent} object with the event `type` and `data`. + * + * **RPC Subscriptions vs Event Listeners** + * + * Subscriptions are used to receive notifications from the RPC client. + * Event listeners are client-side application registrations that are + * triggered when notifications are received. + * + * If node is disconnected, upon reconnection you do not need to re-register event listeners, + * however, you have to re-subscribe for Kaspa node notifications. As such, it is recommended + * to register event listeners when the RPC `open` event is received. + * + * ```javascript + * rpc.addEventListener("connect", async (event) => { + * console.log("Connected to", rpc.url); + * await rpc.subscribeDaaScore(); + * // ... perform wallet address subscriptions + * }); + * ``` + * + * **Multiple events and listeners** + * + * `addEventListener` can be used to register multiple event listeners for the same event + * as well as the same event listener for multiple events. + * + * ```javascript + * // Registering a single event listener for multiple events: + * rpc.addEventListener(["connect", "disconnect"], (event) => { + * console.log(event); + * }); + * + * // Registering event listener for all events: + * // (by omitting the event type) + * rpc.addEventListener((event) => { + * console.log(event); + * }); + * + * // Registering multiple event listeners for the same event: + * rpc.addEventListener("connect", (event) => { // first listener + * console.log(event); + * }); + * rpc.addEventListener("connect", (event) => { // second listener + * console.log(event); + * }); + * ``` + * + * **Use of context objects** + * + * You can also register an event with a `context` object. When the event is triggered, + * the `handleEvent` method of the `context` object will be called while `this` value + * will be set to the `context` object. + * ```javascript + * // Registering events with a context object: + * + * const context = { + * someProperty: "someValue", + * handleEvent: (event) => { + * // the following will log "someValue" + * console.log(this.someProperty); + * console.log(event); + * } + * }; + * rpc.addEventListener(["connect","disconnect"], context); + * + * ``` + * + * **General use examples** + * + * In TypeScript you can use {@link RpcEventType} enum (such as `RpcEventType.Connect`) + * or `string` (such as "connect") to register event listeners. + * In JavaScript you can only use `string`. + * + * ```typescript + * // Example usage (TypeScript): + * + * rpc.addEventListener(RpcEventType.Connect, (event) => { + * console.log("Connected to", rpc.url); + * }); + * + * rpc.addEventListener(RpcEventType.VirtualDaaScoreChanged, (event) => { + * console.log(event.type,event.data); + * }); + * await rpc.subscribeDaaScore(); + * + * rpc.addEventListener(RpcEventType.BlockAdded, (event) => { + * console.log(event.type,event.data); + * }); + * await rpc.subscribeBlockAdded(); + * + * // Example usage (JavaScript): + * + * rpc.addEventListener("virtual-daa-score-changed", (event) => { + * console.log(event.type,event.data); + * }); + * + * await rpc.subscribeDaaScore(); + * rpc.addEventListener("block-added", (event) => { + * console.log(event.type,event.data); + * }); + * await rpc.subscribeBlockAdded(); + * ``` + * + * @see {@link RpcEventType} for a list of supported events. + * @see {@link RpcEventData} for the event data interface specification. + * @see {@link RpcClient.removeEventListener}, {@link RpcClient.removeAllEventListeners} + * @param {RpcEventType | string | RpcEventCallback} event + * @param {RpcEventCallback | null} [callback] + */ addEventListener(event, callback) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8180,16 +8713,16 @@ export class RpcClient { } } /** - * - * Unregister an event listener. - * This function will remove the callback for the specified event. - * If the `callback` is not supplied, all callbacks will be - * removed for the specified event. - * - * @see {@link RpcClient.addEventListener} - * @param {RpcEventType | string} event - * @param {RpcEventCallback | undefined} [callback] - */ + * + * Unregister an event listener. + * This function will remove the callback for the specified event. + * If the `callback` is not supplied, all callbacks will be + * removed for the specified event. + * + * @see {@link RpcClient.addEventListener} + * @param {RpcEventType | string} event + * @param {RpcEventCallback | null} [callback] + */ removeEventListener(event, callback) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8204,12 +8737,12 @@ export class RpcClient { } } /** - * - * Unregister a single event listener callback from all events. - * - * - * @param {RpcEventCallback} callback - */ + * + * Unregister a single event listener callback from all events. + * + * + * @param {RpcEventCallback} callback + */ clearEventListener(callback) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8224,9 +8757,9 @@ export class RpcClient { } } /** - * - * Unregister all notification callbacks for all events. - */ + * + * Unregister all notification callbacks for all events. + */ removeAllEventListeners() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8243,17 +8776,17 @@ export class RpcClient { } const ScriptBuilderFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_scriptbuilder_free(ptr >>> 0, 1)); /** -* ScriptBuilder provides a facility for building custom scripts. It allows -* you to push opcodes, ints, and data while respecting canonical encoding. In -* general it does not ensure the script will execute correctly, however any -* data pushes which would exceed the maximum allowed script engine limits and -* are therefore guaranteed not to execute will not be pushed and will result in -* the Script function returning an error. -* @category Consensus -*/ + * ScriptBuilder provides a facility for building custom scripts. It allows + * you to push opcodes, ints, and data while respecting canonical encoding. In + * general it does not ensure the script will execute correctly, however any + * data pushes which would exceed the maximum allowed script engine limits and + * are therefore guaranteed not to execute will not be pushed and will result in + * the Script function returning an error. + * @category Consensus + */ export class ScriptBuilder { static __wrap(ptr) { @@ -8284,8 +8817,6 @@ export class ScriptBuilder { const ptr = this.__destroy_into_raw(); wasm.__wbg_scriptbuilder_free(ptr, 0); } - /** - */ constructor() { const ret = wasm.scriptbuilder_new(); this.__wbg_ptr = ret >>> 0; @@ -8293,11 +8824,11 @@ export class ScriptBuilder { return this; } /** - * Creates a new ScriptBuilder over an existing script. - * Supplied script can be represented as an `Uint8Array` or a `HexString`. - * @param {HexString | Uint8Array} script - * @returns {ScriptBuilder} - */ + * Creates a new ScriptBuilder over an existing script. + * Supplied script can be represented as an `Uint8Array` or a `HexString`. + * @param {HexString | Uint8Array} script + * @returns {ScriptBuilder} + */ static fromScript(script) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8314,12 +8845,12 @@ export class ScriptBuilder { } } /** - * Pushes the passed opcode to the end of the script. The script will not - * be modified if pushing the opcode would cause the script to exceed the - * maximum allowed script engine size. - * @param {number} op - * @returns {ScriptBuilder} - */ + * Pushes the passed opcode to the end of the script. The script will not + * be modified if pushing the opcode would cause the script to exceed the + * maximum allowed script engine size. + * @param {number} op + * @returns {ScriptBuilder} + */ addOp(op) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8336,11 +8867,11 @@ export class ScriptBuilder { } } /** - * Adds the passed opcodes to the end of the script. - * Supplied opcodes can be represented as an `Uint8Array` or a `HexString`. - * @param {HexString | Uint8Array} opcodes - * @returns {ScriptBuilder} - */ + * Adds the passed opcodes to the end of the script. + * Supplied opcodes can be represented as an `Uint8Array` or a `HexString`. + * @param {HexString | Uint8Array} opcodes + * @returns {ScriptBuilder} + */ addOps(opcodes) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8357,18 +8888,18 @@ export class ScriptBuilder { } } /** - * AddData pushes the passed data to the end of the script. It automatically - * chooses canonical opcodes depending on the length of the data. - * - * A zero length buffer will lead to a push of empty data onto the stack (Op0 = OpFalse) - * and any push of data greater than [`MAX_SCRIPT_ELEMENT_SIZE`](kaspa_txscript::MAX_SCRIPT_ELEMENT_SIZE) will not modify - * the script since that is not allowed by the script engine. - * - * Also, the script will not be modified if pushing the data would cause the script to - * exceed the maximum allowed script engine size [`MAX_SCRIPTS_SIZE`](kaspa_txscript::MAX_SCRIPTS_SIZE). - * @param {HexString | Uint8Array} data - * @returns {ScriptBuilder} - */ + * AddData pushes the passed data to the end of the script. It automatically + * chooses canonical opcodes depending on the length of the data. + * + * A zero length buffer will lead to a push of empty data onto the stack (Op0 = OpFalse) + * and any push of data greater than [`MAX_SCRIPT_ELEMENT_SIZE`](kaspa_txscript::MAX_SCRIPT_ELEMENT_SIZE) will not modify + * the script since that is not allowed by the script engine. + * + * Also, the script will not be modified if pushing the data would cause the script to + * exceed the maximum allowed script engine size [`MAX_SCRIPTS_SIZE`](kaspa_txscript::MAX_SCRIPTS_SIZE). + * @param {HexString | Uint8Array} data + * @returns {ScriptBuilder} + */ addData(data) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8385,9 +8916,9 @@ export class ScriptBuilder { } } /** - * @param {bigint} value - * @returns {ScriptBuilder} - */ + * @param {bigint} value + * @returns {ScriptBuilder} + */ addI64(value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8404,9 +8935,9 @@ export class ScriptBuilder { } } /** - * @param {bigint} lock_time - * @returns {ScriptBuilder} - */ + * @param {bigint} lock_time + * @returns {ScriptBuilder} + */ addLockTime(lock_time) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8423,9 +8954,9 @@ export class ScriptBuilder { } } /** - * @param {bigint} sequence - * @returns {ScriptBuilder} - */ + * @param {bigint} sequence + * @returns {ScriptBuilder} + */ addSequence(sequence) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8442,9 +8973,9 @@ export class ScriptBuilder { } } /** - * @param {HexString | Uint8Array} data - * @returns {number} - */ + * @param {HexString | Uint8Array} data + * @returns {number} + */ static canonicalDataSize(data) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8461,37 +8992,37 @@ export class ScriptBuilder { } } /** - * Get script bytes represented by a hex string. - * @returns {HexString} - */ + * Get script bytes represented by a hex string. + * @returns {HexString} + */ toString() { const ret = wasm.scriptbuilder_toString(this.__wbg_ptr); return takeObject(ret); } /** - * Drains (empties) the script builder, returning the - * script bytes represented by a hex string. - * @returns {HexString} - */ + * Drains (empties) the script builder, returning the + * script bytes represented by a hex string. + * @returns {HexString} + */ drain() { const ret = wasm.scriptbuilder_drain(this.__wbg_ptr); return takeObject(ret); } /** - * Creates an equivalent pay-to-script-hash script. - * Can be used to create an P2SH address. - * @see {@link addressFromScriptPublicKey} - * @returns {ScriptPublicKey} - */ + * Creates an equivalent pay-to-script-hash script. + * Can be used to create an P2SH address. + * @see {@link addressFromScriptPublicKey} + * @returns {ScriptPublicKey} + */ createPayToScriptHashScript() { const ret = wasm.scriptbuilder_createPayToScriptHashScript(this.__wbg_ptr); return ScriptPublicKey.__wrap(ret); } /** - * Generates a signature script that fits a pay-to-script-hash script. - * @param {HexString | Uint8Array} signature - * @returns {HexString} - */ + * Generates a signature script that fits a pay-to-script-hash script. + * @param {HexString | Uint8Array} signature + * @returns {HexString} + */ encodePayToScriptHashSignatureScript(signature) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8508,9 +9039,9 @@ export class ScriptBuilder { } } /** - * @param {IHexViewConfig | undefined} [args] - * @returns {string} - */ + * @param {IHexViewConfig | null} [args] + * @returns {string} + */ hexView(args) { let deferred2_0; let deferred2_1; @@ -8532,18 +9063,18 @@ export class ScriptBuilder { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } } const ScriptPublicKeyFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_scriptpublickey_free(ptr >>> 0, 1)); /** -* Represents a Kaspad ScriptPublicKey -* @category Consensus -*/ + * Represents a Kaspad ScriptPublicKey + * @category Consensus + */ export class ScriptPublicKey { static __wrap(ptr) { @@ -8577,22 +9108,22 @@ export class ScriptPublicKey { wasm.__wbg_scriptpublickey_free(ptr, 0); } /** - * @returns {number} - */ + * @returns {number} + */ get version() { const ret = wasm.__wbg_get_scriptpublickey_version(this.__wbg_ptr); return ret; } /** - * @param {number} arg0 - */ + * @param {number} arg0 + */ set version(arg0) { wasm.__wbg_set_scriptpublickey_version(this.__wbg_ptr, arg0); } /** - * @param {number} version - * @param {any} script - */ + * @param {number} version + * @param {any} script + */ constructor(version, script) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8611,8 +9142,8 @@ export class ScriptPublicKey { } } /** - * @returns {string} - */ + * @returns {string} + */ get script() { let deferred1_0; let deferred1_1; @@ -8626,16 +9157,15 @@ export class ScriptPublicKey { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const SetAadOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_setaadoptions_free(ptr >>> 0, 1)); -/** -*/ + export class SetAadOptions { __destroy_into_raw() { @@ -8650,10 +9180,10 @@ export class SetAadOptions { wasm.__wbg_setaadoptions_free(ptr, 0); } /** - * @param {Function} flush - * @param {number} plaintext_length - * @param {Function} transform - */ + * @param {Function} flush + * @param {number} plaintext_length + * @param {Function} transform + */ constructor(flush, plaintext_length, transform) { const ret = wasm.setaadoptions_new(addHeapObject(flush), plaintext_length, addHeapObject(transform)); this.__wbg_ptr = ret >>> 0; @@ -8661,51 +9191,50 @@ export class SetAadOptions { return this; } /** - * @returns {Function} - */ + * @returns {Function} + */ get flush() { const ret = wasm.setaadoptions_flush(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set flush(value) { wasm.setaadoptions_set_flush(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {number} - */ + * @returns {number} + */ get plaintextLength() { - const ret = wasm.agentconstructoroptions_keep_alive_msecs(this.__wbg_ptr); + const ret = wasm.setaadoptions_plaintextLength(this.__wbg_ptr); return ret; } /** - * @param {number} value - */ + * @param {number} value + */ set plaintext_length(value) { - wasm.agentconstructoroptions_set_keep_alive_msecs(this.__wbg_ptr, value); + wasm.setaadoptions_set_plaintext_length(this.__wbg_ptr, value); } /** - * @returns {Function} - */ + * @returns {Function} + */ get transform() { const ret = wasm.setaadoptions_transform(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set transform(value) { wasm.setaadoptions_set_transform(this.__wbg_ptr, addHeapObject(value)); } } const SigHashTypeFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_sighashtype_free(ptr >>> 0, 1)); -/** -*/ + export class SigHashType { __destroy_into_raw() { @@ -8722,12 +9251,12 @@ export class SigHashType { } const StorageFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_storage_free(ptr >>> 0, 1)); /** -* Wallet file storage interface -* @category Wallet SDK -*/ + * Wallet file storage interface + * @category Wallet SDK + */ export class Storage { toJSON() { @@ -8752,8 +9281,8 @@ export class Storage { wasm.__wbg_storage_free(ptr, 0); } /** - * @returns {string} - */ + * @returns {string} + */ get filename() { let deferred1_0; let deferred1_1; @@ -8767,16 +9296,15 @@ export class Storage { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const StreamTransformOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_streamtransformoptions_free(ptr >>> 0, 1)); -/** -*/ + export class StreamTransformOptions { __destroy_into_raw() { @@ -8791,9 +9319,9 @@ export class StreamTransformOptions { wasm.__wbg_streamtransformoptions_free(ptr, 0); } /** - * @param {Function} flush - * @param {Function} transform - */ + * @param {Function} flush + * @param {Function} transform + */ constructor(flush, transform) { const ret = wasm.streamtransformoptions_new(addHeapObject(flush), addHeapObject(transform)); this.__wbg_ptr = ret >>> 0; @@ -8801,43 +9329,43 @@ export class StreamTransformOptions { return this; } /** - * @returns {Function} - */ + * @returns {Function} + */ get flush() { const ret = wasm.streamtransformoptions_flush(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set flush(value) { wasm.streamtransformoptions_set_flush(this.__wbg_ptr, addHeapObject(value)); } /** - * @returns {Function} - */ + * @returns {Function} + */ get transform() { const ret = wasm.streamtransformoptions_transform(this.__wbg_ptr); return takeObject(ret); } /** - * @param {Function} value - */ + * @param {Function} value + */ set transform(value) { wasm.streamtransformoptions_set_transform(this.__wbg_ptr, addHeapObject(value)); } } const TransactionFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transaction_free(ptr >>> 0, 1)); /** -* Represents a Kaspa transaction. -* This is an artificial construct that includes additional -* transaction-related data such as additional data from UTXOs -* used by transaction inputs. -* @category Consensus -*/ + * Represents a Kaspa transaction. + * This is an artificial construct that includes additional + * transaction-related data such as additional data from UTXOs + * used by transaction inputs. + * @category Consensus + */ export class Transaction { static __wrap(ptr) { @@ -8878,20 +9406,20 @@ export class Transaction { wasm.__wbg_transaction_free(ptr, 0); } /** - * Determines whether or not a transaction is a coinbase transaction. A coinbase - * transaction is a special transaction created by miners that distributes fees and block subsidy - * to the previous blocks' miners, and specifies the script_pub_key that will be used to pay the current - * miner in future blocks. - * @returns {boolean} - */ + * Determines whether or not a transaction is a coinbase transaction. A coinbase + * transaction is a special transaction created by miners that distributes fees and block subsidy + * to the previous blocks' miners, and specifies the script_pub_key that will be used to pay the current + * miner in future blocks. + * @returns {boolean} + */ is_coinbase() { const ret = wasm.transaction_is_coinbase(this.__wbg_ptr); return ret !== 0; } /** - * Recompute and finalize the tx id based on updated tx fields - * @returns {Hash} - */ + * Recompute and finalize the tx id based on updated tx fields + * @returns {Hash} + */ finalize() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8908,9 +9436,9 @@ export class Transaction { } } /** - * Returns the transaction ID - * @returns {string} - */ + * Returns the transaction ID + * @returns {string} + */ get id() { let deferred1_0; let deferred1_1; @@ -8924,12 +9452,12 @@ export class Transaction { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {ITransaction | Transaction} js_value - */ + * @param {ITransaction | Transaction} js_value + */ constructor(js_value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8949,19 +9477,19 @@ export class Transaction { } } /** - * @returns {TransactionInput[]} - */ + * @returns {TransactionInput[]} + */ get inputs() { const ret = wasm.transaction_get_inputs_as_js_array(this.__wbg_ptr); return takeObject(ret); } /** - * Returns a list of unique addresses used by transaction inputs. - * This method can be used to determine addresses used by transaction inputs - * in order to select private keys needed for transaction signing. - * @param {NetworkType | NetworkId | string} network_type - * @returns {Address[]} - */ + * Returns a list of unique addresses used by transaction inputs. + * This method can be used to determine addresses used by transaction inputs + * in order to select private keys needed for transaction signing. + * @param {NetworkType | NetworkId | string} network_type + * @returns {Address[]} + */ addresses(network_type) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -8979,8 +9507,8 @@ export class Transaction { } } /** - * @param {(ITransactionInput | TransactionInput)[]} js_value - */ + * @param {(ITransactionInput | TransactionInput)[]} js_value + */ set inputs(js_value) { try { wasm.transaction_set_inputs_from_js_array(this.__wbg_ptr, addBorrowedObject(js_value)); @@ -8989,15 +9517,15 @@ export class Transaction { } } /** - * @returns {TransactionOutput[]} - */ + * @returns {TransactionOutput[]} + */ get outputs() { const ret = wasm.transaction_get_outputs_as_js_array(this.__wbg_ptr); return takeObject(ret); } /** - * @param {(ITransactionOutput | TransactionOutput)[]} js_value - */ + * @param {(ITransactionOutput | TransactionOutput)[]} js_value + */ set outputs(js_value) { try { wasm.transaction_set_outputs_from_js_array(this.__wbg_ptr, addBorrowedObject(js_value)); @@ -9006,47 +9534,47 @@ export class Transaction { } } /** - * @returns {number} - */ + * @returns {number} + */ get version() { const ret = wasm.transaction_version(this.__wbg_ptr); return ret; } /** - * @param {number} v - */ + * @param {number} v + */ set version(v) { wasm.transaction_set_version(this.__wbg_ptr, v); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get lockTime() { const ret = wasm.transaction_lockTime(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} v - */ + * @param {bigint} v + */ set lockTime(v) { wasm.transaction_set_lockTime(this.__wbg_ptr, v); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get gas() { const ret = wasm.transaction_gas(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} v - */ + * @param {bigint} v + */ set gas(v) { wasm.transaction_set_gas(this.__wbg_ptr, v); } /** - * @returns {string} - */ + * @returns {string} + */ get subnetworkId() { let deferred1_0; let deferred1_1; @@ -9060,18 +9588,18 @@ export class Transaction { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set subnetworkId(js_value) { wasm.transaction_set_subnetwork_id_from_js_value(this.__wbg_ptr, addHeapObject(js_value)); } /** - * @returns {string} - */ + * @returns {string} + */ get payload() { let deferred1_0; let deferred1_1; @@ -9085,34 +9613,34 @@ export class Transaction { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set payload(js_value) { wasm.transaction_set_payload_from_js_value(this.__wbg_ptr, addHeapObject(js_value)); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get mass() { const ret = wasm.transaction_get_mass(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} v - */ + * @param {bigint} v + */ set mass(v) { wasm.transaction_set_mass(this.__wbg_ptr, v); } /** - * Serializes the transaction to a pure JavaScript Object. - * The schema of the JavaScript object is defined by {@link ISerializableTransaction}. - * @see {@link ISerializableTransaction} - * @returns {ISerializableTransaction} - */ + * Serializes the transaction to a pure JavaScript Object. + * The schema of the JavaScript object is defined by {@link ISerializableTransaction}. + * @see {@link ISerializableTransaction} + * @returns {ISerializableTransaction} + */ serializeToObject() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9129,10 +9657,10 @@ export class Transaction { } } /** - * Serializes the transaction to a JSON string. - * The schema of the JSON is defined by {@link ISerializableTransaction}. - * @returns {string} - */ + * Serializes the transaction to a JSON string. + * The schema of the JSON is defined by {@link ISerializableTransaction}. + * @returns {string} + */ serializeToJSON() { let deferred2_0; let deferred2_1; @@ -9154,13 +9682,13 @@ export class Transaction { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * Serializes the transaction to a "Safe" JSON schema where it converts all `bigint` values to `string` to avoid potential client-side precision loss. - * @returns {string} - */ + * Serializes the transaction to a "Safe" JSON schema where it converts all `bigint` values to `string` to avoid potential client-side precision loss. + * @returns {string} + */ serializeToSafeJSON() { let deferred2_0; let deferred2_1; @@ -9182,14 +9710,14 @@ export class Transaction { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * Deserialize the {@link Transaction} Object from a pure JavaScript Object. - * @param {any} js_value - * @returns {Transaction} - */ + * Deserialize the {@link Transaction} Object from a pure JavaScript Object. + * @param {any} js_value + * @returns {Transaction} + */ static deserializeFromObject(js_value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9207,14 +9735,14 @@ export class Transaction { } } /** - * Deserialize the {@link Transaction} Object from a JSON string. - * @param {string} json - * @returns {Transaction} - */ + * Deserialize the {@link Transaction} Object from a JSON string. + * @param {string} json + * @returns {Transaction} + */ static deserializeFromJSON(json) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.transaction_deserializeFromJSON(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -9229,14 +9757,14 @@ export class Transaction { } } /** - * Deserialize the {@link Transaction} Object from a "Safe" JSON schema where all `bigint` values are represented as `string`. - * @param {string} json - * @returns {Transaction} - */ + * Deserialize the {@link Transaction} Object from a "Safe" JSON schema where all `bigint` values are represented as `string`. + * @param {string} json + * @returns {Transaction} + */ static deserializeFromSafeJSON(json) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.transaction_deserializeFromSafeJSON(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -9253,12 +9781,12 @@ export class Transaction { } const TransactionInputFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transactioninput_free(ptr >>> 0, 1)); /** -* Represents a Kaspa transaction input -* @category Consensus -*/ + * Represents a Kaspa transaction input + * @category Consensus + */ export class TransactionInput { static __wrap(ptr) { @@ -9295,8 +9823,8 @@ export class TransactionInput { wasm.__wbg_transactioninput_free(ptr, 0); } /** - * @param {ITransactionInput | TransactionInput} value - */ + * @param {ITransactionInput | TransactionInput} value + */ constructor(value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9316,15 +9844,15 @@ export class TransactionInput { } } /** - * @returns {TransactionOutpoint} - */ + * @returns {TransactionOutpoint} + */ get previousOutpoint() { const ret = wasm.transactioninput_get_previous_outpoint(this.__wbg_ptr); return TransactionOutpoint.__wrap(ret); } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set previousOutpoint(js_value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9340,8 +9868,8 @@ export class TransactionInput { } } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get signatureScript() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9351,7 +9879,7 @@ export class TransactionInput { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -9359,8 +9887,8 @@ export class TransactionInput { } } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set signatureScript(js_value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9375,34 +9903,34 @@ export class TransactionInput { } } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get sequence() { const ret = wasm.transactioninput_get_sequence(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} sequence - */ + * @param {bigint} sequence + */ set sequence(sequence) { wasm.transactioninput_set_sequence(this.__wbg_ptr, sequence); } /** - * @returns {number} - */ + * @returns {number} + */ get sigOpCount() { const ret = wasm.transactioninput_get_sig_op_count(this.__wbg_ptr); return ret; } /** - * @param {number} sig_op_count - */ + * @param {number} sig_op_count + */ set sigOpCount(sig_op_count) { wasm.transactioninput_set_sig_op_count(this.__wbg_ptr, sig_op_count); } /** - * @returns {UtxoEntryReference | undefined} - */ + * @returns {UtxoEntryReference | undefined} + */ get utxo() { const ret = wasm.transactioninput_get_utxo(this.__wbg_ptr); return ret === 0 ? undefined : UtxoEntryReference.__wrap(ret); @@ -9410,15 +9938,15 @@ export class TransactionInput { } const TransactionOutpointFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transactionoutpoint_free(ptr >>> 0, 1)); /** -* Represents a Kaspa transaction outpoint. -* NOTE: This struct is immutable - to create a custom outpoint -* use the `TransactionOutpoint::new` constructor. (in JavaScript -* use `new TransactionOutpoint(transactionId, index)`). -* @category Consensus -*/ + * Represents a Kaspa transaction outpoint. + * NOTE: This struct is immutable - to create a custom outpoint + * use the `TransactionOutpoint::new` constructor. (in JavaScript + * use `new TransactionOutpoint(transactionId, index)`). + * @category Consensus + */ export class TransactionOutpoint { static __wrap(ptr) { @@ -9452,9 +9980,9 @@ export class TransactionOutpoint { wasm.__wbg_transactionoutpoint_free(ptr, 0); } /** - * @param {Hash} transaction_id - * @param {number} index - */ + * @param {Hash} transaction_id + * @param {number} index + */ constructor(transaction_id, index) { _assertClass(transaction_id, Hash); var ptr0 = transaction_id.__destroy_into_raw(); @@ -9464,8 +9992,8 @@ export class TransactionOutpoint { return this; } /** - * @returns {string} - */ + * @returns {string} + */ getId() { let deferred1_0; let deferred1_1; @@ -9479,12 +10007,12 @@ export class TransactionOutpoint { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ get transactionId() { let deferred1_0; let deferred1_1; @@ -9498,12 +10026,12 @@ export class TransactionOutpoint { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {number} - */ + * @returns {number} + */ get index() { const ret = wasm.transactionoutpoint_index(this.__wbg_ptr); return ret >>> 0; @@ -9511,12 +10039,12 @@ export class TransactionOutpoint { } const TransactionOutputFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transactionoutput_free(ptr >>> 0, 1)); /** -* Represents a Kaspad transaction output -* @category Consensus -*/ + * Represents a Kaspad transaction output + * @category Consensus + */ export class TransactionOutput { static __wrap(ptr) { @@ -9550,10 +10078,10 @@ export class TransactionOutput { wasm.__wbg_transactionoutput_free(ptr, 0); } /** - * TransactionOutput constructor - * @param {bigint} value - * @param {ScriptPublicKey} script_public_key - */ + * TransactionOutput constructor + * @param {bigint} value + * @param {ScriptPublicKey} script_public_key + */ constructor(value, script_public_key) { _assertClass(script_public_key, ScriptPublicKey); const ret = wasm.transactionoutput_ctor(value, script_public_key.__wbg_ptr); @@ -9562,28 +10090,28 @@ export class TransactionOutput { return this; } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get value() { const ret = wasm.transactionoutput_value(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} v - */ + * @param {bigint} v + */ set value(v) { wasm.transactionoutput_set_value(this.__wbg_ptr, v); } /** - * @returns {ScriptPublicKey} - */ + * @returns {ScriptPublicKey} + */ get scriptPublicKey() { const ret = wasm.transactionoutput_scriptPublicKey(this.__wbg_ptr); return ScriptPublicKey.__wrap(ret); } /** - * @param {ScriptPublicKey} v - */ + * @param {ScriptPublicKey} v + */ set scriptPublicKey(v) { _assertClass(v, ScriptPublicKey); wasm.transactionoutput_set_scriptPublicKey(this.__wbg_ptr, v.__wbg_ptr); @@ -9591,11 +10119,11 @@ export class TransactionOutput { } const TransactionRecordFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transactionrecord_free(ptr >>> 0, 1)); /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class TransactionRecord { static __wrap(ptr) { @@ -9637,24 +10165,24 @@ export class TransactionRecord { wasm.__wbg_transactionrecord_free(ptr, 0); } /** - * @returns {Hash} - */ + * @returns {Hash} + */ get id() { const ret = wasm.__wbg_get_transactionrecord_id(this.__wbg_ptr); return Hash.__wrap(ret); } /** - * @param {Hash} arg0 - */ + * @param {Hash} arg0 + */ set id(arg0) { _assertClass(arg0, Hash); var ptr0 = arg0.__destroy_into_raw(); wasm.__wbg_set_transactionrecord_id(this.__wbg_ptr, ptr0); } /** - * Unix time in milliseconds - * @returns {bigint | undefined} - */ + * Unix time in milliseconds + * @returns {bigint | undefined} + */ get unixtimeMsec() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9667,30 +10195,30 @@ export class TransactionRecord { } } /** - * Unix time in milliseconds - * @param {bigint | undefined} [arg0] - */ + * Unix time in milliseconds + * @param {bigint | null} [arg0] + */ set unixtimeMsec(arg0) { wasm.__wbg_set_transactionrecord_unixtimeMsec(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0); } /** - * @returns {NetworkId} - */ + * @returns {NetworkId} + */ get network() { const ret = wasm.__wbg_get_transactionrecord_network(this.__wbg_ptr); return NetworkId.__wrap(ret); } /** - * @param {NetworkId} arg0 - */ + * @param {NetworkId} arg0 + */ set network(arg0) { _assertClass(arg0, NetworkId); var ptr0 = arg0.__destroy_into_raw(); wasm.__wbg_set_transactionrecord_network(this.__wbg_ptr, ptr0); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get note() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9700,7 +10228,7 @@ export class TransactionRecord { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -9708,16 +10236,16 @@ export class TransactionRecord { } } /** - * @param {string | undefined} [arg0] - */ + * @param {string | null} [arg0] + */ set note(arg0) { - var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); var len0 = WASM_VECTOR_LEN; wasm.__wbg_set_transactionrecord_note(this.__wbg_ptr, ptr0, len0); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get metadata() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9727,7 +10255,7 @@ export class TransactionRecord { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -9735,44 +10263,64 @@ export class TransactionRecord { } } /** - * @param {string | undefined} [arg0] - */ + * @param {string | null} [arg0] + */ set metadata(arg0) { - var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); var len0 = WASM_VECTOR_LEN; wasm.__wbg_set_transactionrecord_metadata(this.__wbg_ptr, ptr0, len0); } /** - * @returns {bigint} - */ + * @param {bigint} currentDaaScore + * @returns {string} + */ + maturityProgress(currentDaaScore) { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.transactionrecord_maturityProgress(retptr, this.__wbg_ptr, addHeapObject(currentDaaScore)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); + } + } + /** + * @returns {bigint} + */ get value() { const ret = wasm.transactionrecord_value(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get blockDaaScore() { const ret = wasm.transactionrecord_blockDaaScore(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {IBinding} - */ + * @returns {IBinding} + */ get binding() { const ret = wasm.transactionrecord_binding(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {ITransactionData} - */ + * @returns {ITransactionData} + */ get data() { const ret = wasm.transactionrecord_data(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {string} - */ + * @returns {string} + */ get type() { let deferred1_0; let deferred1_1; @@ -9786,23 +10334,23 @@ export class TransactionRecord { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Check if the transaction record has the given address within the associated UTXO set. - * @param {Address} address - * @returns {boolean} - */ + * Check if the transaction record has the given address within the associated UTXO set. + * @param {Address} address + * @returns {boolean} + */ hasAddress(address) { _assertClass(address, Address); const ret = wasm.transactionrecord_hasAddress(this.__wbg_ptr, address.__wbg_ptr); return ret !== 0; } /** - * Serialize the transaction record to a JavaScript object. - * @returns {any} - */ + * Serialize the transaction record to a JavaScript object. + * @returns {any} + */ serialize() { const ret = wasm.transactionrecord_serialize(this.__wbg_ptr); return takeObject(ret); @@ -9810,10 +10358,9 @@ export class TransactionRecord { } const TransactionRecordNotificationFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transactionrecordnotification_free(ptr >>> 0, 1)); -/** -*/ + export class TransactionRecordNotification { static __wrap(ptr) { @@ -9847,8 +10394,8 @@ export class TransactionRecordNotification { wasm.__wbg_transactionrecordnotification_free(ptr, 0); } /** - * @returns {string} - */ + * @returns {string} + */ get type() { let deferred1_0; let deferred1_1; @@ -9862,27 +10409,27 @@ export class TransactionRecordNotification { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {string} arg0 - */ + * @param {string} arg0 + */ set type(arg0) { - const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.__wbg_set_transactionrecordnotification_type(this.__wbg_ptr, ptr0, len0); } /** - * @returns {TransactionRecord} - */ + * @returns {TransactionRecord} + */ get data() { const ret = wasm.__wbg_get_transactionrecordnotification_data(this.__wbg_ptr); return TransactionRecord.__wrap(ret); } /** - * @param {TransactionRecord} arg0 - */ + * @param {TransactionRecord} arg0 + */ set data(arg0) { _assertClass(arg0, TransactionRecord); var ptr0 = arg0.__destroy_into_raw(); @@ -9891,11 +10438,11 @@ export class TransactionRecordNotification { } const TransactionSigningHashFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transactionsigninghash_free(ptr >>> 0, 1)); /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class TransactionSigningHash { __destroy_into_raw() { @@ -9909,8 +10456,6 @@ export class TransactionSigningHash { const ptr = this.__destroy_into_raw(); wasm.__wbg_transactionsigninghash_free(ptr, 0); } - /** - */ constructor() { const ret = wasm.transactionsigninghash_new(); this.__wbg_ptr = ret >>> 0; @@ -9918,8 +10463,8 @@ export class TransactionSigningHash { return this; } /** - * @param {HexString | Uint8Array} data - */ + * @param {HexString | Uint8Array} data + */ update(data) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9934,8 +10479,8 @@ export class TransactionSigningHash { } } /** - * @returns {string} - */ + * @returns {string} + */ finalize() { let deferred1_0; let deferred1_1; @@ -9949,17 +10494,17 @@ export class TransactionSigningHash { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const TransactionSigningHashECDSAFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transactionsigninghashecdsa_free(ptr >>> 0, 1)); /** -* @category Wallet SDK -*/ + * @category Wallet SDK + */ export class TransactionSigningHashECDSA { __destroy_into_raw() { @@ -9973,8 +10518,6 @@ export class TransactionSigningHashECDSA { const ptr = this.__destroy_into_raw(); wasm.__wbg_transactionsigninghashecdsa_free(ptr, 0); } - /** - */ constructor() { const ret = wasm.transactionsigninghashecdsa_new(); this.__wbg_ptr = ret >>> 0; @@ -9982,8 +10525,8 @@ export class TransactionSigningHashECDSA { return this; } /** - * @param {HexString | Uint8Array} data - */ + * @param {HexString | Uint8Array} data + */ update(data) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -9998,8 +10541,8 @@ export class TransactionSigningHashECDSA { } } /** - * @returns {string} - */ + * @returns {string} + */ finalize() { let deferred1_0; let deferred1_1; @@ -10013,21 +10556,21 @@ export class TransactionSigningHashECDSA { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const TransactionUtxoEntryFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_transactionutxoentry_free(ptr >>> 0, 1)); /** -* Holds details about an individual transaction output in a utxo -* set such as whether or not it was contained in a coinbase tx, the daa -* score of the block that accepts the tx, its public key script, and how -* much it pays. -* @category Consensus -*/ + * Holds details about an individual transaction output in a utxo + * set such as whether or not it was contained in a coinbase tx, the daa + * score of the block that accepts the tx, its public key script, and how + * much it pays. + * @category Consensus + */ export class TransactionUtxoEntry { toJSON() { @@ -10055,66 +10598,65 @@ export class TransactionUtxoEntry { wasm.__wbg_transactionutxoentry_free(ptr, 0); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get amount() { const ret = wasm.__wbg_get_transactionutxoentry_amount(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} arg0 - */ + * @param {bigint} arg0 + */ set amount(arg0) { wasm.__wbg_set_transactionutxoentry_amount(this.__wbg_ptr, arg0); } /** - * @returns {ScriptPublicKey} - */ + * @returns {ScriptPublicKey} + */ get scriptPublicKey() { const ret = wasm.__wbg_get_transactionutxoentry_scriptPublicKey(this.__wbg_ptr); return ScriptPublicKey.__wrap(ret); } /** - * @param {ScriptPublicKey} arg0 - */ + * @param {ScriptPublicKey} arg0 + */ set scriptPublicKey(arg0) { _assertClass(arg0, ScriptPublicKey); var ptr0 = arg0.__destroy_into_raw(); wasm.__wbg_set_transactionutxoentry_scriptPublicKey(this.__wbg_ptr, ptr0); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get blockDaaScore() { const ret = wasm.__wbg_get_transactionutxoentry_blockDaaScore(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} arg0 - */ + * @param {bigint} arg0 + */ set blockDaaScore(arg0) { wasm.__wbg_set_transactionutxoentry_blockDaaScore(this.__wbg_ptr, arg0); } /** - * @returns {boolean} - */ + * @returns {boolean} + */ get isCoinbase() { const ret = wasm.__wbg_get_transactionutxoentry_isCoinbase(this.__wbg_ptr); return ret !== 0; } /** - * @param {boolean} arg0 - */ + * @param {boolean} arg0 + */ set isCoinbase(arg0) { wasm.__wbg_set_transactionutxoentry_isCoinbase(this.__wbg_ptr, arg0); } } const UserInfoOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_userinfooptions_free(ptr >>> 0, 1)); -/** -*/ + export class UserInfoOptions { static __wrap(ptr) { @@ -10137,8 +10679,8 @@ export class UserInfoOptions { wasm.__wbg_userinfooptions_free(ptr, 0); } /** - * @param {string | undefined} [encoding] - */ + * @param {string | null} [encoding] + */ constructor(encoding) { const ret = wasm.userinfooptions_new_with_values(isLikeNone(encoding) ? 0 : addHeapObject(encoding)); this.__wbg_ptr = ret >>> 0; @@ -10146,86 +10688,86 @@ export class UserInfoOptions { return this; } /** - * @returns {UserInfoOptions} - */ + * @returns {UserInfoOptions} + */ static new() { const ret = wasm.userinfooptions_new(); return UserInfoOptions.__wrap(ret); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get encoding() { const ret = wasm.userinfooptions_encoding(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set encoding(value) { wasm.userinfooptions_set_encoding(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } } const UtxoContextFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_utxocontext_free(ptr >>> 0, 1)); /** -* -* UtxoContext is a class that provides a way to track addresses activity -* on the Kaspa network. When an address is registered with UtxoContext -* it aggregates all UTXO entries for that address and emits events when -* any activity against these addresses occurs. -* -* UtxoContext constructor accepts {@link IUtxoContextArgs} interface that -* can contain an optional id parameter. If supplied, this `id` parameter -* will be included in all notifications emitted by the UtxoContext as -* well as included as a part of {@link ITransactionRecord} emitted when -* transactions occur. If not provided, a random id will be generated. This id -* typically represents an account id in the context of a wallet application. -* The integrated Wallet API uses UtxoContext to represent wallet accounts. -* -* **Exchanges:** if you are building an exchange wallet, it is recommended -* to use UtxoContext for each user account. This way you can track and isolate -* each user activity (use address set, balances, transaction records). -* -* UtxoContext maintains a real-time cumulative balance of all addresses -* registered against it and provides balance update notification events -* when the balance changes. -* -* The UtxoContext balance is comprised of 3 values: -* - `mature`: amount of funds available for spending. -* - `pending`: amount of funds that are being received. -* - `outgoing`: amount of funds that are being sent but are not yet accepted by the network. -* -* Please see {@link IBalance} interface for more details. -* -* UtxoContext can be supplied as a UTXO source to the transaction {@link Generator} -* allowing the {@link Generator} to create transactions using the -* UTXO entries it manages. -* -* **IMPORTANT:** UtxoContext is meant to represent a single account. It is not -* designed to be used as a global UTXO manager for all addresses in a very large -* wallet (such as an exchange wallet). For such use cases, it is recommended to -* perform manual UTXO management by subscribing to UTXO notifications using -* {@link RpcClient.subscribeUtxosChanged} and {@link RpcClient.getUtxosByAddresses}. -* -* @see {@link IUtxoContextArgs}, -* {@link UtxoProcessor}, -* {@link Generator}, -* {@link createTransactions}, -* {@link IBalance}, -* {@link IBalanceEvent}, -* {@link IPendingEvent}, -* {@link IReorgEvent}, -* {@link IStasisEvent}, -* {@link IMaturityEvent}, -* {@link IDiscoveryEvent}, -* {@link IBalanceEvent}, -* {@link ITransactionRecord} -* -* @category Wallet SDK -*/ + * + * UtxoContext is a class that provides a way to track addresses activity + * on the Kaspa network. When an address is registered with UtxoContext + * it aggregates all UTXO entries for that address and emits events when + * any activity against these addresses occurs. + * + * UtxoContext constructor accepts {@link IUtxoContextArgs} interface that + * can contain an optional id parameter. If supplied, this `id` parameter + * will be included in all notifications emitted by the UtxoContext as + * well as included as a part of {@link ITransactionRecord} emitted when + * transactions occur. If not provided, a random id will be generated. This id + * typically represents an account id in the context of a wallet application. + * The integrated Wallet API uses UtxoContext to represent wallet accounts. + * + * **Exchanges:** if you are building an exchange wallet, it is recommended + * to use UtxoContext for each user account. This way you can track and isolate + * each user activity (use address set, balances, transaction records). + * + * UtxoContext maintains a real-time cumulative balance of all addresses + * registered against it and provides balance update notification events + * when the balance changes. + * + * The UtxoContext balance is comprised of 3 values: + * - `mature`: amount of funds available for spending. + * - `pending`: amount of funds that are being received. + * - `outgoing`: amount of funds that are being sent but are not yet accepted by the network. + * + * Please see {@link IBalance} interface for more details. + * + * UtxoContext can be supplied as a UTXO source to the transaction {@link Generator} + * allowing the {@link Generator} to create transactions using the + * UTXO entries it manages. + * + * **IMPORTANT:** UtxoContext is meant to represent a single account. It is not + * designed to be used as a global UTXO manager for all addresses in a very large + * wallet (such as an exchange wallet). For such use cases, it is recommended to + * perform manual UTXO management by subscribing to UTXO notifications using + * {@link RpcClient.subscribeUtxosChanged} and {@link RpcClient.getUtxosByAddresses}. + * + * @see {@link IUtxoContextArgs}, + * {@link UtxoProcessor}, + * {@link Generator}, + * {@link createTransactions}, + * {@link IBalance}, + * {@link IBalanceEvent}, + * {@link IPendingEvent}, + * {@link IReorgEvent}, + * {@link IStasisEvent}, + * {@link IMaturityEvent}, + * {@link IDiscoveryEvent}, + * {@link IBalanceEvent}, + * {@link ITransactionRecord} + * + * @category Wallet SDK + */ export class UtxoContext { toJSON() { @@ -10253,8 +10795,8 @@ export class UtxoContext { wasm.__wbg_utxocontext_free(ptr, 0); } /** - * @param {IUtxoContextArgs} js_value - */ + * @param {IUtxoContextArgs} js_value + */ constructor(js_value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10273,59 +10815,59 @@ export class UtxoContext { } } /** - * Performs a scan of the given addresses and registers them in the context for event notifications. - * @param {(Address | string)[]} addresses - * @param {bigint | undefined} [optional_current_daa_score] - * @returns {Promise} - */ + * Performs a scan of the given addresses and registers them in the context for event notifications. + * @param {(Address | string)[]} addresses + * @param {bigint | null} [optional_current_daa_score] + * @returns {Promise} + */ trackAddresses(addresses, optional_current_daa_score) { const ret = wasm.utxocontext_trackAddresses(this.__wbg_ptr, addHeapObject(addresses), isLikeNone(optional_current_daa_score) ? 0 : addHeapObject(optional_current_daa_score)); return takeObject(ret); } /** - * Unregister a list of addresses from the context. This will stop tracking of these addresses. - * @param {(Address | string)[]} addresses - * @returns {Promise} - */ + * Unregister a list of addresses from the context. This will stop tracking of these addresses. + * @param {(Address | string)[]} addresses + * @returns {Promise} + */ unregisterAddresses(addresses) { const ret = wasm.utxocontext_unregisterAddresses(this.__wbg_ptr, addHeapObject(addresses)); return takeObject(ret); } /** - * Clear the UtxoContext. Unregister all addresses and clear all UTXO entries. - * IMPORTANT: This function must be manually called when disconnecting or re-connecting to the node - * (followed by address re-registration). - * @returns {Promise} - */ + * Clear the UtxoContext. Unregister all addresses and clear all UTXO entries. + * IMPORTANT: This function must be manually called when disconnecting or re-connecting to the node + * (followed by address re-registration). + * @returns {Promise} + */ clear() { const ret = wasm.utxocontext_clear(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {boolean} - */ + * @returns {boolean} + */ get isActive() { const ret = wasm.utxocontext_isActive(this.__wbg_ptr); return ret !== 0; } /** - * - * Returns a range of mature UTXO entries that are currently - * managed by the UtxoContext and are available for spending. - * - * NOTE: This function is provided for informational purposes only. - * **You should not manage UTXO entries manually if they are owned by UtxoContext.** - * - * The resulting range may be less than requested if UTXO entries - * have been spent asynchronously by UtxoContext or by other means - * (i.e. UtxoContext has received notification from the network that - * UtxoEntries have been spent externally). - * - * UtxoEntries are kept in in the ascending sorted order by their amount. - * @param {number} from - * @param {number} to - * @returns {UtxoEntryReference[]} - */ + * + * Returns a range of mature UTXO entries that are currently + * managed by the UtxoContext and are available for spending. + * + * NOTE: This function is provided for informational purposes only. + * **You should not manage UTXO entries manually if they are owned by UtxoContext.** + * + * The resulting range may be less than requested if UTXO entries + * have been spent asynchronously by UtxoContext or by other means + * (i.e. UtxoContext has received notification from the network that + * UtxoEntries have been spent externally). + * + * UtxoEntries are kept in in the ascending sorted order by their amount. + * @param {number} from + * @param {number} to + * @returns {UtxoEntryReference[]} + */ getMatureRange(from, to) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10342,18 +10884,18 @@ export class UtxoContext { } } /** - * Obtain the length of the mature UTXO entries that are currently - * managed by the UtxoContext. - * @returns {number} - */ + * Obtain the length of the mature UTXO entries that are currently + * managed by the UtxoContext. + * @returns {number} + */ get matureLength() { const ret = wasm.utxocontext_matureLength(this.__wbg_ptr); return ret >>> 0; } /** - * Returns pending UTXO entries that are currently managed by the UtxoContext. - * @returns {UtxoEntryReference[]} - */ + * Returns pending UTXO entries that are currently managed by the UtxoContext. + * @returns {UtxoEntryReference[]} + */ getPending() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10370,17 +10912,17 @@ export class UtxoContext { } } /** - * Current {@link Balance} of the UtxoContext. - * @returns {Balance | undefined} - */ + * Current {@link Balance} of the UtxoContext. + * @returns {Balance | undefined} + */ get balance() { const ret = wasm.utxocontext_balance(this.__wbg_ptr); return ret === 0 ? undefined : Balance.__wrap(ret); } /** - * Current {@link BalanceStrings} of the UtxoContext. - * @returns {BalanceStrings | undefined} - */ + * Current {@link BalanceStrings} of the UtxoContext. + * @returns {BalanceStrings | undefined} + */ get balanceStrings() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10399,17 +10941,17 @@ export class UtxoContext { } const UtxoEntriesFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_utxoentries_free(ptr >>> 0, 1)); /** -* A simple collection of UTXO entries. This struct is used to -* retain a set of UTXO entries in the WASM memory for faster -* processing. This struct keeps a list of entries represented -* by `UtxoEntryReference` struct. This data structure is used -* internally by the framework, but is exposed for convenience. -* Please consider using `UtxoContext` instead. -* @category Wallet SDK -*/ + * A simple collection of UTXO entries. This struct is used to + * retain a set of UTXO entries in the WASM memory for faster + * processing. This struct keeps a list of entries represented + * by `UtxoEntryReference` struct. This data structure is used + * internally by the framework, but is exposed for convenience. + * Please consider using `UtxoContext` instead. + * @category Wallet SDK + */ export class UtxoEntries { toJSON() { @@ -10434,9 +10976,9 @@ export class UtxoEntries { wasm.__wbg_utxoentries_free(ptr, 0); } /** - * Create a new `UtxoEntries` struct with a set of entries. - * @param {any} js_value - */ + * Create a new `UtxoEntries` struct with a set of entries. + * @param {any} js_value + */ constructor(js_value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10455,15 +10997,15 @@ export class UtxoEntries { } } /** - * @returns {any} - */ + * @returns {any} + */ get items() { const ret = wasm.utxoentries_get_items_as_js_array(this.__wbg_ptr); return takeObject(ret); } /** - * @param {any} js_value - */ + * @param {any} js_value + */ set items(js_value) { try { wasm.utxoentries_set_items_from_js_array(this.__wbg_ptr, addBorrowedObject(js_value)); @@ -10472,16 +11014,16 @@ export class UtxoEntries { } } /** - * Sort the contained entries by amount. Please note that - * this function is not intended for use with large UTXO sets - * as it duplicates the whole contained UTXO set while sorting. - */ + * Sort the contained entries by amount. Please note that + * this function is not intended for use with large UTXO sets + * as it duplicates the whole contained UTXO set while sorting. + */ sort() { wasm.utxoentries_sort(this.__wbg_ptr); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ amount() { const ret = wasm.utxoentries_amount(this.__wbg_ptr); return BigInt.asUintN(64, ret); @@ -10489,13 +11031,13 @@ export class UtxoEntries { } const UtxoEntryFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_utxoentry_free(ptr >>> 0, 1)); /** -* [`UtxoEntry`] struct represents a client-side UTXO entry. -* -* @category Wallet SDK -*/ + * [`UtxoEntry`] struct represents a client-side UTXO entry. + * + * @category Wallet SDK + */ export class UtxoEntry { static __wrap(ptr) { @@ -10533,15 +11075,15 @@ export class UtxoEntry { wasm.__wbg_utxoentry_free(ptr, 0); } /** - * @returns {Address | undefined} - */ + * @returns {Address | undefined} + */ get address() { const ret = wasm.__wbg_get_utxoentry_address(this.__wbg_ptr); return ret === 0 ? undefined : Address.__wrap(ret); } /** - * @param {Address | undefined} [arg0] - */ + * @param {Address | null} [arg0] + */ set address(arg0) { let ptr0 = 0; if (!isLikeNone(arg0)) { @@ -10551,77 +11093,77 @@ export class UtxoEntry { wasm.__wbg_set_utxoentry_address(this.__wbg_ptr, ptr0); } /** - * @returns {TransactionOutpoint} - */ + * @returns {TransactionOutpoint} + */ get outpoint() { const ret = wasm.__wbg_get_utxoentry_outpoint(this.__wbg_ptr); return TransactionOutpoint.__wrap(ret); } /** - * @param {TransactionOutpoint} arg0 - */ + * @param {TransactionOutpoint} arg0 + */ set outpoint(arg0) { _assertClass(arg0, TransactionOutpoint); var ptr0 = arg0.__destroy_into_raw(); wasm.__wbg_set_utxoentry_outpoint(this.__wbg_ptr, ptr0); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get amount() { const ret = wasm.__wbg_get_utxoentry_amount(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} arg0 - */ + * @param {bigint} arg0 + */ set amount(arg0) { wasm.__wbg_set_utxoentry_amount(this.__wbg_ptr, arg0); } /** - * @returns {ScriptPublicKey} - */ + * @returns {ScriptPublicKey} + */ get scriptPublicKey() { const ret = wasm.__wbg_get_utxoentry_scriptPublicKey(this.__wbg_ptr); return ScriptPublicKey.__wrap(ret); } /** - * @param {ScriptPublicKey} arg0 - */ + * @param {ScriptPublicKey} arg0 + */ set scriptPublicKey(arg0) { _assertClass(arg0, ScriptPublicKey); var ptr0 = arg0.__destroy_into_raw(); wasm.__wbg_set_utxoentry_scriptPublicKey(this.__wbg_ptr, ptr0); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get blockDaaScore() { const ret = wasm.__wbg_get_utxoentry_blockDaaScore(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @param {bigint} arg0 - */ + * @param {bigint} arg0 + */ set blockDaaScore(arg0) { wasm.__wbg_set_utxoentry_blockDaaScore(this.__wbg_ptr, arg0); } /** - * @returns {boolean} - */ + * @returns {boolean} + */ get isCoinbase() { const ret = wasm.__wbg_get_utxoentry_isCoinbase(this.__wbg_ptr); return ret !== 0; } /** - * @param {boolean} arg0 - */ + * @param {boolean} arg0 + */ set isCoinbase(arg0) { wasm.__wbg_set_utxoentry_isCoinbase(this.__wbg_ptr, arg0); } /** - * @returns {string} - */ + * @returns {string} + */ toString() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10640,13 +11182,13 @@ export class UtxoEntry { } const UtxoEntryReferenceFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_utxoentryreference_free(ptr >>> 0, 1)); /** -* [`Arc`] reference to a [`UtxoEntry`] used by the wallet subsystems. -* -* @category Wallet SDK -*/ + * [`Arc`] reference to a [`UtxoEntry`] used by the wallet subsystems. + * + * @category Wallet SDK + */ export class UtxoEntryReference { static __wrap(ptr) { @@ -10685,8 +11227,8 @@ export class UtxoEntryReference { wasm.__wbg_utxoentryreference_free(ptr, 0); } /** - * @returns {string} - */ + * @returns {string} + */ toString() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10703,50 +11245,50 @@ export class UtxoEntryReference { } } /** - * @returns {UtxoEntry} - */ + * @returns {UtxoEntry} + */ get entry() { const ret = wasm.utxoentryreference_entry(this.__wbg_ptr); return UtxoEntry.__wrap(ret); } /** - * @returns {TransactionOutpoint} - */ + * @returns {TransactionOutpoint} + */ get outpoint() { const ret = wasm.utxoentryreference_outpoint(this.__wbg_ptr); return TransactionOutpoint.__wrap(ret); } /** - * @returns {Address | undefined} - */ + * @returns {Address | undefined} + */ get address() { const ret = wasm.utxoentryreference_address(this.__wbg_ptr); return ret === 0 ? undefined : Address.__wrap(ret); } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get amount() { const ret = wasm.utxoentryreference_amount(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @returns {boolean} - */ + * @returns {boolean} + */ get isCoinbase() { const ret = wasm.utxoentryreference_isCoinbase(this.__wbg_ptr); return ret !== 0; } /** - * @returns {bigint} - */ + * @returns {bigint} + */ get blockDaaScore() { const ret = wasm.utxoentryreference_blockDaaScore(this.__wbg_ptr); return BigInt.asUintN(64, ret); } /** - * @returns {ScriptPublicKey} - */ + * @returns {ScriptPublicKey} + */ get scriptPublicKey() { const ret = wasm.utxoentryreference_scriptPublicKey(this.__wbg_ptr); return ScriptPublicKey.__wrap(ret); @@ -10754,22 +11296,22 @@ export class UtxoEntryReference { } const UtxoProcessorFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_utxoprocessor_free(ptr >>> 0, 1)); /** -* -* UtxoProcessor class is the main coordinator that manages UTXO processing -* between multiple UtxoContext instances. It acts as a bridge between the -* Kaspa node RPC connection, address subscriptions and UtxoContext instances. -* -* @see {@link IUtxoProcessorArgs}, -* {@link UtxoContext}, -* {@link RpcClient}, -* {@link NetworkId}, -* {@link IConnectEvent} -* {@link IDisconnectEvent} -* @category Wallet SDK -*/ + * + * UtxoProcessor class is the main coordinator that manages UTXO processing + * between multiple UtxoContext instances. It acts as a bridge between the + * Kaspa node RPC connection, address subscriptions and UtxoContext instances. + * + * @see {@link IUtxoProcessorArgs}, + * {@link UtxoContext}, + * {@link RpcClient}, + * {@link NetworkId}, + * {@link IConnectEvent} + * {@link IDisconnectEvent} + * @category Wallet SDK + */ export class UtxoProcessor { toJSON() { @@ -10796,9 +11338,9 @@ export class UtxoProcessor { wasm.__wbg_utxoprocessor_free(ptr, 0); } /** - * @param {string | UtxoProcessorNotificationCallback} event - * @param {UtxoProcessorNotificationCallback | undefined} [callback] - */ + * @param {string | UtxoProcessorNotificationCallback} event + * @param {UtxoProcessorNotificationCallback | null} [callback] + */ addEventListener(event, callback) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10813,9 +11355,9 @@ export class UtxoProcessor { } } /** - * @param {UtxoProcessorEventType | UtxoProcessorEventType[] | string | string[]} event - * @param {UtxoProcessorNotificationCallback | undefined} [callback] - */ + * @param {UtxoProcessorEventType | UtxoProcessorEventType[] | string | string[]} event + * @param {UtxoProcessorNotificationCallback | null} [callback] + */ removeEventListener(event, callback) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10830,13 +11372,13 @@ export class UtxoProcessor { } } /** - * UtxoProcessor constructor. - * - * - * - * @see {@link IUtxoProcessorArgs} - * @param {IUtxoProcessorArgs} js_value - */ + * UtxoProcessor constructor. + * + * + * + * @see {@link IUtxoProcessorArgs} + * @param {IUtxoProcessorArgs} js_value + */ constructor(js_value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10855,31 +11397,31 @@ export class UtxoProcessor { } } /** - * Starts the UtxoProcessor and begins processing UTXO and other notifications. - * @returns {Promise} - */ + * Starts the UtxoProcessor and begins processing UTXO and other notifications. + * @returns {Promise} + */ start() { const ret = wasm.utxoprocessor_start(this.__wbg_ptr); return takeObject(ret); } /** - * Stops the UtxoProcessor and ends processing UTXO and other notifications. - * @returns {Promise} - */ + * Stops the UtxoProcessor and ends processing UTXO and other notifications. + * @returns {Promise} + */ stop() { const ret = wasm.utxoprocessor_stop(this.__wbg_ptr); return takeObject(ret); } /** - * @returns {RpcClient} - */ + * @returns {RpcClient} + */ get rpc() { const ret = wasm.utxoprocessor_rpc(this.__wbg_ptr); return RpcClient.__wrap(ret); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get networkId() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10889,7 +11431,7 @@ export class UtxoProcessor { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -10897,8 +11439,8 @@ export class UtxoProcessor { } } /** - * @param {NetworkId | string} network_id - */ + * @param {NetworkId | string} network_id + */ setNetworkId(network_id) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10914,25 +11456,25 @@ export class UtxoProcessor { } } /** - * @returns {boolean} - */ + * @returns {boolean} + */ get isActive() { const ret = wasm.utxoprocessor_isActive(this.__wbg_ptr); return ret !== 0; } /** - * - * Set the coinbase transaction maturity period DAA score for a given network. - * This controls the DAA period after which the user transactions are considered mature - * and the wallet subsystem emits the transaction maturity event. - * - * @see {@link TransactionRecord} - * @see {@link IUtxoProcessorEvent} - * - * @category Wallet SDK - * @param {NetworkId | string} network_id - * @param {bigint} value - */ + * + * Set the coinbase transaction maturity period DAA score for a given network. + * This controls the DAA period after which the user transactions are considered mature + * and the wallet subsystem emits the transaction maturity event. + * + * @see {@link TransactionRecord} + * @see {@link IUtxoProcessorEvent} + * + * @category Wallet SDK + * @param {NetworkId | string} network_id + * @param {bigint} value + */ static setCoinbaseTransactionMaturityDAA(network_id, value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10948,18 +11490,18 @@ export class UtxoProcessor { } } /** - * - * Set the user transaction maturity period DAA score for a given network. - * This controls the DAA period after which the user transactions are considered mature - * and the wallet subsystem emits the transaction maturity event. - * - * @see {@link TransactionRecord} - * @see {@link IUtxoProcessorEvent} - * - * @category Wallet SDK - * @param {NetworkId | string} network_id - * @param {bigint} value - */ + * + * Set the user transaction maturity period DAA score for a given network. + * This controls the DAA period after which the user transactions are considered mature + * and the wallet subsystem emits the transaction maturity event. + * + * @see {@link TransactionRecord} + * @see {@link IUtxoProcessorEvent} + * + * @category Wallet SDK + * @param {NetworkId | string} network_id + * @param {bigint} value + */ static setUserTransactionMaturityDAA(network_id, value) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -10977,43 +11519,43 @@ export class UtxoProcessor { } const WalletFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_wallet_free(ptr >>> 0, 1)); /** -* -* Wallet class is the main coordinator that manages integrated wallet operations. -* -* The Wallet class encapsulates {@link UtxoProcessor} and provides internal -* account management using {@link UtxoContext} instances. It acts as a bridge -* between the integrated Wallet subsystem providing a high-level interface -* for wallet key and account management. -* -* The Rusty Kaspa is developed in Rust, and the Wallet class is a Rust implementation -* exposed to the JavaScript/TypeScript environment using the WebAssembly (WASM32) interface. -* As such, the Wallet implementation can be powered up using native Rust or built -* as a WebAssembly module and used in the browser or Node.js environment. -* -* When using Rust native or NodeJS environment, all wallet data is stored on the local -* filesystem. When using WASM32 build in the web browser, the wallet data is stored -* in the browser's `localStorage` and transaction records are stored in the `IndexedDB`. -* -* The Wallet API can create multiple wallet instances, however, only one wallet instance -* can be active at a time. -* -* The wallet implementation is designed to be efficient and support a large number -* of accounts. Accounts reside in storage and can be loaded and activated as needed. -* A `loaded` account contains all account information loaded from the permanent storage -* whereas an `active` account monitors the UTXO set and provides notifications for -* incoming and outgoing transactions as well as balance updates. -* -* The Wallet API communicates with the client using resource identifiers. These include -* account IDs, private key IDs, transaction IDs, etc. It is the responsibility of the -* client to track these resource identifiers at runtime. -* -* @see {@link IWalletConfig}, -* -* @category Wallet API -*/ + * + * Wallet class is the main coordinator that manages integrated wallet operations. + * + * The Wallet class encapsulates {@link UtxoProcessor} and provides internal + * account management using {@link UtxoContext} instances. It acts as a bridge + * between the integrated Wallet subsystem providing a high-level interface + * for wallet key and account management. + * + * The Rusty Kaspa is developed in Rust, and the Wallet class is a Rust implementation + * exposed to the JavaScript/TypeScript environment using the WebAssembly (WASM32) interface. + * As such, the Wallet implementation can be powered up using native Rust or built + * as a WebAssembly module and used in the browser or Node.js environment. + * + * When using Rust native or NodeJS environment, all wallet data is stored on the local + * filesystem. When using WASM32 build in the web browser, the wallet data is stored + * in the browser's `localStorage` and transaction records are stored in the `IndexedDB`. + * + * The Wallet API can create multiple wallet instances, however, only one wallet instance + * can be active at a time. + * + * The wallet implementation is designed to be efficient and support a large number + * of accounts. Accounts reside in storage and can be loaded and activated as needed. + * A `loaded` account contains all account information loaded from the permanent storage + * whereas an `active` account monitors the UTXO set and provides notifications for + * incoming and outgoing transactions as well as balance updates. + * + * The Wallet API communicates with the client using resource identifiers. These include + * account IDs, private key IDs, transaction IDs, etc. It is the responsibility of the + * client to track these resource identifiers at runtime. + * + * @see {@link IWalletConfig}, + * + * @category Wallet API + */ export class Wallet { toJSON() { @@ -11041,470 +11583,576 @@ export class Wallet { wasm.__wbg_wallet_free(ptr, 0); } /** - * @param {IWalletConfig} config - */ - constructor(config) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.wallet_constructor(retptr, addHeapObject(config)); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); - if (r2) { - throw takeObject(r1); - } - this.__wbg_ptr = r0 >>> 0; - WalletFinalization.register(this, this.__wbg_ptr, this); - return this; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + * Ping backend + * @see {@link IBatchRequest} {@link IBatchResponse} + * @throws `string` in case of an error. + * @param {IBatchRequest} request + * @returns {Promise} + */ + batch(request) { + const ret = wasm.wallet_batch(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); } /** - * @returns {RpcClient} - */ - get rpc() { - const ret = wasm.wallet_rpc(this.__wbg_ptr); - return RpcClient.__wrap(ret); + * @see {@link IFlushRequest} {@link IFlushResponse} + * @throws `string` in case of an error. + * @param {IFlushRequest} request + * @returns {Promise} + */ + flush(request) { + const ret = wasm.wallet_flush(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); } /** - * @remarks This is a local property indicating - * if the wallet is currently open. - * @returns {boolean} - */ - get isOpen() { - const ret = wasm.wallet_isOpen(this.__wbg_ptr); - return ret !== 0; + * @see {@link IRetainContextRequest} {@link IRetainContextResponse} + * @throws `string` in case of an error. + * @param {IRetainContextRequest} request + * @returns {Promise} + */ + retainContext(request) { + const ret = wasm.wallet_retainContext(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); } /** - * @remarks This is a local property indicating - * if the node is currently synced. - * @returns {boolean} - */ - get isSynced() { - const ret = wasm.wallet_isSynced(this.__wbg_ptr); - return ret !== 0; + * @see {@link IGetStatusRequest} {@link IGetStatusResponse} + * @throws `string` in case of an error. + * @param {IGetStatusRequest} request + * @returns {Promise} + */ + getStatus(request) { + const ret = wasm.wallet_getStatus(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); } /** - * @returns {WalletDescriptor | undefined} - */ - get descriptor() { - const ret = wasm.wallet_descriptor(this.__wbg_ptr); - return ret === 0 ? undefined : WalletDescriptor.__wrap(ret); + * @see {@link IWalletEnumerateRequest} {@link IWalletEnumerateResponse} + * @throws `string` in case of an error. + * @param {IWalletEnumerateRequest} request + * @returns {Promise} + */ + walletEnumerate(request) { + const ret = wasm.wallet_walletEnumerate(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); } /** - * Check if a wallet with a given name exists. - * @param {string | undefined} [name] - * @returns {Promise} - */ - exists(name) { - var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - var len0 = WASM_VECTOR_LEN; - const ret = wasm.wallet_exists(this.__wbg_ptr, ptr0, len0); + * @see {@link IWalletCreateRequest} {@link IWalletCreateResponse} + * @throws `string` in case of an error. + * @param {IWalletCreateRequest} request + * @returns {Promise} + */ + walletCreate(request) { + const ret = wasm.wallet_walletCreate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * @returns {Promise} - */ - start() { - const ret = wasm.wallet_start(this.__wbg_ptr); + * @see {@link IWalletOpenRequest} {@link IWalletOpenResponse} + * @throws `string` in case of an error. + * @param {IWalletOpenRequest} request + * @returns {Promise} + */ + walletOpen(request) { + const ret = wasm.wallet_walletOpen(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * @returns {Promise} - */ - stop() { - const ret = wasm.wallet_stop(this.__wbg_ptr); + * @see {@link IWalletReloadRequest} {@link IWalletReloadResponse} + * @throws `string` in case of an error. + * @param {IWalletReloadRequest} request + * @returns {Promise} + */ + walletReload(request) { + const ret = wasm.wallet_walletReload(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - * @param {IConnectOptions | undefined | undefined} [args] - * @returns {Promise} - */ - connect(args) { - const ret = wasm.wallet_connect(this.__wbg_ptr, isLikeNone(args) ? 0 : addHeapObject(args)); - return takeObject(ret); - } - /** - * @returns {Promise} - */ - disconnect() { - const ret = wasm.wallet_disconnect(this.__wbg_ptr); - return takeObject(ret); - } - /** - * @param {string | WalletNotificationCallback} event - * @param {WalletNotificationCallback | undefined} [callback] - */ - addEventListener(event, callback) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.wallet_addEventListener(retptr, this.__wbg_ptr, addHeapObject(event), isLikeNone(callback) ? 0 : addHeapObject(callback)); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - if (r1) { - throw takeObject(r0); - } - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } - } - /** - * @param {WalletEventType | WalletEventType[] | string | string[]} event - * @param {WalletNotificationCallback | undefined} [callback] - */ - removeEventListener(event, callback) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.wallet_removeEventListener(retptr, this.__wbg_ptr, addHeapObject(event), isLikeNone(callback) ? 0 : addHeapObject(callback)); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - if (r1) { - throw takeObject(r0); - } - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } - } - /** - * Ping backend - *@see {@link IBatchRequest} {@link IBatchResponse} - *@throws `string` in case of an error. - * @param {IBatchRequest} request - * @returns {Promise} - */ - batch(request) { - const ret = wasm.wallet_batch(this.__wbg_ptr, addHeapObject(request)); - return takeObject(ret); - } - /** - *@see {@link IFlushRequest} {@link IFlushResponse} - *@throws `string` in case of an error. - * @param {IFlushRequest} request - * @returns {Promise} - */ - flush(request) { - const ret = wasm.wallet_flush(this.__wbg_ptr, addHeapObject(request)); - return takeObject(ret); - } - /** - *@see {@link IRetainContextRequest} {@link IRetainContextResponse} - *@throws `string` in case of an error. - * @param {IRetainContextRequest} request - * @returns {Promise} - */ - retainContext(request) { - const ret = wasm.wallet_retainContext(this.__wbg_ptr, addHeapObject(request)); - return takeObject(ret); - } - /** - *@see {@link IGetStatusRequest} {@link IGetStatusResponse} - *@throws `string` in case of an error. - * @param {IGetStatusRequest} request - * @returns {Promise} - */ - getStatus(request) { - const ret = wasm.wallet_getStatus(this.__wbg_ptr, addHeapObject(request)); - return takeObject(ret); - } - /** - *@see {@link IWalletEnumerateRequest} {@link IWalletEnumerateResponse} - *@throws `string` in case of an error. - * @param {IWalletEnumerateRequest} request - * @returns {Promise} - */ - walletEnumerate(request) { - const ret = wasm.wallet_walletEnumerate(this.__wbg_ptr, addHeapObject(request)); - return takeObject(ret); - } - /** - *@see {@link IWalletCreateRequest} {@link IWalletCreateResponse} - *@throws `string` in case of an error. - * @param {IWalletCreateRequest} request - * @returns {Promise} - */ - walletCreate(request) { - const ret = wasm.wallet_walletCreate(this.__wbg_ptr, addHeapObject(request)); - return takeObject(ret); - } - /** - *@see {@link IWalletOpenRequest} {@link IWalletOpenResponse} - *@throws `string` in case of an error. - * @param {IWalletOpenRequest} request - * @returns {Promise} - */ - walletOpen(request) { - const ret = wasm.wallet_walletOpen(this.__wbg_ptr, addHeapObject(request)); - return takeObject(ret); - } - /** - *@see {@link IWalletReloadRequest} {@link IWalletReloadResponse} - *@throws `string` in case of an error. - * @param {IWalletReloadRequest} request - * @returns {Promise} - */ - walletReload(request) { - const ret = wasm.wallet_walletReload(this.__wbg_ptr, addHeapObject(request)); - return takeObject(ret); - } - /** - *@see {@link IWalletCloseRequest} {@link IWalletCloseResponse} - *@throws `string` in case of an error. - * @param {IWalletCloseRequest} request - * @returns {Promise} - */ + * @see {@link IWalletCloseRequest} {@link IWalletCloseResponse} + * @throws `string` in case of an error. + * @param {IWalletCloseRequest} request + * @returns {Promise} + */ walletClose(request) { const ret = wasm.wallet_walletClose(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IWalletChangeSecretRequest} {@link IWalletChangeSecretResponse} - *@throws `string` in case of an error. - * @param {IWalletChangeSecretRequest} request - * @returns {Promise} - */ + * @see {@link IWalletChangeSecretRequest} {@link IWalletChangeSecretResponse} + * @throws `string` in case of an error. + * @param {IWalletChangeSecretRequest} request + * @returns {Promise} + */ walletChangeSecret(request) { const ret = wasm.wallet_walletChangeSecret(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IWalletExportRequest} {@link IWalletExportResponse} - *@throws `string` in case of an error. - * @param {IWalletExportRequest} request - * @returns {Promise} - */ + * @see {@link IWalletExportRequest} {@link IWalletExportResponse} + * @throws `string` in case of an error. + * @param {IWalletExportRequest} request + * @returns {Promise} + */ walletExport(request) { const ret = wasm.wallet_walletExport(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IWalletImportRequest} {@link IWalletImportResponse} - *@throws `string` in case of an error. - * @param {IWalletImportRequest} request - * @returns {Promise} - */ + * @see {@link IWalletImportRequest} {@link IWalletImportResponse} + * @throws `string` in case of an error. + * @param {IWalletImportRequest} request + * @returns {Promise} + */ walletImport(request) { const ret = wasm.wallet_walletImport(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IPrvKeyDataEnumerateRequest} {@link IPrvKeyDataEnumerateResponse} - *@throws `string` in case of an error. - * @param {IPrvKeyDataEnumerateRequest} request - * @returns {Promise} - */ + * @see {@link IPrvKeyDataEnumerateRequest} {@link IPrvKeyDataEnumerateResponse} + * @throws `string` in case of an error. + * @param {IPrvKeyDataEnumerateRequest} request + * @returns {Promise} + */ prvKeyDataEnumerate(request) { const ret = wasm.wallet_prvKeyDataEnumerate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IPrvKeyDataCreateRequest} {@link IPrvKeyDataCreateResponse} - *@throws `string` in case of an error. - * @param {IPrvKeyDataCreateRequest} request - * @returns {Promise} - */ + * @see {@link IPrvKeyDataCreateRequest} {@link IPrvKeyDataCreateResponse} + * @throws `string` in case of an error. + * @param {IPrvKeyDataCreateRequest} request + * @returns {Promise} + */ prvKeyDataCreate(request) { const ret = wasm.wallet_prvKeyDataCreate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IPrvKeyDataRemoveRequest} {@link IPrvKeyDataRemoveResponse} - *@throws `string` in case of an error. - * @param {IPrvKeyDataRemoveRequest} request - * @returns {Promise} - */ + * @see {@link IPrvKeyDataRemoveRequest} {@link IPrvKeyDataRemoveResponse} + * @throws `string` in case of an error. + * @param {IPrvKeyDataRemoveRequest} request + * @returns {Promise} + */ prvKeyDataRemove(request) { const ret = wasm.wallet_prvKeyDataRemove(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IPrvKeyDataGetRequest} {@link IPrvKeyDataGetResponse} - *@throws `string` in case of an error. - * @param {IPrvKeyDataGetRequest} request - * @returns {Promise} - */ + * @see {@link IPrvKeyDataGetRequest} {@link IPrvKeyDataGetResponse} + * @throws `string` in case of an error. + * @param {IPrvKeyDataGetRequest} request + * @returns {Promise} + */ prvKeyDataGet(request) { const ret = wasm.wallet_prvKeyDataGet(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsEnumerateRequest} {@link IAccountsEnumerateResponse} - *@throws `string` in case of an error. - * @param {IAccountsEnumerateRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsEnumerateRequest} {@link IAccountsEnumerateResponse} + * @throws `string` in case of an error. + * @param {IAccountsEnumerateRequest} request + * @returns {Promise} + */ accountsEnumerate(request) { const ret = wasm.wallet_accountsEnumerate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsRenameRequest} {@link IAccountsRenameResponse} - *@throws `string` in case of an error. - * @param {IAccountsRenameRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsRenameRequest} {@link IAccountsRenameResponse} + * @throws `string` in case of an error. + * @param {IAccountsRenameRequest} request + * @returns {Promise} + */ accountsRename(request) { const ret = wasm.wallet_accountsRename(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsDiscoveryRequest} {@link IAccountsDiscoveryResponse} - *@throws `string` in case of an error. - * @param {IAccountsDiscoveryRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsDiscoveryRequest} {@link IAccountsDiscoveryResponse} + * @throws `string` in case of an error. + * @param {IAccountsDiscoveryRequest} request + * @returns {Promise} + */ accountsDiscovery(request) { const ret = wasm.wallet_accountsDiscovery(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsCreateRequest} {@link IAccountsCreateResponse} - *@throws `string` in case of an error. - * @param {IAccountsCreateRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsCreateRequest} {@link IAccountsCreateResponse} + * @throws `string` in case of an error. + * @param {IAccountsCreateRequest} request + * @returns {Promise} + */ accountsCreate(request) { const ret = wasm.wallet_accountsCreate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsEnsureDefaultRequest} {@link IAccountsEnsureDefaultResponse} - *@throws `string` in case of an error. - * @param {IAccountsEnsureDefaultRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsEnsureDefaultRequest} {@link IAccountsEnsureDefaultResponse} + * @throws `string` in case of an error. + * @param {IAccountsEnsureDefaultRequest} request + * @returns {Promise} + */ accountsEnsureDefault(request) { const ret = wasm.wallet_accountsEnsureDefault(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsImportRequest} {@link IAccountsImportResponse} - *@throws `string` in case of an error. - * @param {IAccountsImportRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsImportRequest} {@link IAccountsImportResponse} + * @throws `string` in case of an error. + * @param {IAccountsImportRequest} request + * @returns {Promise} + */ accountsImport(request) { const ret = wasm.wallet_accountsImport(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsActivateRequest} {@link IAccountsActivateResponse} - *@throws `string` in case of an error. - * @param {IAccountsActivateRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsActivateRequest} {@link IAccountsActivateResponse} + * @throws `string` in case of an error. + * @param {IAccountsActivateRequest} request + * @returns {Promise} + */ accountsActivate(request) { const ret = wasm.wallet_accountsActivate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsDeactivateRequest} {@link IAccountsDeactivateResponse} - *@throws `string` in case of an error. - * @param {IAccountsDeactivateRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsDeactivateRequest} {@link IAccountsDeactivateResponse} + * @throws `string` in case of an error. + * @param {IAccountsDeactivateRequest} request + * @returns {Promise} + */ accountsDeactivate(request) { const ret = wasm.wallet_accountsDeactivate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsGetRequest} {@link IAccountsGetResponse} - *@throws `string` in case of an error. - * @param {IAccountsGetRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsGetRequest} {@link IAccountsGetResponse} + * @throws `string` in case of an error. + * @param {IAccountsGetRequest} request + * @returns {Promise} + */ accountsGet(request) { const ret = wasm.wallet_accountsGet(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsCreateNewAddressRequest} {@link IAccountsCreateNewAddressResponse} - *@throws `string` in case of an error. - * @param {IAccountsCreateNewAddressRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsCreateNewAddressRequest} {@link IAccountsCreateNewAddressResponse} + * @throws `string` in case of an error. + * @param {IAccountsCreateNewAddressRequest} request + * @returns {Promise} + */ accountsCreateNewAddress(request) { const ret = wasm.wallet_accountsCreateNewAddress(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsSendRequest} {@link IAccountsSendResponse} - *@throws `string` in case of an error. - * @param {IAccountsSendRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsSendRequest} {@link IAccountsSendResponse} + * @throws `string` in case of an error. + * @param {IAccountsSendRequest} request + * @returns {Promise} + */ accountsSend(request) { const ret = wasm.wallet_accountsSend(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsTransferRequest} {@link IAccountsTransferResponse} - *@throws `string` in case of an error. - * @param {IAccountsTransferRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsPskbSignRequest} {@link IAccountsPskbSignResponse} + * @throws `string` in case of an error. + * @param {IAccountsPskbSignRequest} request + * @returns {Promise} + */ + accountsPskbSign(request) { + const ret = wasm.wallet_accountsPskbSign(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @see {@link IAccountsPskbBroadcastRequest} {@link IAccountsPskbBroadcastResponse} + * @throws `string` in case of an error. + * @param {IAccountsPskbBroadcastRequest} request + * @returns {Promise} + */ + accountsPskbBroadcast(request) { + const ret = wasm.wallet_accountsPskbBroadcast(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @see {@link IAccountsPskbSendRequest} {@link IAccountsPskbSendResponse} + * @throws `string` in case of an error. + * @param {IAccountsPskbSendRequest} request + * @returns {Promise} + */ + accountsPskbSend(request) { + const ret = wasm.wallet_accountsPskbSend(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @see {@link IAccountsGetUtxosRequest} {@link IAccountsGetUtxosResponse} + * @throws `string` in case of an error. + * @param {IAccountsGetUtxosRequest} request + * @returns {Promise} + */ + accountsGetUtxos(request) { + const ret = wasm.wallet_accountsGetUtxos(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @see {@link IAccountsTransferRequest} {@link IAccountsTransferResponse} + * @throws `string` in case of an error. + * @param {IAccountsTransferRequest} request + * @returns {Promise} + */ accountsTransfer(request) { const ret = wasm.wallet_accountsTransfer(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAccountsEstimateRequest} {@link IAccountsEstimateResponse} - *@throws `string` in case of an error. - * @param {IAccountsEstimateRequest} request - * @returns {Promise} - */ + * @see {@link IAccountsEstimateRequest} {@link IAccountsEstimateResponse} + * @throws `string` in case of an error. + * @param {IAccountsEstimateRequest} request + * @returns {Promise} + */ accountsEstimate(request) { const ret = wasm.wallet_accountsEstimate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link ITransactionsDataGetRequest} {@link ITransactionsDataGetResponse} - *@throws `string` in case of an error. - * @param {ITransactionsDataGetRequest} request - * @returns {Promise} - */ + * @see {@link ITransactionsDataGetRequest} {@link ITransactionsDataGetResponse} + * @throws `string` in case of an error. + * @param {ITransactionsDataGetRequest} request + * @returns {Promise} + */ transactionsDataGet(request) { const ret = wasm.wallet_transactionsDataGet(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link ITransactionsReplaceNoteRequest} {@link ITransactionsReplaceNoteResponse} - *@throws `string` in case of an error. - * @param {ITransactionsReplaceNoteRequest} request - * @returns {Promise} - */ + * @see {@link ITransactionsReplaceNoteRequest} {@link ITransactionsReplaceNoteResponse} + * @throws `string` in case of an error. + * @param {ITransactionsReplaceNoteRequest} request + * @returns {Promise} + */ transactionsReplaceNote(request) { const ret = wasm.wallet_transactionsReplaceNote(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link ITransactionsReplaceMetadataRequest} {@link ITransactionsReplaceMetadataResponse} - *@throws `string` in case of an error. - * @param {ITransactionsReplaceMetadataRequest} request - * @returns {Promise} - */ + * @see {@link ITransactionsReplaceMetadataRequest} {@link ITransactionsReplaceMetadataResponse} + * @throws `string` in case of an error. + * @param {ITransactionsReplaceMetadataRequest} request + * @returns {Promise} + */ transactionsReplaceMetadata(request) { const ret = wasm.wallet_transactionsReplaceMetadata(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } /** - *@see {@link IAddressBookEnumerateRequest} {@link IAddressBookEnumerateResponse} - *@throws `string` in case of an error. - * @param {IAddressBookEnumerateRequest} request - * @returns {Promise} - */ + * @see {@link IAddressBookEnumerateRequest} {@link IAddressBookEnumerateResponse} + * @throws `string` in case of an error. + * @param {IAddressBookEnumerateRequest} request + * @returns {Promise} + */ addressBookEnumerate(request) { const ret = wasm.wallet_addressBookEnumerate(this.__wbg_ptr, addHeapObject(request)); return takeObject(ret); } + /** + * @see {@link IFeeRateEstimateRequest} {@link IFeeRateEstimateResponse} + * @throws `string` in case of an error. + * @param {IFeeRateEstimateRequest} request + * @returns {Promise} + */ + feeRateEstimate(request) { + const ret = wasm.wallet_feeRateEstimate(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @see {@link IFeeRatePollerEnableRequest} {@link IFeeRatePollerEnableResponse} + * @throws `string` in case of an error. + * @param {IFeeRatePollerEnableRequest} request + * @returns {Promise} + */ + feeRatePollerEnable(request) { + const ret = wasm.wallet_feeRatePollerEnable(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @see {@link IFeeRatePollerDisableRequest} {@link IFeeRatePollerDisableResponse} + * @throws `string` in case of an error. + * @param {IFeeRatePollerDisableRequest} request + * @returns {Promise} + */ + feeRatePollerDisable(request) { + const ret = wasm.wallet_feeRatePollerDisable(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @see {@link IAccountsCommitRevealRequest} {@link IAccountsCommitRevealResponse} + * @throws `string` in case of an error. + * @param {IAccountsCommitRevealRequest} request + * @returns {Promise} + */ + accountsCommitReveal(request) { + const ret = wasm.wallet_accountsCommitReveal(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @see {@link IAccountsCommitRevealManualRequest} {@link IAccountsCommitRevealManualResponse} + * @throws `string` in case of an error. + * @param {IAccountsCommitRevealManualRequest} request + * @returns {Promise} + */ + accountsCommitRevealManual(request) { + const ret = wasm.wallet_accountsCommitRevealManual(this.__wbg_ptr, addHeapObject(request)); + return takeObject(ret); + } + /** + * @param {IWalletConfig} config + */ + constructor(config) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.wallet_constructor(retptr, addHeapObject(config)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + this.__wbg_ptr = r0 >>> 0; + WalletFinalization.register(this, this.__wbg_ptr, this); + return this; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {RpcClient} + */ + get rpc() { + const ret = wasm.wallet_rpc(this.__wbg_ptr); + return RpcClient.__wrap(ret); + } + /** + * @remarks This is a local property indicating + * if the wallet is currently open. + * @returns {boolean} + */ + get isOpen() { + const ret = wasm.wallet_isOpen(this.__wbg_ptr); + return ret !== 0; + } + /** + * @remarks This is a local property indicating + * if the node is currently synced. + * @returns {boolean} + */ + get isSynced() { + const ret = wasm.wallet_isSynced(this.__wbg_ptr); + return ret !== 0; + } + /** + * @returns {WalletDescriptor | undefined} + */ + get descriptor() { + const ret = wasm.wallet_descriptor(this.__wbg_ptr); + return ret === 0 ? undefined : WalletDescriptor.__wrap(ret); + } + /** + * Check if a wallet with a given name exists. + * @param {string | null} [name] + * @returns {Promise} + */ + exists(name) { + var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len0 = WASM_VECTOR_LEN; + const ret = wasm.wallet_exists(this.__wbg_ptr, ptr0, len0); + return takeObject(ret); + } + /** + * @returns {Promise} + */ + start() { + const ret = wasm.wallet_start(this.__wbg_ptr); + return takeObject(ret); + } + /** + * @returns {Promise} + */ + stop() { + const ret = wasm.wallet_stop(this.__wbg_ptr); + return takeObject(ret); + } + /** + * @param {IConnectOptions | undefined | null} [args] + * @returns {Promise} + */ + connect(args) { + const ret = wasm.wallet_connect(this.__wbg_ptr, isLikeNone(args) ? 0 : addHeapObject(args)); + return takeObject(ret); + } + /** + * @returns {Promise} + */ + disconnect() { + const ret = wasm.wallet_disconnect(this.__wbg_ptr); + return takeObject(ret); + } + /** + * @param {string | WalletNotificationCallback} event + * @param {WalletNotificationCallback | null} [callback] + */ + addEventListener(event, callback) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.wallet_addEventListener(retptr, this.__wbg_ptr, addHeapObject(event), isLikeNone(callback) ? 0 : addHeapObject(callback)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {WalletEventType | WalletEventType[] | string | string[]} event + * @param {WalletNotificationCallback | null} [callback] + */ + removeEventListener(event, callback) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.wallet_removeEventListener(retptr, this.__wbg_ptr, addHeapObject(event), isLikeNone(callback) ? 0 : addHeapObject(callback)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {NetworkId | string} network_id + */ + setNetworkId(network_id) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.wallet_setNetworkId(retptr, this.__wbg_ptr, addHeapObject(network_id)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } } const WalletDescriptorFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_walletdescriptor_free(ptr >>> 0, 1)); /** -* @category Wallet API -*/ + * @category Wallet API + */ export class WalletDescriptor { static __wrap(ptr) { @@ -11538,8 +12186,8 @@ export class WalletDescriptor { wasm.__wbg_walletdescriptor_free(ptr, 0); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get title() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -11549,7 +12197,7 @@ export class WalletDescriptor { let v1; if (r0 !== 0) { v1 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 1, 1); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); } return v1; } finally { @@ -11557,16 +12205,16 @@ export class WalletDescriptor { } } /** - * @param {string | undefined} [arg0] - */ + * @param {string | null} [arg0] + */ set title(arg0) { - var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); var len0 = WASM_VECTOR_LEN; wasm.__wbg_set_walletdescriptor_title(this.__wbg_ptr, ptr0, len0); } /** - * @returns {string} - */ + * @returns {string} + */ get filename() { let deferred1_0; let deferred1_1; @@ -11580,24 +12228,23 @@ export class WalletDescriptor { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @param {string} arg0 - */ + * @param {string} arg0 + */ set filename(arg0) { - const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.__wbg_set_walletdescriptor_filename(this.__wbg_ptr, ptr0, len0); } } const WasiOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_wasioptions_free(ptr >>> 0, 1)); -/** -*/ + export class WasiOptions { static __wrap(ptr) { @@ -11620,12 +12267,12 @@ export class WasiOptions { wasm.__wbg_wasioptions_free(ptr, 0); } /** - * @param {any[] | undefined} args - * @param {object | undefined} env - * @param {object} preopens - */ + * @param {any[] | null | undefined} args + * @param {object | null | undefined} env + * @param {object} preopens + */ constructor(args, env, preopens) { - var ptr0 = isLikeNone(args) ? 0 : passArrayJsValueToWasm0(args, wasm.__wbindgen_export_0); + var ptr0 = isLikeNone(args) ? 0 : passArrayJsValueToWasm0(args, wasm.__wbindgen_export_1); var len0 = WASM_VECTOR_LEN; const ret = wasm.wasioptions_new_with_values(ptr0, len0, isLikeNone(env) ? 0 : addHeapObject(env), addHeapObject(preopens)); this.__wbg_ptr = ret >>> 0; @@ -11633,16 +12280,16 @@ export class WasiOptions { return this; } /** - * @param {object} preopens - * @returns {WasiOptions} - */ + * @param {object} preopens + * @returns {WasiOptions} + */ static new(preopens) { const ret = wasm.wasioptions_new(addHeapObject(preopens)); return WasiOptions.__wrap(ret); } /** - * @returns {any[] | undefined} - */ + * @returns {any[] | undefined} + */ get args() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -11652,7 +12299,7 @@ export class WasiOptions { let v1; if (r0 !== 0) { v1 = getArrayJsValueFromWasm0(r0, r1).slice(); - wasm.__wbindgen_export_17(r0, r1 * 4, 4); + wasm.__wbindgen_export_3(r0, r1 * 4, 4); } return v1; } finally { @@ -11660,46 +12307,45 @@ export class WasiOptions { } } /** - * @param {any[] | undefined} [value] - */ + * @param {any[] | null} [value] + */ set args(value) { - var ptr0 = isLikeNone(value) ? 0 : passArrayJsValueToWasm0(value, wasm.__wbindgen_export_0); + var ptr0 = isLikeNone(value) ? 0 : passArrayJsValueToWasm0(value, wasm.__wbindgen_export_1); var len0 = WASM_VECTOR_LEN; wasm.wasioptions_set_args(this.__wbg_ptr, ptr0, len0); } /** - * @returns {object | undefined} - */ + * @returns {object | undefined} + */ get env() { const ret = wasm.wasioptions_env(this.__wbg_ptr); return takeObject(ret); } /** - * @param {object | undefined} [value] - */ + * @param {object | null} [value] + */ set env(value) { wasm.wasioptions_set_env(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {object} - */ + * @returns {object} + */ get preopens() { const ret = wasm.wasioptions_preopens(this.__wbg_ptr); return takeObject(ret); } /** - * @param {object} value - */ + * @param {object} value + */ set preopens(value) { wasm.wasioptions_set_preopens(this.__wbg_ptr, addHeapObject(value)); } } const WriteFileSyncOptionsFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_writefilesyncoptions_free(ptr >>> 0, 1)); -/** -*/ + export class WriteFileSyncOptions { __destroy_into_raw() { @@ -11714,66 +12360,59 @@ export class WriteFileSyncOptions { wasm.__wbg_writefilesyncoptions_free(ptr, 0); } /** - * @param {string | undefined} [encoding] - * @param {string | undefined} [flag] - * @param {number | undefined} [mode] - */ + * @param {string | null} [encoding] + * @param {string | null} [flag] + * @param {number | null} [mode] + */ constructor(encoding, flag, mode) { - const ret = wasm.writefilesyncoptions_new(isLikeNone(encoding) ? 0 : addHeapObject(encoding), isLikeNone(flag) ? 0 : addHeapObject(flag), !isLikeNone(mode), isLikeNone(mode) ? 0 : mode); + const ret = wasm.writefilesyncoptions_new(isLikeNone(encoding) ? 0 : addHeapObject(encoding), isLikeNone(flag) ? 0 : addHeapObject(flag), isLikeNone(mode) ? 0x100000001 : (mode) >>> 0); this.__wbg_ptr = ret >>> 0; WriteFileSyncOptionsFinalization.register(this, this.__wbg_ptr, this); return this; } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get encoding() { const ret = wasm.writefilesyncoptions_encoding(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set encoding(value) { wasm.writefilesyncoptions_set_encoding(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {string | undefined} - */ + * @returns {string | undefined} + */ get flag() { const ret = wasm.writefilesyncoptions_flag(this.__wbg_ptr); return takeObject(ret); } /** - * @param {string | undefined} [value] - */ + * @param {string | null} [value] + */ set flag(value) { wasm.writefilesyncoptions_set_flag(this.__wbg_ptr, isLikeNone(value) ? 0 : addHeapObject(value)); } /** - * @returns {number | undefined} - */ + * @returns {number | undefined} + */ get mode() { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.writefilesyncoptions_mode(retptr, this.__wbg_ptr); - var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); - var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); - return r0 === 0 ? undefined : r1 >>> 0; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } + const ret = wasm.writefilesyncoptions_mode(this.__wbg_ptr); + return ret === 0x100000001 ? undefined : ret; } /** - * @param {number | undefined} [value] - */ + * @param {number | null} [value] + */ set mode(value) { - wasm.writefilesyncoptions_set_mode(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value); + wasm.writefilesyncoptions_set_mode(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0); } } const WriteStreamFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_writestream_free(ptr >>> 0, 1)); export class WriteStream { @@ -11790,9 +12429,9 @@ export class WriteStream { wasm.__wbg_writestream_free(ptr, 0); } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ add_listener_with_open(listener) { try { const ret = wasm.writestream_add_listener_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11802,9 +12441,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ add_listener_with_close(listener) { try { const ret = wasm.writestream_add_listener_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11814,9 +12453,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ on_with_open(listener) { try { const ret = wasm.writestream_on_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11826,9 +12465,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ on_with_close(listener) { try { const ret = wasm.writestream_on_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11838,9 +12477,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ once_with_open(listener) { try { const ret = wasm.writestream_once_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11850,9 +12489,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ once_with_close(listener) { try { const ret = wasm.writestream_once_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11862,9 +12501,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ prepend_listener_with_open(listener) { try { const ret = wasm.writestream_prepend_listener_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11874,9 +12513,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ prepend_listener_with_close(listener) { try { const ret = wasm.writestream_prepend_listener_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11886,9 +12525,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ prepend_once_listener_with_open(listener) { try { const ret = wasm.writestream_prepend_once_listener_with_open(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11898,9 +12537,9 @@ export class WriteStream { } } /** - * @param {Function} listener - * @returns {any} - */ + * @param {Function} listener + * @returns {any} + */ prepend_once_listener_with_close(listener) { try { const ret = wasm.writestream_prepend_once_listener_with_close(this.__wbg_ptr, addBorrowedObject(listener)); @@ -11912,17 +12551,17 @@ export class WriteStream { } const XOnlyPublicKeyFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_xonlypublickey_free(ptr >>> 0, 1)); /** -* -* Data structure that envelopes a XOnlyPublicKey. -* -* XOnlyPublicKey is used as a payload part of the {@link Address}. -* -* @see {@link PublicKey} -* @category Wallet SDK -*/ + * + * Data structure that envelopes a XOnlyPublicKey. + * + * XOnlyPublicKey is used as a payload part of the {@link Address}. + * + * @see {@link PublicKey} + * @category Wallet SDK + */ export class XOnlyPublicKey { static __wrap(ptr) { @@ -11945,12 +12584,12 @@ export class XOnlyPublicKey { wasm.__wbg_xonlypublickey_free(ptr, 0); } /** - * @param {string} key - */ + * @param {string} key + */ constructor(key) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.xonlypublickey_try_new(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -11967,8 +12606,8 @@ export class XOnlyPublicKey { } } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred1_0; let deferred1_1; @@ -11982,16 +12621,16 @@ export class XOnlyPublicKey { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * Get the [`Address`] of this XOnlyPublicKey. - * Receives a [`NetworkType`] to determine the prefix of the address. - * JavaScript: `let address = xOnlyPublicKey.toAddress(NetworkType.MAINNET);`. - * @param {NetworkType | NetworkId | string} network - * @returns {Address} - */ + * Get the [`Address`] of this XOnlyPublicKey. + * Receives a [`NetworkType`] to determine the prefix of the address. + * JavaScript: `let address = xOnlyPublicKey.toAddress(NetworkType.MAINNET);`. + * @param {NetworkType | NetworkId | string} network + * @returns {Address} + */ toAddress(network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12009,12 +12648,12 @@ export class XOnlyPublicKey { } } /** - * Get `ECDSA` [`Address`] of this XOnlyPublicKey. - * Receives a [`NetworkType`] to determine the prefix of the address. - * JavaScript: `let address = xOnlyPublicKey.toAddress(NetworkType.MAINNET);`. - * @param {NetworkType | NetworkId | string} network - * @returns {Address} - */ + * Get `ECDSA` [`Address`] of this XOnlyPublicKey. + * Receives a [`NetworkType`] to determine the prefix of the address. + * JavaScript: `let address = xOnlyPublicKey.toAddress(NetworkType.MAINNET);`. + * @param {NetworkType | NetworkId | string} network + * @returns {Address} + */ toAddressECDSA(network) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12032,9 +12671,9 @@ export class XOnlyPublicKey { } } /** - * @param {Address} address - * @returns {XOnlyPublicKey} - */ + * @param {Address} address + * @returns {XOnlyPublicKey} + */ static fromAddress(address) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12054,20 +12693,20 @@ export class XOnlyPublicKey { } const XPrvFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_xprv_free(ptr >>> 0, 1)); /** -* -* Extended private key (XPrv). -* -* This class allows accepts a master seed and provides -* functions for derivation of dependent child private keys. -* -* Please note that Kaspa extended private keys use `kprv` prefix. -* -* @see {@link PrivateKeyGenerator}, {@link PublicKeyGenerator}, {@link XPub}, {@link Mnemonic} -* @category Wallet SDK -*/ + * + * Extended private key (XPrv). + * + * This class allows accepts a master seed and provides + * functions for derivation of dependent child private keys. + * + * Please note that Kaspa extended private keys use `kprv` prefix. + * + * @see {@link PrivateKeyGenerator}, {@link PublicKeyGenerator}, {@link XPub}, {@link Mnemonic} + * @category Wallet SDK + */ export class XPrv { static __wrap(ptr) { @@ -12105,8 +12744,8 @@ export class XPrv { wasm.__wbg_xprv_free(ptr, 0); } /** - * @param {HexString} seed - */ + * @param {HexString} seed + */ constructor(seed) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12125,14 +12764,14 @@ export class XPrv { } } /** - * Create {@link XPrv} from `xprvxxxx..` string - * @param {string} xprv - * @returns {XPrv} - */ + * Create {@link XPrv} from `xprvxxxx..` string + * @param {string} xprv + * @returns {XPrv} + */ static fromXPrv(xprv) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(xprv, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(xprv, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.xprv_fromXPrv(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -12147,10 +12786,10 @@ export class XPrv { } } /** - * @param {number} child_number - * @param {boolean | undefined} [hardened] - * @returns {XPrv} - */ + * @param {number} child_number + * @param {boolean | null} [hardened] + * @returns {XPrv} + */ deriveChild(child_number, hardened) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12167,9 +12806,9 @@ export class XPrv { } } /** - * @param {any} path - * @returns {XPrv} - */ + * @param {any} path + * @returns {XPrv} + */ derivePath(path) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12187,15 +12826,15 @@ export class XPrv { } } /** - * @param {string} prefix - * @returns {string} - */ + * @param {string} prefix + * @returns {string} + */ intoString(prefix) { let deferred3_0; let deferred3_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.xprv_intoString(retptr, this.__wbg_ptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -12213,12 +12852,12 @@ export class XPrv { return getStringFromWasm0(ptr2, len2); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred3_0, deferred3_1, 1); + wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ toString() { let deferred2_0; let deferred2_1; @@ -12240,12 +12879,12 @@ export class XPrv { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * @returns {XPub} - */ + * @returns {XPub} + */ toXPub() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12262,8 +12901,8 @@ export class XPrv { } } /** - * @returns {PrivateKey} - */ + * @returns {PrivateKey} + */ toPrivateKey() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12280,8 +12919,8 @@ export class XPrv { } } /** - * @returns {string} - */ + * @returns {string} + */ get xprv() { let deferred2_0; let deferred2_1; @@ -12303,12 +12942,12 @@ export class XPrv { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * @returns {string} - */ + * @returns {string} + */ get privateKey() { let deferred1_0; let deferred1_1; @@ -12322,19 +12961,19 @@ export class XPrv { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {number} - */ + * @returns {number} + */ get depth() { const ret = wasm.xprv_depth(this.__wbg_ptr); return ret; } /** - * @returns {string} - */ + * @returns {string} + */ get parentFingerprint() { let deferred1_0; let deferred1_1; @@ -12348,19 +12987,19 @@ export class XPrv { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {number} - */ + * @returns {number} + */ get childNumber() { const ret = wasm.xprv_childNumber(this.__wbg_ptr); return ret >>> 0; } /** - * @returns {string} - */ + * @returns {string} + */ get chainCode() { let deferred1_0; let deferred1_1; @@ -12374,26 +13013,26 @@ export class XPrv { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } const XPubFinalization = (typeof FinalizationRegistry === 'undefined') - ? { register: () => { }, unregister: () => { } } + ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_xpub_free(ptr >>> 0, 1)); /** -* -* Extended public key (XPub). -* -* This class allows accepts another XPub and and provides -* functions for derivation of dependent child public keys. -* -* Please note that Kaspa extended public keys use `kpub` prefix. -* -* @see {@link PrivateKeyGenerator}, {@link PublicKeyGenerator}, {@link XPrv}, {@link Mnemonic} -* @category Wallet SDK -*/ + * + * Extended public key (XPub). + * + * This class allows accepts another XPub and and provides + * functions for derivation of dependent child public keys. + * + * Please note that Kaspa extended public keys use `kpub` prefix. + * + * @see {@link PrivateKeyGenerator}, {@link PublicKeyGenerator}, {@link XPrv}, {@link Mnemonic} + * @category Wallet SDK + */ export class XPub { static __wrap(ptr) { @@ -12430,12 +13069,12 @@ export class XPub { wasm.__wbg_xpub_free(ptr, 0); } /** - * @param {string} xpub - */ + * @param {string} xpub + */ constructor(xpub) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(xpub, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(xpub, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.xpub_try_new(retptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -12452,10 +13091,10 @@ export class XPub { } } /** - * @param {number} child_number - * @param {boolean | undefined} [hardened] - * @returns {XPub} - */ + * @param {number} child_number + * @param {boolean | null} [hardened] + * @returns {XPub} + */ deriveChild(child_number, hardened) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12472,9 +13111,9 @@ export class XPub { } } /** - * @param {any} path - * @returns {XPub} - */ + * @param {any} path + * @returns {XPub} + */ derivePath(path) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); @@ -12492,15 +13131,15 @@ export class XPub { } } /** - * @param {string} prefix - * @returns {string} - */ + * @param {string} prefix + * @returns {string} + */ intoString(prefix) { let deferred3_0; let deferred3_1; try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len0 = WASM_VECTOR_LEN; wasm.xpub_intoString(retptr, this.__wbg_ptr, ptr0, len0); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); @@ -12518,19 +13157,19 @@ export class XPub { return getStringFromWasm0(ptr2, len2); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred3_0, deferred3_1, 1); + wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1); } } /** - * @returns {PublicKey} - */ + * @returns {PublicKey} + */ toPublicKey() { const ret = wasm.xpub_toPublicKey(this.__wbg_ptr); return PublicKey.__wrap(ret); } /** - * @returns {string} - */ + * @returns {string} + */ get xpub() { let deferred2_0; let deferred2_1; @@ -12552,19 +13191,19 @@ export class XPub { return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred2_0, deferred2_1, 1); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); } } /** - * @returns {number} - */ + * @returns {number} + */ get depth() { const ret = wasm.xpub_depth(this.__wbg_ptr); return ret; } /** - * @returns {string} - */ + * @returns {string} + */ get parentFingerprint() { let deferred1_0; let deferred1_1; @@ -12578,19 +13217,19 @@ export class XPub { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } /** - * @returns {number} - */ + * @returns {number} + */ get childNumber() { const ret = wasm.xpub_childNumber(this.__wbg_ptr); return ret >>> 0; } /** - * @returns {string} - */ + * @returns {string} + */ get chainCode() { let deferred1_0; let deferred1_1; @@ -12604,7 +13243,7 @@ export class XPub { return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_export_17(deferred1_0, deferred1_1, 1); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); } } } @@ -12617,7 +13256,7 @@ async function __wbg_load(module, imports) { } catch (e) { if (module.headers.get('Content-Type') != 'application/wasm') { - console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); } else { throw e; @@ -12643,433 +13282,420 @@ async function __wbg_load(module, imports) { function __wbg_get_imports() { const imports = {}; imports.wbg = {}; - imports.wbg.__wbindgen_object_clone_ref = function (arg0) { - const ret = getObject(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_crypto_1d1f22824a6a080c = function (arg0) { - const ret = getObject(arg0).crypto; + imports.wbg.__wbg_BigInt_470dd987b8190f8e = function(arg0) { + const ret = BigInt(getObject(arg0)); return addHeapObject(ret); }; - imports.wbg.__wbindgen_is_object = function (arg0) { - const val = getObject(arg0); - const ret = typeof (val) === 'object' && val !== null; - return ret; - }; - imports.wbg.__wbg_process_4a72847cc503995b = function (arg0) { - const ret = getObject(arg0).process; + imports.wbg.__wbg_BigInt_ddea6d2f55558acb = function() { return handleError(function (arg0) { + const ret = BigInt(getObject(arg0)); return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) { + const ret = String(getObject(arg1)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbg_versions_f686565e586dd935 = function (arg0) { - const ret = getObject(arg0).versions; + imports.wbg.__wbg_Window_b0044ac7db258535 = function(arg0) { + const ret = getObject(arg0).Window; return addHeapObject(ret); }; - imports.wbg.__wbg_node_104a2ff8d6ea03a2 = function (arg0) { - const ret = getObject(arg0).node; + imports.wbg.__wbg_WorkerGlobalScope_b74cefefc62a37da = function(arg0) { + const ret = getObject(arg0).WorkerGlobalScope; return addHeapObject(ret); }; - imports.wbg.__wbindgen_is_string = function (arg0) { - const ret = typeof (getObject(arg0)) === 'string'; - return ret; - }; - imports.wbg.__wbindgen_object_drop_ref = function (arg0) { - takeObject(arg0); - }; - imports.wbg.__wbg_require_cca90b1a94a0255b = function () { - return handleError(function () { - const ret = module.require; - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) { + getObject(arg0).abort(); }; - imports.wbg.__wbindgen_is_function = function (arg0) { - const ret = typeof (getObject(arg0)) === 'function'; - return ret; + imports.wbg.__wbg_aborted_new = function(arg0) { + const ret = Aborted.__wrap(arg0); + return addHeapObject(ret); }; - imports.wbg.__wbindgen_string_new = function (arg0, arg1) { - const ret = getStringFromWasm0(arg0, arg1); + imports.wbg.__wbg_accountkind_new = function(arg0) { + const ret = AccountKind.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function (arg0) { - const ret = getObject(arg0).msCrypto; + imports.wbg.__wbg_addListener_d78339dd4535b756 = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).addListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); return addHeapObject(ret); }; - imports.wbg.__wbg_newwithlength_ec548f448387c968 = function (arg0) { - const ret = new Uint8Array(arg0 >>> 0); + imports.wbg.__wbg_address_new = function(arg0) { + const ret = Address.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbindgen_memory = function () { - const ret = wasm.memory; + imports.wbg.__wbg_advance_b3ccc91b80962d79 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).advance(arg1 >>> 0); + }, arguments) }; + imports.wbg.__wbg_appendChild_8204974b7328bf98 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).appendChild(getObject(arg1)); return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_body_942ea927546a04ba = function(arg0) { + const ret = getObject(arg0).body; + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_buffer_b7b08af79b0b0974 = function (arg0) { + imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) { const ret = getObject(arg0).buffer; return addHeapObject(ret); }; - imports.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function (arg0, arg1, arg2) { - const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).call(getObject(arg1)); return addHeapObject(ret); - }; - imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function () { - return handleError(function (arg0, arg1) { - getObject(arg0).randomFillSync(takeObject(arg1)); - }, arguments) - }; - imports.wbg.__wbg_subarray_7c2e3576afe181d1 = function (arg0, arg1, arg2) { - const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); + }, arguments) }; + imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_cancelAnimationFrame_032049cb190240a7 = function(arg0) { + cancelAnimationFrame(takeObject(arg0)); }; - imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function () { - return handleError(function (arg0, arg1) { - getObject(arg0).getRandomValues(getObject(arg1)); - }, arguments) - }; - imports.wbg.__wbg_new_ea1883e1e5e86686 = function (arg0) { - const ret = new Uint8Array(getObject(arg0)); + imports.wbg.__wbg_clearInterval_d472232e2fb5e5e4 = function() { return handleError(function (arg0) { + clearInterval(getObject(arg0)); + }, arguments) }; + imports.wbg.__wbg_clearTimeout_c5ac0f4b6a07b59e = function() { return handleError(function (arg0) { + clearTimeout(getObject(arg0)); + }, arguments) }; + imports.wbg.__wbg_close_0880036443561527 = function() { return handleError(function (arg0) { + getObject(arg0).close(); + }, arguments) }; + imports.wbg.__wbg_continue_c46c11d3dbe1b030 = function() { return handleError(function (arg0) { + getObject(arg0).continue(); + }, arguments) }; + imports.wbg.__wbg_count_613cb921d67a4f26 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).count(); return addHeapObject(ret); - }; - imports.wbg.__wbg_set_d1e79e2388520f18 = function (arg0, arg1, arg2) { - getObject(arg0).set(getObject(arg1), arg2 >>> 0); - }; - imports.wbg.__wbg_open_e8f45f3526088828 = function () { - return handleError(function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_transaction_5a1543682e4ad921 = function () { - return handleError(function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2), ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup",][arg3]); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_createObjectStore_190c19a0bae3fedb = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_setonversionchange_b1a0928064e9b758 = function (arg0, arg1) { - getObject(arg0).onversionchange = getObject(arg1); - }; - imports.wbg.__wbg_Window_6a2291ac118902bc = function (arg0) { - const ret = getObject(arg0).Window; + }, arguments) }; + imports.wbg.__wbg_createElement_8c9931a732ee2fea = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2)); return addHeapObject(ret); - }; - imports.wbg.__wbindgen_is_undefined = function (arg0) { - const ret = getObject(arg0) === undefined; - return ret; - }; - imports.wbg.__wbg_WorkerGlobalScope_e82ddd4027f19bb8 = function (arg0) { - const ret = getObject(arg0).WorkerGlobalScope; + }, arguments) }; + imports.wbg.__wbg_createIndex_873ac48adc772309 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + const ret = getObject(arg0).createIndex(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4)); return addHeapObject(ret); - }; - imports.wbg.__wbg_global_12bfcc55465b53ad = function (arg0) { - const ret = getObject(arg0).global; + }, arguments) }; + imports.wbg.__wbg_createObjectStore_e566459f7161f82f = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764 = function() { return handleError(function (arg0, arg1) { + const ret = URL.createObjectURL(getObject(arg1)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) { + const ret = getObject(arg0).crypto; return addHeapObject(ret); }; - imports.wbg.__wbg_indexedDB_1f9ee79bddf7d011 = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).indexedDB; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_indexedDB_9d299adf9543d0c3 = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).indexedDB; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_indexedDB_59bf81be2abc635d = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).indexedDB; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_setoncomplete_a9e0ec1d6568a6d9 = function (arg0, arg1) { - getObject(arg0).oncomplete = getObject(arg1); - }; - imports.wbg.__wbg_setonerror_00500154a07e987d = function (arg0, arg1) { - getObject(arg0).onerror = getObject(arg1); - }; - imports.wbg.__wbg_setonabort_aedc77f0151af20c = function (arg0, arg1) { - getObject(arg0).onabort = getObject(arg1); - }; - imports.wbg.__wbg_target_b7cb1739bee70928 = function (arg0) { - const ret = getObject(arg0).target; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_error_1221bc1f1d0b14d3 = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).error; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_result_fd2dae625828961d = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).result; - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_setonupgradeneeded_8f3f0ac5d7130a6f = function (arg0, arg1) { - getObject(arg0).onupgradeneeded = getObject(arg1); - }; - imports.wbg.__wbg_setonblocked_554fa1541fe66a16 = function (arg0, arg1) { - getObject(arg0).onblocked = getObject(arg1); - }; - imports.wbg.__wbindgen_number_get = function (arg0, arg1) { - const obj = getObject(arg1); - const ret = typeof (obj) === 'number' ? obj : undefined; - getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); - }; - imports.wbg.__wbg_readyState_80e6a6c7d538fa33 = function (arg0) { - const ret = getObject(arg0).readyState; - return { "pending": 0, "done": 1, }[ret] ?? 2; - }; - imports.wbg.__wbg_setonsuccess_962c293b6e38a5d5 = function (arg0, arg1) { - getObject(arg0).onsuccess = getObject(arg1); - }; - imports.wbg.__wbg_setonerror_bd61d0a61808ca40 = function (arg0, arg1) { - getObject(arg0).onerror = getObject(arg1); - }; - imports.wbg.__wbg_createIndex_6d4c3e20ee0f1066 = function () { - return handleError(function (arg0, arg1, arg2, arg3, arg4) { - const ret = getObject(arg0).createIndex(getStringFromWasm0(arg1, arg2), getObject(arg3), getObject(arg4)); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_objectStore_80724f9f6d33ab5b = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_data_432d9c3df2630942 = function(arg0) { + const ret = getObject(arg0).data; + return addHeapObject(ret); }; - imports.wbg.__wbindgen_is_null = function (arg0) { - const ret = getObject(arg0) === null; + imports.wbg.__wbg_delete_200677093b4cf756 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).delete(getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_delete_36c8630e530a2a1a = function(arg0, arg1) { + const ret = getObject(arg0).delete(getObject(arg1)); return ret; }; - imports.wbg.__wbg_get_224d16597dbbfd96 = function () { - return handleError(function (arg0, arg1) { - const ret = Reflect.get(getObject(arg0), getObject(arg1)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_document_d249400bd7bd996d = function(arg0) { + const ret = getObject(arg0).document; + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_now_a69647afb1f66247 = function (arg0) { - const ret = getObject(arg0).now(); + imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) { + const ret = getObject(arg0).done; return ret; }; - imports.wbg.__wbg_get_3baa728f9d58d3f6 = function (arg0, arg1) { - const ret = getObject(arg0)[arg1 >>> 0]; + imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) { + const ret = Object.entries(getObject(arg0)); return addHeapObject(ret); }; - imports.wbg.__wbg_length_ae22078168b726f5 = function (arg0) { - const ret = getObject(arg0).length; - return ret; - }; - imports.wbg.__wbg_new_a220cf903aa02ca2 = function () { - const ret = new Array(); + imports.wbg.__wbg_entries_c8a90a7ed73e84ce = function(arg0) { + const ret = getObject(arg0).entries(); return addHeapObject(ret); }; - imports.wbg.__wbg_new_8608a2b51a5f6737 = function () { - const ret = new Map(); - return addHeapObject(ret); + imports.wbg.__wbg_error_5edc95999c70d386 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1); + } }; - imports.wbg.__wbg_next_f9cb570345655b9a = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).next(); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_error_b5d62a6100a65a3b = function(arg0, arg1) { + console.error(getStringFromWasm0(arg0, arg1)); }; - imports.wbg.__wbg_done_bfda7aa8f252b39f = function (arg0) { - const ret = getObject(arg0).done; + imports.wbg.__wbg_error_ff4ddaabdfc5dbb3 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).error; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_existsSync_6b2031627aea3e5a = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).existsSync(getStringFromWasm0(arg1, arg2)); return ret; - }; - imports.wbg.__wbg_value_6d39332ab4788d86 = function (arg0) { - const ret = getObject(arg0).value; + }, arguments) }; + imports.wbg.__wbg_fetch_509096533071c657 = function(arg0, arg1) { + const ret = getObject(arg0).fetch(getObject(arg1)); return addHeapObject(ret); }; - imports.wbg.__wbg_iterator_888179a48810a9fe = function () { - const ret = Symbol.iterator; + imports.wbg.__wbg_fetch_7bb58c5ed3c31810 = function(arg0) { + const ret = fetch(getObject(arg0)); return addHeapObject(ret); }; - imports.wbg.__wbg_call_1084a111329e68ce = function () { - return handleError(function (arg0, arg1) { - const ret = getObject(arg0).call(getObject(arg1)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) { + const ret = String.fromCodePoint(arg0 >>> 0); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) { + const ret = Array.from(getObject(arg0)); + return addHeapObject(ret); }; - imports.wbg.__wbg_next_de3e9db4440638b2 = function (arg0) { - const ret = getObject(arg0).next; + imports.wbg.__wbg_from_d608a04300bfd9ac = function(arg0) { + const ret = Buffer.from(getObject(arg0)); return addHeapObject(ret); }; - imports.wbg.__wbg_new_525245e2b9901204 = function () { - const ret = new Object(); + imports.wbg.__wbg_generatorsummary_new = function(arg0) { + const ret = GeneratorSummary.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_self_3093d5d1f7bcb682 = function () { - return handleError(function () { - const ret = self.self; - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_getItem_17f98dee3b43fa7e = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = getObject(arg1).getItem(getStringFromWasm0(arg2, arg3)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).getRandomValues(getObject(arg1)); + }, arguments) }; + imports.wbg.__wbg_get_13495dac72693ecc = function(arg0, arg1) { + const ret = getObject(arg0).get(getObject(arg1)); + return addHeapObject(ret); }; - imports.wbg.__wbg_window_3bcfc4d31bc012f8 = function () { - return handleError(function () { - const ret = window.window; + imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_get_8da03f81f6a1111e = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).get(getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_get_a8e28596722a45ff = function() { return handleError(function (arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + const ret = chrome.storage.local.get(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); - }, arguments) + } finally { + wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1); + } + }, arguments) }; + imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return addHeapObject(ret); }; - imports.wbg.__wbg_globalThis_86b222e13bdf32ed = function () { - return handleError(function () { - const ret = globalThis.globalThis; - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_get_f1f75752f252b231 = function() { return handleError(function () { + const ret = chrome.storage.local.get(); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) { + const ret = getObject(arg0)[getObject(arg1)]; + return addHeapObject(ret); }; - imports.wbg.__wbg_global_e5a3fe56f8be9485 = function () { - return handleError(function () { - const ret = global.global; - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_global_b6f5c73312f62313 = function(arg0) { + const ret = getObject(arg0).global; + return addHeapObject(ret); }; - imports.wbg.__wbg_newnoargs_76313bd6ff35d0f2 = function (arg0, arg1) { - const ret = new Function(getStringFromWasm0(arg0, arg1)); + imports.wbg.__wbg_has_a5ea9117f258a0ec = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.has(getObject(arg0), getObject(arg1)); + return ret; + }, arguments) }; + imports.wbg.__wbg_hash_new = function(arg0) { + const ret = Hash.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_set_673dda6c73d19609 = function (arg0, arg1, arg2) { - getObject(arg0)[arg1 >>> 0] = takeObject(arg2); + imports.wbg.__wbg_headers_9cb51cfd2ac780a4 = function(arg0) { + const ret = getObject(arg0).headers; + return addHeapObject(ret); }; - imports.wbg.__wbg_from_0791d740a9d37830 = function (arg0) { - const ret = Array.from(getObject(arg0)); + imports.wbg.__wbg_index_e00ca5fff206ee3e = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2)); return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_indexedDB_601ec26c63e333de = function() { return handleError(function (arg0) { + const ret = getObject(arg0).indexedDB; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_indexedDB_b1f49280282046f8 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).indexedDB; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_indexedDB_f6b47b0dc333fd2f = function() { return handleError(function (arg0) { + const ret = getObject(arg0).indexedDB; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_innerHTML_e1553352fe93921a = function(arg0, arg1) { + const ret = getObject(arg1).innerHTML; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbg_isArray_8364a5371e9737d8 = function (arg0) { - const ret = Array.isArray(getObject(arg0)); + imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ArrayBuffer; + } catch (_) { + result = false; + } + const ret = result; return ret; }; - imports.wbg.__wbg_push_37c89022f34c01ca = function (arg0, arg1) { - const ret = getObject(arg0).push(getObject(arg1)); + imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Map; + } catch (_) { + result = false; + } + const ret = result; return ret; }; - imports.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function (arg0) { + imports.wbg.__wbg_instanceof_Object_7f2dcef8f78644a4 = function(arg0) { let result; try { - result = getObject(arg0) instanceof ArrayBuffer; + result = getObject(arg0) instanceof Object; } catch (_) { result = false; } const ret = result; return ret; }; - imports.wbg.__wbg_new_7695fb2ba274b094 = function (arg0) { - const ret = new ArrayBuffer(arg0 >>> 0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_BigInt_38f8da7386bbae76 = function () { - return handleError(function (arg0) { - const ret = BigInt(getObject(arg0)); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_BigInt_c180ff1ada0e172c = function (arg0) { - const ret = BigInt(getObject(arg0)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_toString_2e14737b6219a1c7 = function () { - return handleError(function (arg0, arg1) { - const ret = getObject(arg0).toString(arg1); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_toString_515790fe476e2613 = function (arg0, arg1, arg2) { - const ret = getObject(arg1).toString(arg2); - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - const len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + imports.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Response; + } catch (_) { + result = false; + } + const ret = result; + return ret; }; - imports.wbg.__wbg_call_89af060b4e1523f2 = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Uint8Array; + } catch (_) { + result = false; + } + const ret = result; + return ret; }; - imports.wbg.__wbg_instanceof_Map_763ce0e95960d55e = function (arg0) { + imports.wbg.__wbg_instanceof_Window_def73ea0955fc569 = function(arg0) { let result; try { - result = getObject(arg0) instanceof Map; + result = getObject(arg0) instanceof Window; } catch (_) { result = false; } const ret = result; return ret; }; - imports.wbg.__wbg_delete_4c9190c1892c9b79 = function (arg0, arg1) { - const ret = getObject(arg0).delete(getObject(arg1)); + imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) { + const ret = Array.isArray(getObject(arg0)); return ret; }; - imports.wbg.__wbg_get_5a402b270e32a550 = function (arg0, arg1) { - const ret = getObject(arg0).get(getObject(arg1)); - return addHeapObject(ret); + imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) { + const ret = Number.isSafeInteger(getObject(arg0)); + return ret; }; - imports.wbg.__wbg_set_49185437f0ab06f8 = function (arg0, arg1, arg2) { - const ret = getObject(arg0).set(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); + imports.wbg.__wbg_is_c7481c65e7e5df9e = function(arg0, arg1) { + const ret = Object.is(getObject(arg0), getObject(arg1)); + return ret; }; - imports.wbg.__wbg_entries_2f5ddf03b53c6730 = function (arg0) { - const ret = getObject(arg0).entries(); + imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() { + const ret = Symbol.iterator; return addHeapObject(ret); }; - imports.wbg.__wbg_isSafeInteger_7f1ed56200d90674 = function (arg0) { - const ret = Number.isSafeInteger(getObject(arg0)); - return ret; - }; - imports.wbg.__wbg_new0_65387337a95cf44d = function () { - const ret = new Date(); + imports.wbg.__wbg_key_c5e0a01cf450dca2 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg1).key(arg2 >>> 0); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_keys_5c77a08ddc2fb8a6 = function(arg0) { + const ret = Object.keys(getObject(arg0)); return addHeapObject(ret); }; - imports.wbg.__wbg_now_b7a162010a9e75b4 = function () { - const ret = Date.now(); + imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) { + const ret = getObject(arg0).length; return ret; }; - imports.wbg.__wbg_setTime_07f7863c994c1d6f = function (arg0, arg1) { - const ret = getObject(arg0).setTime(arg1); + imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) { + const ret = getObject(arg0).length; return ret; }; - imports.wbg.__wbg_instanceof_Object_b80213ae6cc9aafb = function (arg0) { - let result; - try { - result = getObject(arg0) instanceof Object; - } catch (_) { - result = false; - } - const ret = result; + imports.wbg.__wbg_length_ed4a84b02b798bda = function() { return handleError(function (arg0) { + const ret = getObject(arg0).length; return ret; + }, arguments) }; + imports.wbg.__wbg_localStorage_1406c99c39728187 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).localStorage; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_location_350d99456c2f3693 = function(arg0) { + const ret = getObject(arg0).location; + return addHeapObject(ret); }; - imports.wbg.__wbg_entries_7a0e06255456ebcd = function (arg0) { - const ret = Object.entries(getObject(arg0)); + imports.wbg.__wbg_log_6c164928aa7b57f4 = function(arg0, arg1) { + console.log(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg_mkdirSync_29d1fd92bf140bd0 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + getObject(arg0).mkdirSync(getStringFromWasm0(arg1, arg2), takeObject(arg3)); + }, arguments) }; + imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) { + const ret = getObject(arg0).msCrypto; return addHeapObject(ret); }; - imports.wbg.__wbg_is_009b1ef508712fda = function (arg0, arg1) { - const ret = Object.is(getObject(arg0), getObject(arg1)); - return ret; + imports.wbg.__wbg_navigator_1577371c070c8947 = function(arg0) { + const ret = getObject(arg0).navigator; + return addHeapObject(ret); }; - imports.wbg.__wbg_keys_7840ae453e408eab = function (arg0) { - const ret = Object.keys(getObject(arg0)); + imports.wbg.__wbg_networkid_new = function(arg0) { + const ret = NetworkId.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_fromCodePoint_ae875c4ff5f6a86b = function () { - return handleError(function (arg0) { - const ret = String.fromCodePoint(arg0 >>> 0); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_new0_f788a2397c7ca929 = function() { + const ret = new Date(); + return addHeapObject(ret); }; - imports.wbg.__wbg_new_b85e72ed1bfd57f9 = function (arg0, arg1) { + imports.wbg.__wbg_new_018dcc2d6c8c2f6a = function() { return handleError(function () { + const ret = new Headers(); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_new_0b790fd655ff1a97 = function() { return handleError(function (arg0, arg1) { + const ret = new WebSocket(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) { try { - var state0 = { a: arg0, b: arg1 }; + var state0 = {a: arg0, b: arg1}; var cb0 = (arg0, arg1) => { const a = state0.a; state0.a = 0; try { - return __wbg_adapter_218(a, state0.b, arg0, arg1); + return __wbg_adapter_199(a, state0.b, arg0, arg1); } finally { state0.a = a; } @@ -13080,836 +13706,660 @@ function __wbg_get_imports() { state0.a = state0.b = 0; } }; - imports.wbg.__wbg_resolve_570458cb99d56a43 = function (arg0) { - const ret = Promise.resolve(getObject(arg0)); + imports.wbg.__wbg_new_405e22f390576ce2 = function() { + const ret = new Object(); return addHeapObject(ret); }; - imports.wbg.__wbg_then_95e6edc0f89b73b1 = function (arg0, arg1) { - const ret = getObject(arg0).then(getObject(arg1)); + imports.wbg.__wbg_new_5e0be73521bc8c17 = function() { + const ret = new Map(); return addHeapObject(ret); }; - imports.wbg.__wbg_then_876bb3c633745cc6 = function (arg0, arg1, arg2) { - const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); + imports.wbg.__wbg_new_757fd34d47ff40d2 = function(arg0) { + const ret = new ArrayBuffer(arg0 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_length_8339fcf5d8ecd12e = function (arg0) { - const ret = getObject(arg0).length; - return ret; - }; - imports.wbg.__wbg_instanceof_Uint8Array_247a91427532499e = function (arg0) { - let result; - try { - result = getObject(arg0) instanceof Uint8Array; - } catch (_) { - result = false; - } - const ret = result; - return ret; - }; - imports.wbg.__wbg_stringify_bbf45426c92a6bf5 = function () { - return handleError(function (arg0) { - const ret = JSON.stringify(getObject(arg0)); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbindgen_string_get = function (arg0, arg1) { - const obj = getObject(arg1); - const ret = typeof (obj) === 'string' ? obj : undefined; - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - var len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }; - imports.wbg.__wbg_has_4bfbc01db38743f7 = function () { - return handleError(function (arg0, arg1) { - const ret = Reflect.has(getObject(arg0), getObject(arg1)); - return ret; - }, arguments) - }; - imports.wbg.__wbg_set_eacc7d73fefaafdf = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); - return ret; - }, arguments) - }; - imports.wbg.__wbindgen_is_array = function (arg0) { - const ret = Array.isArray(getObject(arg0)); - return ret; - }; - imports.wbg.__wbg_address_new = function (arg0) { - const ret = Address.__wrap(arg0); + imports.wbg.__wbg_new_78feb108b6472713 = function() { + const ret = new Array(); return addHeapObject(ret); }; - imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) { - const ret = getObject(arg0) == getObject(arg1); - return ret; - }; - imports.wbg.__wbindgen_boolean_get = function (arg0) { - const v = getObject(arg0); - const ret = typeof (v) === 'boolean' ? (v ? 1 : 0) : 2; - return ret; + imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) { + const ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); }; - imports.wbg.__wbindgen_is_bigint = function (arg0) { - const ret = typeof (getObject(arg0)) === 'bigint'; - return ret; + imports.wbg.__wbg_new_b1a33e5095abf678 = function() { return handleError(function (arg0, arg1) { + const ret = new Worker(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_new_e25e5aab09ff45db = function() { return handleError(function () { + const ret = new AbortController(); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_new_f5f8a7325e1cb479 = function() { + const ret = new Error(); + return addHeapObject(ret); }; - imports.wbg.__wbindgen_in = function (arg0, arg1) { - const ret = getObject(arg0) in getObject(arg1); - return ret; + imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); }; - imports.wbg.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) { - const v = getObject(arg1); - const ret = typeof (v) === 'bigint' ? v : undefined; - getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); + imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) { + const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); }; - imports.wbg.__wbindgen_bigint_from_i64 = function (arg0) { - const ret = arg0; + imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) { + const ret = new Uint8Array(arg0 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbindgen_jsval_eq = function (arg0, arg1) { - const ret = getObject(arg0) === getObject(arg1); - return ret; + imports.wbg.__wbg_newwithnodejsconfigimpl_b0a2d4e5b0763676 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + const ret = new WebSocket(getStringFromWasm0(arg0, arg1), takeObject(arg2), takeObject(arg3), takeObject(arg4), takeObject(arg5), takeObject(arg6)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_newwithstrandinit_06c535e0a867c635 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_newwithstrsequenceandoptions_aaff55b467c81b63 = function() { return handleError(function (arg0, arg1) { + const ret = new Blob(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) { + const ret = getObject(arg0).next; + return addHeapObject(ret); }; - imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) { - const ret = BigInt.asUintN(64, arg0); + imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).next(); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) { + const ret = getObject(arg0).node; return addHeapObject(ret); }; - imports.wbg.__wbindgen_error_new = function (arg0, arg1) { - const ret = new Error(getStringFromWasm0(arg0, arg1)); + imports.wbg.__wbg_nodedescriptor_new = function(arg0) { + const ret = NodeDescriptor.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbindgen_as_number = function (arg0) { - const ret = +getObject(arg0); + imports.wbg.__wbg_now_807e54c39636c349 = function() { + const ret = Date.now(); return ret; }; - imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) { - const ret = getObject(arg0)[getObject(arg1)]; - return addHeapObject(ret); + imports.wbg.__wbg_now_d18023d54d4e5500 = function(arg0) { + const ret = getObject(arg0).now(); + return ret; }; - imports.wbg.__wbindgen_number_new = function (arg0) { - const ret = arg0; + imports.wbg.__wbg_objectStore_21878d46d25b64b6 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2)); return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_oldVersion_e8337811e52861c6 = function(arg0) { + const ret = getObject(arg0).oldVersion; + return ret; }; - imports.wbg.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) { - getObject(arg0)[takeObject(arg1)] = takeObject(arg2); - }; - imports.wbg.__wbg_utxoentryreference_new = function (arg0) { - const ret = UtxoEntryReference.__wrap(arg0); + imports.wbg.__wbg_on_9ef8de87725b93b5 = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).on(getStringFromWasm0(arg1, arg2), getObject(arg3)); return addHeapObject(ret); }; - imports.wbg.__wbg_transactionoutput_new = function (arg0) { - const ret = TransactionOutput.__wrap(arg0); + imports.wbg.__wbg_once_8901720a31f56808 = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).once(getStringFromWasm0(arg1, arg2), getObject(arg3)); return addHeapObject(ret); }; - imports.wbg.__wbg_transactioninput_new = function (arg0) { - const ret = TransactionInput.__wrap(arg0); + imports.wbg.__wbg_openCursor_d8ea5d621ec422f8 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).openCursor(getObject(arg1), __wbindgen_enum_IdbCursorDirection[arg2]); return addHeapObject(ret); - }; - imports.wbg.__wbg_transaction_new = function (arg0) { - const ret = Transaction.__wrap(arg0); + }, arguments) }; + imports.wbg.__wbg_open_e0c0b2993eb596e1 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_pendingtransaction_new = function(arg0) { + const ret = PendingTransaction.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbindgen_try_into_number = function (arg0) { - let result; - try { result = +getObject(arg0) } catch (e) { result = e } - const ret = result; + imports.wbg.__wbg_postMessage_6edafa8f7b9c2f52 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).postMessage(getObject(arg1)); + }, arguments) }; + imports.wbg.__wbg_prependListener_dc1e8b094d0f731e = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).prependListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); return addHeapObject(ret); }; - imports.wbg.__wbg_networkid_new = function (arg0) { - const ret = NetworkId.__wrap(arg0); + imports.wbg.__wbg_prependOnceListener_93873dc17dd2fcad = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).prependOnceListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); return addHeapObject(ret); }; - imports.wbg.__wbg_hash_new = function (arg0) { - const ret = Hash.__wrap(arg0); + imports.wbg.__wbg_process_5c1d670bc53614b8 = function(arg0) { + const ret = getObject(arg0).process; return addHeapObject(ret); }; - imports.wbg.__wbg_String_b9412f8799faab3e = function (arg0, arg1) { - const ret = String(getObject(arg1)); - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + imports.wbg.__wbg_protocol_faa0494a9b2554cb = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).protocol; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }; - imports.wbg.__wbg_log_117e2aa9c9ac35ef = function (arg0, arg1) { - console.log(getStringFromWasm0(arg0, arg1)); - }; - imports.wbg.__wbg_warn_2b7cdd18b11959d4 = function (arg0, arg1) { - console.warn(getStringFromWasm0(arg0, arg1)); - }; - imports.wbg.__wbindgen_cb_drop = function (arg0) { - const obj = takeObject(arg0).original; - if (obj.cnt-- == 1) { - obj.a = 0; - return true; - } - const ret = false; - return ret; - }; - imports.wbg.__wbg_generatorsummary_new = function (arg0) { - const ret = GeneratorSummary.__wrap(arg0); + }, arguments) }; + imports.wbg.__wbg_publickey_new = function(arg0) { + const ret = PublicKey.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_cancelAnimationFrame_63674bbd9fe50db0 = function (arg0) { - cancelAnimationFrame(takeObject(arg0)); - }; - imports.wbg.__wbindgen_ge = function (arg0, arg1) { - const ret = getObject(arg0) >= getObject(arg1); + imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) { + const ret = getObject(arg0).push(getObject(arg1)); return ret; }; - imports.wbg.__wbg_length_17e41c43021d9584 = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).length; - return ret; - }, arguments) - }; - imports.wbg.__wbg_key_89eef9cf026e74da = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg1).key(arg2 >>> 0); - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - var len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }, arguments) - }; - imports.wbg.__wbg_error_8a5920abbe618207 = function (arg0, arg1) { - console.error(getStringFromWasm0(arg0, arg1)); - }; - imports.wbg.__wbg_readFileSync_de49edfedd87a445 = function () { - return handleError(function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).readFileSync(getStringFromWasm0(arg1, arg2), takeObject(arg3)); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_getItem_cab39762abab3e70 = function () { - return handleError(function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg1).getItem(getStringFromWasm0(arg2, arg3)); - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - var len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }, arguments) - }; - imports.wbg.__wbg_from_90240fa076fed36a = function (arg0) { - const ret = Buffer.from(getObject(arg0)); + imports.wbg.__wbg_put_066faa31a6a88f5b = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).put(getObject(arg1), getObject(arg2)); return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) { + queueMicrotask(getObject(arg0)); }; - imports.wbg.__wbg_writeFileSync_c19a5360f851c3d9 = function () { - return handleError(function (arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).writeFileSync(getStringFromWasm0(arg1, arg2), takeObject(arg3), takeObject(arg4)); - }, arguments) - }; - imports.wbg.__wbg_setItem_9482185c870abba6 = function () { - return handleError(function (arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); - }, arguments) - }; - imports.wbg.__wbg_unlinkSync_814cf160f57ba152 = function () { - return handleError(function (arg0, arg1, arg2) { - getObject(arg0).unlinkSync(getStringFromWasm0(arg1, arg2)); - }, arguments) - }; - imports.wbg.__wbg_removeItem_f10a84254de33054 = function () { - return handleError(function (arg0, arg1, arg2) { - getObject(arg0).removeItem(getStringFromWasm0(arg1, arg2)); - }, arguments) - }; - imports.wbg.__wbg_renameSync_6187da191329d2e4 = function () { - return handleError(function (arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).renameSync(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); - }, arguments) - }; - imports.wbg.__wbg_mkdirSync_e0e18e086e2ef088 = function () { - return handleError(function (arg0, arg1, arg2, arg3) { - getObject(arg0).mkdirSync(getStringFromWasm0(arg1, arg2), takeObject(arg3)); - }, arguments) - }; - imports.wbg.__wbg_existsSync_71c4330089739336 = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).existsSync(getStringFromWasm0(arg1, arg2)); - return ret; - }, arguments) - }; - imports.wbg.__wbg_put_f83d95662936dee7 = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).put(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_setonopen_627ecbd31f447580 = function (arg0, arg1) { - getObject(arg0).onopen = getObject(arg1); - }; - imports.wbg.__wbg_setonclose_5493577767d066d1 = function (arg0, arg1) { - getObject(arg0).onclose = getObject(arg1); - }; - imports.wbg.__wbg_setonerror_8bb4d27c1bd546a1 = function (arg0, arg1) { - getObject(arg0).onerror = getObject(arg1); + imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) { + const ret = getObject(arg0).queueMicrotask; + return addHeapObject(ret); }; - imports.wbg.__wbg_setonmessage_aa9deea5b0e4c255 = function (arg0, arg1) { - getObject(arg0).onmessage = getObject(arg1); + imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).randomFillSync(takeObject(arg1)); + }, arguments) }; + imports.wbg.__wbg_readFileSync_42b340d959241f2b = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).readFileSync(getStringFromWasm0(arg1, arg2), takeObject(arg3)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_readdir_319d9b13a44c9af9 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).readdir(getStringFromWasm0(arg1, arg2)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_readyState_4013cfdf4f22afb0 = function(arg0) { + const ret = getObject(arg0).readyState; + return (__wbindgen_enum_IdbRequestReadyState.indexOf(ret) + 1 || 3) - 1; }; - imports.wbg.__wbg_readyState_02fb3a5c8e82fb5c = function (arg0) { + imports.wbg.__wbg_readyState_6c28968f3e6c1e47 = function(arg0) { const ret = getObject(arg0).readyState; return ret; }; - imports.wbg.__wbg_close_f1f7d57aca466836 = function () { - return handleError(function (arg0) { - getObject(arg0).close(); - }, arguments) - }; - imports.wbg.__wbg_get_88b5e79e9daccb9f = function () { - return handleError(function (arg0, arg1) { - const ret = getObject(arg0).get(getObject(arg1)); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_get_d8f9cfb1368ca9b7 = function () { - return handleError(function (arg0, arg1) { - let deferred0_0; - let deferred0_1; - try { - deferred0_0 = arg0; - deferred0_1 = arg1; - const ret = chrome.storage.local.get(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - } finally { - wasm.__wbindgen_export_17(deferred0_0, deferred0_1, 1); - } - }, arguments) - }; - imports.wbg.__wbg_count_7b9a7e71c616b931 = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).count(); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_value_d4be628e515b251f = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).value; + imports.wbg.__wbg_removeAttribute_e419cd6726b4c62f = function() { return handleError(function (arg0, arg1, arg2) { + getObject(arg0).removeAttribute(getStringFromWasm0(arg1, arg2)); + }, arguments) }; + imports.wbg.__wbg_removeItem_9d2669ee3bba6f7d = function() { return handleError(function (arg0, arg1, arg2) { + getObject(arg0).removeItem(getStringFromWasm0(arg1, arg2)); + }, arguments) }; + imports.wbg.__wbg_remove_cb9af65ab98197c5 = function() { return handleError(function (arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + const ret = chrome.storage.local.remove(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); - }, arguments) + } finally { + wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1); + } + }, arguments) }; + imports.wbg.__wbg_renameSync_86e78b84a05e4a0b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).renameSync(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_requestAnimationFrame_63a812187303a02c = function(arg0) { + const ret = requestAnimationFrame(takeObject(arg0)); + return addHeapObject(ret); }; - imports.wbg.__wbg_continue_a92b4c9f17458897 = function () { - return handleError(function (arg0) { - getObject(arg0).continue(); - }, arguments) + imports.wbg.__wbg_require_05f2f70e92254dbb = function(arg0, arg1) { + const ret = require(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); }; - imports.wbg.__wbg_update_375c91f2a290ec51 = function () { - return handleError(function (arg0, arg1) { - const ret = getObject(arg0).update(getObject(arg1)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_require_11fc9008c54f5b90 = function(arg0, arg1) { + const ret = require(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); }; - imports.wbg.__wbg_set_1d630b100fb9094b = function () { - return handleError(function (arg0) { - const ret = chrome.storage.local.set(takeObject(arg0)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () { + const ret = module.require; + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) { + const ret = Promise.resolve(getObject(arg0)); + return addHeapObject(ret); }; - imports.wbg.__wbg_remove_d58cbb142852d2e8 = function () { - return handleError(function (arg0, arg1) { - let deferred0_0; - let deferred0_1; - try { - deferred0_0 = arg0; - deferred0_1 = arg1; - const ret = chrome.storage.local.remove(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - } finally { - wasm.__wbindgen_export_17(deferred0_0, deferred0_1, 1); - } - }, arguments) - }; - imports.wbg.__wbg_delete_34764ece57bdc720 = function () { - return handleError(function (arg0, arg1) { - const ret = getObject(arg0).delete(getObject(arg1)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_result_f29afabdf2c05826 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).result; + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_rpcclient_new = function(arg0) { + const ret = RpcClient.__wrap(arg0); + return addHeapObject(ret); }; - imports.wbg.__wbg_readdir_10db195565f761a0 = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).readdir(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_send_17f8c8c8e084cc5e = function() { return handleError(function (arg0, arg1, arg2) { + getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2)); + }, arguments) }; + imports.wbg.__wbg_send_9a57107cc0d7eafa = function() { return handleError(function (arg0, arg1, arg2) { + getObject(arg0).send(getStringFromWasm0(arg1, arg2)); + }, arguments) }; + imports.wbg.__wbg_send_afb0c27f2d9698e3 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).send(getObject(arg1)); + }, arguments) }; + imports.wbg.__wbg_setAttribute_2704501201f15687 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setInterval_160c4baec24e25f6 = function() { return handleError(function (arg0, arg1) { + const ret = setInterval(getObject(arg0), arg1 >>> 0); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_setItem_212ecc915942ab0a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setTime_8afa2faa26e7eb59 = function(arg0, arg1) { + const ret = getObject(arg0).setTime(arg1); + return ret; }; - imports.wbg.__wbg_statSync_edbaafda26c0599a = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).statSync(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_setTimeout_430dd4984e76f6c3 = function() { return handleError(function (arg0, arg1) { + const ret = setTimeout(getObject(arg0), arg1 >>> 0); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_set_005c36bbcfafb768 = function() { return handleError(function (arg0) { + const ret = chrome.storage.local.set(takeObject(arg0)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) { + getObject(arg0)[arg1 >>> 0] = takeObject(arg2); }; - imports.wbg.__wbg_get_396d4cb09bce1873 = function () { - return handleError(function () { - const ret = chrome.storage.local.get(); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) { + getObject(arg0)[takeObject(arg1)] = takeObject(arg2); }; - imports.wbg.__wbg_walletdescriptor_new = function (arg0) { - const ret = WalletDescriptor.__wrap(arg0); - return addHeapObject(ret); + imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); }; - imports.wbg.__wbg_pendingtransaction_new = function (arg0) { - const ret = PendingTransaction.__wrap(arg0); + imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).set(getObject(arg1), getObject(arg2)); return addHeapObject(ret); }; - imports.wbg.__wbg_oldVersion_74205b5e4698efc3 = function (arg0) { - const ret = getObject(arg0).oldVersion; + imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); return ret; + }, arguments) }; + imports.wbg.__wbg_setbinaryType_9981a6ba2bd58b94 = function(arg0, arg1) { + getObject(arg0).binaryType = __wbindgen_enum_BinaryType[arg1]; }; - imports.wbg.__wbg_setunique_6f46c3f803001492 = function (arg0, arg1) { - getObject(arg0).unique = arg1 !== 0; + imports.wbg.__wbg_setbody_5923b78a95eedf29 = function(arg0, arg1) { + getObject(arg0).body = getObject(arg1); }; - imports.wbg.__wbg_setbinaryType_a05483ec8b59edc2 = function (arg0, arg1) { - getObject(arg0).binaryType = ["blob", "arraybuffer",][arg1]; + imports.wbg.__wbg_setcredentials_c3a22f1cd105a2c6 = function(arg0, arg1) { + getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1]; }; - imports.wbg.__wbg_accountkind_new = function (arg0) { - const ret = AccountKind.__wrap(arg0); - return addHeapObject(ret); + imports.wbg.__wbg_setheaders_834c0bdb6a8949ad = function(arg0, arg1) { + getObject(arg0).headers = getObject(arg1); }; - imports.wbg.__wbg_openCursor_eae86c5dbc805f16 = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).openCursor(getObject(arg1), ["next", "nextunique", "prev", "prevunique",][arg2]); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_setinnerHTML_31bde41f835786f7 = function(arg0, arg1, arg2) { + getObject(arg0).innerHTML = getStringFromWasm0(arg1, arg2); }; - imports.wbg.__wbg_advance_0922866a23942467 = function () { - return handleError(function (arg0, arg1) { - getObject(arg0).advance(arg1 >>> 0); - }, arguments) + imports.wbg.__wbg_setmethod_3c5280fe5d890842 = function(arg0, arg1, arg2) { + getObject(arg0).method = getStringFromWasm0(arg1, arg2); }; - imports.wbg.__wbg_transactionrecordnotification_new = function (arg0) { - const ret = TransactionRecordNotification.__wrap(arg0); - return addHeapObject(ret); + imports.wbg.__wbg_setmode_5dc300b865044b65 = function(arg0, arg1) { + getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1]; }; - imports.wbg.__wbg_publickey_new = function (arg0) { - const ret = PublicKey.__wrap(arg0); - return addHeapObject(ret); + imports.wbg.__wbg_setonabort_3bf4db6614fa98e9 = function(arg0, arg1) { + getObject(arg0).onabort = getObject(arg1); }; - imports.wbg.__wbg_instanceof_Window_5012736c80a01584 = function (arg0) { - let result; - try { - result = getObject(arg0) instanceof Window; - } catch (_) { - result = false; - } - const ret = result; - return ret; + imports.wbg.__wbg_setonblocked_aebf64bd39f1eca8 = function(arg0, arg1) { + getObject(arg0).onblocked = getObject(arg1); }; - imports.wbg.__wbg_location_af118da6c50d4c3f = function (arg0) { - const ret = getObject(arg0).location; - return addHeapObject(ret); + imports.wbg.__wbg_setonclose_b15bdabd419b6357 = function(arg0, arg1) { + getObject(arg0).onclose = getObject(arg1); }; - imports.wbg.__wbg_protocol_787951293a197961 = function () { - return handleError(function (arg0, arg1) { - const ret = getObject(arg1).protocol; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - const len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }, arguments) + imports.wbg.__wbg_setoncomplete_4d19df0dadb7c4d4 = function(arg0, arg1) { + getObject(arg0).oncomplete = getObject(arg1); }; - imports.wbg.__wbg_abort_8659d889a7877ae3 = function (arg0) { - getObject(arg0).abort(); + imports.wbg.__wbg_setonerror_b0d9d723b8fddbbb = function(arg0, arg1) { + getObject(arg0).onerror = getObject(arg1); }; - imports.wbg.__wbg_setmethod_dc68a742c2db5c6a = function (arg0, arg1, arg2) { - getObject(arg0).method = getStringFromWasm0(arg1, arg2); + imports.wbg.__wbg_setonerror_d7e3056cc6e56085 = function(arg0, arg1) { + getObject(arg0).onerror = getObject(arg1); }; - imports.wbg.__wbg_new_e27c93803e1acc42 = function () { - return handleError(function () { - const ret = new Headers(); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_setonerror_e2c5c0fa6fbf6d99 = function(arg0, arg1) { + getObject(arg0).onerror = getObject(arg1); }; - imports.wbg.__wbg_setheaders_be10a5ab566fd06f = function (arg0, arg1) { - getObject(arg0).headers = getObject(arg1); + imports.wbg.__wbg_setonmessage_007594843a0b97e8 = function(arg0, arg1) { + getObject(arg0).onmessage = getObject(arg1); + }; + imports.wbg.__wbg_setonmessage_5a885b16bdc6dca6 = function(arg0, arg1) { + getObject(arg0).onmessage = getObject(arg1); }; - imports.wbg.__wbg_setmode_a781aae2bd3df202 = function (arg0, arg1) { - getObject(arg0).mode = ["same-origin", "no-cors", "cors", "navigate",][arg1]; + imports.wbg.__wbg_setonopen_c42cfdbb28b087c4 = function(arg0, arg1) { + getObject(arg0).onopen = getObject(arg1); }; - imports.wbg.__wbg_setcredentials_2b67800db3f7b621 = function (arg0, arg1) { - getObject(arg0).credentials = ["omit", "same-origin", "include",][arg1]; + imports.wbg.__wbg_setonsuccess_afa464ee777a396d = function(arg0, arg1) { + getObject(arg0).onsuccess = getObject(arg1); }; - imports.wbg.__wbg_setbody_734cb3d7ee8e6e96 = function (arg0, arg1) { - getObject(arg0).body = getObject(arg1); + imports.wbg.__wbg_setonupgradeneeded_fcf7ce4f2eb0cb5f = function(arg0, arg1) { + getObject(arg0).onupgradeneeded = getObject(arg1); }; - imports.wbg.__wbg_signal_41e46ccad44bb5e2 = function (arg0) { - const ret = getObject(arg0).signal; - return addHeapObject(ret); + imports.wbg.__wbg_setonversionchange_6ee07fa49ee1e3a5 = function(arg0, arg1) { + getObject(arg0).onversionchange = getObject(arg1); }; - imports.wbg.__wbg_setsignal_91c4e8ebd04eb935 = function (arg0, arg1) { + imports.wbg.__wbg_setsignal_75b21ef3a81de905 = function(arg0, arg1) { getObject(arg0).signal = getObject(arg1); }; - imports.wbg.__wbg_append_f3a4426bb50622c5 = function () { - return handleError(function (arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); - }, arguments) + imports.wbg.__wbg_settype_39ed370d3edd403c = function(arg0, arg1, arg2) { + getObject(arg0).type = getStringFromWasm0(arg1, arg2); }; - imports.wbg.__wbg_instanceof_Response_e91b7eb7c611a9ae = function (arg0) { - let result; - try { - result = getObject(arg0) instanceof Response; - } catch (_) { - result = false; - } - const ret = result; - return ret; + imports.wbg.__wbg_setunique_dd24c422aa05df89 = function(arg0, arg1) { + getObject(arg0).unique = arg1 !== 0; }; - imports.wbg.__wbg_status_ae8de515694c5c7c = function (arg0) { - const ret = getObject(arg0).status; - return ret; + imports.wbg.__wbg_signal_aaf9ad74119f20a4 = function(arg0) { + const ret = getObject(arg0).signal; + return addHeapObject(ret); }; - imports.wbg.__wbg_url_1bf85c8abeb8c92d = function (arg0, arg1) { - const ret = getObject(arg1).url; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + imports.wbg.__wbg_stack_c99a96ed42647c4c = function(arg0, arg1) { + const ret = getObject(arg1).stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbg_headers_5e283e8345689121 = function (arg0) { - const ret = getObject(arg0).headers; + imports.wbg.__wbg_statSync_9a429acc496bafda = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).statSync(getStringFromWasm0(arg1, arg2)); return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() { + const ret = typeof global === 'undefined' ? null : global; + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_text_a94b91ea8700357a = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).text(); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() { + const ret = typeof globalThis === 'undefined' ? null : globalThis; + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_nodedescriptor_new = function (arg0) { - const ret = NodeDescriptor.__wrap(arg0); - return addHeapObject(ret); + imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() { + const ret = typeof self === 'undefined' ? null : self; + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_rpcclient_new = function (arg0) { - const ret = RpcClient.__wrap(arg0); - return addHeapObject(ret); + imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() { + const ret = typeof window === 'undefined' ? null : window; + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_addListener_ef6c129bb87219d9 = function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).addListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); - return addHeapObject(ret); + imports.wbg.__wbg_status_f6360336ca686bf0 = function(arg0) { + const ret = getObject(arg0).status; + return ret; }; - imports.wbg.__wbg_on_5d61447a91633f13 = function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).on(getStringFromWasm0(arg1, arg2), getObject(arg3)); + imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) { + const ret = JSON.stringify(getObject(arg0)); return addHeapObject(ret); - }; - imports.wbg.__wbg_once_73046d9a6e68af07 = function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).once(getStringFromWasm0(arg1, arg2), getObject(arg3)); + }, arguments) }; + imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_prependListener_c57792e09c18b9ac = function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).prependListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); - return addHeapObject(ret); + imports.wbg.__wbg_target_0a62d9d79a2a1ede = function(arg0) { + const ret = getObject(arg0).target; + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_prependOnceListener_56fb1130dde3be9d = function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).prependOnceListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); + imports.wbg.__wbg_text_7805bea50de2af49 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).text(); return addHeapObject(ret); - }; - imports.wbg.__wbg_new_ebf2727385ee825c = function () { - return handleError(function () { - const ret = new AbortController(); - return addHeapObject(ret); - }, arguments) - }; - imports.wbg.__wbg_fetch_f8d735ba6fe1b719 = function (arg0) { - const ret = fetch(getObject(arg0)); + }, arguments) }; + imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) { + const ret = getObject(arg0).then(getObject(arg1)); return addHeapObject(ret); }; - imports.wbg.__wbg_fetch_ba7fe179e527d942 = function (arg0, arg1) { - const ret = getObject(arg0).fetch(getObject(arg1)); + imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); return addHeapObject(ret); }; - imports.wbg.__wbindgen_debug_string = function (arg0, arg1) { - const ret = debugString(getObject(arg1)); - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + imports.wbg.__wbg_toString_2f76f493957b63da = function(arg0, arg1, arg2) { + const ret = getObject(arg1).toString(arg2); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbindgen_throw = function (arg0, arg1) { - throw new Error(getStringFromWasm0(arg0, arg1)); - }; - imports.wbg.__wbg_queueMicrotask_48421b3cc9052b68 = function (arg0) { - const ret = getObject(arg0).queueMicrotask; + imports.wbg.__wbg_toString_b5d4438bc26b267c = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).toString(arg1); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_transaction_babc423936946a37 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2), __wbindgen_enum_IdbTransactionMode[arg3]); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_transaction_new = function(arg0) { + const ret = Transaction.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_queueMicrotask_12a30234db4045d3 = function (arg0) { - queueMicrotask(getObject(arg0)); - }; - imports.wbg.__wbg_document_8554450897a855b9 = function (arg0) { - const ret = getObject(arg0).document; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_navigator_6210380287bf8581 = function (arg0) { - const ret = getObject(arg0).navigator; + imports.wbg.__wbg_transactioninput_new = function(arg0) { + const ret = TransactionInput.__wrap(arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_localStorage_90db5cb66e840248 = function () { - return handleError(function (arg0) { - const ret = getObject(arg0).localStorage; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_transactionoutput_new = function(arg0) { + const ret = TransactionOutput.__wrap(arg0); + return addHeapObject(ret); }; - imports.wbg.__wbg_body_b3bb488e8e54bf4b = function (arg0) { - const ret = getObject(arg0).body; - return isLikeNone(ret) ? 0 : addHeapObject(ret); + imports.wbg.__wbg_transactionrecordnotification_new = function(arg0) { + const ret = TransactionRecordNotification.__wrap(arg0); + return addHeapObject(ret); }; - imports.wbg.__wbg_createElement_5921e9eb06b9ec89 = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_unlinkSync_656392e8d747415f = function() { return handleError(function (arg0, arg1, arg2) { + getObject(arg0).unlinkSync(getStringFromWasm0(arg1, arg2)); + }, arguments) }; + imports.wbg.__wbg_update_acd72607f506872a = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).update(getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_url_ae10c34ca209681d = function(arg0, arg1) { + const ret = getObject(arg1).url; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbg_innerHTML_a31692607fb7f5ac = function (arg0, arg1) { - const ret = getObject(arg1).innerHTML; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + imports.wbg.__wbg_userAgent_12e9d8e62297563f = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).userAgent; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_utxoentryreference_new = function(arg0) { + const ret = UtxoEntryReference.__wrap(arg0); + return addHeapObject(ret); }; - imports.wbg.__wbg_setinnerHTML_ea7e3c6a3c4790c6 = function (arg0, arg1, arg2) { - getObject(arg0).innerHTML = getStringFromWasm0(arg1, arg2); + imports.wbg.__wbg_value_68c4e9a54bb7fd5e = function() { return handleError(function (arg0) { + const ret = getObject(arg0).value; + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) { + const ret = getObject(arg0).value; + return addHeapObject(ret); }; - imports.wbg.__wbg_removeAttribute_c80e298b60689065 = function () { - return handleError(function (arg0, arg1, arg2) { - getObject(arg0).removeAttribute(getStringFromWasm0(arg1, arg2)); - }, arguments) - }; - imports.wbg.__wbg_setAttribute_d5540a19be09f8dc = function () { - return handleError(function (arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); - }, arguments) - }; - imports.wbg.__wbg_createObjectURL_ca544150f40fb1bf = function () { - return handleError(function (arg0, arg1) { - const ret = URL.createObjectURL(getObject(arg1)); - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - const len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }, arguments) - }; - imports.wbg.__wbg_newwithstrsequenceandoptions_f700d764298e22da = function () { - return handleError(function (arg0, arg1) { - const ret = new Blob(getObject(arg0), getObject(arg1)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) { + const ret = getObject(arg0).versions; + return addHeapObject(ret); }; - imports.wbg.__wbg_newwithstrandinit_a31c69e4cc337183 = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbg_walletdescriptor_new = function(arg0) { + const ret = WalletDescriptor.__wrap(arg0); + return addHeapObject(ret); }; - imports.wbg.__wbg_settype_b6ab7b74bd1908a1 = function (arg0, arg1, arg2) { - getObject(arg0).type = getStringFromWasm0(arg1, arg2); + imports.wbg.__wbg_warn_28319e260c89a4f8 = function(arg0, arg1) { + console.warn(getStringFromWasm0(arg0, arg1)); }; - imports.wbg.__wbg_setonmessage_7cee8e224acfa056 = function (arg0, arg1) { - getObject(arg0).onmessage = getObject(arg1); + imports.wbg.__wbg_writeFileSync_6325b339950ab342 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).writeFileSync(getStringFromWasm0(arg1, arg2), takeObject(arg3), takeObject(arg4)); + }, arguments) }; + imports.wbg.__wbindgen_array_new = function() { + const ret = []; + return addHeapObject(ret); }; - imports.wbg.__wbg_new_25d9d4e2932d816f = function () { - return handleError(function (arg0, arg1) { - const ret = new Worker(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbindgen_array_push = function(arg0, arg1) { + getObject(arg0).push(takeObject(arg1)); }; - imports.wbg.__wbg_postMessage_37faac1bc005e5c0 = function () { - return handleError(function (arg0, arg1) { - getObject(arg0).postMessage(getObject(arg1)); - }, arguments) + imports.wbg.__wbindgen_as_number = function(arg0) { + const ret = +getObject(arg0); + return ret; }; - imports.wbg.__wbg_index_c90226e82bd94b45 = function () { - return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) { + const ret = arg0; + return addHeapObject(ret); }; - imports.wbg.__wbg_data_5c47a6985fefc490 = function (arg0) { - const ret = getObject(arg0).data; + imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) { + const ret = BigInt.asUintN(64, arg0); return addHeapObject(ret); }; - imports.wbg.__wbg_userAgent_58dedff4303aeb66 = function () { - return handleError(function (arg0, arg1) { - const ret = getObject(arg1).userAgent; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); - const len1 = WASM_VECTOR_LEN; - getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); - getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); - }, arguments) + imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) { + const v = getObject(arg1); + const ret = typeof(v) === 'bigint' ? v : undefined; + getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); }; - imports.wbg.__wbg_appendChild_ac45d1abddf1b89b = function () { - return handleError(function (arg0, arg1) { - const ret = getObject(arg0).appendChild(getObject(arg1)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbindgen_boolean_get = function(arg0) { + const v = getObject(arg0); + const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; + return ret; }; - imports.wbg.__wbg_aborted_new = function (arg0) { - const ret = Aborted.__wrap(arg0); - return addHeapObject(ret); + imports.wbg.__wbindgen_cb_drop = function(arg0) { + const obj = takeObject(arg0).original; + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + const ret = false; + return ret; }; - imports.wbg.__wbg_setTimeout_9da2ed000180b082 = function () { - return handleError(function (arg0, arg1) { - const ret = setTimeout(getObject(arg0), arg1 >>> 0); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbindgen_closure_wrapper16260 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 6017, __wbg_adapter_78); + return addHeapObject(ret); }; - imports.wbg.__wbg_clearTimeout_57b125c22c2e5ff4 = function () { - return handleError(function (arg0) { - clearTimeout(getObject(arg0)); - }, arguments) + imports.wbg.__wbindgen_closure_wrapper17014 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 6045, __wbg_adapter_81); + return addHeapObject(ret); }; - imports.wbg.__wbg_require_09472de69ed820a3 = function (arg0, arg1) { - const ret = require(getStringFromWasm0(arg0, arg1)); + imports.wbg.__wbindgen_closure_wrapper17016 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 6045, __wbg_adapter_84); return addHeapObject(ret); }; - imports.wbg.__wbindgen_is_falsy = function (arg0) { - const ret = !getObject(arg0); - return ret; + imports.wbg.__wbindgen_closure_wrapper17018 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 6045, __wbg_adapter_87); + return addHeapObject(ret); }; - imports.wbg.__wbg_requestAnimationFrame_d121ba8dd86b0059 = function (arg0) { - const ret = requestAnimationFrame(takeObject(arg0)); + imports.wbg.__wbindgen_closure_wrapper17350 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 6153, __wbg_adapter_90); return addHeapObject(ret); }; - imports.wbg.__wbg_setInterval_25b5473f0ee57b43 = function () { - return handleError(function (arg0, arg1) { - const ret = setInterval(getObject(arg0), arg1 >>> 0); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbindgen_closure_wrapper17352 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 6153, __wbg_adapter_90); + return addHeapObject(ret); }; - imports.wbg.__wbg_clearInterval_e2b8baa82df892bd = function () { - return handleError(function (arg0) { - clearInterval(getObject(arg0)); - }, arguments) + imports.wbg.__wbindgen_closure_wrapper5957 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1959, __wbg_adapter_75); + return addHeapObject(ret); }; - imports.wbg.__wbg_require_a5c3e455324dea82 = function (arg0, arg1) { - const ret = require(getStringFromWasm0(arg0, arg1)); + imports.wbg.__wbindgen_closure_wrapper836 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 213, __wbg_adapter_66); return addHeapObject(ret); }; - imports.wbg.__wbg_error_a702220199ff3bbd = function (arg0, arg1) { - let deferred0_0; - let deferred0_1; - try { - deferred0_0 = arg0; - deferred0_1 = arg1; - console.error(getStringFromWasm0(arg0, arg1)); - } finally { - wasm.__wbindgen_export_17(deferred0_0, deferred0_1, 1); - } + imports.wbg.__wbindgen_closure_wrapper956 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 263, __wbg_adapter_69); + return addHeapObject(ret); }; - imports.wbg.__wbg_new_107dfe3ee494dded = function () { - const ret = new Error(); + imports.wbg.__wbindgen_closure_wrapper958 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 263, __wbg_adapter_72); return addHeapObject(ret); }; - imports.wbg.__wbg_stack_f5d57bffa5adaba2 = function (arg0, arg1) { - const ret = getObject(arg1).stack; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); + imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(getObject(arg1)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); const len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbg_send_5e8a6aaae2974d0e = function () { - return handleError(function (arg0, arg1, arg2) { - getObject(arg0).send(getStringFromWasm0(arg1, arg2)); - }, arguments) - }; - imports.wbg.__wbg_send_84e0256a95a66ff8 = function () { - return handleError(function (arg0, arg1, arg2) { - getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2)); - }, arguments) - }; - imports.wbg.__wbg_send_481678566012a815 = function () { - return handleError(function (arg0, arg1) { - getObject(arg0).send(getObject(arg1)); - }, arguments) + imports.wbg.__wbindgen_error_new = function(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); }; - imports.wbg.__wbg_new_170a6c447a0bc8cf = function () { - return handleError(function (arg0, arg1) { - const ret = new WebSocket(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbindgen_in = function(arg0, arg1) { + const ret = getObject(arg0) in getObject(arg1); + return ret; }; - imports.wbg.__wbg_newwithnodejsconfigimpl_1645b14a91580b93 = function () { - return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) { - const ret = new WebSocket(getStringFromWasm0(arg0, arg1), takeObject(arg2), takeObject(arg3), takeObject(arg4), takeObject(arg5), takeObject(arg6)); - return addHeapObject(ret); - }, arguments) + imports.wbg.__wbindgen_is_array = function(arg0) { + const ret = Array.isArray(getObject(arg0)); + return ret; }; - imports.wbg.__wbindgen_closure_wrapper960 = function (arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 285, __wbg_adapter_60); - return addHeapObject(ret); + imports.wbg.__wbindgen_is_bigint = function(arg0) { + const ret = typeof(getObject(arg0)) === 'bigint'; + return ret; }; - imports.wbg.__wbindgen_closure_wrapper962 = function (arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 285, __wbg_adapter_63); - return addHeapObject(ret); + imports.wbg.__wbindgen_is_falsy = function(arg0) { + const ret = !getObject(arg0); + return ret; }; - imports.wbg.__wbindgen_closure_wrapper4523 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1376, __wbg_adapter_66); - return addHeapObject(ret); + imports.wbg.__wbindgen_is_function = function(arg0) { + const ret = typeof(getObject(arg0)) === 'function'; + return ret; }; - imports.wbg.__wbindgen_closure_wrapper4525 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1376, __wbg_adapter_69); - return addHeapObject(ret); + imports.wbg.__wbindgen_is_null = function(arg0) { + const ret = getObject(arg0) === null; + return ret; }; - imports.wbg.__wbindgen_closure_wrapper4527 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1376, __wbg_adapter_66); - return addHeapObject(ret); + imports.wbg.__wbindgen_is_object = function(arg0) { + const val = getObject(arg0); + const ret = typeof(val) === 'object' && val !== null; + return ret; }; - imports.wbg.__wbindgen_closure_wrapper4529 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1376, __wbg_adapter_66); - return addHeapObject(ret); + imports.wbg.__wbindgen_is_string = function(arg0) { + const ret = typeof(getObject(arg0)) === 'string'; + return ret; }; - imports.wbg.__wbindgen_closure_wrapper4531 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1376, __wbg_adapter_76); - return addHeapObject(ret); + imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === undefined; + return ret; }; - imports.wbg.__wbindgen_closure_wrapper13085 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 5298, __wbg_adapter_79); - return addHeapObject(ret); + imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) { + const ret = getObject(arg0) === getObject(arg1); + return ret; }; - imports.wbg.__wbindgen_closure_wrapper13087 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 5298, __wbg_adapter_82); - return addHeapObject(ret); + imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) { + const ret = getObject(arg0) == getObject(arg1); + return ret; }; - imports.wbg.__wbindgen_closure_wrapper13089 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 5298, __wbg_adapter_82); - return addHeapObject(ret); + imports.wbg.__wbindgen_lt = function(arg0, arg1) { + const ret = getObject(arg0) < getObject(arg1); + return ret; }; - imports.wbg.__wbindgen_closure_wrapper13091 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 5298, __wbg_adapter_82); + imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper15725 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6259, __wbg_adapter_89); + imports.wbg.__wbindgen_neg = function(arg0) { + const ret = -getObject(arg0); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper16455 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6294, __wbg_adapter_92); - return addHeapObject(ret); + imports.wbg.__wbindgen_number_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'number' ? obj : undefined; + getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); }; - imports.wbg.__wbindgen_closure_wrapper16457 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6294, __wbg_adapter_95); + imports.wbg.__wbindgen_number_new = function(arg0) { + const ret = arg0; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper16459 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6294, __wbg_adapter_98); + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper16461 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6294, __wbg_adapter_101); - return addHeapObject(ret); + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); }; - imports.wbg.__wbindgen_closure_wrapper16913 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6427, __wbg_adapter_104); - return addHeapObject(ret); + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; - imports.wbg.__wbindgen_closure_wrapper16915 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6427, __wbg_adapter_104); + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper16917 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6427, __wbg_adapter_109); - return addHeapObject(ret); + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); }; - imports.wbg.__wbindgen_closure_wrapper16919 = function (arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 6427, __wbg_adapter_104); + imports.wbg.__wbindgen_try_into_number = function(arg0) { + let result; + try { result = +getObject(arg0) } catch (e) { result = e } + const ret = result; return addHeapObject(ret); }; @@ -13935,10 +14385,13 @@ function initSync(module) { if (wasm !== undefined) return wasm; - if (typeof module !== 'undefined' && Object.getPrototypeOf(module) === Object.prototype) - ({ module } = module) - else - console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } const imports = __wbg_get_imports(); @@ -13957,10 +14410,13 @@ async function __wbg_init(module_or_path) { if (wasm !== undefined) return wasm; - if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype) - ({ module_or_path } = module_or_path) - else - console.warn('using deprecated parameters for the initialization function; pass a single object instead') + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } if (typeof module_or_path === 'undefined') { module_or_path = new URL('kaspa_bg.wasm', import.meta.url); diff --git a/wasm/core/kaspa_bg.wasm.d.ts b/wasm/core/kaspa_bg.wasm.d.ts index 58f7220c..6db4ce77 100644 --- a/wasm/core/kaspa_bg.wasm.d.ts +++ b/wasm/core/kaspa_bg.wasm.d.ts @@ -1,807 +1,828 @@ /* tslint:disable */ /* eslint-disable */ export const memory: WebAssembly.Memory; -export function __wbg_address_free(a: number, b: number): void; -export function address_constructor(a: number, b: number): number; -export function address_validate(a: number, b: number): number; -export function address_toString(a: number, b: number): void; -export function address_version(a: number, b: number): void; -export function address_prefix(a: number, b: number): void; -export function address_set_setPrefix(a: number, b: number, c: number): void; -export function address_payload(a: number, b: number): void; -export function address_short(a: number, b: number, c: number): void; -export function __wbg_mnemonic_free(a: number, b: number): void; -export function mnemonic_constructor(a: number, b: number, c: number, d: number): void; -export function mnemonic_validate(a: number, b: number, c: number): number; -export function mnemonic_entropy(a: number, b: number): void; -export function mnemonic_set_entropy(a: number, b: number, c: number): void; -export function mnemonic_random(a: number, b: number, c: number): void; -export function mnemonic_phrase(a: number, b: number): void; -export function mnemonic_set_phrase(a: number, b: number, c: number): void; -export function mnemonic_toSeed(a: number, b: number, c: number, d: number): void; -export function __wbg_utxoentry_free(a: number, b: number): void; -export function __wbg_get_utxoentry_address(a: number): number; -export function __wbg_set_utxoentry_address(a: number, b: number): void; -export function __wbg_get_utxoentry_outpoint(a: number): number; -export function __wbg_set_utxoentry_outpoint(a: number, b: number): void; -export function __wbg_get_utxoentry_amount(a: number): number; -export function __wbg_set_utxoentry_amount(a: number, b: number): void; -export function __wbg_get_utxoentry_scriptPublicKey(a: number): number; -export function __wbg_set_utxoentry_scriptPublicKey(a: number, b: number): void; -export function __wbg_get_utxoentry_blockDaaScore(a: number): number; -export function __wbg_set_utxoentry_blockDaaScore(a: number, b: number): void; -export function __wbg_get_utxoentry_isCoinbase(a: number): number; -export function __wbg_set_utxoentry_isCoinbase(a: number, b: number): void; -export function utxoentry_toString(a: number, b: number): void; -export function __wbg_utxoentryreference_free(a: number, b: number): void; -export function utxoentryreference_toString(a: number, b: number): void; -export function utxoentryreference_entry(a: number): number; -export function utxoentryreference_outpoint(a: number): number; -export function utxoentryreference_address(a: number): number; -export function utxoentryreference_amount(a: number): number; -export function utxoentryreference_isCoinbase(a: number): number; -export function utxoentryreference_blockDaaScore(a: number): number; -export function utxoentryreference_scriptPublicKey(a: number): number; -export function __wbg_utxoentries_free(a: number, b: number): void; -export function utxoentries_js_ctor(a: number, b: number): void; -export function utxoentries_get_items_as_js_array(a: number): number; -export function utxoentries_set_items_from_js_array(a: number, b: number): void; -export function utxoentries_sort(a: number): void; -export function utxoentries_amount(a: number): number; -export function __wbg_transaction_free(a: number, b: number): void; -export function transaction_is_coinbase(a: number): number; -export function transaction_finalize(a: number, b: number): void; -export function transaction_id(a: number, b: number): void; -export function transaction_constructor(a: number, b: number): void; -export function transaction_get_inputs_as_js_array(a: number): number; -export function transaction_addresses(a: number, b: number, c: number): void; -export function transaction_set_inputs_from_js_array(a: number, b: number): void; -export function transaction_get_outputs_as_js_array(a: number): number; -export function transaction_set_outputs_from_js_array(a: number, b: number): void; -export function transaction_version(a: number): number; -export function transaction_set_version(a: number, b: number): void; -export function transaction_lockTime(a: number): number; -export function transaction_set_lockTime(a: number, b: number): void; -export function transaction_gas(a: number): number; -export function transaction_set_gas(a: number, b: number): void; -export function transaction_get_subnetwork_id_as_hex(a: number, b: number): void; -export function transaction_set_subnetwork_id_from_js_value(a: number, b: number): void; -export function transaction_get_payload_as_hex_string(a: number, b: number): void; -export function transaction_set_payload_from_js_value(a: number, b: number): void; -export function transaction_get_mass(a: number): number; -export function transaction_set_mass(a: number, b: number): void; -export function transaction_serializeToObject(a: number, b: number): void; -export function transaction_serializeToJSON(a: number, b: number): void; -export function transaction_serializeToSafeJSON(a: number, b: number): void; -export function transaction_deserializeFromObject(a: number, b: number): void; -export function transaction_deserializeFromJSON(a: number, b: number, c: number): void; -export function transaction_deserializeFromSafeJSON(a: number, b: number, c: number): void; -export function __wbg_transactionoutpoint_free(a: number, b: number): void; -export function transactionoutpoint_ctor(a: number, b: number): number; -export function transactionoutpoint_getId(a: number, b: number): void; -export function transactionoutpoint_transactionId(a: number, b: number): void; -export function transactionoutpoint_index(a: number): number; -export function header_constructor(a: number, b: number): void; -export function header_finalize(a: number, b: number): void; -export function header_asJSON(a: number, b: number): void; -export function header_get_version(a: number): number; -export function header_set_version(a: number, b: number): void; -export function header_get_timestamp(a: number): number; -export function header_set_timestamp(a: number, b: number): void; -export function header_bits(a: number): number; -export function header_set_bits(a: number, b: number): void; -export function header_nonce(a: number): number; -export function header_set_nonce(a: number, b: number): void; -export function header_daa_score(a: number): number; -export function header_set_daa_score(a: number, b: number): void; -export function header_blue_score(a: number): number; -export function header_set_blue_score(a: number, b: number): void; -export function header_get_hash_as_hex(a: number, b: number): void; -export function header_get_hash_merkle_root_as_hex(a: number, b: number): void; -export function header_set_hash_merkle_root_from_js_value(a: number, b: number): void; -export function header_get_accepted_id_merkle_root_as_hex(a: number, b: number): void; -export function header_set_accepted_id_merkle_root_from_js_value(a: number, b: number): void; -export function header_get_utxo_commitment_as_hex(a: number, b: number): void; -export function header_set_utxo_commitment_from_js_value(a: number, b: number): void; -export function header_get_pruning_point_as_hex(a: number, b: number): void; -export function header_set_pruning_point_from_js_value(a: number, b: number): void; -export function header_get_parents_by_level_as_js_value(a: number): number; -export function header_set_parents_by_level_from_js_value(a: number, b: number): void; -export function header_blue_work(a: number): number; -export function header_getBlueWorkAsHex(a: number, b: number): void; -export function header_set_blue_work_from_js_value(a: number, b: number): void; -export function __wbg_header_free(a: number, b: number): void; -export function __wbg_transactioninput_free(a: number, b: number): void; -export function transactioninput_constructor(a: number, b: number): void; -export function transactioninput_get_previous_outpoint(a: number): number; -export function transactioninput_set_previous_outpoint(a: number, b: number, c: number): void; -export function transactioninput_get_signature_script_as_hex(a: number, b: number): void; -export function transactioninput_set_signature_script_from_js_value(a: number, b: number, c: number): void; -export function transactioninput_get_sequence(a: number): number; -export function transactioninput_set_sequence(a: number, b: number): void; -export function transactioninput_get_sig_op_count(a: number): number; -export function transactioninput_set_sig_op_count(a: number, b: number): void; -export function transactioninput_get_utxo(a: number): number; -export function __wbg_transactionoutput_free(a: number, b: number): void; -export function transactionoutput_ctor(a: number, b: number): number; -export function transactionoutput_value(a: number): number; -export function transactionoutput_set_value(a: number, b: number): void; -export function transactionoutput_scriptPublicKey(a: number): number; -export function transactionoutput_set_scriptPublicKey(a: number, b: number): void; -export function isScriptPayToScriptHash(a: number, b: number): void; -export function isScriptPayToPubkeyECDSA(a: number, b: number): void; -export function isScriptPayToPubkey(a: number, b: number): void; -export function addressFromScriptPublicKey(a: number, b: number, c: number): void; -export function payToScriptHashSignatureScript(a: number, b: number, c: number): void; -export function payToScriptHashScript(a: number, b: number): void; -export function payToAddressScript(a: number, b: number): void; -export function transactionsigninghashecdsa_new(): number; -export function transactionsigninghashecdsa_update(a: number, b: number, c: number): void; -export function transactionsigninghashecdsa_finalize(a: number, b: number): void; -export function __wbg_transactionsigninghashecdsa_free(a: number, b: number): void; -export function transactionsigninghash_new(): number; -export function transactionsigninghash_update(a: number, b: number, c: number): void; -export function transactionsigninghash_finalize(a: number, b: number): void; -export function __wbg_transactionsigninghash_free(a: number, b: number): void; -export function __wbg_networkid_free(a: number, b: number): void; -export function __wbg_get_networkid_type(a: number): number; -export function __wbg_set_networkid_type(a: number, b: number): void; -export function __wbg_get_networkid_suffix(a: number, b: number): void; -export function __wbg_set_networkid_suffix(a: number, b: number, c: number): void; -export function networkid_ctor(a: number, b: number): void; -export function networkid_id(a: number, b: number): void; -export function networkid_addressPrefix(a: number, b: number): void; -export function networkid_toString(a: number, b: number): void; -export function __wbg_scriptpublickey_free(a: number, b: number): void; -export function __wbg_get_scriptpublickey_version(a: number): number; -export function __wbg_set_scriptpublickey_version(a: number, b: number): void; -export function scriptpublickey_constructor(a: number, b: number, c: number): void; -export function scriptpublickey_script_as_hex(a: number, b: number): void; -export function __wbg_sighashtype_free(a: number, b: number): void; -export function __wbg_transactionutxoentry_free(a: number, b: number): void; -export function __wbg_get_transactionutxoentry_amount(a: number): number; -export function __wbg_set_transactionutxoentry_amount(a: number, b: number): void; -export function __wbg_get_transactionutxoentry_scriptPublicKey(a: number): number; -export function __wbg_set_transactionutxoentry_scriptPublicKey(a: number, b: number): void; -export function __wbg_get_transactionutxoentry_blockDaaScore(a: number): number; -export function __wbg_set_transactionutxoentry_blockDaaScore(a: number, b: number): void; -export function __wbg_get_transactionutxoentry_isCoinbase(a: number): number; -export function __wbg_set_transactionutxoentry_isCoinbase(a: number, b: number): void; -export function __wbg_hash_free(a: number, b: number): void; -export function hash_constructor(a: number, b: number): number; -export function hash_toString(a: number, b: number): void; -export function __wbg_pow_free(a: number, b: number): void; -export function pow_new(a: number, b: number, c: number, d: number): void; -export function pow_target(a: number, b: number): void; -export function pow_checkWork(a: number, b: number, c: number): void; -export function pow_get_pre_pow_hash(a: number, b: number): void; -export function pow_fromRaw(a: number, b: number, c: number, d: number, e: number, f: number): void; -export function calculateTarget(a: number, b: number): void; -export function scriptbuilder_new(): number; -export function scriptbuilder_fromScript(a: number, b: number): void; -export function scriptbuilder_addOp(a: number, b: number, c: number): void; -export function scriptbuilder_addOps(a: number, b: number, c: number): void; -export function scriptbuilder_addData(a: number, b: number, c: number): void; -export function scriptbuilder_addI64(a: number, b: number, c: number): void; -export function scriptbuilder_addLockTime(a: number, b: number, c: number): void; -export function scriptbuilder_canonicalDataSize(a: number, b: number): void; -export function scriptbuilder_toString(a: number): number; -export function scriptbuilder_drain(a: number): number; -export function scriptbuilder_createPayToScriptHashScript(a: number): number; -export function scriptbuilder_encodePayToScriptHashSignatureScript(a: number, b: number, c: number): void; -export function scriptbuilder_hexView(a: number, b: number, c: number): void; -export function __wbg_scriptbuilder_free(a: number, b: number): void; -export function scriptbuilder_addSequence(a: number, b: number, c: number): void; -export function __wbg_storage_free(a: number, b: number): void; -export function storage_filename(a: number, b: number): void; -export function __wbg_paymentoutput_free(a: number, b: number): void; -export function __wbg_get_paymentoutput_address(a: number): number; -export function __wbg_set_paymentoutput_address(a: number, b: number): void; -export function __wbg_get_paymentoutput_amount(a: number): number; -export function __wbg_set_paymentoutput_amount(a: number, b: number): void; -export function paymentoutput_new(a: number, b: number): number; -export function __wbg_paymentoutputs_free(a: number, b: number): void; -export function paymentoutputs_constructor(a: number, b: number): void; -export function cryptobox_ctor(a: number, b: number, c: number): void; -export function cryptobox_publicKey(a: number, b: number): void; -export function cryptobox_encrypt(a: number, b: number, c: number, d: number): void; -export function cryptobox_decrypt(a: number, b: number, c: number, d: number): void; -export function __wbg_cryptobox_free(a: number, b: number): void; -export function cryptoboxpublickey_ctor(a: number, b: number): void; -export function cryptoboxpublickey_toString(a: number, b: number): void; -export function __wbg_cryptoboxpublickey_free(a: number, b: number): void; -export function cryptoboxprivatekey_ctor(a: number, b: number): void; -export function cryptoboxprivatekey_to_public_key(a: number): number; -export function __wbg_cryptoboxprivatekey_free(a: number, b: number): void; -export function utxoprocessor_addEventListener(a: number, b: number, c: number, d: number): void; -export function utxoprocessor_removeEventListener(a: number, b: number, c: number, d: number): void; -export function utxoprocessor_ctor(a: number, b: number): void; -export function utxoprocessor_start(a: number): number; -export function utxoprocessor_stop(a: number): number; -export function utxoprocessor_rpc(a: number): number; -export function utxoprocessor_networkId(a: number, b: number): void; -export function utxoprocessor_setNetworkId(a: number, b: number, c: number): void; -export function utxoprocessor_isActive(a: number): number; -export function utxoprocessor_setCoinbaseTransactionMaturityDAA(a: number, b: number, c: number): void; -export function utxoprocessor_setUserTransactionMaturityDAA(a: number, b: number, c: number): void; -export function __wbg_utxoprocessor_free(a: number, b: number): void; -export function sompiToKaspaStringWithSuffix(a: number, b: number, c: number): void; -export function sompiToKaspaString(a: number, b: number): void; -export function kaspaToSompi(a: number, b: number): number; -export function pendingtransaction_id(a: number, b: number): void; -export function pendingtransaction_paymentAmount(a: number): number; -export function pendingtransaction_changeAmount(a: number): number; -export function pendingtransaction_feeAmount(a: number): number; -export function pendingtransaction_mass(a: number): number; -export function pendingtransaction_minimumSignatures(a: number): number; -export function pendingtransaction_aggregateInputAmount(a: number): number; -export function pendingtransaction_aggregateOutputAmount(a: number): number; -export function pendingtransaction_type(a: number, b: number): void; -export function pendingtransaction_addresses(a: number): number; -export function pendingtransaction_getUtxoEntries(a: number): number; -export function pendingtransaction_createInputSignature(a: number, b: number, c: number, d: number, e: number): void; -export function pendingtransaction_fillInput(a: number, b: number, c: number, d: number): void; -export function pendingtransaction_signInput(a: number, b: number, c: number, d: number, e: number): void; -export function pendingtransaction_sign(a: number, b: number, c: number, d: number): void; -export function pendingtransaction_submit(a: number, b: number): number; -export function pendingtransaction_transaction(a: number, b: number): void; -export function pendingtransaction_serializeToObject(a: number, b: number): void; -export function pendingtransaction_serializeToJSON(a: number, b: number): void; -export function pendingtransaction_serializeToSafeJSON(a: number, b: number): void; -export function __wbg_pendingtransaction_free(a: number, b: number): void; -export function verifyMessage(a: number, b: number): void; -export function signMessage(a: number, b: number): void; -export function estimateTransactions(a: number): number; -export function createTransactions(a: number): number; -export function createTransaction(a: number, b: number, c: number, d: number, e: number, f: number): void; -export function __wbg_accountkind_free(a: number, b: number): void; -export function accountkind_ctor(a: number, b: number, c: number): void; -export function accountkind_toString(a: number, b: number): void; -export function setDefaultStorageFolder(a: number, b: number, c: number): void; -export function setDefaultWalletFile(a: number, b: number, c: number): void; -export function balancestrings_mature(a: number, b: number): void; -export function balancestrings_pending(a: number, b: number): void; -export function __wbg_balancestrings_free(a: number, b: number): void; -export function balance_mature(a: number): number; -export function balance_pending(a: number): number; -export function balance_outgoing(a: number): number; -export function balance_toBalanceStrings(a: number, b: number, c: number): void; -export function __wbg_balance_free(a: number, b: number): void; -export function prvkeydatainfo_id(a: number, b: number): void; -export function prvkeydatainfo_name(a: number): number; -export function prvkeydatainfo_isEncrypted(a: number): number; -export function prvkeydatainfo_setName(a: number, b: number, c: number, d: number): void; -export function __wbg_prvkeydatainfo_free(a: number, b: number): void; -export function calculateTransactionFee(a: number, b: number, c: number, d: number): void; -export function updateTransactionMass(a: number, b: number, c: number, d: number): void; -export function calculateTransactionMass(a: number, b: number, c: number, d: number): void; -export function maximumStandardTransactionMass(): number; -export function signScriptHash(a: number, b: number, c: number): void; -export function createInputSignature(a: number, b: number, c: number, d: number, e: number): void; -export function signTransaction(a: number, b: number, c: number, d: number): void; -export function createAddress(a: number, b: number, c: number, d: number, e: number): void; -export function createMultisigAddress(a: number, b: number, c: number, d: number, e: number, f: number): void; -export function utxocontext_ctor(a: number, b: number): void; -export function utxocontext_trackAddresses(a: number, b: number, c: number): number; -export function utxocontext_unregisterAddresses(a: number, b: number): number; -export function utxocontext_clear(a: number): number; -export function utxocontext_isActive(a: number): number; -export function utxocontext_getMatureRange(a: number, b: number, c: number, d: number): void; -export function utxocontext_matureLength(a: number): number; -export function utxocontext_getPending(a: number, b: number): void; -export function utxocontext_balance(a: number): number; -export function utxocontext_balanceStrings(a: number, b: number): void; -export function __wbg_utxocontext_free(a: number, b: number): void; -export function generator_ctor(a: number, b: number): void; -export function generator_next(a: number): number; -export function generator_estimate(a: number): number; -export function generator_summary(a: number): number; -export function __wbg_generator_free(a: number, b: number): void; -export function __wbg_walletdescriptor_free(a: number, b: number): void; -export function __wbg_get_walletdescriptor_title(a: number, b: number): void; -export function __wbg_set_walletdescriptor_title(a: number, b: number, c: number): void; -export function __wbg_get_walletdescriptor_filename(a: number, b: number): void; -export function __wbg_set_walletdescriptor_filename(a: number, b: number, c: number): void; -export function __wbg_transactionrecordnotification_free(a: number, b: number): void; -export function __wbg_get_transactionrecordnotification_type(a: number, b: number): void; -export function __wbg_set_transactionrecordnotification_type(a: number, b: number, c: number): void; -export function __wbg_get_transactionrecordnotification_data(a: number): number; -export function __wbg_set_transactionrecordnotification_data(a: number, b: number): void; -export function __wbg_transactionrecord_free(a: number, b: number): void; -export function __wbg_get_transactionrecord_id(a: number): number; -export function __wbg_set_transactionrecord_id(a: number, b: number): void; -export function __wbg_get_transactionrecord_unixtimeMsec(a: number, b: number): void; -export function __wbg_set_transactionrecord_unixtimeMsec(a: number, b: number, c: number): void; -export function __wbg_get_transactionrecord_network(a: number): number; -export function __wbg_set_transactionrecord_network(a: number, b: number): void; -export function __wbg_get_transactionrecord_note(a: number, b: number): void; -export function __wbg_set_transactionrecord_note(a: number, b: number, c: number): void; -export function __wbg_get_transactionrecord_metadata(a: number, b: number): void; -export function __wbg_set_transactionrecord_metadata(a: number, b: number, c: number): void; -export function transactionrecord_value(a: number): number; -export function transactionrecord_blockDaaScore(a: number): number; -export function transactionrecord_binding(a: number): number; -export function transactionrecord_data(a: number): number; -export function transactionrecord_type(a: number, b: number): void; -export function transactionrecord_hasAddress(a: number, b: number): number; -export function transactionrecord_serialize(a: number): number; -export function wallet_constructor(a: number, b: number): void; -export function wallet_rpc(a: number): number; -export function wallet_isOpen(a: number): number; -export function wallet_isSynced(a: number): number; -export function wallet_descriptor(a: number): number; -export function wallet_exists(a: number, b: number, c: number): number; -export function wallet_start(a: number): number; -export function wallet_stop(a: number): number; -export function wallet_connect(a: number, b: number): number; -export function wallet_disconnect(a: number): number; -export function wallet_addEventListener(a: number, b: number, c: number, d: number): void; -export function wallet_removeEventListener(a: number, b: number, c: number, d: number): void; -export function __wbg_wallet_free(a: number, b: number): void; -export function argon2sha256ivFromText(a: number, b: number, c: number, d: number): void; -export function argon2sha256ivFromBinary(a: number, b: number, c: number): void; -export function sha256dFromText(a: number, b: number, c: number): void; -export function sha256dFromBinary(a: number, b: number): void; -export function sha256FromText(a: number, b: number, c: number): void; -export function sha256FromBinary(a: number, b: number): void; -export function decryptXChaCha20Poly1305(a: number, b: number, c: number, d: number, e: number): void; -export function encryptXChaCha20Poly1305(a: number, b: number, c: number, d: number, e: number): void; -export function wallet_batch(a: number, b: number): number; -export function wallet_flush(a: number, b: number): number; -export function wallet_retainContext(a: number, b: number): number; -export function wallet_getStatus(a: number, b: number): number; -export function wallet_walletEnumerate(a: number, b: number): number; -export function wallet_walletCreate(a: number, b: number): number; -export function wallet_walletOpen(a: number, b: number): number; -export function wallet_walletReload(a: number, b: number): number; -export function wallet_walletClose(a: number, b: number): number; -export function wallet_walletChangeSecret(a: number, b: number): number; -export function wallet_walletExport(a: number, b: number): number; -export function wallet_walletImport(a: number, b: number): number; -export function wallet_prvKeyDataEnumerate(a: number, b: number): number; -export function wallet_prvKeyDataCreate(a: number, b: number): number; -export function wallet_prvKeyDataRemove(a: number, b: number): number; -export function wallet_prvKeyDataGet(a: number, b: number): number; -export function wallet_accountsEnumerate(a: number, b: number): number; -export function wallet_accountsRename(a: number, b: number): number; -export function wallet_accountsDiscovery(a: number, b: number): number; -export function wallet_accountsCreate(a: number, b: number): number; -export function wallet_accountsEnsureDefault(a: number, b: number): number; -export function wallet_accountsImport(a: number, b: number): number; -export function wallet_accountsActivate(a: number, b: number): number; -export function wallet_accountsDeactivate(a: number, b: number): number; -export function wallet_accountsGet(a: number, b: number): number; -export function wallet_accountsCreateNewAddress(a: number, b: number): number; -export function wallet_accountsSend(a: number, b: number): number; -export function wallet_accountsTransfer(a: number, b: number): number; -export function wallet_accountsEstimate(a: number, b: number): number; -export function wallet_transactionsDataGet(a: number, b: number): number; -export function wallet_transactionsReplaceNote(a: number, b: number): number; -export function wallet_transactionsReplaceMetadata(a: number, b: number): number; -export function wallet_addressBookEnumerate(a: number, b: number): number; -export function generatorsummary_networkType(a: number): number; -export function generatorsummary_utxos(a: number): number; -export function generatorsummary_fees(a: number): number; -export function generatorsummary_transactions(a: number): number; -export function generatorsummary_finalAmount(a: number): number; -export function generatorsummary_finalTransactionId(a: number, b: number): void; -export function __wbg_generatorsummary_free(a: number, b: number): void; -export function __wbg_publickey_free(a: number, b: number): void; -export function publickey_try_new(a: number, b: number, c: number): void; -export function publickey_toString(a: number, b: number): void; -export function publickey_toAddress(a: number, b: number, c: number): void; -export function publickey_toAddressECDSA(a: number, b: number, c: number): void; -export function publickey_toXOnlyPublicKey(a: number): number; -export function publickey_fingerprint(a: number): number; -export function __wbg_xonlypublickey_free(a: number, b: number): void; -export function xonlypublickey_try_new(a: number, b: number, c: number): void; -export function xonlypublickey_toString(a: number, b: number): void; -export function xonlypublickey_toAddress(a: number, b: number, c: number): void; -export function xonlypublickey_toAddressECDSA(a: number, b: number, c: number): void; -export function xonlypublickey_fromAddress(a: number, b: number): void; -export function __wbg_keypair_free(a: number, b: number): void; -export function keypair_get_public_key(a: number, b: number): void; -export function keypair_get_private_key(a: number, b: number): void; -export function keypair_get_xonly_public_key(a: number): number; -export function keypair_toAddress(a: number, b: number, c: number): void; -export function keypair_toAddressECDSA(a: number, b: number, c: number): void; -export function keypair_random(a: number): void; -export function keypair_fromPrivateKey(a: number, b: number): void; -export function __wbg_xpub_free(a: number, b: number): void; -export function xpub_try_new(a: number, b: number, c: number): void; -export function xpub_deriveChild(a: number, b: number, c: number, d: number): void; -export function xpub_derivePath(a: number, b: number, c: number): void; -export function xpub_intoString(a: number, b: number, c: number, d: number): void; -export function xpub_toPublicKey(a: number): number; -export function xpub_xpub(a: number, b: number): void; -export function xpub_depth(a: number): number; -export function xpub_parentFingerprint(a: number, b: number): void; -export function xpub_childNumber(a: number): number; -export function xpub_chainCode(a: number, b: number): void; -export function __wbg_derivationpath_free(a: number, b: number): void; -export function derivationpath_new(a: number, b: number, c: number): void; -export function derivationpath_isEmpty(a: number): number; -export function derivationpath_length(a: number): number; -export function derivationpath_parent(a: number): number; -export function derivationpath_push(a: number, b: number, c: number, d: number): void; -export function derivationpath_toString(a: number, b: number): void; -export function __wbg_privatekey_free(a: number, b: number): void; -export function privatekey_try_new(a: number, b: number, c: number): void; -export function privatekey_toString(a: number, b: number): void; -export function privatekey_toKeypair(a: number, b: number): void; -export function privatekey_toPublicKey(a: number, b: number): void; -export function privatekey_toAddress(a: number, b: number, c: number): void; -export function privatekey_toAddressECDSA(a: number, b: number, c: number): void; -export function __wbg_publickeygenerator_free(a: number, b: number): void; -export function publickeygenerator_fromXPub(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_fromMasterXPrv(a: number, b: number, c: number, d: number, e: number, f: number): void; -export function publickeygenerator_receivePubkeys(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_receivePubkey(a: number, b: number, c: number): void; -export function publickeygenerator_receivePubkeysAsStrings(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_receivePubkeyAsString(a: number, b: number, c: number): void; -export function publickeygenerator_receiveAddresses(a: number, b: number, c: number, d: number, e: number): void; -export function publickeygenerator_receiveAddress(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_receiveAddressAsStrings(a: number, b: number, c: number, d: number, e: number): void; -export function publickeygenerator_receiveAddressAsString(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_changePubkeys(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_changePubkey(a: number, b: number, c: number): void; -export function publickeygenerator_changePubkeysAsStrings(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_changePubkeyAsString(a: number, b: number, c: number): void; -export function publickeygenerator_changeAddresses(a: number, b: number, c: number, d: number, e: number): void; -export function publickeygenerator_changeAddress(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_changeAddressAsStrings(a: number, b: number, c: number, d: number, e: number): void; -export function publickeygenerator_changeAddressAsString(a: number, b: number, c: number, d: number): void; -export function publickeygenerator_toString(a: number, b: number): void; -export function __wbg_privatekeygenerator_free(a: number, b: number): void; -export function privatekeygenerator_new(a: number, b: number, c: number, d: number, e: number, f: number): void; -export function privatekeygenerator_receiveKey(a: number, b: number, c: number): void; -export function privatekeygenerator_changeKey(a: number, b: number, c: number): void; -export function __wbg_xprv_free(a: number, b: number): void; -export function xprv_try_new(a: number, b: number): void; -export function xprv_fromXPrv(a: number, b: number, c: number): void; -export function xprv_deriveChild(a: number, b: number, c: number, d: number): void; -export function xprv_derivePath(a: number, b: number, c: number): void; -export function xprv_intoString(a: number, b: number, c: number, d: number): void; -export function xprv_toString(a: number, b: number): void; -export function xprv_toXPub(a: number, b: number): void; -export function xprv_toPrivateKey(a: number, b: number): void; -export function xprv_privateKey(a: number, b: number): void; -export function xprv_depth(a: number): number; -export function xprv_parentFingerprint(a: number, b: number): void; -export function xprv_childNumber(a: number): number; -export function xprv_chainCode(a: number, b: number): void; -export function xprv_xprv(a: number, b: number): void; -export function __wbg_pskt_free(a: number, b: number): void; -export function pskt_new(a: number, b: number): void; -export function pskt_role(a: number, b: number): void; -export function pskt_payload(a: number): number; -export function pskt_creator(a: number, b: number): void; -export function pskt_toConstructor(a: number, b: number): void; -export function pskt_toUpdater(a: number, b: number): void; -export function pskt_toSigner(a: number, b: number): void; -export function pskt_toCombiner(a: number, b: number): void; -export function pskt_toFinalizer(a: number, b: number): void; -export function pskt_toExtractor(a: number, b: number): void; -export function pskt_fallbackLockTime(a: number, b: number, c: number): void; -export function pskt_inputsModifiable(a: number, b: number): void; -export function pskt_outputsModifiable(a: number, b: number): void; -export function pskt_noMoreInputs(a: number, b: number): void; -export function pskt_noMoreOutputs(a: number, b: number): void; -export function pskt_input(a: number, b: number, c: number): void; -export function pskt_output(a: number, b: number, c: number): void; -export function pskt_setSequence(a: number, b: number, c: number, d: number): void; -export function pskt_calculateId(a: number, b: number): void; -export function version(a: number): void; -export function __wbg_nodedescriptor_free(a: number, b: number): void; -export function __wbg_get_nodedescriptor_uid(a: number, b: number): void; -export function __wbg_set_nodedescriptor_uid(a: number, b: number, c: number): void; -export function __wbg_get_nodedescriptor_url(a: number, b: number): void; -export function __wbg_set_nodedescriptor_url(a: number, b: number, c: number): void; -export function rpcclient_getBlockCount(a: number, b: number): number; -export function rpcclient_getBlockDagInfo(a: number, b: number): number; -export function rpcclient_getCoinSupply(a: number, b: number): number; -export function rpcclient_getConnectedPeerInfo(a: number, b: number): number; -export function rpcclient_getInfo(a: number, b: number): number; -export function rpcclient_getPeerAddresses(a: number, b: number): number; -export function rpcclient_getMetrics(a: number, b: number): number; -export function rpcclient_getConnections(a: number, b: number): number; -export function rpcclient_getSink(a: number, b: number): number; -export function rpcclient_getSinkBlueScore(a: number, b: number): number; -export function rpcclient_ping(a: number, b: number): number; -export function rpcclient_shutdown(a: number, b: number): number; -export function rpcclient_getServerInfo(a: number, b: number): number; -export function rpcclient_getSyncStatus(a: number, b: number): number; -export function rpcclient_getFeeEstimate(a: number, b: number): number; -export function rpcclient_getCurrentNetwork(a: number, b: number): number; -export function rpcclient_addPeer(a: number, b: number): number; -export function rpcclient_ban(a: number, b: number): number; -export function rpcclient_estimateNetworkHashesPerSecond(a: number, b: number): number; -export function rpcclient_getBalanceByAddress(a: number, b: number): number; -export function rpcclient_getBalancesByAddresses(a: number, b: number): number; -export function rpcclient_getBlock(a: number, b: number): number; -export function rpcclient_getBlocks(a: number, b: number): number; -export function rpcclient_getBlockTemplate(a: number, b: number): number; -export function rpcclient_getCurrentBlockColor(a: number, b: number): number; -export function rpcclient_getDaaScoreTimestampEstimate(a: number, b: number): number; -export function rpcclient_getFeeEstimateExperimental(a: number, b: number): number; -export function rpcclient_getHeaders(a: number, b: number): number; -export function rpcclient_getMempoolEntries(a: number, b: number): number; -export function rpcclient_getMempoolEntriesByAddresses(a: number, b: number): number; -export function rpcclient_getMempoolEntry(a: number, b: number): number; -export function rpcclient_getSubnetwork(a: number, b: number): number; -export function rpcclient_getUtxosByAddresses(a: number, b: number): number; -export function rpcclient_getVirtualChainFromBlock(a: number, b: number): number; -export function rpcclient_resolveFinalityConflict(a: number, b: number): number; -export function rpcclient_submitBlock(a: number, b: number): number; -export function rpcclient_submitTransaction(a: number, b: number): number; -export function rpcclient_submitTransactionReplacement(a: number, b: number): number; -export function rpcclient_unban(a: number, b: number): number; -export function rpcclient_subscribeBlockAdded(a: number): number; -export function rpcclient_unsubscribeBlockAdded(a: number): number; -export function rpcclient_subscribeFinalityConflict(a: number): number; -export function rpcclient_unsubscribeFinalityConflict(a: number): number; -export function rpcclient_subscribeFinalityConflictResolved(a: number): number; -export function rpcclient_unsubscribeFinalityConflictResolved(a: number): number; -export function rpcclient_subscribeSinkBlueScoreChanged(a: number): number; -export function rpcclient_unsubscribeSinkBlueScoreChanged(a: number): number; -export function rpcclient_subscribePruningPointUtxoSetOverride(a: number): number; -export function rpcclient_unsubscribePruningPointUtxoSetOverride(a: number): number; -export function rpcclient_subscribeNewBlockTemplate(a: number): number; -export function rpcclient_unsubscribeNewBlockTemplate(a: number): number; -export function rpcclient_subscribeVirtualDaaScoreChanged(a: number): number; -export function rpcclient_unsubscribeVirtualDaaScoreChanged(a: number): number; -export function rpcclient_subscribeUtxosChanged(a: number, b: number): number; -export function rpcclient_unsubscribeUtxosChanged(a: number, b: number): number; -export function rpcclient_subscribeVirtualChainChanged(a: number, b: number): number; -export function rpcclient_unsubscribeVirtualChainChanged(a: number, b: number): number; -export function rpcclient_defaultPort(a: number, b: number, c: number): void; -export function rpcclient_parseUrl(a: number, b: number, c: number, d: number, e: number): void; -export function rpcclient_ctor(a: number, b: number): void; -export function rpcclient_url(a: number, b: number): void; -export function rpcclient_resolver(a: number): number; -export function rpcclient_setResolver(a: number, b: number, c: number): void; -export function rpcclient_setNetworkId(a: number, b: number, c: number): void; -export function rpcclient_isConnected(a: number): number; -export function rpcclient_encoding(a: number, b: number): void; -export function rpcclient_nodeId(a: number, b: number): void; -export function rpcclient_connect(a: number, b: number): number; -export function rpcclient_disconnect(a: number): number; -export function rpcclient_start(a: number): number; -export function rpcclient_stop(a: number): number; -export function rpcclient_triggerAbort(a: number): void; -export function rpcclient_addEventListener(a: number, b: number, c: number, d: number): void; -export function rpcclient_removeEventListener(a: number, b: number, c: number, d: number): void; -export function rpcclient_clearEventListener(a: number, b: number, c: number): void; -export function rpcclient_removeAllEventListeners(a: number, b: number): void; -export function __wbg_rpcclient_free(a: number, b: number): void; -export function resolver_urls(a: number): number; -export function resolver_getNode(a: number, b: number, c: number): number; -export function resolver_getUrl(a: number, b: number, c: number): number; -export function resolver_connect(a: number, b: number): number; -export function resolver_ctor(a: number, b: number): void; -export function __wbg_resolver_free(a: number, b: number): void; -export function __wbg_assertionerroroptions_free(a: number, b: number): void; -export function assertionerroroptions_new(a: number, b: number, c: number, d: number): number; -export function assertionerroroptions_message(a: number): number; -export function assertionerroroptions_set_message(a: number, b: number): void; -export function assertionerroroptions_actual(a: number): number; -export function assertionerroroptions_set_actual(a: number, b: number): void; -export function assertionerroroptions_expected(a: number): number; -export function assertionerroroptions_set_expected(a: number, b: number): void; -export function assertionerroroptions_operator(a: number): number; -export function assertionerroroptions_set_operator(a: number, b: number): void; -export function __wbg_createreadstreamoptions_free(a: number, b: number): void; -export function createreadstreamoptions_new_with_values(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number): number; -export function createreadstreamoptions_auto_close(a: number): number; -export function createreadstreamoptions_set_auto_close(a: number, b: number): void; -export function createreadstreamoptions_emit_close(a: number): number; -export function createreadstreamoptions_set_emit_close(a: number, b: number): void; -export function createreadstreamoptions_encoding(a: number): number; -export function createreadstreamoptions_set_encoding(a: number, b: number): void; -export function createreadstreamoptions_end(a: number, b: number): void; -export function createreadstreamoptions_set_end(a: number, b: number, c: number): void; -export function createreadstreamoptions_fd(a: number, b: number): void; -export function createreadstreamoptions_set_fd(a: number, b: number, c: number): void; -export function createreadstreamoptions_flags(a: number): number; -export function createreadstreamoptions_set_flags(a: number, b: number): void; -export function createreadstreamoptions_high_water_mark(a: number, b: number): void; -export function createreadstreamoptions_set_high_water_mark(a: number, b: number, c: number): void; -export function createreadstreamoptions_mode(a: number, b: number): void; -export function createreadstreamoptions_set_mode(a: number, b: number, c: number): void; -export function createreadstreamoptions_start(a: number, b: number): void; -export function createreadstreamoptions_set_start(a: number, b: number, c: number): void; -export function __wbg_processsendoptions_free(a: number, b: number): void; -export function processsendoptions_new(a: number): number; -export function processsendoptions_swallow_errors(a: number): number; -export function processsendoptions_set_swallow_errors(a: number, b: number): void; -export function __wbg_consoleconstructoroptions_free(a: number, b: number): void; -export function consoleconstructoroptions_new_with_values(a: number, b: number, c: number, d: number, e: number): number; -export function consoleconstructoroptions_new(a: number, b: number): number; -export function consoleconstructoroptions_stdout(a: number): number; -export function consoleconstructoroptions_set_stdout(a: number, b: number): void; -export function consoleconstructoroptions_stderr(a: number): number; -export function consoleconstructoroptions_set_stderr(a: number, b: number): void; -export function consoleconstructoroptions_ignore_errors(a: number): number; -export function consoleconstructoroptions_set_ignore_errors(a: number, b: number): void; -export function consoleconstructoroptions_color_mod(a: number): number; -export function consoleconstructoroptions_set_color_mod(a: number, b: number): void; -export function consoleconstructoroptions_inspect_options(a: number): number; -export function consoleconstructoroptions_set_inspect_options(a: number, b: number): void; -export function __wbg_agentconstructoroptions_free(a: number, b: number): void; -export function agentconstructoroptions_keep_alive_msecs(a: number): number; -export function agentconstructoroptions_set_keep_alive_msecs(a: number, b: number): void; -export function agentconstructoroptions_keep_alive(a: number): number; -export function agentconstructoroptions_set_keep_alive(a: number, b: number): void; -export function agentconstructoroptions_max_free_sockets(a: number): number; -export function agentconstructoroptions_set_max_free_sockets(a: number, b: number): void; -export function agentconstructoroptions_max_sockets(a: number): number; -export function agentconstructoroptions_set_max_sockets(a: number, b: number): void; -export function agentconstructoroptions_timeout(a: number): number; -export function agentconstructoroptions_set_timeout(a: number, b: number): void; -export function __wbg_setaadoptions_free(a: number, b: number): void; -export function setaadoptions_new(a: number, b: number, c: number): number; -export function setaadoptions_flush(a: number): number; -export function setaadoptions_set_flush(a: number, b: number): void; -export function setaadoptions_transform(a: number): number; -export function setaadoptions_set_transform(a: number, b: number): void; -export function setaadoptions_plaintextLength(a: number): number; -export function setaadoptions_set_plaintext_length(a: number, b: number): void; -export function __wbg_createhookcallbacks_free(a: number, b: number): void; -export function createhookcallbacks_new(a: number, b: number, c: number, d: number, e: number): number; -export function createhookcallbacks_init(a: number): number; -export function createhookcallbacks_set_init(a: number, b: number): void; -export function createhookcallbacks_before(a: number): number; -export function createhookcallbacks_set_before(a: number, b: number): void; -export function createhookcallbacks_after(a: number): number; -export function createhookcallbacks_set_after(a: number, b: number): void; -export function createhookcallbacks_destroy(a: number): number; -export function createhookcallbacks_set_destroy(a: number, b: number): void; -export function createhookcallbacks_promise_resolve(a: number): number; -export function createhookcallbacks_set_promise_resolve(a: number, b: number): void; -export function __wbg_pipeoptions_free(a: number, b: number): void; -export function pipeoptions_new(a: number): number; -export function pipeoptions_end(a: number): number; -export function pipeoptions_set_end(a: number, b: number): void; -export function __wbg_streamtransformoptions_free(a: number, b: number): void; -export function streamtransformoptions_new(a: number, b: number): number; -export function streamtransformoptions_flush(a: number): number; -export function streamtransformoptions_set_flush(a: number, b: number): void; -export function streamtransformoptions_transform(a: number): number; -export function streamtransformoptions_set_transform(a: number, b: number): void; -export function writestream_add_listener_with_open(a: number, b: number): number; -export function writestream_add_listener_with_close(a: number, b: number): number; -export function writestream_on_with_open(a: number, b: number): number; -export function writestream_on_with_close(a: number, b: number): number; -export function writestream_once_with_open(a: number, b: number): number; -export function writestream_once_with_close(a: number, b: number): number; -export function writestream_prepend_listener_with_open(a: number, b: number): number; -export function writestream_prepend_listener_with_close(a: number, b: number): number; -export function writestream_prepend_once_listener_with_open(a: number, b: number): number; -export function writestream_prepend_once_listener_with_close(a: number, b: number): number; -export function __wbg_appendfileoptions_free(a: number, b: number): void; -export function appendfileoptions_new_with_values(a: number, b: number, c: number, d: number): number; -export function appendfileoptions_new(): number; -export function appendfileoptions_encoding(a: number): number; -export function appendfileoptions_set_encoding(a: number, b: number): void; -export function appendfileoptions_mode(a: number, b: number): void; -export function appendfileoptions_set_mode(a: number, b: number, c: number): void; -export function appendfileoptions_flag(a: number): number; -export function appendfileoptions_set_flag(a: number, b: number): void; -export function __wbg_formatinputpathobject_free(a: number, b: number): void; -export function formatinputpathobject_new_with_values(a: number, b: number, c: number, d: number, e: number): number; -export function formatinputpathobject_new(): number; -export function formatinputpathobject_base(a: number): number; -export function formatinputpathobject_set_base(a: number, b: number): void; -export function formatinputpathobject_dir(a: number): number; -export function formatinputpathobject_set_dir(a: number, b: number): void; -export function formatinputpathobject_ext(a: number): number; -export function formatinputpathobject_set_ext(a: number, b: number): void; -export function formatinputpathobject_name(a: number): number; -export function formatinputpathobject_set_name(a: number, b: number): void; -export function formatinputpathobject_root(a: number): number; -export function formatinputpathobject_set_root(a: number, b: number): void; -export function __wbg_getnameoptions_free(a: number, b: number): void; -export function getnameoptions_new(a: number, b: number, c: number, d: number): number; -export function getnameoptions_family(a: number): number; -export function getnameoptions_set_family(a: number, b: number): void; -export function getnameoptions_host(a: number): number; -export function getnameoptions_set_host(a: number, b: number): void; -export function getnameoptions_local_address(a: number): number; -export function getnameoptions_set_local_address(a: number, b: number): void; -export function getnameoptions_port(a: number): number; -export function getnameoptions_set_port(a: number, b: number): void; -export function __wbg_mkdtempsyncoptions_free(a: number, b: number): void; -export function mkdtempsyncoptions_new_with_values(a: number): number; -export function mkdtempsyncoptions_new(): number; -export function mkdtempsyncoptions_encoding(a: number): number; -export function mkdtempsyncoptions_set_encoding(a: number, b: number): void; -export function readstream_add_listener_with_open(a: number, b: number): number; -export function readstream_add_listener_with_close(a: number, b: number): number; -export function readstream_on_with_open(a: number, b: number): number; -export function readstream_on_with_close(a: number, b: number): number; -export function readstream_once_with_open(a: number, b: number): number; -export function readstream_once_with_close(a: number, b: number): number; -export function readstream_prepend_listener_with_open(a: number, b: number): number; -export function readstream_prepend_listener_with_close(a: number, b: number): number; -export function readstream_prepend_once_listener_with_open(a: number, b: number): number; -export function readstream_prepend_once_listener_with_close(a: number, b: number): number; -export function __wbg_createwritestreamoptions_free(a: number, b: number): void; -export function createwritestreamoptions_new_with_values(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): number; -export function createwritestreamoptions_auto_close(a: number): number; -export function createwritestreamoptions_set_auto_close(a: number, b: number): void; -export function createwritestreamoptions_emit_close(a: number): number; -export function createwritestreamoptions_set_emit_close(a: number, b: number): void; -export function createwritestreamoptions_encoding(a: number): number; -export function createwritestreamoptions_set_encoding(a: number, b: number): void; -export function createwritestreamoptions_fd(a: number, b: number): void; -export function createwritestreamoptions_set_fd(a: number, b: number, c: number): void; -export function createwritestreamoptions_flags(a: number): number; -export function createwritestreamoptions_set_flags(a: number, b: number): void; -export function createwritestreamoptions_mode(a: number, b: number): void; -export function createwritestreamoptions_set_mode(a: number, b: number, c: number): void; -export function createwritestreamoptions_start(a: number, b: number): void; -export function createwritestreamoptions_set_start(a: number, b: number, c: number): void; -export function __wbg_netserveroptions_free(a: number, b: number): void; -export function netserveroptions_allow_half_open(a: number): number; -export function netserveroptions_set_allow_half_open(a: number, b: number): void; -export function netserveroptions_pause_on_connect(a: number): number; -export function __wbg_userinfooptions_free(a: number, b: number): void; -export function userinfooptions_new_with_values(a: number): number; -export function userinfooptions_new(): number; -export function userinfooptions_encoding(a: number): number; -export function userinfooptions_set_encoding(a: number, b: number): void; -export function __wbg_writefilesyncoptions_free(a: number, b: number): void; -export function writefilesyncoptions_new(a: number, b: number, c: number, d: number): number; -export function writefilesyncoptions_encoding(a: number): number; -export function writefilesyncoptions_set_encoding(a: number, b: number): void; -export function writefilesyncoptions_flag(a: number): number; -export function writefilesyncoptions_set_flag(a: number, b: number): void; -export function writefilesyncoptions_mode(a: number, b: number): void; -export function writefilesyncoptions_set_mode(a: number, b: number, c: number): void; -export function netserveroptions_set_pause_on_connect(a: number, b: number): void; -export function __wbg_wasioptions_free(a: number, b: number): void; -export function wasioptions_new_with_values(a: number, b: number, c: number, d: number): number; -export function wasioptions_new(a: number): number; -export function wasioptions_args(a: number, b: number): void; -export function wasioptions_set_args(a: number, b: number, c: number): void; -export function wasioptions_env(a: number): number; -export function wasioptions_set_env(a: number, b: number): void; -export function wasioptions_preopens(a: number): number; -export function wasioptions_set_preopens(a: number, b: number): void; -export function rustsecp256k1_v0_10_0_context_create(a: number): number; -export function rustsecp256k1_v0_10_0_context_destroy(a: number): void; -export function rustsecp256k1_v0_10_0_default_illegal_callback_fn(a: number, b: number): void; -export function rustsecp256k1_v0_10_0_default_error_callback_fn(a: number, b: number): void; -export function __wbg_aborted_free(a: number, b: number): void; -export function __wbg_abortable_free(a: number, b: number): void; -export function abortable_new(): number; -export function abortable_isAborted(a: number): number; -export function abortable_abort(a: number): void; -export function abortable_check(a: number, b: number): void; -export function abortable_reset(a: number): void; -export function setLogLevel(a: number): void; -export function defer(): number; -export function presentPanicHookLogs(): void; -export function initConsolePanicHook(): void; -export function initBrowserPanicHook(): void; -export function initWASM32Bindings(a: number, b: number): void; -export function __wbindgen_export_0(a: number, b: number): number; -export function __wbindgen_export_1(a: number, b: number, c: number, d: number): number; -export const __wbindgen_export_2: WebAssembly.Table; -export function __wbindgen_export_3(a: number, b: number): void; -export function __wbindgen_export_4(a: number, b: number, c: number): void; -export function __wbindgen_export_5(a: number, b: number, c: number): void; -export function __wbindgen_export_6(a: number, b: number): void; -export function __wbindgen_add_to_stack_pointer(a: number): number; -export function __wbindgen_export_7(a: number, b: number, c: number, d: number): void; -export function __wbindgen_export_8(a: number, b: number): void; -export function __wbindgen_export_9(a: number, b: number, c: number): void; -export function __wbindgen_export_10(a: number, b: number, c: number): void; -export function __wbindgen_export_11(a: number, b: number, c: number): void; -export function __wbindgen_export_12(a: number, b: number): void; -export function __wbindgen_export_13(a: number, b: number, c: number, d: number): number; -export function __wbindgen_export_14(a: number, b: number, c: number): void; -export function __wbindgen_export_15(a: number, b: number): void; -export function __wbindgen_export_16(a: number): void; -export function __wbindgen_export_17(a: number, b: number, c: number): void; -export function __wbindgen_export_18(a: number, b: number, c: number, d: number): void; +export const __wbg_address_free: (a: number, b: number) => void; +export const address_constructor: (a: number, b: number) => number; +export const address_validate: (a: number, b: number) => number; +export const address_toString: (a: number, b: number) => void; +export const address_version: (a: number, b: number) => void; +export const address_prefix: (a: number, b: number) => void; +export const address_set_setPrefix: (a: number, b: number, c: number) => void; +export const address_payload: (a: number, b: number) => void; +export const address_short: (a: number, b: number, c: number) => void; +export const __wbg_mnemonic_free: (a: number, b: number) => void; +export const mnemonic_constructor: (a: number, b: number, c: number, d: number) => void; +export const mnemonic_validate: (a: number, b: number, c: number) => number; +export const mnemonic_entropy: (a: number, b: number) => void; +export const mnemonic_set_entropy: (a: number, b: number, c: number) => void; +export const mnemonic_random: (a: number, b: number) => void; +export const mnemonic_phrase: (a: number, b: number) => void; +export const mnemonic_set_phrase: (a: number, b: number, c: number) => void; +export const mnemonic_toSeed: (a: number, b: number, c: number, d: number) => void; +export const __wbg_transactioninput_free: (a: number, b: number) => void; +export const transactioninput_constructor: (a: number, b: number) => void; +export const transactioninput_get_previous_outpoint: (a: number) => number; +export const transactioninput_set_previous_outpoint: (a: number, b: number, c: number) => void; +export const transactioninput_get_signature_script_as_hex: (a: number, b: number) => void; +export const transactioninput_set_signature_script_from_js_value: (a: number, b: number, c: number) => void; +export const transactioninput_get_sequence: (a: number) => bigint; +export const transactioninput_set_sequence: (a: number, b: bigint) => void; +export const transactioninput_get_sig_op_count: (a: number) => number; +export const transactioninput_set_sig_op_count: (a: number, b: number) => void; +export const transactioninput_get_utxo: (a: number) => number; +export const transactionsigninghashecdsa_new: () => number; +export const transactionsigninghashecdsa_update: (a: number, b: number, c: number) => void; +export const transactionsigninghashecdsa_finalize: (a: number, b: number) => void; +export const __wbg_transactionsigninghashecdsa_free: (a: number, b: number) => void; +export const transactionsigninghash_new: () => number; +export const transactionsigninghash_update: (a: number, b: number, c: number) => void; +export const transactionsigninghash_finalize: (a: number, b: number) => void; +export const __wbg_transactionsigninghash_free: (a: number, b: number) => void; +export const __wbg_utxoentry_free: (a: number, b: number) => void; +export const __wbg_get_utxoentry_address: (a: number) => number; +export const __wbg_set_utxoentry_address: (a: number, b: number) => void; +export const __wbg_get_utxoentry_outpoint: (a: number) => number; +export const __wbg_set_utxoentry_outpoint: (a: number, b: number) => void; +export const __wbg_get_utxoentry_amount: (a: number) => bigint; +export const __wbg_set_utxoentry_amount: (a: number, b: bigint) => void; +export const __wbg_get_utxoentry_scriptPublicKey: (a: number) => number; +export const __wbg_set_utxoentry_scriptPublicKey: (a: number, b: number) => void; +export const __wbg_get_utxoentry_blockDaaScore: (a: number) => bigint; +export const __wbg_set_utxoentry_blockDaaScore: (a: number, b: bigint) => void; +export const __wbg_get_utxoentry_isCoinbase: (a: number) => number; +export const __wbg_set_utxoentry_isCoinbase: (a: number, b: number) => void; +export const utxoentry_toString: (a: number, b: number) => void; +export const __wbg_utxoentryreference_free: (a: number, b: number) => void; +export const utxoentryreference_toString: (a: number, b: number) => void; +export const utxoentryreference_entry: (a: number) => number; +export const utxoentryreference_outpoint: (a: number) => number; +export const utxoentryreference_address: (a: number) => number; +export const utxoentryreference_amount: (a: number) => bigint; +export const utxoentryreference_isCoinbase: (a: number) => number; +export const utxoentryreference_blockDaaScore: (a: number) => bigint; +export const utxoentryreference_scriptPublicKey: (a: number) => number; +export const __wbg_utxoentries_free: (a: number, b: number) => void; +export const utxoentries_js_ctor: (a: number, b: number) => void; +export const utxoentries_get_items_as_js_array: (a: number) => number; +export const utxoentries_set_items_from_js_array: (a: number, b: number) => void; +export const utxoentries_sort: (a: number) => void; +export const utxoentries_amount: (a: number) => bigint; +export const isScriptPayToScriptHash: (a: number, b: number) => void; +export const isScriptPayToPubkeyECDSA: (a: number, b: number) => void; +export const isScriptPayToPubkey: (a: number, b: number) => void; +export const addressFromScriptPublicKey: (a: number, b: number, c: number) => void; +export const payToScriptHashSignatureScript: (a: number, b: number, c: number) => void; +export const payToScriptHashScript: (a: number, b: number) => void; +export const payToAddressScript: (a: number, b: number) => void; +export const __wbg_transactionoutpoint_free: (a: number, b: number) => void; +export const transactionoutpoint_ctor: (a: number, b: number) => number; +export const transactionoutpoint_getId: (a: number, b: number) => void; +export const transactionoutpoint_transactionId: (a: number, b: number) => void; +export const transactionoutpoint_index: (a: number) => number; +export const header_constructor: (a: number, b: number) => void; +export const header_finalize: (a: number, b: number) => void; +export const header_asJSON: (a: number, b: number) => void; +export const header_get_version: (a: number) => number; +export const header_set_version: (a: number, b: number) => void; +export const header_get_timestamp: (a: number) => bigint; +export const header_set_timestamp: (a: number, b: bigint) => void; +export const header_bits: (a: number) => number; +export const header_set_bits: (a: number, b: number) => void; +export const header_nonce: (a: number) => bigint; +export const header_set_nonce: (a: number, b: bigint) => void; +export const header_daa_score: (a: number) => bigint; +export const header_set_daa_score: (a: number, b: bigint) => void; +export const header_blue_score: (a: number) => bigint; +export const header_set_blue_score: (a: number, b: bigint) => void; +export const header_get_hash_as_hex: (a: number, b: number) => void; +export const header_get_hash_merkle_root_as_hex: (a: number, b: number) => void; +export const header_set_hash_merkle_root_from_js_value: (a: number, b: number) => void; +export const header_get_accepted_id_merkle_root_as_hex: (a: number, b: number) => void; +export const header_set_accepted_id_merkle_root_from_js_value: (a: number, b: number) => void; +export const header_get_utxo_commitment_as_hex: (a: number, b: number) => void; +export const header_set_utxo_commitment_from_js_value: (a: number, b: number) => void; +export const header_get_pruning_point_as_hex: (a: number, b: number) => void; +export const header_set_pruning_point_from_js_value: (a: number, b: number) => void; +export const header_get_parents_by_level_as_js_value: (a: number) => number; +export const header_set_parents_by_level_from_js_value: (a: number, b: number) => void; +export const header_blue_work: (a: number) => number; +export const header_getBlueWorkAsHex: (a: number, b: number) => void; +export const header_set_blue_work_from_js_value: (a: number, b: number) => void; +export const __wbg_header_free: (a: number, b: number) => void; +export const __wbg_transaction_free: (a: number, b: number) => void; +export const transaction_is_coinbase: (a: number) => number; +export const transaction_finalize: (a: number, b: number) => void; +export const transaction_id: (a: number, b: number) => void; +export const transaction_constructor: (a: number, b: number) => void; +export const transaction_get_inputs_as_js_array: (a: number) => number; +export const transaction_addresses: (a: number, b: number, c: number) => void; +export const transaction_set_inputs_from_js_array: (a: number, b: number) => void; +export const transaction_get_outputs_as_js_array: (a: number) => number; +export const transaction_set_outputs_from_js_array: (a: number, b: number) => void; +export const transaction_version: (a: number) => number; +export const transaction_set_version: (a: number, b: number) => void; +export const transaction_lockTime: (a: number) => bigint; +export const transaction_set_lockTime: (a: number, b: bigint) => void; +export const transaction_gas: (a: number) => bigint; +export const transaction_set_gas: (a: number, b: bigint) => void; +export const transaction_get_subnetwork_id_as_hex: (a: number, b: number) => void; +export const transaction_set_subnetwork_id_from_js_value: (a: number, b: number) => void; +export const transaction_get_payload_as_hex_string: (a: number, b: number) => void; +export const transaction_set_payload_from_js_value: (a: number, b: number) => void; +export const transaction_get_mass: (a: number) => bigint; +export const transaction_set_mass: (a: number, b: bigint) => void; +export const transaction_serializeToObject: (a: number, b: number) => void; +export const transaction_serializeToJSON: (a: number, b: number) => void; +export const transaction_serializeToSafeJSON: (a: number, b: number) => void; +export const transaction_deserializeFromObject: (a: number, b: number) => void; +export const transaction_deserializeFromJSON: (a: number, b: number, c: number) => void; +export const transaction_deserializeFromSafeJSON: (a: number, b: number, c: number) => void; +export const __wbg_transactionoutput_free: (a: number, b: number) => void; +export const transactionoutput_ctor: (a: bigint, b: number) => number; +export const transactionoutput_value: (a: number) => bigint; +export const transactionoutput_set_value: (a: number, b: bigint) => void; +export const transactionoutput_scriptPublicKey: (a: number) => number; +export const transactionoutput_set_scriptPublicKey: (a: number, b: number) => void; +export const __wbg_networkid_free: (a: number, b: number) => void; +export const __wbg_get_networkid_type: (a: number) => number; +export const __wbg_set_networkid_type: (a: number, b: number) => void; +export const __wbg_get_networkid_suffix: (a: number) => number; +export const __wbg_set_networkid_suffix: (a: number, b: number) => void; +export const networkid_ctor: (a: number, b: number) => void; +export const networkid_id: (a: number, b: number) => void; +export const networkid_addressPrefix: (a: number, b: number) => void; +export const networkid_toString: (a: number, b: number) => void; +export const __wbg_sighashtype_free: (a: number, b: number) => void; +export const __wbg_scriptpublickey_free: (a: number, b: number) => void; +export const __wbg_get_scriptpublickey_version: (a: number) => number; +export const __wbg_set_scriptpublickey_version: (a: number, b: number) => void; +export const scriptpublickey_constructor: (a: number, b: number, c: number) => void; +export const scriptpublickey_script_as_hex: (a: number, b: number) => void; +export const __wbg_transactionutxoentry_free: (a: number, b: number) => void; +export const __wbg_get_transactionutxoentry_amount: (a: number) => bigint; +export const __wbg_set_transactionutxoentry_amount: (a: number, b: bigint) => void; +export const __wbg_get_transactionutxoentry_scriptPublicKey: (a: number) => number; +export const __wbg_set_transactionutxoentry_scriptPublicKey: (a: number, b: number) => void; +export const __wbg_get_transactionutxoentry_blockDaaScore: (a: number) => bigint; +export const __wbg_set_transactionutxoentry_blockDaaScore: (a: number, b: bigint) => void; +export const __wbg_get_transactionutxoentry_isCoinbase: (a: number) => number; +export const __wbg_set_transactionutxoentry_isCoinbase: (a: number, b: number) => void; +export const __wbg_hash_free: (a: number, b: number) => void; +export const hash_constructor: (a: number, b: number) => number; +export const hash_toString: (a: number, b: number) => void; +export const __wbg_pow_free: (a: number, b: number) => void; +export const pow_new: (a: number, b: number, c: number, d: bigint) => void; +export const pow_target: (a: number, b: number) => void; +export const pow_checkWork: (a: number, b: number, c: bigint) => void; +export const pow_get_pre_pow_hash: (a: number, b: number) => void; +export const pow_fromRaw: (a: number, b: number, c: number, d: bigint, e: number) => void; +export const calculateTarget: (a: number, b: number) => void; +export const scriptbuilder_new: () => number; +export const scriptbuilder_fromScript: (a: number, b: number) => void; +export const scriptbuilder_addOp: (a: number, b: number, c: number) => void; +export const scriptbuilder_addOps: (a: number, b: number, c: number) => void; +export const scriptbuilder_addData: (a: number, b: number, c: number) => void; +export const scriptbuilder_addI64: (a: number, b: number, c: bigint) => void; +export const scriptbuilder_addLockTime: (a: number, b: number, c: bigint) => void; +export const scriptbuilder_canonicalDataSize: (a: number, b: number) => void; +export const scriptbuilder_toString: (a: number) => number; +export const scriptbuilder_drain: (a: number) => number; +export const scriptbuilder_createPayToScriptHashScript: (a: number) => number; +export const scriptbuilder_encodePayToScriptHashSignatureScript: (a: number, b: number, c: number) => void; +export const scriptbuilder_hexView: (a: number, b: number, c: number) => void; +export const __wbg_scriptbuilder_free: (a: number, b: number) => void; +export const scriptbuilder_addSequence: (a: number, b: number, c: bigint) => void; +export const __wbg_storage_free: (a: number, b: number) => void; +export const storage_filename: (a: number, b: number) => void; +export const __wbg_paymentoutput_free: (a: number, b: number) => void; +export const __wbg_get_paymentoutput_address: (a: number) => number; +export const __wbg_set_paymentoutput_address: (a: number, b: number) => void; +export const __wbg_get_paymentoutput_amount: (a: number) => bigint; +export const __wbg_set_paymentoutput_amount: (a: number, b: bigint) => void; +export const paymentoutput_new: (a: number, b: bigint) => number; +export const __wbg_paymentoutputs_free: (a: number, b: number) => void; +export const paymentoutputs_constructor: (a: number, b: number) => void; +export const utxocontext_ctor: (a: number, b: number) => void; +export const utxocontext_trackAddresses: (a: number, b: number, c: number) => number; +export const utxocontext_unregisterAddresses: (a: number, b: number) => number; +export const utxocontext_clear: (a: number) => number; +export const utxocontext_isActive: (a: number) => number; +export const utxocontext_getMatureRange: (a: number, b: number, c: number, d: number) => void; +export const utxocontext_matureLength: (a: number) => number; +export const utxocontext_getPending: (a: number, b: number) => void; +export const utxocontext_balance: (a: number) => number; +export const utxocontext_balanceStrings: (a: number, b: number) => void; +export const __wbg_utxocontext_free: (a: number, b: number) => void; +export const generator_ctor: (a: number, b: number) => void; +export const generator_next: (a: number) => number; +export const generator_estimate: (a: number) => number; +export const generator_summary: (a: number) => number; +export const __wbg_generator_free: (a: number, b: number) => void; +export const calculateStorageMass: (a: number, b: number, c: number, d: number) => void; +export const calculateTransactionFee: (a: number, b: number, c: number, d: number) => void; +export const updateTransactionMass: (a: number, b: number, c: number, d: number) => void; +export const calculateTransactionMass: (a: number, b: number, c: number, d: number) => void; +export const maximumStandardTransactionMass: () => bigint; +export const generatorsummary_networkType: (a: number) => number; +export const generatorsummary_utxos: (a: number) => number; +export const generatorsummary_fees: (a: number) => number; +export const generatorsummary_mass: (a: number) => number; +export const generatorsummary_transactions: (a: number) => number; +export const generatorsummary_finalAmount: (a: number) => number; +export const generatorsummary_finalTransactionId: (a: number, b: number) => void; +export const __wbg_generatorsummary_free: (a: number, b: number) => void; +export const __wbg_accountkind_free: (a: number, b: number) => void; +export const accountkind_ctor: (a: number, b: number, c: number) => void; +export const accountkind_toString: (a: number, b: number) => void; +export const prvkeydatainfo_id: (a: number, b: number) => void; +export const prvkeydatainfo_name: (a: number) => number; +export const prvkeydatainfo_isEncrypted: (a: number) => number; +export const prvkeydatainfo_setName: (a: number, b: number, c: number, d: number) => void; +export const __wbg_prvkeydatainfo_free: (a: number, b: number) => void; +export const wallet_batch: (a: number, b: number) => number; +export const wallet_flush: (a: number, b: number) => number; +export const wallet_retainContext: (a: number, b: number) => number; +export const wallet_getStatus: (a: number, b: number) => number; +export const wallet_walletEnumerate: (a: number, b: number) => number; +export const wallet_walletCreate: (a: number, b: number) => number; +export const wallet_walletOpen: (a: number, b: number) => number; +export const wallet_walletReload: (a: number, b: number) => number; +export const wallet_walletClose: (a: number, b: number) => number; +export const wallet_walletChangeSecret: (a: number, b: number) => number; +export const wallet_walletExport: (a: number, b: number) => number; +export const wallet_walletImport: (a: number, b: number) => number; +export const wallet_prvKeyDataEnumerate: (a: number, b: number) => number; +export const wallet_prvKeyDataCreate: (a: number, b: number) => number; +export const wallet_prvKeyDataRemove: (a: number, b: number) => number; +export const wallet_prvKeyDataGet: (a: number, b: number) => number; +export const wallet_accountsEnumerate: (a: number, b: number) => number; +export const wallet_accountsRename: (a: number, b: number) => number; +export const wallet_accountsDiscovery: (a: number, b: number) => number; +export const wallet_accountsCreate: (a: number, b: number) => number; +export const wallet_accountsEnsureDefault: (a: number, b: number) => number; +export const wallet_accountsImport: (a: number, b: number) => number; +export const wallet_accountsActivate: (a: number, b: number) => number; +export const wallet_accountsDeactivate: (a: number, b: number) => number; +export const wallet_accountsGet: (a: number, b: number) => number; +export const wallet_accountsCreateNewAddress: (a: number, b: number) => number; +export const wallet_accountsSend: (a: number, b: number) => number; +export const wallet_accountsPskbSign: (a: number, b: number) => number; +export const wallet_accountsPskbBroadcast: (a: number, b: number) => number; +export const wallet_accountsPskbSend: (a: number, b: number) => number; +export const wallet_accountsGetUtxos: (a: number, b: number) => number; +export const wallet_accountsTransfer: (a: number, b: number) => number; +export const wallet_accountsEstimate: (a: number, b: number) => number; +export const wallet_transactionsDataGet: (a: number, b: number) => number; +export const wallet_transactionsReplaceNote: (a: number, b: number) => number; +export const wallet_transactionsReplaceMetadata: (a: number, b: number) => number; +export const wallet_addressBookEnumerate: (a: number, b: number) => number; +export const wallet_feeRateEstimate: (a: number, b: number) => number; +export const wallet_feeRatePollerEnable: (a: number, b: number) => number; +export const wallet_feeRatePollerDisable: (a: number, b: number) => number; +export const wallet_accountsCommitReveal: (a: number, b: number) => number; +export const wallet_accountsCommitRevealManual: (a: number, b: number) => number; +export const createAddress: (a: number, b: number, c: number, d: number, e: number) => void; +export const createMultisigAddress: (a: number, b: number, c: number, d: number, e: number, f: number) => void; +export const wallet_constructor: (a: number, b: number) => void; +export const wallet_rpc: (a: number) => number; +export const wallet_isOpen: (a: number) => number; +export const wallet_isSynced: (a: number) => number; +export const wallet_descriptor: (a: number) => number; +export const wallet_exists: (a: number, b: number, c: number) => number; +export const wallet_start: (a: number) => number; +export const wallet_stop: (a: number) => number; +export const wallet_connect: (a: number, b: number) => number; +export const wallet_disconnect: (a: number) => number; +export const wallet_addEventListener: (a: number, b: number, c: number, d: number) => void; +export const wallet_removeEventListener: (a: number, b: number, c: number, d: number) => void; +export const wallet_setNetworkId: (a: number, b: number, c: number) => void; +export const __wbg_wallet_free: (a: number, b: number) => void; +export const cryptobox_ctor: (a: number, b: number, c: number) => void; +export const cryptobox_publicKey: (a: number, b: number) => void; +export const cryptobox_encrypt: (a: number, b: number, c: number, d: number) => void; +export const cryptobox_decrypt: (a: number, b: number, c: number, d: number) => void; +export const __wbg_cryptobox_free: (a: number, b: number) => void; +export const cryptoboxpublickey_ctor: (a: number, b: number) => void; +export const cryptoboxpublickey_toString: (a: number, b: number) => void; +export const __wbg_cryptoboxpublickey_free: (a: number, b: number) => void; +export const cryptoboxprivatekey_ctor: (a: number, b: number) => void; +export const cryptoboxprivatekey_to_public_key: (a: number) => number; +export const __wbg_cryptoboxprivatekey_free: (a: number, b: number) => void; +export const utxoprocessor_addEventListener: (a: number, b: number, c: number, d: number) => void; +export const utxoprocessor_removeEventListener: (a: number, b: number, c: number, d: number) => void; +export const utxoprocessor_ctor: (a: number, b: number) => void; +export const utxoprocessor_start: (a: number) => number; +export const utxoprocessor_stop: (a: number) => number; +export const utxoprocessor_rpc: (a: number) => number; +export const utxoprocessor_networkId: (a: number, b: number) => void; +export const utxoprocessor_setNetworkId: (a: number, b: number, c: number) => void; +export const utxoprocessor_isActive: (a: number) => number; +export const utxoprocessor_setCoinbaseTransactionMaturityDAA: (a: number, b: number, c: bigint) => void; +export const utxoprocessor_setUserTransactionMaturityDAA: (a: number, b: number, c: bigint) => void; +export const __wbg_utxoprocessor_free: (a: number, b: number) => void; +export const getTransactionMaturityProgress: (a: number, b: number, c: number, d: number, e: number) => void; +export const getNetworkParams: (a: number, b: number) => void; +export const sompiToKaspaStringWithSuffix: (a: number, b: number, c: number) => void; +export const sompiToKaspaString: (a: number, b: number) => void; +export const kaspaToSompi: (a: number, b: number) => number; +export const pendingtransaction_id: (a: number, b: number) => void; +export const pendingtransaction_paymentAmount: (a: number) => number; +export const pendingtransaction_changeAmount: (a: number) => number; +export const pendingtransaction_feeAmount: (a: number) => number; +export const pendingtransaction_mass: (a: number) => number; +export const pendingtransaction_minimumSignatures: (a: number) => number; +export const pendingtransaction_aggregateInputAmount: (a: number) => number; +export const pendingtransaction_aggregateOutputAmount: (a: number) => number; +export const pendingtransaction_type: (a: number, b: number) => void; +export const pendingtransaction_addresses: (a: number) => number; +export const pendingtransaction_getUtxoEntries: (a: number) => number; +export const pendingtransaction_createInputSignature: (a: number, b: number, c: number, d: number, e: number) => void; +export const pendingtransaction_fillInput: (a: number, b: number, c: number, d: number) => void; +export const pendingtransaction_signInput: (a: number, b: number, c: number, d: number, e: number) => void; +export const pendingtransaction_sign: (a: number, b: number, c: number, d: number) => void; +export const pendingtransaction_submit: (a: number, b: number) => number; +export const pendingtransaction_transaction: (a: number, b: number) => void; +export const pendingtransaction_serializeToObject: (a: number, b: number) => void; +export const pendingtransaction_serializeToJSON: (a: number, b: number) => void; +export const pendingtransaction_serializeToSafeJSON: (a: number, b: number) => void; +export const __wbg_pendingtransaction_free: (a: number, b: number) => void; +export const signScriptHash: (a: number, b: number, c: number) => void; +export const createInputSignature: (a: number, b: number, c: number, d: number, e: number) => void; +export const signTransaction: (a: number, b: number, c: number, d: number) => void; +export const balancestrings_mature: (a: number, b: number) => void; +export const balancestrings_pending: (a: number, b: number) => void; +export const __wbg_balancestrings_free: (a: number, b: number) => void; +export const balance_mature: (a: number) => number; +export const balance_pending: (a: number) => number; +export const balance_outgoing: (a: number) => number; +export const balance_toBalanceStrings: (a: number, b: number, c: number) => void; +export const __wbg_balance_free: (a: number, b: number) => void; +export const __wbg_walletdescriptor_free: (a: number, b: number) => void; +export const __wbg_get_walletdescriptor_title: (a: number, b: number) => void; +export const __wbg_set_walletdescriptor_title: (a: number, b: number, c: number) => void; +export const __wbg_get_walletdescriptor_filename: (a: number, b: number) => void; +export const __wbg_set_walletdescriptor_filename: (a: number, b: number, c: number) => void; +export const __wbg_transactionrecordnotification_free: (a: number, b: number) => void; +export const __wbg_get_transactionrecordnotification_type: (a: number, b: number) => void; +export const __wbg_set_transactionrecordnotification_type: (a: number, b: number, c: number) => void; +export const __wbg_get_transactionrecordnotification_data: (a: number) => number; +export const __wbg_set_transactionrecordnotification_data: (a: number, b: number) => void; +export const __wbg_transactionrecord_free: (a: number, b: number) => void; +export const __wbg_get_transactionrecord_id: (a: number) => number; +export const __wbg_set_transactionrecord_id: (a: number, b: number) => void; +export const __wbg_get_transactionrecord_unixtimeMsec: (a: number, b: number) => void; +export const __wbg_set_transactionrecord_unixtimeMsec: (a: number, b: number, c: bigint) => void; +export const __wbg_get_transactionrecord_network: (a: number) => number; +export const __wbg_set_transactionrecord_network: (a: number, b: number) => void; +export const __wbg_get_transactionrecord_note: (a: number, b: number) => void; +export const __wbg_set_transactionrecord_note: (a: number, b: number, c: number) => void; +export const __wbg_get_transactionrecord_metadata: (a: number, b: number) => void; +export const __wbg_set_transactionrecord_metadata: (a: number, b: number, c: number) => void; +export const transactionrecord_maturityProgress: (a: number, b: number, c: number) => void; +export const transactionrecord_value: (a: number) => number; +export const transactionrecord_blockDaaScore: (a: number) => number; +export const transactionrecord_binding: (a: number) => number; +export const transactionrecord_data: (a: number) => number; +export const transactionrecord_type: (a: number, b: number) => void; +export const transactionrecord_hasAddress: (a: number, b: number) => number; +export const transactionrecord_serialize: (a: number) => number; +export const argon2sha256ivFromText: (a: number, b: number, c: number, d: number) => void; +export const argon2sha256ivFromBinary: (a: number, b: number, c: number) => void; +export const sha256dFromText: (a: number, b: number, c: number) => void; +export const sha256dFromBinary: (a: number, b: number) => void; +export const sha256FromText: (a: number, b: number, c: number) => void; +export const sha256FromBinary: (a: number, b: number) => void; +export const decryptXChaCha20Poly1305: (a: number, b: number, c: number, d: number, e: number) => void; +export const encryptXChaCha20Poly1305: (a: number, b: number, c: number, d: number, e: number) => void; +export const setDefaultStorageFolder: (a: number, b: number, c: number) => void; +export const setDefaultWalletFile: (a: number, b: number, c: number) => void; +export const estimateTransactions: (a: number) => number; +export const createTransactions: (a: number) => number; +export const createTransaction: (a: number, b: number, c: number, d: number, e: number, f: number) => void; +export const verifyMessage: (a: number, b: number) => void; +export const signMessage: (a: number, b: number) => void; +export const __wbg_publickey_free: (a: number, b: number) => void; +export const publickey_try_new: (a: number, b: number, c: number) => void; +export const publickey_toString: (a: number, b: number) => void; +export const publickey_toAddress: (a: number, b: number, c: number) => void; +export const publickey_toAddressECDSA: (a: number, b: number, c: number) => void; +export const publickey_toXOnlyPublicKey: (a: number) => number; +export const publickey_fingerprint: (a: number) => number; +export const __wbg_xonlypublickey_free: (a: number, b: number) => void; +export const xonlypublickey_try_new: (a: number, b: number, c: number) => void; +export const xonlypublickey_toString: (a: number, b: number) => void; +export const xonlypublickey_toAddress: (a: number, b: number, c: number) => void; +export const xonlypublickey_toAddressECDSA: (a: number, b: number, c: number) => void; +export const xonlypublickey_fromAddress: (a: number, b: number) => void; +export const __wbg_privatekey_free: (a: number, b: number) => void; +export const privatekey_try_new: (a: number, b: number, c: number) => void; +export const privatekey_toString: (a: number, b: number) => void; +export const privatekey_toKeypair: (a: number, b: number) => void; +export const privatekey_toPublicKey: (a: number, b: number) => void; +export const privatekey_toAddress: (a: number, b: number, c: number) => void; +export const privatekey_toAddressECDSA: (a: number, b: number, c: number) => void; +export const __wbg_derivationpath_free: (a: number, b: number) => void; +export const derivationpath_new: (a: number, b: number, c: number) => void; +export const derivationpath_isEmpty: (a: number) => number; +export const derivationpath_length: (a: number) => number; +export const derivationpath_parent: (a: number) => number; +export const derivationpath_push: (a: number, b: number, c: number, d: number) => void; +export const derivationpath_toString: (a: number, b: number) => void; +export const __wbg_keypair_free: (a: number, b: number) => void; +export const keypair_get_public_key: (a: number, b: number) => void; +export const keypair_get_private_key: (a: number, b: number) => void; +export const keypair_get_xonly_public_key: (a: number) => number; +export const keypair_toAddress: (a: number, b: number, c: number) => void; +export const keypair_toAddressECDSA: (a: number, b: number, c: number) => void; +export const keypair_random: (a: number) => void; +export const keypair_fromPrivateKey: (a: number, b: number) => void; +export const __wbg_xpub_free: (a: number, b: number) => void; +export const xpub_try_new: (a: number, b: number, c: number) => void; +export const xpub_deriveChild: (a: number, b: number, c: number, d: number) => void; +export const xpub_derivePath: (a: number, b: number, c: number) => void; +export const xpub_intoString: (a: number, b: number, c: number, d: number) => void; +export const xpub_toPublicKey: (a: number) => number; +export const xpub_xpub: (a: number, b: number) => void; +export const xpub_depth: (a: number) => number; +export const xpub_parentFingerprint: (a: number, b: number) => void; +export const xpub_childNumber: (a: number) => number; +export const xpub_chainCode: (a: number, b: number) => void; +export const __wbg_publickeygenerator_free: (a: number, b: number) => void; +export const publickeygenerator_fromXPub: (a: number, b: number, c: number) => void; +export const publickeygenerator_fromMasterXPrv: (a: number, b: number, c: number, d: bigint, e: number) => void; +export const publickeygenerator_receivePubkeys: (a: number, b: number, c: number, d: number) => void; +export const publickeygenerator_receivePubkey: (a: number, b: number, c: number) => void; +export const publickeygenerator_receivePubkeysAsStrings: (a: number, b: number, c: number, d: number) => void; +export const publickeygenerator_receivePubkeyAsString: (a: number, b: number, c: number) => void; +export const publickeygenerator_receiveAddresses: (a: number, b: number, c: number, d: number, e: number) => void; +export const publickeygenerator_receiveAddress: (a: number, b: number, c: number, d: number) => void; +export const publickeygenerator_receiveAddressAsStrings: (a: number, b: number, c: number, d: number, e: number) => void; +export const publickeygenerator_receiveAddressAsString: (a: number, b: number, c: number, d: number) => void; +export const publickeygenerator_changePubkeys: (a: number, b: number, c: number, d: number) => void; +export const publickeygenerator_changePubkey: (a: number, b: number, c: number) => void; +export const publickeygenerator_changePubkeysAsStrings: (a: number, b: number, c: number, d: number) => void; +export const publickeygenerator_changePubkeyAsString: (a: number, b: number, c: number) => void; +export const publickeygenerator_changeAddresses: (a: number, b: number, c: number, d: number, e: number) => void; +export const publickeygenerator_changeAddress: (a: number, b: number, c: number, d: number) => void; +export const publickeygenerator_changeAddressAsStrings: (a: number, b: number, c: number, d: number, e: number) => void; +export const publickeygenerator_changeAddressAsString: (a: number, b: number, c: number, d: number) => void; +export const publickeygenerator_toString: (a: number, b: number) => void; +export const __wbg_privatekeygenerator_free: (a: number, b: number) => void; +export const privatekeygenerator_new: (a: number, b: number, c: number, d: bigint, e: number) => void; +export const privatekeygenerator_receiveKey: (a: number, b: number, c: number) => void; +export const privatekeygenerator_changeKey: (a: number, b: number, c: number) => void; +export const __wbg_xprv_free: (a: number, b: number) => void; +export const xprv_try_new: (a: number, b: number) => void; +export const xprv_fromXPrv: (a: number, b: number, c: number) => void; +export const xprv_deriveChild: (a: number, b: number, c: number, d: number) => void; +export const xprv_derivePath: (a: number, b: number, c: number) => void; +export const xprv_intoString: (a: number, b: number, c: number, d: number) => void; +export const xprv_toString: (a: number, b: number) => void; +export const xprv_toXPub: (a: number, b: number) => void; +export const xprv_toPrivateKey: (a: number, b: number) => void; +export const xprv_privateKey: (a: number, b: number) => void; +export const xprv_depth: (a: number) => number; +export const xprv_parentFingerprint: (a: number, b: number) => void; +export const xprv_childNumber: (a: number) => number; +export const xprv_chainCode: (a: number, b: number) => void; +export const xprv_xprv: (a: number, b: number) => void; +export const __wbg_pskt_free: (a: number, b: number) => void; +export const pskt_new: (a: number, b: number) => void; +export const pskt_role: (a: number, b: number) => void; +export const pskt_payload: (a: number) => number; +export const pskt_serialize: (a: number, b: number) => void; +export const pskt_creator: (a: number, b: number) => void; +export const pskt_toConstructor: (a: number, b: number) => void; +export const pskt_toUpdater: (a: number, b: number) => void; +export const pskt_toSigner: (a: number, b: number) => void; +export const pskt_toCombiner: (a: number, b: number) => void; +export const pskt_toFinalizer: (a: number, b: number) => void; +export const pskt_toExtractor: (a: number, b: number) => void; +export const pskt_fallbackLockTime: (a: number, b: number, c: bigint) => void; +export const pskt_inputsModifiable: (a: number, b: number) => void; +export const pskt_outputsModifiable: (a: number, b: number) => void; +export const pskt_noMoreInputs: (a: number, b: number) => void; +export const pskt_noMoreOutputs: (a: number, b: number) => void; +export const pskt_inputAndRedeemScript: (a: number, b: number, c: number, d: number) => void; +export const pskt_input: (a: number, b: number, c: number) => void; +export const pskt_output: (a: number, b: number, c: number) => void; +export const pskt_setSequence: (a: number, b: number, c: bigint, d: number) => void; +export const pskt_calculateId: (a: number, b: number) => void; +export const pskt_calculateMass: (a: number, b: number, c: number) => void; +export const __wbg_pskb_free: (a: number, b: number) => void; +export const pskb_new: (a: number) => void; +export const pskb_serialize: (a: number, b: number) => void; +export const pskb_displayFormat: (a: number, b: number, c: number) => void; +export const pskb_deserialize: (a: number, b: number, c: number) => void; +export const pskb_length: (a: number) => number; +export const pskb_add: (a: number, b: number, c: number) => void; +export const pskb_merge: (a: number, b: number) => void; +export const version: (a: number) => void; +export const __wbg_nodedescriptor_free: (a: number, b: number) => void; +export const __wbg_get_nodedescriptor_uid: (a: number, b: number) => void; +export const __wbg_set_nodedescriptor_uid: (a: number, b: number, c: number) => void; +export const __wbg_get_nodedescriptor_url: (a: number, b: number) => void; +export const __wbg_set_nodedescriptor_url: (a: number, b: number, c: number) => void; +export const rpcclient_getBlockCount: (a: number, b: number) => number; +export const rpcclient_getBlockDagInfo: (a: number, b: number) => number; +export const rpcclient_getCoinSupply: (a: number, b: number) => number; +export const rpcclient_getConnectedPeerInfo: (a: number, b: number) => number; +export const rpcclient_getInfo: (a: number, b: number) => number; +export const rpcclient_getPeerAddresses: (a: number, b: number) => number; +export const rpcclient_getMetrics: (a: number, b: number) => number; +export const rpcclient_getConnections: (a: number, b: number) => number; +export const rpcclient_getSink: (a: number, b: number) => number; +export const rpcclient_getSinkBlueScore: (a: number, b: number) => number; +export const rpcclient_ping: (a: number, b: number) => number; +export const rpcclient_shutdown: (a: number, b: number) => number; +export const rpcclient_getServerInfo: (a: number, b: number) => number; +export const rpcclient_getSyncStatus: (a: number, b: number) => number; +export const rpcclient_getFeeEstimate: (a: number, b: number) => number; +export const rpcclient_getCurrentNetwork: (a: number, b: number) => number; +export const rpcclient_addPeer: (a: number, b: number) => number; +export const rpcclient_ban: (a: number, b: number) => number; +export const rpcclient_estimateNetworkHashesPerSecond: (a: number, b: number) => number; +export const rpcclient_getBalanceByAddress: (a: number, b: number) => number; +export const rpcclient_getBalancesByAddresses: (a: number, b: number) => number; +export const rpcclient_getBlock: (a: number, b: number) => number; +export const rpcclient_getBlocks: (a: number, b: number) => number; +export const rpcclient_getBlockTemplate: (a: number, b: number) => number; +export const rpcclient_getCurrentBlockColor: (a: number, b: number) => number; +export const rpcclient_getDaaScoreTimestampEstimate: (a: number, b: number) => number; +export const rpcclient_getFeeEstimateExperimental: (a: number, b: number) => number; +export const rpcclient_getHeaders: (a: number, b: number) => number; +export const rpcclient_getMempoolEntries: (a: number, b: number) => number; +export const rpcclient_getMempoolEntriesByAddresses: (a: number, b: number) => number; +export const rpcclient_getMempoolEntry: (a: number, b: number) => number; +export const rpcclient_getSubnetwork: (a: number, b: number) => number; +export const rpcclient_getUtxosByAddresses: (a: number, b: number) => number; +export const rpcclient_getVirtualChainFromBlock: (a: number, b: number) => number; +export const rpcclient_resolveFinalityConflict: (a: number, b: number) => number; +export const rpcclient_submitBlock: (a: number, b: number) => number; +export const rpcclient_submitTransaction: (a: number, b: number) => number; +export const rpcclient_submitTransactionReplacement: (a: number, b: number) => number; +export const rpcclient_unban: (a: number, b: number) => number; +export const rpcclient_subscribeBlockAdded: (a: number) => number; +export const rpcclient_unsubscribeBlockAdded: (a: number) => number; +export const rpcclient_subscribeFinalityConflict: (a: number) => number; +export const rpcclient_unsubscribeFinalityConflict: (a: number) => number; +export const rpcclient_subscribeFinalityConflictResolved: (a: number) => number; +export const rpcclient_unsubscribeFinalityConflictResolved: (a: number) => number; +export const rpcclient_subscribeSinkBlueScoreChanged: (a: number) => number; +export const rpcclient_unsubscribeSinkBlueScoreChanged: (a: number) => number; +export const rpcclient_subscribePruningPointUtxoSetOverride: (a: number) => number; +export const rpcclient_unsubscribePruningPointUtxoSetOverride: (a: number) => number; +export const rpcclient_subscribeNewBlockTemplate: (a: number) => number; +export const rpcclient_unsubscribeNewBlockTemplate: (a: number) => number; +export const rpcclient_subscribeVirtualDaaScoreChanged: (a: number) => number; +export const rpcclient_unsubscribeVirtualDaaScoreChanged: (a: number) => number; +export const rpcclient_subscribeUtxosChanged: (a: number, b: number) => number; +export const rpcclient_unsubscribeUtxosChanged: (a: number, b: number) => number; +export const rpcclient_subscribeVirtualChainChanged: (a: number, b: number) => number; +export const rpcclient_unsubscribeVirtualChainChanged: (a: number, b: number) => number; +export const rpcclient_defaultPort: (a: number, b: number, c: number) => void; +export const rpcclient_parseUrl: (a: number, b: number, c: number, d: number, e: number) => void; +export const rpcclient_ctor: (a: number, b: number) => void; +export const rpcclient_url: (a: number, b: number) => void; +export const rpcclient_resolver: (a: number) => number; +export const rpcclient_setResolver: (a: number, b: number, c: number) => void; +export const rpcclient_setNetworkId: (a: number, b: number, c: number) => void; +export const rpcclient_isConnected: (a: number) => number; +export const rpcclient_encoding: (a: number, b: number) => void; +export const rpcclient_nodeId: (a: number, b: number) => void; +export const rpcclient_connect: (a: number, b: number) => number; +export const rpcclient_disconnect: (a: number) => number; +export const rpcclient_start: (a: number) => number; +export const rpcclient_stop: (a: number) => number; +export const rpcclient_triggerAbort: (a: number) => void; +export const rpcclient_addEventListener: (a: number, b: number, c: number, d: number) => void; +export const rpcclient_removeEventListener: (a: number, b: number, c: number, d: number) => void; +export const rpcclient_clearEventListener: (a: number, b: number, c: number) => void; +export const rpcclient_removeAllEventListeners: (a: number, b: number) => void; +export const __wbg_rpcclient_free: (a: number, b: number) => void; +export const resolver_urls: (a: number) => number; +export const resolver_getNode: (a: number, b: number, c: number) => number; +export const resolver_getUrl: (a: number, b: number, c: number) => number; +export const resolver_connect: (a: number, b: number) => number; +export const resolver_ctor: (a: number, b: number) => void; +export const __wbg_resolver_free: (a: number, b: number) => void; +export const __wbg_appendfileoptions_free: (a: number, b: number) => void; +export const appendfileoptions_new_with_values: (a: number, b: number, c: number) => number; +export const appendfileoptions_new: () => number; +export const appendfileoptions_encoding: (a: number) => number; +export const appendfileoptions_set_encoding: (a: number, b: number) => void; +export const appendfileoptions_mode: (a: number) => number; +export const appendfileoptions_set_mode: (a: number, b: number) => void; +export const appendfileoptions_flag: (a: number) => number; +export const appendfileoptions_set_flag: (a: number, b: number) => void; +export const __wbg_formatinputpathobject_free: (a: number, b: number) => void; +export const formatinputpathobject_new_with_values: (a: number, b: number, c: number, d: number, e: number) => number; +export const formatinputpathobject_new: () => number; +export const formatinputpathobject_base: (a: number) => number; +export const formatinputpathobject_set_base: (a: number, b: number) => void; +export const formatinputpathobject_dir: (a: number) => number; +export const formatinputpathobject_set_dir: (a: number, b: number) => void; +export const formatinputpathobject_ext: (a: number) => number; +export const formatinputpathobject_set_ext: (a: number, b: number) => void; +export const formatinputpathobject_name: (a: number) => number; +export const formatinputpathobject_set_name: (a: number, b: number) => void; +export const formatinputpathobject_root: (a: number) => number; +export const formatinputpathobject_set_root: (a: number, b: number) => void; +export const __wbg_mkdtempsyncoptions_free: (a: number, b: number) => void; +export const mkdtempsyncoptions_new_with_values: (a: number) => number; +export const mkdtempsyncoptions_new: () => number; +export const mkdtempsyncoptions_encoding: (a: number) => number; +export const mkdtempsyncoptions_set_encoding: (a: number, b: number) => void; +export const __wbg_wasioptions_free: (a: number, b: number) => void; +export const wasioptions_new_with_values: (a: number, b: number, c: number, d: number) => number; +export const wasioptions_new: (a: number) => number; +export const wasioptions_args: (a: number, b: number) => void; +export const wasioptions_set_args: (a: number, b: number, c: number) => void; +export const wasioptions_env: (a: number) => number; +export const wasioptions_set_env: (a: number, b: number) => void; +export const wasioptions_preopens: (a: number) => number; +export const wasioptions_set_preopens: (a: number, b: number) => void; +export const __wbg_assertionerroroptions_free: (a: number, b: number) => void; +export const assertionerroroptions_new: (a: number, b: number, c: number, d: number) => number; +export const assertionerroroptions_message: (a: number) => number; +export const assertionerroroptions_set_message: (a: number, b: number) => void; +export const assertionerroroptions_actual: (a: number) => number; +export const assertionerroroptions_set_actual: (a: number, b: number) => void; +export const assertionerroroptions_expected: (a: number) => number; +export const assertionerroroptions_set_expected: (a: number, b: number) => void; +export const assertionerroroptions_operator: (a: number) => number; +export const assertionerroroptions_set_operator: (a: number, b: number) => void; +export const __wbg_createreadstreamoptions_free: (a: number, b: number) => void; +export const createreadstreamoptions_new_with_values: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number; +export const createreadstreamoptions_auto_close: (a: number) => number; +export const createreadstreamoptions_set_auto_close: (a: number, b: number) => void; +export const createreadstreamoptions_emit_close: (a: number) => number; +export const createreadstreamoptions_set_emit_close: (a: number, b: number) => void; +export const createreadstreamoptions_encoding: (a: number) => number; +export const createreadstreamoptions_set_encoding: (a: number, b: number) => void; +export const createreadstreamoptions_end: (a: number, b: number) => void; +export const createreadstreamoptions_set_end: (a: number, b: number, c: number) => void; +export const createreadstreamoptions_fd: (a: number) => number; +export const createreadstreamoptions_set_fd: (a: number, b: number) => void; +export const createreadstreamoptions_flags: (a: number) => number; +export const createreadstreamoptions_set_flags: (a: number, b: number) => void; +export const createreadstreamoptions_high_water_mark: (a: number, b: number) => void; +export const createreadstreamoptions_set_high_water_mark: (a: number, b: number, c: number) => void; +export const createreadstreamoptions_mode: (a: number) => number; +export const createreadstreamoptions_set_mode: (a: number, b: number) => void; +export const createreadstreamoptions_start: (a: number, b: number) => void; +export const createreadstreamoptions_set_start: (a: number, b: number, c: number) => void; +export const __wbg_getnameoptions_free: (a: number, b: number) => void; +export const getnameoptions_new: (a: number, b: number, c: number, d: number) => number; +export const getnameoptions_family: (a: number) => number; +export const getnameoptions_set_family: (a: number, b: number) => void; +export const getnameoptions_host: (a: number) => number; +export const getnameoptions_set_host: (a: number, b: number) => void; +export const getnameoptions_local_address: (a: number) => number; +export const getnameoptions_set_local_address: (a: number, b: number) => void; +export const getnameoptions_port: (a: number) => number; +export const getnameoptions_set_port: (a: number, b: number) => void; +export const __wbg_netserveroptions_free: (a: number, b: number) => void; +export const netserveroptions_allow_half_open: (a: number) => number; +export const netserveroptions_set_allow_half_open: (a: number, b: number) => void; +export const netserveroptions_pause_on_connect: (a: number) => number; +export const __wbg_processsendoptions_free: (a: number, b: number) => void; +export const processsendoptions_new: (a: number) => number; +export const processsendoptions_swallow_errors: (a: number) => number; +export const processsendoptions_set_swallow_errors: (a: number, b: number) => void; +export const netserveroptions_set_pause_on_connect: (a: number, b: number) => void; +export const readstream_add_listener_with_open: (a: number, b: number) => number; +export const readstream_add_listener_with_close: (a: number, b: number) => number; +export const readstream_on_with_open: (a: number, b: number) => number; +export const readstream_on_with_close: (a: number, b: number) => number; +export const readstream_once_with_open: (a: number, b: number) => number; +export const readstream_once_with_close: (a: number, b: number) => number; +export const readstream_prepend_listener_with_open: (a: number, b: number) => number; +export const readstream_prepend_listener_with_close: (a: number, b: number) => number; +export const readstream_prepend_once_listener_with_open: (a: number, b: number) => number; +export const readstream_prepend_once_listener_with_close: (a: number, b: number) => number; +export const __wbg_agentconstructoroptions_free: (a: number, b: number) => void; +export const agentconstructoroptions_keep_alive_msecs: (a: number) => number; +export const agentconstructoroptions_set_keep_alive_msecs: (a: number, b: number) => void; +export const agentconstructoroptions_keep_alive: (a: number) => number; +export const agentconstructoroptions_set_keep_alive: (a: number, b: number) => void; +export const agentconstructoroptions_max_free_sockets: (a: number) => number; +export const agentconstructoroptions_set_max_free_sockets: (a: number, b: number) => void; +export const agentconstructoroptions_max_sockets: (a: number) => number; +export const agentconstructoroptions_set_max_sockets: (a: number, b: number) => void; +export const agentconstructoroptions_timeout: (a: number) => number; +export const agentconstructoroptions_set_timeout: (a: number, b: number) => void; +export const __wbg_createwritestreamoptions_free: (a: number, b: number) => void; +export const createwritestreamoptions_new_with_values: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number; +export const createwritestreamoptions_auto_close: (a: number) => number; +export const createwritestreamoptions_set_auto_close: (a: number, b: number) => void; +export const createwritestreamoptions_emit_close: (a: number) => number; +export const createwritestreamoptions_set_emit_close: (a: number, b: number) => void; +export const createwritestreamoptions_encoding: (a: number) => number; +export const createwritestreamoptions_set_encoding: (a: number, b: number) => void; +export const createwritestreamoptions_fd: (a: number) => number; +export const createwritestreamoptions_set_fd: (a: number, b: number) => void; +export const createwritestreamoptions_flags: (a: number) => number; +export const createwritestreamoptions_set_flags: (a: number, b: number) => void; +export const createwritestreamoptions_mode: (a: number) => number; +export const createwritestreamoptions_set_mode: (a: number, b: number) => void; +export const createwritestreamoptions_start: (a: number, b: number) => void; +export const createwritestreamoptions_set_start: (a: number, b: number, c: number) => void; +export const __wbg_userinfooptions_free: (a: number, b: number) => void; +export const userinfooptions_new_with_values: (a: number) => number; +export const userinfooptions_new: () => number; +export const userinfooptions_encoding: (a: number) => number; +export const userinfooptions_set_encoding: (a: number, b: number) => void; +export const __wbg_writefilesyncoptions_free: (a: number, b: number) => void; +export const writefilesyncoptions_new: (a: number, b: number, c: number) => number; +export const writefilesyncoptions_encoding: (a: number) => number; +export const writefilesyncoptions_set_encoding: (a: number, b: number) => void; +export const writefilesyncoptions_flag: (a: number) => number; +export const writefilesyncoptions_set_flag: (a: number, b: number) => void; +export const writefilesyncoptions_mode: (a: number) => number; +export const writefilesyncoptions_set_mode: (a: number, b: number) => void; +export const __wbg_consoleconstructoroptions_free: (a: number, b: number) => void; +export const consoleconstructoroptions_new_with_values: (a: number, b: number, c: number, d: number, e: number) => number; +export const consoleconstructoroptions_new: (a: number, b: number) => number; +export const consoleconstructoroptions_stdout: (a: number) => number; +export const consoleconstructoroptions_set_stdout: (a: number, b: number) => void; +export const consoleconstructoroptions_stderr: (a: number) => number; +export const consoleconstructoroptions_set_stderr: (a: number, b: number) => void; +export const consoleconstructoroptions_ignore_errors: (a: number) => number; +export const consoleconstructoroptions_set_ignore_errors: (a: number, b: number) => void; +export const consoleconstructoroptions_color_mod: (a: number) => number; +export const consoleconstructoroptions_set_color_mod: (a: number, b: number) => void; +export const consoleconstructoroptions_inspect_options: (a: number) => number; +export const consoleconstructoroptions_set_inspect_options: (a: number, b: number) => void; +export const __wbg_pipeoptions_free: (a: number, b: number) => void; +export const pipeoptions_new: (a: number) => number; +export const pipeoptions_end: (a: number) => number; +export const pipeoptions_set_end: (a: number, b: number) => void; +export const writestream_add_listener_with_open: (a: number, b: number) => number; +export const writestream_add_listener_with_close: (a: number, b: number) => number; +export const writestream_on_with_open: (a: number, b: number) => number; +export const writestream_on_with_close: (a: number, b: number) => number; +export const writestream_once_with_open: (a: number, b: number) => number; +export const writestream_once_with_close: (a: number, b: number) => number; +export const writestream_prepend_listener_with_open: (a: number, b: number) => number; +export const writestream_prepend_listener_with_close: (a: number, b: number) => number; +export const writestream_prepend_once_listener_with_open: (a: number, b: number) => number; +export const writestream_prepend_once_listener_with_close: (a: number, b: number) => number; +export const __wbg_createhookcallbacks_free: (a: number, b: number) => void; +export const createhookcallbacks_new: (a: number, b: number, c: number, d: number, e: number) => number; +export const createhookcallbacks_init: (a: number) => number; +export const createhookcallbacks_set_init: (a: number, b: number) => void; +export const createhookcallbacks_before: (a: number) => number; +export const createhookcallbacks_set_before: (a: number, b: number) => void; +export const createhookcallbacks_after: (a: number) => number; +export const createhookcallbacks_set_after: (a: number, b: number) => void; +export const createhookcallbacks_destroy: (a: number) => number; +export const createhookcallbacks_set_destroy: (a: number, b: number) => void; +export const createhookcallbacks_promise_resolve: (a: number) => number; +export const createhookcallbacks_set_promise_resolve: (a: number, b: number) => void; +export const __wbg_streamtransformoptions_free: (a: number, b: number) => void; +export const streamtransformoptions_new: (a: number, b: number) => number; +export const streamtransformoptions_flush: (a: number) => number; +export const streamtransformoptions_set_flush: (a: number, b: number) => void; +export const streamtransformoptions_transform: (a: number) => number; +export const streamtransformoptions_set_transform: (a: number, b: number) => void; +export const __wbg_setaadoptions_free: (a: number, b: number) => void; +export const setaadoptions_new: (a: number, b: number, c: number) => number; +export const setaadoptions_flush: (a: number) => number; +export const setaadoptions_set_flush: (a: number, b: number) => void; +export const setaadoptions_plaintextLength: (a: number) => number; +export const setaadoptions_set_plaintext_length: (a: number, b: number) => void; +export const setaadoptions_transform: (a: number) => number; +export const setaadoptions_set_transform: (a: number, b: number) => void; +export const rustsecp256k1_v0_10_0_context_create: (a: number) => number; +export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void; +export const rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void; +export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void; +export const __wbg_aborted_free: (a: number, b: number) => void; +export const __wbg_abortable_free: (a: number, b: number) => void; +export const abortable_new: () => number; +export const abortable_isAborted: (a: number) => number; +export const abortable_abort: (a: number) => void; +export const abortable_check: (a: number, b: number) => void; +export const abortable_reset: (a: number) => void; +export const setLogLevel: (a: number) => void; +export const initWASM32Bindings: (a: number, b: number) => void; +export const defer: () => number; +export const presentPanicHookLogs: () => void; +export const initConsolePanicHook: () => void; +export const initBrowserPanicHook: () => void; +export const __wbindgen_export_0: (a: number) => void; +export const __wbindgen_export_1: (a: number, b: number) => number; +export const __wbindgen_export_2: (a: number, b: number, c: number, d: number) => number; +export const __wbindgen_export_3: (a: number, b: number, c: number) => void; +export const __wbindgen_export_4: WebAssembly.Table; +export const __wbindgen_add_to_stack_pointer: (a: number) => number; +export const __wbindgen_export_5: (a: number, b: number) => void; +export const __wbindgen_export_6: (a: number, b: number) => void; +export const __wbindgen_export_7: (a: number, b: number, c: number) => void; +export const __wbindgen_export_8: (a: number, b: number, c: number, d: number) => void; +export const __wbindgen_export_9: (a: number, b: number, c: number) => void; +export const __wbindgen_export_10: (a: number, b: number, c: number) => void; +export const __wbindgen_export_11: (a: number, b: number, c: number, d: number) => number; +export const __wbindgen_export_12: (a: number, b: number, c: number) => void; +export const __wbindgen_export_13: (a: number, b: number, c: number, d: number) => void;