/* tslint:disable */
/* eslint-disable */

export class JsChainContext {
  private constructor();
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Get shielded balance for a token on this chain.
   */
  getBalance(token_address: string): Promise<any>;
  /**
   * Unwrap WETH to ETH after an unshield on this chain.
   *
   * @param amount - Amount to unwrap (as string for `BigInt` support)
   * @param recipientAddress - The address the unshield was sent to (must match connected wallet)
   */
  unwrapWeth(amount: string, recipient_address: string): Promise<any>;
  /**
   * Authenticate with this chain's server using shared identity keys.
   *
   * Performs wallet login + ViewAuth upgrade to get a chain-specific JWT.
   * Includes auth key registration. The parent SDK must be authenticated
   * (keys derived) before calling this.
   */
  authenticate(): Promise<any>;
  /**
   * Clear this chain's session (JWT + pending transactions).
   */
  clearSession(): void;
  /**
   * Get all shielded balances on this chain.
   *
   * Resolves token IDs to addresses and decimals using the registered token list,
   * returning the same `WasmTokenBalance` shape as the root SDK.
   */
  getAllBalances(): Promise<any>;
  /**
   * Look up a user's identity by Ethereum address or MPK on this chain.
   */
  resolveIdentity(identifier: string): Promise<any>;
  /**
   * Consolidate fragmented notes for a token on this chain.
   *
   * Performs self-transfers to merge multiple small notes into fewer notes.
   * Each round consolidates up to 15 notes. Returns the number of rounds
   * executed and the remaining note count.
   *
   * @param token_address - Token address to consolidate
   * @param max_rounds - Maximum rounds (0 = until fully consolidated)
   */
  consolidateNotes(token_address: string, max_rounds: number): Promise<any>;
  /**
   * Get shield status by request ID.
   */
  getShieldStatus(request_id: string): Promise<any>;
  /**
   * Get unspent notes for the authenticated account on this chain.
   */
  getUnspentNotes(token_address?: string | null): Promise<any>;
  /**
   * Get transfer status by ID.
   */
  getTransferStatus(id: string): Promise<any>;
  /**
   * Get unshield status by ID.
   */
  getUnshieldStatus(id: string): Promise<any>;
  /**
   * Get registered tokens on this chain.
   */
  getRegisteredTokens(): Promise<any>;
  /**
   * Add a pending transaction to this chain's local tracking.
   */
  addPendingTransaction(tx: any): void;
  /**
   * Get transaction history on this chain.
   */
  getTransactionHistory(params: any): Promise<any>;
  /**
   * Get pending transactions for this chain.
   */
  getPendingTransactions(): any;
  /**
   * Get all tracked transactions (all statuses) for this chain.
   */
  getAllPendingTransactions(): any;
  /**
   * Poll status endpoints for pending transactions on this chain.
   */
  refreshPendingTransactions(): Promise<any>;
  /**
   * Send a private transfer on this chain.
   */
  send(token_address: string, amount: string, recipient: string): Promise<any>;
  /**
   * Shield tokens into the shielded pool on this chain.
   */
  shield(token_address: string, amount: string): Promise<any>;
  /**
   * Get the resolved chain ID (0 if not yet discovered).
   */
  chainId(): bigint;
  /**
   * Get fee rates for this chain.
   */
  getFees(token_id: number): Promise<any>;
  /**
   * Unshield tokens from the shielded pool on this chain.
   */
  unshield(token_address: string, amount: string, recipient_address: string): Promise<any>;
  /**
   * Get metadata for a specific token on this chain.
   */
  getToken(token_address: string): Promise<any>;
  /**
   * Check if auth keys are registered on this chain.
   */
  readonly isRegistered: boolean;
  /**
   * Whether this chain context is authenticated (has a valid JWT).
   */
  readonly isAuthenticated: boolean;
}

export class JsWalletAdapter {
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Get the wallet address
   */
  getAddress(): Promise<string>;
  /**
   * Get the current chain ID
   */
  getChainId(): Promise<bigint>;
  /**
   * Sign a message
   */
  signMessage(message: string): Promise<string>;
  /**
   * Sign EIP-712 typed data
   */
  signTypedData(typed_data: string): Promise<string>;
  /**
   * Send a transaction
   */
  sendTransaction(tx: any): Promise<string>;
  /**
   * Create a new wallet adapter from a JavaScript object
   */
  constructor(wallet: any);
}

export class JsWasmPasskeyProvider {
  free(): void;
  [Symbol.dispose](): void;
  isAvailable(): boolean;
  static checkSupport(): Promise<boolean>;
  getPrfOutput(credential: any, prf_salt: string): Promise<any>;
  createCredential(rp_id: string, user_id: string, user_name: string): Promise<any>;
  constructor(rp_name: string);
}

export class PrivacyBoost {
  free(): void;
  [Symbol.dispose](): void;
  getBalance(token_address: string): Promise<any>;
  /**
   * Unwrap WETH to ETH after a unshield has been confirmed on-chain.
   *
   * This must only be called *after* the unshield transaction has settled
   * and the WETH is present in the user's wallet. The connected wallet must
   * be the same address that received the unshield.
   *
   * @param amount - Amount to unwrap (as string for `BigInt` support)
   * @param recipientAddress - The address the withdrawal was sent to (must match connected wallet)
   * @returns Promise<string> - The unwrap transaction hash
   */
  unwrapWeth(amount: string, recipient_address: string): Promise<any>;
  /**
   * Authenticate with the two-phase pattern.
   *
   * Returns either:
   * - `{ status: "authenticated", privacyAddress, mpk }` if auth completes
   * - `{ status: "credentialRequired", action: "setup"|"unlock", unlockType: "pin"|"password" }` if credential needed
   * - `{ status: "mnemonicGenerated", mnemonic, isNewUser: true }` if mnemonic generated for new user
   *
   * @param wallet - JavaScript wallet adapter object
   * @param key_source - Optional key source: null/undefined for walletDerived, or { type: "mnemonic", phrase: "..." }, { type: "rawSeed", hex: "..." }, { type: "walletDerived" }
   * @param callback - Optional token provider: (payload) => Promise<{ token, expiresIn }>
   */
  authenticate(wallet: any, key_source: any, callback?: Function | null): Promise<any>;
  /**
   * Permanently delete the server vault and clear local state.
   */
  deleteVault(): Promise<any>;
  /**
   * Get app metadata by IDs
   */
  getAppInfo(app_ids: Array<any>): Promise<any>;
  /**
   * Get the BIP39 mnemonic phrase from the unlocked vault.
   * Returns null if entropy was not stored (old vault) or keys not loaded.
   */
  getMnemonic(): any;
  /**
   * Parse a human-readable amount to wei
   *
   * @param amount - Human-readable amount (e.g., "1.5")
   * @param decimals - Token decimals (default: 18)
   * @returns Amount in wei as string
   */
  parseAmount(amount: string, decimals?: number | null): string;
  /**
   * Clear session: clear auth token only, keep keys for quick re-auth
   */
  clearSession(): void;
  /**
   * Format wei to human-readable amount
   *
   * @param wei - Amount in wei as string
   * @param decimals - Token decimals (default: 18)
   * @returns Human-readable amount
   */
  formatAmount(wei: string, decimals?: number | null): string;
  /**
   * Proxy an HTTP request through the SDK's encrypted HTTP client.
   *
   * In iframe mode, the parent page cannot make direct API calls to the
   * server because the server requires encrypted POST envelopes. This
   * method lets the parent route requests through the iframe's WASM
   * encryption layer.
   *
   * The request goes through EncryptedHttpClient which automatically
   * handles encryption for non-plaintext paths.
   */
  proxyFetch(path: string, method: string, body: any, query: any, base_url: any, auth_token: any): Promise<any>;
  /**
   * Generate NPK from recipient MPK and random value.
   */
  generateNpk(recipient_mpk_hex: string, random_in_hex: string): any;
  getAllBalances(): Promise<any>;
  /**
   * Validate an Ethereum address
   *
   * @param address - Ethereum address to validate
   * @returns boolean
   */
  isValidAddress(address: string): boolean;
  /**
   * Search for an identity by Ethereum address or MPK
   *
   * @param identifier - Ethereum address (0x... 42 chars) or MPK (hex string)
   * @returns Promise<IdentityResult>
   */
  resolveIdentity(identifier: string): Promise<any>;
  /**
   * Sign a spending digest with the auth key (EdDSA-Poseidon).
   */
  signSpending(digest_hi: string, digest_lo: string): any;
  /**
   * Consolidate fragmented notes for a token.
   *
   * Performs self-transfers to merge many small notes into fewer notes.
   * Each round consolidates up to 15 input notes into 1-2 output notes.
   *
   * @param tokenAddress - Token address to consolidate
   * @param maxRounds - Maximum rounds (0 = until fully consolidated)
   * @returns Promise<{ rounds, transfers, remainingNotes }>
   */
  consolidateNotes(token_address: string, max_rounds: number): Promise<any>;
  getShieldStatus(request_id: string): Promise<any>;
  getUnspentNotes(token_address?: string | null): Promise<any>;
  /**
   * Sign a ViewAuth message with the viewing key (ECDSA secp256k1).
   * The `mpk_hex` parameter is kept for API compatibility but ignored —
   * the stored MPK is used to prevent signing for arbitrary accounts.
   */
  signViewAuth(_mpk_hex: string, nonce: string): any;
  /**
   * Submit a credential (PIN or password) after authenticate() returned credentialRequired.
   *
   * @param credential - The PIN or password string
   * @param callback - Optional token provider callback
   * @returns Promise<{ status: "authenticated", privacyAddress, mpk }>
   */
  submitCredential(credential: string, callback?: Function | null): Promise<any>;
  /**
   * Add tracked tokens
   *
   * @param tokens - Array of token addresses to add
   */
  addTrackedTokens(tokens: Array<any>): void;
  /**
   * Get public keys from the current session.
   */
  getPublicKeys(): any;
  /**
   * Get tracked tokens
   *
   * @returns string[] - Array of tracked token addresses
   */
  getTrackedTokens(): Array<any>;
  /**
   * Set tracked tokens
   *
   * @param tokens - Array of token addresses to track
   */
  setTrackedTokens(tokens: Array<any>): void;
  /**
   * Derive 3-way ECDH keys for transfer/withdraw encryption.
   * Returns all derived keys including ephTxEncKey needed for ciphertext encryption.
   */
  deriveEcdhKeys(tee_public_key_hex: string, recipient_viewing_pub_key_hex?: string | null): any;
  /**
   * Get the user's privacy address
   */
  getPrivacyAddress(): string | undefined;
  getTransferStatus(id: string): Promise<any>;
  getUnshieldStatus(id: string): Promise<any>;
  /**
   * Convert an address to checksum format
   *
   * @param address - Ethereum address
   * @returns Checksummed address or null if invalid
   */
  toChecksumAddress(address: string): string | undefined;
  /**
   * Run a signed audit balances query. Same options as
   * `auditQueryTransactions`; `txType`/`limit`/`offset` are ignored.
   */
  auditQueryBalances(options: any): Promise<any>;
  /**
   * Create a chain-scoped context for operations on a specific blockchain.
   *
   * The chain context shares this SDK's identity keys but has its own
   * server connection, JWT, and chain configuration.
   *
   * Call `.authenticate()` on the returned context before performing operations.
   *
   * @param config - Chain configuration object (only `serverUrl` required;
   *                 `chainId`, `shieldContractAddress`, etc. are auto-discovered)
   * @returns ChainContext
   */
  createChainContext(config: any): JsChainContext;
  getSupportedTokens(): Promise<any>;
  getTokenByAddress(address: string): Promise<any>;
  /**
   * Compute nullifiers for a set of notes.
   * Returns an array of nullifier hex strings.
   */
  computeNullifiers(notes: any): any;
  /**
   * Get merkle tree statistics (current leaf count and root).
   *
   * @returns Promise<MerkleTreeStats>
   */
  getMerkleTreeStats(): Promise<any>;
  getRegisteredTokens(): Promise<any>;
  getTokenRegistryId(token_address: string): Promise<any>;
  /**
   * Continue authentication after showing mnemonic to the user.
   *
   * Called after authenticate() returned `{ status: "mnemonicGenerated" }`.
   * Signs the vault backup message, encrypts vault, uploads to server, completes auth.
   *
   * @param credential - Optional PIN/password string. Required when the
   *   SDK is configured with `persistence.unlock = "pin"` or `"password"`.
   * @param callback - Optional token provider callback
   * @returns Promise<{ status: "authenticated", privacyAddress, mpk }>
   */
  proceedAfterMnemonic(credential?: string | null, callback?: Function | null): Promise<any>;
  /**
   * Add a pending transaction to the local store
   */
  addPendingTransaction(tx: any): void;
  /**
   * Get grouped wallet transactions
   *
   * @param params - Optional params { limit, cursor, txType }
   * @returns Promise<{ data: Transaction[], limit: number, next?: string }>
   */
  getTransactionHistory(params: any): Promise<any>;
  /**
   * Run a signed audit transactions query.
   *
   * Requires the auditor's wallet to be connected (it signs the EIP-712
   * `AuditQuery` typed data). Authentication via `connect()`/`authenticate()`
   * is *not* required — auditors are a separate identity.
   *
   * @param options - {
   *     adminKey: string,            // X-Admin-Key header value
   *     auditGatewayAddress: string, // EIP-712 verifying contract
   *     accountId?: string,          // shielded-pool account ID (decimal)
   *     eoaAddress?: string,         // OR Ethereum address (resolved server-side)
   *     txType?: string,             // "" | "shield" | "unshield" | "transfer" | "forced_unshield"
   *     limit?: number,
   *     offset?: number,
   *     chainId?: number,            // defaults to SDK config
   * }
   */
  auditQueryTransactions(options: any): Promise<any>;
  /**
   * Get all pending transactions (those with status == pending)
   */
  getPendingTransactions(): any;
  /**
   * Get auth registration data (auth public key).
   */
  getRegistrationData(): any;
  /**
   * Validate a privacy address
   *
   * @param address - Privacy address to validate
   * @returns boolean
   */
  isValidPrivacyAddress(address: string): boolean;
  /**
   * Build a shield commitment for deposit.
   * Returns { commitment, randomIn, npk } as hex strings.
   */
  buildShieldCommitment(token_id: number, amount: string, recipient_mpk?: string | null): any;
  /**
   * Compute the transfer digest for signing.
   * Returns { digestHi, digestLo } as hex strings.
   */
  computeTransferDigest(params: any): any;
  /**
   * Compute the withdrawal digest for signing.
   * Returns { digestHi, digestLo } as hex strings.
   */
  computeWithdrawalDigest(params: any): any;
  /**
   * Compute output commitment (Poseidon hash, no private keys needed).
   */
  computeOutputCommitment(npk_hex: string, token_id: number, amount: string): any;
  /**
   * Get all tracked pending transactions (all statuses, including resolved)
   */
  getAllPendingTransactions(): any;
  /**
   * Poll status endpoints for all pending transactions and resolve them.
   * Returns the number of resolved transactions.
   */
  refreshPendingTransactions(): Promise<any>;
  /**
   * Encrypt deposit ciphertext for TEE.
   * Returns { viewingKey, teeWrapKey, receiverWrapKey, ct0, ct1, ct2 } as hex strings.
   */
  encryptDepositCiphertext(tee_public_key_hex: string, token_id: number, amount: string, random_in_hex: string, output_index: number): any;
  /**
   * Encrypt transfer ciphertext using pre-derived ECDH keys.
   * Returns { ct0, ct1, ct2, ct3 } as hex strings.
   */
  encryptTransferCiphertext(params: any): any;
  /**
   * Compute withdrawal commitment (Poseidon hash).
   */
  computeWithdrawalCommitment(recipient_addr: string, token_id: number, amount: string): any;
  /**
   * Create a new SDK instance synchronously.
   *
   * Auto-discovery of `chainId`, `shieldContractAddress`, `tokenRegistryAddress`, and
   * `teePublicKey` from the indexer's `/api/v1/info` endpoint is deferred to the
   * first operation that needs them (e.g. `authenticate`, `shield`).
   *
   * @param config - SDK configuration object (only `serverUrl` and `appId` required)
   */
  constructor(config: any);
  /**
   * Send a private transfer
   *
   * @param params - Object with fields:
   *   - `tokenAddress` (string, required) - Token contract address (hex string)
   *   - `amount` (string, required) - Amount to send (as string for `BigInt` support)
   *   - `to` (string, required) - Recipient's privacy address
   * @returns Promise<WasmTransferResult>
   */
  send(params: any): Promise<any>;
  /**
   * Logout: clear all state, disconnect wallet, and clear persisted session
   */
  logout(): void;
  /**
   * Shield tokens into the shielded pool
   *
   * @param params - Object with fields:
   *   - `tokenAddress` (string, required) - Token contract address (hex string)
   *   - `amount` (string, required) - Amount to shield (as string for `BigInt` support)
   *   - `onProgress` (function, optional) - Callback invoked with progress events.
   *     Each event is a JS object `{ step: string, txHash?: string, requestId?: string }`.
   * @returns Promise<WasmShieldResult>
   */
  shield(params: any): Promise<any>;
  /**
   * Connect a wallet adapter
   *
   * The wallet adapter should be a JavaScript object with the following methods:
   * - `getAddress(): Promise<string>`
   * - `getChainId(): Promise<number>`
   * - `signMessage(message: string): Promise<string>`
   * - `signTypedData(typedData: string): Promise<string>`
   * - `sendTransaction(tx: object): Promise<string>`
   * - `waitForTransactionReceipt(txHash: string): Promise<object>`
   *
   * @param wallet - JavaScript wallet adapter object
   */
  connect(wallet: any): Promise<any>;
  /**
   * Proactively release JS-held SDK state.
   *
   * `wasm-bindgen` already exposes a generated `free()` that drops the
   * underlying Rust struct — but JS GC is opportunistic and a long-lived
   * SPA that recreates the SDK on route change can leak the cached HTTP
   * clients, wallet adapter, and tracked-token list until the browser
   * runs a major collection. Call `dispose()` explicitly when you're
   * done with an SDK instance to release these immediately.
   *
   * After `dispose()`, the wallet adapter, tracked-token list, and
   * chain-HTTP cache are released. Core state (auth token, config,
   * key manager) is retained. `free()` remains valid and will drop
   * the entire struct.
   */
  dispose(): void;
  /**
   * Get the user's master public key (MPK)
   */
  getMpk(): string | undefined;
  getFees(token_address: string): Promise<any>;
  /**
   * Unshield tokens from the shielded pool
   *
   * @param params - Object with fields:
   *   - `tokenAddress` (string, required) - Token contract address (hex string)
   *   - `amount` (string, required) - Amount to unshield (as string for `BigInt` support)
   *   - `recipientAddress` (string, required) - Recipient Ethereum address
   *   - `onProgress` (function, optional) - Callback invoked with progress events.
   * @returns Promise<WasmUnshieldResult>
   */
  unshield(params: any): Promise<any>;
  /**
   * Get current SDK state
   *
   * @returns `SDKState` object with wallet and auth state
   */
  getState(): any;
  /**
   * Check if wallet is connected
   */
  readonly isConnected: boolean;
  /**
   * Check if auth keys are registered on-chain.
   */
  readonly isRegistered: boolean;
  /**
   * Get the connected wallet address
   *
   * @returns The wallet address or null if not connected
   */
  readonly walletAddress: string | undefined;
  /**
   * Check if user is authenticated
   */
  readonly isAuthenticated: boolean;
  /**
   * Get the shield contract address
   *
   * @returns The shield contract address
   */
  readonly shieldContractAddress: string;
  /**
   * Get SDK configuration
   */
  readonly config: any;
  /**
   * Get the current chain ID
   *
   * @returns The chain ID
   */
  readonly chainId: bigint;
}

export class PrivacyBoostConfig {
  private constructor();
  free(): void;
  [Symbol.dispose](): void;
}

export class WasmChainMetadata {
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Add RPC URL
   */
  addRpcUrl(url: string): void;
  /**
   * Add block explorer URL
   */
  addBlockExplorerUrl(url: string): void;
  /**
   * Create new chain metadata
   */
  constructor(chain_name: string, native_currency_name: string, native_currency_symbol: string, native_currency_decimals: number);
}

export class WasmShieldResult {
  private constructor();
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Convert to JavaScript object
   */
  toObject(): any;
  /**
   * Get commitment
   */
  readonly commitment: string;
  /**
   * Get request ID
   */
  readonly requestId: string;
  /**
   * Get wrap transaction hash (if ETH was wrapped to WETH)
   */
  readonly wrapTxHash: string | undefined;
  /**
   * Get fee
   */
  readonly fee: string;
  /**
   * Get transaction hash
   */
  readonly txHash: string;
}

export class WasmTokenBalance {
  private constructor();
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Convert to JavaScript object
   */
  toObject(): any;
  /**
   * Get token address
   */
  readonly tokenAddress: string;
  /**
   * Get total balance (shielded + wallet)
   */
  readonly total: string;
  /**
   * Get token symbol
   */
  readonly symbol: string | undefined;
  /**
   * Get wallet balance as string (for `BigInt`)
   */
  readonly walletBalance: string;
  /**
   * Get token decimals
   */
  readonly decimals: number | undefined;
  /**
   * Get shielded balance as string (for `BigInt`)
   */
  readonly shieldedBalance: string;
}

export class WasmTokenMetadata {
  private constructor();
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Convert to JavaScript object
   */
  toObject(): any;
  /**
   * Get token name
   */
  readonly name: string;
  /**
   * Get token symbol
   */
  readonly symbol: string;
  /**
   * Get token address
   */
  readonly address: string;
  /**
   * Get token decimals
   */
  readonly decimals: number;
}

export class WasmTransaction {
  private constructor();
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Convert to JavaScript object
   */
  toObject(): any;
  /**
   * Get recipient address
   */
  readonly toAddress: string | undefined;
  /**
   * Get sender address
   */
  readonly fromAddress: string | undefined;
  /**
   * Get token address
   */
  readonly tokenAddress: string;
  /**
   * Get fee
   */
  readonly fee: string | undefined;
  /**
   * Get amount
   */
  readonly amount: string;
  /**
   * Get transaction status
   */
  readonly status: string;
  /**
   * Get transaction hash
   */
  readonly txHash: string;
  /**
   * Get transaction type
   */
  readonly txType: string;
  /**
   * Get transaction direction (incoming/outgoing)
   */
  readonly direction: string;
  /**
   * Get timestamp
   */
  readonly timestamp: bigint;
}

export class WasmTransactionRequest {
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Set gas limit
   */
  setGasLimit(gas_limit: string): void;
  /**
   * Create a new transaction request
   */
  constructor(to: string);
  /**
   * Set data
   */
  setData(data: string): void;
  /**
   * Set value
   */
  setValue(value: string): void;
  /**
   * Convert to JavaScript object
   */
  toObject(): any;
  /**
   * Get the to address
   */
  readonly to: string;
}

export class WasmTransferResult {
  private constructor();
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Convert to JavaScript object
   */
  toObject(): any;
  /**
   * Get request ID
   */
  readonly requestId: string;
  /**
   * Get local placeholder transaction hash
   */
  readonly txHash: string;
}

export class WasmUnshieldResult {
  private constructor();
  free(): void;
  [Symbol.dispose](): void;
  /**
   * Convert to JavaScript object
   */
  toObject(): any;
  /**
   * Get request ID
   */
  readonly requestId: string;
  /**
   * Get amount
   */
  readonly amount: string;
  /**
   * Get local placeholder transaction hash
   */
  readonly txHash: string;
}

export function generateMnemonic(): string;

/**
 * Get the native ETH address constant (zero address)
 */
export function getNativeEthAddress(): string;

/**
 * Get the SDK version
 */
export function get_version(): string;

/**
 * Initialize the WASM module
 *
 * This function sets up panic hooks for better error messages in the browser console.
 * It should be called once when the module is loaded.
 */
export function init(): void;

/**
 * Check if a string is a valid EVM address (20 bytes, 0x-prefixed)
 */
export function isEvmAddress(address: string): boolean;

/**
 * Check if a string is a valid MPK hex (32 bytes, 0x-prefixed)
 */
export function isMpkHex(mpk: string): boolean;

/**
 * Check if an address is the native ETH address
 */
export function isNativeEth(address: string): boolean;

/**
 * Check if a string is a valid privacy address
 */
export function isPrivacyAddress(address: string): boolean;

/**
 * Validate an EVM address and return an error message if invalid
 */
export function validateEvmAddress(address: string): string | undefined;

/**
 * Validate a privacy address and return an error message if invalid
 */
export function validatePrivacyAddress(address: string): string | undefined;

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
  readonly memory: WebAssembly.Memory;
  readonly __wbg_jschaincontext_free: (a: number, b: number) => void;
  readonly __wbg_jswalletadapter_free: (a: number, b: number) => void;
  readonly __wbg_jswasmpasskeyprovider_free: (a: number, b: number) => void;
  readonly __wbg_privacyboost_free: (a: number, b: number) => void;
  readonly __wbg_privacyboostconfig_free: (a: number, b: number) => void;
  readonly __wbg_wasmchainmetadata_free: (a: number, b: number) => void;
  readonly __wbg_wasmshieldresult_free: (a: number, b: number) => void;
  readonly __wbg_wasmtokenbalance_free: (a: number, b: number) => void;
  readonly __wbg_wasmtokenmetadata_free: (a: number, b: number) => void;
  readonly __wbg_wasmtransaction_free: (a: number, b: number) => void;
  readonly __wbg_wasmtransactionrequest_free: (a: number, b: number) => void;
  readonly __wbg_wasmtransferresult_free: (a: number, b: number) => void;
  readonly __wbg_wasmunshieldresult_free: (a: number, b: number) => void;
  readonly generateMnemonic: (a: number) => void;
  readonly getNativeEthAddress: (a: number) => void;
  readonly get_version: (a: number) => void;
  readonly isEvmAddress: (a: number, b: number) => number;
  readonly isMpkHex: (a: number, b: number) => number;
  readonly isNativeEth: (a: number, b: number) => number;
  readonly isPrivacyAddress: (a: number, b: number) => number;
  readonly jschaincontext_addPendingTransaction: (a: number, b: number, c: number) => void;
  readonly jschaincontext_authenticate: (a: number) => number;
  readonly jschaincontext_chainId: (a: number) => bigint;
  readonly jschaincontext_clearSession: (a: number) => void;
  readonly jschaincontext_consolidateNotes: (a: number, b: number, c: number, d: number) => number;
  readonly jschaincontext_getAllBalances: (a: number) => number;
  readonly jschaincontext_getAllPendingTransactions: (a: number, b: number) => void;
  readonly jschaincontext_getBalance: (a: number, b: number, c: number) => number;
  readonly jschaincontext_getFees: (a: number, b: number) => number;
  readonly jschaincontext_getPendingTransactions: (a: number, b: number) => void;
  readonly jschaincontext_getRegisteredTokens: (a: number) => number;
  readonly jschaincontext_getShieldStatus: (a: number, b: number, c: number) => number;
  readonly jschaincontext_getToken: (a: number, b: number, c: number) => number;
  readonly jschaincontext_getTransactionHistory: (a: number, b: number) => number;
  readonly jschaincontext_getTransferStatus: (a: number, b: number, c: number) => number;
  readonly jschaincontext_getUnshieldStatus: (a: number, b: number, c: number) => number;
  readonly jschaincontext_getUnspentNotes: (a: number, b: number, c: number) => number;
  readonly jschaincontext_isAuthenticated: (a: number) => number;
  readonly jschaincontext_isRegistered: (a: number) => number;
  readonly jschaincontext_refreshPendingTransactions: (a: number) => number;
  readonly jschaincontext_resolveIdentity: (a: number, b: number, c: number) => number;
  readonly jschaincontext_send: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
  readonly jschaincontext_shield: (a: number, b: number, c: number, d: number, e: number) => number;
  readonly jschaincontext_unshield: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
  readonly jschaincontext_unwrapWeth: (a: number, b: number, c: number, d: number, e: number) => number;
  readonly jswalletadapter_getAddress: (a: number) => number;
  readonly jswalletadapter_getChainId: (a: number) => number;
  readonly jswalletadapter_new: (a: number, b: number) => void;
  readonly jswalletadapter_sendTransaction: (a: number, b: number) => number;
  readonly jswalletadapter_signMessage: (a: number, b: number, c: number) => number;
  readonly jswalletadapter_signTypedData: (a: number, b: number, c: number) => number;
  readonly jswasmpasskeyprovider_checkSupport: () => number;
  readonly jswasmpasskeyprovider_createCredential: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
  readonly jswasmpasskeyprovider_getPrfOutput: (a: number, b: number, c: number, d: number) => number;
  readonly jswasmpasskeyprovider_isAvailable: (a: number) => number;
  readonly jswasmpasskeyprovider_new: (a: number, b: number) => number;
  readonly privacyboost_addPendingTransaction: (a: number, b: number, c: number) => void;
  readonly privacyboost_addTrackedTokens: (a: number, b: number) => void;
  readonly privacyboost_auditQueryBalances: (a: number, b: number) => number;
  readonly privacyboost_auditQueryTransactions: (a: number, b: number) => number;
  readonly privacyboost_authenticate: (a: number, b: number, c: number, d: number) => number;
  readonly privacyboost_buildShieldCommitment: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
  readonly privacyboost_chainId: (a: number) => bigint;
  readonly privacyboost_clearSession: (a: number) => void;
  readonly privacyboost_computeNullifiers: (a: number, b: number, c: number) => void;
  readonly privacyboost_computeOutputCommitment: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
  readonly privacyboost_computeTransferDigest: (a: number, b: number, c: number) => void;
  readonly privacyboost_computeWithdrawalCommitment: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
  readonly privacyboost_computeWithdrawalDigest: (a: number, b: number, c: number) => void;
  readonly privacyboost_config: (a: number) => number;
  readonly privacyboost_connect: (a: number, b: number) => number;
  readonly privacyboost_consolidateNotes: (a: number, b: number, c: number, d: number) => number;
  readonly privacyboost_createChainContext: (a: number, b: number, c: number) => void;
  readonly privacyboost_deleteVault: (a: number) => number;
  readonly privacyboost_deriveEcdhKeys: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
  readonly privacyboost_dispose: (a: number) => void;
  readonly privacyboost_encryptDepositCiphertext: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
  readonly privacyboost_encryptTransferCiphertext: (a: number, b: number, c: number) => void;
  readonly privacyboost_formatAmount: (a: number, b: number, c: number, d: number, e: number) => void;
  readonly privacyboost_generateNpk: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
  readonly privacyboost_getAllBalances: (a: number) => number;
  readonly privacyboost_getAllPendingTransactions: (a: number, b: number) => void;
  readonly privacyboost_getAppInfo: (a: number, b: number) => number;
  readonly privacyboost_getBalance: (a: number, b: number, c: number) => number;
  readonly privacyboost_getFees: (a: number, b: number, c: number) => number;
  readonly privacyboost_getMerkleTreeStats: (a: number) => number;
  readonly privacyboost_getMnemonic: (a: number, b: number) => void;
  readonly privacyboost_getMpk: (a: number, b: number) => void;
  readonly privacyboost_getPendingTransactions: (a: number, b: number) => void;
  readonly privacyboost_getPrivacyAddress: (a: number, b: number) => void;
  readonly privacyboost_getPublicKeys: (a: number, b: number) => void;
  readonly privacyboost_getRegisteredTokens: (a: number) => number;
  readonly privacyboost_getRegistrationData: (a: number, b: number) => void;
  readonly privacyboost_getShieldStatus: (a: number, b: number, c: number) => number;
  readonly privacyboost_getState: (a: number) => number;
  readonly privacyboost_getSupportedTokens: (a: number) => number;
  readonly privacyboost_getTokenByAddress: (a: number, b: number, c: number) => number;
  readonly privacyboost_getTokenRegistryId: (a: number, b: number, c: number) => number;
  readonly privacyboost_getTrackedTokens: (a: number) => number;
  readonly privacyboost_getTransactionHistory: (a: number, b: number) => number;
  readonly privacyboost_getTransferStatus: (a: number, b: number, c: number) => number;
  readonly privacyboost_getUnshieldStatus: (a: number, b: number, c: number) => number;
  readonly privacyboost_getUnspentNotes: (a: number, b: number, c: number) => number;
  readonly privacyboost_isAuthenticated: (a: number) => number;
  readonly privacyboost_isConnected: (a: number) => number;
  readonly privacyboost_isRegistered: (a: number) => number;
  readonly privacyboost_isValidAddress: (a: number, b: number, c: number) => number;
  readonly privacyboost_isValidPrivacyAddress: (a: number, b: number, c: number) => number;
  readonly privacyboost_logout: (a: number) => void;
  readonly privacyboost_new: (a: number, b: number) => void;
  readonly privacyboost_parseAmount: (a: number, b: number, c: number, d: number, e: number) => void;
  readonly privacyboost_proceedAfterMnemonic: (a: number, b: number, c: number, d: number) => number;
  readonly privacyboost_proxyFetch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
  readonly privacyboost_refreshPendingTransactions: (a: number) => number;
  readonly privacyboost_resolveIdentity: (a: number, b: number, c: number) => number;
  readonly privacyboost_send: (a: number, b: number) => number;
  readonly privacyboost_setTrackedTokens: (a: number, b: number) => void;
  readonly privacyboost_shield: (a: number, b: number) => number;
  readonly privacyboost_shieldContractAddress: (a: number, b: number) => void;
  readonly privacyboost_signSpending: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
  readonly privacyboost_signViewAuth: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
  readonly privacyboost_submitCredential: (a: number, b: number, c: number, d: number) => number;
  readonly privacyboost_toChecksumAddress: (a: number, b: number, c: number, d: number) => void;
  readonly privacyboost_unshield: (a: number, b: number) => number;
  readonly privacyboost_unwrapWeth: (a: number, b: number, c: number, d: number, e: number) => number;
  readonly privacyboost_walletAddress: (a: number, b: number) => void;
  readonly validateEvmAddress: (a: number, b: number, c: number) => void;
  readonly validatePrivacyAddress: (a: number, b: number, c: number) => void;
  readonly wasmchainmetadata_addBlockExplorerUrl: (a: number, b: number, c: number) => void;
  readonly wasmchainmetadata_addRpcUrl: (a: number, b: number, c: number) => void;
  readonly wasmchainmetadata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
  readonly wasmconfig_fromObject: (a: number, b: number) => void;
  readonly wasmconfig_new: (a: number, b: number, c: bigint, d: number, e: number) => number;
  readonly wasmconfig_setAutoBootstrap: (a: number, b: number) => void;
  readonly wasmconfig_setRpcUrl: (a: number, b: number, c: number) => void;
  readonly wasmconfig_setTimeoutMs: (a: number, b: bigint) => void;
  readonly wasmconfig_setWethContractAddress: (a: number, b: number, c: number) => void;
  readonly wasmconfig_toJSON: (a: number, b: number) => void;
  readonly wasmshieldresult_commitment: (a: number, b: number) => void;
  readonly wasmshieldresult_fee: (a: number, b: number) => void;
  readonly wasmshieldresult_requestId: (a: number, b: number) => void;
  readonly wasmshieldresult_toObject: (a: number) => number;
  readonly wasmshieldresult_txHash: (a: number, b: number) => void;
  readonly wasmshieldresult_wrapTxHash: (a: number, b: number) => void;
  readonly wasmtokenbalance_decimals: (a: number) => number;
  readonly wasmtokenbalance_shieldedBalance: (a: number, b: number) => void;
  readonly wasmtokenbalance_symbol: (a: number, b: number) => void;
  readonly wasmtokenbalance_toObject: (a: number) => number;
  readonly wasmtokenbalance_tokenAddress: (a: number, b: number) => void;
  readonly wasmtokenbalance_total: (a: number, b: number) => void;
  readonly wasmtokenbalance_walletBalance: (a: number, b: number) => void;
  readonly wasmtokenmetadata_address: (a: number, b: number) => void;
  readonly wasmtokenmetadata_decimals: (a: number) => number;
  readonly wasmtokenmetadata_name: (a: number, b: number) => void;
  readonly wasmtokenmetadata_symbol: (a: number, b: number) => void;
  readonly wasmtokenmetadata_toObject: (a: number) => number;
  readonly wasmtransaction_amount: (a: number, b: number) => void;
  readonly wasmtransaction_direction: (a: number, b: number) => void;
  readonly wasmtransaction_fee: (a: number, b: number) => void;
  readonly wasmtransaction_fromAddress: (a: number, b: number) => void;
  readonly wasmtransaction_status: (a: number, b: number) => void;
  readonly wasmtransaction_timestamp: (a: number) => bigint;
  readonly wasmtransaction_toAddress: (a: number, b: number) => void;
  readonly wasmtransaction_toObject: (a: number) => number;
  readonly wasmtransaction_tokenAddress: (a: number, b: number) => void;
  readonly wasmtransaction_txHash: (a: number, b: number) => void;
  readonly wasmtransaction_txType: (a: number, b: number) => void;
  readonly wasmtransactionrequest_new: (a: number, b: number) => number;
  readonly wasmtransactionrequest_setData: (a: number, b: number, c: number) => void;
  readonly wasmtransactionrequest_setGasLimit: (a: number, b: number, c: number) => void;
  readonly wasmtransactionrequest_setValue: (a: number, b: number, c: number) => void;
  readonly wasmtransactionrequest_to: (a: number, b: number) => void;
  readonly wasmtransactionrequest_toObject: (a: number) => number;
  readonly wasmtransferresult_requestId: (a: number, b: number) => void;
  readonly wasmtransferresult_toObject: (a: number) => number;
  readonly wasmtransferresult_txHash: (a: number, b: number) => void;
  readonly wasmunshieldresult_amount: (a: number, b: number) => void;
  readonly wasmunshieldresult_requestId: (a: number, b: number) => void;
  readonly wasmunshieldresult_toObject: (a: number) => number;
  readonly wasmunshieldresult_txHash: (a: number, b: number) => void;
  readonly init: () => void;
  readonly __wasm_bindgen_func_elem_3259: (a: number, b: number, c: number) => void;
  readonly __wasm_bindgen_func_elem_3258: (a: number, b: number) => void;
  readonly __wasm_bindgen_func_elem_576: (a: number, b: number) => void;
  readonly __wasm_bindgen_func_elem_575: (a: number, b: number) => void;
  readonly __wasm_bindgen_func_elem_3306: (a: number, b: number, c: number, d: number) => void;
  readonly __wbindgen_export: (a: number, b: number) => number;
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
  readonly __wbindgen_export3: (a: number) => void;
  readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
  readonly __wbindgen_start: () => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;

/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
*
* @returns {InitOutput}
*/
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;

/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
