X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FTwoTuple_PaymentHashPaymentSecretZ.mts;h=b541c1c27c23dede058d5241f134443d9ed8a565;hb=7a5639be20902abaa73d5dab53664f89bec70357;hp=ca95d31f0d83c4abff3b8241454b1c7a8aa5352d;hpb=bf08029c1ad5244b59902eada723b634dcade62d;p=ldk-java diff --git a/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.mts b/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.mts index ca95d31f..b541c1c2 100644 --- a/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.mts +++ b/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.mts @@ -279,23 +279,33 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' -import * as InternalUtils from '../InternalUtils.mjs' +/** + * A Tuple + */ export class TwoTuple_PaymentHashPaymentSecretZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_PaymentHashPaymentSecretZ_free); } + /** + * + */ public get_a(): Uint8Array { - const ret: Uint8Array = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_a(this.ptr); - return ret; + const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_a(this.ptr); + const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); + return ret_conv; } + /** + * + */ public get_b(): Uint8Array { - const ret: Uint8Array = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_b(this.ptr); - return ret; + const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_b(this.ptr); + const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); + return ret_conv; } public clone_ptr(): number { @@ -303,6 +313,10 @@ export class TwoTuple_PaymentHashPaymentSecretZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_PaymentHashPaymentSecretZ { const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone(this.ptr); const ret_hu_conv: TwoTuple_PaymentHashPaymentSecretZ = new TwoTuple_PaymentHashPaymentSecretZ(null, ret); @@ -310,8 +324,11 @@ export class TwoTuple_PaymentHashPaymentSecretZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b: Uint8Array): TwoTuple_PaymentHashPaymentSecretZ { - const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32)); + const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), bindings.encodeUint8Array(bindings.check_arr_len(b, 32))); const ret_hu_conv: TwoTuple_PaymentHashPaymentSecretZ = new TwoTuple_PaymentHashPaymentSecretZ(null, ret); CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv); return ret_hu_conv;