void* tweak_ptr = untag_ptr(tweak);
CHECK_ACCESS(tweak_ptr);
LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
- // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
+ tweak_conv = COption_ScalarZ_clone((LDKCOption_ScalarZ*)untag_ptr(tweak));
LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
*ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
return tag_ptr(ret_conv, true);
COption_ScalarZ_free(_res_conv);
}
+static inline uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg) {
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_ScalarZ_clone_ptr"))) TS_COption_ScalarZ_clone_ptr(uint64_t arg) {
+ LDKCOption_ScalarZ* arg_conv = (LDKCOption_ScalarZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_ScalarZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_ScalarZ_clone"))) TS_COption_ScalarZ_clone(uint64_t orig) {
+ LDKCOption_ScalarZ* orig_conv = (LDKCOption_ScalarZ*)untag_ptr(orig);
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_ok"))) TS_CResult_SharedSecretNoneZ_ok(int8_tArray o) {
LDKThirtyTwoBytes o_ref;
CHECK(o->arr_len == 32);
void* tweak_ptr = untag_ptr(tweak);
CHECK_ACCESS(tweak_ptr);
LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
- // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
+ tweak_conv = COption_ScalarZ_clone((LDKCOption_ScalarZ*)untag_ptr(tweak));
LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
*ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
return tag_ptr(ret_conv, true);
COption_ScalarZ_free(_res_conv);
}
+static inline uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg) {
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_clone(arg);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+int64_t __attribute__((export_name("TS_COption_ScalarZ_clone_ptr"))) TS_COption_ScalarZ_clone_ptr(uint64_t arg) {
+ LDKCOption_ScalarZ* arg_conv = (LDKCOption_ScalarZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_ScalarZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+uint64_t __attribute__((export_name("TS_COption_ScalarZ_clone"))) TS_COption_ScalarZ_clone(uint64_t orig) {
+ LDKCOption_ScalarZ* orig_conv = (LDKCOption_ScalarZ*)untag_ptr(orig);
+ LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+ *ret_copy = COption_ScalarZ_clone(orig_conv);
+ uint64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
uint64_t __attribute__((export_name("TS_CResult_SharedSecretNoneZ_ok"))) TS_CResult_SharedSecretNoneZ_ok(int8_tArray o) {
LDKThirtyTwoBytes o_ref;
CHECK(o->arr_len == 32);
}
const nativeResponseValue = wasm.TS_COption_ScalarZ_free(_res);
// debug statements here
+}
+ // uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg);
+/* @internal */
+export function COption_ScalarZ_clone_ptr(arg: bigint): bigint {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.TS_COption_ScalarZ_clone_ptr(arg);
+ return nativeResponseValue;
+}
+ // struct LDKCOption_ScalarZ COption_ScalarZ_clone(const struct LDKCOption_ScalarZ *NONNULL_PTR orig);
+/* @internal */
+export function COption_ScalarZ_clone(orig: bigint): bigint {
+ if(!isWasmInitialized) {
+ throw new Error("initializeWasm() must be awaited first!");
+ }
+ const nativeResponseValue = wasm.TS_COption_ScalarZ_clone(orig);
+ return nativeResponseValue;
}
// struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
/* @internal */
* Errors if less than two hops are provided or if `node_pk`(s) are invalid.
*/
public static constructor_new_for_message(node_pks: Uint8Array[], entropy_source: EntropySource): Result_BlindedPathNoneZ {
- const ret: bigint = bindings.BlindedPath_new_for_message(bindings.encodeUint32Array(node_pks != null ? node_pks.map(node_pks_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(node_pks_conv_12, 33))) : null), entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source));
+ const ret: bigint = bindings.BlindedPath_new_for_message(bindings.encodeUint32Array(node_pks != null ? node_pks.map(node_pks_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(node_pks_conv_12, 33))) : null), CommonBase.get_ptr_of(entropy_source));
const ret_hu_conv: Result_BlindedPathNoneZ = Result_BlindedPathNoneZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, entropy_source);
return ret_hu_conv;
* Signs the holder commitment transaction because we are about to broadcast it.
*/
public sign_holder_commitment(funding_key: Uint8Array, funding_redeemscript: Uint8Array, channel_value_satoshis: bigint, entropy_source: EntropySource): Uint8Array {
- const ret: number = bindings.BuiltCommitmentTransaction_sign_holder_commitment(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(funding_key, 32)), bindings.encodeUint8Array(funding_redeemscript), channel_value_satoshis, entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source));
+ const ret: number = bindings.BuiltCommitmentTransaction_sign_holder_commitment(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(funding_key, 32)), bindings.encodeUint8Array(funding_redeemscript), channel_value_satoshis, CommonBase.get_ptr_of(entropy_source));
const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
CommonBase.add_ref_from(this, entropy_source);
return ret_conv;
* transactions relevant to the watched channels.
*/
public static constructor_new(chain_source: Option_FilterZ, broadcaster: BroadcasterInterface, logger: Logger, feeest: FeeEstimator, persister: Persist): ChainMonitor {
- const ret: bigint = bindings.ChainMonitor_new(CommonBase.get_ptr_of(chain_source), broadcaster == null ? 0n : CommonBase.get_ptr_of(broadcaster), logger == null ? 0n : CommonBase.get_ptr_of(logger), feeest == null ? 0n : CommonBase.get_ptr_of(feeest), persister == null ? 0n : CommonBase.get_ptr_of(persister));
+ const ret: bigint = bindings.ChainMonitor_new(CommonBase.get_ptr_of(chain_source), CommonBase.get_ptr_of(broadcaster), CommonBase.get_ptr_of(logger), CommonBase.get_ptr_of(feeest), CommonBase.get_ptr_of(persister));
const ret_hu_conv: ChainMonitor = new ChainMonitor(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, chain_source);
* [`params.best_block.block_hash`]: chain::BestBlock::block_hash
*/
public static constructor_new(fee_est: FeeEstimator, chain_monitor: Watch, tx_broadcaster: BroadcasterInterface, router: Router, logger: Logger, entropy_source: EntropySource, node_signer: NodeSigner, signer_provider: SignerProvider, config: UserConfig, params: ChainParameters): ChannelManager {
- const ret: bigint = bindings.ChannelManager_new(fee_est == null ? 0n : CommonBase.get_ptr_of(fee_est), chain_monitor == null ? 0n : CommonBase.get_ptr_of(chain_monitor), tx_broadcaster == null ? 0n : CommonBase.get_ptr_of(tx_broadcaster), router == null ? 0n : CommonBase.get_ptr_of(router), logger == null ? 0n : CommonBase.get_ptr_of(logger), entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer), signer_provider == null ? 0n : CommonBase.get_ptr_of(signer_provider), config == null ? 0n : CommonBase.get_ptr_of(config), params == null ? 0n : CommonBase.get_ptr_of(params));
+ const ret: bigint = bindings.ChannelManager_new(CommonBase.get_ptr_of(fee_est), CommonBase.get_ptr_of(chain_monitor), CommonBase.get_ptr_of(tx_broadcaster), CommonBase.get_ptr_of(router), CommonBase.get_ptr_of(logger), CommonBase.get_ptr_of(entropy_source), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(signer_provider), config == null ? 0n : CommonBase.get_ptr_of(config), params == null ? 0n : CommonBase.get_ptr_of(params));
const ret_hu_conv: ChannelManager = new ChannelManager(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, fee_est);
* A cryptographically secure source of entropy.
*/
public set_entropy_source(val: EntropySource): void {
- bindings.ChannelManagerReadArgs_set_entropy_source(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.ChannelManagerReadArgs_set_entropy_source(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* A signer that is able to perform node-scoped cryptographic operations.
*/
public set_node_signer(val: NodeSigner): void {
- bindings.ChannelManagerReadArgs_set_node_signer(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.ChannelManagerReadArgs_set_node_signer(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* signing data.
*/
public set_signer_provider(val: SignerProvider): void {
- bindings.ChannelManagerReadArgs_set_signer_provider(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.ChannelManagerReadArgs_set_signer_provider(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* No calls to the FeeEstimator will be made during deserialization.
*/
public set_fee_estimator(val: FeeEstimator): void {
- bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* chain::Watch after deserializing this ChannelManager.
*/
public set_chain_monitor(val: Watch): void {
- bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* force-closed during deserialization.
*/
public set_tx_broadcaster(val: BroadcasterInterface): void {
- bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* No calls to the router will be made during deserialization.
*/
public set_router(val: Router): void {
- bindings.ChannelManagerReadArgs_set_router(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.ChannelManagerReadArgs_set_router(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* deserialization.
*/
public set_logger(val: Logger): void {
- bindings.ChannelManagerReadArgs_set_logger(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.ChannelManagerReadArgs_set_logger(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* populate a HashMap directly from C.
*/
public static constructor_new(entropy_source: EntropySource, node_signer: NodeSigner, signer_provider: SignerProvider, fee_estimator: FeeEstimator, chain_monitor: Watch, tx_broadcaster: BroadcasterInterface, router: Router, logger: Logger, default_config: UserConfig, channel_monitors: ChannelMonitor[]): ChannelManagerReadArgs {
- const ret: bigint = bindings.ChannelManagerReadArgs_new(entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer), signer_provider == null ? 0n : CommonBase.get_ptr_of(signer_provider), fee_estimator == null ? 0n : CommonBase.get_ptr_of(fee_estimator), chain_monitor == null ? 0n : CommonBase.get_ptr_of(chain_monitor), tx_broadcaster == null ? 0n : CommonBase.get_ptr_of(tx_broadcaster), router == null ? 0n : CommonBase.get_ptr_of(router), logger == null ? 0n : CommonBase.get_ptr_of(logger), default_config == null ? 0n : CommonBase.get_ptr_of(default_config), bindings.encodeUint64Array(channel_monitors != null ? channel_monitors.map(channel_monitors_conv_16 => channel_monitors_conv_16 == null ? 0n : CommonBase.get_ptr_of(channel_monitors_conv_16)) : null));
+ const ret: bigint = bindings.ChannelManagerReadArgs_new(CommonBase.get_ptr_of(entropy_source), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(signer_provider), CommonBase.get_ptr_of(fee_estimator), CommonBase.get_ptr_of(chain_monitor), CommonBase.get_ptr_of(tx_broadcaster), CommonBase.get_ptr_of(router), CommonBase.get_ptr_of(logger), default_config == null ? 0n : CommonBase.get_ptr_of(default_config), bindings.encodeUint64Array(channel_monitors != null ? channel_monitors.map(channel_monitors_conv_16 => channel_monitors_conv_16 == null ? 0n : CommonBase.get_ptr_of(channel_monitors_conv_16)) : null));
const ret_hu_conv: ChannelManagerReadArgs = new ChannelManagerReadArgs(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, entropy_source);
* panics if the given update is not the next update by update_id.
*/
public update_monitor(updates: ChannelMonitorUpdate, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): Result_NoneNoneZ {
- const ret: bigint = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0n : CommonBase.get_ptr_of(updates), broadcaster == null ? 0n : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0n : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: bigint = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0n : CommonBase.get_ptr_of(updates), CommonBase.get_ptr_of(broadcaster), CommonBase.get_ptr_of(fee_estimator), CommonBase.get_ptr_of(logger));
const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret);
CommonBase.add_ref_from(this, updates);
CommonBase.add_ref_from(this, broadcaster);
* have been registered.
*/
public load_outputs_to_watch(filter: Filter): void {
- bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0n : CommonBase.get_ptr_of(filter));
+ bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, CommonBase.get_ptr_of(filter));
CommonBase.add_ref_from(this, filter);
}
* [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
*/
public get_latest_holder_commitment_txn(logger: Logger): Uint8Array[] {
- const ret: number = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: number = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, CommonBase.get_ptr_of(logger));
const ret_conv_12_len: number = bindings.getArrayLength(ret);
const ret_conv_12_arr: Uint8Array[] = new Array(ret_conv_12_len).fill(null);
for (var m = 0; m < ret_conv_12_len; m++) {
* [`get_outputs_to_watch`]: #method.get_outputs_to_watch
*/
public block_connected(header: Uint8Array, txdata: TwoTuple_usizeTransactionZ[], height: number, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] {
- const ret: number = bindings.ChannelMonitor_block_connected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), bindings.encodeUint64Array(txdata != null ? txdata.map(txdata_conv_28 => txdata_conv_28 != null ? CommonBase.get_ptr_of(txdata_conv_28) : 0n) : null), height, broadcaster == null ? 0n : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0n : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: number = bindings.ChannelMonitor_block_connected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), bindings.encodeUint64Array(txdata != null ? txdata.map(txdata_conv_28 => txdata_conv_28 != null ? CommonBase.get_ptr_of(txdata_conv_28) : 0n) : null), height, CommonBase.get_ptr_of(broadcaster), CommonBase.get_ptr_of(fee_estimator), CommonBase.get_ptr_of(logger));
const ret_conv_39_len: number = bindings.getArrayLength(ret);
const ret_conv_39_arr: TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] = new Array(ret_conv_39_len).fill(null);
for (var n = 0; n < ret_conv_39_len; n++) {
* appropriately.
*/
public block_disconnected(header: Uint8Array, height: number, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): void {
- bindings.ChannelMonitor_block_disconnected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), height, broadcaster == null ? 0n : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0n : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ bindings.ChannelMonitor_block_disconnected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), height, CommonBase.get_ptr_of(broadcaster), CommonBase.get_ptr_of(fee_estimator), CommonBase.get_ptr_of(logger));
CommonBase.add_ref_from(this, broadcaster);
CommonBase.add_ref_from(this, fee_estimator);
CommonBase.add_ref_from(this, logger);
* [`block_connected`]: Self::block_connected
*/
public transactions_confirmed(header: Uint8Array, txdata: TwoTuple_usizeTransactionZ[], height: number, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] {
- const ret: number = bindings.ChannelMonitor_transactions_confirmed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), bindings.encodeUint64Array(txdata != null ? txdata.map(txdata_conv_28 => txdata_conv_28 != null ? CommonBase.get_ptr_of(txdata_conv_28) : 0n) : null), height, broadcaster == null ? 0n : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0n : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: number = bindings.ChannelMonitor_transactions_confirmed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), bindings.encodeUint64Array(txdata != null ? txdata.map(txdata_conv_28 => txdata_conv_28 != null ? CommonBase.get_ptr_of(txdata_conv_28) : 0n) : null), height, CommonBase.get_ptr_of(broadcaster), CommonBase.get_ptr_of(fee_estimator), CommonBase.get_ptr_of(logger));
const ret_conv_39_len: number = bindings.getArrayLength(ret);
const ret_conv_39_arr: TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] = new Array(ret_conv_39_len).fill(null);
for (var n = 0; n < ret_conv_39_len; n++) {
* [`block_disconnected`]: Self::block_disconnected
*/
public transaction_unconfirmed(txid: Uint8Array, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): void {
- bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(txid, 32)), broadcaster == null ? 0n : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0n : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(txid, 32)), CommonBase.get_ptr_of(broadcaster), CommonBase.get_ptr_of(fee_estimator), CommonBase.get_ptr_of(logger));
CommonBase.add_ref_from(this, broadcaster);
CommonBase.add_ref_from(this, fee_estimator);
CommonBase.add_ref_from(this, logger);
* [`block_connected`]: Self::block_connected
*/
public best_block_updated(header: Uint8Array, height: number, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] {
- const ret: number = bindings.ChannelMonitor_best_block_updated(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), height, broadcaster == null ? 0n : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0n : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: number = bindings.ChannelMonitor_best_block_updated(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), height, CommonBase.get_ptr_of(broadcaster), CommonBase.get_ptr_of(fee_estimator), CommonBase.get_ptr_of(logger));
const ret_conv_39_len: number = bindings.getArrayLength(ret);
const ret_conv_39_arr: TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] = new Array(ret_conv_39_len).fill(null);
for (var n = 0; n < ret_conv_39_len; n++) {
* connections, like on mobile.
*/
public rebroadcast_pending_claims(broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): void {
- bindings.ChannelMonitor_rebroadcast_pending_claims(this.ptr, broadcaster == null ? 0n : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0n : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ bindings.ChannelMonitor_rebroadcast_pending_claims(this.ptr, CommonBase.get_ptr_of(broadcaster), CommonBase.get_ptr_of(fee_estimator), CommonBase.get_ptr_of(logger));
CommonBase.add_ref_from(this, broadcaster);
CommonBase.add_ref_from(this, fee_estimator);
CommonBase.add_ref_from(this, logger);
* to send.
*/
public handle_custom_message(msg: Type, sender_node_id: Uint8Array): Result_NoneLightningErrorZ {
- const ret: bigint = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0n : CommonBase.get_ptr_of(msg), bindings.encodeUint8Array(bindings.check_arr_len(sender_node_id, 33)));
+ const ret: bigint = bindings.CustomMessageHandler_handle_custom_message(this.ptr, CommonBase.get_ptr_of(msg), bindings.encodeUint8Array(bindings.check_arr_len(sender_node_id, 33)));
const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(this, msg);
return ret_hu_conv;
* Called with the custom message that was received.
*/
public handle_custom_message(msg: CustomOnionMessageContents): void {
- bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg == null ? 0n : CommonBase.get_ptr_of(msg));
+ bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, CommonBase.get_ptr_of(msg));
CommonBase.add_ref_from(this, msg);
}
* Creates a new router.
*/
public static constructor_new(network_graph: NetworkGraph, logger: Logger, random_seed_bytes: Uint8Array, scorer: LockableScore): DefaultRouter {
- const ret: bigint = bindings.DefaultRouter_new(network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), logger == null ? 0n : CommonBase.get_ptr_of(logger), bindings.encodeUint8Array(bindings.check_arr_len(random_seed_bytes, 32)), scorer == null ? 0n : CommonBase.get_ptr_of(scorer));
+ const ret: bigint = bindings.DefaultRouter_new(network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), CommonBase.get_ptr_of(logger), bindings.encodeUint8Array(bindings.check_arr_len(random_seed_bytes, 32)), CommonBase.get_ptr_of(scorer));
const ret_hu_conv: DefaultRouter = new DefaultRouter(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, network_graph);
* See the trait-level documentation for requirements.
*/
public process_pending_events(handler: EventHandler): void {
- bindings.EventsProvider_process_pending_events(this.ptr, handler == null ? 0n : CommonBase.get_ptr_of(handler));
+ bindings.EventsProvider_process_pending_events(this.ptr, CommonBase.get_ptr_of(handler));
CommonBase.add_ref_from(this, handler);
}
* completed, the callback will be called immediately.
*/
public register_callback_fn(callback: FutureCallback): void {
- bindings.Future_register_callback_fn(this.ptr, callback == null ? 0n : CommonBase.get_ptr_of(callback));
+ bindings.Future_register_callback_fn(this.ptr, CommonBase.get_ptr_of(callback));
CommonBase.add_ref_from(this, callback);
}
* Read a InMemorySigner from a byte array, created by InMemorySigner_write
*/
public static constructor_read(ser: Uint8Array, arg: EntropySource): Result_InMemorySignerDecodeErrorZ {
- const ret: bigint = bindings.InMemorySigner_read(bindings.encodeUint8Array(ser), arg == null ? 0n : CommonBase.get_ptr_of(arg));
+ const ret: bigint = bindings.InMemorySigner_read(bindings.encodeUint8Array(ser), CommonBase.get_ptr_of(arg));
const ret_hu_conv: Result_InMemorySignerDecodeErrorZ = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, arg);
return ret_hu_conv;
let structImplementation = {
lock (): bigint {
const ret: Score = arg.lock();
- const result: bigint = ret == null ? 0n : CommonBase.get_ptr_of(ret);
+ const result: bigint = CommonBase.get_ptr_of(ret);
CommonBase.add_ref_from(impl_holder.held, ret);
return result;
},
* [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
*/
public set_chan_handler(val: ChannelMessageHandler): void {
- bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.MessageHandler_set_chan_handler(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
*/
public set_route_handler(val: RoutingMessageHandler): void {
- bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.MessageHandler_set_route_handler(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* [`IgnoringMessageHandler`].
*/
public set_onion_message_handler(val: OnionMessageHandler): void {
- bindings.MessageHandler_set_onion_message_handler(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ bindings.MessageHandler_set_onion_message_handler(this.ptr, CommonBase.get_ptr_of(val));
CommonBase.add_ref_from(this, val);
}
* Constructs a new MessageHandler given each field
*/
public static constructor_new(chan_handler_arg: ChannelMessageHandler, route_handler_arg: RoutingMessageHandler, onion_message_handler_arg: OnionMessageHandler): MessageHandler {
- const ret: bigint = bindings.MessageHandler_new(chan_handler_arg == null ? 0n : CommonBase.get_ptr_of(chan_handler_arg), route_handler_arg == null ? 0n : CommonBase.get_ptr_of(route_handler_arg), onion_message_handler_arg == null ? 0n : CommonBase.get_ptr_of(onion_message_handler_arg));
+ const ret: bigint = bindings.MessageHandler_new(CommonBase.get_ptr_of(chan_handler_arg), CommonBase.get_ptr_of(route_handler_arg), CommonBase.get_ptr_of(onion_message_handler_arg));
const ret_hu_conv: MessageHandler = new MessageHandler(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, chan_handler_arg);
* Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
*/
public static constructor_new(score: Score): MultiThreadedLockableScore {
- const ret: bigint = bindings.MultiThreadedLockableScore_new(score == null ? 0n : CommonBase.get_ptr_of(score));
+ const ret: bigint = bindings.MultiThreadedLockableScore_new(CommonBase.get_ptr_of(score));
const ret_hu_conv: MultiThreadedLockableScore = new MultiThreadedLockableScore(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, score);
* Read a NetworkGraph from a byte array, created by NetworkGraph_write
*/
public static constructor_read(ser: Uint8Array, arg: Logger): Result_NetworkGraphDecodeErrorZ {
- const ret: bigint = bindings.NetworkGraph_read(bindings.encodeUint8Array(ser), arg == null ? 0n : CommonBase.get_ptr_of(arg));
+ const ret: bigint = bindings.NetworkGraph_read(bindings.encodeUint8Array(ser), CommonBase.get_ptr_of(arg));
const ret_hu_conv: Result_NetworkGraphDecodeErrorZ = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, arg);
return ret_hu_conv;
* Creates a new, empty, network graph.
*/
public static constructor_new(network: Network, logger: Logger): NetworkGraph {
- const ret: bigint = bindings.NetworkGraph_new(network, logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: bigint = bindings.NetworkGraph_new(network, CommonBase.get_ptr_of(logger));
const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, logger);
* Utility method to constructs a new Custom-variant OnionMessageContents
*/
public static constructor_custom(a: CustomOnionMessageContents): OnionMessageContents {
- const ret: bigint = bindings.OnionMessageContents_custom(a == null ? 0n : CommonBase.get_ptr_of(a));
+ const ret: bigint = bindings.OnionMessageContents_custom(CommonBase.get_ptr_of(a));
const ret_hu_conv: OnionMessageContents = OnionMessageContents.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, a);
* their respective handlers.
*/
public static constructor_new(entropy_source: EntropySource, node_signer: NodeSigner, logger: Logger, custom_handler: CustomOnionMessageHandler): OnionMessenger {
- const ret: bigint = bindings.OnionMessenger_new(entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer), logger == null ? 0n : CommonBase.get_ptr_of(logger), custom_handler == null ? 0n : CommonBase.get_ptr_of(custom_handler));
+ const ret: bigint = bindings.OnionMessenger_new(CommonBase.get_ptr_of(entropy_source), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(logger), CommonBase.get_ptr_of(custom_handler));
const ret_hu_conv: OnionMessenger = new OnionMessenger(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, entropy_source);
* Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
*/
public static constructor_some(o: CustomOnionMessageContents): Option_CustomOnionMessageContentsZ {
- const ret: bigint = bindings.COption_CustomOnionMessageContentsZ_some(o == null ? 0n : CommonBase.get_ptr_of(o));
+ const ret: bigint = bindings.COption_CustomOnionMessageContentsZ_some(CommonBase.get_ptr_of(o));
const ret_hu_conv: Option_CustomOnionMessageContentsZ = Option_CustomOnionMessageContentsZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, o);
* Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
*/
public static constructor_some(o: Filter): Option_FilterZ {
- const ret: bigint = bindings.COption_FilterZ_some(o == null ? 0n : CommonBase.get_ptr_of(o));
+ const ret: bigint = bindings.COption_FilterZ_some(CommonBase.get_ptr_of(o));
const ret_hu_conv: Option_FilterZ = Option_FilterZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, o);
return ret_hu_conv;
}
+ public clone_ptr(): bigint {
+ const ret: bigint = bindings.COption_ScalarZ_clone_ptr(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Creates a new COption_ScalarZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public clone(): Option_ScalarZ {
+ const ret: bigint = bindings.COption_ScalarZ_clone(this.ptr);
+ const ret_hu_conv: Option_ScalarZ = Option_ScalarZ.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ return ret_hu_conv;
+ }
+
}
/** A Option_ScalarZ of type Some */
export class Option_ScalarZ_Some extends Option_ScalarZ {
* Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
*/
public static constructor_some(o: Type): Option_TypeZ {
- const ret: bigint = bindings.COption_TypeZ_some(o == null ? 0n : CommonBase.get_ptr_of(o));
+ const ret: bigint = bindings.COption_TypeZ_some(CommonBase.get_ptr_of(o));
const ret_hu_conv: Option_TypeZ = Option_TypeZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, o);
* Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
*/
public static constructor_some(o: UtxoLookup): Option_UtxoLookupZ {
- const ret: bigint = bindings.COption_UtxoLookupZ_some(o == null ? 0n : CommonBase.get_ptr_of(o));
+ const ret: bigint = bindings.COption_UtxoLookupZ_some(CommonBase.get_ptr_of(o));
const ret_hu_conv: Option_UtxoLookupZ = Option_UtxoLookupZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, o);
* correct, and the announcement is signed with channel owners' keys.
*/
public static constructor_new(network_graph: NetworkGraph, utxo_lookup: Option_UtxoLookupZ, logger: Logger): P2PGossipSync {
- const ret: bigint = bindings.P2PGossipSync_new(network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), CommonBase.get_ptr_of(utxo_lookup), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: bigint = bindings.P2PGossipSync_new(network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), CommonBase.get_ptr_of(utxo_lookup), CommonBase.get_ptr_of(logger));
const ret_hu_conv: P2PGossipSync = new P2PGossipSync(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, network_graph);
* minute should suffice.
*/
public static constructor_new(message_handler_chan_handler_arg: ChannelMessageHandler, message_handler_route_handler_arg: RoutingMessageHandler, message_handler_onion_message_handler_arg: OnionMessageHandler, current_time: number, ephemeral_random_data: Uint8Array, logger: Logger, custom_message_handler: CustomMessageHandler, node_signer: NodeSigner): PeerManager {
- const ret: bigint = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0n : CommonBase.get_ptr_of(message_handler_chan_handler_arg), message_handler_route_handler_arg == null ? 0n : CommonBase.get_ptr_of(message_handler_route_handler_arg), message_handler_onion_message_handler_arg == null ? 0n : CommonBase.get_ptr_of(message_handler_onion_message_handler_arg)), current_time, bindings.encodeUint8Array(bindings.check_arr_len(ephemeral_random_data, 32)), logger == null ? 0n : CommonBase.get_ptr_of(logger), custom_message_handler == null ? 0n : CommonBase.get_ptr_of(custom_message_handler), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer));
+ const ret: bigint = bindings.PeerManager_new(bindings.MessageHandler_new(CommonBase.get_ptr_of(message_handler_chan_handler_arg), CommonBase.get_ptr_of(message_handler_route_handler_arg), CommonBase.get_ptr_of(message_handler_onion_message_handler_arg)), current_time, bindings.encodeUint8Array(bindings.check_arr_len(ephemeral_random_data, 32)), CommonBase.get_ptr_of(logger), CommonBase.get_ptr_of(custom_message_handler), CommonBase.get_ptr_of(node_signer));
const ret_hu_conv: PeerManager = new PeerManager(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, message_handler_chan_handler_arg);
* [`socket_disconnected`]: PeerManager::socket_disconnected
*/
public new_outbound_connection(their_node_id: Uint8Array, descriptor: SocketDescriptor, remote_network_address: Option_NetAddressZ): Result_CVec_u8ZPeerHandleErrorZ {
- const ret: bigint = bindings.PeerManager_new_outbound_connection(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), descriptor == null ? 0n : CommonBase.get_ptr_of(descriptor), CommonBase.get_ptr_of(remote_network_address));
+ const ret: bigint = bindings.PeerManager_new_outbound_connection(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), CommonBase.get_ptr_of(descriptor), CommonBase.get_ptr_of(remote_network_address));
const ret_hu_conv: Result_CVec_u8ZPeerHandleErrorZ = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(this, descriptor);
CommonBase.add_ref_from(this, remote_network_address);
* [`socket_disconnected`]: PeerManager::socket_disconnected
*/
public new_inbound_connection(descriptor: SocketDescriptor, remote_network_address: Option_NetAddressZ): Result_NonePeerHandleErrorZ {
- const ret: bigint = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0n : CommonBase.get_ptr_of(descriptor), CommonBase.get_ptr_of(remote_network_address));
+ const ret: bigint = bindings.PeerManager_new_inbound_connection(this.ptr, CommonBase.get_ptr_of(descriptor), CommonBase.get_ptr_of(remote_network_address));
const ret_hu_conv: Result_NonePeerHandleErrorZ = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(this, descriptor);
CommonBase.add_ref_from(this, remote_network_address);
* [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
*/
public write_buffer_space_avail(descriptor: SocketDescriptor): Result_NonePeerHandleErrorZ {
- const ret: bigint = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0n : CommonBase.get_ptr_of(descriptor));
+ const ret: bigint = bindings.PeerManager_write_buffer_space_avail(this.ptr, CommonBase.get_ptr_of(descriptor));
const ret_hu_conv: Result_NonePeerHandleErrorZ = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
* [`process_events`]: PeerManager::process_events
*/
public read_event(peer_descriptor: SocketDescriptor, data: Uint8Array): Result_boolPeerHandleErrorZ {
- const ret: bigint = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0n : CommonBase.get_ptr_of(peer_descriptor), bindings.encodeUint8Array(data));
+ const ret: bigint = bindings.PeerManager_read_event(this.ptr, CommonBase.get_ptr_of(peer_descriptor), bindings.encodeUint8Array(data));
const ret_hu_conv: Result_boolPeerHandleErrorZ = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
* Indicates that the given socket descriptor's connection is now closed.
*/
public socket_disconnected(descriptor: SocketDescriptor): void {
- bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0n : CommonBase.get_ptr_of(descriptor));
+ bindings.PeerManager_socket_disconnected(this.ptr, CommonBase.get_ptr_of(descriptor));
}
/**
* Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
*/
public persist_scorer(scorer: WriteableScore): Result_NoneErrorZ {
- const ret: bigint = bindings.Persister_persist_scorer(this.ptr, scorer == null ? 0n : CommonBase.get_ptr_of(scorer));
+ const ret: bigint = bindings.Persister_persist_scorer(this.ptr, CommonBase.get_ptr_of(scorer));
const ret_hu_conv: Result_NoneErrorZ = Result_NoneErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(this, scorer);
return ret_hu_conv;
* through a network graph.
*/
public static constructor_new(params: ProbabilisticScoringParameters, network_graph: NetworkGraph, logger: Logger): ProbabilisticScorer {
- const ret: bigint = bindings.ProbabilisticScorer_new(params == null ? 0n : CommonBase.get_ptr_of(params), network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: bigint = bindings.ProbabilisticScorer_new(params == null ? 0n : CommonBase.get_ptr_of(params), network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), CommonBase.get_ptr_of(logger));
const ret_hu_conv: ProbabilisticScorer = new ProbabilisticScorer(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, params);
* Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
*/
public static constructor_read(ser: Uint8Array, arg_a: ProbabilisticScoringParameters, arg_b: NetworkGraph, arg_c: Logger): Result_ProbabilisticScorerDecodeErrorZ {
- const ret: bigint = bindings.ProbabilisticScorer_read(bindings.encodeUint8Array(ser), arg_a == null ? 0n : CommonBase.get_ptr_of(arg_a), arg_b == null ? 0n : CommonBase.get_ptr_of(arg_b), arg_c == null ? 0n : CommonBase.get_ptr_of(arg_c));
+ const ret: bigint = bindings.ProbabilisticScorer_read(bindings.encodeUint8Array(ser), arg_a == null ? 0n : CommonBase.get_ptr_of(arg_a), arg_b == null ? 0n : CommonBase.get_ptr_of(arg_b), CommonBase.get_ptr_of(arg_c));
const ret_hu_conv: Result_ProbabilisticScorerDecodeErrorZ = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, arg_a);
CommonBase.add_ref_from(ret_hu_conv, arg_b);
* Instantiate a new [`RapidGossipSync`] instance.
*/
public static constructor_new(network_graph: NetworkGraph, logger: Logger): RapidGossipSync {
- const ret: bigint = bindings.RapidGossipSync_new(network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), logger == null ? 0n : CommonBase.get_ptr_of(logger));
+ const ret: bigint = bindings.RapidGossipSync_new(network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), CommonBase.get_ptr_of(logger));
const ret_hu_conv: RapidGossipSync = new RapidGossipSync(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, network_graph);
* Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
*/
public static constructor_ok(o_network: Network, o_logger: Logger): Result_NetworkGraphDecodeErrorZ {
- const ret: bigint = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(o_network, o_logger == null ? 0n : CommonBase.get_ptr_of(o_logger)));
+ const ret: bigint = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(o_network, CommonBase.get_ptr_of(o_logger)));
const ret_hu_conv: Result_NetworkGraphDecodeErrorZ = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, o_logger);
return ret_hu_conv;
* Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
*/
public static constructor_ok(o_params: ProbabilisticScoringParameters, o_network_graph: NetworkGraph, o_logger: Logger): Result_ProbabilisticScorerDecodeErrorZ {
- const ret: bigint = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0n : CommonBase.get_ptr_of(o_params), o_network_graph == null ? 0n : CommonBase.get_ptr_of(o_network_graph), o_logger == null ? 0n : CommonBase.get_ptr_of(o_logger)));
+ const ret: bigint = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0n : CommonBase.get_ptr_of(o_params), o_network_graph == null ? 0n : CommonBase.get_ptr_of(o_network_graph), CommonBase.get_ptr_of(o_logger)));
const ret_hu_conv: Result_ProbabilisticScorerDecodeErrorZ = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, o_params);
CommonBase.add_ref_from(ret_hu_conv, o_network_graph);
* Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
*/
public static constructor_ok(o: WriteableEcdsaChannelSigner): Result_WriteableEcdsaChannelSignerDecodeErrorZ {
- const ret: bigint = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o == null ? 0n : CommonBase.get_ptr_of(o));
+ const ret: bigint = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(CommonBase.get_ptr_of(o));
const ret_hu_conv: Result_WriteableEcdsaChannelSignerDecodeErrorZ = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, o);
return ret_hu_conv;
* Initialize a new `ScorerAccountingForInFlightHtlcs`.
*/
public static constructor_new(scorer: Score, inflight_htlcs: InFlightHtlcs): ScorerAccountingForInFlightHtlcs {
- const ret: bigint = bindings.ScorerAccountingForInFlightHtlcs_new(scorer == null ? 0n : CommonBase.get_ptr_of(scorer), inflight_htlcs == null ? 0n : CommonBase.get_ptr_of(inflight_htlcs));
+ const ret: bigint = bindings.ScorerAccountingForInFlightHtlcs_new(CommonBase.get_ptr_of(scorer), inflight_htlcs == null ? 0n : CommonBase.get_ptr_of(inflight_htlcs));
const ret_hu_conv: ScorerAccountingForInFlightHtlcs = new ScorerAccountingForInFlightHtlcs(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, scorer);
derive_channel_signer (channel_value_satoshis: bigint, channel_keys_id: number): bigint {
const channel_keys_id_conv: Uint8Array = bindings.decodeUint8Array(channel_keys_id);
const ret: WriteableEcdsaChannelSigner = arg.derive_channel_signer(channel_value_satoshis, channel_keys_id_conv);
- const result: bigint = ret == null ? 0n : ret.clone_ptr();
+ const result: bigint = ret.clone_ptr();
CommonBase.add_ref_from(impl_holder.held, ret);
return result;
},
* This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
*/
public get_htlc_sigs(htlc_base_key: Uint8Array, channel_parameters: DirectedChannelTransactionParameters, entropy_source: EntropySource): Result_CVec_SignatureZNoneZ {
- const ret: bigint = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(htlc_base_key, 32)), channel_parameters == null ? 0n : CommonBase.get_ptr_of(channel_parameters), entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source));
+ const ret: bigint = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(htlc_base_key, 32)), channel_parameters == null ? 0n : CommonBase.get_ptr_of(channel_parameters), CommonBase.get_ptr_of(entropy_source));
const ret_hu_conv: Result_CVec_SignatureZNoneZ = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
CommonBase.add_ref_from(this, channel_parameters);
CommonBase.add_ref_from(this, entropy_source);
* Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
*/
public static constructor_new(a: Uint8Array, b_fee_est: FeeEstimator, b_chain_monitor: Watch, b_tx_broadcaster: BroadcasterInterface, b_router: Router, b_logger: Logger, b_entropy_source: EntropySource, b_node_signer: NodeSigner, b_signer_provider: SignerProvider, b_config: UserConfig, b_params: ChainParameters): TwoTuple_BlockHashChannelManagerZ {
- const ret: bigint = bindings.C2Tuple_BlockHashChannelManagerZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), bindings.ChannelManager_new(b_fee_est == null ? 0n : CommonBase.get_ptr_of(b_fee_est), b_chain_monitor == null ? 0n : CommonBase.get_ptr_of(b_chain_monitor), b_tx_broadcaster == null ? 0n : CommonBase.get_ptr_of(b_tx_broadcaster), b_router == null ? 0n : CommonBase.get_ptr_of(b_router), b_logger == null ? 0n : CommonBase.get_ptr_of(b_logger), b_entropy_source == null ? 0n : CommonBase.get_ptr_of(b_entropy_source), b_node_signer == null ? 0n : CommonBase.get_ptr_of(b_node_signer), b_signer_provider == null ? 0n : CommonBase.get_ptr_of(b_signer_provider), b_config == null ? 0n : CommonBase.get_ptr_of(b_config), b_params == null ? 0n : CommonBase.get_ptr_of(b_params)));
+ const ret: bigint = bindings.C2Tuple_BlockHashChannelManagerZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), bindings.ChannelManager_new(CommonBase.get_ptr_of(b_fee_est), CommonBase.get_ptr_of(b_chain_monitor), CommonBase.get_ptr_of(b_tx_broadcaster), CommonBase.get_ptr_of(b_router), CommonBase.get_ptr_of(b_logger), CommonBase.get_ptr_of(b_entropy_source), CommonBase.get_ptr_of(b_node_signer), CommonBase.get_ptr_of(b_signer_provider), b_config == null ? 0n : CommonBase.get_ptr_of(b_config), b_params == null ? 0n : CommonBase.get_ptr_of(b_params)));
const ret_hu_conv: TwoTuple_BlockHashChannelManagerZ = new TwoTuple_BlockHashChannelManagerZ(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, b_fee_est);
* Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
*/
public static constructor_new(a: Uint8Array, b: Type): TwoTuple_PublicKeyTypeZ {
- const ret: bigint = bindings.C2Tuple_PublicKeyTypeZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 33)), b == null ? 0n : CommonBase.get_ptr_of(b));
+ const ret: bigint = bindings.C2Tuple_PublicKeyTypeZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 33)), CommonBase.get_ptr_of(b));
const ret_hu_conv: TwoTuple_PublicKeyTypeZ = new TwoTuple_PublicKeyTypeZ(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
CommonBase.add_ref_from(ret_hu_conv, b);
* Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
*/
public static constructor_C2Tuple_BlockHashChannelMonitorZ_read(ser: Uint8Array, arg_a: EntropySource, arg_b: SignerProvider): Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
- const ret: bigint = bindings.C2Tuple_BlockHashChannelMonitorZ_read(bindings.encodeUint8Array(ser), arg_a == null ? 0n : CommonBase.get_ptr_of(arg_a), arg_b == null ? 0n : CommonBase.get_ptr_of(arg_b));
+ const ret: bigint = bindings.C2Tuple_BlockHashChannelMonitorZ_read(bindings.encodeUint8Array(ser), CommonBase.get_ptr_of(arg_a), CommonBase.get_ptr_of(arg_b));
const ret_hu_conv: Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, arg_a);
CommonBase.add_ref_from(ret_hu_conv, arg_b);
* Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
*/
public static constructor_C2Tuple_BlockHashChannelManagerZ_read(ser: Uint8Array, arg_entropy_source: EntropySource, arg_node_signer: NodeSigner, arg_signer_provider: SignerProvider, arg_fee_estimator: FeeEstimator, arg_chain_monitor: Watch, arg_tx_broadcaster: BroadcasterInterface, arg_router: Router, arg_logger: Logger, arg_default_config: UserConfig, arg_channel_monitors: ChannelMonitor[]): Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
- const ret: bigint = bindings.C2Tuple_BlockHashChannelManagerZ_read(bindings.encodeUint8Array(ser), bindings.ChannelManagerReadArgs_new(arg_entropy_source == null ? 0n : CommonBase.get_ptr_of(arg_entropy_source), arg_node_signer == null ? 0n : CommonBase.get_ptr_of(arg_node_signer), arg_signer_provider == null ? 0n : CommonBase.get_ptr_of(arg_signer_provider), arg_fee_estimator == null ? 0n : CommonBase.get_ptr_of(arg_fee_estimator), arg_chain_monitor == null ? 0n : CommonBase.get_ptr_of(arg_chain_monitor), arg_tx_broadcaster == null ? 0n : CommonBase.get_ptr_of(arg_tx_broadcaster), arg_router == null ? 0n : CommonBase.get_ptr_of(arg_router), arg_logger == null ? 0n : CommonBase.get_ptr_of(arg_logger), arg_default_config == null ? 0n : CommonBase.get_ptr_of(arg_default_config), bindings.encodeUint64Array(arg_channel_monitors != null ? arg_channel_monitors.map(arg_channel_monitors_conv_16 => arg_channel_monitors_conv_16 == null ? 0n : CommonBase.get_ptr_of(arg_channel_monitors_conv_16)) : null)));
+ const ret: bigint = bindings.C2Tuple_BlockHashChannelManagerZ_read(bindings.encodeUint8Array(ser), bindings.ChannelManagerReadArgs_new(CommonBase.get_ptr_of(arg_entropy_source), CommonBase.get_ptr_of(arg_node_signer), CommonBase.get_ptr_of(arg_signer_provider), CommonBase.get_ptr_of(arg_fee_estimator), CommonBase.get_ptr_of(arg_chain_monitor), CommonBase.get_ptr_of(arg_tx_broadcaster), CommonBase.get_ptr_of(arg_router), CommonBase.get_ptr_of(arg_logger), arg_default_config == null ? 0n : CommonBase.get_ptr_of(arg_default_config), bindings.encodeUint64Array(arg_channel_monitors != null ? arg_channel_monitors.map(arg_channel_monitors_conv_16 => arg_channel_monitors_conv_16 == null ? 0n : CommonBase.get_ptr_of(arg_channel_monitors_conv_16)) : null)));
const ret_hu_conv: Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, arg_entropy_source);
CommonBase.add_ref_from(ret_hu_conv, arg_node_signer);
* [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
*/
public static constructor_create(keys: ExpandedKey, min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number, entropy_source: EntropySource, current_time: bigint, min_final_cltv_expiry_delta: Option_u16Z): Result_C2Tuple_PaymentHashPaymentSecretZNoneZ {
- const ret: bigint = bindings.create(keys == null ? 0n : CommonBase.get_ptr_of(keys), CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs, entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source), current_time, CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
+ const ret: bigint = bindings.create(keys == null ? 0n : CommonBase.get_ptr_of(keys), CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs, CommonBase.get_ptr_of(entropy_source), current_time, CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZNoneZ = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, keys);
CommonBase.add_ref_from(ret_hu_conv, min_value_msat);
* Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public static constructor_find_route(our_node_pubkey: Uint8Array, route_params: RouteParameters, network_graph: NetworkGraph, first_hops: ChannelDetails[]|null, logger: Logger, scorer: Score, random_seed_bytes: Uint8Array): Result_RouteLightningErrorZ {
- const ret: bigint = bindings.find_route(bindings.encodeUint8Array(bindings.check_arr_len(our_node_pubkey, 33)), route_params == null ? 0n : CommonBase.get_ptr_of(route_params), network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), bindings.encodeUint64Array(first_hops != null ? first_hops.map(first_hops_conv_16 => first_hops_conv_16 == null ? 0n : CommonBase.get_ptr_of(first_hops_conv_16)) : null), logger == null ? 0n : CommonBase.get_ptr_of(logger), scorer == null ? 0n : CommonBase.get_ptr_of(scorer), bindings.encodeUint8Array(bindings.check_arr_len(random_seed_bytes, 32)));
+ const ret: bigint = bindings.find_route(bindings.encodeUint8Array(bindings.check_arr_len(our_node_pubkey, 33)), route_params == null ? 0n : CommonBase.get_ptr_of(route_params), network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), bindings.encodeUint64Array(first_hops != null ? first_hops.map(first_hops_conv_16 => first_hops_conv_16 == null ? 0n : CommonBase.get_ptr_of(first_hops_conv_16)) : null), CommonBase.get_ptr_of(logger), CommonBase.get_ptr_of(scorer), bindings.encodeUint8Array(bindings.check_arr_len(random_seed_bytes, 32)));
const ret_hu_conv: Result_RouteLightningErrorZ = Result_RouteLightningErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, route_params);
CommonBase.add_ref_from(ret_hu_conv, network_graph);
* Re-uses logic from `find_route`, so the restrictions described there also apply here.
*/
public static constructor_build_route_from_hops(our_node_pubkey: Uint8Array, hops: Uint8Array[], route_params: RouteParameters, network_graph: NetworkGraph, logger: Logger, random_seed_bytes: Uint8Array): Result_RouteLightningErrorZ {
- const ret: bigint = bindings.build_route_from_hops(bindings.encodeUint8Array(bindings.check_arr_len(our_node_pubkey, 33)), bindings.encodeUint32Array(hops != null ? hops.map(hops_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(hops_conv_12, 33))) : null), route_params == null ? 0n : CommonBase.get_ptr_of(route_params), network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), logger == null ? 0n : CommonBase.get_ptr_of(logger), bindings.encodeUint8Array(bindings.check_arr_len(random_seed_bytes, 32)));
+ const ret: bigint = bindings.build_route_from_hops(bindings.encodeUint8Array(bindings.check_arr_len(our_node_pubkey, 33)), bindings.encodeUint32Array(hops != null ? hops.map(hops_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(hops_conv_12, 33))) : null), route_params == null ? 0n : CommonBase.get_ptr_of(route_params), network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), CommonBase.get_ptr_of(logger), bindings.encodeUint8Array(bindings.check_arr_len(random_seed_bytes, 32)));
const ret_hu_conv: Result_RouteLightningErrorZ = Result_RouteLightningErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, route_params);
CommonBase.add_ref_from(ret_hu_conv, network_graph);
* Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public static constructor_create_phantom_invoice(amt_msat: Option_u64Z, payment_hash: Uint8Array|null, description: string, invoice_expiry_delta_secs: number, phantom_route_hints: PhantomRouteHints[], entropy_source: EntropySource, node_signer: NodeSigner, logger: Logger, network: Currency, min_final_cltv_expiry_delta: Option_u16Z, duration_since_epoch: bigint): Result_InvoiceSignOrCreationErrorZ {
- const ret: bigint = bindings.create_phantom_invoice(CommonBase.get_ptr_of(amt_msat), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeString(description), invoice_expiry_delta_secs, bindings.encodeUint64Array(phantom_route_hints != null ? phantom_route_hints.map(phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0n : CommonBase.get_ptr_of(phantom_route_hints_conv_19)) : null), entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer), logger == null ? 0n : CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(min_final_cltv_expiry_delta), duration_since_epoch);
+ const ret: bigint = bindings.create_phantom_invoice(CommonBase.get_ptr_of(amt_msat), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeString(description), invoice_expiry_delta_secs, bindings.encodeUint64Array(phantom_route_hints != null ? phantom_route_hints.map(phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0n : CommonBase.get_ptr_of(phantom_route_hints_conv_19)) : null), CommonBase.get_ptr_of(entropy_source), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(min_final_cltv_expiry_delta), duration_since_epoch);
const ret_hu_conv: Result_InvoiceSignOrCreationErrorZ = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, amt_msat);
phantom_route_hints.forEach((phantom_route_hints_conv_19: PhantomRouteHints) => { CommonBase.add_ref_from(ret_hu_conv, phantom_route_hints_conv_19); });
* Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public static constructor_create_phantom_invoice_with_description_hash(amt_msat: Option_u64Z, payment_hash: Uint8Array|null, invoice_expiry_delta_secs: number, description_hash: Sha256, phantom_route_hints: PhantomRouteHints[], entropy_source: EntropySource, node_signer: NodeSigner, logger: Logger, network: Currency, min_final_cltv_expiry_delta: Option_u16Z, duration_since_epoch: bigint): Result_InvoiceSignOrCreationErrorZ {
- const ret: bigint = bindings.create_phantom_invoice_with_description_hash(CommonBase.get_ptr_of(amt_msat), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), invoice_expiry_delta_secs, description_hash == null ? 0n : CommonBase.get_ptr_of(description_hash), bindings.encodeUint64Array(phantom_route_hints != null ? phantom_route_hints.map(phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0n : CommonBase.get_ptr_of(phantom_route_hints_conv_19)) : null), entropy_source == null ? 0n : CommonBase.get_ptr_of(entropy_source), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer), logger == null ? 0n : CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(min_final_cltv_expiry_delta), duration_since_epoch);
+ const ret: bigint = bindings.create_phantom_invoice_with_description_hash(CommonBase.get_ptr_of(amt_msat), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), invoice_expiry_delta_secs, description_hash == null ? 0n : CommonBase.get_ptr_of(description_hash), bindings.encodeUint64Array(phantom_route_hints != null ? phantom_route_hints.map(phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0n : CommonBase.get_ptr_of(phantom_route_hints_conv_19)) : null), CommonBase.get_ptr_of(entropy_source), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(min_final_cltv_expiry_delta), duration_since_epoch);
const ret_hu_conv: Result_InvoiceSignOrCreationErrorZ = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, amt_msat);
CommonBase.add_ref_from(ret_hu_conv, description_hash);
* available and the current time is supplied by the caller.
*/
public static constructor_create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager: ChannelManager, node_signer: NodeSigner, logger: Logger, network: Currency, amt_msat: Option_u64Z, description_hash: Sha256, duration_since_epoch: bigint, invoice_expiry_delta_secs: number, min_final_cltv_expiry_delta: Option_u16Z): Result_InvoiceSignOrCreationErrorZ {
- const ret: bigint = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0n : CommonBase.get_ptr_of(channelmanager), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer), logger == null ? 0n : CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(amt_msat), description_hash == null ? 0n : CommonBase.get_ptr_of(description_hash), duration_since_epoch, invoice_expiry_delta_secs, CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
+ const ret: bigint = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0n : CommonBase.get_ptr_of(channelmanager), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(amt_msat), description_hash == null ? 0n : CommonBase.get_ptr_of(description_hash), duration_since_epoch, invoice_expiry_delta_secs, CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
const ret_hu_conv: Result_InvoiceSignOrCreationErrorZ = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, channelmanager);
CommonBase.add_ref_from(ret_hu_conv, node_signer);
* available and the current time is supplied by the caller.
*/
public static constructor_create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager: ChannelManager, node_signer: NodeSigner, logger: Logger, network: Currency, amt_msat: Option_u64Z, description: string, duration_since_epoch: bigint, invoice_expiry_delta_secs: number, min_final_cltv_expiry_delta: Option_u16Z): Result_InvoiceSignOrCreationErrorZ {
- const ret: bigint = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0n : CommonBase.get_ptr_of(channelmanager), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer), logger == null ? 0n : CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(amt_msat), bindings.encodeString(description), duration_since_epoch, invoice_expiry_delta_secs, CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
+ const ret: bigint = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0n : CommonBase.get_ptr_of(channelmanager), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(amt_msat), bindings.encodeString(description), duration_since_epoch, invoice_expiry_delta_secs, CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
const ret_hu_conv: Result_InvoiceSignOrCreationErrorZ = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, channelmanager);
CommonBase.add_ref_from(ret_hu_conv, node_signer);
* the payment hash is also involved outside the scope of lightning.
*/
public static constructor_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager: ChannelManager, node_signer: NodeSigner, logger: Logger, network: Currency, amt_msat: Option_u64Z, description: string, duration_since_epoch: bigint, invoice_expiry_delta_secs: number, payment_hash: Uint8Array, min_final_cltv_expiry_delta: Option_u16Z): Result_InvoiceSignOrCreationErrorZ {
- const ret: bigint = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0n : CommonBase.get_ptr_of(channelmanager), node_signer == null ? 0n : CommonBase.get_ptr_of(node_signer), logger == null ? 0n : CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(amt_msat), bindings.encodeString(description), duration_since_epoch, invoice_expiry_delta_secs, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
+ const ret: bigint = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0n : CommonBase.get_ptr_of(channelmanager), CommonBase.get_ptr_of(node_signer), CommonBase.get_ptr_of(logger), network, CommonBase.get_ptr_of(amt_msat), bindings.encodeString(description), duration_since_epoch, invoice_expiry_delta_secs, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(min_final_cltv_expiry_delta));
const ret_hu_conv: Result_InvoiceSignOrCreationErrorZ = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
CommonBase.add_ref_from(ret_hu_conv, channelmanager);
CommonBase.add_ref_from(ret_hu_conv, node_signer);