6 namespace org { namespace ldk { namespace structs {
8 public class Result_PublicKeySecp256k1ErrorZ : CommonBase {
9 Result_PublicKeySecp256k1ErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_PublicKeySecp256k1ErrorZ() {
11 if (ptr != 0) { bindings.CResult_PublicKeySecp256k1ErrorZ_free(ptr); }
14 internal static Result_PublicKeySecp256k1ErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_PublicKeySecp256k1ErrorZ_is_ok(ptr)) {
16 return new Result_PublicKeySecp256k1ErrorZ_OK(null, ptr);
18 return new Result_PublicKeySecp256k1ErrorZ_Err(null, ptr);
21 public class Result_PublicKeySecp256k1ErrorZ_OK : Result_PublicKeySecp256k1ErrorZ {
22 public readonly byte[] res;
23 internal Result_PublicKeySecp256k1ErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_PublicKeySecp256k1ErrorZ_get_ok(ptr);
25 byte[] res_conv = InternalUtils.decodeUint8Array(res);
30 public class Result_PublicKeySecp256k1ErrorZ_Err : Result_PublicKeySecp256k1ErrorZ {
31 public readonly Secp256k1Error err;
32 internal Result_PublicKeySecp256k1ErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
33 this.err = bindings.CResult_PublicKeySecp256k1ErrorZ_get_err(ptr);
38 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
40 public static Result_PublicKeySecp256k1ErrorZ ok(byte[] o) {
41 long ret = bindings.CResult_PublicKeySecp256k1ErrorZ_ok(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(o, 33)));
43 if (ret >= 0 && ret <= 4096) { return null; }
44 Result_PublicKeySecp256k1ErrorZ ret_hu_conv = Result_PublicKeySecp256k1ErrorZ.constr_from_ptr(ret);
49 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
51 public static Result_PublicKeySecp256k1ErrorZ err(Secp256k1Error e) {
52 long ret = bindings.CResult_PublicKeySecp256k1ErrorZ_err(e);
54 if (ret >= 0 && ret <= 4096) { return null; }
55 Result_PublicKeySecp256k1ErrorZ ret_hu_conv = Result_PublicKeySecp256k1ErrorZ.constr_from_ptr(ret);
60 * Checks if the given object is currently in the success state
63 bool ret = bindings.CResult_PublicKeySecp256k1ErrorZ_is_ok(this.ptr);
68 internal long clone_ptr() {
69 long ret = bindings.CResult_PublicKeySecp256k1ErrorZ_clone_ptr(this.ptr);
75 * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
76 * but with all dynamically-allocated buffers duplicated in new buffers.
78 public Result_PublicKeySecp256k1ErrorZ clone() {
79 long ret = bindings.CResult_PublicKeySecp256k1ErrorZ_clone(this.ptr);
81 if (ret >= 0 && ret <= 4096) { return null; }
82 Result_PublicKeySecp256k1ErrorZ ret_hu_conv = Result_PublicKeySecp256k1ErrorZ.constr_from_ptr(ret);