/* tslint:disable */ /* eslint-disable */ /** */ export function core_misc_set_panic_hook(): void; /** * @param {string} mono_repo_path * @returns {any} */ export function supported_environments(mono_repo_path: string): any; /** * @param {string} mono_repo_path * @param {string} environment_id * @param {string | undefined} maybe_custom_provider * @returns {any} */ export function resolve_environment(mono_repo_path: string, environment_id: string, maybe_custom_provider?: string): any; /** * Returns a struct with readonly constants, needs to be a function * because Rust does not support exporting constants to WASM * @returns {CoreConstants} */ export function CORE_CONSTANTS(): CoreConstants; /** */ export function utils_misc_set_panic_hook(): void; /** * Dummy function to test WASM. * @returns {string} */ export function dummy_get_one(): string; /** * Reads the given package.json file and determines its version. * @param {string} package_file * @returns {string} */ export function get_package_version(package_file: string): string; /** */ export enum EnvironmentType { Production = 0, Staging = 1, Development = 2, } /** * Helper struct to export Rust Streams into Javascript AsyncIterables * * ``` * use futures::stream::{Stream, StreamExt}; * use wasm_bindgen::prelude::*; * use wasm_bindgen_futures::stream::JsStream; * use js_sys::AsyncIterator; * use utils_misc::async_iterable::wasm::to_box_u8_stream; * * #[wasm_bindgen] * pub struct AsyncIterableHelper { * stream: Box, String>> + Unpin>, // must not be pub * } * #[wasm_bindgen] * pub fn async_test(some_async_iterable: AsyncIterator) -> Result { * let stream = JsStream::from(some_async_iterable); * * let stream = stream.map(to_box_u8_stream); * * Ok(AsyncIterableHelper { * stream: Box::new(stream), * }) * } * ``` */ export class AsyncIterableHelper { free(): void; /** * @returns {Promise} */ next(): Promise; } /** */ export class CoreConstants { free(): void; /** */ readonly DEFAULT_HEARTBEAT_INTERVAL: number; /** */ readonly DEFAULT_HEARTBEAT_INTERVAL_VARIANCE: number; /** */ readonly DEFAULT_HEARTBEAT_THRESHOLD: number; /** */ readonly DEFAULT_MAX_PARALLEL_CONNECTIONS: number; /** */ readonly DEFAULT_MAX_PARALLEL_CONNECTIONS_PUBLIC_RELAY: number; /** */ readonly DEFAULT_NETWORK_QUALITY_THRESHOLD: number; } /** * Holds all information about the protocol environment * to be used by the client */ export class Environment { free(): void; /** * an Ethereum address */ boost_contract_address: string; /** * an Ethereum address */ channels_contract_address: string; /** */ environment_type: number; /** */ id: string; /** */ indexer_start_block_number: number; /** * must match one of the Network.id */ network_id: string; /** * an Ethereum address */ network_registry_contract_address: string; /** * an Ethereum address */ network_registry_proxy_contract_address: string; /** * an Ethereum address */ stake_contract_address: string; /** * the associated staking season */ stake_season?: number; /** * an Ethereum address */ token_contract_address: string; /** */ version_range: string; /** * an Ethereum address */ xhopr_contract_address: string; } /** */ export class IteratorResult { free(): void; } /** * Holds all information we need about the blockchain network * the client is going to use */ export class NetworkOptions { free(): void; /** * >= 0 */ chain_id: number; /** * a valid HTTP url pointing at a RPC endpoint */ default_provider: string; /** */ description: string; /** * a valid HTTP url pointing at a RPC endpoint */ etherscan_api_url?: string; /** */ hopr_token_name: string; /** */ id: string; /** */ live: boolean; /** * The absolute maximum you are willing to pay per unit of gas to get your transaction included in a block, e.g. '10 gwei' */ max_fee_per_gas: string; /** * Tips paid directly to miners, e.g. '2 gwei' */ max_priority_fee_per_gas: string; /** */ native_token_name: string; } /** */ export class ResolvedEnvironment { free(): void; /** * an Ethereum address */ boost_contract_address: string; /** */ channel_contract_deploy_block: number; /** * an Ethereum address */ channels_contract_address: string; /** */ environment_type: number; /** * the environment identifier, e.g. monte_rosa */ id: string; /** */ network: NetworkOptions; /** * an Ethereum address */ network_registry_contract_address: string; /** * an Ethereum address */ network_registry_proxy_contract_address: string; /** * an Ethereum address */ stake_contract_address: string; /** * an Ethereum address */ token_contract_address: string; /** * an Ethereum address */ xhopr_contract_address: string; }