X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FAcceptChannel.ts;h=4e102c77817673f1ac0b4940fae7f834bbdc4c2a;hb=0fee03a8095f5599f8eccd920c1b1af6b3a20260;hp=e9719e48e7f96741cc26c17f7265badf62c07185;hpb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;p=ldk-java diff --git a/ts/structs/AcceptChannel.ts b/ts/structs/AcceptChannel.ts index e9719e48..4e102c77 100644 --- a/ts/structs/AcceptChannel.ts +++ b/ts/structs/AcceptChannel.ts @@ -18,20 +18,13 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.AcceptChannel_free(this.ptr); } } - public AcceptChannel clone() { - number ret = bindings.AcceptChannel_clone(this.ptr); - const ret_hu_conv: AcceptChannel = new AcceptChannel(null, ret); - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; - } - public Uint8Array get_temporary_channel_id() { Uint8Array ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr); return ret; } public void set_temporary_channel_id(Uint8Array val) { - bindings.AcceptChannel_set_temporary_channel_id(this.ptr, val); + bindings.AcceptChannel_set_temporary_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } public number get_dust_limit_satoshis() { @@ -103,7 +96,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_funding_pubkey(Uint8Array val) { - bindings.AcceptChannel_set_funding_pubkey(this.ptr, val); + bindings.AcceptChannel_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_revocation_basepoint() { @@ -112,7 +105,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_revocation_basepoint(Uint8Array val) { - bindings.AcceptChannel_set_revocation_basepoint(this.ptr, val); + bindings.AcceptChannel_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_payment_point() { @@ -121,7 +114,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_payment_point(Uint8Array val) { - bindings.AcceptChannel_set_payment_point(this.ptr, val); + bindings.AcceptChannel_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_delayed_payment_basepoint() { @@ -130,7 +123,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_delayed_payment_basepoint(Uint8Array val) { - bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, val); + bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_htlc_basepoint() { @@ -139,7 +132,7 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_htlc_basepoint(Uint8Array val) { - bindings.AcceptChannel_set_htlc_basepoint(this.ptr, val); + bindings.AcceptChannel_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33)); } public Uint8Array get_first_per_commitment_point() { @@ -148,7 +141,19 @@ import * as bindings from '../bindings' // TODO: figure out location } public void set_first_per_commitment_point(Uint8Array val) { - bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val); + bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); + } + + public number clone_ptr() { + number ret = bindings.AcceptChannel_clone_ptr(this.ptr); + return ret; + } + + public AcceptChannel clone() { + number ret = bindings.AcceptChannel_clone(this.ptr); + const ret_hu_conv: AcceptChannel = new AcceptChannel(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; } public Uint8Array write() { @@ -156,10 +161,9 @@ import * as bindings from '../bindings' // TODO: figure out location return ret; } - public static AcceptChannel constructor_read(Uint8Array ser) { + public static Result_AcceptChannelDecodeErrorZ constructor_read(Uint8Array ser) { number ret = bindings.AcceptChannel_read(ser); - const ret_hu_conv: AcceptChannel = new AcceptChannel(null, ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }