/* tslint:disable */ /* eslint-disable */ export enum AccountInterface { BasicWallet = 0, } export enum AccountType { FungibleFaucet = 0, NonFungibleFaucet = 1, RegularAccountImmutableCode = 2, RegularAccountUpdatableCode = 3, } export enum InputNoteState { Expected = 0, Unverified = 1, Committed = 2, Invalid = 3, ProcessingAuthenticated = 4, ProcessingUnauthenticated = 5, ConsumedAuthenticatedLocal = 6, ConsumedUnauthenticatedLocal = 7, ConsumedExternal = 8, } export enum NetworkId { Mainnet = 0, Testnet = 1, Devnet = 2, } export enum NoteFilterTypes { All = 0, Consumed = 1, Committed = 2, Expected = 3, Processing = 4, List = 5, Unique = 6, Nullifiers = 7, Unverified = 8, } export enum NoteType { /** * Notes with this type have only their hash published to the network. */ Private = 2, /** * Notes with this type are shared with the network encrypted. */ Encrypted = 3, /** * Notes with this type are fully shared with the network. */ Public = 1, } export enum SigningInputsType { TransactionSummary = 0, Arbitrary = 1, Blind = 2, } /** * Specifies which procedures an account accepts, and by extension which notes it can consume. */ type AddressInterface = "BasicWallet"; /** * The `ReadableStreamType` enum. * * *This API requires the following crate features to be activated: `ReadableStreamType`* */ type ReadableStreamType = "bytes"; export class Account { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; isNetwork(): boolean; isPrivate(): boolean; static deserialize(bytes: Uint8Array): Account; isUpdatable(): boolean; getPublicKeys(): Word[]; isRegularAccount(): boolean; id(): AccountId; code(): AccountCode; nonce(): Felt; vault(): AssetVault; isNew(): boolean; storage(): AccountStorage; isFaucet(): boolean; isPublic(): boolean; serialize(): Uint8Array; } export class AccountArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: Account): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): Account; constructor(elements?: Account[] | null); push(element: Account): void; length(): number; } export class AccountBuilder { free(): void; [Symbol.dispose](): void; accountType(account_type: AccountType): AccountBuilder; storageMode(storage_mode: AccountStorageMode): AccountBuilder; withComponent(account_component: AccountComponent): AccountBuilder; withAuthComponent(account_component: AccountComponent): AccountBuilder; withNoAuthComponent(): AccountBuilder; withBasicWalletComponent(): AccountBuilder; constructor(init_seed: Uint8Array); build(): AccountBuilderResult; } export class AccountBuilderResult { private constructor(); free(): void; [Symbol.dispose](): void; readonly seed: Word; readonly account: Account; } export class AccountCode { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; hasProcedure(mast_root: Word): boolean; } export class AccountComponent { private constructor(); free(): void; [Symbol.dispose](): void; static fromPackage(_package: Package, storage_slots: StorageSlotArray): AccountComponent; getProcedures(): GetProceduresResultItem[]; getProcedureHash(procedure_name: string): string; static createAuthComponent(secret_key: SecretKey): AccountComponent; withSupportsAllTypes(): AccountComponent; static createAuthComponentFromCommitment(commitment: Word, auth_scheme_id: number): AccountComponent; static compile(account_code: string, builder: ScriptBuilder, storage_slots: StorageSlot[]): AccountComponent; } export class AccountDelta { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): AccountDelta; nonceDelta(): Felt; id(): AccountId; vault(): AccountVaultDelta; storage(): AccountStorageDelta; isEmpty(): boolean; serialize(): Uint8Array; } export class AccountFile { private constructor(); free(): void; [Symbol.dispose](): void; /** * Deserializes a byte array into an `AccountFile` */ static deserialize(bytes: Uint8Array): AccountFile; /** * Serializes the `AccountFile` into a byte array */ serialize(): Uint8Array; } export class AccountHeader { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; codeCommitment(): Word; vaultCommitment(): Word; storageCommitment(): Word; id(): AccountId; nonce(): Felt; } export class AccountId { private constructor(); free(): void; [Symbol.dispose](): void; isNetwork(): boolean; isPrivate(): boolean; /** * Turn this Account ID into its bech32 string representation. This method accepts a custom * network ID. */ toBech32Custom(custom_network_id: string, account_interface: AccountInterface): string; isRegularAccount(): boolean; prefix(): Felt; suffix(): Felt; static fromHex(hex: string): AccountId; isFaucet(): boolean; isPublic(): boolean; /** * Will turn the Account ID into its bech32 string representation. To avoid a potential * wrongful encoding, this function will expect only IDs for either mainnet ("mm"), * testnet ("mtst") or devnet ("mdev"). To use a custom bech32 prefix, see * `Self::to_bech_32_custom`. */ toBech32(network_id: NetworkId, account_interface: AccountInterface): string; toString(): string; } export class AccountIdArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: AccountId): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): AccountId; constructor(elements?: AccountId[] | null); push(element: AccountId): void; length(): number; } export class AccountStorage { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; getMapItem(index: number, key: Word): Word | undefined; /** * Get all key-value pairs from the map slot at `index`. * Returns `undefined` if the slot isn't a map or `index` is out of bounds (0-255). * Returns `[]` if the map exists but is empty. */ getMapEntries(index: number): JsStorageMapEntry[] | undefined; getItem(index: number): Word | undefined; } export class AccountStorageDelta { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): AccountStorageDelta; values(): Word[]; isEmpty(): boolean; serialize(): Uint8Array; } export class AccountStorageMode { private constructor(); free(): void; [Symbol.dispose](): void; static tryFromStr(s: string): AccountStorageMode; asStr(): string; static public(): AccountStorageMode; static network(): AccountStorageMode; static private(): AccountStorageMode; } export class AccountStorageRequirements { free(): void; [Symbol.dispose](): void; static fromSlotAndKeysArray(slots_and_keys: SlotAndKeys[]): AccountStorageRequirements; constructor(); } export class AccountVaultDelta { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): AccountVaultDelta; addedFungibleAssets(): FungibleAsset[]; removedFungibleAssets(): FungibleAsset[]; fungible(): FungibleAssetDelta; isEmpty(): boolean; serialize(): Uint8Array; } export class Address { private constructor(); /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; accountId(): AccountId; static fromBech32(bech32: string): Address; toNoteTag(): NoteTag; static fromAccountId(account_id: AccountId, _interface?: string | null): Address; interface(): AddressInterface; toBech32(network_id: NetworkId): string; } export class AdviceInputs { private constructor(); free(): void; [Symbol.dispose](): void; mappedValues(key: Word): Felt[] | undefined; stack(): Felt[]; } export class AdviceMap { free(): void; [Symbol.dispose](): void; constructor(); insert(key: Word, value: FeltArray): Felt[] | undefined; } export class AssetVault { private constructor(); free(): void; [Symbol.dispose](): void; getBalance(faucet_id: AccountId): bigint; fungibleAssets(): FungibleAsset[]; root(): Word; } export class AuthSecretKey { private constructor(); free(): void; [Symbol.dispose](): void; getRpoFalcon512PublicKeyAsWord(): Word; getRpoFalcon512SecretKeyAsFelts(): Felt[]; getEcdsaK256KeccakPublicKeyAsWord(): Word; getEcdsaK256KeccakSecretKeyAsFelts(): Felt[]; } export class BasicFungibleFaucetComponent { private constructor(); free(): void; [Symbol.dispose](): void; maxSupply(): Felt; static fromAccount(account: Account): BasicFungibleFaucetComponent; symbol(): TokenSymbol; decimals(): number; } export class BlockHeader { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; accountRoot(): Word; txCommitment(): Word; nullifierRoot(): Word; subCommitment(): Word; chainCommitment(): Word; proofCommitment(): Word; txKernelCommitment(): Word; prevBlockCommitment(): Word; version(): number; blockNum(): number; noteRoot(): Word; timestamp(): number; } export class ConsumableNoteRecord { free(): void; [Symbol.dispose](): void; inputNoteRecord(): InputNoteRecord; noteConsumability(): NoteConsumability[]; constructor(input_note_record: InputNoteRecord, note_consumability: NoteConsumability[]); } /** * Represents a network endpoint for connecting to Miden nodes. * * An endpoint consists of a protocol (http/https), host, and optional port. * Provides convenient constructors for common network configurations. */ export class Endpoint { free(): void; [Symbol.dispose](): void; /** * Creates an endpoint from a URL string. * * @param url - The URL string (e.g., ) * @throws throws an error if the URL is invalid */ constructor(url: string); /** * Returns the endpoint for the Miden devnet. */ static devnet(): Endpoint; /** * Returns the endpoint for the Miden testnet. */ static testnet(): Endpoint; /** * Returns the endpoint for a local Miden node. * * Uses */ static localhost(): Endpoint; /** * Returns the string representation of the endpoint. */ toString(): string; /** * Returns the host of the endpoint. */ readonly host: string; /** * Returns the port of the endpoint. */ readonly port: number | undefined; /** * Returns the protocol of the endpoint. */ readonly protocol: string; } export class ExecutedTransaction { private constructor(); free(): void; [Symbol.dispose](): void; accountId(): AccountId; inputNotes(): InputNotes; blockHeader(): BlockHeader; outputNotes(): OutputNotes; accountDelta(): AccountDelta; finalAccountHeader(): AccountHeader; initialAccountHeader(): AccountHeader; id(): TransactionId; txArgs(): TransactionArgs; } export class Felt { free(): void; [Symbol.dispose](): void; constructor(value: bigint); asInt(): bigint; toString(): string; } export class FeltArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: Felt): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): Felt; constructor(elements?: Felt[] | null); push(element: Felt): void; length(): number; } /** * Represents a note fetched from a Miden node via RPC. */ export class FetchedNote { free(): void; [Symbol.dispose](): void; /** * Create a note with an optional `InputNote`. */ constructor(note_id: NoteId, metadata: NoteMetadata, input_note?: InputNote | null); /** * The full [`InputNote`] with inclusion proof. * * For public notes, it contains the complete note data and inclusion proof. * For private notes, it will be ``None`. */ readonly inputNote: InputNote | undefined; /** * The unique identifier of the note. */ readonly noteId: NoteId; /** * The note's metadata, including sender, tag, and other properties. * Available for both private and public notes. */ readonly metadata: NoteMetadata; readonly noteType: NoteType; } export class FlattenedU8Vec { private constructor(); free(): void; [Symbol.dispose](): void; num_inner_vecs(): number; data(): Uint8Array; lengths(): Uint32Array; } export class ForeignAccount { private constructor(); free(): void; [Symbol.dispose](): void; account_id(): AccountId; storage_slot_requirements(): AccountStorageRequirements; static public(account_id: AccountId, storage_requirements: AccountStorageRequirements): ForeignAccount; } export class ForeignAccountArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: ForeignAccount): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): ForeignAccount; constructor(elements?: ForeignAccount[] | null); push(element: ForeignAccount): void; length(): number; } export class FungibleAsset { free(): void; [Symbol.dispose](): void; constructor(faucet_id: AccountId, amount: bigint); amount(): bigint; faucetId(): AccountId; intoWord(): Word; } export class FungibleAssetDelta { private constructor(); free(): void; [Symbol.dispose](): void; numAssets(): number; static deserialize(bytes: Uint8Array): FungibleAssetDelta; amount(faucet_id: AccountId): bigint | undefined; assets(): FungibleAssetDeltaItem[]; isEmpty(): boolean; serialize(): Uint8Array; } export class FungibleAssetDeltaItem { private constructor(); free(): void; [Symbol.dispose](): void; readonly amount: bigint; readonly faucetId: AccountId; } export class GetProceduresResultItem { private constructor(); free(): void; [Symbol.dispose](): void; readonly digest: Word; readonly isAuth: boolean; } export class InputNote { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; id(): NoteId; note(): Note; proof(): NoteInclusionProof | undefined; location(): NoteLocation | undefined; } export class InputNoteRecord { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word | undefined; isConsumed(): boolean; isProcessing(): boolean; toInputNote(): InputNote; inclusionProof(): NoteInclusionProof | undefined; isAuthenticated(): boolean; consumerTransactionId(): string | undefined; id(): NoteId; state(): InputNoteState; details(): NoteDetails; metadata(): NoteMetadata | undefined; nullifier(): string; } export class InputNotes { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; notes(): InputNote[]; getNote(index: number): InputNote; isEmpty(): boolean; numNotes(): number; } export class IntoUnderlyingByteSource { private constructor(); free(): void; [Symbol.dispose](): void; pull(controller: ReadableByteStreamController): Promise; start(controller: ReadableByteStreamController): void; cancel(): void; readonly autoAllocateChunkSize: number; readonly type: ReadableStreamType; } export class IntoUnderlyingSink { private constructor(); free(): void; [Symbol.dispose](): void; abort(reason: any): Promise; close(): Promise; write(chunk: any): Promise; } export class IntoUnderlyingSource { private constructor(); free(): void; [Symbol.dispose](): void; pull(controller: ReadableStreamDefaultController): Promise; cancel(): void; } /** * Represents an update to a single account's state. */ export class JsAccountUpdate { private constructor(); /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; /** * The merkle root of the account's storage trie. */ storageRoot: string; /** * Serialized storage slot data for this account. */ storageSlots: JsStorageSlot[]; /** * Serialized storage map entries for this account. */ storageMapEntries: JsStorageMapEntry[]; /** * The merkle root of the account's asset vault. */ assetVaultRoot: string; /** * The account's asset vault. */ assets: JsVaultAsset[]; /** * ID for this account. */ accountId: string; /** * The merkle root of the account's executable code. */ codeRoot: string; /** * Whether this account update has been committed. */ committed: boolean; /** * The account's transaction nonce as a string. */ nonce: string; /** * The cryptographic commitment representing this account's current state. */ accountCommitment: string; /** * Optional seed data for the account. */ get accountSeed(): Uint8Array | undefined; /** * Optional seed data for the account. */ set accountSeed(value: Uint8Array | null | undefined); } /** * An object that contains data for a sync update, * which will be received by the applyStateSync JS function. * under sync.js */ export class JsStateSyncUpdate { private constructor(); free(): void; [Symbol.dispose](): void; /** * The block number for this update, stored as a string since it will be * persisted in `IndexedDB`. */ blockNum: string; /** * The new block headers for this state update, serialized into a flattened byte array. */ flattenedNewBlockHeaders: FlattenedU8Vec; /** * The block numbers corresponding to each header in `flattened_new_block_headers`. * This vec should have the same length as the number of headers, with each index * representing the block number for the header at that same index. */ newBlockNums: string[]; /** * Flattened byte array containing partial blockchain peaks used for merkle tree * verification. */ flattenedPartialBlockChainPeaks: FlattenedU8Vec; /** * For each block in this update, stores a boolean (as u8) indicating whether * that block contains notes relevant to this client. Index i corresponds to * the ith block, with 1 meaning relevant and 0 meaning not relevant. */ blockHasRelevantNotes: Uint8Array; /** * Serialized IDs for new authentication nodes required to verify block headers. */ serializedNodeIds: string[]; /** * The actual authentication node data corresponding to the IDs above. */ serializedNodes: string[]; /** * IDs of note tags that should be removed from the client's local state. */ committedNoteIds: string[]; /** * Input notes for this state update in serialized form. */ serializedInputNotes: SerializedInputNoteData[]; /** * Output notes created in this state update in serialized form. */ serializedOutputNotes: SerializedOutputNoteData[]; /** * Account state updates included in this sync. */ accountUpdates: JsAccountUpdate[]; /** * Transaction data for transactions included in this update. */ transactionUpdates: SerializedTransactionData[]; } /** * A JavaScript representation of a storage map entry in an account. */ export class JsStorageMapEntry { private constructor(); /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; /** * The root of the storage map entry. */ root: string; /** * The key of the storage map entry. */ key: string; /** * The value of the storage map entry. */ value: string; } /** * A JavaScript representation of a storage slot in an account. */ export class JsStorageSlot { private constructor(); /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; /** * Commitment of the whole account storage */ commitment: string; /** * The index of the storage slot. */ slotIndex: number; /** * The value stored in the storage slot. */ slotValue: string; /** * The type of the storage slot. */ slotType: number; } /** * An object that contains a serialized vault asset */ export class JsVaultAsset { private constructor(); /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; /** * The merkle root of the vault's assets. */ root: string; /** * The vault key associated with the asset. */ vaultKey: string; /** * Asset's faucet ID prefix. */ faucetIdPrefix: string; /** * Word representing the asset. */ asset: string; } export class Library { private constructor(); free(): void; [Symbol.dispose](): void; } export class MerklePath { private constructor(); free(): void; [Symbol.dispose](): void; computeRoot(index: bigint, node: Word): Word; depth(): number; nodes(): Word[]; verify(index: bigint, node: Word, root: Word): boolean; } export class Note { free(): void; [Symbol.dispose](): void; commitment(): Word; static deserialize(bytes: Uint8Array): Note; static createP2IDNote(sender: AccountId, target: AccountId, assets: NoteAssets, note_type: NoteType, aux: Felt): Note; static createP2IDENote(sender: AccountId, target: AccountId, assets: NoteAssets, reclaim_height: number | null | undefined, timelock_height: number | null | undefined, note_type: NoteType, aux: Felt): Note; id(): NoteId; constructor(note_assets: NoteAssets, note_metadata: NoteMetadata, note_recipient: NoteRecipient); assets(): NoteAssets; script(): NoteScript; metadata(): NoteMetadata; recipient(): NoteRecipient; serialize(): Uint8Array; } export class NoteAndArgs { free(): void; [Symbol.dispose](): void; constructor(note: Note, args?: Word | null); } export class NoteAndArgsArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: NoteAndArgs): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): NoteAndArgs; constructor(elements?: NoteAndArgs[] | null); push(element: NoteAndArgs): void; length(): number; } export class NoteAssets { free(): void; [Symbol.dispose](): void; fungibleAssets(): FungibleAsset[]; constructor(assets_array?: FungibleAsset[] | null); push(asset: FungibleAsset): void; } export class NoteConsumability { private constructor(); free(): void; [Symbol.dispose](): void; accountId(): AccountId; consumableAfterBlock(): number | undefined; } export class NoteDetails { free(): void; [Symbol.dispose](): void; id(): NoteId; constructor(note_assets: NoteAssets, note_recipient: NoteRecipient); assets(): NoteAssets; recipient(): NoteRecipient; } export class NoteDetailsAndTag { free(): void; [Symbol.dispose](): void; constructor(note_details: NoteDetails, tag: NoteTag); readonly noteDetails: NoteDetails; readonly tag: NoteTag; } export class NoteDetailsAndTagArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: NoteDetailsAndTag): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): NoteDetailsAndTag; constructor(elements?: NoteDetailsAndTag[] | null); push(element: NoteDetailsAndTag): void; length(): number; } export class NoteExecutionHint { private constructor(); free(): void; [Symbol.dispose](): void; static fromParts(tag: number, payload: number): NoteExecutionHint; static afterBlock(block_num: number): NoteExecutionHint; static onBlockSlot(epoch_len: number, slot_len: number, slot_offset: number): NoteExecutionHint; canBeConsumed(block_num: number): boolean; static none(): NoteExecutionHint; static always(): NoteExecutionHint; } export class NoteExecutionMode { private constructor(); free(): void; [Symbol.dispose](): void; static newNetwork(): NoteExecutionMode; static newLocal(): NoteExecutionMode; toString(): string; } /** * A serialized representation of a note. */ export class NoteFile { private constructor(); /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; /** * Given a valid byte representation of a `NoteFile`, * return it as a struct. */ static deserialize(bytes: Uint8Array): NoteFile; static fromNoteId(note_details: NoteId): NoteFile; static fromInputNote(note: InputNote): NoteFile; static fromOutputNote(note: OutputNote): NoteFile; static fromNoteDetails(note_details: NoteDetails): NoteFile; /** * Returns this `NoteFile`'s types. */ noteType(): string; /** * Turn a notefile into its byte representation. */ serialize(): Uint8Array; } export class NoteFilter { free(): void; [Symbol.dispose](): void; constructor(note_type: NoteFilterTypes, note_ids?: NoteId[] | null); } export class NoteHeader { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; id(): NoteId; metadata(): NoteMetadata; } export class NoteId { free(): void; [Symbol.dispose](): void; constructor(recipient_digest: Word, asset_commitment_digest: Word); static fromHex(hex: string): NoteId; toString(): string; } export class NoteIdAndArgs { free(): void; [Symbol.dispose](): void; constructor(note_id: NoteId, args?: Word | null); } export class NoteIdAndArgsArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: NoteIdAndArgs): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): NoteIdAndArgs; constructor(elements?: NoteIdAndArgs[] | null); push(element: NoteIdAndArgs): void; length(): number; } export class NoteInclusionProof { private constructor(); free(): void; [Symbol.dispose](): void; location(): NoteLocation; notePath(): MerklePath; } export class NoteInputs { free(): void; [Symbol.dispose](): void; constructor(felt_array: FeltArray); values(): Felt[]; } export class NoteLocation { private constructor(); free(): void; [Symbol.dispose](): void; nodeIndexInBlock(): number; blockNum(): number; } export class NoteMetadata { free(): void; [Symbol.dispose](): void; constructor(sender: AccountId, note_type: NoteType, note_tag: NoteTag, note_execution_hint: NoteExecutionHint, aux?: Felt | null); tag(): NoteTag; sender(): AccountId; noteType(): NoteType; } export class NoteRecipient { free(): void; [Symbol.dispose](): void; serialNum(): Word; constructor(serial_num: Word, note_script: NoteScript, inputs: NoteInputs); digest(): Word; inputs(): NoteInputs; script(): NoteScript; } export class NoteRecipientArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: NoteRecipient): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): NoteRecipient; constructor(elements?: NoteRecipient[] | null); push(element: NoteRecipient): void; length(): number; } export class NoteScript { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): NoteScript; /** * Creates a `NoteScript` from the given `Package`. * Throws if the package is invalid. */ static fromPackage(_package: Package): NoteScript; static p2id(): NoteScript; root(): Word; static swap(): NoteScript; static p2ide(): NoteScript; serialize(): Uint8Array; /** * Print the MAST source for this script. */ toString(): string; } export class NoteTag { private constructor(); free(): void; [Symbol.dispose](): void; executionMode(): NoteExecutionMode; static fromAccountId(account_id: AccountId): NoteTag; isSingleTarget(): boolean; static forLocalUseCase(use_case_id: number, payload: number): NoteTag; static forPublicUseCase(use_case_id: number, payload: number, execution: NoteExecutionMode): NoteTag; asU32(): number; } export class OutputNote { private constructor(); free(): void; [Symbol.dispose](): void; recipientDigest(): Word | undefined; id(): NoteId; static full(note: Note): OutputNote; assets(): NoteAssets | undefined; static header(note_header: NoteHeader): OutputNote; shrink(): OutputNote; static partial(partial_note: PartialNote): OutputNote; metadata(): NoteMetadata; intoFull(): Note | undefined; } export class OutputNoteArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: OutputNote): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): OutputNote; constructor(elements?: OutputNote[] | null); push(element: OutputNote): void; length(): number; } export class OutputNotes { private constructor(); free(): void; [Symbol.dispose](): void; commitment(): Word; notes(): OutputNote[]; getNote(index: number): OutputNote; isEmpty(): boolean; numNotes(): number; } export class OutputNotesArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: OutputNotes): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): OutputNotes; constructor(elements?: OutputNotes[] | null); push(element: OutputNotes): void; length(): number; } export class Package { private constructor(); free(): void; [Symbol.dispose](): void; /** * Returns the underlying library of a `Package`. * Fails if the package is not a library. */ asLibrary(): Library; /** * Returns the underlying program of a `Package`. * Fails if the package is not a program. */ asProgram(): Program; static deserialize(bytes: Uint8Array): Package; serialize(): Uint8Array; } export class PartialNote { private constructor(); free(): void; [Symbol.dispose](): void; recipientDigest(): Word; id(): NoteId; assets(): NoteAssets; metadata(): NoteMetadata; } export class Program { private constructor(); free(): void; [Symbol.dispose](): void; } /** * WASM wrapper around the native [`ProvenTransaction`]. */ export class ProvenTransaction { private constructor(); free(): void; [Symbol.dispose](): void; /** * Returns the account ID the transaction was executed against. */ accountId(): AccountId; /** * Returns the nullifiers of the consumed input notes. */ nullifiers(): Word[]; /** * Deserializes a proven transaction from bytes. */ static deserialize(bytes: Uint8Array): ProvenTransaction; /** * Returns notes created by this transaction. */ outputNotes(): OutputNotes; /** * Returns the reference block number used during execution. */ refBlockNumber(): number; /** * Returns the commitment of the reference block. */ refBlockCommitment(): Word; /** * Returns the block number at which the transaction expires. */ expirationBlockNumber(): number; /** * Returns the transaction ID. */ id(): TransactionId; /** * Serializes the proven transaction into bytes. */ serialize(): Uint8Array; } export class PublicKey { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): PublicKey; verifyData(signing_inputs: SigningInputs, signature: Signature): boolean; static recoverFrom(message: Word, signature: Signature): PublicKey; toCommitment(): Word; verify(message: Word, signature: Signature): boolean; serialize(): Uint8Array; } /** * RPC Client for interacting with Miden nodes directly. */ export class RpcClient { free(): void; [Symbol.dispose](): void; /** * Fetches notes by their IDs from the connected Miden node. * * @param note_ids - Array of [`NoteId`] objects to fetch * @returns Promise that resolves to different data depending on the note type: * - Private notes: Returns only `note_id` and `metadata`. The `input_note` field will be * `null`. * - Public notes: Returns the full `input_note` with inclusion proof, alongside metadata and * ID. */ getNotesById(note_ids: NoteId[]): Promise; /** * Fetches a note script by its root hash from the connected Miden node. * * @param `script_root` The root hash of the note script to fetch * @returns Promise that resolves to the `NoteScript` */ getNoteScriptByRoot(script_root: Word): Promise; /** * Creates a new RPC client instance. * * @param endpoint - Endpoint to connect to. */ constructor(endpoint: Endpoint); } export class Rpo256 { private constructor(); free(): void; [Symbol.dispose](): void; static hashElements(felt_array: FeltArray): Word; } export class ScriptBuilder { private constructor(); /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; /** * Given a module path (something like `my_lib::module`) and source code, this will * statically link it for use with scripts to be built with this builder. */ linkModule(module_path: string, module_code: string): void; /** * Given a Library Path, and a source code, turn it into a Library. * E.g. A path library can be `miden::my_contract`. When turned into a library, * this can be used from another script with an import statement, following the * previous example: `use.miden::my_contract'. */ buildLibrary(library_path: string, source_code: string): Library; /** * Given a Transaction Script's source code, compiles it with the available * modules under this builder. Returns the compiled script. */ compileTxScript(tx_script: string): TransactionScript; /** * Given a Note Script's source code, compiles it with the available * modules under this builder. Returns the compiled script. */ compileNoteScript(program: string): NoteScript; /** * Statically links the given library. * * Static linking means the library code is copied into the script code. * Use this for most libraries that are not available on-chain. * * Receives as argument the library to link. */ linkStaticLibrary(library: Library): void; /** * This is useful to dynamically link the [`Library`] of a foreign account * that is invoked using foreign procedure invocation (FPI). Its code is available * on-chain and so it does not have to be copied into the script code. * * For all other use cases not involving FPI, link the library statically. * Receives as argument the library to be linked. */ linkDynamicLibrary(library: Library): void; } export class SecretKey { private constructor(); free(): void; [Symbol.dispose](): void; publicKey(): PublicKey; static deserialize(bytes: Uint8Array): SecretKey; static ecdsaWithRNG(seed?: Uint8Array | null): SecretKey; static rpoFalconWithRNG(seed?: Uint8Array | null): SecretKey; sign(message: Word): Signature; serialize(): Uint8Array; signData(signing_inputs: SigningInputs): Signature; } export class SerializedInputNoteData { private constructor(); free(): void; [Symbol.dispose](): void; noteId: string; noteAssets: Uint8Array; serialNumber: Uint8Array; inputs: Uint8Array; noteScriptRoot: string; noteScript: Uint8Array; nullifier: string; stateDiscriminant: number; state: Uint8Array; createdAt: string; } export class SerializedOutputNoteData { private constructor(); free(): void; [Symbol.dispose](): void; noteId: string; noteAssets: Uint8Array; recipientDigest: string; metadata: Uint8Array; get nullifier(): string | undefined; set nullifier(value: string | null | undefined); expectedHeight: number; stateDiscriminant: number; state: Uint8Array; } export class SerializedTransactionData { private constructor(); free(): void; [Symbol.dispose](): void; id: string; details: Uint8Array; get scriptRoot(): Uint8Array | undefined; set scriptRoot(value: Uint8Array | null | undefined); get txScript(): Uint8Array | undefined; set txScript(value: Uint8Array | null | undefined); blockNum: string; statusVariant: number; status: Uint8Array; } export class Signature { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): Signature; toPreparedSignature(message: Word): Felt[]; serialize(): Uint8Array; } export class SigningInputs { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): SigningInputs; toElements(): FeltArray; blindPayload(): Word; static newArbitrary(felts: Felt[]): SigningInputs; toCommitment(): Word; arbitraryPayload(): FeltArray; static newTransactionSummary(summary: TransactionSummary): SigningInputs; transactionSummaryPayload(): TransactionSummary; static newBlind(word: Word): SigningInputs; serialize(): Uint8Array; readonly variantType: SigningInputsType; } export class SlotAndKeys { free(): void; [Symbol.dispose](): void; storage_map_keys(): Word[]; storage_slot_index(): number; constructor(storage_slot_index: number, storage_map_keys: Word[]); } export class StorageMap { free(): void; [Symbol.dispose](): void; constructor(); insert(key: Word, value: Word): Word; } export class StorageSlot { private constructor(); free(): void; [Symbol.dispose](): void; static fromValue(value: Word): StorageSlot; static emptyValue(): StorageSlot; static map(storage_map: StorageMap): StorageSlot; } export class StorageSlotArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: StorageSlot): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): StorageSlot; constructor(elements?: StorageSlot[] | null); push(element: StorageSlot): void; length(): number; } export class SyncSummary { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): SyncSummary; consumedNotes(): NoteId[]; committedNotes(): NoteId[]; updatedAccounts(): AccountId[]; committedTransactions(): TransactionId[]; blockNum(): number; serialize(): Uint8Array; } export class TestUtils { private constructor(); free(): void; [Symbol.dispose](): void; static createMockAccountId(): AccountId; static createMockSerializedLibraryPackage(): Uint8Array; static createMockSerializedProgramPackage(): Uint8Array; } export class TokenSymbol { free(): void; [Symbol.dispose](): void; constructor(symbol: string); toString(): string; } export class TransactionArgs { private constructor(); free(): void; [Symbol.dispose](): void; adviceInputs(): AdviceInputs; getNoteArgs(note_id: NoteId): Word | undefined; txScript(): TransactionScript | undefined; } export class TransactionFilter { private constructor(); free(): void; [Symbol.dispose](): void; static uncommitted(): TransactionFilter; static expiredBefore(block_num: number): TransactionFilter; static all(): TransactionFilter; static ids(ids: TransactionId[]): TransactionFilter; } export class TransactionId { private constructor(); free(): void; [Symbol.dispose](): void; asElements(): Felt[]; inner(): Word; toHex(): string; asBytes(): Uint8Array; } export class TransactionProver { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(prover_type: string, endpoint?: string | null): TransactionProver; static newLocalProver(): TransactionProver; static newRemoteProver(endpoint: string): TransactionProver; endpoint(): string | undefined; serialize(): string; } export class TransactionRecord { private constructor(); free(): void; [Symbol.dispose](): void; accountId(): AccountId; outputNotes(): OutputNotes; creationTimestamp(): bigint; initAccountState(): Word; transactionStatus(): TransactionStatus; finalAccountState(): Word; inputNoteNullifiers(): Word[]; id(): TransactionId; blockNum(): number; } export class TransactionRequest { private constructor(); free(): void; [Symbol.dispose](): void; scriptArg(): Word | undefined; static deserialize(bytes: Uint8Array): TransactionRequest; expectedFutureNotes(): NoteDetailsAndTag[]; expectedOutputOwnNotes(): Note[]; authArg(): Word | undefined; serialize(): Uint8Array; } export class TransactionRequestBuilder { free(): void; [Symbol.dispose](): void; withAuthArg(auth_arg: Word): TransactionRequestBuilder; withScriptArg(script_arg: Word): TransactionRequestBuilder; extendAdviceMap(advice_map: AdviceMap): TransactionRequestBuilder; withCustomScript(script: TransactionScript): TransactionRequestBuilder; withForeignAccounts(foreign_accounts: ForeignAccountArray): TransactionRequestBuilder; withOwnOutputNotes(notes: OutputNoteArray): TransactionRequestBuilder; withExpectedFutureNotes(note_details_and_tag: NoteDetailsAndTagArray): TransactionRequestBuilder; withExpectedOutputRecipients(recipients: NoteRecipientArray): TransactionRequestBuilder; withAuthenticatedInputNotes(notes: NoteIdAndArgsArray): TransactionRequestBuilder; withUnauthenticatedInputNotes(notes: NoteAndArgsArray): TransactionRequestBuilder; constructor(); build(): TransactionRequest; } /** * WASM wrapper around the native [`TransactionResult`]. */ export class TransactionResult { private constructor(); free(): void; [Symbol.dispose](): void; /** * Deserializes a transaction result from bytes. */ static deserialize(bytes: Uint8Array): TransactionResult; /** * Returns notes that are expected to be created as a result of follow-up executions. */ futureNotes(): NoteDetailsAndTag[]; /** * Returns the executed transaction. */ executedTransaction(): ExecutedTransaction; /** * Returns the ID of the transaction. */ id(): TransactionId; /** * Serializes the transaction result into bytes. */ serialize(): Uint8Array; } export class TransactionScript { private constructor(); free(): void; [Symbol.dispose](): void; /** * Creates a `NoteScript` from the given `Package`. * Throws if the package is invalid. */ static fromPackage(_package: Package): TransactionScript; root(): Word; } export class TransactionScriptInputPair { free(): void; [Symbol.dispose](): void; constructor(word: Word, felts: FeltArray); word(): Word; felts(): FeltArray; } export class TransactionScriptInputPairArray { /** ** Return copy of self without private attributes. */ toJSON(): Object; /** * Return stringified version of self. */ toString(): string; free(): void; [Symbol.dispose](): void; replaceAt(index: number, elem: TransactionScriptInputPair): void; /** * Get element at index, will always return a clone to avoid aliasing issues. */ get(index: number): TransactionScriptInputPair; constructor(elements?: TransactionScriptInputPair[] | null); push(element: TransactionScriptInputPair): void; length(): number; } export class TransactionStatus { private constructor(); free(): void; [Symbol.dispose](): void; isPending(): boolean; isCommitted(): boolean; isDiscarded(): boolean; getBlockNum(): number | undefined; getCommitTimestamp(): bigint | undefined; static pending(): TransactionStatus; static committed(block_num: number, commit_timestamp: bigint): TransactionStatus; static discarded(cause: string): TransactionStatus; } export class TransactionStoreUpdate { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): TransactionStoreUpdate; futureNotes(): NoteDetailsAndTag[]; accountDelta(): AccountDelta; createdNotes(): OutputNotes; submissionHeight(): number; executedTransaction(): ExecutedTransaction; serialize(): Uint8Array; } export class TransactionSummary { private constructor(); free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): TransactionSummary; inputNotes(): InputNotes; outputNotes(): OutputNotes; accountDelta(): AccountDelta; salt(): Word; serialize(): Uint8Array; } export class WebClient { free(): void; [Symbol.dispose](): void; newFaucet(storage_mode: AccountStorageMode, non_fungible: boolean, token_symbol: string, decimals: number, max_supply: bigint, auth_scheme_id: number): Promise; newWallet(storage_mode: AccountStorageMode, mutable: boolean, auth_scheme_id: number, init_seed?: Uint8Array | null): Promise; newAccount(account: Account, overwrite: boolean): Promise; addAccountSecretKeyToWebStore(secret_key: SecretKey): Promise; getTransactions(transaction_filter: TransactionFilter): Promise; /** * Send a private note via the note transport layer */ sendPrivateNote(note: Note, address: Address): Promise; /** * Fetch private notes from the note transport layer * * Uses an internal pagination mechanism to avoid fetching duplicate notes. */ fetchPrivateNotes(): Promise; /** * Fetch all private notes from the note transport layer * * Fetches all notes stored in the transport layer, with no pagination. * Prefer using [`WebClient::fetch_private_notes`] for a more efficient, on-going, * fetching mechanism. */ fetchAllPrivateNotes(): Promise; applyTransaction(transaction_result: TransactionResult, submission_height: number): Promise; /** * Generates a transaction proof using either the provided prover or the client's default * prover if none is supplied. */ proveTransaction(transaction_result: TransactionResult, prover?: TransactionProver | null): Promise; /** * Executes a transaction specified by the request against the specified account but does not * submit it to the network nor update the local database. The returned [`TransactionResult`] * retains the execution artifacts needed to continue with the transaction lifecycle. * * If the transaction utilizes foreign account data, there is a chance that the client doesn't * have the required block header in the local database. In these scenarios, a sync to * the chain tip is performed, and the required block header is retrieved. */ executeTransaction(account_id: AccountId, transaction_request: TransactionRequest): Promise; /** * Executes a transaction specified by the request against the specified account, * proves it, submits it to the network, and updates the local database. * * If the transaction utilizes foreign account data, there is a chance that the client doesn't * have the required block header in the local database. In these scenarios, a sync to * the chain tip is performed, and the required block header is retrieved. */ submitNewTransaction(account_id: AccountId, transaction_request: TransactionRequest): Promise; submitProvenTransaction(proven_transaction: ProvenTransaction, transaction_result: TransactionResult): Promise; newMintTransactionRequest(target_account_id: AccountId, faucet_id: AccountId, note_type: NoteType, amount: bigint): TransactionRequest; newSendTransactionRequest(sender_account_id: AccountId, target_account_id: AccountId, faucet_id: AccountId, note_type: NoteType, amount: bigint, recall_height?: number | null, timelock_height?: number | null): TransactionRequest; newSwapTransactionRequest(sender_account_id: AccountId, offered_asset_faucet_id: AccountId, offered_asset_amount: bigint, requested_asset_faucet_id: AccountId, requested_asset_amount: bigint, note_type: NoteType, payback_note_type: NoteType): TransactionRequest; newConsumeTransactionRequest(list_of_note_ids: string[]): TransactionRequest; proveBlock(): void; usesMockChain(): boolean; /** * Creates a new client with a mock RPC API. Useful for testing purposes and proof-of-concept * applications as it uses a mock chain that simulates the behavior of a real node. */ createMockClient(seed?: Uint8Array | null, serialized_mock_chain?: Uint8Array | null, serialized_mock_note_transport_node?: Uint8Array | null): Promise; /** * Returns the inner serialized mock chain if it exists. */ serializeMockChain(): Uint8Array; /** * Returns the inner serialized mock note transport node if it exists. */ serializeMockNoteTransportNode(): Uint8Array; syncState(): Promise; static buildSwapTag(note_type: NoteType, offered_asset_faucet_id: AccountId, offered_asset_amount: bigint, requested_asset_faucet_id: AccountId, requested_asset_amount: bigint): NoteTag; getSyncHeight(): Promise; removeTag(tag: string): Promise; addTag(tag: string): Promise; listTags(): Promise; getInputNote(note_id: string): Promise; getInputNotes(filter: NoteFilter): Promise; getOutputNote(note_id: string): Promise; getOutputNotes(filter: NoteFilter): Promise; getConsumableNotes(account_id?: AccountId | null): Promise; /** * Retrieves the entire underlying web store and returns it as a `JsValue` * * Meant to be used in conjunction with the `force_import_store` method */ exportStore(): Promise; exportNoteFile(note_id: string, export_type: string): Promise; exportAccountFile(account_id: AccountId): Promise; importNoteFile(note_file: NoteFile): Promise; forceImportStore(store_dump: any): Promise; importAccountFile(account_file: AccountFile): Promise; importAccountById(account_id: AccountId): Promise; importPublicAccountFromSeed(init_seed: Uint8Array, mutable: boolean, auth_scheme_id: number): Promise; getAccount(account_id: AccountId): Promise; getAccounts(): Promise; insertAccountAddress(account_id: AccountId, address: Address): Promise; removeAccountAddress(account_id: AccountId, address: Address): Promise; getAccountAuthByPubKey(pub_key: Word): Promise; /** * Retrieves the setting value for `key`, or `None` if it hasn’t been set. */ getSetting(key: string): Promise; /** * Sets a setting key-value in the store. It can then be retrieved using `get_setting`. */ setSetting(key: string, value: any): Promise; /** * Deletes a setting key-value from the store. */ removeSetting(key: string): Promise; /** * Returns all the existing setting keys from the store. */ listSettingKeys(): Promise; /** * Creates a new client with the given node URL and optional seed. * If `node_url` is `None`, it defaults to the testnet endpoint. */ createClient(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null): Promise; createScriptBuilder(): ScriptBuilder; /** * Creates a new client with the given node URL, optional seed, and external keystore * callbacks. If `node_url` is `None`, it defaults to the testnet endpoint. */ createClientWithExternalKeystore(node_url?: string | null, node_note_transport_url?: string | null, seed?: Uint8Array | null, get_key_cb?: Function | null, insert_key_cb?: Function | null, sign_cb?: Function | null): Promise; constructor(); } export class Word { free(): void; [Symbol.dispose](): void; static deserialize(bytes: Uint8Array): Word; static newFromFelts(felt_vec: Felt[]): Word; constructor(u64_vec: BigUint64Array); toHex(): string; toU64s(): BigUint64Array; /** * Creates a Word from a hex string. * Fails if the provided string is not a valid hex representation of a Word. */ static fromHex(hex: string): Word; toFelts(): Felt[]; serialize(): Uint8Array; }