X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=blobdiff_plain;f=ts%2Findex.mts;h=9e6b7b101a96177c1c13957bb29b0fbd6df570d1;hp=8aff2a3d0b5920cd897f8f87ecceaa15b61882fb;hb=e31bfe206b70addcb59e25a8fb47144370b2e4e8;hpb=4f8eade3592d704fd0d9f968aeca4810dc710a5c diff --git a/ts/index.mts b/ts/index.mts index 8aff2a3d..9e6b7b10 100644 --- a/ts/index.mts +++ b/ts/index.mts @@ -1,7 +1,13 @@ -import { initializeWasm as bindingsInit } from './bindings.mjs'; -export function initializeWasm(path: string) { - bindingsInit(path); +import { initializeWasmFetch, initializeWasmFromUint8Array } from './bindings.mjs'; +/** Initializes the WASM backend by calling `fetch()` on the given URI - Browser only */ +export async function initializeWasmWebFetch(uri: string) { + await initializeWasmFetch(uri); } +/** Initializes the WASM backend given a Uint8Array of the .wasm binary file - Browser or Node.JS */ +export async function initializeWasmFromBinary(bin: Uint8Array) { + await initializeWasmFromUint8Array(bin); +} + export * from './structs/TxOut.mjs'; export * from './enums/AccessError.mjs'; export * from './enums/COption_NoneZ.mjs';