update hc wasm files

This commit is contained in:
Bob van der Helm 2023-11-23 15:12:06 +01:00
parent 4c88cfd99f
commit 7ebd35fbfd
No known key found for this signature in database
GPG Key ID: 59FC90B476A8CB39
4 changed files with 32 additions and 2 deletions

View File

@ -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

View File

@ -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)

View File

@ -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