X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=blobdiff_plain;f=ts%2Fstructs%2FUpdateFulfillHTLC.mts;fp=ts%2Fstructs%2FUpdateFulfillHTLC.mts;h=9664666497ffa4ed45c47db5b21b4df9822aa387;hp=1717d0779cbac8fbd80675514736a9fad55ab344;hb=7d372e434499e36b8be0d090ef733a03650dec6e;hpb=d87886bb194886ef86d3597a5cdc142b6ccc89e9 diff --git a/ts/structs/UpdateFulfillHTLC.mts b/ts/structs/UpdateFulfillHTLC.mts index 1717d077..96646664 100644 --- a/ts/structs/UpdateFulfillHTLC.mts +++ b/ts/structs/UpdateFulfillHTLC.mts @@ -279,7 +279,6 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' -import * as InternalUtils from '../InternalUtils.mjs' export class UpdateFulfillHTLC extends CommonBase { @@ -289,34 +288,36 @@ export class UpdateFulfillHTLC extends CommonBase { } public get_channel_id(): Uint8Array { - const ret: Uint8Array = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr); - return ret; + const ret: number = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr); + const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); + return ret_conv; } public set_channel_id(val: Uint8Array): void { - bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } - public get_htlc_id(): number { - const ret: number = bindings.UpdateFulfillHTLC_get_htlc_id(this.ptr); + public get_htlc_id(): bigint { + const ret: bigint = bindings.UpdateFulfillHTLC_get_htlc_id(this.ptr); return ret; } - public set_htlc_id(val: number): void { + public set_htlc_id(val: bigint): void { bindings.UpdateFulfillHTLC_set_htlc_id(this.ptr, val); } public get_payment_preimage(): Uint8Array { - const ret: Uint8Array = bindings.UpdateFulfillHTLC_get_payment_preimage(this.ptr); - return ret; + const ret: number = bindings.UpdateFulfillHTLC_get_payment_preimage(this.ptr); + const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); + return ret_conv; } public set_payment_preimage(val: Uint8Array): void { - bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, InternalUtils.check_arr_len(val, 32)); + bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } - public static constructor_new(channel_id_arg: Uint8Array, htlc_id_arg: number, payment_preimage_arg: Uint8Array): UpdateFulfillHTLC { - const ret: number = bindings.UpdateFulfillHTLC_new(InternalUtils.check_arr_len(channel_id_arg, 32), htlc_id_arg, InternalUtils.check_arr_len(payment_preimage_arg, 32)); + public static constructor_new(channel_id_arg: Uint8Array, htlc_id_arg: bigint, payment_preimage_arg: Uint8Array): UpdateFulfillHTLC { + const ret: number = bindings.UpdateFulfillHTLC_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), htlc_id_arg, bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage_arg, 32))); const ret_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, ret); CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv); return ret_hu_conv; @@ -335,12 +336,13 @@ export class UpdateFulfillHTLC extends CommonBase { } public write(): Uint8Array { - const ret: Uint8Array = bindings.UpdateFulfillHTLC_write(this.ptr); - return ret; + const ret: number = bindings.UpdateFulfillHTLC_write(this.ptr); + const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); + return ret_conv; } public static constructor_read(ser: Uint8Array): Result_UpdateFulfillHTLCDecodeErrorZ { - const ret: number = bindings.UpdateFulfillHTLC_read(ser); + const ret: number = bindings.UpdateFulfillHTLC_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UpdateFulfillHTLCDecodeErrorZ = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }