UNPKG

lightningdevkit

Version:
67 lines 2.77 kB
import { LSPS2OpeningFeeParams } from '../structs/LSPS2OpeningFeeParams.mjs'; import { CommonBase } from './CommonBase.mjs'; import * as bindings from '../bindings.mjs'; /** * A response to a [`LSPS2GetInfoRequest`] */ export class LSPS2GetInfoResponse extends CommonBase { /* @internal */ constructor(_dummy, ptr) { super(ptr, bindings.LSPS2GetInfoResponse_free); } /** * A set of opening fee parameters. */ get_opening_fee_params_menu() { const ret = bindings.LSPS2GetInfoResponse_get_opening_fee_params_menu(this.ptr); const ret_conv_23_len = bindings.getArrayLength(ret); const ret_conv_23_arr = new Array(ret_conv_23_len).fill(null); for (var x = 0; x < ret_conv_23_len; x++) { const ret_conv_23 = bindings.getU64ArrayElem(ret, x); const ret_conv_23_hu_conv = new LSPS2OpeningFeeParams(null, ret_conv_23); CommonBase.add_ref_from(ret_conv_23_hu_conv, this); ret_conv_23_arr[x] = ret_conv_23_hu_conv; } bindings.freeWasmMemory(ret); return ret_conv_23_arr; } /** * A set of opening fee parameters. */ set_opening_fee_params_menu(val) { bindings.LSPS2GetInfoResponse_set_opening_fee_params_menu(this.ptr, bindings.encodeUint64Array(val.map(val_conv_23 => CommonBase.get_ptr_of(val_conv_23)))); } /** * Constructs a new LSPS2GetInfoResponse given each field */ static constructor_new(opening_fee_params_menu_arg) { const ret = bindings.LSPS2GetInfoResponse_new(bindings.encodeUint64Array(opening_fee_params_menu_arg.map(opening_fee_params_menu_arg_conv_23 => CommonBase.get_ptr_of(opening_fee_params_menu_arg_conv_23)))); const ret_hu_conv = new LSPS2GetInfoResponse(null, ret); CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv); return ret_hu_conv; } clone_ptr() { const ret = bindings.LSPS2GetInfoResponse_clone_ptr(this.ptr); return ret; } /** * Creates a copy of the LSPS2GetInfoResponse */ clone() { const ret = bindings.LSPS2GetInfoResponse_clone(this.ptr); const ret_hu_conv = new LSPS2GetInfoResponse(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; } /** * Checks if two LSPS2GetInfoResponses contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. * Two objects with NULL inner values will be considered "equal" here. */ eq(b) { const ret = bindings.LSPS2GetInfoResponse_eq(this.ptr, CommonBase.get_ptr_of(b)); CommonBase.add_ref_from(this, b); return ret; } } //# sourceMappingURL=LSPS2GetInfoResponse.mjs.map