X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChainParameters.ts;h=292a85f19a4504385b51d0e5eff24b2bfc4f04ff;hb=9d146759e11191b55130be7a1b6988d3f289a168;hp=74eb66fa56d29350b2c628d8420dd5b7a760a503;hpb=6f84978154512148a47502caad48038e3f264392;p=ldk-java diff --git a/ts/structs/ChainParameters.ts b/ts/structs/ChainParameters.ts index 74eb66fa..292a85f1 100644 --- a/ts/structs/ChainParameters.ts +++ b/ts/structs/ChainParameters.ts @@ -18,12 +18,12 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ChainParameters_free(this.ptr); } } - public LDKNetwork get_network() { - LDKNetwork ret = bindings.ChainParameters_get_network(this.ptr); + public Network get_network() { + Network ret = bindings.ChainParameters_get_network(this.ptr); return ret; } - public void set_network(LDKNetwork val) { + public void set_network(Network val) { bindings.ChainParameters_set_network(this.ptr, val); } @@ -36,14 +36,19 @@ import * as bindings from '../bindings' // TODO: figure out location public void set_best_block(BestBlock val) { bindings.ChainParameters_set_best_block(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } - public static ChainParameters constructor_new(LDKNetwork network_arg, BestBlock best_block_arg) { + public static ChainParameters constructor_new(Network network_arg, BestBlock best_block_arg) { number ret = bindings.ChainParameters_new(network_arg, best_block_arg == null ? 0 : best_block_arg.ptr & ~1); const ret_hu_conv: ChainParameters = new ChainParameters(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(best_block_arg); + return ret_hu_conv; + } + + public ChainParameters clone() { + number ret = bindings.ChainParameters_clone(this.ptr); + const ret_hu_conv: ChainParameters = new ChainParameters(null, ret); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; }