import CommonBase from './CommonBase.mjs';
import * as bindings from '../bindings.mjs'
-import * as InternalUtils from '../InternalUtils.mjs'
+/**
+ * The minimum and maximum fees which the sender is willing to place on the closing transaction.
+ * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
+ * to use.
+ */
export class ClosingSignedFeeRange extends CommonBase {
/* @internal */
public constructor(_dummy: object, ptr: number) {
super(ptr, bindings.ClosingSignedFeeRange_free);
}
- public get_min_fee_satoshis(): number {
- const ret: number = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr);
+ /**
+ * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
+ */
+ public get_min_fee_satoshis(): bigint {
+ const ret: bigint = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr);
return ret;
}
- public set_min_fee_satoshis(val: number): void {
+ /**
+ * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
+ */
+ public set_min_fee_satoshis(val: bigint): void {
bindings.ClosingSignedFeeRange_set_min_fee_satoshis(this.ptr, val);
}
- public get_max_fee_satoshis(): number {
- const ret: number = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr);
+ /**
+ * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
+ */
+ public get_max_fee_satoshis(): bigint {
+ const ret: bigint = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr);
return ret;
}
- public set_max_fee_satoshis(val: number): void {
+ /**
+ * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
+ */
+ public set_max_fee_satoshis(val: bigint): void {
bindings.ClosingSignedFeeRange_set_max_fee_satoshis(this.ptr, val);
}
- public static constructor_new(min_fee_satoshis_arg: number, max_fee_satoshis_arg: number): ClosingSignedFeeRange {
+ /**
+ * Constructs a new ClosingSignedFeeRange given each field
+ */
+ public static constructor_new(min_fee_satoshis_arg: bigint, max_fee_satoshis_arg: bigint): ClosingSignedFeeRange {
const ret: number = bindings.ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
const ret_hu_conv: ClosingSignedFeeRange = new ClosingSignedFeeRange(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
return ret;
}
+ /**
+ * Creates a copy of the ClosingSignedFeeRange
+ */
public clone(): ClosingSignedFeeRange {
const ret: number = bindings.ClosingSignedFeeRange_clone(this.ptr);
const ret_hu_conv: ClosingSignedFeeRange = new ClosingSignedFeeRange(null, ret);
return ret_hu_conv;
}
+ /**
+ * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
+ */
public write(): Uint8Array {
- const ret: Uint8Array = bindings.ClosingSignedFeeRange_write(this.ptr);
- return ret;
+ const ret: number = bindings.ClosingSignedFeeRange_write(this.ptr);
+ const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+ return ret_conv;
}
+ /**
+ * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
+ */
public static constructor_read(ser: Uint8Array): Result_ClosingSignedFeeRangeDecodeErrorZ {
- const ret: number = bindings.ClosingSignedFeeRange_read(ser);
+ const ret: number = bindings.ClosingSignedFeeRange_read(bindings.encodeUint8Array(ser));
const ret_hu_conv: Result_ClosingSignedFeeRangeDecodeErrorZ = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}