X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fbindings.ts;h=1257092210a1eeebf8e956a4b0225e1414e22c54;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=d936b46e0b74b4819deaafec1c19f8c4b576fd86;hpb=d92b9f26eda1f6c1fbb970db797a03fac62c5606;p=ldk-java diff --git a/ts/bindings.ts b/ts/bindings.ts index d936b46e..12570922 100644 --- a/ts/bindings.ts +++ b/ts/bindings.ts @@ -211,6 +211,9 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_TrustedClosingTransactionNoneZ_result_ok(long arg); + public static native number LDKCResult_TrustedClosingTransactionNoneZ_get_ok(long arg); + public static native void LDKCResult_TrustedClosingTransactionNoneZ_get_err(long arg); public static native boolean LDKCResult_CommitmentTransactionDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_CommitmentTransactionDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_CommitmentTransactionDecodeErrorZ_get_err(long arg); @@ -236,6 +239,10 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_RouteDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_RouteDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_RouteParametersDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_RouteParametersDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_RouteParametersDecodeErrorZ_get_err(long arg); + public static native long LDKCVec_RouteHintZ_new(number[] elems); public static class LDKCOption_u64Z { private LDKCOption_u64Z() {} export class Some extends LDKCOption_u64Z { @@ -249,17 +256,39 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_u64Z.init(); } public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr); + public static native boolean LDKCResult_PayeeDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_PayeeDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_PayeeDecodeErrorZ_get_err(long arg); + public static native long LDKCVec_RouteHintHopZ_new(number[] elems); + public static native boolean LDKCResult_RouteHintDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_RouteHintDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_RouteHintDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_RouteHintHopDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_RouteHintHopDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_RouteHintHopDecodeErrorZ_get_err(long arg); public static native long LDKCVec_ChannelDetailsZ_new(number[] elems); - public static native long LDKCVec_RouteHintZ_new(number[] elems); public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg); public static native number LDKCResult_RouteLightningErrorZ_get_ok(long arg); public static native number LDKCResult_RouteLightningErrorZ_get_err(long arg); public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg); public static native number LDKCResult_TxOutAccessErrorZ_get_ok(long arg); public static native AccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg); - public static native long LDKC2Tuple_usizeTransactionZ_new(number a, Uint8Array b); - public static native number LDKC2Tuple_usizeTransactionZ_get_a(long ptr); - public static native Uint8Array LDKC2Tuple_usizeTransactionZ_get_b(long ptr); + // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple); + export function C2Tuple_usizeTransactionZ_get_a(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_usizeTransactionZ_get_a(tuple); + return nativeResponseValue; + } + // struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR tuple); + export function C2Tuple_usizeTransactionZ_get_b(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_usizeTransactionZ_get_b(tuple); + return decodeArray(nativeResponseValue); + } public static native long LDKCVec_C2Tuple_usizeTransactionZZ_new(number[] elems); public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg); public static native void LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg); @@ -270,9 +299,18 @@ public static native long new_empty_slice_vec(); public number htlc_event; HTLCEvent(number htlc_event) { this.htlc_event = htlc_event; } } - export class CommitmentTxBroadcasted extends LDKMonitorEvent { - public number commitment_tx_broadcasted; - CommitmentTxBroadcasted(number commitment_tx_broadcasted) { this.commitment_tx_broadcasted = commitment_tx_broadcasted; } + export class CommitmentTxConfirmed extends LDKMonitorEvent { + public number commitment_tx_confirmed; + CommitmentTxConfirmed(number commitment_tx_confirmed) { this.commitment_tx_confirmed = commitment_tx_confirmed; } + } + export class UpdateCompleted extends LDKMonitorEvent { + public number funding_txo; + public number monitor_update_id; + UpdateCompleted(number funding_txo, number monitor_update_id) { this.funding_txo = funding_txo; this.monitor_update_id = monitor_update_id; } + } + export class UpdateFailed extends LDKMonitorEvent { + public number update_failed; + UpdateFailed(number update_failed) { this.update_failed = update_failed; } } static native void init(); } @@ -292,6 +330,39 @@ public static native long new_empty_slice_vec(); } static { LDKCOption_C2Tuple_usizeTransactionZZ.init(); } public static native LDKCOption_C2Tuple_usizeTransactionZZ LDKCOption_C2Tuple_usizeTransactionZZ_ref_from_ptr(long ptr); + public static class LDKNetworkUpdate { + private LDKNetworkUpdate() {} + export class ChannelUpdateMessage extends LDKNetworkUpdate { + public number msg; + ChannelUpdateMessage(number msg) { this.msg = msg; } + } + export class ChannelClosed extends LDKNetworkUpdate { + public number short_channel_id; + public boolean is_permanent; + ChannelClosed(number short_channel_id, boolean is_permanent) { this.short_channel_id = short_channel_id; this.is_permanent = is_permanent; } + } + export class NodeFailure extends LDKNetworkUpdate { + public Uint8Array node_id; + public boolean is_permanent; + NodeFailure(Uint8Array node_id, boolean is_permanent) { this.node_id = node_id; this.is_permanent = is_permanent; } + } + static native void init(); + } + static { LDKNetworkUpdate.init(); } + public static native LDKNetworkUpdate LDKNetworkUpdate_ref_from_ptr(long ptr); + public static class LDKCOption_NetworkUpdateZ { + private LDKCOption_NetworkUpdateZ() {} + export class Some extends LDKCOption_NetworkUpdateZ { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_NetworkUpdateZ { + None() { } + } + static native void init(); + } + static { LDKCOption_NetworkUpdateZ.init(); } + public static native LDKCOption_NetworkUpdateZ LDKCOption_NetworkUpdateZ_ref_from_ptr(long ptr); public static class LDKSpendableOutputDescriptor { private LDKSpendableOutputDescriptor() {} export class StaticOutput extends LDKSpendableOutputDescriptor { @@ -333,26 +404,6 @@ public static native long new_empty_slice_vec(); } static { LDKErrorAction.init(); } public static native LDKErrorAction LDKErrorAction_ref_from_ptr(long ptr); - public static class LDKHTLCFailChannelUpdate { - private LDKHTLCFailChannelUpdate() {} - export class ChannelUpdateMessage extends LDKHTLCFailChannelUpdate { - public number msg; - ChannelUpdateMessage(number msg) { this.msg = msg; } - } - export class ChannelClosed extends LDKHTLCFailChannelUpdate { - public number short_channel_id; - public boolean is_permanent; - ChannelClosed(number short_channel_id, boolean is_permanent) { this.short_channel_id = short_channel_id; this.is_permanent = is_permanent; } - } - export class NodeFailure extends LDKHTLCFailChannelUpdate { - public Uint8Array node_id; - public boolean is_permanent; - NodeFailure(Uint8Array node_id, boolean is_permanent) { this.node_id = node_id; this.is_permanent = is_permanent; } - } - static native void init(); - } - static { LDKHTLCFailChannelUpdate.init(); } - public static native LDKHTLCFailChannelUpdate LDKHTLCFailChannelUpdate_ref_from_ptr(long ptr); public static class LDKMessageSendEvent { private LDKMessageSendEvent() {} export class SendAcceptChannel extends LDKMessageSendEvent { @@ -433,10 +484,6 @@ public static native long new_empty_slice_vec(); public number action; HandleError(Uint8Array node_id, number action) { this.node_id = node_id; this.action = action; } } - export class PaymentFailureNetworkUpdate extends LDKMessageSendEvent { - public number update; - PaymentFailureNetworkUpdate(number update) { this.update = update; } - } export class SendChannelRangeQuery extends LDKMessageSendEvent { public Uint8Array node_id; public number msg; @@ -469,6 +516,12 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ScoringParametersDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_ScoringParametersDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ScoringParametersDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ScorerDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_ScorerDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ScorerDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(long arg); @@ -478,9 +531,25 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg); - public static native long LDKC2Tuple_SignatureCVec_SignatureZZ_new(Uint8Array a, Uint8Array[] b); - public static native Uint8Array LDKC2Tuple_SignatureCVec_SignatureZZ_get_a(long ptr); - public static native Uint8Array[] LDKC2Tuple_SignatureCVec_SignatureZZ_get_b(long ptr); + public static native boolean LDKCResult_NoneNoneZ_result_ok(long arg); + public static native void LDKCResult_NoneNoneZ_get_ok(long arg); + public static native void LDKCResult_NoneNoneZ_get_err(long arg); + // struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple); + export function C2Tuple_SignatureCVec_SignatureZZ_get_a(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_SignatureCVec_SignatureZZ_get_a(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR tuple); + export function C2Tuple_SignatureCVec_SignatureZZ_get_b(tuple: number): Uint8Array[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_SignatureCVec_SignatureZZ_get_b(tuple); + return nativeResponseValue; + } public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg); public static native number LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long arg); public static native void LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long arg); @@ -495,13 +564,15 @@ public static native long new_empty_slice_vec(); export interface LDKBaseSign { get_per_commitment_point (idx: number): Uint8Array; release_commitment_secret (idx: number): Uint8Array; + validate_holder_commitment (holder_tx: number): number; channel_keys_id (): Uint8Array; sign_counterparty_commitment (commitment_tx: number): number; + validate_counterparty_revocation (idx: number, secret: Uint8Array): number; sign_holder_commitment_and_htlcs (commitment_tx: number): number; sign_justice_revoked_output (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array): number; sign_justice_revoked_htlc (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number; sign_counterparty_htlc_transaction (htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number; - sign_closing_transaction (closing_tx: Uint8Array): number; + sign_closing_transaction (closing_tx: number): number; sign_channel_announcement (msg: number): number; ready_channel (channel_parameters: number): void; } @@ -529,6 +600,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BaseSign_release_commitment_secret(this_arg, idx); return decodeArray(nativeResponseValue); } + // LDKCResult_NoneNoneZ BaseSign_validate_holder_commitment LDKBaseSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx + export function BaseSign_validate_holder_commitment(this_arg: number, holder_tx: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.BaseSign_validate_holder_commitment(this_arg, holder_tx); + return nativeResponseValue; + } // LDKThirtyTwoBytes BaseSign_channel_keys_id LDKBaseSign *NONNULL_PTR this_arg export function BaseSign_channel_keys_id(this_arg: number): Uint8Array { if(!isWasmInitialized) { @@ -545,6 +624,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BaseSign_sign_counterparty_commitment(this_arg, commitment_tx); return nativeResponseValue; } + // LDKCResult_NoneNoneZ BaseSign_validate_counterparty_revocation LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx, const uint8_t (*secret)[32] + export function BaseSign_validate_counterparty_revocation(this_arg: number, idx: number, secret: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.BaseSign_validate_counterparty_revocation(this_arg, idx, encodeArray(secret)); + return nativeResponseValue; + } // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ BaseSign_sign_holder_commitment_and_htlcs LDKBaseSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx export function BaseSign_sign_holder_commitment_and_htlcs(this_arg: number, commitment_tx: number): number { if(!isWasmInitialized) { @@ -577,12 +664,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BaseSign_sign_counterparty_htlc_transaction(this_arg, encodeArray(htlc_tx), input, amount, encodeArray(per_commitment_point), htlc); return nativeResponseValue; } - // LDKCResult_SignatureNoneZ BaseSign_sign_closing_transaction LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction closing_tx - export function BaseSign_sign_closing_transaction(this_arg: number, closing_tx: Uint8Array): number { + // LDKCResult_SignatureNoneZ BaseSign_sign_closing_transaction LDKBaseSign *NONNULL_PTR this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx + export function BaseSign_sign_closing_transaction(this_arg: number, closing_tx: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.BaseSign_sign_closing_transaction(this_arg, encodeArray(closing_tx)); + const nativeResponseValue = wasm.BaseSign_sign_closing_transaction(this_arg, closing_tx); return nativeResponseValue; } // LDKCResult_SignatureNoneZ BaseSign_sign_channel_announcement LDKBaseSign *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg @@ -649,9 +736,22 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_TransactionNoneZ_result_ok(long arg); public static native Uint8Array LDKCResult_TransactionNoneZ_get_ok(long arg); public static native void LDKCResult_TransactionNoneZ_get_err(long arg); - public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(Uint8Array a, number b); - public static native Uint8Array LDKC2Tuple_BlockHashChannelMonitorZ_get_a(long ptr); - public static native number LDKC2Tuple_BlockHashChannelMonitorZ_get_b(long ptr); + // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple); + export function C2Tuple_BlockHashChannelMonitorZ_get_a(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_BlockHashChannelMonitorZ_get_a(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR tuple); + export function C2Tuple_BlockHashChannelMonitorZ_get_b(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_BlockHashChannelMonitorZ_get_b(tuple); + return nativeResponseValue; + } public static native long LDKCVec_C2Tuple_BlockHashChannelMonitorZZ_new(number[] elems); public static native boolean LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_result_ok(long arg); public static native number[] LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(long arg); @@ -704,6 +804,9 @@ public static native long new_empty_slice_vec(); public static native number LDKCResult_NoneAPIErrorZ_get_err(long arg); public static native long LDKCVec_CResult_NoneAPIErrorZZ_new(number[] elems); public static native long LDKCVec_APIErrorZ_new(number[] elems); + public static native boolean LDKCResult__u832APIErrorZ_result_ok(long arg); + public static native Uint8Array LDKCResult__u832APIErrorZ_get_ok(long arg); + public static native number LDKCResult__u832APIErrorZ_get_err(long arg); public static class LDKPaymentSendFailure { private LDKPaymentSendFailure() {} export class ParameterError extends LDKPaymentSendFailure { @@ -719,19 +822,40 @@ public static native long new_empty_slice_vec(); AllFailedRetrySafe(number[] all_failed_retry_safe) { this.all_failed_retry_safe = all_failed_retry_safe; } } export class PartialFailure extends LDKPaymentSendFailure { - public number[] partial_failure; - PartialFailure(number[] partial_failure) { this.partial_failure = partial_failure; } + public number[] results; + public number failed_paths_retry; + public Uint8Array payment_id; + PartialFailure(number[] results, number failed_paths_retry, Uint8Array payment_id) { this.results = results; this.failed_paths_retry = failed_paths_retry; this.payment_id = payment_id; } } static native void init(); } static { LDKPaymentSendFailure.init(); } public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr); + public static native boolean LDKCResult_PaymentIdPaymentSendFailureZ_result_ok(long arg); + public static native Uint8Array LDKCResult_PaymentIdPaymentSendFailureZ_get_ok(long arg); + public static native number LDKCResult_PaymentIdPaymentSendFailureZ_get_err(long arg); 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); + // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple); + export function C2Tuple_PaymentHashPaymentIdZ_get_a(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_get_a(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR tuple); + export function C2Tuple_PaymentHashPaymentIdZ_get_b(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_get_b(tuple); + return decodeArray(nativeResponseValue); + } + public static native boolean LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_result_ok(long arg); + public static native number LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(long arg); + public static native number LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(long arg); public static class LDKNetAddress { private LDKNetAddress() {} export class IPv4 extends LDKNetAddress { @@ -761,9 +885,22 @@ public static native long new_empty_slice_vec(); static { LDKNetAddress.init(); } public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); public static native long LDKCVec_NetAddressZ_new(number[] elems); - public static native long LDKC2Tuple_PaymentHashPaymentSecretZ_new(Uint8Array a, Uint8Array b); - public static native Uint8Array LDKC2Tuple_PaymentHashPaymentSecretZ_get_a(long ptr); - public static native Uint8Array LDKC2Tuple_PaymentHashPaymentSecretZ_get_b(long ptr); + // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple); + export function C2Tuple_PaymentHashPaymentSecretZ_get_a(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentSecretZ_get_a(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR tuple); + export function C2Tuple_PaymentHashPaymentSecretZ_get_b(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentSecretZ_get_b(tuple); + return decodeArray(nativeResponseValue); + } public static native boolean LDKCResult_PaymentSecretAPIErrorZ_result_ok(long arg); public static native Uint8Array LDKCResult_PaymentSecretAPIErrorZ_get_ok(long arg); public static native number LDKCResult_PaymentSecretAPIErrorZ_get_err(long arg); @@ -952,9 +1089,22 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - public static native long LDKC2Tuple_BlockHashChannelManagerZ_new(Uint8Array a, number b); - public static native Uint8Array LDKC2Tuple_BlockHashChannelManagerZ_get_a(long ptr); - public static native number LDKC2Tuple_BlockHashChannelManagerZ_get_b(long ptr); + // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple); + export function C2Tuple_BlockHashChannelManagerZ_get_a(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_BlockHashChannelManagerZ_get_a(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR tuple); + export function C2Tuple_BlockHashChannelManagerZ_get_b(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_BlockHashChannelManagerZ_get_b(tuple); + return nativeResponseValue; + } public static native boolean LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(long arg); @@ -964,6 +1114,85 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_OutPointDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_OutPointDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_OutPointDecodeErrorZ_get_err(long arg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKType { + type_id (): number; + debug_str (): String; + write (): Uint8Array; + } + + export function LDKType_new(impl: LDKType): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + // uint16_t Type_type_id LDKType *NONNULL_PTR this_arg + export function Type_type_id(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Type_type_id(this_arg); + return nativeResponseValue; + } + // LDKStr Type_debug_str LDKType *NONNULL_PTR this_arg + export function Type_debug_str(this_arg: number): String { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Type_debug_str(this_arg); + return nativeResponseValue; + } + // LDKCVec_u8Z Type_write LDKType *NONNULL_PTR this_arg + export function Type_write(this_arg: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Type_write(this_arg); + return decodeArray(nativeResponseValue); + } + public static class LDKCOption_TypeZ { + private LDKCOption_TypeZ() {} + export class Some extends LDKCOption_TypeZ { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_TypeZ { + None() { } + } + static native void init(); + } + static { LDKCOption_TypeZ.init(); } + public static native LDKCOption_TypeZ LDKCOption_TypeZ_ref_from_ptr(long ptr); + public static native boolean LDKCResult_COption_TypeZDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_COption_TypeZDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_COption_TypeZDecodeErrorZ_get_err(long arg); + public static class LDKPaymentError { + private LDKPaymentError() {} + export class Invoice extends LDKPaymentError { + public String invoice; + Invoice(String invoice) { this.invoice = invoice; } + } + export class Routing extends LDKPaymentError { + public number routing; + Routing(number routing) { this.routing = routing; } + } + export class Sending extends LDKPaymentError { + public number sending; + Sending(number sending) { this.sending = sending; } + } + static native void init(); + } + static { LDKPaymentError.init(); } + public static native LDKPaymentError LDKPaymentError_ref_from_ptr(long ptr); + public static native boolean LDKCResult_PaymentIdPaymentErrorZ_result_ok(long arg); + public static native Uint8Array LDKCResult_PaymentIdPaymentErrorZ_get_ok(long arg); + public static native number LDKCResult_PaymentIdPaymentErrorZ_get_err(long arg); public static native boolean LDKCResult_SiPrefixNoneZ_result_ok(long arg); public static native SiPrefix LDKCResult_SiPrefixNoneZ_get_ok(long arg); public static native void LDKCResult_SiPrefixNoneZ_get_err(long arg); @@ -973,10 +1202,30 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_SignedRawInvoiceNoneZ_result_ok(long arg); public static native number LDKCResult_SignedRawInvoiceNoneZ_get_ok(long arg); public static native void LDKCResult_SignedRawInvoiceNoneZ_get_err(long arg); - public static native long LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_new(number a, Uint8Array b, number c); - public static native number LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(long ptr); - public static native Uint8Array LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(long ptr); - public static native number LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(long ptr); + // struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple); + export function C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(tuple); + return nativeResponseValue; + } + // struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple); + export function C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR tuple); + export function C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(tuple); + return nativeResponseValue; + } public static native boolean LDKCResult_PayeePubKeyErrorZ_result_ok(long arg); public static native number LDKCResult_PayeePubKeyErrorZ_get_ok(long arg); public static native Secp256k1Error LDKCResult_PayeePubKeyErrorZ_get_err(long arg); @@ -1011,16 +1260,55 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg); public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg); public static native number LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg); - public static native long LDKC2Tuple_OutPointScriptZ_new(number a, Uint8Array b); - public static native number LDKC2Tuple_OutPointScriptZ_get_a(long ptr); - public static native Uint8Array LDKC2Tuple_OutPointScriptZ_get_b(long ptr); - public static native long LDKC2Tuple_u32ScriptZ_new(number a, Uint8Array b); - public static native number LDKC2Tuple_u32ScriptZ_get_a(long ptr); - public static native Uint8Array LDKC2Tuple_u32ScriptZ_get_b(long ptr); + // struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple); + export function C2Tuple_OutPointScriptZ_get_a(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_OutPointScriptZ_get_a(tuple); + return nativeResponseValue; + } + // struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR tuple); + export function C2Tuple_OutPointScriptZ_get_b(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_OutPointScriptZ_get_b(tuple); + return decodeArray(nativeResponseValue); + } + // uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple); + export function C2Tuple_u32ScriptZ_get_a(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32ScriptZ_get_a(tuple); + return nativeResponseValue; + } + // struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR tuple); + export function C2Tuple_u32ScriptZ_get_b(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32ScriptZ_get_b(tuple); + return decodeArray(nativeResponseValue); + } public static native long LDKCVec_C2Tuple_u32ScriptZZ_new(number[] elems); - public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(Uint8Array a, number[] b); - public static native Uint8Array LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(long ptr); - public static native number[] LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(long ptr); + // struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple); + export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR tuple); + export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(tuple: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(tuple); + return nativeResponseValue; + } public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(number[] elems); public static class LDKPaymentPurpose { private LDKPaymentPurpose() {} @@ -1038,6 +1326,35 @@ public static native long new_empty_slice_vec(); } static { LDKPaymentPurpose.init(); } public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr); + public static class LDKClosureReason { + private LDKClosureReason() {} + export class CounterpartyForceClosed extends LDKClosureReason { + public String peer_msg; + CounterpartyForceClosed(String peer_msg) { this.peer_msg = peer_msg; } + } + export class HolderForceClosed extends LDKClosureReason { + HolderForceClosed() { } + } + export class CooperativeClosure extends LDKClosureReason { + CooperativeClosure() { } + } + export class CommitmentTxConfirmed extends LDKClosureReason { + CommitmentTxConfirmed() { } + } + export class ProcessingError extends LDKClosureReason { + public String err; + ProcessingError(String err) { this.err = err; } + } + export class DisconnectedPeer extends LDKClosureReason { + DisconnectedPeer() { } + } + export class OutdatedChannelManager extends LDKClosureReason { + OutdatedChannelManager() { } + } + static native void init(); + } + static { LDKClosureReason.init(); } + public static native LDKClosureReason LDKClosureReason_ref_from_ptr(long ptr); public static class LDKEvent { private LDKEvent() {} export class FundingGenerationReady extends LDKEvent { @@ -1054,13 +1371,22 @@ public static native long new_empty_slice_vec(); 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_id; public Uint8Array payment_preimage; - PaymentSent(Uint8Array payment_preimage) { this.payment_preimage = payment_preimage; } + public Uint8Array payment_hash; + public number fee_paid_msat; + PaymentSent(Uint8Array payment_id, Uint8Array payment_preimage, Uint8Array payment_hash, number fee_paid_msat) { this.payment_id = payment_id; this.payment_preimage = payment_preimage; this.payment_hash = payment_hash; this.fee_paid_msat = fee_paid_msat; } } - export class PaymentFailed extends LDKEvent { + export class PaymentPathFailed extends LDKEvent { + public Uint8Array payment_id; public Uint8Array payment_hash; public boolean rejected_by_dest; - PaymentFailed(Uint8Array payment_hash, boolean rejected_by_dest) { this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; } + public number network_update; + public boolean all_paths_failed; + public number[] path; + public number short_channel_id; + public number retry; + PaymentPathFailed(Uint8Array payment_id, Uint8Array payment_hash, boolean rejected_by_dest, number network_update, boolean all_paths_failed, number[] path, number short_channel_id, number retry) { this.payment_id = payment_id; this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; this.network_update = network_update; this.all_paths_failed = all_paths_failed; this.path = path; this.short_channel_id = short_channel_id; this.retry = retry; } } export class PendingHTLCsForwardable extends LDKEvent { public number time_forwardable; @@ -1075,55 +1401,195 @@ public static native long new_empty_slice_vec(); 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; } } + export class ChannelClosed extends LDKEvent { + public Uint8Array channel_id; + public number user_channel_id; + public number reason; + ChannelClosed(Uint8Array channel_id, number user_channel_id, number reason) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; } + } + export class DiscardFunding extends LDKEvent { + public Uint8Array channel_id; + public Uint8Array transaction; + DiscardFunding(Uint8Array channel_id, Uint8Array transaction) { this.channel_id = channel_id; this.transaction = transaction; } + } static native void init(); } static { LDKEvent.init(); } public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); public static native long LDKCVec_EventZ_new(number[] elems); - public static native long LDKC2Tuple_u32TxOutZ_new(number a, number b); - public static native number LDKC2Tuple_u32TxOutZ_get_a(long ptr); - public static native number LDKC2Tuple_u32TxOutZ_get_b(long ptr); + // uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple); + export function C2Tuple_u32TxOutZ_get_a(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32TxOutZ_get_a(tuple); + return nativeResponseValue; + } + // struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR tuple); + export function C2Tuple_u32TxOutZ_get_b(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_u32TxOutZ_get_b(tuple); + return nativeResponseValue; + } public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(number[] elems); - public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(Uint8Array a, number[] b); - public static native Uint8Array LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(long ptr); - public static native number[] LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(long ptr); + // struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple); + export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR tuple); + export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(tuple: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(tuple); + return nativeResponseValue; + } public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(number[] elems); + public static class LDKBalance { + private LDKBalance() {} + export class ClaimableOnChannelClose extends LDKBalance { + public number claimable_amount_satoshis; + ClaimableOnChannelClose(number claimable_amount_satoshis) { this.claimable_amount_satoshis = claimable_amount_satoshis; } + } + export class ClaimableAwaitingConfirmations extends LDKBalance { + public number claimable_amount_satoshis; + public number confirmation_height; + ClaimableAwaitingConfirmations(number claimable_amount_satoshis, number confirmation_height) { this.claimable_amount_satoshis = claimable_amount_satoshis; this.confirmation_height = confirmation_height; } + } + export class ContentiousClaimable extends LDKBalance { + public number claimable_amount_satoshis; + public number timeout_height; + ContentiousClaimable(number claimable_amount_satoshis, number timeout_height) { this.claimable_amount_satoshis = claimable_amount_satoshis; this.timeout_height = timeout_height; } + } + export class MaybeClaimableHTLCAwaitingTimeout extends LDKBalance { + public number claimable_amount_satoshis; + public number claimable_height; + MaybeClaimableHTLCAwaitingTimeout(number claimable_amount_satoshis, number claimable_height) { this.claimable_amount_satoshis = claimable_amount_satoshis; this.claimable_height = claimable_height; } + } + static native void init(); + } + static { LDKBalance.init(); } + public static native LDKBalance LDKBalance_ref_from_ptr(long ptr); + public static native long LDKCVec_BalanceZ_new(number[] elems); public static native boolean LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg); - public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg); - public static native number LDKCResult_boolLightningErrorZ_get_err(long arg); - public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(number a, number b, number c); - public static native number LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long ptr); - public static native number LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long ptr); - public static native number LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long ptr); - public static native long LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(number[] elems); - public static native long LDKCVec_NodeAnnouncementZ_new(number[] elems); public static native boolean LDKCResult_NoneLightningErrorZ_result_ok(long arg); public static native void LDKCResult_NoneLightningErrorZ_get_ok(long arg); public static native number LDKCResult_NoneLightningErrorZ_get_err(long arg); - public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg); - public static native Uint8Array LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(long arg); - public static native number LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg); - public static native void LDKCResult_NonePeerHandleErrorZ_get_ok(long arg); - public static native number LDKCResult_NonePeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg); - public static native boolean LDKCResult_boolPeerHandleErrorZ_get_ok(long arg); - public static native number LDKCResult_boolPeerHandleErrorZ_get_err(long arg); - public static native boolean LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(long arg); - public static native number LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(long arg); - public static native number LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_ChannelInfoDecodeErrorZ_result_ok(long arg); - public static native number LDKCResult_ChannelInfoDecodeErrorZ_get_ok(long arg); - public static native number LDKCResult_ChannelInfoDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_RoutingFeesDecodeErrorZ_result_ok(long arg); - public static native number LDKCResult_RoutingFeesDecodeErrorZ_get_ok(long arg); - public static native number LDKCResult_RoutingFeesDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(long arg); - public static native number LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long arg); - public static native number LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long arg); + // struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple); + export function C2Tuple_PublicKeyTypeZ_get_a(tuple: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PublicKeyTypeZ_get_a(tuple); + return decodeArray(nativeResponseValue); + } + // struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR tuple); + export function C2Tuple_PublicKeyTypeZ_get_b(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PublicKeyTypeZ_get_b(tuple); + return nativeResponseValue; + } + public static native long LDKCVec_C2Tuple_PublicKeyTypeZZ_new(number[] elems); + public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg); + public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg); + public static native number LDKCResult_boolLightningErrorZ_get_err(long arg); + // struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple); + export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(tuple); + return nativeResponseValue; + } + // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple); + export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(tuple); + return nativeResponseValue; + } + // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR tuple); + export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(tuple: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(tuple); + return nativeResponseValue; + } + public static native long LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(number[] elems); + public static native long LDKCVec_NodeAnnouncementZ_new(number[] elems); + public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg); + public static native Uint8Array LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(long arg); + public static native number LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(long arg); + public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg); + public static native void LDKCResult_NonePeerHandleErrorZ_get_ok(long arg); + public static native number LDKCResult_NonePeerHandleErrorZ_get_err(long arg); + public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg); + public static native boolean LDKCResult_boolPeerHandleErrorZ_get_ok(long arg); + public static native number LDKCResult_boolPeerHandleErrorZ_get_err(long arg); + public static native boolean LDKCResult_NodeIdDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_NodeIdDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_NodeIdDecodeErrorZ_get_err(long arg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKAccess { + get_utxo (genesis_hash: Uint8Array, short_channel_id: number): number; + } + + export function LDKAccess_new(impl: LDKAccess): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess *NONNULL_PTR this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id + export function Access_get_utxo(this_arg: number, genesis_hash: Uint8Array, short_channel_id: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Access_get_utxo(this_arg, encodeArray(genesis_hash), short_channel_id); + return nativeResponseValue; + } + public static class LDKCOption_AccessZ { + private LDKCOption_AccessZ() {} + export class Some extends LDKCOption_AccessZ { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_AccessZ { + None() { } + } + static native void init(); + } + static { LDKCOption_AccessZ.init(); } + public static native LDKCOption_AccessZ LDKCOption_AccessZ_ref_from_ptr(long ptr); + public static native boolean LDKCResult_DirectionalChannelInfoDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_DirectionalChannelInfoDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_ChannelInfoDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_ChannelInfoDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ChannelInfoDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_RoutingFeesDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_RoutingFeesDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_RoutingFeesDecodeErrorZ_get_err(long arg); + public static native boolean LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(long arg); + public static native number LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long arg); public static native long LDKCVec_u64Z_new(number[] elems); public static native boolean LDKCResult_NodeInfoDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NodeInfoDecodeErrorZ_get_ok(long arg); @@ -1131,12 +1597,19 @@ public static native long new_empty_slice_vec(); public static native boolean LDKCResult_NetworkGraphDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NetworkGraphDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NetworkGraphDecodeErrorZ_get_err(long arg); - public static native boolean LDKCResult_NetAddressu8Z_result_ok(long arg); - public static native number LDKCResult_NetAddressu8Z_get_ok(long arg); - public static native number LDKCResult_NetAddressu8Z_get_err(long arg); - public static native boolean LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(long arg); - public static native number LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(long arg); - public static native number LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(long arg); + public static class LDKCOption_CVec_NetAddressZZ { + private LDKCOption_CVec_NetAddressZZ() {} + export class Some extends LDKCOption_CVec_NetAddressZZ { + public number[] some; + Some(number[] some) { this.some = some; } + } + export class None extends LDKCOption_CVec_NetAddressZZ { + None() { } + } + static native void init(); + } + static { LDKCOption_CVec_NetAddressZZ.init(); } + public static native LDKCOption_CVec_NetAddressZZ LDKCOption_CVec_NetAddressZZ_ref_from_ptr(long ptr); public static native boolean LDKCResult_NetAddressDecodeErrorZ_result_ok(long arg); public static native number LDKCResult_NetAddressDecodeErrorZ_get_ok(long arg); public static native number LDKCResult_NetAddressDecodeErrorZ_get_err(long arg); @@ -1259,6 +1732,56 @@ public static native long new_empty_slice_vec(); +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKFilter { + register_tx (txid: Uint8Array, script_pubkey: Uint8Array): void; + register_output (output: number): number; + } + + export function LDKFilter_new(impl: LDKFilter): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + // void Filter_register_tx LDKFilter *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey + export function Filter_register_tx(this_arg: number, txid: Uint8Array, script_pubkey: Uint8Array): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Filter_register_tx(this_arg, encodeArray(txid), encodeArray(script_pubkey)); + // debug statements here + } + // LDKCOption_C2Tuple_usizeTransactionZZ Filter_register_output LDKFilter *NONNULL_PTR this_arg, struct LDKWatchedOutput output + export function Filter_register_output(this_arg: number, output: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Filter_register_output(this_arg, output); + return nativeResponseValue; + } + public static class LDKCOption_FilterZ { + private LDKCOption_FilterZ() {} + export class Some extends LDKCOption_FilterZ { + public number some; + Some(number some) { this.some = some; } + } + export class None extends LDKCOption_FilterZ { + None() { } + } + static native void init(); + } + static { LDKCOption_FilterZ.init(); } + public static native LDKCOption_FilterZ LDKCOption_FilterZ_ref_from_ptr(long ptr); + public static native boolean LDKCResult_LockedChannelMonitorNoneZ_result_ok(long arg); + public static native number LDKCResult_LockedChannelMonitorNoneZ_get_ok(long arg); + public static native void LDKCResult_LockedChannelMonitorNoneZ_get_err(long arg); + public static native long LDKCVec_OutPointZ_new(number[] elems); + + + // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START export interface LDKMessageSendEventsProvider { @@ -1296,7 +1819,7 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, struct LDKEvent event + // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, const struct LDKEvent *NONNULL_PTR event export function EventHandler_handle_event(this_arg: number, event: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1331,30 +1854,6 @@ public static native long new_empty_slice_vec(); -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - - export interface LDKAccess { - get_utxo (genesis_hash: Uint8Array, short_channel_id: number): number; - } - - export function LDKAccess_new(impl: LDKAccess): number { - throw new Error('unimplemented'); // TODO: bind to WASM - } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - - // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess *NONNULL_PTR this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id - export function Access_get_utxo(this_arg: number, genesis_hash: Uint8Array, short_channel_id: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Access_get_utxo(this_arg, encodeArray(genesis_hash), short_channel_id); - return nativeResponseValue; - } - - - // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START export interface LDKListen { @@ -1439,44 +1938,11 @@ public static native long new_empty_slice_vec(); -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - - export interface LDKFilter { - register_tx (txid: Uint8Array, script_pubkey: Uint8Array): void; - register_output (output: number): number; - } - - export function LDKFilter_new(impl: LDKFilter): number { - throw new Error('unimplemented'); // TODO: bind to WASM - } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - - // void Filter_register_tx LDKFilter *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey - export function Filter_register_tx(this_arg: number, txid: Uint8Array, script_pubkey: Uint8Array): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Filter_register_tx(this_arg, encodeArray(txid), encodeArray(script_pubkey)); - // debug statements here - } - // LDKCOption_C2Tuple_usizeTransactionZZ Filter_register_output LDKFilter *NONNULL_PTR this_arg, struct LDKWatchedOutput output - export function Filter_register_output(this_arg: number, output: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Filter_register_output(this_arg, output); - return nativeResponseValue; - } - - - // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START export interface LDKPersist { - persist_new_channel (id: number, data: number): number; - update_persisted_channel (id: number, update: number, data: number): number; + persist_new_channel (channel_id: number, data: number, update_id: number): number; + update_persisted_channel (channel_id: number, update: number, data: number, update_id: number): number; } export function LDKPersist_new(impl: LDKPersist): number { @@ -1486,20 +1952,20 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data - export function Persist_persist_new_channel(this_arg: number, id: number, data: number): number { + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id + export function Persist_persist_new_channel(this_arg: number, channel_id: number, data: number, update_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Persist_persist_new_channel(this_arg, id, data); + const nativeResponseValue = wasm.Persist_persist_new_channel(this_arg, channel_id, data, update_id); return nativeResponseValue; } - // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data - export function Persist_update_persisted_channel(this_arg: number, id: number, update: number, data: number): number { + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id + export function Persist_update_persisted_channel(this_arg: number, channel_id: number, update: number, data: number, update_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Persist_update_persisted_channel(this_arg, id, update, data); + const nativeResponseValue = wasm.Persist_update_persisted_channel(this_arg, channel_id, update, data, update_id); return nativeResponseValue; } @@ -1706,7 +2172,6 @@ public static native long new_empty_slice_vec(); handle_node_announcement (msg: number): number; handle_channel_announcement (msg: number): number; handle_channel_update (msg: number): number; - handle_htlc_fail_channel_update (update: number): void; get_next_channel_announcements (starting_point: number, batch_amount: number): number[]; get_next_node_announcements (starting_point: Uint8Array, batch_amount: number): number[]; sync_routing_table (their_node_id: Uint8Array, init: number): void; @@ -1747,14 +2212,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingMessageHandler_handle_channel_update(this_arg, msg); return nativeResponseValue; } - // void RoutingMessageHandler_handle_htlc_fail_channel_update LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update - export function RoutingMessageHandler_handle_htlc_fail_channel_update(this_arg: number, update: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RoutingMessageHandler_handle_htlc_fail_channel_update(this_arg, update); - // debug statements here - } // LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcements LDKRoutingMessageHandler *NONNULL_PTR this_arg, uint64_t starting_point, uint8_t batch_amount export function RoutingMessageHandler_get_next_channel_announcements(this_arg: number, starting_point: number, batch_amount: number): number[] { if(!isWasmInitialized) { @@ -1814,6 +2271,63 @@ public static native long new_empty_slice_vec(); +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKCustomMessageReader { + read (message_type: number, buffer: Uint8Array): number; + } + + export function LDKCustomMessageReader_new(impl: LDKCustomMessageReader): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + // LDKCResult_COption_TypeZDecodeErrorZ CustomMessageReader_read LDKCustomMessageReader *NONNULL_PTR this_arg, uint16_t message_type, struct LDKu8slice buffer + export function CustomMessageReader_read(this_arg: number, message_type: number, buffer: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CustomMessageReader_read(this_arg, message_type, encodeArray(buffer)); + return nativeResponseValue; + } + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKCustomMessageHandler { + handle_custom_message (msg: number, sender_node_id: Uint8Array): number; + get_and_clear_pending_msg (): number[]; + } + + export function LDKCustomMessageHandler_new(impl: LDKCustomMessageHandler, CustomMessageReader: LDKCustomMessageReader): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + // LDKCResult_NoneLightningErrorZ CustomMessageHandler_handle_custom_message LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id + export function CustomMessageHandler_handle_custom_message(this_arg: number, msg: number, sender_node_id: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CustomMessageHandler_handle_custom_message(this_arg, msg, encodeArray(sender_node_id)); + return nativeResponseValue; + } + // LDKCVec_C2Tuple_PublicKeyTypeZZ CustomMessageHandler_get_and_clear_pending_msg LDKCustomMessageHandler *NONNULL_PTR this_arg + export function CustomMessageHandler_get_and_clear_pending_msg(this_arg: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CustomMessageHandler_get_and_clear_pending_msg(this_arg); + return nativeResponseValue; + } + + + // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START export interface LDKSocketDescriptor { @@ -1859,44 +2373,161 @@ public static native long new_empty_slice_vec(); // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - export interface LDKChannelManagerPersister { - persist_manager (channel_manager: number): number; + export interface LDKScore { + channel_penalty_msat (short_channel_id: number, source: number, target: number): number; + payment_path_failed (path: number[], short_channel_id: number): void; + write (): Uint8Array; } - export function LDKChannelManagerPersister_new(impl: LDKChannelManagerPersister): number { + export function LDKScore_new(impl: LDKScore): number { throw new Error('unimplemented'); // TODO: bind to WASM } // OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - // LDKCResult_NoneErrorZ ChannelManagerPersister_persist_manager LDKChannelManagerPersister *NONNULL_PTR this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager - export function ChannelManagerPersister_persist_manager(this_arg: number, channel_manager: number): number { + // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target + export function Score_channel_penalty_msat(this_arg: number, short_channel_id: number, source: number, target: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelManagerPersister_persist_manager(this_arg, channel_manager); + const nativeResponseValue = wasm.Score_channel_penalty_msat(this_arg, short_channel_id, source, target); return nativeResponseValue; } - public static class LDKFallback { - private LDKFallback() {} - export class SegWitProgram extends LDKFallback { - public number version; - public Uint8Array program; - SegWitProgram(number version, Uint8Array program) { this.version = version; this.program = program; } - } - export class PubKeyHash extends LDKFallback { - public Uint8Array pub_key_hash; - PubKeyHash(Uint8Array pub_key_hash) { this.pub_key_hash = pub_key_hash; } - } - export class ScriptHash extends LDKFallback { - public Uint8Array script_hash; - ScriptHash(Uint8Array script_hash) { this.script_hash = script_hash; } + // void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id + export function Score_payment_path_failed(this_arg: number, path: number[], short_channel_id: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); } - static native void init(); + const nativeResponseValue = wasm.Score_payment_path_failed(this_arg, path, short_channel_id); + // debug statements here } - static { LDKFallback.init(); } + // LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg + export function Score_write(this_arg: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Score_write(this_arg); + return decodeArray(nativeResponseValue); + } + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKChannelManagerPersister { + persist_manager (channel_manager: number): number; + } + + export function LDKChannelManagerPersister_new(impl: LDKChannelManagerPersister): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + // LDKCResult_NoneErrorZ ChannelManagerPersister_persist_manager LDKChannelManagerPersister *NONNULL_PTR this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager + export function ChannelManagerPersister_persist_manager(this_arg: number, channel_manager: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelManagerPersister_persist_manager(this_arg, channel_manager); + return nativeResponseValue; + } + public static class LDKFallback { + private LDKFallback() {} + export class SegWitProgram extends LDKFallback { + public number version; + public Uint8Array program; + SegWitProgram(number version, Uint8Array program) { this.version = version; this.program = program; } + } + export class PubKeyHash extends LDKFallback { + public Uint8Array pub_key_hash; + PubKeyHash(Uint8Array pub_key_hash) { this.pub_key_hash = pub_key_hash; } + } + export class ScriptHash extends LDKFallback { + public Uint8Array script_hash; + ScriptHash(Uint8Array script_hash) { this.script_hash = script_hash; } + } + static native void init(); + } + static { LDKFallback.init(); } public static native LDKFallback LDKFallback_ref_from_ptr(long ptr); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKPayer { + node_id (): Uint8Array; + first_hops (): number[]; + send_payment (route: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number; + retry_payment (route: number, payment_id: Uint8Array): number; + } + + export function LDKPayer_new(impl: LDKPayer): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + // LDKPublicKey Payer_node_id LDKPayer *NONNULL_PTR this_arg + export function Payer_node_id(this_arg: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payer_node_id(this_arg); + return decodeArray(nativeResponseValue); + } + // LDKCVec_ChannelDetailsZ Payer_first_hops LDKPayer *NONNULL_PTR this_arg + export function Payer_first_hops(this_arg: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payer_first_hops(this_arg); + return nativeResponseValue; + } + // LDKCResult_PaymentIdPaymentSendFailureZ Payer_send_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret + export function Payer_send_payment(this_arg: number, route: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payer_send_payment(this_arg, route, encodeArray(payment_hash), encodeArray(payment_secret)); + return nativeResponseValue; + } + // LDKCResult_NonePaymentSendFailureZ Payer_retry_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id + export function Payer_retry_payment(this_arg: number, route: number, payment_id: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payer_retry_payment(this_arg, route, encodeArray(payment_id)); + return nativeResponseValue; + } + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKRouter { + find_route (payer: Uint8Array, params: number, first_hops: number[], scorer: number): number; + } + + export function LDKRouter_new(impl: LDKRouter): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer + export function Router_find_route(this_arg: number, payer: Uint8Array, params: number, first_hops: number[], scorer: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Router_find_route(this_arg, encodeArray(payer), params, first_hops, scorer); + return nativeResponseValue; + } // struct LDKStr _ldk_get_compiled_version(void); export function _ldk_get_compiled_version(): String { if(!isWasmInitialized) { @@ -2305,6 +2936,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o); + export function CResult_TrustedClosingTransactionNoneZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TrustedClosingTransactionNoneZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void); + export function CResult_TrustedClosingTransactionNoneZ_err(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TrustedClosingTransactionNoneZ_err(); + return nativeResponseValue; + } + // void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res); + export function CResult_TrustedClosingTransactionNoneZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_TrustedClosingTransactionNoneZ_free(_res); + // debug statements here + } // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o); export function CResult_CommitmentTransactionDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { @@ -2449,6 +3104,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res); // debug statements here } + // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig); + export function CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig); + return nativeResponseValue; + } // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void); export function CResult_NoneErrorZ_ok(): number { if(!isWasmInitialized) { @@ -2561,6 +3224,46 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_RouteDecodeErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o); + export function CResult_RouteParametersDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_RouteParametersDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res); + export function CResult_RouteParametersDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig); + export function CResult_RouteParametersDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteParametersDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); + export function CVec_RouteHintZ_free(_res: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CVec_RouteHintZ_free(_res); + // debug statements here + } // struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); export function COption_u64Z_some(o: number): number { if(!isWasmInitialized) { @@ -2593,20 +3296,116 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_u64Z_clone(orig); return nativeResponseValue; } - // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); - export function CVec_ChannelDetailsZ_free(_res: number[]): void { + // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_ok(struct LDKPayee o); + export function CResult_PayeeDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CVec_ChannelDetailsZ_free(_res); + const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_PayeeDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_PayeeDecodeErrorZ_free(struct LDKCResult_PayeeDecodeErrorZ _res); + export function CResult_PayeeDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_free(_res); // debug statements here } - // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); - export function CVec_RouteHintZ_free(_res: number[]): void { + // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_clone(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR orig); + export function CResult_PayeeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CVec_RouteHintZ_free(_res); + const nativeResponseValue = wasm.CResult_PayeeDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); + export function CVec_RouteHintHopZ_free(_res: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CVec_RouteHintHopZ_free(_res); + // debug statements here + } + // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o); + export function CResult_RouteHintDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_RouteHintDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res); + export function CResult_RouteHintDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig); + export function CResult_RouteHintDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o); + export function CResult_RouteHintHopDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_RouteHintHopDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res); + export function CResult_RouteHintHopDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig); + export function CResult_RouteHintHopDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_RouteHintHopDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); + export function CVec_ChannelDetailsZ_free(_res: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CVec_ChannelDetailsZ_free(_res); // debug statements here } // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); @@ -2785,6 +3584,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.COption_C2Tuple_usizeTransactionZZ_clone(orig); return nativeResponseValue; } + // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); + export function COption_NetworkUpdateZ_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_NetworkUpdateZ_some(o); + return nativeResponseValue; + } + // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void); + export function COption_NetworkUpdateZ_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_NetworkUpdateZ_none(); + return nativeResponseValue; + } + // void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res); + export function COption_NetworkUpdateZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_NetworkUpdateZ_free(_res); + // debug statements here + } + // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig); + export function COption_NetworkUpdateZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_NetworkUpdateZ_clone(orig); + return nativeResponseValue; + } // void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res); export function CVec_SpendableOutputDescriptorZ_free(_res: number[]): void { if(!isWasmInitialized) { @@ -2897,55 +3728,103 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceFeaturesDecodeErrorZ_free(_res); // debug statements here } - // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); - export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o: number): number { + // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o); + export function CResult_ScoringParametersDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o); + const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_ok(o); return nativeResponseValue; } - // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); - export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e: number): number { + // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_ScoringParametersDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e); + const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_err(e); return nativeResponseValue; } - // void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res); - export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res: number): void { + // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res); + export function CResult_ScoringParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res); + const nativeResponseValue = wasm.CResult_ScoringParametersDecodeErrorZ_free(_res); // debug statements here } - // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); - export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig: number): number { + // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o); + export function CResult_ScorerDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig); + const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_ok(o); return nativeResponseValue; } - // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o); - export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o: number): number { + // struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_ScorerDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o); + const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_err(e); return nativeResponseValue; } - // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); - export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e: number): number { + // void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res); + export function CResult_ScorerDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e); - return nativeResponseValue; + const nativeResponseValue = wasm.CResult_ScorerDecodeErrorZ_free(_res); + // debug statements here } - // void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res); + // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); + export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res); + export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); + export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o); + export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res); export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2993,6 +3872,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); + export function CResult_NoneNoneZ_ok(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneNoneZ_ok(); + return nativeResponseValue; + } + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); + export function CResult_NoneNoneZ_err(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneNoneZ_err(); + return nativeResponseValue; + } + // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); + export function CResult_NoneNoneZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneNoneZ_free(_res); + // debug statements here + } + // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); + export function CResult_NoneNoneZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneNoneZ_clone(orig); + return nativeResponseValue; + } // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig); export function C2Tuple_SignatureCVec_SignatureZZ_clone(orig: number): number { if(!isWasmInitialized) { @@ -3265,6 +4176,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_TransactionNoneZ_clone(orig); return nativeResponseValue; } + // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_clone(const struct LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR orig); + export function C2Tuple_BlockHashChannelMonitorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_BlockHashChannelMonitorZ_clone(orig); + return nativeResponseValue; + } // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); export function C2Tuple_BlockHashChannelMonitorZ_new(a: Uint8Array, b: number): number { if(!isWasmInitialized) { @@ -3313,6 +4232,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res); // debug statements here } + // struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR orig); + export function CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig); + return nativeResponseValue; + } // struct LDKCOption_u16Z COption_u16Z_some(uint16_t o); export function COption_u16Z_some(o: number): number { if(!isWasmInitialized) { @@ -3393,6 +4320,70 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CVec_APIErrorZ_free(_res); // debug statements here } + // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o); + export function CResult__u832APIErrorZ_ok(o: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult__u832APIErrorZ_ok(encodeArray(o)); + return nativeResponseValue; + } + // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e); + export function CResult__u832APIErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult__u832APIErrorZ_err(e); + return nativeResponseValue; + } + // void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res); + export function CResult__u832APIErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult__u832APIErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig); + export function CResult__u832APIErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult__u832APIErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o); + export function CResult_PaymentIdPaymentSendFailureZ_ok(o: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_ok(encodeArray(o)); + return nativeResponseValue; + } + // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); + export function CResult_PaymentIdPaymentSendFailureZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_err(e); + return nativeResponseValue; + } + // void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res); + export function CResult_PaymentIdPaymentSendFailureZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_free(_res); + // debug statements here + } + // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig); + export function CResult_PaymentIdPaymentSendFailureZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentSendFailureZ_clone(orig); + return nativeResponseValue; + } // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); export function CResult_NonePaymentSendFailureZ_ok(): number { if(!isWasmInitialized) { @@ -3425,36 +4416,60 @@ 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 { + // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig); + export function C2Tuple_PaymentHashPaymentIdZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_clone(orig); + return nativeResponseValue; + } + // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); + export function C2Tuple_PaymentHashPaymentIdZ_new(a: Uint8Array, b: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_new(encodeArray(a), encodeArray(b)); + return nativeResponseValue; + } + // void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res); + export function C2Tuple_PaymentHashPaymentIdZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PaymentHashPaymentIdZ_free(_res); + // debug statements here + } + // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o); + export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_PaymentHashPaymentSendFailureZ_ok(encodeArray(o)); + const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o); return nativeResponseValue; } - // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); - export function CResult_PaymentHashPaymentSendFailureZ_err(e: number): number { + // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); + export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_PaymentHashPaymentSendFailureZ_err(e); + const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e); return nativeResponseValue; } - // void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res); - export function CResult_PaymentHashPaymentSendFailureZ_free(_res: number): void { + // void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res); + export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_PaymentHashPaymentSendFailureZ_free(_res); + const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_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 { + // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig); + export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_PaymentHashPaymentSendFailureZ_clone(orig); + const nativeResponseValue = wasm.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig); return nativeResponseValue; } // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); @@ -3633,6 +4648,102 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_OutPointDecodeErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); + export function COption_TypeZ_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_TypeZ_some(o); + return nativeResponseValue; + } + // struct LDKCOption_TypeZ COption_TypeZ_none(void); + export function COption_TypeZ_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_TypeZ_none(); + return nativeResponseValue; + } + // void COption_TypeZ_free(struct LDKCOption_TypeZ _res); + export function COption_TypeZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_TypeZ_free(_res); + // debug statements here + } + // struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig); + export function COption_TypeZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_TypeZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o); + export function CResult_COption_TypeZDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_COption_TypeZDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res); + export function CResult_COption_TypeZDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig); + export function CResult_COption_TypeZDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_COption_TypeZDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o); + export function CResult_PaymentIdPaymentErrorZ_ok(o: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_ok(encodeArray(o)); + return nativeResponseValue; + } + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e); + export function CResult_PaymentIdPaymentErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res); + export function CResult_PaymentIdPaymentErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig); + export function CResult_PaymentIdPaymentErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_PaymentIdPaymentErrorZ_clone(orig); + return nativeResponseValue; + } // struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o); export function CResult_SiPrefixNoneZ_ok(o: SiPrefix): number { if(!isWasmInitialized) { @@ -4273,6 +5384,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res); // debug statements here } + // void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res); + export function CVec_BalanceZ_free(_res: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CVec_BalanceZ_free(_res); + // debug statements here + } // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o); export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { @@ -4297,6 +5416,78 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res); // debug statements here } + // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR orig); + export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); + export function CResult_NoneLightningErrorZ_ok(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_ok(); + return nativeResponseValue; + } + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); + export function CResult_NoneLightningErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); + export function CResult_NoneLightningErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); + export function CResult_NoneLightningErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig); + export function C2Tuple_PublicKeyTypeZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PublicKeyTypeZ_clone(orig); + return nativeResponseValue; + } + // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b); + export function C2Tuple_PublicKeyTypeZ_new(a: Uint8Array, b: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PublicKeyTypeZ_new(encodeArray(a), b); + return nativeResponseValue; + } + // void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res); + export function C2Tuple_PublicKeyTypeZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.C2Tuple_PublicKeyTypeZ_free(_res); + // debug statements here + } + // void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res); + export function CVec_C2Tuple_PublicKeyTypeZZ_free(_res: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CVec_C2Tuple_PublicKeyTypeZZ_free(_res); + // debug statements here + } // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); export function CResult_boolLightningErrorZ_ok(o: boolean): number { if(!isWasmInitialized) { @@ -4369,38 +5560,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CVec_NodeAnnouncementZ_free(_res); // debug statements here } - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); - export function CResult_NoneLightningErrorZ_ok(): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_ok(); - return nativeResponseValue; - } - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); - export function CResult_NoneLightningErrorZ_err(e: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_err(e); - return nativeResponseValue; - } - // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); - export function CResult_NoneLightningErrorZ_free(_res: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_free(_res); - // debug statements here - } - // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); - export function CResult_NoneLightningErrorZ_clone(orig: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.CResult_NoneLightningErrorZ_clone(orig); - return nativeResponseValue; - } // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); export function CVec_PublicKeyZ_free(_res: Uint8Array[]): void { if(!isWasmInitialized) { @@ -4505,6 +5664,62 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_boolPeerHandleErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o); + export function CResult_NodeIdDecodeErrorZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e); + export function CResult_NodeIdDecodeErrorZ_err(e: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_err(e); + return nativeResponseValue; + } + // void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res); + export function CResult_NodeIdDecodeErrorZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_free(_res); + // debug statements here + } + // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); + export function CResult_NodeIdDecodeErrorZ_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_NodeIdDecodeErrorZ_clone(orig); + return nativeResponseValue; + } + // struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o); + export function COption_AccessZ_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_AccessZ_some(o); + return nativeResponseValue; + } + // struct LDKCOption_AccessZ COption_AccessZ_none(void); + export function COption_AccessZ_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_AccessZ_none(); + return nativeResponseValue; + } + // void COption_AccessZ_free(struct LDKCOption_AccessZ _res); + export function COption_AccessZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_AccessZ_free(_res); + // debug statements here + } // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o); export function CResult_DirectionalChannelInfoDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { @@ -4705,68 +5920,36 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_NetworkGraphDecodeErrorZ_clone(orig); return nativeResponseValue; } - // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o); - export function CResult_NetAddressu8Z_ok(o: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.CResult_NetAddressu8Z_ok(o); - return nativeResponseValue; - } - // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e); - export function CResult_NetAddressu8Z_err(e: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.CResult_NetAddressu8Z_err(e); - return nativeResponseValue; - } - // void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res); - export function CResult_NetAddressu8Z_free(_res: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.CResult_NetAddressu8Z_free(_res); - // debug statements here - } - // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig); - export function CResult_NetAddressu8Z_clone(orig: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.CResult_NetAddressu8Z_clone(orig); - return nativeResponseValue; - } - // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o); - export function CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o: number): number { + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o); + export function COption_CVec_NetAddressZZ_some(o: number[]): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o); + const nativeResponseValue = wasm.COption_CVec_NetAddressZZ_some(o); return nativeResponseValue; } - // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e); - export function CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e: number): number { + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void); + export function COption_CVec_NetAddressZZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e); + const nativeResponseValue = wasm.COption_CVec_NetAddressZZ_none(); return nativeResponseValue; } - // void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res); - export function CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res: number): void { + // void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res); + export function COption_CVec_NetAddressZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_CResult_NetAddressu8ZDecodeErrorZ_free(_res); + const nativeResponseValue = wasm.COption_CVec_NetAddressZZ_free(_res); // debug statements here } - // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig); - export function CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig: number): number { + // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig); + export function COption_CVec_NetAddressZZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(orig); + const nativeResponseValue = wasm.COption_CVec_NetAddressZZ_clone(orig); return nativeResponseValue; } // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o); @@ -5889,6 +7072,62 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CResult_InvoiceSignOrCreationErrorZ_clone(orig); return nativeResponseValue; } + // struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o); + export function COption_FilterZ_some(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_FilterZ_some(o); + return nativeResponseValue; + } + // struct LDKCOption_FilterZ COption_FilterZ_none(void); + export function COption_FilterZ_none(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_FilterZ_none(); + return nativeResponseValue; + } + // void COption_FilterZ_free(struct LDKCOption_FilterZ _res); + export function COption_FilterZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.COption_FilterZ_free(_res); + // debug statements here + } + // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o); + export function CResult_LockedChannelMonitorNoneZ_ok(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_LockedChannelMonitorNoneZ_ok(o); + return nativeResponseValue; + } + // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void); + export function CResult_LockedChannelMonitorNoneZ_err(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_LockedChannelMonitorNoneZ_err(); + return nativeResponseValue; + } + // void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res); + export function CResult_LockedChannelMonitorNoneZ_free(_res: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CResult_LockedChannelMonitorNoneZ_free(_res); + // debug statements here + } + // void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res); + export function CVec_OutPointZ_free(_res: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CVec_OutPointZ_free(_res); + // debug statements here + } // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); export function PaymentPurpose_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -5921,6 +7160,86 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PaymentPurpose_spontaneous_payment(encodeArray(a)); return nativeResponseValue; } + // void ClosureReason_free(struct LDKClosureReason this_ptr); + export function ClosureReason_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_free(this_ptr); + // debug statements here + } + // struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig); + export function ClosureReason_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_clone(orig); + return nativeResponseValue; + } + // struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg); + export function ClosureReason_counterparty_force_closed(peer_msg: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_counterparty_force_closed(peer_msg); + return nativeResponseValue; + } + // struct LDKClosureReason ClosureReason_holder_force_closed(void); + export function ClosureReason_holder_force_closed(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_holder_force_closed(); + return nativeResponseValue; + } + // struct LDKClosureReason ClosureReason_cooperative_closure(void); + export function ClosureReason_cooperative_closure(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_cooperative_closure(); + return nativeResponseValue; + } + // struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void); + export function ClosureReason_commitment_tx_confirmed(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_commitment_tx_confirmed(); + return nativeResponseValue; + } + // struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err); + export function ClosureReason_processing_error(err: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_processing_error(err); + return nativeResponseValue; + } + // struct LDKClosureReason ClosureReason_disconnected_peer(void); + export function ClosureReason_disconnected_peer(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_disconnected_peer(); + return nativeResponseValue; + } + // struct LDKClosureReason ClosureReason_outdated_channel_manager(void); + export function ClosureReason_outdated_channel_manager(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_outdated_channel_manager(); + return nativeResponseValue; + } + // struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj); + export function ClosureReason_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosureReason_write(obj); + return decodeArray(nativeResponseValue); + } // void Event_free(struct LDKEvent this_ptr); export function Event_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -5953,20 +7272,20 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Event_payment_received(encodeArray(payment_hash), amt, purpose); return nativeResponseValue; } - // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage); - export function Event_payment_sent(payment_preimage: Uint8Array): number { + // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat); + export function Event_payment_sent(payment_id: Uint8Array, payment_preimage: Uint8Array, payment_hash: Uint8Array, fee_paid_msat: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Event_payment_sent(encodeArray(payment_preimage)); + const nativeResponseValue = wasm.Event_payment_sent(encodeArray(payment_id), encodeArray(payment_preimage), encodeArray(payment_hash), fee_paid_msat); return nativeResponseValue; } - // 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 { + // struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry); + export function Event_payment_path_failed(payment_id: Uint8Array, payment_hash: Uint8Array, rejected_by_dest: boolean, network_update: number, all_paths_failed: boolean, path: number[], short_channel_id: number, retry: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Event_payment_failed(encodeArray(payment_hash), rejected_by_dest); + const nativeResponseValue = wasm.Event_payment_path_failed(encodeArray(payment_id), encodeArray(payment_hash), rejected_by_dest, network_update, all_paths_failed, path, short_channel_id, retry); return nativeResponseValue; } // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable); @@ -5993,6 +7312,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Event_payment_forwarded(fee_earned_msat, claim_from_onchain_tx); return nativeResponseValue; } + // struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason); + export function Event_channel_closed(channel_id: Uint8Array, user_channel_id: number, reason: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Event_channel_closed(encodeArray(channel_id), user_channel_id, reason); + return nativeResponseValue; + } + // struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction); + export function Event_discard_funding(channel_id: Uint8Array, transaction: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Event_discard_funding(encodeArray(channel_id), encodeArray(transaction)); + return nativeResponseValue; + } // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); export function Event_write(obj: number): Uint8Array { if(!isWasmInitialized) { @@ -6145,14 +7480,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MessageSendEvent_handle_error(encodeArray(node_id), action); return nativeResponseValue; } - // 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.MessageSendEvent_payment_failure_network_update(update); - return nativeResponseValue; - } // 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) { @@ -6961,6 +8288,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Confirm_free(this_ptr); // debug statements here } + // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig); + export function ChannelMonitorUpdateErr_clone(orig: number): ChannelMonitorUpdateErr { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + 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 Watch_free(struct LDKWatch this_ptr); export function Watch_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -7113,124 +8464,180 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.FeeEstimator_free(this_ptr); // debug statements here } - // void ChainMonitor_free(struct LDKChainMonitor this_obj); - export function ChainMonitor_free(this_obj: number): void { + // void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj); + export function MonitorUpdateId_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChainMonitor_free(this_obj); + const nativeResponseValue = wasm.MonitorUpdateId_free(this_obj); // debug statements here } - // MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister); - export function ChainMonitor_new(chain_source: number, broadcaster: number, logger: number, feeest: number, persister: number): number { + // struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig); + export function MonitorUpdateId_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChainMonitor_new(chain_source, broadcaster, logger, feeest, persister); + const nativeResponseValue = wasm.MonitorUpdateId_clone(orig); return nativeResponseValue; } - // struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg); - export function ChainMonitor_as_Listen(this_arg: number): number { + // uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o); + export function MonitorUpdateId_hash(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChainMonitor_as_Listen(this_arg); + const nativeResponseValue = wasm.MonitorUpdateId_hash(o); return nativeResponseValue; } - // struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg); - export function ChainMonitor_as_Confirm(this_arg: number): number { + // bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b); + export function MonitorUpdateId_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChainMonitor_as_Confirm(this_arg); + const nativeResponseValue = wasm.MonitorUpdateId_eq(a, b); return nativeResponseValue; } - // struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg); - export function ChainMonitor_as_Watch(this_arg: number): number { + // void Persist_free(struct LDKPersist this_ptr); + export function Persist_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChainMonitor_as_Watch(this_arg); - return nativeResponseValue; + const nativeResponseValue = wasm.Persist_free(this_ptr); + // debug statements here } - // struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg); - export function ChainMonitor_as_EventsProvider(this_arg: number): number { + // void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj); + export function LockedChannelMonitor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChainMonitor_as_EventsProvider(this_arg); - return nativeResponseValue; + const nativeResponseValue = wasm.LockedChannelMonitor_free(this_obj); + // debug statements here } - // void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj); - export function ChannelMonitorUpdate_free(this_obj: number): void { + // void ChainMonitor_free(struct LDKChainMonitor this_obj); + export function ChainMonitor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdate_free(this_obj); + const nativeResponseValue = wasm.ChainMonitor_free(this_obj); // debug statements here } - // uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr); - export function ChannelMonitorUpdate_get_update_id(this_ptr: number): number { + // MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister); + export function ChainMonitor_new(chain_source: number, broadcaster: number, logger: number, feeest: number, persister: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdate_get_update_id(this_ptr); + const nativeResponseValue = wasm.ChainMonitor_new(chain_source, broadcaster, logger, feeest, persister); return nativeResponseValue; } - // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); - export function ChannelMonitorUpdate_set_update_id(this_ptr: number, val: number): void { + // MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels); + export function ChainMonitor_get_claimable_balances(this_arg: number, ignored_channels: number[]): number[] { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdate_set_update_id(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.ChainMonitor_get_claimable_balances(this_arg, ignored_channels); + return nativeResponseValue; } - // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); - export function ChannelMonitorUpdate_clone(orig: number): number { + // MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo); + export function ChainMonitor_get_monitor(this_arg: number, funding_txo: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdate_clone(orig); + const nativeResponseValue = wasm.ChainMonitor_get_monitor(this_arg, funding_txo); return nativeResponseValue; } - // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); - export function ChannelMonitorUpdate_write(obj: number): Uint8Array { + // MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg); + export function ChainMonitor_list_monitors(this_arg: number): number[] { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdate_write(obj); - return decodeArray(nativeResponseValue); + const nativeResponseValue = wasm.ChainMonitor_list_monitors(this_arg); + return nativeResponseValue; } - // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser); - export function ChannelMonitorUpdate_read(ser: Uint8Array): number { + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id); + export function ChainMonitor_channel_monitor_updated(this_arg: number, funding_txo: number, completed_update_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdate_read(encodeArray(ser)); + const nativeResponseValue = wasm.ChainMonitor_channel_monitor_updated(this_arg, funding_txo, completed_update_id); return nativeResponseValue; } - // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig); - export function ChannelMonitorUpdateErr_clone(orig: number): ChannelMonitorUpdateErr { + // struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg); + export function ChainMonitor_as_Listen(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdateErr_clone(orig); + const nativeResponseValue = wasm.ChainMonitor_as_Listen(this_arg); return nativeResponseValue; } - // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void); - export function ChannelMonitorUpdateErr_temporary_failure(): ChannelMonitorUpdateErr { + // struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg); + export function ChainMonitor_as_Confirm(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdateErr_temporary_failure(); + const nativeResponseValue = wasm.ChainMonitor_as_Confirm(this_arg); return nativeResponseValue; } - // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void); - export function ChannelMonitorUpdateErr_permanent_failure(): ChannelMonitorUpdateErr { + // struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg); + export function ChainMonitor_as_Watch(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelMonitorUpdateErr_permanent_failure(); + const nativeResponseValue = wasm.ChainMonitor_as_Watch(this_arg); + return nativeResponseValue; + } + // struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg); + export function ChainMonitor_as_EventsProvider(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChainMonitor_as_EventsProvider(this_arg); + return nativeResponseValue; + } + // void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj); + export function ChannelMonitorUpdate_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdate_free(this_obj); + // debug statements here + } + // uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr); + export function ChannelMonitorUpdate_get_update_id(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdate_get_update_id(this_ptr); + return nativeResponseValue; + } + // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); + export function ChannelMonitorUpdate_set_update_id(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdate_set_update_id(this_ptr, val); + // debug statements here + } + // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); + export function ChannelMonitorUpdate_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdate_clone(orig); + return nativeResponseValue; + } + // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); + export function ChannelMonitorUpdate_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdate_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser); + export function ChannelMonitorUpdate_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelMonitorUpdate_read(encodeArray(ser)); return nativeResponseValue; } // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj); @@ -7241,6 +8648,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MonitorUpdateError_free(this_obj); // debug statements here } + // struct LDKStr MonitorUpdateError_get_a(const struct LDKMonitorUpdateError *NONNULL_PTR this_ptr); + export function MonitorUpdateError_get_a(this_ptr: number): String { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorUpdateError_get_a(this_ptr); + return nativeResponseValue; + } + // void MonitorUpdateError_set_a(struct LDKMonitorUpdateError *NONNULL_PTR this_ptr, struct LDKStr val); + export function MonitorUpdateError_set_a(this_ptr: number, val: String): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorUpdateError_set_a(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKMonitorUpdateError MonitorUpdateError_new(struct LDKStr a_arg); + export function MonitorUpdateError_new(a_arg: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorUpdateError_new(a_arg); + return nativeResponseValue; + } // struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig); export function MonitorUpdateError_clone(orig: number): number { if(!isWasmInitialized) { @@ -7273,14 +8704,38 @@ public static native long new_empty_slice_vec(); 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 { + // struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a); + export function MonitorEvent_commitment_tx_confirmed(a: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorEvent_commitment_tx_confirmed(a); + return nativeResponseValue; + } + // struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id); + export function MonitorEvent_update_completed(funding_txo: number, monitor_update_id: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorEvent_update_completed(funding_txo, monitor_update_id); + return nativeResponseValue; + } + // struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a); + export function MonitorEvent_update_failed(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.MonitorEvent_commitment_tx_broadcasted(a); + const nativeResponseValue = wasm.MonitorEvent_update_failed(a); return nativeResponseValue; } + // struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj); + export function MonitorEvent_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.MonitorEvent_write(obj); + return decodeArray(nativeResponseValue); + } // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj); export function HTLCUpdate_free(this_obj: number): void { if(!isWasmInitialized) { @@ -7313,6 +8768,62 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.HTLCUpdate_read(encodeArray(ser)); return nativeResponseValue; } + // void Balance_free(struct LDKBalance this_ptr); + export function Balance_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Balance_free(this_ptr); + // debug statements here + } + // struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig); + export function Balance_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Balance_clone(orig); + return nativeResponseValue; + } + // struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis); + export function Balance_claimable_on_channel_close(claimable_amount_satoshis: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Balance_claimable_on_channel_close(claimable_amount_satoshis); + return nativeResponseValue; + } + // struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height); + export function Balance_claimable_awaiting_confirmations(claimable_amount_satoshis: number, confirmation_height: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); + return nativeResponseValue; + } + // struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height); + export function Balance_contentious_claimable(claimable_amount_satoshis: number, timeout_height: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); + return nativeResponseValue; + } + // struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height); + export function Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis: number, claimable_height: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height); + return nativeResponseValue; + } + // bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b); + export function Balance_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Balance_eq(a, b); + return nativeResponseValue; + } // void ChannelMonitor_free(struct LDKChannelMonitor this_obj); export function ChannelMonitor_free(this_obj: number): void { if(!isWasmInitialized) { @@ -7457,13 +8968,13 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelMonitor_current_best_block(this_arg); return nativeResponseValue; } - // void Persist_free(struct LDKPersist this_ptr); - export function Persist_free(this_ptr: number): void { + // MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg); + export function ChannelMonitor_get_claimable_balances(this_arg: number): number[] { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Persist_free(this_ptr); - // debug statements here + const nativeResponseValue = wasm.ChannelMonitor_get_claimable_balances(this_arg); + return nativeResponseValue; } // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg); export function C2Tuple_BlockHashChannelMonitorZ_read(ser: Uint8Array, arg: number): number { @@ -8217,6 +9728,78 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChainParameters_clone(orig); return nativeResponseValue; } + // void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj); + export function CounterpartyForwardingInfo_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_free(this_obj); + // debug statements here + } + // uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); + export function CounterpartyForwardingInfo_get_fee_base_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_get_fee_base_msat(this_ptr); + return nativeResponseValue; + } + // void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val); + export function CounterpartyForwardingInfo_set_fee_base_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_set_fee_base_msat(this_ptr, val); + // debug statements here + } + // uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); + export function CounterpartyForwardingInfo_get_fee_proportional_millionths(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_get_fee_proportional_millionths(this_ptr); + return nativeResponseValue; + } + // void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val); + export function CounterpartyForwardingInfo_set_fee_proportional_millionths(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_set_fee_proportional_millionths(this_ptr, val); + // debug statements here + } + // uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); + export function CounterpartyForwardingInfo_get_cltv_expiry_delta(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_get_cltv_expiry_delta(this_ptr); + return nativeResponseValue; + } + // void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val); + export function CounterpartyForwardingInfo_set_cltv_expiry_delta(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_set_cltv_expiry_delta(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg); + export function CounterpartyForwardingInfo_new(fee_base_msat_arg: number, fee_proportional_millionths_arg: number, cltv_expiry_delta_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); + return nativeResponseValue; + } + // struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig); + export function CounterpartyForwardingInfo_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CounterpartyForwardingInfo_clone(orig); + return nativeResponseValue; + } // void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj); export function ChannelCounterparty_free(this_obj: number): void { if(!isWasmInitialized) { @@ -8273,6 +9856,30 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelCounterparty_set_unspendable_punishment_reserve(this_ptr, val); // debug statements here } + // struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); + export function ChannelCounterparty_get_forwarding_info(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelCounterparty_get_forwarding_info(this_ptr); + return nativeResponseValue; + } + // void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val); + export function ChannelCounterparty_set_forwarding_info(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelCounterparty_set_forwarding_info(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg); + export function ChannelCounterparty_new(node_id_arg: Uint8Array, features_arg: number, unspendable_punishment_reserve_arg: number, forwarding_info_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelCounterparty_new(encodeArray(node_id_arg), features_arg, unspendable_punishment_reserve_arg, forwarding_info_arg); + return nativeResponseValue; + } // struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig); export function ChannelCounterparty_clone(orig: number): number { if(!isWasmInitialized) { @@ -8385,20 +9992,20 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelDetails_set_unspendable_punishment_reserve(this_ptr, val); // debug statements here } - // uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - export function ChannelDetails_get_user_id(this_ptr: number): number { + // uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + export function ChannelDetails_get_user_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelDetails_get_user_id(this_ptr); + const nativeResponseValue = wasm.ChannelDetails_get_user_channel_id(this_ptr); return nativeResponseValue; } - // void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - export function ChannelDetails_set_user_id(this_ptr: number, val: number): void { + // void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); + export function ChannelDetails_set_user_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelDetails_set_user_id(this_ptr, val); + const nativeResponseValue = wasm.ChannelDetails_set_user_channel_id(this_ptr, val); // debug statements here } // uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); @@ -8529,12 +10136,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelDetails_set_is_public(this_ptr, val); // debug statements here } - // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg); - export function ChannelDetails_new(channel_id_arg: Uint8Array, counterparty_arg: number, funding_txo_arg: number, short_channel_id_arg: number, channel_value_satoshis_arg: number, unspendable_punishment_reserve_arg: number, user_id_arg: number, outbound_capacity_msat_arg: number, inbound_capacity_msat_arg: number, confirmations_required_arg: number, force_close_spend_delay_arg: number, is_outbound_arg: boolean, is_funding_locked_arg: boolean, is_usable_arg: boolean, is_public_arg: boolean): number { + // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg); + export function ChannelDetails_new(channel_id_arg: Uint8Array, counterparty_arg: number, funding_txo_arg: number, short_channel_id_arg: number, channel_value_satoshis_arg: number, unspendable_punishment_reserve_arg: number, user_channel_id_arg: number, outbound_capacity_msat_arg: number, inbound_capacity_msat_arg: number, confirmations_required_arg: number, force_close_spend_delay_arg: number, is_outbound_arg: boolean, is_funding_locked_arg: boolean, is_usable_arg: boolean, is_public_arg: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelDetails_new(encodeArray(channel_id_arg), counterparty_arg, funding_txo_arg, short_channel_id_arg, channel_value_satoshis_arg, unspendable_punishment_reserve_arg, user_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg, force_close_spend_delay_arg, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); + const nativeResponseValue = wasm.ChannelDetails_new(encodeArray(channel_id_arg), counterparty_arg, funding_txo_arg, short_channel_id_arg, channel_value_satoshis_arg, unspendable_punishment_reserve_arg, user_channel_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg, force_close_spend_delay_arg, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); return nativeResponseValue; } // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); @@ -8585,12 +10192,12 @@ public static native long new_empty_slice_vec(); 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 { + // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id); + export function PaymentSendFailure_partial_failure(results: number[], failed_paths_retry: number, payment_id: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PaymentSendFailure_partial_failure(a); + const nativeResponseValue = wasm.PaymentSendFailure_partial_failure(results, failed_paths_retry, encodeArray(payment_id)); 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); @@ -8609,12 +10216,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelManager_get_current_default_configuration(this_arg); return nativeResponseValue; } - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_id, struct LDKUserConfig override_config); - export function ChannelManager_create_channel(this_arg: number, their_network_key: Uint8Array, channel_value_satoshis: number, push_msat: number, user_id: number, override_config: number): number { + // MUST_USE_RES struct LDKCResult__u832APIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_channel_id, struct LDKUserConfig override_config); + export function ChannelManager_create_channel(this_arg: number, their_network_key: Uint8Array, channel_value_satoshis: number, push_msat: number, user_channel_id: number, override_config: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelManager_create_channel(this_arg, encodeArray(their_network_key), channel_value_satoshis, push_msat, user_id, override_config); + const nativeResponseValue = wasm.ChannelManager_create_channel(this_arg, encodeArray(their_network_key), channel_value_satoshis, push_msat, user_channel_id, override_config); return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); @@ -8665,7 +10272,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelManager_force_close_all_channels(this_arg); // debug statements here } - // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret); + // MUST_USE_RES struct LDKCResult_PaymentIdPaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret); export function ChannelManager_send_payment(this_arg: number, route: number, payment_hash: Uint8Array, payment_secret: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8673,7 +10280,15 @@ 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); + // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id); + export function ChannelManager_retry_payment(this_arg: number, route: number, payment_id: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelManager_retry_payment(this_arg, route, encodeArray(payment_id)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ 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!"); @@ -8737,14 +10352,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelManager_get_our_node_id(this_arg); return decodeArray(nativeResponseValue); } - // void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id); - export function ChannelManager_channel_monitor_updated(this_arg: number, funding_txo: number, highest_applied_update_id: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.ChannelManager_channel_monitor_updated(this_arg, funding_txo, highest_applied_update_id); - // debug statements here - } // MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id); export function ChannelManager_create_inbound_payment(this_arg: number, min_value_msat: number, invoice_expiry_delta_secs: number, user_payment_id: number): number { if(!isWasmInitialized) { @@ -10841,14 +12448,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetAddress_write(obj); return decodeArray(nativeResponseValue); } - // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser); - export function Result_read(ser: Uint8Array): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Result_read(encodeArray(ser)); - return nativeResponseValue; - } // struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser); export function NetAddress_read(ser: Uint8Array): number { if(!isWasmInitialized) { @@ -11905,6 +13504,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentUpdate_free(this_obj); // debug statements here } + // struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); + export function CommitmentUpdate_get_update_add_htlcs(this_ptr: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CommitmentUpdate_get_update_add_htlcs(this_ptr); + return nativeResponseValue; + } // void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val); export function CommitmentUpdate_set_update_add_htlcs(this_ptr: number, val: number[]): void { if(!isWasmInitialized) { @@ -11913,6 +13520,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentUpdate_set_update_add_htlcs(this_ptr, val); // debug statements here } + // struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); + export function CommitmentUpdate_get_update_fulfill_htlcs(this_ptr: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CommitmentUpdate_get_update_fulfill_htlcs(this_ptr); + return nativeResponseValue; + } // void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val); export function CommitmentUpdate_set_update_fulfill_htlcs(this_ptr: number, val: number[]): void { if(!isWasmInitialized) { @@ -11921,6 +13536,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentUpdate_set_update_fulfill_htlcs(this_ptr, val); // debug statements here } + // struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); + export function CommitmentUpdate_get_update_fail_htlcs(this_ptr: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CommitmentUpdate_get_update_fail_htlcs(this_ptr); + return nativeResponseValue; + } // void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val); export function CommitmentUpdate_set_update_fail_htlcs(this_ptr: number, val: number[]): void { if(!isWasmInitialized) { @@ -11929,6 +13552,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentUpdate_set_update_fail_htlcs(this_ptr, val); // debug statements here } + // struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); + export function CommitmentUpdate_get_update_fail_malformed_htlcs(this_ptr: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.CommitmentUpdate_get_update_fail_malformed_htlcs(this_ptr); + return nativeResponseValue; + } // void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val); export function CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr: number, val: number[]): void { if(!isWasmInitialized) { @@ -11985,64 +13616,24 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.CommitmentUpdate_clone(orig); return nativeResponseValue; } - // void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr); - export function HTLCFailChannelUpdate_free(this_ptr: number): void { + // void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr); + export function ChannelMessageHandler_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.HTLCFailChannelUpdate_free(this_ptr); + const nativeResponseValue = wasm.ChannelMessageHandler_free(this_ptr); // debug statements here } - // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig); - export function HTLCFailChannelUpdate_clone(orig: number): number { + // void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr); + export function RoutingMessageHandler_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.HTLCFailChannelUpdate_clone(orig); - return nativeResponseValue; + const nativeResponseValue = wasm.RoutingMessageHandler_free(this_ptr); + // debug statements here } - // 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) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.ChannelMessageHandler_free(this_ptr); - // debug statements here - } - // void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr); - export function RoutingMessageHandler_free(this_ptr: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RoutingMessageHandler_free(this_ptr); - // debug statements here - } - // struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); - export function AcceptChannel_write(obj: number): Uint8Array { + // struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); + export function AcceptChannel_write(obj: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } @@ -12489,14 +14080,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.QueryShortChannelIds_write(obj); return decodeArray(nativeResponseValue); } - // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser); - export function ReplyShortChannelIdsEnd_read(ser: Uint8Array): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_read(encodeArray(ser)); - return nativeResponseValue; - } // struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj); export function ReplyShortChannelIdsEnd_write(obj: number): Uint8Array { if(!isWasmInitialized) { @@ -12505,20 +14088,20 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_write(obj); return decodeArray(nativeResponseValue); } - // MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg); - export function QueryChannelRange_end_blocknum(this_arg: number): number { + // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser); + export function ReplyShortChannelIdsEnd_read(ser: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.QueryChannelRange_end_blocknum(this_arg); + const nativeResponseValue = wasm.ReplyShortChannelIdsEnd_read(encodeArray(ser)); return nativeResponseValue; } - // struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser); - export function QueryChannelRange_read(ser: Uint8Array): number { + // MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg); + export function QueryChannelRange_end_blocknum(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.QueryChannelRange_read(encodeArray(ser)); + const nativeResponseValue = wasm.QueryChannelRange_end_blocknum(this_arg); return nativeResponseValue; } // struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj); @@ -12529,6 +14112,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.QueryChannelRange_write(obj); return decodeArray(nativeResponseValue); } + // struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser); + export function QueryChannelRange_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.QueryChannelRange_read(encodeArray(ser)); + return nativeResponseValue; + } // struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser); export function ReplyChannelRange_read(ser: Uint8Array): number { if(!isWasmInitialized) { @@ -12545,6 +14136,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ReplyChannelRange_write(obj); return decodeArray(nativeResponseValue); } + // struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj); + export function GossipTimestampFilter_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.GossipTimestampFilter_write(obj); + return decodeArray(nativeResponseValue); + } // struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser); export function GossipTimestampFilter_read(ser: Uint8Array): number { if(!isWasmInitialized) { @@ -12553,13 +14152,13 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.GossipTimestampFilter_read(encodeArray(ser)); return nativeResponseValue; } - // struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj); - export function GossipTimestampFilter_write(obj: number): Uint8Array { + // void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr); + export function CustomMessageHandler_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.GossipTimestampFilter_write(obj); - return decodeArray(nativeResponseValue); + const nativeResponseValue = wasm.CustomMessageHandler_free(this_ptr); + // debug statements here } // void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj); export function IgnoringMessageHandler_free(this_obj: number): void { @@ -12593,6 +14192,22 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.IgnoringMessageHandler_as_RoutingMessageHandler(this_arg); return nativeResponseValue; } + // struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); + export function IgnoringMessageHandler_as_CustomMessageReader(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.IgnoringMessageHandler_as_CustomMessageReader(this_arg); + return nativeResponseValue; + } + // struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); + export function IgnoringMessageHandler_as_CustomMessageHandler(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.IgnoringMessageHandler_as_CustomMessageHandler(this_arg); + return nativeResponseValue; + } // void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj); export function ErroringMessageHandler_free(this_obj: number): void { if(!isWasmInitialized) { @@ -12737,12 +14352,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PeerManager_free(this_obj); // debug statements here } - // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger); - export function PeerManager_new(message_handler: number, our_node_secret: Uint8Array, ephemeral_random_data: Uint8Array, logger: number): number { + // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler); + export function PeerManager_new(message_handler: number, our_node_secret: Uint8Array, ephemeral_random_data: Uint8Array, logger: number, custom_message_handler: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PeerManager_new(message_handler, encodeArray(our_node_secret), encodeArray(ephemeral_random_data), logger); + const nativeResponseValue = wasm.PeerManager_new(message_handler, encodeArray(our_node_secret), encodeArray(ephemeral_random_data), logger, custom_message_handler); return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg); @@ -12809,6 +14424,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PeerManager_disconnect_by_node_id(this_arg, encodeArray(node_id), no_connection_possible); // debug statements here } + // void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg); + export function PeerManager_disconnect_all_peers(this_arg: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PeerManager_disconnect_all_peers(this_arg); + // debug statements here + } // void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg); export function PeerManager_timer_tick_occurred(this_arg: number): void { if(!isWasmInitialized) { @@ -12825,6 +14448,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.build_commitment_secret(encodeArray(commitment_seed), idx); return decodeArray(nativeResponseValue); } + // struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint); + export function build_closing_transaction(to_holder_value_sat: number, to_counterparty_value_sat: number, to_holder_script: Uint8Array, to_counterparty_script: Uint8Array, funding_outpoint: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, encodeArray(to_holder_script), encodeArray(to_counterparty_script), funding_outpoint); + return decodeArray(nativeResponseValue); + } // struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); export function derive_private_key(per_commitment_point: Uint8Array, base_secret: Uint8Array): number { if(!isWasmInitialized) { @@ -13681,6 +15312,118 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.BuiltCommitmentTransaction_sign(this_arg, encodeArray(funding_key), encodeArray(funding_redeemscript), channel_value_satoshis); return decodeArray(nativeResponseValue); } + // void ClosingTransaction_free(struct LDKClosingTransaction this_obj); + export function ClosingTransaction_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_free(this_obj); + // debug statements here + } + // struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig); + export function ClosingTransaction_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_clone(orig); + return nativeResponseValue; + } + // uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o); + export function ClosingTransaction_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_hash(o); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint); + export function ClosingTransaction_new(to_holder_value_sat: number, to_counterparty_value_sat: number, to_holder_script: Uint8Array, to_counterparty_script: Uint8Array, funding_outpoint: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, encodeArray(to_holder_script), encodeArray(to_counterparty_script), funding_outpoint); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg); + export function ClosingTransaction_trust(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_trust(this_arg); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint); + export function ClosingTransaction_verify(this_arg: number, funding_outpoint: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_verify(this_arg, funding_outpoint); + return nativeResponseValue; + } + // MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg); + export function ClosingTransaction_to_holder_value_sat(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_to_holder_value_sat(this_arg); + return nativeResponseValue; + } + // MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg); + export function ClosingTransaction_to_counterparty_value_sat(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_to_counterparty_value_sat(this_arg); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg); + export function ClosingTransaction_to_holder_script(this_arg: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_to_holder_script(this_arg); + return decodeArray(nativeResponseValue); + } + // MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg); + export function ClosingTransaction_to_counterparty_script(this_arg: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ClosingTransaction_to_counterparty_script(this_arg); + return decodeArray(nativeResponseValue); + } + // void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj); + export function TrustedClosingTransaction_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TrustedClosingTransaction_free(this_obj); + // debug statements here + } + // MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg); + export function TrustedClosingTransaction_built_transaction(this_arg: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TrustedClosingTransaction_built_transaction(this_arg); + return decodeArray(nativeResponseValue); + } + // MUST_USE_RES struct LDKThirtyTwoBytes TrustedClosingTransaction_get_sighash_all(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); + export function TrustedClosingTransaction_get_sighash_all(this_arg: number, funding_redeemscript: Uint8Array, channel_value_satoshis: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TrustedClosingTransaction_get_sighash_all(this_arg, encodeArray(funding_redeemscript), channel_value_satoshis); + return decodeArray(nativeResponseValue); + } + // MUST_USE_RES struct LDKSignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); + export function TrustedClosingTransaction_sign(this_arg: number, funding_key: Uint8Array, funding_redeemscript: Uint8Array, channel_value_satoshis: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.TrustedClosingTransaction_sign(this_arg, encodeArray(funding_key), encodeArray(funding_redeemscript), channel_value_satoshis); + return decodeArray(nativeResponseValue); + } // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj); export function CommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { @@ -13921,6 +15664,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InitFeatures_known(); return nativeResponseValue; } + // MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); + export function InitFeatures_requires_unknown_bits(this_arg: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InitFeatures_requires_unknown_bits(this_arg); + return nativeResponseValue; + } // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void); export function NodeFeatures_empty(): number { if(!isWasmInitialized) { @@ -13937,6 +15688,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NodeFeatures_known(); return nativeResponseValue; } + // MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + export function NodeFeatures_requires_unknown_bits(this_arg: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NodeFeatures_requires_unknown_bits(this_arg); + return nativeResponseValue; + } // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void); export function ChannelFeatures_empty(): number { if(!isWasmInitialized) { @@ -13953,6 +15712,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelFeatures_known(); return nativeResponseValue; } + // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); + export function ChannelFeatures_requires_unknown_bits(this_arg: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelFeatures_requires_unknown_bits(this_arg); + return nativeResponseValue; + } // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void); export function InvoiceFeatures_empty(): number { if(!isWasmInitialized) { @@ -13969,6 +15736,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InvoiceFeatures_known(); return nativeResponseValue; } + // MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); + export function InvoiceFeatures_requires_unknown_bits(this_arg: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoiceFeatures_requires_unknown_bits(this_arg); + return nativeResponseValue; + } // MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg); export function InitFeatures_supports_payment_secret(this_arg: number): boolean { if(!isWasmInitialized) { @@ -14105,6 +15880,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InvalidShutdownScript_new(encodeArray(script_arg)); return nativeResponseValue; } + // struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig); + export function InvalidShutdownScript_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvalidShutdownScript_clone(orig); + return nativeResponseValue; + } // struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj); export function ShutdownScript_write(obj: number): Uint8Array { if(!isWasmInitialized) { @@ -14121,22 +15904,6 @@ public static native long new_empty_slice_vec(); 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) { @@ -14185,382 +15952,198 @@ public static native long new_empty_slice_vec(); 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 { + // void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr); + export function CustomMessageReader_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_free(this_obj); + const nativeResponseValue = wasm.CustomMessageReader_free(this_ptr); // debug statements here } - // struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr); - export function RouteHop_get_pubkey(this_ptr: number): Uint8Array { + // struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig); + export function Type_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_get_pubkey(this_ptr); - return decodeArray(nativeResponseValue); + const nativeResponseValue = wasm.Type_clone(orig); + return nativeResponseValue; } - // void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); - export function RouteHop_set_pubkey(this_ptr: number, val: Uint8Array): void { + // void Type_free(struct LDKType this_ptr); + export function Type_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_set_pubkey(this_ptr, encodeArray(val)); + const nativeResponseValue = wasm.Type_free(this_ptr); // debug statements here } - // struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); - export function RouteHop_get_node_features(this_ptr: number): number { + // void Score_free(struct LDKScore this_ptr); + export function Score_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_get_node_features(this_ptr); - return nativeResponseValue; + const nativeResponseValue = wasm.Score_free(this_ptr); + // debug statements here } - // void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); - export function RouteHop_set_node_features(this_ptr: number, val: number): void { + // void LockableScore_free(struct LDKLockableScore this_obj); + export function LockableScore_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_set_node_features(this_ptr, val); + const nativeResponseValue = wasm.LockableScore_free(this_obj); // debug statements here } - // uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr); - export function RouteHop_get_short_channel_id(this_ptr: number): number { + // MUST_USE_RES struct LDKLockableScore LockableScore_new(struct LDKScore score); + export function LockableScore_new(score: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_get_short_channel_id(this_ptr); + const nativeResponseValue = wasm.LockableScore_new(score); return nativeResponseValue; } - // void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); - export function RouteHop_set_short_channel_id(this_ptr: number, val: number): void { + // struct LDKCVec_u8Z LockableScore_write(const struct LDKLockableScore *NONNULL_PTR obj); + export function LockableScore_write(obj: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_set_short_channel_id(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.LockableScore_write(obj); + return decodeArray(nativeResponseValue); } - // struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); - export function RouteHop_get_channel_features(this_ptr: number): number { + // void NodeId_free(struct LDKNodeId this_obj); + export function NodeId_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_get_channel_features(this_ptr); - return nativeResponseValue; + const nativeResponseValue = wasm.NodeId_free(this_obj); + // debug statements here } - // void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); - export function RouteHop_set_channel_features(this_ptr: number, val: number): void { + // struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig); + export function NodeId_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_set_channel_features(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.NodeId_clone(orig); + return nativeResponseValue; } - // uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr); - export function RouteHop_get_fee_msat(this_ptr: number): number { + // MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey); + export function NodeId_from_pubkey(pubkey: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_get_fee_msat(this_ptr); + const nativeResponseValue = wasm.NodeId_from_pubkey(encodeArray(pubkey)); return nativeResponseValue; } - // void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); - export function RouteHop_set_fee_msat(this_ptr: number, val: number): void { + // MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg); + export function NodeId_as_slice(this_arg: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_set_fee_msat(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.NodeId_as_slice(this_arg); + return decodeArray(nativeResponseValue); } - // uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr); - export function RouteHop_get_cltv_expiry_delta(this_ptr: number): number { + // uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o); + export function NodeId_hash(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_get_cltv_expiry_delta(this_ptr); + const nativeResponseValue = wasm.NodeId_hash(o); return nativeResponseValue; } - // void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val); - export function RouteHop_set_cltv_expiry_delta(this_ptr: number, val: number): void { + // struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj); + export function NodeId_write(obj: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_set_cltv_expiry_delta(this_ptr, val); - // debug statements here + const nativeResponseValue = wasm.NodeId_write(obj); + return decodeArray(nativeResponseValue); } - // MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); - export function RouteHop_new(pubkey_arg: Uint8Array, node_features_arg: number, short_channel_id_arg: number, channel_features_arg: number, fee_msat_arg: number, cltv_expiry_delta_arg: number): number { + // struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser); + export function NodeId_read(ser: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHop_new(encodeArray(pubkey_arg), node_features_arg, short_channel_id_arg, channel_features_arg, fee_msat_arg, cltv_expiry_delta_arg); + const nativeResponseValue = wasm.NodeId_read(encodeArray(ser)); return nativeResponseValue; } - // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); - export function RouteHop_clone(orig: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHop_clone(orig); - return nativeResponseValue; - } - // struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj); - export function RouteHop_write(obj: number): Uint8Array { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHop_write(obj); - return decodeArray(nativeResponseValue); - } - // struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser); - export function RouteHop_read(ser: Uint8Array): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHop_read(encodeArray(ser)); - return nativeResponseValue; - } - // void Route_free(struct LDKRoute this_obj); - export function Route_free(this_obj: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Route_free(this_obj); - // debug statements here - } - // void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val); - export function Route_set_paths(this_ptr: number, val: number[][]): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Route_set_paths(this_ptr, val); - // debug statements here - } - // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg); - export function Route_new(paths_arg: number[][]): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Route_new(paths_arg); - return nativeResponseValue; - } - // struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); - export function Route_clone(orig: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Route_clone(orig); - return nativeResponseValue; - } - // struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); - export function Route_write(obj: number): Uint8Array { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Route_write(obj); - return decodeArray(nativeResponseValue); - } - // struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); - export function Route_read(ser: Uint8Array): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.Route_read(encodeArray(ser)); - return nativeResponseValue; - } - // void RouteHint_free(struct LDKRouteHint this_obj); - export function RouteHint_free(this_obj: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHint_free(this_obj); - // debug statements here - } - // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b); - export function RouteHint_eq(a: number, b: number): boolean { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHint_eq(a, b); - return nativeResponseValue; - } - // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); - export function RouteHint_clone(orig: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHint_clone(orig); - return nativeResponseValue; - } - // void RouteHintHop_free(struct LDKRouteHintHop this_obj); - export function RouteHintHop_free(this_obj: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_free(this_obj); - // debug statements here - } - // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - export function RouteHintHop_get_src_node_id(this_ptr: number): Uint8Array { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_get_src_node_id(this_ptr); - return decodeArray(nativeResponseValue); - } - // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); - export function RouteHintHop_set_src_node_id(this_ptr: number, val: Uint8Array): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_set_src_node_id(this_ptr, encodeArray(val)); - // debug statements here - } - // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - export function RouteHintHop_get_short_channel_id(this_ptr: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_get_short_channel_id(this_ptr); - return nativeResponseValue; - } - // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val); - export function RouteHintHop_set_short_channel_id(this_ptr: number, val: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_set_short_channel_id(this_ptr, val); - // debug statements here - } - // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - export function RouteHintHop_get_fees(this_ptr: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_get_fees(this_ptr); - return nativeResponseValue; - } - // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val); - export function RouteHintHop_set_fees(this_ptr: number, val: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_set_fees(this_ptr, val); - // debug statements here - } - // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - export function RouteHintHop_get_cltv_expiry_delta(this_ptr: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_get_cltv_expiry_delta(this_ptr); - return nativeResponseValue; - } - // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val); - export function RouteHintHop_set_cltv_expiry_delta(this_ptr: number, val: number): void { + // void NetworkGraph_free(struct LDKNetworkGraph this_obj); + export function NetworkGraph_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHintHop_set_cltv_expiry_delta(this_ptr, val); + const nativeResponseValue = wasm.NetworkGraph_free(this_obj); // debug statements here } - // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - export function RouteHintHop_get_htlc_minimum_msat(this_ptr: number): number { + // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig); + export function NetworkGraph_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHintHop_get_htlc_minimum_msat(this_ptr); + const nativeResponseValue = wasm.NetworkGraph_clone(orig); return nativeResponseValue; } - // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - export function RouteHintHop_set_htlc_minimum_msat(this_ptr: number, val: number): void { + // void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj); + export function ReadOnlyNetworkGraph_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHintHop_set_htlc_minimum_msat(this_ptr, val); + const nativeResponseValue = wasm.ReadOnlyNetworkGraph_free(this_obj); // debug statements here } - // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); - export function RouteHintHop_get_htlc_maximum_msat(this_ptr: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_get_htlc_maximum_msat(this_ptr); - return nativeResponseValue; - } - // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); - export function RouteHintHop_set_htlc_maximum_msat(this_ptr: number, val: number): void { + // void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr); + export function NetworkUpdate_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHintHop_set_htlc_maximum_msat(this_ptr, val); + const nativeResponseValue = wasm.NetworkUpdate_free(this_ptr); // debug statements here } - // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); - export function RouteHintHop_new(src_node_id_arg: Uint8Array, short_channel_id_arg: number, fees_arg: number, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: number, htlc_maximum_msat_arg: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.RouteHintHop_new(encodeArray(src_node_id_arg), short_channel_id_arg, fees_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg); - return nativeResponseValue; - } - // bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b); - export function RouteHintHop_eq(a: number, b: number): boolean { + // struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig); + export function NetworkUpdate_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHintHop_eq(a, b); + const nativeResponseValue = wasm.NetworkUpdate_clone(orig); return nativeResponseValue; } - // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); - export function RouteHintHop_clone(orig: number): number { + // struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg); + export function NetworkUpdate_channel_update_message(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.RouteHintHop_clone(orig); + const nativeResponseValue = wasm.NetworkUpdate_channel_update_message(msg); 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 { + // struct LDKNetworkUpdate NetworkUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent); + export function NetworkUpdate_channel_closed(short_channel_id: number, is_permanent: boolean): 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); + const nativeResponseValue = wasm.NetworkUpdate_channel_closed(short_channel_id, is_permanent); 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 { + // struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent); + export function NetworkUpdate_node_failure(node_id: Uint8Array, is_permanent: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.get_route(encodeArray(our_node_id), network, encodeArray(payee), payee_features, first_hops, last_hops, final_value_msat, final_cltv, logger); + const nativeResponseValue = wasm.NetworkUpdate_node_failure(encodeArray(node_id), is_permanent); return nativeResponseValue; } - // void NetworkGraph_free(struct LDKNetworkGraph this_obj); - export function NetworkGraph_free(this_obj: number): void { + // struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj); + export function NetworkUpdate_write(obj: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NetworkGraph_free(this_obj); - // debug statements here + const nativeResponseValue = wasm.NetworkUpdate_write(obj); + return decodeArray(nativeResponseValue); } - // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig); - export function NetworkGraph_clone(orig: number): number { + // struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); + export function NetGraphMsgHandler_as_EventHandler(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NetworkGraph_clone(orig); + const nativeResponseValue = wasm.NetGraphMsgHandler_as_EventHandler(this_arg); return nativeResponseValue; } - // void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj); - export function LockedNetworkGraph_free(this_obj: number): void { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.LockedNetworkGraph_free(this_obj); - // debug statements here - } // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj); export function NetGraphMsgHandler_free(this_obj: number): void { if(!isWasmInitialized) { @@ -14569,23 +16152,15 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetGraphMsgHandler_free(this_obj); // debug statements here } - // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger); - export function NetGraphMsgHandler_new(genesis_hash: Uint8Array, chain_access: number, logger: number): number { + // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger); + export function NetGraphMsgHandler_new(network_graph: number, chain_access: number, logger: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.NetGraphMsgHandler_new(encodeArray(genesis_hash), chain_access, logger); + const nativeResponseValue = wasm.NetGraphMsgHandler_new(network_graph, chain_access, logger); return nativeResponseValue; } - // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph); - export function NetGraphMsgHandler_from_net_graph(chain_access: number, logger: number, network_graph: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.NetGraphMsgHandler_from_net_graph(chain_access, logger, network_graph); - return nativeResponseValue; - } - // void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access); + // void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access); export function NetGraphMsgHandler_add_chain_access(this_arg: number, chain_access: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14593,22 +16168,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetGraphMsgHandler_add_chain_access(this_arg, chain_access); // debug statements here } - // MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); - export function NetGraphMsgHandler_read_locked_graph(this_arg: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.NetGraphMsgHandler_read_locked_graph(this_arg); - return nativeResponseValue; - } - // MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg); - export function LockedNetworkGraph_graph(this_arg: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.LockedNetworkGraph_graph(this_arg); - return nativeResponseValue; - } // struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); export function NetGraphMsgHandler_as_RoutingMessageHandler(this_arg: number): number { if(!isWasmInitialized) { @@ -14801,20 +16360,20 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelInfo_set_features(this_ptr, val); // debug statements here } - // struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - export function ChannelInfo_get_node_one(this_ptr: number): Uint8Array { + // struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + export function ChannelInfo_get_node_one(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } const nativeResponseValue = wasm.ChannelInfo_get_node_one(this_ptr); - return decodeArray(nativeResponseValue); + return nativeResponseValue; } - // void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val); - export function ChannelInfo_set_node_one(this_ptr: number, val: Uint8Array): void { + // void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val); + export function ChannelInfo_set_node_one(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelInfo_set_node_one(this_ptr, encodeArray(val)); + const nativeResponseValue = wasm.ChannelInfo_set_node_one(this_ptr, val); // debug statements here } // struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); @@ -14833,20 +16392,20 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelInfo_set_one_to_two(this_ptr, val); // debug statements here } - // struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - export function ChannelInfo_get_node_two(this_ptr: number): Uint8Array { + // struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + export function ChannelInfo_get_node_two(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } const nativeResponseValue = wasm.ChannelInfo_get_node_two(this_ptr); - return decodeArray(nativeResponseValue); + return nativeResponseValue; } - // void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val); - export function ChannelInfo_set_node_two(this_ptr: number, val: Uint8Array): void { + // void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val); + export function ChannelInfo_set_node_two(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelInfo_set_node_two(this_ptr, encodeArray(val)); + const nativeResponseValue = wasm.ChannelInfo_set_node_two(this_ptr, val); // debug statements here } // struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); @@ -14897,12 +16456,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelInfo_set_announcement_message(this_ptr, val); // debug statements here } - // MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKPublicKey node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKPublicKey node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg); - export function ChannelInfo_new(features_arg: number, node_one_arg: Uint8Array, one_to_two_arg: number, node_two_arg: Uint8Array, two_to_one_arg: number, capacity_sats_arg: number, announcement_message_arg: number): number { + // MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKNodeId node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKNodeId node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg); + export function ChannelInfo_new(features_arg: number, node_one_arg: number, one_to_two_arg: number, node_two_arg: number, two_to_one_arg: number, capacity_sats_arg: number, announcement_message_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ChannelInfo_new(features_arg, encodeArray(node_one_arg), one_to_two_arg, encodeArray(node_two_arg), two_to_one_arg, capacity_sats_arg, announcement_message_arg); + const nativeResponseValue = wasm.ChannelInfo_new(features_arg, node_one_arg, one_to_two_arg, node_two_arg, two_to_one_arg, capacity_sats_arg, announcement_message_arg); return nativeResponseValue; } // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig); @@ -14993,6 +16552,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.RoutingFees_clone(orig); return nativeResponseValue; } + // uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o); + export function RoutingFees_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RoutingFees_hash(o); + return nativeResponseValue; + } // struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); export function RoutingFees_write(obj: number): Uint8Array { if(!isWasmInitialized) { @@ -15241,7 +16808,15 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_new(encodeArray(genesis_hash)); return nativeResponseValue; } - // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg); + // MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg); + export function NetworkGraph_read_only(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetworkGraph_read_only(this_arg); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg); export function NetworkGraph_update_node_from_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15249,7 +16824,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_update_node_from_announcement(this_arg, msg); return nativeResponseValue; } - // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg); export function NetworkGraph_update_node_from_unsigned_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15257,7 +16832,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_update_node_from_unsigned_announcement(this_arg, msg); return nativeResponseValue; } - // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access); export function NetworkGraph_update_channel_from_announcement(this_arg: number, msg: number, chain_access: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15265,7 +16840,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_update_channel_from_announcement(this_arg, msg, chain_access); return nativeResponseValue; } - // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access); export function NetworkGraph_update_channel_from_unsigned_announcement(this_arg: number, msg: number, chain_access: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15273,7 +16848,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_update_channel_from_unsigned_announcement(this_arg, msg, chain_access); return nativeResponseValue; } - // void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent); + // void NetworkGraph_close_channel_from_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent); export function NetworkGraph_close_channel_from_update(this_arg: number, short_channel_id: number, is_permanent: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15281,7 +16856,15 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_close_channel_from_update(this_arg, short_channel_id, is_permanent); // debug statements here } - // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg); + // void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent); + export function NetworkGraph_fail_node(this_arg: number, _node_id: Uint8Array, is_permanent: boolean): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.NetworkGraph_fail_node(this_arg, encodeArray(_node_id), is_permanent); + // debug statements here + } + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg); export function NetworkGraph_update_channel(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15289,7 +16872,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_update_channel(this_arg, msg); return nativeResponseValue; } - // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg); + // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg); export function NetworkGraph_update_channel_unsigned(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15297,23 +16880,879 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.NetworkGraph_update_channel_unsigned(this_arg, msg); return nativeResponseValue; } - // void FilesystemPersister_free(struct LDKFilesystemPersister this_obj); - export function FilesystemPersister_free(this_obj: number): void { + // MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey); + export function ReadOnlyNetworkGraph_get_addresses(this_arg: number, pubkey: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.FilesystemPersister_free(this_obj); - // debug statements here + const nativeResponseValue = wasm.ReadOnlyNetworkGraph_get_addresses(this_arg, encodeArray(pubkey)); + return nativeResponseValue; } - // MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data); - export function FilesystemPersister_new(path_to_channel_data: String): number { + // void RouteHop_free(struct LDKRouteHop this_obj); + export function RouteHop_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.FilesystemPersister_new(path_to_channel_data); - return nativeResponseValue; + const nativeResponseValue = wasm.RouteHop_free(this_obj); + // debug statements here } - // MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg); + // struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr); + export function RouteHop_get_pubkey(this_ptr: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_get_pubkey(this_ptr); + return decodeArray(nativeResponseValue); + } + // void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); + export function RouteHop_set_pubkey(this_ptr: number, val: Uint8Array): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_set_pubkey(this_ptr, encodeArray(val)); + // debug statements here + } + // struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); + export function RouteHop_get_node_features(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_get_node_features(this_ptr); + return nativeResponseValue; + } + // void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); + export function RouteHop_set_node_features(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_set_node_features(this_ptr, val); + // debug statements here + } + // uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr); + export function RouteHop_get_short_channel_id(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_get_short_channel_id(this_ptr); + return nativeResponseValue; + } + // void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); + export function RouteHop_set_short_channel_id(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_set_short_channel_id(this_ptr, val); + // debug statements here + } + // struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); + export function RouteHop_get_channel_features(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_get_channel_features(this_ptr); + return nativeResponseValue; + } + // void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); + export function RouteHop_set_channel_features(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_set_channel_features(this_ptr, val); + // debug statements here + } + // uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr); + export function RouteHop_get_fee_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_get_fee_msat(this_ptr); + return nativeResponseValue; + } + // void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); + export function RouteHop_set_fee_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_set_fee_msat(this_ptr, val); + // debug statements here + } + // uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr); + export function RouteHop_get_cltv_expiry_delta(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_get_cltv_expiry_delta(this_ptr); + return nativeResponseValue; + } + // void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val); + export function RouteHop_set_cltv_expiry_delta(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_set_cltv_expiry_delta(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); + export function RouteHop_new(pubkey_arg: Uint8Array, node_features_arg: number, short_channel_id_arg: number, channel_features_arg: number, fee_msat_arg: number, cltv_expiry_delta_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_new(encodeArray(pubkey_arg), node_features_arg, short_channel_id_arg, channel_features_arg, fee_msat_arg, cltv_expiry_delta_arg); + return nativeResponseValue; + } + // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); + export function RouteHop_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_clone(orig); + return nativeResponseValue; + } + // uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o); + export function RouteHop_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_hash(o); + return nativeResponseValue; + } + // bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b); + export function RouteHop_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_eq(a, b); + return nativeResponseValue; + } + // struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj); + export function RouteHop_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser); + export function RouteHop_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHop_read(encodeArray(ser)); + return nativeResponseValue; + } + // void Route_free(struct LDKRoute this_obj); + export function Route_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_free(this_obj); + // debug statements here + } + // struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr); + export function Route_get_paths(this_ptr: number): number[][] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_get_paths(this_ptr); + return nativeResponseValue; + } + // void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val); + export function Route_set_paths(this_ptr: number, val: number[][]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_set_paths(this_ptr, val); + // debug statements here + } + // struct LDKPayee Route_get_payee(const struct LDKRoute *NONNULL_PTR this_ptr); + export function Route_get_payee(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_get_payee(this_ptr); + return nativeResponseValue; + } + // void Route_set_payee(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPayee val); + export function Route_set_payee(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_set_payee(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPayee payee_arg); + export function Route_new(paths_arg: number[][], payee_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_new(paths_arg, payee_arg); + return nativeResponseValue; + } + // struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); + export function Route_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_clone(orig); + return nativeResponseValue; + } + // uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o); + export function Route_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_hash(o); + return nativeResponseValue; + } + // bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b); + export function Route_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_eq(a, b); + return nativeResponseValue; + } + // MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg); + export function Route_get_total_fees(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_get_total_fees(this_arg); + return nativeResponseValue; + } + // MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg); + export function Route_get_total_amount(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_get_total_amount(this_arg); + return nativeResponseValue; + } + // struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); + export function Route_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); + export function Route_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Route_read(encodeArray(ser)); + return nativeResponseValue; + } + // void RouteParameters_free(struct LDKRouteParameters this_obj); + export function RouteParameters_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_free(this_obj); + // debug statements here + } + // struct LDKPayee RouteParameters_get_payee(const struct LDKRouteParameters *NONNULL_PTR this_ptr); + export function RouteParameters_get_payee(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_get_payee(this_ptr); + return nativeResponseValue; + } + // void RouteParameters_set_payee(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPayee val); + export function RouteParameters_set_payee(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_set_payee(this_ptr, val); + // debug statements here + } + // uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr); + export function RouteParameters_get_final_value_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_get_final_value_msat(this_ptr); + return nativeResponseValue; + } + // void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val); + export function RouteParameters_set_final_value_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_set_final_value_msat(this_ptr, val); + // debug statements here + } + // uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr); + export function RouteParameters_get_final_cltv_expiry_delta(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_get_final_cltv_expiry_delta(this_ptr); + return nativeResponseValue; + } + // void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val); + export function RouteParameters_set_final_cltv_expiry_delta(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_set_final_cltv_expiry_delta(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPayee payee_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg); + export function RouteParameters_new(payee_arg: number, final_value_msat_arg: number, final_cltv_expiry_delta_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_new(payee_arg, final_value_msat_arg, final_cltv_expiry_delta_arg); + return nativeResponseValue; + } + // struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig); + export function RouteParameters_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_clone(orig); + return nativeResponseValue; + } + // struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj); + export function RouteParameters_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser); + export function RouteParameters_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteParameters_read(encodeArray(ser)); + return nativeResponseValue; + } + // void Payee_free(struct LDKPayee this_obj); + export function Payee_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_free(this_obj); + // debug statements here + } + // struct LDKPublicKey Payee_get_pubkey(const struct LDKPayee *NONNULL_PTR this_ptr); + export function Payee_get_pubkey(this_ptr: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_get_pubkey(this_ptr); + return decodeArray(nativeResponseValue); + } + // void Payee_set_pubkey(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKPublicKey val); + export function Payee_set_pubkey(this_ptr: number, val: Uint8Array): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_set_pubkey(this_ptr, encodeArray(val)); + // debug statements here + } + // struct LDKInvoiceFeatures Payee_get_features(const struct LDKPayee *NONNULL_PTR this_ptr); + export function Payee_get_features(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_get_features(this_ptr); + return nativeResponseValue; + } + // void Payee_set_features(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val); + export function Payee_set_features(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_set_features(this_ptr, val); + // debug statements here + } + // struct LDKCVec_RouteHintZ Payee_get_route_hints(const struct LDKPayee *NONNULL_PTR this_ptr); + export function Payee_get_route_hints(this_ptr: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_get_route_hints(this_ptr); + return nativeResponseValue; + } + // void Payee_set_route_hints(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val); + export function Payee_set_route_hints(this_ptr: number, val: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_set_route_hints(this_ptr, val); + // debug statements here + } + // struct LDKCOption_u64Z Payee_get_expiry_time(const struct LDKPayee *NONNULL_PTR this_ptr); + export function Payee_get_expiry_time(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_get_expiry_time(this_ptr); + return nativeResponseValue; + } + // void Payee_set_expiry_time(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + export function Payee_set_expiry_time(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_set_expiry_time(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKPayee Payee_new(struct LDKPublicKey pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg); + export function Payee_new(pubkey_arg: Uint8Array, features_arg: number, route_hints_arg: number[], expiry_time_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_new(encodeArray(pubkey_arg), features_arg, route_hints_arg, expiry_time_arg); + return nativeResponseValue; + } + // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig); + export function Payee_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_clone(orig); + return nativeResponseValue; + } + // uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o); + export function Payee_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_hash(o); + return nativeResponseValue; + } + // bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b); + export function Payee_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_eq(a, b); + return nativeResponseValue; + } + // struct LDKCVec_u8Z Payee_write(const struct LDKPayee *NONNULL_PTR obj); + export function Payee_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_PayeeDecodeErrorZ Payee_read(struct LDKu8slice ser); + export function Payee_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_read(encodeArray(ser)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKPayee Payee_from_node_id(struct LDKPublicKey pubkey); + export function Payee_from_node_id(pubkey: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_from_node_id(encodeArray(pubkey)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKPayee Payee_for_keysend(struct LDKPublicKey pubkey); + export function Payee_for_keysend(pubkey: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payee_for_keysend(encodeArray(pubkey)); + return nativeResponseValue; + } + // void RouteHint_free(struct LDKRouteHint this_obj); + export function RouteHint_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_free(this_obj); + // debug statements here + } + // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr); + export function RouteHint_get_a(this_ptr: number): number[] { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_get_a(this_ptr); + return nativeResponseValue; + } + // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val); + export function RouteHint_set_a(this_ptr: number, val: number[]): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_set_a(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg); + export function RouteHint_new(a_arg: number[]): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_new(a_arg); + return nativeResponseValue; + } + // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); + export function RouteHint_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_clone(orig); + return nativeResponseValue; + } + // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o); + export function RouteHint_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_hash(o); + return nativeResponseValue; + } + // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b); + export function RouteHint_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_eq(a, b); + return nativeResponseValue; + } + // struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj); + export function RouteHint_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser); + export function RouteHint_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHint_read(encodeArray(ser)); + return nativeResponseValue; + } + // void RouteHintHop_free(struct LDKRouteHintHop this_obj); + export function RouteHintHop_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_free(this_obj); + // debug statements here + } + // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + export function RouteHintHop_get_src_node_id(this_ptr: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_get_src_node_id(this_ptr); + return decodeArray(nativeResponseValue); + } + // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); + export function RouteHintHop_set_src_node_id(this_ptr: number, val: Uint8Array): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_set_src_node_id(this_ptr, encodeArray(val)); + // debug statements here + } + // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + export function RouteHintHop_get_short_channel_id(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_get_short_channel_id(this_ptr); + return nativeResponseValue; + } + // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val); + export function RouteHintHop_set_short_channel_id(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_set_short_channel_id(this_ptr, val); + // debug statements here + } + // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + export function RouteHintHop_get_fees(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_get_fees(this_ptr); + return nativeResponseValue; + } + // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val); + export function RouteHintHop_set_fees(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_set_fees(this_ptr, val); + // debug statements here + } + // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + export function RouteHintHop_get_cltv_expiry_delta(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_get_cltv_expiry_delta(this_ptr); + return nativeResponseValue; + } + // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val); + export function RouteHintHop_set_cltv_expiry_delta(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_set_cltv_expiry_delta(this_ptr, val); + // debug statements here + } + // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + export function RouteHintHop_get_htlc_minimum_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_get_htlc_minimum_msat(this_ptr); + return nativeResponseValue; + } + // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + export function RouteHintHop_set_htlc_minimum_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_set_htlc_minimum_msat(this_ptr, val); + // debug statements here + } + // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); + export function RouteHintHop_get_htlc_maximum_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_get_htlc_maximum_msat(this_ptr); + return nativeResponseValue; + } + // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + export function RouteHintHop_set_htlc_maximum_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_set_htlc_maximum_msat(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); + export function RouteHintHop_new(src_node_id_arg: Uint8Array, short_channel_id_arg: number, fees_arg: number, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: number, htlc_maximum_msat_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_new(encodeArray(src_node_id_arg), short_channel_id_arg, fees_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg); + return nativeResponseValue; + } + // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); + export function RouteHintHop_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_clone(orig); + return nativeResponseValue; + } + // uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o); + export function RouteHintHop_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_hash(o); + return nativeResponseValue; + } + // bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b); + export function RouteHintHop_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_eq(a, b); + return nativeResponseValue; + } + // struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj); + export function RouteHintHop_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser); + export function RouteHintHop_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RouteHintHop_read(encodeArray(ser)); + return nativeResponseValue; + } + // struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR params, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer); + export function find_route(our_node_pubkey: Uint8Array, params: number, network: number, first_hops: number[], logger: number, scorer: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.find_route(encodeArray(our_node_pubkey), params, network, first_hops, logger, scorer); + return nativeResponseValue; + } + // void Scorer_free(struct LDKScorer this_obj); + export function Scorer_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Scorer_free(this_obj); + // debug statements here + } + // void ScoringParameters_free(struct LDKScoringParameters this_obj); + export function ScoringParameters_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_free(this_obj); + // debug statements here + } + // uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr); + export function ScoringParameters_get_base_penalty_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_get_base_penalty_msat(this_ptr); + return nativeResponseValue; + } + // void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); + export function ScoringParameters_set_base_penalty_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_set_base_penalty_msat(this_ptr, val); + // debug statements here + } + // uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr); + export function ScoringParameters_get_failure_penalty_msat(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_get_failure_penalty_msat(this_ptr); + return nativeResponseValue; + } + // void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); + export function ScoringParameters_set_failure_penalty_msat(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_set_failure_penalty_msat(this_ptr, val); + // debug statements here + } + // uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr); + export function ScoringParameters_get_failure_penalty_half_life(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_get_failure_penalty_half_life(this_ptr); + return nativeResponseValue; + } + // void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); + export function ScoringParameters_set_failure_penalty_half_life(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_set_failure_penalty_half_life(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint64_t failure_penalty_half_life_arg); + export function ScoringParameters_new(base_penalty_msat_arg: number, failure_penalty_msat_arg: number, failure_penalty_half_life_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, failure_penalty_half_life_arg); + return nativeResponseValue; + } + // struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj); + export function ScoringParameters_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_ScoringParametersDecodeErrorZ ScoringParameters_read(struct LDKu8slice ser); + export function ScoringParameters_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_read(encodeArray(ser)); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKScorer Scorer_new(struct LDKScoringParameters params); + export function Scorer_new(params: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Scorer_new(params); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKScorer Scorer_default(void); + export function Scorer_default(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Scorer_default(); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void); + export function ScoringParameters_default(): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ScoringParameters_default(); + return nativeResponseValue; + } + // struct LDKScore Scorer_as_Score(const struct LDKScorer *NONNULL_PTR this_arg); + export function Scorer_as_Score(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Scorer_as_Score(this_arg); + return nativeResponseValue; + } + // struct LDKCVec_u8Z Scorer_write(const struct LDKScorer *NONNULL_PTR obj); + export function Scorer_write(obj: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Scorer_write(obj); + return decodeArray(nativeResponseValue); + } + // struct LDKCResult_ScorerDecodeErrorZ Scorer_read(struct LDKu8slice ser); + export function Scorer_read(ser: Uint8Array): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Scorer_read(encodeArray(ser)); + return nativeResponseValue; + } + // void FilesystemPersister_free(struct LDKFilesystemPersister this_obj); + export function FilesystemPersister_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.FilesystemPersister_free(this_obj); + // debug statements here + } + // MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data); + export function FilesystemPersister_new(path_to_channel_data: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.FilesystemPersister_new(path_to_channel_data); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg); export function FilesystemPersister_get_data_dir(this_arg: number): String { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15361,12 +17800,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.ChannelManagerPersister_free(this_ptr); // debug statements here } - // MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger); - export function BackgroundProcessor_start(persister: number, event_handler: number, chain_monitor: number, channel_manager: number, peer_manager: number, logger: number): number { + // MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKNetGraphMsgHandler net_graph_msg_handler, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger); + export function BackgroundProcessor_start(persister: number, event_handler: number, chain_monitor: number, channel_manager: number, net_graph_msg_handler: number, peer_manager: number, logger: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.BackgroundProcessor_start(persister, event_handler, chain_monitor, channel_manager, peer_manager, logger); + const nativeResponseValue = wasm.BackgroundProcessor_start(persister, event_handler, chain_monitor, channel_manager, net_graph_msg_handler, peer_manager, logger); return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg); @@ -15638,128 +18077,232 @@ public static native long new_empty_slice_vec(); if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Currency_simnet(); - return nativeResponseValue; + 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; + } + // uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o); + export function Currency_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Currency_hash(o); + 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) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Currency_eq(a, b); + return nativeResponseValue; + } + // void Sha256_free(struct LDKSha256 this_obj); + export function Sha256_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Sha256_free(this_obj); + // debug statements here + } + // struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig); + export function Sha256_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Sha256_clone(orig); + return nativeResponseValue; + } + // uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o); + export function Sha256_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Sha256_hash(o); + return nativeResponseValue; + } + // bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b); + export function Sha256_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Sha256_eq(a, b); + return nativeResponseValue; + } + // void Description_free(struct LDKDescription this_obj); + export function Description_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Description_free(this_obj); + // debug statements here + } + // struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig); + export function Description_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Description_clone(orig); + return nativeResponseValue; + } + // uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o); + export function Description_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Description_hash(o); + return nativeResponseValue; + } + // bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b); + export function Description_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Description_eq(a, b); + return nativeResponseValue; + } + // void PayeePubKey_free(struct LDKPayeePubKey this_obj); + export function PayeePubKey_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PayeePubKey_free(this_obj); + // debug statements here + } + // struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr); + export function PayeePubKey_get_a(this_ptr: number): Uint8Array { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PayeePubKey_get_a(this_ptr); + return decodeArray(nativeResponseValue); } - // enum LDKCurrency Currency_signet(void); - export function Currency_signet(): Currency { + // void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val); + export function PayeePubKey_set_a(this_ptr: number, val: Uint8Array): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Currency_signet(); - return nativeResponseValue; + const nativeResponseValue = wasm.PayeePubKey_set_a(this_ptr, encodeArray(val)); + // debug statements here } - // bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b); - export function Currency_eq(a: number, b: number): boolean { + // MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg); + export function PayeePubKey_new(a_arg: Uint8Array): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Currency_eq(a, b); + const nativeResponseValue = wasm.PayeePubKey_new(encodeArray(a_arg)); return nativeResponseValue; } - // void Sha256_free(struct LDKSha256 this_obj); - export function Sha256_free(this_obj: number): void { + // struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig); + export function PayeePubKey_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Sha256_free(this_obj); - // debug statements here + const nativeResponseValue = wasm.PayeePubKey_clone(orig); + return nativeResponseValue; } - // bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b); - export function Sha256_eq(a: number, b: number): boolean { + // uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o); + export function PayeePubKey_hash(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Sha256_eq(a, b); + const nativeResponseValue = wasm.PayeePubKey_hash(o); return nativeResponseValue; } - // struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig); - export function Sha256_clone(orig: number): number { + // bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b); + export function PayeePubKey_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Sha256_clone(orig); + const nativeResponseValue = wasm.PayeePubKey_eq(a, b); return nativeResponseValue; } - // void Description_free(struct LDKDescription this_obj); - export function Description_free(this_obj: number): void { + // void ExpiryTime_free(struct LDKExpiryTime this_obj); + export function ExpiryTime_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Description_free(this_obj); + const nativeResponseValue = wasm.ExpiryTime_free(this_obj); // debug statements here } - // bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b); - export function Description_eq(a: number, b: number): boolean { + // struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig); + export function ExpiryTime_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Description_eq(a, b); + const nativeResponseValue = wasm.ExpiryTime_clone(orig); return nativeResponseValue; } - // struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig); - export function Description_clone(orig: number): number { + // uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o); + export function ExpiryTime_hash(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Description_clone(orig); + const nativeResponseValue = wasm.ExpiryTime_hash(o); return nativeResponseValue; } - // void PayeePubKey_free(struct LDKPayeePubKey this_obj); - export function PayeePubKey_free(this_obj: number): void { + // bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b); + export function ExpiryTime_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PayeePubKey_free(this_obj); - // debug statements here + const nativeResponseValue = wasm.ExpiryTime_eq(a, b); + return nativeResponseValue; } - // bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b); - export function PayeePubKey_eq(a: number, b: number): boolean { + // void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj); + export function MinFinalCltvExpiry_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PayeePubKey_eq(a, b); - return nativeResponseValue; + const nativeResponseValue = wasm.MinFinalCltvExpiry_free(this_obj); + // debug statements here } - // struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig); - export function PayeePubKey_clone(orig: number): number { + // uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr); + export function MinFinalCltvExpiry_get_a(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PayeePubKey_clone(orig); + const nativeResponseValue = wasm.MinFinalCltvExpiry_get_a(this_ptr); return nativeResponseValue; } - // void ExpiryTime_free(struct LDKExpiryTime this_obj); - export function ExpiryTime_free(this_obj: number): void { + // void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val); + export function MinFinalCltvExpiry_set_a(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ExpiryTime_free(this_obj); + const nativeResponseValue = wasm.MinFinalCltvExpiry_set_a(this_ptr, val); // debug statements here } - // bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b); - export function ExpiryTime_eq(a: number, b: number): boolean { + // MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg); + export function MinFinalCltvExpiry_new(a_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ExpiryTime_eq(a, b); + const nativeResponseValue = wasm.MinFinalCltvExpiry_new(a_arg); return nativeResponseValue; } - // struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig); - export function ExpiryTime_clone(orig: number): number { + // struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig); + export function MinFinalCltvExpiry_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.ExpiryTime_clone(orig); + const nativeResponseValue = wasm.MinFinalCltvExpiry_clone(orig); return nativeResponseValue; } - // void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj); - export function MinFinalCltvExpiry_free(this_obj: number): void { + // uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o); + export function MinFinalCltvExpiry_hash(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.MinFinalCltvExpiry_free(this_obj); - // debug statements here + const nativeResponseValue = wasm.MinFinalCltvExpiry_hash(o); + return nativeResponseValue; } // bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b); export function MinFinalCltvExpiry_eq(a: number, b: number): boolean { @@ -15769,14 +18312,6 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.MinFinalCltvExpiry_eq(a, b); return nativeResponseValue; } - // struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig); - export function MinFinalCltvExpiry_clone(orig: number): number { - if(!isWasmInitialized) { - throw new Error("initializeWasm() must be awaited first!"); - } - const nativeResponseValue = wasm.MinFinalCltvExpiry_clone(orig); - return nativeResponseValue; - } // void Fallback_free(struct LDKFallback this_ptr); export function Fallback_free(this_ptr: number): void { if(!isWasmInitialized) { @@ -15817,6 +18352,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Fallback_script_hash(encodeArray(a)); return nativeResponseValue; } + // uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o); + export function Fallback_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Fallback_hash(o); + 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) { @@ -15833,20 +18376,20 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.InvoiceSignature_free(this_obj); // debug statements here } - // bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b); - export function InvoiceSignature_eq(a: number, b: number): boolean { + // struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig); + export function InvoiceSignature_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.InvoiceSignature_eq(a, b); + const nativeResponseValue = wasm.InvoiceSignature_clone(orig); return nativeResponseValue; } - // struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig); - export function InvoiceSignature_clone(orig: number): number { + // bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b); + export function InvoiceSignature_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.InvoiceSignature_clone(orig); + const nativeResponseValue = wasm.InvoiceSignature_eq(a, b); return nativeResponseValue; } // void PrivateRoute_free(struct LDKPrivateRoute this_obj); @@ -15857,20 +18400,28 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.PrivateRoute_free(this_obj); // debug statements here } - // bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b); - export function PrivateRoute_eq(a: number, b: number): boolean { + // struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig); + export function PrivateRoute_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PrivateRoute_eq(a, b); + const nativeResponseValue = wasm.PrivateRoute_clone(orig); return nativeResponseValue; } - // struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig); - export function PrivateRoute_clone(orig: number): number { + // uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o); + export function PrivateRoute_hash(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.PrivateRoute_clone(orig); + const nativeResponseValue = wasm.PrivateRoute_hash(o); + return nativeResponseValue; + } + // bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b); + export function PrivateRoute_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PrivateRoute_eq(a, b); return nativeResponseValue; } // MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg); @@ -16097,7 +18648,7 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Invoice_payee_pub_key(this_arg); return decodeArray(nativeResponseValue); } - // MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg); + // MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32]; export function Invoice_payment_secret(this_arg: number): Uint8Array { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16129,6 +18680,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Invoice_expiry_time(this_arg); return nativeResponseValue; } + // MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg); + export function Invoice_is_expired(this_arg: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Invoice_is_expired(this_arg); + return nativeResponseValue; + } // MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg); export function Invoice_min_final_cltv_expiry(this_arg: number): number { if(!isWasmInitialized) { @@ -16161,12 +18720,12 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.Invoice_currency(this_arg); return nativeResponseValue; } - // MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg); - export function Invoice_amount_pico_btc(this_arg: number): number { + // MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg); + export function Invoice_amount_milli_satoshis(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); } - const nativeResponseValue = wasm.Invoice_amount_pico_btc(this_arg); + const nativeResponseValue = wasm.Invoice_amount_milli_satoshis(this_arg); return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description); @@ -16329,6 +18888,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SemanticError_multiple_descriptions(); return nativeResponseValue; } + // enum LDKSemanticError SemanticError_no_payment_secret(void); + export function SemanticError_no_payment_secret(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_no_payment_secret(); + return nativeResponseValue; + } // enum LDKSemanticError SemanticError_multiple_payment_secrets(void); export function SemanticError_multiple_payment_secrets(): SemanticError { if(!isWasmInitialized) { @@ -16361,6 +18928,14 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SemanticError_invalid_signature(); return nativeResponseValue; } + // enum LDKSemanticError SemanticError_imprecise_amount(void); + export function SemanticError_imprecise_amount(): SemanticError { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.SemanticError_imprecise_amount(); + 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) { @@ -16425,6 +19000,166 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.SignOrCreationError_to_str(o); return nativeResponseValue; } + // void InvoicePayer_free(struct LDKInvoicePayer this_obj); + export function InvoicePayer_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoicePayer_free(this_obj); + // debug statements here + } + // void Payer_free(struct LDKPayer this_ptr); + export function Payer_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Payer_free(this_ptr); + // debug statements here + } + // void Router_free(struct LDKRouter this_ptr); + export function Router_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.Router_free(this_ptr); + // debug statements here + } + // void RetryAttempts_free(struct LDKRetryAttempts this_obj); + export function RetryAttempts_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RetryAttempts_free(this_obj); + // debug statements here + } + // uintptr_t RetryAttempts_get_a(const struct LDKRetryAttempts *NONNULL_PTR this_ptr); + export function RetryAttempts_get_a(this_ptr: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RetryAttempts_get_a(this_ptr); + return nativeResponseValue; + } + // void RetryAttempts_set_a(struct LDKRetryAttempts *NONNULL_PTR this_ptr, uintptr_t val); + export function RetryAttempts_set_a(this_ptr: number, val: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RetryAttempts_set_a(this_ptr, val); + // debug statements here + } + // MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg); + export function RetryAttempts_new(a_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RetryAttempts_new(a_arg); + return nativeResponseValue; + } + // struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig); + export function RetryAttempts_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RetryAttempts_clone(orig); + return nativeResponseValue; + } + // bool RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b); + export function RetryAttempts_eq(a: number, b: number): boolean { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RetryAttempts_eq(a, b); + return nativeResponseValue; + } + // uint64_t RetryAttempts_hash(const struct LDKRetryAttempts *NONNULL_PTR o); + export function RetryAttempts_hash(o: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.RetryAttempts_hash(o); + return nativeResponseValue; + } + // void PaymentError_free(struct LDKPaymentError this_ptr); + export function PaymentError_free(this_ptr: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentError_free(this_ptr); + // debug statements here + } + // struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig); + export function PaymentError_clone(orig: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentError_clone(orig); + return nativeResponseValue; + } + // struct LDKPaymentError PaymentError_invoice(struct LDKStr a); + export function PaymentError_invoice(a: String): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentError_invoice(a); + return nativeResponseValue; + } + // struct LDKPaymentError PaymentError_routing(struct LDKLightningError a); + export function PaymentError_routing(a: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentError_routing(a); + return nativeResponseValue; + } + // struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a); + export function PaymentError_sending(a: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.PaymentError_sending(a); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts); + export function InvoicePayer_new(payer: number, router: number, scorer: number, logger: number, event_handler: number, retry_attempts: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoicePayer_new(payer, router, scorer, logger, event_handler, retry_attempts); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice); + export function InvoicePayer_pay_invoice(this_arg: number, invoice: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoicePayer_pay_invoice(this_arg, invoice); + return nativeResponseValue; + } + // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats); + export function InvoicePayer_pay_zero_value_invoice(this_arg: number, invoice: number, amount_msats: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoicePayer_pay_zero_value_invoice(this_arg, invoice, amount_msats); + return nativeResponseValue; + } + // void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]); + export function InvoicePayer_remove_cached_payment(this_arg: number, payment_hash: Uint8Array): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoicePayer_remove_cached_payment(this_arg, encodeArray(payment_hash)); + // debug statements here + } + // struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg); + export function InvoicePayer_as_EventHandler(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.InvoicePayer_as_EventHandler(this_arg); + return nativeResponseValue; + } // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description); export function create_invoice_from_channelmanager(channelmanager: number, keys_manager: number, network: Currency, amt_msat: number, description: String): number { if(!isWasmInitialized) { @@ -16433,6 +19168,38 @@ public static native long new_empty_slice_vec(); const nativeResponseValue = wasm.create_invoice_from_channelmanager(channelmanager, keys_manager, network, amt_msat, description); return nativeResponseValue; } + // void DefaultRouter_free(struct LDKDefaultRouter this_obj); + export function DefaultRouter_free(this_obj: number): void { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DefaultRouter_free(this_obj); + // debug statements here + } + // MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger); + export function DefaultRouter_new(network_graph: number, logger: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DefaultRouter_new(network_graph, logger); + return nativeResponseValue; + } + // struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg); + export function DefaultRouter_as_Router(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.DefaultRouter_as_Router(this_arg); + return nativeResponseValue; + } + // struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg); + export function ChannelManager_as_Payer(this_arg: number): number { + if(!isWasmInitialized) { + throw new Error("initializeWasm() must be awaited first!"); + } + const nativeResponseValue = wasm.ChannelManager_as_Payer(this_arg); + return nativeResponseValue; + } // struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s); export function SiPrefix_from_str(s: String): number { if(!isWasmInitialized) {