X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FOpenChannel.mts;h=db832754584ff725d8553fb02e2c1ce8571f537c;hb=f6d7282fcf6324519ea1fe4b584c8d02c95acd9e;hp=58d90e591f9a49415b857a42df207f2f3f4b65d0;hpb=7cbcc5ef17b8036b2e99980e227c7ca0d44dba7f;p=ldk-java diff --git a/ts/structs/OpenChannel.mts b/ts/structs/OpenChannel.mts index 58d90e59..db832754 100644 --- a/ts/structs/OpenChannel.mts +++ b/ts/structs/OpenChannel.mts @@ -361,7 +361,7 @@ import * as bindings from '../bindings.mjs' */ export class OpenChannel extends CommonBase { /* @internal */ - public constructor(_dummy: object, ptr: number) { + public constructor(_dummy: object, ptr: bigint) { super(ptr, bindings.OpenChannel_free); } @@ -651,7 +651,7 @@ export class OpenChannel extends CommonBase { * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public get_channel_type(): ChannelTypeFeatures { - const ret: number = bindings.OpenChannel_get_channel_type(this.ptr); + const ret: bigint = bindings.OpenChannel_get_channel_type(this.ptr); const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; @@ -665,11 +665,12 @@ export class OpenChannel extends CommonBase { * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ public set_channel_type(val: ChannelTypeFeatures): void { - bindings.OpenChannel_set_channel_type(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); + bindings.OpenChannel_set_channel_type(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val)); + CommonBase.add_ref_from(this, val); } - public clone_ptr(): number { - const ret: number = bindings.OpenChannel_clone_ptr(this.ptr); + public clone_ptr(): bigint { + const ret: bigint = bindings.OpenChannel_clone_ptr(this.ptr); return ret; } @@ -677,7 +678,7 @@ export class OpenChannel extends CommonBase { * Creates a copy of the OpenChannel */ public clone(): OpenChannel { - const ret: number = bindings.OpenChannel_clone(this.ptr); + const ret: bigint = bindings.OpenChannel_clone(this.ptr); const ret_hu_conv: OpenChannel = new OpenChannel(null, ret); CommonBase.add_ref_from(ret_hu_conv, this); return ret_hu_conv; @@ -696,7 +697,7 @@ export class OpenChannel extends CommonBase { * Read a OpenChannel from a byte array, created by OpenChannel_write */ public static constructor_read(ser: Uint8Array): Result_OpenChannelDecodeErrorZ { - const ret: number = bindings.OpenChannel_read(bindings.encodeUint8Array(ser)); + const ret: bigint = bindings.OpenChannel_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_OpenChannelDecodeErrorZ = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }