@hashgraphonline/standards-sdk
Version:
The Hashgraph Online Standards SDK provides a complete implementation of the Hashgraph Consensus Standards (HCS), giving developers all the tools needed to build applications on Hedera.
72 lines • 2.27 kB
TypeScript
export interface BaseMessage {
p: string;
op: string;
m: string;
t?: string;
t_id?: string;
d?: Record<string, unknown>;
}
export interface EVMConfig extends BaseMessage {
c: {
contractAddress: string;
abi: {
inputs: Array<{
name: string;
type: string;
}>;
name: string;
outputs: Array<{
name: string;
type: string;
}>;
stateMutability: string;
type: string;
};
};
}
export interface WASMConfig extends BaseMessage {
c: {
wasmTopicId: string;
inputType: {
stateData: Record<string, string>;
};
outputType: {
type: string;
format: string;
};
};
}
export interface WasmExports extends WebAssembly.Exports {
__wbindgen_add_to_stack_pointer: (a: number) => number;
__wbindgen_malloc: (a: number, b: number) => number;
__wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
__wbindgen_free: (a: number, b: number, c: number) => void;
memory: WebAssembly.Memory;
process_state: (state_json: string, messages_json: string) => string;
get_params: () => string;
[key: string]: any;
}
export declare class WasmBridge {
wasm: WasmExports | null;
private WASM_VECTOR_LEN;
private cachedUint8Memory;
private cachedDataViewMemory;
private readonly textEncoder;
private readonly textDecoder;
private logger;
constructor();
setLogLevel(level: 'debug' | 'info' | 'warn' | 'error'): void;
get wasmInstance(): WasmExports;
private getUint8Memory;
private getDataViewMemory;
private encodeString;
private passStringToWasm;
private getStringFromWasm;
createWasmFunction(wasmFn: (...args: any[]) => any): (...args: string[]) => string;
initWasm(wasmBytes: BufferSource): Promise<WasmExports>;
createStateData(wasmConfig: WASMConfig, stateData?: Record<string, any>): Record<string, any>;
private getDefaultValueForType;
executeWasm(stateData: Record<string, any>, messages: BaseMessage[]): string;
getParams(): string;
}
//# sourceMappingURL=wasm-bridge.d.ts.map