X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=ts%2Fstructs%2FClosingSignedFeeRange.mts;h=3fe3c79e6308de0d8e1f3a87d69bbad0c7c489a5;hb=c629a01650402c8e2f9b9db8ced9ed63ce687727;hp=537904bd1d962c4db24b0169b3d7e0849b90667c;hpb=bf08029c1ad5244b59902eada723b634dcade62d;p=ldk-java diff --git a/ts/structs/ClosingSignedFeeRange.mts b/ts/structs/ClosingSignedFeeRange.mts index 537904bd..3fe3c79e 100644 --- a/ts/structs/ClosingSignedFeeRange.mts +++ b/ts/structs/ClosingSignedFeeRange.mts @@ -279,34 +279,57 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor 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); @@ -318,6 +341,9 @@ export class ClosingSignedFeeRange extends CommonBase { 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); @@ -325,13 +351,20 @@ export class ClosingSignedFeeRange extends CommonBase { 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; }