X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=blobdiff_plain;f=ts%2Fstructs%2FPong.mts;h=34a8d79eade438372e855cf7250f84b6841465e5;hp=79e3babd140d5f58282693882725c889967e420b;hb=c629a01650402c8e2f9b9db8ced9ed63ce687727;hpb=d1d0121c000b713c10fd0bedd249eb8dda2e4db7 diff --git a/ts/structs/Pong.mts b/ts/structs/Pong.mts index 79e3babd..34a8d79e 100644 --- a/ts/structs/Pong.mts +++ b/ts/structs/Pong.mts @@ -281,21 +281,35 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A pong message to be sent or received from a peer + */ export class Pong extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.Pong_free); } + /** + * The pong packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public get_byteslen(): number { const ret: number = bindings.Pong_get_byteslen(this.ptr); return ret; } + /** + * The pong packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public set_byteslen(val: number): void { bindings.Pong_set_byteslen(this.ptr, val); } + /** + * Constructs a new Pong given each field + */ public static constructor_new(byteslen_arg: number): Pong { const ret: number = bindings.Pong_new(byteslen_arg); const ret_hu_conv: Pong = new Pong(null, ret); @@ -308,6 +322,9 @@ export class Pong extends CommonBase { return ret; } + /** + * Creates a copy of the Pong + */ public clone(): Pong { const ret: number = bindings.Pong_clone(this.ptr); const ret_hu_conv: Pong = new Pong(null, ret); @@ -315,12 +332,18 @@ export class Pong extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Pong object into a byte array which can be read by Pong_read + */ public write(): Uint8Array { const ret: number = bindings.Pong_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a Pong from a byte array, created by Pong_write + */ public static constructor_read(ser: Uint8Array): Result_PongDecodeErrorZ { const ret: number = bindings.Pong_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_PongDecodeErrorZ = Result_PongDecodeErrorZ.constr_from_ptr(ret);