]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/SignedRawInvoice.ts
Update auto-generated bindings to latest upstream
[ldk-java] / ts / structs / SignedRawInvoice.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export default class SignedRawInvoice extends CommonBase {
9                 constructor(_dummy: object, ptr: number) {
10                     super(ptr);
11                 }
12
13                 
14                 protected finalize() {
15                     super.finalize();
16
17                     if (this.ptr != 0) {
18                         bindings.SignedRawInvoice_free(this.ptr);
19                     }
20                 }
21         public boolean eq(SignedRawInvoice b) {
22                 boolean ret = bindings.SignedRawInvoice_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
23                 this.ptrs_to.add(b);
24                 return ret;
25         }
26
27         public SignedRawInvoice clone() {
28                 number ret = bindings.SignedRawInvoice_clone(this.ptr);
29                 const ret_hu_conv: SignedRawInvoice = new SignedRawInvoice(null, ret);
30                 ret_hu_conv.ptrs_to.add(this);
31                 return ret_hu_conv;
32         }
33
34         public ThreeTuple<RawInvoice, Uint8Array, InvoiceSignature> into_parts() {
35                 number ret = bindings.SignedRawInvoice_into_parts(this.ptr);
36                 number ret_a = bindings.LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(ret);
37                 const ret_a_hu_conv: RawInvoice = new RawInvoice(null, ret_a);
38                 ret_a_hu_conv.ptrs_to.add(this);;
39                 Uint8Array ret_b = bindings.LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(ret);
40                 number ret_c = bindings.LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(ret);
41                 const ret_c_hu_conv: InvoiceSignature = new InvoiceSignature(null, ret_c);
42                 ret_c_hu_conv.ptrs_to.add(this);;
43                 ThreeTuple<RawInvoice, Uint8Array, InvoiceSignature> ret_conv = new ThreeTuple<RawInvoice, Uint8Array, InvoiceSignature>(ret_a_hu_conv, ret_b, ret_c_hu_conv, () -> {
44                         bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(ret);
45                 });
46                 ret_a_hu_conv.ptrs_to.add(ret_conv);
47                 ret_c_hu_conv.ptrs_to.add(ret_conv);
48                 return ret_conv;
49         }
50
51         public RawInvoice raw_invoice() {
52                 number ret = bindings.SignedRawInvoice_raw_invoice(this.ptr);
53                 const ret_hu_conv: RawInvoice = new RawInvoice(null, ret);
54                 ret_hu_conv.ptrs_to.add(this);
55                 return ret_hu_conv;
56         }
57
58         public Uint8Array hash() {
59                 Uint8Array ret = bindings.SignedRawInvoice_hash(this.ptr);
60                 return ret;
61         }
62
63         public InvoiceSignature signature() {
64                 number ret = bindings.SignedRawInvoice_signature(this.ptr);
65                 const ret_hu_conv: InvoiceSignature = new InvoiceSignature(null, ret);
66                 ret_hu_conv.ptrs_to.add(this);
67                 return ret_hu_conv;
68         }
69
70         public Result_PayeePubKeyErrorZ recover_payee_pub_key() {
71                 number ret = bindings.SignedRawInvoice_recover_payee_pub_key(this.ptr);
72                 Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
73                 return ret_hu_conv;
74         }
75
76         public boolean check_signature() {
77                 boolean ret = bindings.SignedRawInvoice_check_signature(this.ptr);
78                 return ret;
79         }
80
81         public static Result_SignedRawInvoiceNoneZ constructor_from_str(String s) {
82                 number ret = bindings.SignedRawInvoice_from_str(s);
83                 Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
84                 return ret_hu_conv;
85         }
86
87         public String to_str() {
88                 String ret = bindings.SignedRawInvoice_to_str(this.ptr);
89                 return ret;
90         }
91
92 }