f moar test
[ldk-java] / ts / bindings.ts
index 326a84e2a0e4bd9915fb80d20c202fa1ba365c80..6de31bc407a786b2fae11a1f6e76d76a66b057f8 100644 (file)
@@ -317,6 +317,11 @@ public static native long new_empty_slice_vec();
                        public number msg;
                        SendShortIdsQuery(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; }
                }
+               export class SendReplyChannelRange extends LDKMessageSendEvent {
+                       public Uint8Array node_id;
+                       public number msg;
+                       SendReplyChannelRange(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; }
+               }
                static native void init();
        }
        static { LDKMessageSendEvent.init(); }
@@ -352,6 +357,9 @@ public static native long new_empty_slice_vec();
        public static native boolean LDKCResult_ChannelFeaturesDecodeErrorZ_result_ok(long arg);
        public static native number LDKCResult_ChannelFeaturesDecodeErrorZ_get_ok(long arg);
        public static native number LDKCResult_ChannelFeaturesDecodeErrorZ_get_err(long arg);
+       public static native boolean LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(long arg);
+       public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(long arg);
+       public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(long arg);
        public static native boolean LDKCResult_ChannelConfigDecodeErrorZ_result_ok(long arg);
        public static native number LDKCResult_ChannelConfigDecodeErrorZ_get_ok(long arg);
        public static native number LDKCResult_ChannelConfigDecodeErrorZ_get_err(long arg);
@@ -1211,6 +1219,7 @@ public static native long new_empty_slice_vec();
                        peer_disconnected (their_node_id: Uint8Array, no_connection_possible: boolean): void;
                        peer_connected (their_node_id: Uint8Array, msg: number): void;
                        handle_channel_reestablish (their_node_id: Uint8Array, msg: number): void;
+                       handle_channel_update (their_node_id: Uint8Array, msg: number): void;
                        handle_error (their_node_id: Uint8Array, msg: number): void;
                }
 
@@ -1365,6 +1374,14 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelMessageHandler_handle_channel_reestablish(this_arg, encodeArray(their_node_id), msg);
                // debug statements here
        }
+       // void ChannelMessageHandler_handle_channel_update LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg
+       export function ChannelMessageHandler_handle_channel_update(this_arg: number, their_node_id: Uint8Array, msg: number): void {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ChannelMessageHandler_handle_channel_update(this_arg, encodeArray(their_node_id), msg);
+               // debug statements here
+       }
        // void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg
        export function ChannelMessageHandler_handle_error(this_arg: number, their_node_id: Uint8Array, msg: number): void {
                if(!isWasmInitialized) {
@@ -2242,6 +2259,30 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.CResult_ChannelFeaturesDecodeErrorZ_free(_res);
                // debug statements here
        }
+       // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
+       export function CResult_InvoiceFeaturesDecodeErrorZ_ok(o: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_ok(o);
+               return nativeResponseValue;
+       }
+       // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+       export function CResult_InvoiceFeaturesDecodeErrorZ_err(e: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_err(e);
+               return nativeResponseValue;
+       }
+       // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
+       export function CResult_InvoiceFeaturesDecodeErrorZ_free(_res: number): void {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_free(_res);
+               // debug statements here
+       }
        // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
        export function CResult_ChannelConfigDecodeErrorZ_ok(o: number): number {
                if(!isWasmInitialized) {
@@ -4866,6 +4907,22 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelConfig_set_fee_proportional_millionths(this_ptr, val);
                // debug statements here
        }
+       // uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+       export function ChannelConfig_get_cltv_expiry_delta(this_ptr: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ChannelConfig_get_cltv_expiry_delta(this_ptr);
+               return nativeResponseValue;
+       }
+       // void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
+       export function ChannelConfig_set_cltv_expiry_delta(this_ptr: number, val: number): void {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ChannelConfig_set_cltv_expiry_delta(this_ptr, val);
+               // debug statements here
+       }
        // bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
        export function ChannelConfig_get_announced_channel(this_ptr: number): boolean {
                if(!isWasmInitialized) {
@@ -4898,12 +4955,12 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr, val);
                // debug statements here
        }
-       // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
-       export function ChannelConfig_new(fee_proportional_millionths_arg: number, announced_channel_arg: boolean, commit_upfront_shutdown_pubkey_arg: boolean): number {
+       // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
+       export function ChannelConfig_new(fee_proportional_millionths_arg: number, cltv_expiry_delta_arg: number, announced_channel_arg: boolean, commit_upfront_shutdown_pubkey_arg: boolean): number {
                if(!isWasmInitialized) {
                        throw new Error("initializeWasm() must be awaited first!");
                }
-               const nativeResponseValue = wasm.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+               const nativeResponseValue = wasm.ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
                return nativeResponseValue;
        }
        // struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
@@ -9874,6 +9931,14 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_write(obj);
                return decodeArray(nativeResponseValue);
        }
+       // MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
+       export function QueryChannelRange_end_blocknum(this_arg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.QueryChannelRange_end_blocknum(this_arg);
+               return nativeResponseValue;
+       }
        // struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
        export function QueryChannelRange_read(ser: Uint8Array): number {
                if(!isWasmInitialized) {
@@ -10170,12 +10235,12 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.PeerManager_disconnect_by_node_id(this_arg, encodeArray(node_id), no_connection_possible);
                // debug statements here
        }
-       // void PeerManager_timer_tick_occured(const struct LDKPeerManager *NONNULL_PTR this_arg);
-       export function PeerManager_timer_tick_occured(this_arg: number): void {
+       // void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
+       export function PeerManager_timer_tick_occurred(this_arg: number): void {
                if(!isWasmInitialized) {
                        throw new Error("initializeWasm() must be awaited first!");
                }
-               const nativeResponseValue = wasm.PeerManager_timer_tick_occured(this_arg);
+               const nativeResponseValue = wasm.PeerManager_timer_tick_occurred(this_arg);
                // debug statements here
        }
        // struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
@@ -11170,6 +11235,14 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelFeatures_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
+       export function InvoiceFeatures_clone(orig: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.InvoiceFeatures_clone(orig);
+               return nativeResponseValue;
+       }
        // void InitFeatures_free(struct LDKInitFeatures this_obj);
        export function InitFeatures_free(this_obj: number): void {
                if(!isWasmInitialized) {
@@ -11194,6 +11267,14 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelFeatures_free(this_obj);
                // debug statements here
        }
+       // void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
+       export function InvoiceFeatures_free(this_obj: number): void {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.InvoiceFeatures_free(this_obj);
+               // debug statements here
+       }
        // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
        export function InitFeatures_empty(): number {
                if(!isWasmInitialized) {
@@ -11242,6 +11323,22 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelFeatures_known();
                return nativeResponseValue;
        }
+       // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
+       export function InvoiceFeatures_empty(): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.InvoiceFeatures_empty();
+               return nativeResponseValue;
+       }
+       // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
+       export function InvoiceFeatures_known(): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.InvoiceFeatures_known();
+               return nativeResponseValue;
+       }
        // struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
        export function InitFeatures_write(obj: number): Uint8Array {
                if(!isWasmInitialized) {
@@ -11266,6 +11363,14 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelFeatures_write(obj);
                return decodeArray(nativeResponseValue);
        }
+       // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
+       export function InvoiceFeatures_write(obj: number): Uint8Array {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.InvoiceFeatures_write(obj);
+               return decodeArray(nativeResponseValue);
+       }
        // struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
        export function InitFeatures_read(ser: Uint8Array): number {
                if(!isWasmInitialized) {
@@ -11290,6 +11395,14 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelFeatures_read(encodeArray(ser));
                return nativeResponseValue;
        }
+       // struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
+       export function InvoiceFeatures_read(ser: Uint8Array): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.InvoiceFeatures_read(encodeArray(ser));
+               return nativeResponseValue;
+       }
        // void RouteHop_free(struct LDKRouteHop this_obj);
        export function RouteHop_free(this_obj: number): void {
                if(!isWasmInitialized) {
@@ -11538,12 +11651,12 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.RouteHint_clone(orig);
                return nativeResponseValue;
        }
-       // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
-       export function get_route(our_node_id: Uint8Array, network: number, payee: Uint8Array, first_hops: number[], last_hops: number[], final_value_msat: number, final_cltv: number, logger: number): number {
+       // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
+       export function get_route(our_node_id: Uint8Array, network: number, payee: Uint8Array, payee_features: number, first_hops: number[], last_hops: number[], final_value_msat: number, final_cltv: number, logger: number): number {
                if(!isWasmInitialized) {
                        throw new Error("initializeWasm() must be awaited first!");
                }
-               const nativeResponseValue = wasm.get_route(encodeArray(our_node_id), network, encodeArray(payee), first_hops, last_hops, final_value_msat, final_cltv, logger);
+               const nativeResponseValue = wasm.get_route(encodeArray(our_node_id), network, encodeArray(payee), payee_features, first_hops, last_hops, final_value_msat, final_cltv, logger);
                return nativeResponseValue;
        }
        // void NetworkGraph_free(struct LDKNetworkGraph this_obj);