]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/Result_PublicKeyErrorZ.ts
Merge pull request #69 from TheBlueMatt/main
[ldk-java] / ts / structs / Result_PublicKeyErrorZ.ts
1
2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
4
5 public class Result_PublicKeyErrorZ extends CommonBase {
6         private Result_PublicKeyErrorZ(Object _dummy, long ptr) { super(ptr); }
7         protected void finalize() throws Throwable {
8                 if (ptr != 0) { bindings.CResult_PublicKeyErrorZ_free(ptr); } super.finalize();
9         }
10
11         static Result_PublicKeyErrorZ constr_from_ptr(long ptr) {
12                 if (bindings.CResult_PublicKeyErrorZ_is_ok(ptr)) {
13                         return new Result_PublicKeyErrorZ_OK(null, ptr);
14                 } else {
15                         return new Result_PublicKeyErrorZ_Err(null, ptr);
16                 }
17         }
18         public static final class Result_PublicKeyErrorZ_OK extends Result_PublicKeyErrorZ {
19                 public final Uint8Array res;
20                 private Result_PublicKeyErrorZ_OK(Object _dummy, long ptr) {
21                         super(_dummy, ptr);
22                         this.res = bindings.LDKCResult_PublicKeyErrorZ_get_ok(ptr);
23                 }
24         }
25
26         public static final class Result_PublicKeyErrorZ_Err extends Result_PublicKeyErrorZ {
27                 public final Secp256k1Error err;
28                 private Result_PublicKeyErrorZ_Err(Object _dummy, long ptr) {
29                         super(_dummy, ptr);
30                         this.err = bindings.LDKCResult_PublicKeyErrorZ_get_err(ptr);
31                 }
32         }
33
34         public static Result_PublicKeyErrorZ constructor_ok(Uint8Array o) {
35                 number ret = bindings.CResult_PublicKeyErrorZ_ok(InternalUtils.check_arr_len(o, 33));
36                 Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
37                 return ret_hu_conv;
38         }
39
40         public static Result_PublicKeyErrorZ constructor_err(Secp256k1Error e) {
41                 number ret = bindings.CResult_PublicKeyErrorZ_err(e);
42                 Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
43                 return ret_hu_conv;
44         }
45
46         public boolean is_ok() {
47                 boolean ret = bindings.CResult_PublicKeyErrorZ_is_ok(this.ptr);
48                 return ret;
49         }
50
51         public number clone_ptr() {
52                 number ret = bindings.CResult_PublicKeyErrorZ_clone_ptr(this.ptr);
53                 return ret;
54         }
55
56         public Result_PublicKeyErrorZ clone() {
57                 number ret = bindings.CResult_PublicKeyErrorZ_clone(this.ptr);
58                 Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
59                 return ret_hu_conv;
60         }
61
62 }