X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fbindings.ts;fp=ts%2Fbindings.ts;h=efa5422f02f7fd2dfa8ea7a2dd1e6ade04f9202c;hb=a3b773365e6ff5622cca25de409ceaa5a8ba69fe;hp=326a84e2a0e4bd9915fb80d20c202fa1ba365c80;hpb=7df17e5d4ad0db3c9837301acd9062ba500e2218;p=ldk-java diff --git a/ts/bindings.ts b/ts/bindings.ts index 326a84e2..efa5422f 100644 --- a/ts/bindings.ts +++ b/ts/bindings.ts @@ -352,6 +352,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); @@ -2242,6 +2245,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) { @@ -10170,12 +10197,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 +11197,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 +11229,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 +11285,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 +11325,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 +11357,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 +11613,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);