Update auto-generated bindings to 0.0.103
[ldk-java] / ts / structs / UtilMethods.ts
1         public static Result_StringErrorZ constructor_sign(Uint8Array msg, Uint8Array sk) {
2                 number ret = bindings.sign(msg, sk);
3                 Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
4                 return ret_hu_conv;
5         }
6
7         public static Result_PublicKeyErrorZ constructor_recover_pk(Uint8Array msg, String sig) {
8                 number ret = bindings.recover_pk(msg, sig);
9                 Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
10                 return ret_hu_conv;
11         }
12
13         public static boolean constructor_verify(Uint8Array msg, String sig, Uint8Array pk) {
14                 boolean ret = bindings.verify(msg, sig, pk);
15                 return ret;
16         }
17
18         public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ constructor_C2Tuple_BlockHashChannelMonitorZ_read(Uint8Array ser, KeysInterface arg) {
19                 number ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg == null ? 0 : arg.ptr);
20                 Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
21                 ret_hu_conv.ptrs_to.add(arg);
22                 return ret_hu_conv;
23         }
24
25         public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor_C2Tuple_BlockHashChannelManagerZ_read(Uint8Array ser, KeysInterface arg_keys_manager, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) {
26                 number ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr & ~1, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).map(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr & ~1).toArray(number[]::new) : null));
27                 Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
28                 ret_hu_conv.ptrs_to.add(arg_keys_manager);
29                 ret_hu_conv.ptrs_to.add(arg_fee_estimator);
30                 ret_hu_conv.ptrs_to.add(arg_chain_monitor);
31                 ret_hu_conv.ptrs_to.add(arg_tx_broadcaster);
32                 ret_hu_conv.ptrs_to.add(arg_logger);
33                 ;
34                 for (ChannelMonitor arg_channel_monitors_conv_16: arg_channel_monitors) { ret_hu_conv.ptrs_to.add(arg_channel_monitors_conv_16); };
35                 return ret_hu_conv;
36         }
37
38         public static Uint8Array constructor_build_commitment_secret(Uint8Array commitment_seed, number idx) {
39                 Uint8Array ret = bindings.build_commitment_secret(commitment_seed, idx);
40                 return ret;
41         }
42
43         public static Uint8Array constructor_build_closing_transaction(number to_holder_value_sat, number to_counterparty_value_sat, Uint8Array to_holder_script, Uint8Array to_counterparty_script, OutPoint funding_outpoint) {
44                 Uint8Array ret = bindings.build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script, to_counterparty_script, funding_outpoint == null ? 0 : funding_outpoint.ptr & ~1);
45                 return ret;
46         }
47
48         public static Result_SecretKeyErrorZ constructor_derive_private_key(Uint8Array per_commitment_point, Uint8Array base_secret) {
49                 number ret = bindings.derive_private_key(per_commitment_point, base_secret);
50                 Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
51                 return ret_hu_conv;
52         }
53
54         public static Result_PublicKeyErrorZ constructor_derive_public_key(Uint8Array per_commitment_point, Uint8Array base_point) {
55                 number ret = bindings.derive_public_key(per_commitment_point, base_point);
56                 Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
57                 return ret_hu_conv;
58         }
59
60         public static Result_SecretKeyErrorZ constructor_derive_private_revocation_key(Uint8Array per_commitment_secret, Uint8Array countersignatory_revocation_base_secret) {
61                 number ret = bindings.derive_private_revocation_key(per_commitment_secret, countersignatory_revocation_base_secret);
62                 Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
63                 return ret_hu_conv;
64         }
65
66         public static Result_PublicKeyErrorZ constructor_derive_public_revocation_key(Uint8Array per_commitment_point, Uint8Array countersignatory_revocation_base_point) {
67                 number ret = bindings.derive_public_revocation_key(per_commitment_point, countersignatory_revocation_base_point);
68                 Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
69                 return ret_hu_conv;
70         }
71
72         public static Uint8Array constructor_get_revokeable_redeemscript(Uint8Array revocation_key, number contest_delay, Uint8Array broadcaster_delayed_payment_key) {
73                 Uint8Array ret = bindings.get_revokeable_redeemscript(revocation_key, contest_delay, broadcaster_delayed_payment_key);
74                 return ret;
75         }
76
77         public static Uint8Array constructor_get_htlc_redeemscript(HTLCOutputInCommitment htlc, TxCreationKeys keys) {
78                 Uint8Array ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr & ~1, keys == null ? 0 : keys.ptr & ~1);
79                 // this.ptrs_to.add(htlc);
80                 // this.ptrs_to.add(keys);
81                 return ret;
82         }
83
84         public static Uint8Array constructor_make_funding_redeemscript(Uint8Array broadcaster, Uint8Array countersignatory) {
85                 Uint8Array ret = bindings.make_funding_redeemscript(broadcaster, countersignatory);
86                 return ret;
87         }
88
89         public static Uint8Array constructor_build_htlc_transaction(Uint8Array commitment_txid, number feerate_per_kw, number contest_delay, HTLCOutputInCommitment htlc, Uint8Array broadcaster_delayed_payment_key, Uint8Array revocation_key) {
90                 Uint8Array ret = bindings.build_htlc_transaction(commitment_txid, feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr & ~1, broadcaster_delayed_payment_key, revocation_key);
91                 // this.ptrs_to.add(htlc);
92                 return ret;
93         }
94
95         public static number constructor_get_commitment_transaction_number_obscure_factor(Uint8Array broadcaster_payment_basepoint, Uint8Array countersignatory_payment_basepoint, boolean outbound_from_broadcaster) {
96                 number ret = bindings.get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint, countersignatory_payment_basepoint, outbound_from_broadcaster);
97                 return ret;
98         }
99
100         public static Result_RouteLightningErrorZ constructor_find_route(Uint8Array our_node_pubkey, RouteParameters params, NetworkGraph network, ChannelDetails[] first_hops, Logger logger, Score scorer) {
101                 number ret = bindings.find_route(our_node_pubkey, params == null ? 0 : params.ptr & ~1, network == null ? 0 : network.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new) : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr);
102                 Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
103                 ret_hu_conv.ptrs_to.add(params);
104                 ret_hu_conv.ptrs_to.add(network);
105                 for (ChannelDetails first_hops_conv_16: first_hops) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); };
106                 ret_hu_conv.ptrs_to.add(logger);
107                 ret_hu_conv.ptrs_to.add(scorer);
108                 return ret_hu_conv;
109         }
110
111         public static Result_NoneErrorZ constructor_FilesystemPersister_persist_manager(String data_dir, ChannelManager manager) {
112                 number ret = bindings.FilesystemPersister_persist_manager(data_dir, manager == null ? 0 : manager.ptr & ~1);
113                 Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
114                 ret_hu_conv.ptrs_to.add(manager);
115                 return ret_hu_conv;
116         }
117
118         public static Result_InvoiceSignOrCreationErrorZ constructor_create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, Currency network, Option_u64Z amt_msat, String description) {
119                 number ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description);
120                 Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
121                 ret_hu_conv.ptrs_to.add(channelmanager);
122                 ret_hu_conv.ptrs_to.add(keys_manager);
123                 return ret_hu_conv;
124         }
125