X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=blobdiff_plain;f=ts%2Fstructs%2FRoutingFees.mts;h=4260a25875d24e4ed1eaccd5bec0496d5f85f93e;hp=d51cc65e14406f9eaa6f5e9b2819c2994222b509;hb=c629a01650402c8e2f9b9db8ced9ed63ce687727;hpb=d1d0121c000b713c10fd0bedd249eb8dda2e4db7 diff --git a/ts/structs/RoutingFees.mts b/ts/structs/RoutingFees.mts index d51cc65e..4260a258 100644 --- a/ts/structs/RoutingFees.mts +++ b/ts/structs/RoutingFees.mts @@ -281,30 +281,50 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Fees for routing via a given channel or a node + */ export class RoutingFees extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.RoutingFees_free); } + /** + * Flat routing fee in satoshis + */ public get_base_msat(): number { const ret: number = bindings.RoutingFees_get_base_msat(this.ptr); return ret; } + /** + * Flat routing fee in satoshis + */ public set_base_msat(val: number): void { bindings.RoutingFees_set_base_msat(this.ptr, val); } + /** + * Liquidity-based routing fee in millionths of a routed amount. + * In other words, 10000 is 1%. + */ public get_proportional_millionths(): number { const ret: number = bindings.RoutingFees_get_proportional_millionths(this.ptr); return ret; } + /** + * Liquidity-based routing fee in millionths of a routed amount. + * In other words, 10000 is 1%. + */ public set_proportional_millionths(val: number): void { bindings.RoutingFees_set_proportional_millionths(this.ptr, val); } + /** + * Constructs a new RoutingFees given each field + */ public static constructor_new(base_msat_arg: number, proportional_millionths_arg: number): RoutingFees { const ret: number = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); @@ -312,6 +332,11 @@ export class RoutingFees extends CommonBase { return ret_hu_conv; } + /** + * Checks if two RoutingFeess 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. + */ public eq(b: RoutingFees): boolean { const ret: boolean = bindings.RoutingFees_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); @@ -323,6 +348,9 @@ export class RoutingFees extends CommonBase { return ret; } + /** + * Creates a copy of the RoutingFees + */ public clone(): RoutingFees { const ret: number = bindings.RoutingFees_clone(this.ptr); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); @@ -330,17 +358,26 @@ export class RoutingFees extends CommonBase { return ret_hu_conv; } + /** + * Checks if two RoutingFeess contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.RoutingFees_hash(this.ptr); return ret; } + /** + * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read + */ public write(): Uint8Array { const ret: number = bindings.RoutingFees_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a RoutingFees from a byte array, created by RoutingFees_write + */ public static constructor_read(ser: Uint8Array): Result_RoutingFeesDecodeErrorZ { const ret: number = bindings.RoutingFees_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_RoutingFeesDecodeErrorZ = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);