]> git.bitcoin.ninja Git - ldk-java/commitdiff
[TS] Update auto-generated bindings
authorMatt Corallo <git@bluematt.me>
Thu, 1 Jun 2023 20:22:45 +0000 (20:22 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 1 Jun 2023 20:23:10 +0000 (20:23 +0000)
40 files changed:
ts/bindings.c
ts/bindings.c.body
ts/bindings.mts
ts/structs/BlindedPath.mts
ts/structs/BuiltCommitmentTransaction.mts
ts/structs/ChainMonitor.mts
ts/structs/ChannelManager.mts
ts/structs/ChannelManagerReadArgs.mts
ts/structs/ChannelMonitor.mts
ts/structs/CustomMessageHandler.mts
ts/structs/CustomOnionMessageHandler.mts
ts/structs/DefaultRouter.mts
ts/structs/EventsProvider.mts
ts/structs/Future.mts
ts/structs/InMemorySigner.mts
ts/structs/LockableScore.mts
ts/structs/MessageHandler.mts
ts/structs/MultiThreadedLockableScore.mts
ts/structs/NetworkGraph.mts
ts/structs/OnionMessageContents.mts
ts/structs/OnionMessenger.mts
ts/structs/Option_CustomOnionMessageContentsZ.mts
ts/structs/Option_FilterZ.mts
ts/structs/Option_ScalarZ.mts
ts/structs/Option_TypeZ.mts
ts/structs/Option_UtxoLookupZ.mts
ts/structs/P2PGossipSync.mts
ts/structs/PeerManager.mts
ts/structs/Persister.mts
ts/structs/ProbabilisticScorer.mts
ts/structs/RapidGossipSync.mts
ts/structs/Result_NetworkGraphDecodeErrorZ.mts
ts/structs/Result_ProbabilisticScorerDecodeErrorZ.mts
ts/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mts
ts/structs/ScorerAccountingForInFlightHtlcs.mts
ts/structs/SignerProvider.mts
ts/structs/TrustedCommitmentTransaction.mts
ts/structs/TwoTuple_BlockHashChannelManagerZ.mts
ts/structs/TwoTuple_PublicKeyTypeZ.mts
ts/structs/UtilMethods.mts

index d357a2cf668acac44524c763517006b199e64d66..3ae6cadeb04bc24a0ded2fb4a66378e7edcdcfb0 100644 (file)
@@ -5920,7 +5920,7 @@ uint64_t  __attribute__((export_name("TS_NodeSigner_ecdh"))) TS_NodeSigner_ecdh(
        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);
@@ -16621,6 +16621,26 @@ void  __attribute__((export_name("TS_COption_ScalarZ_free"))) TS_COption_ScalarZ
        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);
index 13b1d657ea105c56f0fdc2162a8d741a6c236388..87eba6a89a98afe5090e814c25b99824332f9589 100644 (file)
@@ -5918,7 +5918,7 @@ uint64_t  __attribute__((export_name("TS_NodeSigner_ecdh"))) TS_NodeSigner_ecdh(
        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);
@@ -16619,6 +16619,26 @@ void  __attribute__((export_name("TS_COption_ScalarZ_free"))) TS_COption_ScalarZ
        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);
index 00440c9d8a8948ea7a902796058530360704e229..68d39042cf788ef23a309b58fbe4580f932339d8 100644 (file)
@@ -12909,6 +12909,24 @@ export function COption_ScalarZ_free(_res: bigint): void {
        }
        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 */
index 8ae7ec755eaa88eb2f3fc35ad071527172916098..660d8ec26b1d0bbfb0e47f35a26a3b74ad5c1112 100644 (file)
@@ -487,7 +487,7 @@ export class BlindedPath extends CommonBase {
         * 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;
index ae479503473466b3ef8a88655bd57a0d583bf1a4..c1818972e5b87da0ef7fad1755847fcb6ac26036 100644 (file)
@@ -550,7 +550,7 @@ export class BuiltCommitmentTransaction extends CommonBase {
         * 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;
index 21d62917be0cc0777f5c54fbdf4940a1e743a43c..976f7f95831d9e85f312e8c3c316b45778466a30 100644 (file)
@@ -470,7 +470,7 @@ export class ChainMonitor extends CommonBase {
         * 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);
index fffe30efc9b434405685fa8e3e89a4f9678a48de..d2bf80d6b5396d5990acca08ff2496ebffd14f8e 100644 (file)
@@ -514,7 +514,7 @@ export class ChannelManager extends CommonBase {
         * [`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);
index cdabbbf5e587c1e74ba92e84341f93b67e5e83c7..cc327ff334aefa5205e3fedce4deac5445f0205d 100644 (file)
@@ -490,7 +490,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
        }
 
@@ -508,7 +508,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
        }
 
@@ -530,7 +530,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
        }
 
@@ -552,7 +552,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
        }
 
@@ -578,7 +578,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
        }
 
@@ -600,7 +600,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
        }
 
@@ -624,7 +624,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
        }
 
@@ -644,7 +644,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
        }
 
@@ -674,7 +674,7 @@ export class ChannelManagerReadArgs extends CommonBase {
         * 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);
index d91243de7e92346ecac637ae51b9e2219a728ac4..19b048b1f719c37e1daae3c78c2edfbdc3b8e212 100644 (file)
@@ -491,7 +491,7 @@ export class ChannelMonitor extends CommonBase {
         * 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);
@@ -543,7 +543,7 @@ export class ChannelMonitor extends CommonBase {
         * 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);
        }
 
@@ -621,7 +621,7 @@ export class ChannelMonitor extends CommonBase {
         * [`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++) {
@@ -648,7 +648,7 @@ export class ChannelMonitor extends CommonBase {
         * [`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++) {
@@ -669,7 +669,7 @@ export class ChannelMonitor extends CommonBase {
         * 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);
@@ -685,7 +685,7 @@ export class ChannelMonitor extends CommonBase {
         * [`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++) {
@@ -710,7 +710,7 @@ export class ChannelMonitor extends CommonBase {
         * [`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);
@@ -726,7 +726,7 @@ export class ChannelMonitor extends CommonBase {
         * [`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++) {
@@ -778,7 +778,7 @@ export class ChannelMonitor extends CommonBase {
         * 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);
index cfcb5b50edb7d5f7e25c499783d621c11a6efa74..1ef53252daf9315a0adb95c502e354b81a4a4701 100644 (file)
@@ -513,7 +513,7 @@ export class CustomMessageHandler extends CommonBase {
         * 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;
index d1ed2219be06343c80d888970b9999d889743c68..d75cf8961a5de2484377240786c2151e3c8383e6 100644 (file)
@@ -506,7 +506,7 @@ export class CustomOnionMessageHandler extends CommonBase {
         * 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);
        }
 
index 9588fc8262a767240cad3a8215dcc1abe2fb786a..d6fbb65b94ca6c03a83e050b7c41096dcdb8fe83 100644 (file)
@@ -449,7 +449,7 @@ export class DefaultRouter extends CommonBase {
         * 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);
index 9ae7274f0037a26e587745ccedb0479ad523e6d1..70765c6eb5c82e4c219e9a7cda591e6c822ebc34 100644 (file)
@@ -526,7 +526,7 @@ export class EventsProvider extends CommonBase {
         * 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);
        }
 
index ea757c6802625212798736cafb5e4780c15f8ea5..2543184fed70d3548b9883ac35e54758e26e622c 100644 (file)
@@ -467,7 +467,7 @@ export class Future extends CommonBase {
         * 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);
        }
 
index 8df8e9b8b0ff92793e2a1bd813f270695b10fe93..1553dc707b1f4ebf3ca8a0f37a0b2b4027e3e9e5 100644 (file)
@@ -745,7 +745,7 @@ export class InMemorySigner extends CommonBase {
         * 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;
index 2c952672b15998dc6a9ee7430dfdc1f158da28ed..7d39a67c05c7c33975e3d8cdafc9fc98ff3ce45d 100644 (file)
@@ -478,7 +478,7 @@ export class LockableScore extends CommonBase {
                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;
                        },
index 70dfcc072576612961850d8647edb1ee0b6174f9..194f296f465c77190f7262220aa612d40a65e844 100644 (file)
@@ -465,7 +465,7 @@ export class MessageHandler extends CommonBase {
         * [`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);
        }
 
@@ -489,7 +489,7 @@ export class MessageHandler extends CommonBase {
         * [`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);
        }
 
@@ -509,7 +509,7 @@ export class MessageHandler extends CommonBase {
         * [`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);
        }
 
@@ -517,7 +517,7 @@ export class MessageHandler extends CommonBase {
         * 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);
index 3f282a5690cba68499069543cfd7f14667d9802d..9d78ecab11b9ea99c7386d99329313b0a9c13cd8 100644 (file)
@@ -480,7 +480,7 @@ export class MultiThreadedLockableScore extends CommonBase {
         * 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);
index f4cb414d763aa63e80d52e9a29ead30889477830..021d2a281349b7cb05c671e99dabb52ee9e1e2c7 100644 (file)
@@ -467,7 +467,7 @@ export class NetworkGraph extends CommonBase {
         * 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;
@@ -477,7 +477,7 @@ export class NetworkGraph extends CommonBase {
         * 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);
index 81b404175dcdb621ae39acfc0d8977b4ac83accc..d146a183c08a1aafec2041dfc168ae7ddbc71e7d 100644 (file)
@@ -470,7 +470,7 @@ export class OnionMessageContents extends CommonBase {
         * 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);
index d39533ade4abac9c529767ca977be81a08df4066..75872a8d13ea0067fe8417f437b6500d7844e611 100644 (file)
@@ -522,7 +522,7 @@ export class OnionMessenger extends CommonBase {
         * 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);
index 5792d75c01ff30680ea5b630cf6c610ab8eee2c4..afc6b9829d2d849ece24b820eb05113f90859811 100644 (file)
@@ -455,7 +455,7 @@ export class Option_CustomOnionMessageContentsZ extends CommonBase {
         * 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);
index d3a05cab1f59757165867bb743b68bc0cc2a5c56..15868a50df2a2ce1a5b2900889f95db28e4e68b6 100644 (file)
@@ -455,7 +455,7 @@ export class Option_FilterZ extends CommonBase {
         * 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);
index 0d62930b4c390694c2a5094ce724cb7bc9b46cd9..921f6f0084f08b53ffab8c6085ba0d0c91495e92 100644 (file)
@@ -472,6 +472,22 @@ export class Option_ScalarZ extends CommonBase {
                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 {
index c2d20648de59032622533b27812fdc12bbf86c7d..f7e0fcf33538bed4845e5ba160015354481ceb7b 100644 (file)
@@ -455,7 +455,7 @@ export class Option_TypeZ extends CommonBase {
         * 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);
index eab1f8c39b1156194100b328277ad4325dba0f89..83ca6d1234e84dd5b3a744a15d90e05c77e526ee 100644 (file)
@@ -455,7 +455,7 @@ export class Option_UtxoLookupZ extends CommonBase {
         * 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);
index 2e980a11245bc969156610073a0027d6050986b1..362415d8e4dfd1570d7b51c8c2eb85b470b33db6 100644 (file)
@@ -456,7 +456,7 @@ export class P2PGossipSync extends CommonBase {
         * 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);
index 03ca6ad901a1bd566b5ee0dd2e46fa2dd163e967..d04377630bdc986d0c98bfbac92910c540d299f1 100644 (file)
@@ -475,7 +475,7 @@ export class PeerManager extends CommonBase {
         * 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);
@@ -531,7 +531,7 @@ export class PeerManager extends CommonBase {
         * [`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);
@@ -556,7 +556,7 @@ export class PeerManager extends CommonBase {
         * [`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);
@@ -578,7 +578,7 @@ export class PeerManager extends CommonBase {
         * [`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;
        }
@@ -603,7 +603,7 @@ export class PeerManager extends CommonBase {
         * [`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;
        }
@@ -635,7 +635,7 @@ export class PeerManager extends CommonBase {
         * 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));
        }
 
        /**
index 9614d0f99f60d0e0aecc2313c74282bdfb8eaa61..dac356b41bed669dc958ad67343107f40c7c25e0 100644 (file)
@@ -527,7 +527,7 @@ export class Persister extends CommonBase {
         * 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;
index c82b2f46a719d4178508448c69c60239d6d40916..19697dab48d3039e843cde060885eb298b3e4c68 100644 (file)
@@ -485,7 +485,7 @@ export class ProbabilisticScorer extends CommonBase {
         * 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);
@@ -611,7 +611,7 @@ export class ProbabilisticScorer extends CommonBase {
         * 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);
index 6f17e760c90faf1b3f387bd19d7bdeaa63caef32..974df8a7cadedc80c639ae6ee8e8640fa3242f5b 100644 (file)
@@ -453,7 +453,7 @@ export class RapidGossipSync extends CommonBase {
         * 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);
index af3f33436ec4025a844e2be58bcdbfefe866603d..654a061370c185cd89e2cab031bbf216566b3ed3 100644 (file)
@@ -453,7 +453,7 @@ export class Result_NetworkGraphDecodeErrorZ extends CommonBase {
         * 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;
index 294fa36585c9153b5d3bdd45fa5f4c5638af4d48..077864a98e887f26605617d1c5c21b7aa3afe9a5 100644 (file)
@@ -453,7 +453,7 @@ export class Result_ProbabilisticScorerDecodeErrorZ extends CommonBase {
         * 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);
index 578664788d395c003a5572fd9bee0fa9e30ac08f..727c8a43f43647f504804e14d5858ce930ca3c4a 100644 (file)
@@ -453,7 +453,7 @@ export class Result_WriteableEcdsaChannelSignerDecodeErrorZ extends CommonBase {
         * 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;
index 5342e118245e84fc5a53529313fbb89f17a4a11e..7d07123fe66ea466f3b6c27659a8a7da12bc5c27 100644 (file)
@@ -454,7 +454,7 @@ export class ScorerAccountingForInFlightHtlcs extends CommonBase {
         * 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);
index 589265bf341d16beaa3f9cea5bc42d86bec1fba5..bef7d721932905219022a63c02b313b893bc7718 100644 (file)
@@ -518,7 +518,7 @@ export class SignerProvider extends CommonBase {
                        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;
                        },
index c82844c317d9fe042985c2f279ea92bb91a9325f..11d024c6e6637c0bbbc8bc0075818e7e836143d0 100644 (file)
@@ -496,7 +496,7 @@ export class TrustedCommitmentTransaction extends CommonBase {
         * 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);
index 04087c1a2f22fcc3a9c4c803c6273ac0c2961c3c..2bf55516a9195602dfe905fca0db7d9a933f2fd2 100644 (file)
@@ -468,7 +468,7 @@ export class TwoTuple_BlockHashChannelManagerZ extends CommonBase {
         * 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);
index 7d0f6e5509dd929817499db9ab238a3af9b8f37b..749fc6a4c33ec2fa9fef66d00426e264155bff7d 100644 (file)
@@ -484,7 +484,7 @@ export class TwoTuple_PublicKeyTypeZ extends CommonBase {
         * 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);
index 65a395af1a225b7d611c8dd16b685445faf72ad7..8221663466aa76cf95d97205b3e35ddef4766c5b 100644 (file)
@@ -532,7 +532,7 @@ export class UtilMethods extends CommonBase {
         * 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);
@@ -555,7 +555,7 @@ export class UtilMethods extends CommonBase {
         * 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);
@@ -588,7 +588,7 @@ export class UtilMethods extends CommonBase {
         * [`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);
@@ -861,7 +861,7 @@ export class UtilMethods extends CommonBase {
         * 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);
@@ -878,7 +878,7 @@ export class UtilMethods extends CommonBase {
         * 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);
@@ -1047,7 +1047,7 @@ export class UtilMethods extends CommonBase {
         * 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); });
@@ -1099,7 +1099,7 @@ export class UtilMethods extends CommonBase {
         * 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);
@@ -1117,7 +1117,7 @@ export class UtilMethods extends CommonBase {
         * 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);
@@ -1134,7 +1134,7 @@ export class UtilMethods extends CommonBase {
         * 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);
@@ -1151,7 +1151,7 @@ export class UtilMethods extends CommonBase {
         * 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);