diff --git a/src/utils/health_computer/index.d.ts b/src/utils/health_computer/index.d.ts index ea88a7b2..f6c5086c 100644 --- a/src/utils/health_computer/index.d.ts +++ b/src/utils/health_computer/index.d.ts @@ -37,6 +37,12 @@ export function max_swap_estimate_js( kind: SwapKind, slippage: Slippage, ): string +/** + * @param {HealthComputer} c + * @param {string} denom + * @returns {string} + */ +export function liquidation_price_js(c: HealthComputer, denom: string): string export interface HealthComputer { kind: AccountKind positions: Positions @@ -82,9 +88,9 @@ export interface InitOutput { g: number, h: number, ) => void + readonly liquidation_price_js: (a: number, b: number, c: number, d: number) => void readonly allocate: (a: number) => number readonly deallocate: (a: number) => void - readonly requires_stargate: () => void readonly requires_iterator: () => void readonly interface_version_8: () => void readonly __wbindgen_malloc: (a: number, b: number) => number diff --git a/src/utils/health_computer/index.js b/src/utils/health_computer/index.js index 0544f6f4..fe0f1cb6 100644 --- a/src/utils/health_computer/index.js +++ b/src/utils/health_computer/index.js @@ -230,6 +230,30 @@ export function max_swap_estimate_js(c, from_denom, to_denom, kind, slippage) { } } +/** + * @param {HealthComputer} c + * @param {string} denom + * @returns {string} + */ +export function liquidation_price_js(c, denom) { + let deferred2_0 + let deferred2_1 + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) + const ptr0 = passStringToWasm0(denom, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc) + const len0 = WASM_VECTOR_LEN + wasm.liquidation_price_js(retptr, addHeapObject(c), ptr0, len0) + var r0 = getInt32Memory0()[retptr / 4 + 0] + var r1 = getInt32Memory0()[retptr / 4 + 1] + deferred2_0 = r0 + deferred2_1 = r1 + return getStringFromWasm0(r0, r1) + } finally { + wasm.__wbindgen_add_to_stack_pointer(16) + wasm.__wbindgen_free(deferred2_0, deferred2_1, 1) + } +} + function handleError(f, args) { try { return f.apply(this, args) diff --git a/src/utils/health_computer/index_bg.wasm b/src/utils/health_computer/index_bg.wasm index 55f248f4..7d916784 100644 Binary files a/src/utils/health_computer/index_bg.wasm and b/src/utils/health_computer/index_bg.wasm differ diff --git a/src/utils/health_computer/index_bg.wasm.d.ts b/src/utils/health_computer/index_bg.wasm.d.ts index ea2c344a..bcd48262 100644 --- a/src/utils/health_computer/index_bg.wasm.d.ts +++ b/src/utils/health_computer/index_bg.wasm.d.ts @@ -14,9 +14,9 @@ export function max_swap_estimate_js( g: number, h: number, ): void +export function liquidation_price_js(a: number, b: number, c: number, d: number): void export function allocate(a: number): number export function deallocate(a: number): void -export function requires_stargate(): void export function requires_iterator(): void export function interface_version_8(): void export function __wbindgen_malloc(a: number, b: number): number