X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=ts%2Fbindings.ts;h=d936b46e0b74b4819deaafec1c19f8c4b576fd86;hb=cc8b92921f3e342cdfb0ceb070cee2b742371aea;hp=055daec02ed2d9225ea6fa2115f2209d5cb0429c;hpb=348009c7987109e810e7e31db6110fb71879fbc3;p=ldk-java diff --git a/ts/bindings.ts b/ts/bindings.ts index 055daec0..d936b46e 100644 --- a/ts/bindings.ts +++ b/ts/bindings.ts @@ -152,6 +152,22 @@ public static native long new_empty_slice_vec(); */ public static native long LDKCVec_u8Z_new(number[] elems); + // struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) + export function TxOut_get_script_pubkey(thing: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TxOut_get_script_pubkey(thing); + return decodeArray(nativeResponseValue); + } + // uint64_t TxOut_get_value (struct LDKTxOut* thing) + export function TxOut_get_value(thing: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TxOut_get_value(thing); + return nativeResponseValue; + } public static native boolean LDKCResult_SecretKeyErrorZ_result_ok(long arg); public static native Uint8Array LDKCResult_SecretKeyErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_SecretKeyErrorZ_get_err(long arg); @@ -204,6 +220,12 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_CVec_SignatureZNoneZ_result_ok(long arg); public static native Uint8Array[] LDKCResult_CVec_SignatureZNoneZ_get_ok(long arg); public static native void LDKCResult_CVec_SignatureZNoneZ_get_err(long arg); + public static native boolean LDKCResult_ShutdownScriptDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_ShutdownScriptDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ShutdownScriptDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(long arg); + public static native number LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(long arg); + public static native number LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_err(long arg); public static native boolean LDKCResult_NoneErrorZ_result_ok(long arg); public static native void LDKCResult_NoneErrorZ_get_ok(long arg); public static native IOError LDKCResult_NoneErrorZ_get_err(long arg); @@ -669,6 +691,10 @@ public static native long new_empty_slice_vec(); export class MonitorUpdateFailed extends LDKAPIError { MonitorUpdateFailed() { } } + export class IncompatibleShutdownScript extends LDKAPIError { + public number script; + IncompatibleShutdownScript(number script) { this.script = script; } + } static native void init(); } static { LDKAPIError.init(); } @@ -703,6 +729,9 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg); public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg); public static native number LDKCResult_NonePaymentSendFailureZ_get_err(long arg); + public static native boolean LDKCResult_PaymentHashPaymentSendFailureZ_result_ok(long arg); + public static native Uint8Array LDKCResult_PaymentHashPaymentSendFailureZ_get_ok(long arg); + public static native number LDKCResult_PaymentHashPaymentSendFailureZ_get_err(long arg); public static class LDKNetAddress { private LDKNetAddress() {} export class IPv4 extends LDKNetAddress { @@ -813,7 +842,7 @@ public static native long new_empty_slice_vec(); export interface LDKKeysInterface { get_node_secret (): Uint8Array; get_destination_script (): Uint8Array; - get_shutdown_pubkey (): Uint8Array; + get_shutdown_scriptpubkey (): number; get_channel_signer (inbound: boolean, channel_value_satoshis: number): number; get_secure_random_bytes (): Uint8Array; read_chan_signer (reader: Uint8Array): number; @@ -843,13 +872,13 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.KeysInterface_get_destination_script(this_arg); return decodeArray(nativeResponseValue); } - // LDKPublicKey KeysInterface_get_shutdown_pubkey LDKKeysInterface *NONNULL_PTR this_arg - export function KeysInterface_get_shutdown_pubkey(this_arg: number): Uint8Array { + // LDKShutdownScript KeysInterface_get_shutdown_scriptpubkey LDKKeysInterface *NONNULL_PTR this_arg + export function KeysInterface_get_shutdown_scriptpubkey(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.KeysInterface_get_shutdown_pubkey(this_arg); - return decodeArray(nativeResponseValue); + const nativeResponseValue = wasm.KeysInterface_get_shutdown_scriptpubkey(this_arg); + return nativeResponseValue; } // LDKSign KeysInterface_get_channel_signer LDKKeysInterface *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis export function KeysInterface_get_channel_signer(this_arg: number, inbound: boolean, channel_value_satoshis: number): number { @@ -993,6 +1022,22 @@ public static native long new_empty_slice_vec(); public static native Uint8Array LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(long ptr); public static native number[] LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(long ptr); public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(number[] elems); + public static class LDKPaymentPurpose { + private LDKPaymentPurpose() {} + export class InvoicePayment extends LDKPaymentPurpose { + public Uint8Array payment_preimage; + public Uint8Array payment_secret; + public number user_payment_id; + InvoicePayment(Uint8Array payment_preimage, Uint8Array payment_secret, number user_payment_id) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.user_payment_id = user_payment_id; } + } + export class SpontaneousPayment extends LDKPaymentPurpose { + public Uint8Array spontaneous_payment; + SpontaneousPayment(Uint8Array spontaneous_payment) { this.spontaneous_payment = spontaneous_payment; } + } + static native void init(); + } + static { LDKPaymentPurpose.init(); } + public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr); public static class LDKEvent { private LDKEvent() {} export class FundingGenerationReady extends LDKEvent { @@ -1004,11 +1049,9 @@ public static native long new_empty_slice_vec(); } export class PaymentReceived extends LDKEvent { public Uint8Array payment_hash; - public Uint8Array payment_preimage; - public Uint8Array payment_secret; public number amt; - public number user_payment_id; - PaymentReceived(Uint8Array payment_hash, Uint8Array payment_preimage, Uint8Array payment_secret, number amt, number user_payment_id) { this.payment_hash = payment_hash; this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.amt = amt; this.user_payment_id = user_payment_id; } + public number purpose; + PaymentReceived(Uint8Array payment_hash, number amt, number purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; } } export class PaymentSent extends LDKEvent { public Uint8Array payment_preimage; @@ -1027,6 +1070,11 @@ public static native long new_empty_slice_vec(); public number[] outputs; SpendableOutputs(number[] outputs) { this.outputs = outputs; } } + export class PaymentForwarded extends LDKEvent { + public number fee_earned_msat; + public boolean claim_from_onchain_tx; + PaymentForwarded(number fee_earned_msat, boolean claim_from_onchain_tx) { this.fee_earned_msat = fee_earned_msat; this.claim_from_onchain_tx = claim_from_onchain_tx; } + } static native void init(); } static { LDKEvent.init(); } @@ -1108,6 +1156,9 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_ClosingSignedDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_ClosingSignedDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_ClosingSignedDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_CommitmentSignedDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_CommitmentSignedDecodeErrorZ_get_err(long arg); @@ -1870,6 +1921,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Transaction_free(encodeArray(_res)); // debug statements here } + // struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value); + export function TxOut_new(script_pubkey: Uint8Array, value: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TxOut_new(encodeArray(script_pubkey), value); + return nativeResponseValue; + } // void TxOut_free(struct LDKTxOut _res); export function TxOut_free(_res: number): void { if(!isWasmInitialized) { @@ -2334,6 +2393,62 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_SignatureZNoneZ_clone(orig); return nativeResponseValue; } + // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o); + export function CResult_ShutdownScriptDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_ShutdownScriptDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res); + export function CResult_ShutdownScriptDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptDecodeErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig); + export function CResult_ShutdownScriptDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o); + export function CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e); + export function CResult_ShutdownScriptInvalidShutdownScriptZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e); + return nativeResponseValue; + } + // void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res); + export function CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res); + // debug statements here + } // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void); export function CResult_NoneErrorZ_ok(): number { if(!isWasmInitialized) { @@ -3310,6 +3425,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NonePaymentSendFailureZ_clone(orig); return nativeResponseValue; } + // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o); + export function CResult_PaymentHashPaymentSendFailureZ_ok(o: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentHashPaymentSendFailureZ_ok(encodeArray(o)); + return nativeResponseValue; + } + // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); + export function CResult_PaymentHashPaymentSendFailureZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentHashPaymentSendFailureZ_err(e); + return nativeResponseValue; + } + // void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res); + export function CResult_PaymentHashPaymentSendFailureZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentHashPaymentSendFailureZ_free(_res); + // debug statements here + } + // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig); + export function CResult_PaymentHashPaymentSendFailureZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentHashPaymentSendFailureZ_clone(orig); + return nativeResponseValue; + } // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); export function CVec_NetAddressZ_free(_res: number[]): void { if(!isWasmInitialized) { @@ -4814,6 +4961,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ClosingSignedDecodeErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o); + export function CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res); + export function CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig); + export function CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig); + return nativeResponseValue; + } // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o); export function CResult_CommitmentSignedDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { @@ -5710,276 +5889,612 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceSignOrCreationErrorZ_clone(orig); return nativeResponseValue; } - // void Event_free(struct LDKEvent this_ptr); - export function Event_free(this_ptr: number): void { + // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); + export function PaymentPurpose_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Event_free(this_ptr); + const nativeResponseValue = wasm.PaymentPurpose_free(this_ptr); // debug statements here } - // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); - export function Event_clone(orig: number): number { + // struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig); + export function PaymentPurpose_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Event_clone(orig); + const nativeResponseValue = wasm.PaymentPurpose_clone(orig); return nativeResponseValue; } - // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); - export function Event_write(obj: number): Uint8Array { + // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t user_payment_id); + export function PaymentPurpose_invoice_payment(payment_preimage: Uint8Array, payment_secret: Uint8Array, user_payment_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Event_write(obj); - return decodeArray(nativeResponseValue); + const nativeResponseValue = wasm.PaymentPurpose_invoice_payment(encodeArray(payment_preimage), encodeArray(payment_secret), user_payment_id); + return nativeResponseValue; } - // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); - export function MessageSendEvent_free(this_ptr: number): void { + // struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a); + export function PaymentPurpose_spontaneous_payment(a: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.MessageSendEvent_free(this_ptr); + const nativeResponseValue = wasm.PaymentPurpose_spontaneous_payment(encodeArray(a)); + return nativeResponseValue; + } + // void Event_free(struct LDKEvent this_ptr); + export function Event_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Event_free(this_ptr); // debug statements here } - // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); - export function MessageSendEvent_clone(orig: number): number { + // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); + export function Event_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.MessageSendEvent_clone(orig); + const nativeResponseValue = wasm.Event_clone(orig); return nativeResponseValue; } - // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr); - export function MessageSendEventsProvider_free(this_ptr: number): void { + // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id); + export function Event_funding_generation_ready(temporary_channel_id: Uint8Array, channel_value_satoshis: number, output_script: Uint8Array, user_channel_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.MessageSendEventsProvider_free(this_ptr); - // debug statements here + const nativeResponseValue = wasm.Event_funding_generation_ready(encodeArray(temporary_channel_id), channel_value_satoshis, encodeArray(output_script), user_channel_id); + return nativeResponseValue; } - // void EventsProvider_free(struct LDKEventsProvider this_ptr); - export function EventsProvider_free(this_ptr: number): void { + // struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose); + export function Event_payment_received(payment_hash: Uint8Array, amt: number, purpose: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.EventsProvider_free(this_ptr); - // debug statements here + const nativeResponseValue = wasm.Event_payment_received(encodeArray(payment_hash), amt, purpose); + return nativeResponseValue; } - // void EventHandler_free(struct LDKEventHandler this_ptr); - export function EventHandler_free(this_ptr: number): void { + // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage); + export function Event_payment_sent(payment_preimage: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.EventHandler_free(this_ptr); - // debug statements here + const nativeResponseValue = wasm.Event_payment_sent(encodeArray(payment_preimage)); + return nativeResponseValue; } - // void APIError_free(struct LDKAPIError this_ptr); - export function APIError_free(this_ptr: number): void { + // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest); + export function Event_payment_failed(payment_hash: Uint8Array, rejected_by_dest: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.APIError_free(this_ptr); - // debug statements here + const nativeResponseValue = wasm.Event_payment_failed(encodeArray(payment_hash), rejected_by_dest); + return nativeResponseValue; } - // struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig); - export function APIError_clone(orig: number): number { + // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable); + export function Event_pending_htlcs_forwardable(time_forwardable: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.APIError_clone(orig); + const nativeResponseValue = wasm.Event_pending_htlcs_forwardable(time_forwardable); return nativeResponseValue; } - // struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); - export function sign(msg: Uint8Array, sk: Uint8Array): number { + // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs); + export function Event_spendable_outputs(outputs: number[]): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.sign(encodeArray(msg), encodeArray(sk)); + const nativeResponseValue = wasm.Event_spendable_outputs(outputs); return nativeResponseValue; } - // struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig); - export function recover_pk(msg: Uint8Array, sig: String): number { + // struct LDKEvent Event_payment_forwarded(struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx); + export function Event_payment_forwarded(fee_earned_msat: number, claim_from_onchain_tx: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.recover_pk(encodeArray(msg), sig); + const nativeResponseValue = wasm.Event_payment_forwarded(fee_earned_msat, claim_from_onchain_tx); return nativeResponseValue; } - // bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk); - export function verify(msg: Uint8Array, sig: String, pk: Uint8Array): boolean { + // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); + export function Event_write(obj: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.verify(encodeArray(msg), sig, encodeArray(pk)); - return nativeResponseValue; + const nativeResponseValue = wasm.Event_write(obj); + return decodeArray(nativeResponseValue); } - // enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig); - export function Level_clone(orig: number): Level { + // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); + export function MessageSendEvent_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Level_clone(orig); - return nativeResponseValue; + const nativeResponseValue = wasm.MessageSendEvent_free(this_ptr); + // debug statements here } - // bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b); - export function Level_eq(a: number, b: number): boolean { + // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); + export function MessageSendEvent_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Level_eq(a, b); + const nativeResponseValue = wasm.MessageSendEvent_clone(orig); return nativeResponseValue; } - // uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o); - export function Level_hash(o: number): number { + // struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg); + export function MessageSendEvent_send_accept_channel(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Level_hash(o); + const nativeResponseValue = wasm.MessageSendEvent_send_accept_channel(encodeArray(node_id), msg); return nativeResponseValue; } - // MUST_USE_RES enum LDKLevel Level_max(void); - export function Level_max(): Level { + // struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg); + export function MessageSendEvent_send_open_channel(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Level_max(); + const nativeResponseValue = wasm.MessageSendEvent_send_open_channel(encodeArray(node_id), msg); return nativeResponseValue; } - // void Logger_free(struct LDKLogger this_ptr); - export function Logger_free(this_ptr: number): void { + // struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg); + export function MessageSendEvent_send_funding_created(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Logger_free(this_ptr); - // debug statements here + const nativeResponseValue = wasm.MessageSendEvent_send_funding_created(encodeArray(node_id), msg); + return nativeResponseValue; } - // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj); - export function ChannelHandshakeConfig_free(this_obj: number): void { + // struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg); + export function MessageSendEvent_send_funding_signed(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_free(this_obj); - // debug statements here + const nativeResponseValue = wasm.MessageSendEvent_send_funding_signed(encodeArray(node_id), msg); + return nativeResponseValue; } - // uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); - export function ChannelHandshakeConfig_get_minimum_depth(this_ptr: number): number { + // struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg); + export function MessageSendEvent_send_funding_locked(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_get_minimum_depth(this_ptr); + const nativeResponseValue = wasm.MessageSendEvent_send_funding_locked(encodeArray(node_id), msg); return nativeResponseValue; } - // void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val); - export function ChannelHandshakeConfig_set_minimum_depth(this_ptr: number, val: number): void { + // struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg); + export function MessageSendEvent_send_announcement_signatures(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_set_minimum_depth(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.MessageSendEvent_send_announcement_signatures(encodeArray(node_id), msg); + return nativeResponseValue; } - // uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); - export function ChannelHandshakeConfig_get_our_to_self_delay(this_ptr: number): number { + // struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates); + export function MessageSendEvent_update_htlcs(node_id: Uint8Array, updates: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_get_our_to_self_delay(this_ptr); + const nativeResponseValue = wasm.MessageSendEvent_update_htlcs(encodeArray(node_id), updates); return nativeResponseValue; } - // void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val); - export function ChannelHandshakeConfig_set_our_to_self_delay(this_ptr: number, val: number): void { + // struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg); + export function MessageSendEvent_send_revoke_and_ack(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_set_our_to_self_delay(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.MessageSendEvent_send_revoke_and_ack(encodeArray(node_id), msg); + return nativeResponseValue; } - // uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); - export function ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr: number): number { + // struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg); + export function MessageSendEvent_send_closing_signed(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr); + const nativeResponseValue = wasm.MessageSendEvent_send_closing_signed(encodeArray(node_id), msg); return nativeResponseValue; } - // void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val); - export function ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr: number, val: number): void { + // struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg); + export function MessageSendEvent_send_shutdown(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.MessageSendEvent_send_shutdown(encodeArray(node_id), msg); + return nativeResponseValue; } - // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg); - export function ChannelHandshakeConfig_new(minimum_depth_arg: number, our_to_self_delay_arg: number, our_htlc_minimum_msat_arg: number): number { + // struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg); + export function MessageSendEvent_send_channel_reestablish(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); + const nativeResponseValue = wasm.MessageSendEvent_send_channel_reestablish(encodeArray(node_id), msg); return nativeResponseValue; } - // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); - export function ChannelHandshakeConfig_clone(orig: number): number { + // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg); + export function MessageSendEvent_broadcast_channel_announcement(msg: number, update_msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_clone(orig); + const nativeResponseValue = wasm.MessageSendEvent_broadcast_channel_announcement(msg, update_msg); return nativeResponseValue; } - // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); - export function ChannelHandshakeConfig_default(): number { + // struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg); + export function MessageSendEvent_broadcast_node_announcement(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeConfig_default(); + const nativeResponseValue = wasm.MessageSendEvent_broadcast_node_announcement(msg); return nativeResponseValue; } - // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj); - export function ChannelHandshakeLimits_free(this_obj: number): void { + // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg); + export function MessageSendEvent_broadcast_channel_update(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeLimits_free(this_obj); - // debug statements here + const nativeResponseValue = wasm.MessageSendEvent_broadcast_channel_update(msg); + return nativeResponseValue; } - // uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - export function ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr: number): number { + // struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg); + export function MessageSendEvent_send_channel_update(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr); + const nativeResponseValue = wasm.MessageSendEvent_send_channel_update(encodeArray(node_id), msg); return nativeResponseValue; } - // void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); - export function ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr: number, val: number): void { + // struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action); + export function MessageSendEvent_handle_error(node_id: Uint8Array, action: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.MessageSendEvent_handle_error(encodeArray(node_id), action); + return nativeResponseValue; } - // uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - export function ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr: number): number { + // struct LDKMessageSendEvent MessageSendEvent_payment_failure_network_update(struct LDKHTLCFailChannelUpdate update); + export function MessageSendEvent_payment_failure_network_update(update: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr); + const nativeResponseValue = wasm.MessageSendEvent_payment_failure_network_update(update); return nativeResponseValue; } - // void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); - export function ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr: number, val: number): void { + // struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg); + export function MessageSendEvent_send_channel_range_query(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.MessageSendEvent_send_channel_range_query(encodeArray(node_id), msg); + return nativeResponseValue; } - // uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - export function ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr: number): number { + // struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg); + export function MessageSendEvent_send_short_ids_query(node_id: Uint8Array, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr); + const nativeResponseValue = wasm.MessageSendEvent_send_short_ids_query(encodeArray(node_id), msg); + return nativeResponseValue; + } + // struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg); + export function MessageSendEvent_send_reply_channel_range(node_id: Uint8Array, msg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MessageSendEvent_send_reply_channel_range(encodeArray(node_id), msg); + return nativeResponseValue; + } + // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr); + export function MessageSendEventsProvider_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MessageSendEventsProvider_free(this_ptr); + // debug statements here + } + // void EventsProvider_free(struct LDKEventsProvider this_ptr); + export function EventsProvider_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.EventsProvider_free(this_ptr); + // debug statements here + } + // void EventHandler_free(struct LDKEventHandler this_ptr); + export function EventHandler_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.EventHandler_free(this_ptr); + // debug statements here + } + // void APIError_free(struct LDKAPIError this_ptr); + export function APIError_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_free(this_ptr); + // debug statements here + } + // struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig); + export function APIError_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_clone(orig); + return nativeResponseValue; + } + // struct LDKAPIError APIError_apimisuse_error(struct LDKStr err); + export function APIError_apimisuse_error(err: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_apimisuse_error(err); + return nativeResponseValue; + } + // struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate); + export function APIError_fee_rate_too_high(err: String, feerate: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_fee_rate_too_high(err, feerate); + return nativeResponseValue; + } + // struct LDKAPIError APIError_route_error(struct LDKStr err); + export function APIError_route_error(err: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_route_error(err); + return nativeResponseValue; + } + // struct LDKAPIError APIError_channel_unavailable(struct LDKStr err); + export function APIError_channel_unavailable(err: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_channel_unavailable(err); + return nativeResponseValue; + } + // struct LDKAPIError APIError_monitor_update_failed(void); + export function APIError_monitor_update_failed(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_monitor_update_failed(); + return nativeResponseValue; + } + // struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script); + export function APIError_incompatible_shutdown_script(script: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.APIError_incompatible_shutdown_script(script); + return nativeResponseValue; + } + // struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); + export function sign(msg: Uint8Array, sk: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.sign(encodeArray(msg), encodeArray(sk)); + return nativeResponseValue; + } + // struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig); + export function recover_pk(msg: Uint8Array, sig: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.recover_pk(encodeArray(msg), sig); + return nativeResponseValue; + } + // bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk); + export function verify(msg: Uint8Array, sig: String, pk: Uint8Array): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.verify(encodeArray(msg), sig, encodeArray(pk)); + return nativeResponseValue; + } + // enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig); + export function Level_clone(orig: number): Level { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_clone(orig); + return nativeResponseValue; + } + // enum LDKLevel Level_trace(void); + export function Level_trace(): Level { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_trace(); + return nativeResponseValue; + } + // enum LDKLevel Level_debug(void); + export function Level_debug(): Level { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_debug(); + return nativeResponseValue; + } + // enum LDKLevel Level_info(void); + export function Level_info(): Level { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_info(); + return nativeResponseValue; + } + // enum LDKLevel Level_warn(void); + export function Level_warn(): Level { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_warn(); + return nativeResponseValue; + } + // enum LDKLevel Level_error(void); + export function Level_error(): Level { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_error(); + return nativeResponseValue; + } + // bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b); + export function Level_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_eq(a, b); + return nativeResponseValue; + } + // uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o); + export function Level_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_hash(o); + return nativeResponseValue; + } + // MUST_USE_RES enum LDKLevel Level_max(void); + export function Level_max(): Level { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Level_max(); + return nativeResponseValue; + } + // void Logger_free(struct LDKLogger this_ptr); + export function Logger_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Logger_free(this_ptr); + // debug statements here + } + // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj); + export function ChannelHandshakeConfig_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_free(this_obj); + // debug statements here + } + // uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); + export function ChannelHandshakeConfig_get_minimum_depth(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_get_minimum_depth(this_ptr); + return nativeResponseValue; + } + // void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val); + export function ChannelHandshakeConfig_set_minimum_depth(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_set_minimum_depth(this_ptr, val); + // debug statements here + } + // uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); + export function ChannelHandshakeConfig_get_our_to_self_delay(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_get_our_to_self_delay(this_ptr); + return nativeResponseValue; + } + // void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val); + export function ChannelHandshakeConfig_set_our_to_self_delay(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_set_our_to_self_delay(this_ptr, val); + // debug statements here + } + // uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); + export function ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr); + return nativeResponseValue; + } + // void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val); + export function ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg); + export function ChannelHandshakeConfig_new(minimum_depth_arg: number, our_to_self_delay_arg: number, our_htlc_minimum_msat_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); + return nativeResponseValue; + } + // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); + export function ChannelHandshakeConfig_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_clone(orig); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); + export function ChannelHandshakeConfig_default(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeConfig_default(); + return nativeResponseValue; + } + // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj); + export function ChannelHandshakeLimits_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeLimits_free(this_obj); + // debug statements here + } + // uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); + export function ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr); + return nativeResponseValue; + } + // void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); + export function ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr, val); + // debug statements here + } + // uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); + export function ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr); + return nativeResponseValue; + } + // void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); + export function ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr, val); + // debug statements here + } + // uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); + export function ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr); return nativeResponseValue; } // void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); @@ -6182,12 +6697,44 @@ 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 forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg); - export function ChannelConfig_new(forwarding_fee_proportional_millionths_arg: number, forwarding_fee_base_msat_arg: number, cltv_expiry_delta_arg: number, announced_channel_arg: boolean, commit_upfront_shutdown_pubkey_arg: boolean): number { + // uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr); + export function ChannelConfig_get_max_dust_htlc_exposure_msat(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg); + const nativeResponseValue = wasm.ChannelConfig_get_max_dust_htlc_exposure_msat(this_ptr); + return nativeResponseValue; + } + // void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val); + export function ChannelConfig_set_max_dust_htlc_exposure_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelConfig_set_max_dust_htlc_exposure_msat(this_ptr, val); + // debug statements here + } + // uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr); + export function ChannelConfig_get_force_close_avoidance_max_fee_satoshis(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelConfig_get_force_close_avoidance_max_fee_satoshis(this_ptr); + return nativeResponseValue; + } + // void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val); + export function ChannelConfig_set_force_close_avoidance_max_fee_satoshis(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelConfig_set_force_close_avoidance_max_fee_satoshis(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg); + export function ChannelConfig_new(forwarding_fee_proportional_millionths_arg: number, forwarding_fee_base_msat_arg: number, cltv_expiry_delta_arg: number, announced_channel_arg: boolean, commit_upfront_shutdown_pubkey_arg: boolean, max_dust_htlc_exposure_msat_arg: number, force_close_avoidance_max_fee_satoshis_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); return nativeResponseValue; } // struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); @@ -6374,6 +6921,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.AccessError_clone(orig); return nativeResponseValue; } + // enum LDKAccessError AccessError_unknown_chain(void); + export function AccessError_unknown_chain(): AccessError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.AccessError_unknown_chain(); + return nativeResponseValue; + } + // enum LDKAccessError AccessError_unknown_tx(void); + export function AccessError_unknown_tx(): AccessError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.AccessError_unknown_tx(); + return nativeResponseValue; + } // void Access_free(struct LDKAccess this_ptr); export function Access_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -6510,6 +7073,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ConfirmationTarget_clone(orig); return nativeResponseValue; } + // enum LDKConfirmationTarget ConfirmationTarget_background(void); + export function ConfirmationTarget_background(): ConfirmationTarget { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ConfirmationTarget_background(); + return nativeResponseValue; + } + // enum LDKConfirmationTarget ConfirmationTarget_normal(void); + export function ConfirmationTarget_normal(): ConfirmationTarget { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ConfirmationTarget_normal(); + return nativeResponseValue; + } + // enum LDKConfirmationTarget ConfirmationTarget_high_priority(void); + export function ConfirmationTarget_high_priority(): ConfirmationTarget { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ConfirmationTarget_high_priority(); + return nativeResponseValue; + } + // bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b); + export function ConfirmationTarget_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ConfirmationTarget_eq(a, b); + return nativeResponseValue; + } // void FeeEstimator_free(struct LDKFeeEstimator this_ptr); export function FeeEstimator_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -6622,6 +7217,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMonitorUpdateErr_clone(orig); return nativeResponseValue; } + // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void); + export function ChannelMonitorUpdateErr_temporary_failure(): ChannelMonitorUpdateErr { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdateErr_temporary_failure(); + return nativeResponseValue; + } + // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void); + export function ChannelMonitorUpdateErr_permanent_failure(): ChannelMonitorUpdateErr { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdateErr_permanent_failure(); + return nativeResponseValue; + } // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj); export function MonitorUpdateError_free(this_obj: number): void { if(!isWasmInitialized) { @@ -6654,6 +7265,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MonitorEvent_clone(orig); return nativeResponseValue; } + // struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a); + export function MonitorEvent_htlcevent(a: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorEvent_htlcevent(a); + return nativeResponseValue; + } + // struct LDKMonitorEvent MonitorEvent_commitment_tx_broadcasted(struct LDKOutPoint a); + export function MonitorEvent_commitment_tx_broadcasted(a: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorEvent_commitment_tx_broadcasted(a); + return nativeResponseValue; + } // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj); export function HTLCUpdate_free(this_obj: number): void { if(!isWasmInitialized) { @@ -7198,6 +7825,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SpendableOutputDescriptor_clone(orig); return nativeResponseValue; } + // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output); + export function SpendableOutputDescriptor_static_output(outpoint: number, output: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SpendableOutputDescriptor_static_output(outpoint, output); + return nativeResponseValue; + } + // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a); + export function SpendableOutputDescriptor_delayed_payment_output(a: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SpendableOutputDescriptor_delayed_payment_output(a); + return nativeResponseValue; + } + // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a); + export function SpendableOutputDescriptor_static_payment_output(a: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SpendableOutputDescriptor_static_payment_output(a); + return nativeResponseValue; + } // struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj); export function SpendableOutputDescriptor_write(obj: number): Uint8Array { if(!isWasmInitialized) { @@ -7910,6 +8561,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PaymentSendFailure_clone(orig); return nativeResponseValue; } + // struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a); + export function PaymentSendFailure_parameter_error(a: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentSendFailure_parameter_error(a); + return nativeResponseValue; + } + // struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a); + export function PaymentSendFailure_path_parameter_error(a: number[]): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentSendFailure_path_parameter_error(a); + return nativeResponseValue; + } + // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a); + export function PaymentSendFailure_all_failed_retry_safe(a: number[]): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentSendFailure_all_failed_retry_safe(a); + return nativeResponseValue; + } + // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ a); + export function PaymentSendFailure_partial_failure(a: number[]): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentSendFailure_partial_failure(a); + return nativeResponseValue; + } // MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params); export function ChannelManager_new(fee_est: number, chain_monitor: number, tx_broadcaster: number, logger: number, keys_manager: number, config: number, params: number): number { if(!isWasmInitialized) { @@ -7958,6 +8641,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelManager_close_channel(this_arg, encodeArray(channel_id)); return nativeResponseValue; } + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], uint32_t target_feerate_sats_per_1000_weight); + export function ChannelManager_close_channel_with_target_feerate(this_arg: number, channel_id: Uint8Array, target_feerate_sats_per_1000_weight: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelManager_close_channel_with_target_feerate(this_arg, encodeArray(channel_id), target_feerate_sats_per_1000_weight); + return nativeResponseValue; + } // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); export function ChannelManager_force_close_channel(this_arg: number, channel_id: Uint8Array): number { if(!isWasmInitialized) { @@ -7982,6 +8673,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelManager_send_payment(this_arg, route, encodeArray(payment_hash), encodeArray(payment_secret)); return nativeResponseValue; } + // MUST_USE_RES struct LDKCResult_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage); + export function ChannelManager_send_spontaneous_payment(this_arg: number, route: number, payment_preimage: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelManager_send_spontaneous_payment(this_arg, route, encodeArray(payment_preimage)); + return nativeResponseValue; + } // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKTransaction funding_transaction); export function ChannelManager_funding_transaction_generated(this_arg: number, temporary_channel_id: Uint8Array, funding_transaction: Uint8Array): number { if(!isWasmInitialized) { @@ -9262,6 +9961,62 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Shutdown_clone(orig); return nativeResponseValue; } + // void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj); + export function ClosingSignedFeeRange_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_free(this_obj); + // debug statements here + } + // uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr); + export function ClosingSignedFeeRange_get_min_fee_satoshis(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_get_min_fee_satoshis(this_ptr); + return nativeResponseValue; + } + // void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val); + export function ClosingSignedFeeRange_set_min_fee_satoshis(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_set_min_fee_satoshis(this_ptr, val); + // debug statements here + } + // uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr); + export function ClosingSignedFeeRange_get_max_fee_satoshis(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_get_max_fee_satoshis(this_ptr); + return nativeResponseValue; + } + // void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val); + export function ClosingSignedFeeRange_set_max_fee_satoshis(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_set_max_fee_satoshis(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg); + export function ClosingSignedFeeRange_new(min_fee_satoshis_arg: number, max_fee_satoshis_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); + return nativeResponseValue; + } + // struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig); + export function ClosingSignedFeeRange_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_clone(orig); + return nativeResponseValue; + } // void ClosingSigned_free(struct LDKClosingSigned this_obj); export function ClosingSigned_free(this_obj: number): void { if(!isWasmInitialized) { @@ -9318,12 +10073,28 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ClosingSigned_set_signature(this_ptr, encodeArray(val)); // debug statements here } - // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg); - export function ClosingSigned_new(channel_id_arg: Uint8Array, fee_satoshis_arg: number, signature_arg: Uint8Array): number { + // struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr); + export function ClosingSigned_get_fee_range(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSigned_get_fee_range(this_ptr); + return nativeResponseValue; + } + // void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val); + export function ClosingSigned_set_fee_range(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSigned_set_fee_range(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg); + export function ClosingSigned_new(channel_id_arg: Uint8Array, fee_satoshis_arg: number, signature_arg: Uint8Array, fee_range_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ClosingSigned_new(encodeArray(channel_id_arg), fee_satoshis_arg, encodeArray(signature_arg)); + const nativeResponseValue = wasm.ClosingSigned_new(encodeArray(channel_id_arg), fee_satoshis_arg, encodeArray(signature_arg), fee_range_arg); return nativeResponseValue; } // struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); @@ -10030,6 +10801,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetAddress_clone(orig); return nativeResponseValue; } + // struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port); + export function NetAddress_ipv4(addr: Uint8Array, port: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetAddress_ipv4(encodeArray(addr), port); + return nativeResponseValue; + } + // struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port); + export function NetAddress_ipv6(addr: Uint8Array, port: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetAddress_ipv6(encodeArray(addr), port); + return nativeResponseValue; + } + // struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port); + export function NetAddress_onion_v2(addr: Uint8Array, port: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetAddress_onion_v2(encodeArray(addr), port); + return nativeResponseValue; + } + // struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port); + export function NetAddress_onion_v3(ed25519_pubkey: Uint8Array, checksum: number, version: number, port: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetAddress_onion_v3(encodeArray(ed25519_pubkey), checksum, version, port); + return nativeResponseValue; + } // struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj); export function NetAddress_write(obj: number): Uint8Array { if(!isWasmInitialized) { @@ -10982,28 +11785,60 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.GossipTimestampFilter_new(encodeArray(chain_hash_arg), first_timestamp_arg, timestamp_range_arg); return nativeResponseValue; } - // struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); - export function GossipTimestampFilter_clone(orig: number): number { + // struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); + export function GossipTimestampFilter_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.GossipTimestampFilter_clone(orig); + return nativeResponseValue; + } + // void ErrorAction_free(struct LDKErrorAction this_ptr); + export function ErrorAction_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ErrorAction_free(this_ptr); + // debug statements here + } + // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); + export function ErrorAction_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ErrorAction_clone(orig); + return nativeResponseValue; + } + // struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg); + export function ErrorAction_disconnect_peer(msg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ErrorAction_disconnect_peer(msg); + return nativeResponseValue; + } + // struct LDKErrorAction ErrorAction_ignore_error(void); + export function ErrorAction_ignore_error(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.GossipTimestampFilter_clone(orig); + const nativeResponseValue = wasm.ErrorAction_ignore_error(); return nativeResponseValue; } - // void ErrorAction_free(struct LDKErrorAction this_ptr); - export function ErrorAction_free(this_ptr: number): void { + // struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a); + export function ErrorAction_ignore_and_log(a: Level): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ErrorAction_free(this_ptr); - // debug statements here + const nativeResponseValue = wasm.ErrorAction_ignore_and_log(a); + return nativeResponseValue; } - // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); - export function ErrorAction_clone(orig: number): number { + // struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg); + export function ErrorAction_send_error_message(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ErrorAction_clone(orig); + const nativeResponseValue = wasm.ErrorAction_send_error_message(msg); return nativeResponseValue; } // void LightningError_free(struct LDKLightningError this_obj); @@ -11166,6 +12001,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.HTLCFailChannelUpdate_clone(orig); return nativeResponseValue; } + // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_update_message(struct LDKChannelUpdate msg); + export function HTLCFailChannelUpdate_channel_update_message(msg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HTLCFailChannelUpdate_channel_update_message(msg); + return nativeResponseValue; + } + // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent); + export function HTLCFailChannelUpdate_channel_closed(short_channel_id: number, is_permanent: boolean): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent); + return nativeResponseValue; + } + // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent); + export function HTLCFailChannelUpdate_node_failure(node_id: Uint8Array, is_permanent: boolean): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.HTLCFailChannelUpdate_node_failure(encodeArray(node_id), is_permanent); + return nativeResponseValue; + } // void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr); export function ChannelMessageHandler_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -11246,6 +12105,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ClosingSigned_read(encodeArray(ser)); return nativeResponseValue; } + // struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj); + export function ClosingSignedFeeRange_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser); + export function ClosingSignedFeeRange_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingSignedFeeRange_read(encodeArray(ser)); + return nativeResponseValue; + } // struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); export function CommitmentSigned_write(obj: number): Uint8Array { if(!isWasmInitialized) { @@ -13182,6 +14057,134 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InvoiceFeatures_read(encodeArray(ser)); return nativeResponseValue; } + // void ShutdownScript_free(struct LDKShutdownScript this_obj); + export function ShutdownScript_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_free(this_obj); + // debug statements here + } + // struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig); + export function ShutdownScript_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_clone(orig); + return nativeResponseValue; + } + // void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj); + export function InvalidShutdownScript_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvalidShutdownScript_free(this_obj); + // debug statements here + } + // struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr); + export function InvalidShutdownScript_get_script(this_ptr: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvalidShutdownScript_get_script(this_ptr); + return decodeArray(nativeResponseValue); + } + // void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + export function InvalidShutdownScript_set_script(this_ptr: number, val: Uint8Array): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvalidShutdownScript_set_script(this_ptr, encodeArray(val)); + // debug statements here + } + // MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg); + export function InvalidShutdownScript_new(script_arg: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvalidShutdownScript_new(encodeArray(script_arg)); + return nativeResponseValue; + } + // struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj); + export function ShutdownScript_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser); + export function ShutdownScript_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_read(encodeArray(ser)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2pkh(const uint8_t (*pubkey_hash)[20]); + export function ShutdownScript_new_p2pkh(pubkey_hash: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_new_p2pkh(encodeArray(pubkey_hash)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2sh(const uint8_t (*script_hash)[20]); + export function ShutdownScript_new_p2sh(script_hash: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_new_p2sh(encodeArray(script_hash)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]); + export function ShutdownScript_new_p2wpkh(pubkey_hash: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_new_p2wpkh(encodeArray(pubkey_hash)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]); + export function ShutdownScript_new_p2wsh(script_hash: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_new_p2wsh(encodeArray(script_hash)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program); + export function ShutdownScript_new_witness_program(version: number, program: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_new_witness_program(version, encodeArray(program)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg); + export function ShutdownScript_into_inner(this_arg: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_into_inner(this_arg); + return decodeArray(nativeResponseValue); + } + // MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg); + export function ShutdownScript_as_legacy_pubkey(this_arg: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_as_legacy_pubkey(this_arg); + return decodeArray(nativeResponseValue); + } + // MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features); + export function ShutdownScript_is_compatible(this_arg: number, features: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ShutdownScript_is_compatible(this_arg, features); + return nativeResponseValue; + } // void RouteHop_free(struct LDKRouteHop this_obj); export function RouteHop_free(this_obj: number): void { if(!isWasmInitialized) { @@ -13518,6 +14521,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RouteHintHop_clone(orig); return nativeResponseValue; } + // struct LDKCResult_RouteLightningErrorZ get_keysend_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_keysend_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 { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.get_keysend_route(encodeArray(our_node_id), network, encodeArray(payee), first_hops, last_hops, final_value_msat, final_cltv, logger); + return nativeResponseValue; + } // 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) { @@ -14358,6 +15369,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BackgroundProcessor_start(persister, event_handler, chain_monitor, channel_manager, peer_manager, logger); return nativeResponseValue; } + // MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg); + export function BackgroundProcessor_join(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.BackgroundProcessor_join(this_arg); + return nativeResponseValue; + } // MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg); export function BackgroundProcessor_stop(this_arg: number): number { if(!isWasmInitialized) { @@ -14534,6 +15553,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SiPrefix_clone(orig); return nativeResponseValue; } + // enum LDKSiPrefix SiPrefix_milli(void); + export function SiPrefix_milli(): SiPrefix { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SiPrefix_milli(); + return nativeResponseValue; + } + // enum LDKSiPrefix SiPrefix_micro(void); + export function SiPrefix_micro(): SiPrefix { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SiPrefix_micro(); + return nativeResponseValue; + } + // enum LDKSiPrefix SiPrefix_nano(void); + export function SiPrefix_nano(): SiPrefix { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SiPrefix_nano(); + return nativeResponseValue; + } + // enum LDKSiPrefix SiPrefix_pico(void); + export function SiPrefix_pico(): SiPrefix { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SiPrefix_pico(); + return nativeResponseValue; + } // bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b); export function SiPrefix_eq(a: number, b: number): boolean { if(!isWasmInitialized) { @@ -14558,6 +15609,46 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Currency_clone(orig); return nativeResponseValue; } + // enum LDKCurrency Currency_bitcoin(void); + export function Currency_bitcoin(): Currency { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Currency_bitcoin(); + return nativeResponseValue; + } + // enum LDKCurrency Currency_bitcoin_testnet(void); + export function Currency_bitcoin_testnet(): Currency { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Currency_bitcoin_testnet(); + return nativeResponseValue; + } + // enum LDKCurrency Currency_regtest(void); + export function Currency_regtest(): Currency { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Currency_regtest(); + return nativeResponseValue; + } + // enum LDKCurrency Currency_simnet(void); + export function Currency_simnet(): Currency { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Currency_simnet(); + return nativeResponseValue; + } + // enum LDKCurrency Currency_signet(void); + export function Currency_signet(): Currency { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Currency_signet(); + return nativeResponseValue; + } // bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b); export function Currency_eq(a: number, b: number): boolean { if(!isWasmInitialized) { @@ -14702,6 +15793,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Fallback_clone(orig); return nativeResponseValue; } + // struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program); + export function Fallback_seg_wit_program(version: number, program: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Fallback_seg_wit_program(version, encodeArray(program)); + return nativeResponseValue; + } + // struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a); + export function Fallback_pub_key_hash(a: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Fallback_pub_key_hash(encodeArray(a)); + return nativeResponseValue; + } + // struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a); + export function Fallback_script_hash(a: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Fallback_script_hash(encodeArray(a)); + return nativeResponseValue; + } // bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b); export function Fallback_eq(a: number, b: number): boolean { if(!isWasmInitialized) { @@ -15126,6 +16241,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CreationError_clone(orig); return nativeResponseValue; } + // enum LDKCreationError CreationError_description_too_long(void); + export function CreationError_description_too_long(): CreationError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CreationError_description_too_long(); + return nativeResponseValue; + } + // enum LDKCreationError CreationError_route_too_long(void); + export function CreationError_route_too_long(): CreationError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CreationError_route_too_long(); + return nativeResponseValue; + } + // enum LDKCreationError CreationError_timestamp_out_of_bounds(void); + export function CreationError_timestamp_out_of_bounds(): CreationError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CreationError_timestamp_out_of_bounds(); + return nativeResponseValue; + } + // enum LDKCreationError CreationError_expiry_time_out_of_bounds(void); + export function CreationError_expiry_time_out_of_bounds(): CreationError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CreationError_expiry_time_out_of_bounds(); + return nativeResponseValue; + } // bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b); export function CreationError_eq(a: number, b: number): boolean { if(!isWasmInitialized) { @@ -15150,6 +16297,70 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SemanticError_clone(orig); return nativeResponseValue; } + // enum LDKSemanticError SemanticError_no_payment_hash(void); + export function SemanticError_no_payment_hash(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_no_payment_hash(); + return nativeResponseValue; + } + // enum LDKSemanticError SemanticError_multiple_payment_hashes(void); + export function SemanticError_multiple_payment_hashes(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_multiple_payment_hashes(); + return nativeResponseValue; + } + // enum LDKSemanticError SemanticError_no_description(void); + export function SemanticError_no_description(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_no_description(); + return nativeResponseValue; + } + // enum LDKSemanticError SemanticError_multiple_descriptions(void); + export function SemanticError_multiple_descriptions(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_multiple_descriptions(); + return nativeResponseValue; + } + // enum LDKSemanticError SemanticError_multiple_payment_secrets(void); + export function SemanticError_multiple_payment_secrets(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_multiple_payment_secrets(); + return nativeResponseValue; + } + // enum LDKSemanticError SemanticError_invalid_features(void); + export function SemanticError_invalid_features(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_invalid_features(); + return nativeResponseValue; + } + // enum LDKSemanticError SemanticError_invalid_recovery_id(void); + export function SemanticError_invalid_recovery_id(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_invalid_recovery_id(); + return nativeResponseValue; + } + // enum LDKSemanticError SemanticError_invalid_signature(void); + export function SemanticError_invalid_signature(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_invalid_signature(); + return nativeResponseValue; + } // bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b); export function SemanticError_eq(a: number, b: number): boolean { if(!isWasmInitialized) { @@ -15182,6 +16393,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SignOrCreationError_clone(orig); return nativeResponseValue; } + // struct LDKSignOrCreationError SignOrCreationError_sign_error(void); + export function SignOrCreationError_sign_error(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SignOrCreationError_sign_error(); + return nativeResponseValue; + } + // struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a); + export function SignOrCreationError_creation_error(a: CreationError): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SignOrCreationError_creation_error(a); + return nativeResponseValue; + } // bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b); export function SignOrCreationError_eq(a: number, b: number): boolean { if(!isWasmInitialized) {