5376c2a4ba
* WASM Client: simplify sending of custom messages by always setting headers and a mime-type for the content * Use rollup to bundle the web worker script to support more downstream bundlers The WASM bundle is embedded as a base64 encoded resource and loaded synchronously, because this is the only mechanism widely supported to load WASM inside a web worker currently. Hopefully in the future this can be changed to pure modules. * Suppress errors in build script * Add Parcel 2.0 example * WASM client: fix tests * Update SDK docs and images * wasm-client: add method to validate a recipient's address * Revert "Removing unused prestart" This reverts commitcbeac10383. * Revert "Removing pointless dependency build command from TypeScript SDK example" This reverts commit0e0a62938d. * Add typing for React 18 * Improve README files Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
26 lines
809 B
Rust
26 lines
809 B
Rust
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
mod client;
|
|
#[cfg(target_arch = "wasm32")]
|
|
pub mod encoded_payload_helper;
|
|
#[cfg(target_arch = "wasm32")]
|
|
pub mod gateway_selector;
|
|
#[cfg(target_arch = "wasm32")]
|
|
pub mod validation;
|
|
|
|
#[wasm_bindgen]
|
|
pub fn set_panic_hook() {
|
|
// When the `console_error_panic_hook` feature is enabled, we can call the
|
|
// `set_panic_hook` function at least once during initialization, and then
|
|
// we will get better error messages if our code ever panics.
|
|
//
|
|
// For more details see
|
|
// https://github.com/rustwasm/console_error_panic_hook#readme
|
|
#[cfg(feature = "console_error_panic_hook")]
|
|
console_error_panic_hook::set_once();
|
|
}
|